From owner-svn-src-all@FreeBSD.ORG Sun Nov 13 00:10:49 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E6A93106566C; Sun, 13 Nov 2011 00:10:49 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 0B5AF8FC08; Sun, 13 Nov 2011 00:10:48 +0000 (UTC) Received: by bkbzs8 with SMTP id zs8so6358278bkb.13 for ; Sat, 12 Nov 2011 16:10:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=AP8CEcH7ZDAE0LTne8jXxHfHa7a1uGBTQxdChPbPZiE=; b=QItZ2jzpCL7rPHAakHfxKyq9mwztkYPgpgSDMVhxeKIeA+MLb/5QKyWRPutQaZvPQZ Bl/LK7pAMtuuqqYRlPgATUIO17pTEbYTn294Clnois10e3T+C2TmLtiRZ8MY04eEgeeo XqtH80aoRw9Aeu4mzG4MNuJOemb+JU9q/XfVQ= Received: by 10.204.143.148 with SMTP id v20mr5742342bku.104.1321143047769; Sat, 12 Nov 2011 16:10:47 -0800 (PST) Received: from mavbook2.mavhome.dp.ua (pc.mavhome.dp.ua. [212.86.226.226]) by mx.google.com with ESMTPS id m12sm11444429bkg.14.2011.11.12.16.10.46 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 12 Nov 2011 16:10:46 -0800 (PST) Sender: Alexander Motin Message-ID: <4EBF0B04.40604@FreeBSD.org> Date: Sun, 13 Nov 2011 02:10:44 +0200 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:7.0.1) Gecko/20111003 Thunderbird/7.0.1 MIME-Version: 1.0 To: Marius Strobl References: <201111012312.pA1NCNuY089112@svn.freebsd.org> <20111112210900.GJ56603@alchemy.franken.de> In-Reply-To: <20111112210900.GJ56603@alchemy.franken.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r227009 - head/sys/geom X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Nov 2011 00:10:50 -0000 On 11/12/11 23:09, Marius Strobl wrote: > On Tue, Nov 01, 2011 at 11:12:23PM +0000, Alexander Motin wrote: >> Author: mav >> Date: Tue Nov 1 23:12:22 2011 >> New Revision: 227009 >> URL: http://svn.freebsd.org/changeset/base/227009 >> >> Log: >> Make orphan() method in geom_dev asynchronous using destroy_dev_sched_cb() >> instead of destroy_dev(). It moves device destruction waiting out of the >> topology lock and so fixes dead lock between orphanization and closing. >> Real provider and geom destruction called from swi context after device >> destroyed as callback of the destroy_dev_sched_cb(). >> > > This change causes fsck_ffs(8) and mount(8) to hang unkillably on > sparc64 when the kernel is built with either GEOM_PART_GPT or > GEOM_LABEL. When breaking into the kernel the backtrace so far > looked like one of these two ways: > g_wither_washer() at g_wither_washer+0x18 > g_run_events() at g_run_events+0x4dc > g_event_procbody() at g_event_procbody+0x8c > fork_exit() at fork_exit+0x9c > fork_trampoline() at fork_trampoline+0x8 > > find_instance() at find_instance+0x80 > _sx_xlock() at _sx_xlock+0xf0 > g_run_events() at g_run_events+0xb0 > g_event_procbody() at g_event_procbody+0x8c > fork_exit() at fork_exit+0x9c > fork_trampoline() at fork_trampoline+0x8 > > I've no clue about geom(4) so I also have no idea how to debug this. I think `show alllocks` in debugger and backtraces of related threads could be useful. -- Alexander Motin From owner-svn-src-all@FreeBSD.ORG Sun Nov 13 00:24:02 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 656C1106564A for ; Sun, 13 Nov 2011 00:24:02 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from glenbarber.us (onyx.glenbarber.us [199.48.134.227]) by mx1.freebsd.org (Postfix) with SMTP id 2AF8B8FC18 for ; Sun, 13 Nov 2011 00:24:01 +0000 (UTC) Received: (qmail 79443 invoked by uid 0); 12 Nov 2011 18:57:19 -0500 Received: from unknown (HELO schism.local) (gjb@76.124.49.145) by 0 with SMTP; 12 Nov 2011 18:57:19 -0500 Message-ID: <4EBF07D9.1010004@FreeBSD.org> Date: Sat, 12 Nov 2011 18:57:13 -0500 From: Glen Barber User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 To: Christian Brueffer References: <201111121030.pACAUFho037307@svn.freebsd.org> In-Reply-To: <201111121030.pACAUFho037307@svn.freebsd.org> X-Enigmail-Version: 1.3.3 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enig78B8774DB91B5BD952BC0970" Cc: svn-src-all@freebsd.org, World Wide Web Owner Subject: Re: svn commit: r227466 - head/release/doc/en_US.ISO8859-1/hardware X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Nov 2011 00:24:02 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig78B8774DB91B5BD952BC0970 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Christian, On 11/12/11 5:30 AM, Christian Brueffer wrote: > Author: brueffer > Date: Sat Nov 12 10:30:14 2011 > New Revision: 227466 > URL: http://svn.freebsd.org/changeset/base/227466 >=20 > Log: > Added mps(4) and mvs(4). > =20 > MFC after: 3 days >=20 > Modified: > head/release/doc/en_US.ISO8859-1/hardware/article.sgml >=20 > Modified: head/release/doc/en_US.ISO8859-1/hardware/article.sgml > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/release/doc/en_US.ISO8859-1/hardware/article.sgml Sat Nov 12 1= 0:17:23 2011 (r227465) > +++ head/release/doc/en_US.ISO8859-1/hardware/article.sgml Sat Nov 12 1= 0:30:14 2011 (r227466) > @@ -798,8 +798,12 @@ > =20 > &hwlist.mly; > =20 > + &hwlist.mps; > + > &hwlist.mpt; > =20 > + &hwlist.mvs; > + > &hwlist.ncr; > =20 > &hwlist.ncv; I may revert this commit temporarily to unbreak the web build with release notes. There are two differnet problems here. - mvs(4) - uses nested '.Bl' tags in the HARDWARE section, which seems to make man2hwnotes.pl unhappy. I've done some reformatting of the mvs(4) manual locally, to get past that problem. - mps(4) - I'm still not sure what is causing this man page to break the build. Regards, Glen --=20 Glen Barber | gjb@FreeBSD.org FreeBSD Documentation Project --------------enig78B8774DB91B5BD952BC0970 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.11 (Darwin) iQEcBAEBCAAGBQJOvwffAAoJEFJPDDeguUajVV0IALRrj6OwmYowtgSbm400vUQw T2JgHLZn9YVw4Pe2Mr3h6WTO4MYSuWALNxLUCORmSmByFTj8RQpMXjxaTnvTtbaF 1Sn4ohTAQEz3lE8f+0ogUnZE6JVWIB9Kjy3nW8MWEe5nzEDA1xVR95mP/WylFNzB cjDewXVVeT9pO0bqi5xGNZwZeObOhQMjhOSRLeUF5B1j8XsWYhbtIyunIkTO3hlO KCEhOUmOZvJyYpH5Xo/NZOkBBDVZF5szDPSx5Gq4O17qzpE+ctzgFTrZRFfpZfu9 XlVOosybPIkoYKR0yy5Vv/k7jC7RJ/G4/2Fm7iGAZdWA3cvMRYb1peocSYMEtJU= =7+3R -----END PGP SIGNATURE----- --------------enig78B8774DB91B5BD952BC0970-- From owner-svn-src-all@FreeBSD.ORG Sun Nov 13 01:03:30 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B82E0106564A; Sun, 13 Nov 2011 01:03:30 +0000 (UTC) (envelope-from benlaurie@gmail.com) Received: from mail-vx0-f182.google.com (mail-vx0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id 348228FC0C; Sun, 13 Nov 2011 01:03:30 +0000 (UTC) Received: by vcbfo14 with SMTP id fo14so6306318vcb.13 for ; Sat, 12 Nov 2011 17:03:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=WBsDetVpP5nOKQICrGb4ma5VmOCZC1HeZZDv9sxs/HU=; b=xZUdMbCoSi/UGtL+lKC+2RKXyzqOAk0l13DrgwqAkrSWRT553I7H6bE9wqXOoD3mzg u6RLWeo98Qe9h648oaGbVi+dbvOJ+OyxabNJgcN/EPIw/IqrUwv6AloePYjn2kavn1Bo fkh2dZ5t3sPoNjC1cCBOCwBkhxQUAejd0iefA= MIME-Version: 1.0 Received: by 10.52.112.74 with SMTP id io10mr28087178vdb.116.1321144416362; Sat, 12 Nov 2011 16:33:36 -0800 (PST) Sender: benlaurie@gmail.com Received: by 10.52.114.102 with HTTP; Sat, 12 Nov 2011 16:33:36 -0800 (PST) In-Reply-To: <201111112257.pABMvqjl012442@svn.freebsd.org> References: <201111112257.pABMvqjl012442@svn.freebsd.org> Date: Sat, 12 Nov 2011 16:33:36 -0800 X-Google-Sender-Auth: KgqDDQDKmTwO0iaSUuH-7yDRPn4 Message-ID: From: Ben Laurie To: Brooks Davis Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r227459 - in head/sys: dev/lmc net netgraph netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Nov 2011 01:03:30 -0000 On Fri, Nov 11, 2011 at 2:57 PM, Brooks Davis wrote: > Author: brooks > Date: Fri Nov 11 22:57:52 2011 > New Revision: 227459 > URL: http://svn.freebsd.org/changeset/base/227459 > > Log: > =A0In r191367 the need for if_free_type() was removed and a new member > =A0if_alloctype was used to store the origional interface type. =A0Take > =A0advantage of this change by removing all existing uses of if_free_type= () > =A0in favor of if_free(). Just an observation: this change removes an annotation that could be useful for correctness checking. Do we care? > > =A0MFC after: =A0 =A01 Month > > Modified: > =A0head/sys/dev/lmc/if_lmc.c > =A0head/sys/net/if_bridge.c > =A0head/sys/net/if_lagg.c > =A0head/sys/net/if_tap.c > =A0head/sys/net/if_vlan.c > =A0head/sys/netgraph/ng_fec.c > =A0head/sys/netinet/ip_carp.c > > Modified: head/sys/dev/lmc/if_lmc.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/lmc/if_lmc.c =A0 Fri Nov 11 22:27:09 2011 =A0 =A0 =A0 = =A0(r227458) > +++ head/sys/dev/lmc/if_lmc.c =A0 Fri Nov 11 22:57:52 2011 =A0 =A0 =A0 = =A0(r227459) > @@ -4945,7 +4945,9 @@ lmc_ifnet_detach(softc_t *sc) > =A0 /* Detach from the ifnet kernel interface. */ > =A0 if_detach(sc->ifp); > > -# if (__FreeBSD_version >=3D 600000) > +# if (defined(__FreeBSD__) && __FreeBSD_version >=3D 800082) > + =A0if_free(sc->ifp); > +# elif (defined(__FreeBSD__) && __FreeBSD_version >=3D 600000) > =A0 if_free_type(sc->ifp, NSPPP ? IFT_PPP : IFT_OTHER); > =A0# endif > =A0 } > > Modified: head/sys/net/if_bridge.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/net/if_bridge.c =A0 =A0Fri Nov 11 22:27:09 2011 =A0 =A0 =A0 = =A0(r227458) > +++ head/sys/net/if_bridge.c =A0 =A0Fri Nov 11 22:57:52 2011 =A0 =A0 =A0 = =A0(r227459) > @@ -676,7 +676,7 @@ bridge_clone_destroy(struct ifnet *ifp) > > =A0 =A0 =A0 =A0bstp_detach(&sc->sc_stp); > =A0 =A0 =A0 =A0ether_ifdetach(ifp); > - =A0 =A0 =A0 if_free_type(ifp, IFT_ETHER); > + =A0 =A0 =A0 if_free(ifp); > > =A0 =A0 =A0 =A0/* Tear down the routing table. */ > =A0 =A0 =A0 =A0bridge_rtable_fini(sc); > > Modified: head/sys/net/if_lagg.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/net/if_lagg.c =A0 =A0 =A0Fri Nov 11 22:27:09 2011 =A0 =A0 = =A0 =A0(r227458) > +++ head/sys/net/if_lagg.c =A0 =A0 =A0Fri Nov 11 22:57:52 2011 =A0 =A0 = =A0 =A0(r227459) > @@ -275,7 +275,7 @@ lagg_clone_create(struct if_clone *ifc, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (lagg_protos[i].ti_proto =3D=3D LAGG_PR= OTO_DEFAULT) { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0sc->sc_proto =3D lagg_prot= os[i].ti_proto; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if ((error =3D lagg_protos= [i].ti_attach(sc)) !=3D 0) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if_free_typ= e(ifp, IFT_ETHER); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if_free(ifp= ); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0free(sc, M= _DEVBUF); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return (er= ror); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} > @@ -293,7 +293,6 @@ lagg_clone_create(struct if_clone *ifc, > =A0 =A0 =A0 =A0ifmedia_set(&sc->sc_media, IFM_ETHER | IFM_AUTO); > > =A0 =A0 =A0 =A0if_initname(ifp, ifc->ifc_name, unit); > - =A0 =A0 =A0 ifp->if_type =3D IFT_ETHER; > =A0 =A0 =A0 =A0ifp->if_softc =3D sc; > =A0 =A0 =A0 =A0ifp->if_start =3D lagg_start; > =A0 =A0 =A0 =A0ifp->if_init =3D lagg_init; > @@ -305,7 +304,7 @@ lagg_clone_create(struct if_clone *ifc, > =A0 =A0 =A0 =A0IFQ_SET_READY(&ifp->if_snd); > > =A0 =A0 =A0 =A0/* > - =A0 =A0 =A0 =A0* Attach as an ordinary ethernet device, childs will be = attached > + =A0 =A0 =A0 =A0* Attach as an ordinary ethernet device, children will b= e attached > =A0 =A0 =A0 =A0 * as special device IFT_IEEE8023ADLAG. > =A0 =A0 =A0 =A0 */ > =A0 =A0 =A0 =A0ether_ifattach(ifp, eaddr); > @@ -352,7 +351,7 @@ lagg_clone_destroy(struct ifnet *ifp) > > =A0 =A0 =A0 =A0ifmedia_removeall(&sc->sc_media); > =A0 =A0 =A0 =A0ether_ifdetach(ifp); > - =A0 =A0 =A0 if_free_type(ifp, IFT_ETHER); > + =A0 =A0 =A0 if_free(ifp); > > =A0 =A0 =A0 =A0mtx_lock(&lagg_list_mtx); > =A0 =A0 =A0 =A0SLIST_REMOVE(&lagg_list, sc, lagg_softc, sc_entries); > > Modified: head/sys/net/if_tap.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/net/if_tap.c =A0 =A0 =A0 Fri Nov 11 22:27:09 2011 =A0 =A0 = =A0 =A0(r227458) > +++ head/sys/net/if_tap.c =A0 =A0 =A0 Fri Nov 11 22:57:52 2011 =A0 =A0 = =A0 =A0(r227459) > @@ -218,7 +218,7 @@ tap_destroy(struct tap_softc *tp) > =A0 =A0 =A0 =A0knlist_destroy(&tp->tap_rsel.si_note); > =A0 =A0 =A0 =A0destroy_dev(tp->tap_dev); > =A0 =A0 =A0 =A0ether_ifdetach(ifp); > - =A0 =A0 =A0 if_free_type(ifp, IFT_ETHER); > + =A0 =A0 =A0 if_free(ifp); > > =A0 =A0 =A0 =A0mtx_destroy(&tp->tap_mtx); > =A0 =A0 =A0 =A0free(tp, M_TAP); > > Modified: head/sys/net/if_vlan.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/net/if_vlan.c =A0 =A0 =A0Fri Nov 11 22:27:09 2011 =A0 =A0 = =A0 =A0(r227458) > +++ head/sys/net/if_vlan.c =A0 =A0 =A0Fri Nov 11 22:57:52 2011 =A0 =A0 = =A0 =A0(r227459) > @@ -967,7 +967,7 @@ vlan_clone_create(struct if_clone *ifc, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 */ > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0ether_ifdetach(ifp); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0vlan_unconfig(ifp); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if_free_type(ifp, IFT_ETHER= ); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if_free(ifp); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0ifc_free_unit(ifc, unit); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0free(ifv, M_VLAN); > > @@ -989,7 +989,7 @@ vlan_clone_destroy(struct if_clone *ifc, > > =A0 =A0 =A0 =A0ether_ifdetach(ifp); =A0 =A0/* first, remove it from syste= m-wide lists */ > =A0 =A0 =A0 =A0vlan_unconfig(ifp); =A0 =A0 /* now it can be unconfigured = and freed */ > - =A0 =A0 =A0 if_free_type(ifp, IFT_ETHER); > + =A0 =A0 =A0 if_free(ifp); > =A0 =A0 =A0 =A0free(ifv, M_VLAN); > =A0 =A0 =A0 =A0ifc_free_unit(ifc, unit); > > > Modified: head/sys/netgraph/ng_fec.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/netgraph/ng_fec.c =A0Fri Nov 11 22:27:09 2011 =A0 =A0 =A0 = =A0(r227458) > +++ head/sys/netgraph/ng_fec.c =A0Fri Nov 11 22:57:52 2011 =A0 =A0 =A0 = =A0(r227459) > @@ -1332,7 +1332,7 @@ ng_fec_shutdown(node_p node) > =A0 =A0 =A0 =A0} > > =A0 =A0 =A0 =A0ether_ifdetach(priv->ifp); > - =A0 =A0 =A0 if_free_type(priv->ifp, IFT_ETHER); > + =A0 =A0 =A0 if_free(priv->ifp); > =A0 =A0 =A0 =A0ifmedia_removeall(&priv->ifmedia); > =A0 =A0 =A0 =A0ng_fec_free_unit(priv->unit); > =A0 =A0 =A0 =A0free(priv, M_NETGRAPH); > > Modified: head/sys/netinet/ip_carp.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/netinet/ip_carp.c =A0Fri Nov 11 22:27:09 2011 =A0 =A0 =A0 = =A0(r227458) > +++ head/sys/netinet/ip_carp.c =A0Fri Nov 11 22:57:52 2011 =A0 =A0 =A0 = =A0(r227459) > @@ -472,7 +472,7 @@ carp_clone_destroy(struct ifnet *ifp) > =A0 =A0 =A0 =A0mtx_unlock(&carp_mtx); > =A0 =A0 =A0 =A0bpfdetach(ifp); > =A0 =A0 =A0 =A0if_detach(ifp); > - =A0 =A0 =A0 if_free_type(ifp, IFT_ETHER); > + =A0 =A0 =A0 if_free(ifp); > =A0#ifdef INET > =A0 =A0 =A0 =A0free(sc->sc_imo.imo_membership, M_CARP); > =A0#endif > From owner-svn-src-all@FreeBSD.ORG Sun Nov 13 01:47:31 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 684E6106566C; Sun, 13 Nov 2011 01:47:31 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 585C68FC08; Sun, 13 Nov 2011 01:47:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAD1lVWe070554; Sun, 13 Nov 2011 01:47:31 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAD1lVXc070552; Sun, 13 Nov 2011 01:47:31 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201111130147.pAD1lVXc070552@svn.freebsd.org> From: Glen Barber Date: Sun, 13 Nov 2011 01:47:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227480 - head/release/doc/en_US.ISO8859-1/hardware X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Nov 2011 01:47:31 -0000 Author: gjb (doc committer) Date: Sun Nov 13 01:47:31 2011 New Revision: 227480 URL: http://svn.freebsd.org/changeset/base/227480 Log: Revert 227466: - mvs.4 uses nested '.Bl' tags which appears to confuse man2hwnotes.pl for hardware note generation - mps.4 also breaks the build, but I haven't yet identified why Modified: head/release/doc/en_US.ISO8859-1/hardware/article.sgml Modified: head/release/doc/en_US.ISO8859-1/hardware/article.sgml ============================================================================== --- head/release/doc/en_US.ISO8859-1/hardware/article.sgml Sat Nov 12 23:30:57 2011 (r227479) +++ head/release/doc/en_US.ISO8859-1/hardware/article.sgml Sun Nov 13 01:47:31 2011 (r227480) @@ -798,12 +798,8 @@ &hwlist.mly; - &hwlist.mps; - &hwlist.mpt; - &hwlist.mvs; - &hwlist.ncr; &hwlist.ncv; From owner-svn-src-all@FreeBSD.ORG Sun Nov 13 02:32:10 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E5F1A1065673; Sun, 13 Nov 2011 02:32:10 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D67B48FC0C; Sun, 13 Nov 2011 02:32:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAD2WAQZ072371; Sun, 13 Nov 2011 02:32:10 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAD2WAGM072369; Sun, 13 Nov 2011 02:32:10 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201111130232.pAD2WAGM072369@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 13 Nov 2011 02:32:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227481 - head/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Nov 2011 02:32:11 -0000 Author: bz Date: Sun Nov 13 02:32:10 2011 New Revision: 227481 URL: http://svn.freebsd.org/changeset/base/227481 Log: Return the correct value for the IPV6_MULTICAST_HOPS getsockopt() call. Submitted by: rpaulo MFC after: 3 days Modified: head/sys/netinet6/in6_mcast.c Modified: head/sys/netinet6/in6_mcast.c ============================================================================== --- head/sys/netinet6/in6_mcast.c Sun Nov 13 01:47:31 2011 (r227480) +++ head/sys/netinet6/in6_mcast.c Sun Nov 13 02:32:10 2011 (r227481) @@ -1714,7 +1714,7 @@ ip6_getmoptions(struct inpcb *inp, struc if (im6o == NULL) optval = V_ip6_defmcasthlim; else - optval = im6o->im6o_multicast_loop; + optval = im6o->im6o_multicast_hlim; INP_WUNLOCK(inp); error = sooptcopyout(sopt, &optval, sizeof(u_int)); break; From owner-svn-src-all@FreeBSD.ORG Sun Nov 13 03:01:59 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 644C71065675; Sun, 13 Nov 2011 03:01:59 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3B4998FC12; Sun, 13 Nov 2011 03:01:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAD31xjZ073445; Sun, 13 Nov 2011 03:01:59 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAD31xYK073443; Sun, 13 Nov 2011 03:01:59 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201111130301.pAD31xYK073443@svn.freebsd.org> From: Doug Barton Date: Sun, 13 Nov 2011 03:01:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227482 - head/etc/periodic/daily X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Nov 2011 03:01:59 -0000 Author: dougb Date: Sun Nov 13 03:01:58 2011 New Revision: 227482 URL: http://svn.freebsd.org/changeset/base/227482 Log: The default setting, daily_accounting_compress="NO", was causing only 1 old file to be saved, so fix this. Problem raised in the PR, but actually required a different solution. While I'm here, fix a very old off-by-one error causing 1 more file than specified in daily_accounting_save to be saved because acct.0 was not taken into account (pun intended). Change that, and use a more thorough method of finding old files to delete. Partly just because this is the right thing to do, but also to silently fix the extra log that would have been left behind forever with the previous method. PR: conf/160848 Submitted by: Andrey Zonov Modified: head/etc/periodic/daily/310.accounting Modified: head/etc/periodic/daily/310.accounting ============================================================================== --- head/etc/periodic/daily/310.accounting Sun Nov 13 02:32:10 2011 (r227481) +++ head/etc/periodic/daily/310.accounting Sun Nov 13 03:01:58 2011 (r227482) @@ -30,8 +30,13 @@ case "$daily_accounting_enable" in cd /var/account rc=0 - n=$daily_accounting_save - rm -f acct.$n.gz acct.$n || rc=3 + n=$(( $daily_accounting_save - 1 )) + for f in acct.*; do + case "$f" in acct.\*) continue ;; esac # No files match + m=${f%.gz} ; m=${m#acct.} + [ $m -ge $n ] && { rm $f || rc=3; } + done + m=$n n=$(($n - 1)) while [ $n -ge 0 ] @@ -44,13 +49,14 @@ case "$daily_accounting_enable" in /etc/rc.d/accounting rotate_log || rc=3 + rm -f acct.merge && cp acct.0 acct.merge || rc=3 + sa -s $daily_accounting_flags /var/account/acct.merge || rc=3 + rm acct.merge + case "$daily_accounting_compress" in [Yy][Ee][Ss]) - gzip --keep -f acct.0 || rc=3;; + gzip -f acct.0 || rc=3;; esac - - sa -s $daily_accounting_flags /var/account/acct.0 && - unlink acct.0 || rc=3 fi;; *) rc=0;; From owner-svn-src-all@FreeBSD.ORG Sun Nov 13 03:18:58 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 61AE31065672; Sun, 13 Nov 2011 03:18:58 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1892C8FC12; Sun, 13 Nov 2011 03:18:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAD3IvDO074146; Sun, 13 Nov 2011 03:18:57 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAD3IvGr074144; Sun, 13 Nov 2011 03:18:57 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201111130318.pAD3IvGr074144@svn.freebsd.org> From: Alfred Perlstein Date: Sun, 13 Nov 2011 03:18:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227483 - head/usr.sbin/portsnap/portsnap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Nov 2011 03:18:58 -0000 Author: alfred Date: Sun Nov 13 03:18:57 2011 New Revision: 227483 URL: http://svn.freebsd.org/changeset/base/227483 Log: Utilize shell's IFS instead of forking ~6 processes to handle splitting input files on a '|'. This greatly reduces the time taken to process several databases during the update process. Additionally add some more debug logging. Modified: head/usr.sbin/portsnap/portsnap/portsnap.sh Modified: head/usr.sbin/portsnap/portsnap/portsnap.sh ============================================================================== --- head/usr.sbin/portsnap/portsnap/portsnap.sh Sun Nov 13 03:01:58 2011 (r227482) +++ head/usr.sbin/portsnap/portsnap/portsnap.sh Sun Nov 13 03:18:57 2011 (r227483) @@ -570,14 +570,16 @@ fetch_metadata_sanity() { # Take a list of ${oldhash}|${newhash} and output a list of needed patches fetch_make_patchlist() { - grep -vE "^([0-9a-f]{64})\|\1$" | - while read LINE; do - X=`echo ${LINE} | cut -f 1 -d '|'` - Y=`echo ${LINE} | cut -f 2 -d '|'` - if [ -f "files/${Y}.gz" ]; then continue; fi - if [ ! -f "files/${X}.gz" ]; then continue; fi - echo "${LINE}" + IFS='|' + echo "" 1>${QUIETREDIR} + grep -vE "^([0-9a-f]{64})\|\1$" | + while read X Y; do + printf "Processing: $X $Y ...\r" 1>${QUIETREDIR} + if [ -f "files/${Y}.gz" -o ! -f "files/${X}.gz" ]; then continue; fi + echo "${X}|${Y}" done + echo "" 1>${QUIETREDIR} + IFS= } # Print user-friendly progress statistics @@ -692,9 +694,8 @@ fetch_update() { # Attempt to apply metadata patches echo -n "Applying metadata patches... " - while read LINE; do - X=`echo ${LINE} | cut -f 1 -d '|'` - Y=`echo ${LINE} | cut -f 2 -d '|'` + IFS='|' + while read X Y; do if [ ! -f "${X}-${Y}.gz" ]; then continue; fi gunzip -c < ${X}-${Y}.gz > diff gunzip -c < files/${X}.gz > OLD @@ -707,6 +708,7 @@ fetch_update() { fi rm -f diff OLD NEW ${X}-${Y}.gz ptmp done < patchlist 2>${QUIETREDIR} + IFS= echo "done." # Update metadata without patches @@ -724,16 +726,19 @@ fetch_update() { 2>${QUIETREDIR} while read Y; do + echo -n "Verifying ${Y}... " 1>${QUIETREDIR} if [ `gunzip -c < ${Y}.gz | ${SHA256} -q` = ${Y} ]; then mv ${Y}.gz files/${Y}.gz else echo "metadata is corrupt." return 1 fi + echo "ok." 1>${QUIETREDIR} done < filelist echo "done." # Extract the index + echo -n "Extracting index... " 1>${QUIETREDIR} gunzip -c files/`look INDEX tINDEX.new | cut -f 2 -d '|'`.gz > INDEX.new fetch_index_sanity || return 1 @@ -754,8 +759,10 @@ fetch_update() { fi # Generate a list of wanted ports patches + echo -n "Generating list of wanted patches..." 1>${QUIETREDIR} join -t '|' -o 1.2,2.2 INDEX INDEX.new | fetch_make_patchlist > patchlist + echo " done." 1>${QUIETREDIR} # Attempt to fetch ports patches echo -n "Fetching `wc -l < patchlist | tr -d ' '` " @@ -766,11 +773,18 @@ fetch_update() { echo "done." # Attempt to apply ports patches - echo -n "Applying patches... " - while read LINE; do - X=`echo ${LINE} | cut -f 1 -d '|'` - Y=`echo ${LINE} | cut -f 2 -d '|'` - if [ ! -f "${X}-${Y}" ]; then continue; fi + PATCHCNT=`wc -l patchlist` + echo "Applying patches... " + IFS='|' + I=0 + while read X Y; do + I=$(($I + 1)) + F="${X}-${Y}" + if [ ! -f "${F}" ]; then + printf " Skipping ${F} (${I} of ${PATCHCNT}).\r" + continue; + fi + echo " Processing ${F}..." 1>${QUIETREDIR} gunzip -c < files/${X}.gz > OLD ${BSPATCH} OLD NEW ${X}-${Y} if [ `${SHA256} -q NEW` = ${Y} ]; then @@ -779,6 +793,7 @@ fetch_update() { fi rm -f diff OLD NEW ${X}-${Y} done < patchlist 2>${QUIETREDIR} + IFS= echo "done." # Update ports without patches @@ -795,7 +810,10 @@ fetch_update() { xargs ${XARGST} ${PHTTPGET} ${SERVERNAME} \ 2>${QUIETREDIR} + I=0 while read Y; do + I=$(($I + 1)) + printf " Processing ${Y} (${I} of ${PATCHCNT}).\r" 1>${QUIETREDIR} if [ `gunzip -c < ${Y}.gz | ${SHA256} -q` = ${Y} ]; then mv ${Y}.gz files/${Y}.gz else @@ -877,6 +895,7 @@ extract_metadata() { # Do the actual work involved in "extract" extract_run() { + local IFS='|' mkdir -p ${PORTSDIR} || return 1 if ! @@ -886,7 +905,7 @@ extract_run() { grep -vE "${REFUSE}" ${WORKDIR}/INDEX else cat ${WORKDIR}/INDEX - fi | tr '|' ' ' | while read FILE HASH; do + fi | while read FILE HASH; do echo ${PORTSDIR}/${FILE} if ! [ -r "${WORKDIR}/files/${HASH}.gz" ]; then echo "files/${HASH}.gz not found -- snapshot corrupt." @@ -916,35 +935,8 @@ extract_run() { extract_indices } -# Do the actual work involved in "update" -update_run() { - if ! [ -z "${INDEXONLY}" ]; then - extract_indices >/dev/null || return 1 - return 0 - fi - - if sort ${WORKDIR}/INDEX | - cmp -s ${PORTSDIR}/.portsnap.INDEX -; then - echo "Ports tree is already up to date." - return 0 - fi - -# If we are REFUSEing to touch certain directories, don't remove files -# from those directories (even if they are out of date) - echo -n "Removing old files and directories... " - if ! [ -z "${REFUSE}" ]; then - sort ${WORKDIR}/INDEX | - comm -23 ${PORTSDIR}/.portsnap.INDEX - | cut -f 1 -d '|' | - grep -vE "${REFUSE}" | - lam -s "${PORTSDIR}/" - | - sed -e 's|/$||' | xargs rm -rf - else - sort ${WORKDIR}/INDEX | - comm -23 ${PORTSDIR}/.portsnap.INDEX - | cut -f 1 -d '|' | - lam -s "${PORTSDIR}/" - | - sed -e 's|/$||' | xargs rm -rf - fi - echo "done." +update_run_exract() { + local IFS='|' # Install new files echo "Extracting new files:" @@ -955,9 +947,7 @@ update_run() { sort ${WORKDIR}/INDEX fi | comm -13 ${PORTSDIR}/.portsnap.INDEX - | - while read LINE; do - FILE=`echo ${LINE} | cut -f 1 -d '|'` - HASH=`echo ${LINE} | cut -f 2 -d '|'` + while read FILE HASH; do echo ${PORTSDIR}/${FILE} if ! [ -r "${WORKDIR}/files/${HASH}.gz" ]; then echo "files/${HASH}.gz not found -- snapshot corrupt." @@ -977,7 +967,39 @@ update_run() { done; then return 1 fi +} + +# Do the actual work involved in "update" +update_run() { + if ! [ -z "${INDEXONLY}" ]; then + extract_indices >/dev/null || return 1 + return 0 + fi + + if sort ${WORKDIR}/INDEX | + cmp -s ${PORTSDIR}/.portsnap.INDEX -; then + echo "Ports tree is already up to date." + return 0 + fi + +# If we are REFUSEing to touch certain directories, don't remove files +# from those directories (even if they are out of date) + echo -n "Removing old files and directories... " + if ! [ -z "${REFUSE}" ]; then + sort ${WORKDIR}/INDEX | + comm -23 ${PORTSDIR}/.portsnap.INDEX - | cut -f 1 -d '|' | + grep -vE "${REFUSE}" | + lam -s "${PORTSDIR}/" - | + sed -e 's|/$||' | xargs rm -rf + else + sort ${WORKDIR}/INDEX | + comm -23 ${PORTSDIR}/.portsnap.INDEX - | cut -f 1 -d '|' | + lam -s "${PORTSDIR}/" - | + sed -e 's|/$||' | xargs rm -rf + fi + echo "done." + update_run_exract || return 1 extract_metadata extract_indices } From owner-svn-src-all@FreeBSD.ORG Sun Nov 13 03:25:28 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 78FF7106566C; Sun, 13 Nov 2011 03:25:28 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-pz0-f44.google.com (mail-pz0-f44.google.com [209.85.210.44]) by mx1.freebsd.org (Postfix) with ESMTP id ED6AE8FC12; Sun, 13 Nov 2011 03:25:27 +0000 (UTC) Received: by pzk33 with SMTP id 33so17973845pzk.3 for ; Sat, 12 Nov 2011 19:25:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; bh=r4qc0hdEx7LZIqZrBZKPcPJocNE+fsqkW7gQpwW4GVs=; b=CHpfSKOVkVe+O8iwkICSLuMzulXUdLpCuQbVOYL2pOu3tEHBMHl8vojkmTB2kbd1wB jo+vNY8OGAOdC8tnUiPjWw67Mcxxalm+TqPabppkdQOiX736mIKTMOcy82ZOYObnLPxA lZVGdywEK7kn0qQamopm24IBbnmfvwG04bv6k= Received: by 10.68.20.233 with SMTP id q9mr32555667pbe.99.1321154727285; Sat, 12 Nov 2011 19:25:27 -0800 (PST) Received: from [192.168.20.5] (c-24-6-49-154.hsd1.ca.comcast.net. [24.6.49.154]) by mx.google.com with ESMTPS id s4sm44234009pbq.8.2011.11.12.19.25.25 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 12 Nov 2011 19:25:26 -0800 (PST) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Garrett Cooper In-Reply-To: <201111130318.pAD3IvGr074144@svn.freebsd.org> Date: Sat, 12 Nov 2011 19:25:23 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: <32EF12FA-07AC-481C-A407-3C8B578484C4@gmail.com> References: <201111130318.pAD3IvGr074144@svn.freebsd.org> To: Alfred Perlstein X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r227483 - head/usr.sbin/portsnap/portsnap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Nov 2011 03:25:28 -0000 On Nov 12, 2011, at 7:18 PM, Alfred Perlstein wrote: > Author: alfred > Date: Sun Nov 13 03:18:57 2011 > New Revision: 227483 > URL: http://svn.freebsd.org/changeset/base/227483 >=20 > Log: > Utilize shell's IFS instead of forking ~6 processes to > handle splitting input files on a '|'. This greatly > reduces the time taken to process several databases > during the update process. >=20 > Additionally add some more debug logging. >=20 > Modified: > head/usr.sbin/portsnap/portsnap/portsnap.sh >=20 > Modified: head/usr.sbin/portsnap/portsnap/portsnap.sh > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/usr.sbin/portsnap/portsnap/portsnap.sh Sun Nov 13 = 03:01:58 2011 (r227482) > +++ head/usr.sbin/portsnap/portsnap/portsnap.sh Sun Nov 13 = 03:18:57 2011 (r227483) > @@ -570,14 +570,16 @@ fetch_metadata_sanity() { >=20 > # Take a list of ${oldhash}|${newhash} and output a list of needed = patches > fetch_make_patchlist() { > - grep -vE "^([0-9a-f]{64})\|\1$" |=20 > - while read LINE; do > - X=3D`echo ${LINE} | cut -f 1 -d '|'` > - Y=3D`echo ${LINE} | cut -f 2 -d '|'` > - if [ -f "files/${Y}.gz" ]; then continue; fi > - if [ ! -f "files/${X}.gz" ]; then continue; fi > - echo "${LINE}" > + IFS=3D'|' > + echo "" 1>${QUIETREDIR} > + grep -vE "^([0-9a-f]{64})\|\1$" | > + while read X Y; do > + printf "Processing: $X $Y ...\r" 1>${QUIETREDIR} > + if [ -f "files/${Y}.gz" -o ! -f "files/${X}.gz" = ]; then continue; fi > + echo "${X}|${Y}" > done > + echo "" 1>${QUIETREDIR} > + IFS=3D > } >=20 > # Print user-friendly progress statistics > @@ -692,9 +694,8 @@ fetch_update() { >=20 > # Attempt to apply metadata patches > echo -n "Applying metadata patches... " > - while read LINE; do > - X=3D`echo ${LINE} | cut -f 1 -d '|'` > - Y=3D`echo ${LINE} | cut -f 2 -d '|'` > + IFS=3D'|' > + while read X Y; do > if [ ! -f "${X}-${Y}.gz" ]; then continue; fi > gunzip -c < ${X}-${Y}.gz > diff > gunzip -c < files/${X}.gz > OLD > @@ -707,6 +708,7 @@ fetch_update() { > fi > rm -f diff OLD NEW ${X}-${Y}.gz ptmp > done < patchlist 2>${QUIETREDIR} > + IFS=3D > echo "done." >=20 > # Update metadata without patches > @@ -724,16 +726,19 @@ fetch_update() { > 2>${QUIETREDIR} >=20 > while read Y; do > + echo -n "Verifying ${Y}... " 1>${QUIETREDIR} > if [ `gunzip -c < ${Y}.gz | ${SHA256} -q` =3D ${Y} ]; = then > mv ${Y}.gz files/${Y}.gz > else > echo "metadata is corrupt." > return 1 > fi > + echo "ok." 1>${QUIETREDIR} > done < filelist > echo "done." >=20 > # Extract the index > + echo -n "Extracting index... " 1>${QUIETREDIR} > gunzip -c files/`look INDEX tINDEX.new | > cut -f 2 -d '|'`.gz > INDEX.new > fetch_index_sanity || return 1 > @@ -754,8 +759,10 @@ fetch_update() { > fi >=20 > # Generate a list of wanted ports patches > + echo -n "Generating list of wanted patches..." 1>${QUIETREDIR} > join -t '|' -o 1.2,2.2 INDEX INDEX.new | > fetch_make_patchlist > patchlist > + echo " done." 1>${QUIETREDIR} >=20 > # Attempt to fetch ports patches > echo -n "Fetching `wc -l < patchlist | tr -d ' '` " > @@ -766,11 +773,18 @@ fetch_update() { > echo "done." >=20 > # Attempt to apply ports patches > - echo -n "Applying patches... " > - while read LINE; do > - X=3D`echo ${LINE} | cut -f 1 -d '|'` > - Y=3D`echo ${LINE} | cut -f 2 -d '|'` > - if [ ! -f "${X}-${Y}" ]; then continue; fi > + PATCHCNT=3D`wc -l patchlist` > + echo "Applying patches... " > + IFS=3D'|' > + I=3D0 > + while read X Y; do > + I=3D$(($I + 1)) > + F=3D"${X}-${Y}" > + if [ ! -f "${F}" ]; then > + printf " Skipping ${F} (${I} of = ${PATCHCNT}).\r" > + continue; > + fi > + echo " Processing ${F}..." 1>${QUIETREDIR} > gunzip -c < files/${X}.gz > OLD > ${BSPATCH} OLD NEW ${X}-${Y} > if [ `${SHA256} -q NEW` =3D ${Y} ]; then > @@ -779,6 +793,7 @@ fetch_update() { > fi > rm -f diff OLD NEW ${X}-${Y} > done < patchlist 2>${QUIETREDIR} > + IFS=3D > echo "done." >=20 > # Update ports without patches > @@ -795,7 +810,10 @@ fetch_update() { > xargs ${XARGST} ${PHTTPGET} ${SERVERNAME} \ > 2>${QUIETREDIR} >=20 > + I=3D0 > while read Y; do > + I=3D$(($I + 1)) > + printf " Processing ${Y} (${I} of ${PATCHCNT}).\r" = 1>${QUIETREDIR} > if [ `gunzip -c < ${Y}.gz | ${SHA256} -q` =3D ${Y} ]; = then > mv ${Y}.gz files/${Y}.gz > else > @@ -877,6 +895,7 @@ extract_metadata() { >=20 > # Do the actual work involved in "extract" > extract_run() { > + local IFS=3D'|' > mkdir -p ${PORTSDIR} || return 1 >=20 > if ! > @@ -886,7 +905,7 @@ extract_run() { > grep -vE "${REFUSE}" ${WORKDIR}/INDEX > else > cat ${WORKDIR}/INDEX > - fi | tr '|' ' ' | while read FILE HASH; do > + fi | while read FILE HASH; do > echo ${PORTSDIR}/${FILE} > if ! [ -r "${WORKDIR}/files/${HASH}.gz" ]; then > echo "files/${HASH}.gz not found -- snapshot = corrupt." > @@ -916,35 +935,8 @@ extract_run() { > extract_indices > } >=20 > -# Do the actual work involved in "update" > -update_run() { > - if ! [ -z "${INDEXONLY}" ]; then > - extract_indices >/dev/null || return 1 > - return 0 > - fi > - > - if sort ${WORKDIR}/INDEX | > - cmp -s ${PORTSDIR}/.portsnap.INDEX -; then > - echo "Ports tree is already up to date." > - return 0 > - fi > - > -# If we are REFUSEing to touch certain directories, don't remove = files > -# from those directories (even if they are out of date) > - echo -n "Removing old files and directories... " > - if ! [ -z "${REFUSE}" ]; then=20 > - sort ${WORKDIR}/INDEX | > - comm -23 ${PORTSDIR}/.portsnap.INDEX - | cut -f 1 -d = '|' | > - grep -vE "${REFUSE}" | > - lam -s "${PORTSDIR}/" - | > - sed -e 's|/$||' | xargs rm -rf > - else > - sort ${WORKDIR}/INDEX | > - comm -23 ${PORTSDIR}/.portsnap.INDEX - | cut -f 1 -d = '|' | > - lam -s "${PORTSDIR}/" - | > - sed -e 's|/$||' | xargs rm -rf > - fi > - echo "done." > +update_run_exract() { Consistent typo :)? > + local IFS=3D'|' >=20 > # Install new files > echo "Extracting new files:" > @@ -955,9 +947,7 @@ update_run() { > sort ${WORKDIR}/INDEX > fi | > comm -13 ${PORTSDIR}/.portsnap.INDEX - | > - while read LINE; do > - FILE=3D`echo ${LINE} | cut -f 1 -d '|'` > - HASH=3D`echo ${LINE} | cut -f 2 -d '|'` > + while read FILE HASH; do > echo ${PORTSDIR}/${FILE} > if ! [ -r "${WORKDIR}/files/${HASH}.gz" ]; then > echo "files/${HASH}.gz not found -- snapshot = corrupt." > @@ -977,7 +967,39 @@ update_run() { > done; then > return 1 > fi > +} > + > +# Do the actual work involved in "update" > +update_run() { > + if ! [ -z "${INDEXONLY}" ]; then > + extract_indices >/dev/null || return 1 > + return 0 > + fi > + > + if sort ${WORKDIR}/INDEX | > + cmp -s ${PORTSDIR}/.portsnap.INDEX -; then > + echo "Ports tree is already up to date." > + return 0 > + fi > + > +# If we are REFUSEing to touch certain directories, don't remove = files > +# from those directories (even if they are out of date) > + echo -n "Removing old files and directories... " > + if ! [ -z "${REFUSE}" ]; then=20 > + sort ${WORKDIR}/INDEX | > + comm -23 ${PORTSDIR}/.portsnap.INDEX - | cut -f 1 -d = '|' | > + grep -vE "${REFUSE}" | > + lam -s "${PORTSDIR}/" - | > + sed -e 's|/$||' | xargs rm -rf > + else > + sort ${WORKDIR}/INDEX | > + comm -23 ${PORTSDIR}/.portsnap.INDEX - | cut -f 1 -d = '|' | > + lam -s "${PORTSDIR}/" - | > + sed -e 's|/$||' | xargs rm -rf > + fi > + echo "done." >=20 > + update_run_exract || return 1 Wouldn't oldIFS=3D$IFS # Blah blah IFS=3D$oldIFS be better? -Garrett= From owner-svn-src-all@FreeBSD.ORG Sun Nov 13 05:26:56 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B5732106564A; Sun, 13 Nov 2011 05:26:56 +0000 (UTC) (envelope-from bright@elvis.mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id A3F2A8FC08; Sun, 13 Nov 2011 05:26:56 +0000 (UTC) Received: by elvis.mu.org (Postfix, from userid 1192) id E31A61A3C84; Sat, 12 Nov 2011 21:11:07 -0800 (PST) Date: Sat, 12 Nov 2011 21:11:07 -0800 From: Alfred Perlstein To: Garrett Cooper Message-ID: <20111113051107.GA94817@elvis.mu.org> References: <201111130318.pAD3IvGr074144@svn.freebsd.org> <32EF12FA-07AC-481C-A407-3C8B578484C4@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <32EF12FA-07AC-481C-A407-3C8B578484C4@gmail.com> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r227483 - head/usr.sbin/portsnap/portsnap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Nov 2011 05:26:56 -0000 * Garrett Cooper [111112 19:25] wrote: > On Nov 12, 2011, at 7:18 PM, Alfred Perlstein wrote: > > > Author: alfred > > Date: Sun Nov 13 03:18:57 2011 > > New Revision: 227483 > > URL: http://svn.freebsd.org/changeset/base/227483 > > > > Log: > > Utilize shell's IFS instead of forking ~6 processes to > > handle splitting input files on a '|'. This greatly > > reduces the time taken to process several databases > > during the update process. > > > > Additionally add some more debug logging. > > > > Modified: > > head/usr.sbin/portsnap/portsnap/portsnap.sh > > > > Wouldn't > > oldIFS=$IFS > # Blah blah > IFS=$oldIFS > > be better? Meh, it's hard to do it in some of the code because of the 'return' in the middle of the logic and in the other places I didn't really care that much. That said, I'll happily take a patch to clean it up some. Just watch the logic, it's hairy in the places I used 'local'. -- - Alfred Perlstein .- VMOA #5191, 03 vmax, 92 gs500, 85 ch250, 07 zx10 .- FreeBSD committer From owner-svn-src-all@FreeBSD.ORG Sun Nov 13 06:39:50 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B3E6106566B; Sun, 13 Nov 2011 06:39:50 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2AD648FC0A; Sun, 13 Nov 2011 06:39:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAD6doJs080352; Sun, 13 Nov 2011 06:39:50 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAD6do5W080350; Sun, 13 Nov 2011 06:39:50 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201111130639.pAD6do5W080350@svn.freebsd.org> From: Alfred Perlstein Date: Sun, 13 Nov 2011 06:39:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227484 - head/usr.sbin/portsnap/portsnap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Nov 2011 06:39:50 -0000 Author: alfred Date: Sun Nov 13 06:39:49 2011 New Revision: 227484 URL: http://svn.freebsd.org/changeset/base/227484 Log: Fix spelling of extract. Pointed out by: gcooper Modified: head/usr.sbin/portsnap/portsnap/portsnap.sh Modified: head/usr.sbin/portsnap/portsnap/portsnap.sh ============================================================================== --- head/usr.sbin/portsnap/portsnap/portsnap.sh Sun Nov 13 03:18:57 2011 (r227483) +++ head/usr.sbin/portsnap/portsnap/portsnap.sh Sun Nov 13 06:39:49 2011 (r227484) @@ -935,7 +935,7 @@ extract_run() { extract_indices } -update_run_exract() { +update_run_extract() { local IFS='|' # Install new files @@ -999,7 +999,7 @@ update_run() { fi echo "done." - update_run_exract || return 1 + update_run_extract || return 1 extract_metadata extract_indices } From owner-svn-src-all@FreeBSD.ORG Sun Nov 13 08:08:41 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 94263106564A; Sun, 13 Nov 2011 08:08:41 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id D05B68FC0C; Sun, 13 Nov 2011 08:08:40 +0000 (UTC) Received: by wwg14 with SMTP id 14so5013324wwg.31 for ; Sun, 13 Nov 2011 00:08:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=ou5HzcfBk1nwgPuj7kCzff7naBbQBLi5xiGwk/lZ3xs=; b=E76p8nxm/GfgXuJLs6tLwDYuDvjtgBbXUNDJZ+zpqzHG9XZBRgs/xVGkMw4pSBA9pG DxcsQ66hpRcor1qOgzrPj8dTnM3DBri5hGsRH9+/13EnKDOKWUkkPdd6UXFc7Bcm2KZN TJkalreqZ0W1vIlNnFcbYfyPQZshX7s4kQOCc= Received: by 10.216.133.165 with SMTP id q37mr3185338wei.11.1321170039264; Sat, 12 Nov 2011 23:40:39 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.216.21.133 with HTTP; Sat, 12 Nov 2011 23:40:08 -0800 (PST) In-Reply-To: References: <201111112224.pABMOG0R011302@svn.freebsd.org> From: Eitan Adler Date: Sun, 13 Nov 2011 02:40:08 -0500 X-Google-Sender-Auth: 47J7mCZekqsmfmJfWEUfaVL3SyI Message-ID: To: Dmitry Morozovsky Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r227457 - head/sys/dev/puc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Nov 2011 08:08:41 -0000 On Sat, Nov 12, 2011 at 5:23 AM, Dmitry Morozovsky wrote: > this change seems to be non-intrusive, could we please have it in 9.0-R? I've sent a request to re@ -- Eitan Adler Ports committer X11, Bugbusting teams From owner-svn-src-all@FreeBSD.ORG Sun Nov 13 10:28:02 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ED7DA106566C; Sun, 13 Nov 2011 10:28:01 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DCE5A8FC12; Sun, 13 Nov 2011 10:28:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pADAS1cn087282; Sun, 13 Nov 2011 10:28:01 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pADAS1Ip087280; Sun, 13 Nov 2011 10:28:01 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201111131028.pADAS1Ip087280@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 13 Nov 2011 10:28:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227485 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Nov 2011 10:28:02 -0000 Author: kib Date: Sun Nov 13 10:28:01 2011 New Revision: 227485 URL: http://svn.freebsd.org/changeset/base/227485 Log: To limit amount of the kernel memory allocated, and to optimize the iteration over the fdsets, kern_select() limits the length of the fdsets copied in by the last valid file descriptor index. If any bit is set in a mask above the limit, current implementation ignores the filedescriptor, instead of returning EBADF. Fix the issue by scanning the tails of fdset before entering the select loop and returning EBADF if any bit above last valid filedescriptor index is set. The performance impact of the additional check is only imposed on the (somewhat) buggy applications that pass bad file descriptors to select(2) or pselect(2). PR: kern/155606, kern/162379 Discussed with: cognet, glebius Tested by: andreast (powerpc, all 64/32bit ABI combinations, big-endian), marius (sparc64, big-endian) MFC after: 2 weeks Modified: head/sys/kern/sys_generic.c Modified: head/sys/kern/sys_generic.c ============================================================================== --- head/sys/kern/sys_generic.c Sun Nov 13 06:39:49 2011 (r227484) +++ head/sys/kern/sys_generic.c Sun Nov 13 10:28:01 2011 (r227485) @@ -831,6 +831,54 @@ sys_select(struct thread *td, struct sel NFDBITS)); } +/* + * In the unlikely case when user specified n greater then the last + * open file descriptor, check that no bits are set after the last + * valid fd. We must return EBADF if any is set. + * + * There are applications that rely on the behaviour. + * + * nd is fd_lastfile + 1. + */ +static int +select_check_badfd(fd_set *fd_in, int nd, int ndu, int abi_nfdbits) +{ + char *addr, *oaddr; + int b, i, res; + uint8_t bits; + + if (nd >= ndu || fd_in == NULL) + return (0); + + oaddr = NULL; + bits = 0; /* silence gcc */ + for (i = nd; i < ndu; i++) { + b = i / NBBY; +#if BYTE_ORDER == LITTLE_ENDIAN + addr = (char *)fd_in + b; +#else + addr = (char *)fd_in; + if (abi_nfdbits == NFDBITS) { + addr += rounddown(b, sizeof(fd_mask)) + + sizeof(fd_mask) - 1 - b % sizeof(fd_mask); + } else { + addr += rounddown(b, sizeof(uint32_t)) + + sizeof(uint32_t) - 1 - b % sizeof(uint32_t); + } +#endif + if (addr != oaddr) { + res = fubyte(addr); + if (res == -1) + return (EFAULT); + oaddr = addr; + bits = res; + } + if ((bits & (1 << (i % NBBY))) != 0) + return (EBADF); + } + return (0); +} + int kern_select(struct thread *td, int nd, fd_set *fd_in, fd_set *fd_ou, fd_set *fd_ex, struct timeval *tvp, int abi_nfdbits) @@ -845,14 +893,26 @@ kern_select(struct thread *td, int nd, f fd_mask s_selbits[howmany(2048, NFDBITS)]; fd_mask *ibits[3], *obits[3], *selbits, *sbp; struct timeval atv, rtv, ttv; - int error, timo; + int error, lf, ndu, timo; u_int nbufbytes, ncpbytes, ncpubytes, nfdbits; if (nd < 0) return (EINVAL); fdp = td->td_proc->p_fd; - if (nd > fdp->fd_lastfile + 1) - nd = fdp->fd_lastfile + 1; + ndu = nd; + lf = fdp->fd_lastfile; + if (nd > lf + 1) + nd = lf + 1; + + error = select_check_badfd(fd_in, nd, ndu, abi_nfdbits); + if (error != 0) + return (error); + error = select_check_badfd(fd_ou, nd, ndu, abi_nfdbits); + if (error != 0) + return (error); + error = select_check_badfd(fd_ex, nd, ndu, abi_nfdbits); + if (error != 0) + return (error); /* * Allocate just enough bits for the non-null fd_sets. Use the From owner-svn-src-all@FreeBSD.ORG Sun Nov 13 11:53:18 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DEF581065672; Sun, 13 Nov 2011 11:53:18 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CE57A8FC08; Sun, 13 Nov 2011 11:53:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pADBrIOv091627; Sun, 13 Nov 2011 11:53:18 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pADBrIeJ091625; Sun, 13 Nov 2011 11:53:18 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201111131153.pADBrIeJ091625@svn.freebsd.org> From: Michael Tuexen Date: Sun, 13 Nov 2011 11:53:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227486 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Nov 2011 11:53:19 -0000 Author: tuexen Date: Sun Nov 13 11:53:18 2011 New Revision: 227486 URL: http://svn.freebsd.org/changeset/base/227486 Log: Don't copy uninitialized memory. Also simplify the comparison of interface names. MFC after: 3 days. Modified: head/sys/netinet/sctp_pcb.c Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Sun Nov 13 10:28:01 2011 (r227485) +++ head/sys/netinet/sctp_pcb.c Sun Nov 13 11:53:18 2011 (r227486) @@ -559,9 +559,9 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, vo atomic_add_int(&vrf->refcount, 1); sctp_ifnp->ifn_mtu = SCTP_GATHER_MTU_FROM_IFN_INFO(ifn, ifn_index, addr->sa_family); if (if_name != NULL) { - memcpy(sctp_ifnp->ifn_name, if_name, SCTP_IFNAMSIZ); + snprintf(sctp_ifnp->ifn_name, SCTP_IFNAMSIZ, "%s", if_name); } else { - memcpy(sctp_ifnp->ifn_name, "unknown", min(7, SCTP_IFNAMSIZ)); + snprintf(sctp_ifnp->ifn_name, SCTP_IFNAMSIZ, "%s", "unknown"); } hash_ifn_head = &SCTP_BASE_INFO(vrf_ifn_hash)[(ifn_index & SCTP_BASE_INFO(vrf_ifn_hashmark))]; LIST_INIT(&sctp_ifnp->ifalist); @@ -768,19 +768,9 @@ sctp_del_addr_from_vrf(uint32_t vrf_id, * panda who might recycle indexes fast. */ if (if_name) { - int len1, len2; - - len1 = min(SCTP_IFNAMSIZ, strlen(if_name)); - len2 = min(SCTP_IFNAMSIZ, strlen(sctp_ifap->ifn_p->ifn_name)); - if (len1 && len2 && (len1 == len2)) { - /* we can compare them */ - if (strncmp(if_name, sctp_ifap->ifn_p->ifn_name, len1) == 0) { - /* - * They match its a correct - * delete - */ - valid = 1; - } + if (strncmp(if_name, sctp_ifap->ifn_p->ifn_name, SCTP_IFNAMSIZ) == 0) { + /* They match its a correct delete */ + valid = 1; } } if (!valid) { From owner-svn-src-all@FreeBSD.ORG Sun Nov 13 12:21:52 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E391106566B; Sun, 13 Nov 2011 12:21:52 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay04.stack.nl [IPv6:2001:610:1108:5010::107]) by mx1.freebsd.org (Postfix) with ESMTP id 1A8BB8FC08; Sun, 13 Nov 2011 12:21:52 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 198691DD757; Sun, 13 Nov 2011 13:21:51 +0100 (CET) Received: by snail.stack.nl (Postfix, from userid 1677) id 0012C28468; Sun, 13 Nov 2011 13:21:50 +0100 (CET) Date: Sun, 13 Nov 2011 13:21:50 +0100 From: Jilles Tjoelker To: Garrett Cooper Message-ID: <20111113122150.GA62828@stack.nl> References: <201111130318.pAD3IvGr074144@svn.freebsd.org> <32EF12FA-07AC-481C-A407-3C8B578484C4@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <32EF12FA-07AC-481C-A407-3C8B578484C4@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Alfred Perlstein , src-committers@freebsd.org Subject: Re: svn commit: r227483 - head/usr.sbin/portsnap/portsnap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Nov 2011 12:21:52 -0000 On Sat, Nov 12, 2011 at 07:25:23PM -0800, Garrett Cooper wrote: > On Nov 12, 2011, at 7:18 PM, Alfred Perlstein wrote: > > Author: alfred > > Date: Sun Nov 13 03:18:57 2011 > > New Revision: 227483 > > URL: http://svn.freebsd.org/changeset/base/227483 [snip] > > Modified: head/usr.sbin/portsnap/portsnap/portsnap.sh > > ============================================================================== > > --- head/usr.sbin/portsnap/portsnap/portsnap.sh Sun Nov 13 03:01:58 2011 (r227482) > > +++ head/usr.sbin/portsnap/portsnap/portsnap.sh Sun Nov 13 03:18:57 2011 (r227483) > > @@ -570,14 +570,16 @@ fetch_metadata_sanity() { [snip] > > + IFS='|' > > + echo "" 1>${QUIETREDIR} > > + grep -vE "^([0-9a-f]{64})\|\1$" | > > + while read X Y; do > > + printf "Processing: $X $Y ...\r" 1>${QUIETREDIR} > > + if [ -f "files/${Y}.gz" -o ! -f "files/${X}.gz" ]; then continue; fi > > + echo "${X}|${Y}" > > done > > + echo "" 1>${QUIETREDIR} > > + IFS= [snip] > > + IFS='|' > > + while read X Y; do > > if [ ! -f "${X}-${Y}.gz" ]; then continue; fi > > gunzip -c < ${X}-${Y}.gz > diff > > gunzip -c < files/${X}.gz > OLD > > @@ -707,6 +708,7 @@ fetch_update() { > > fi > > rm -f diff OLD NEW ${X}-${Y}.gz ptmp > > done < patchlist 2>${QUIETREDIR} > > + IFS= > > echo "done." [snip] > > + update_run_exract || return 1 > Wouldn't > oldIFS=$IFS > # Blah blah > IFS=$oldIFS > be better? That's too simple, it will change an unset IFS to a null IFS and the difference between those is major. If IFS is unset, it behaves the same as IFS=$' \t\n' and if IFS='' it disables field splitting. Given that you are already using 'local', why not use it everywhere? You may need to split up some functions to do this. -- Jilles Tjoelker From owner-svn-src-all@FreeBSD.ORG Sun Nov 13 16:18:48 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 97CA7106566C; Sun, 13 Nov 2011 16:18:48 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8746A8FC13; Sun, 13 Nov 2011 16:18:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pADGImJ6099699; Sun, 13 Nov 2011 16:18:48 GMT (envelope-from theraven@svn.freebsd.org) Received: (from theraven@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pADGIm2n099696; Sun, 13 Nov 2011 16:18:48 GMT (envelope-from theraven@svn.freebsd.org) Message-Id: <201111131618.pADGIm2n099696@svn.freebsd.org> From: David Chisnall Date: Sun, 13 Nov 2011 16:18:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227487 - head/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Nov 2011 16:18:48 -0000 Author: theraven Date: Sun Nov 13 16:18:48 2011 New Revision: 227487 URL: http://svn.freebsd.org/changeset/base/227487 Log: The spec says that FILE must be defined in wchar.h, but it wasn't. It is now. Also hide some macros in C++ mode that will break C++ namespaced calls. Approved by: dim (mentor) Modified: head/include/stdio.h head/include/wchar.h Modified: head/include/stdio.h ============================================================================== --- head/include/stdio.h Sun Nov 13 11:53:18 2011 (r227486) +++ head/include/stdio.h Sun Nov 13 16:18:48 2011 (r227487) @@ -107,7 +107,7 @@ struct __sbuf { * inline functions. To preserve ABI compat, these members must not * be disturbed. These members are marked below with (*). */ -typedef struct __sFILE { +struct __sFILE { unsigned char *_p; /* (*) current position in (some) buffer */ int _r; /* (*) read space left for getc() */ int _w; /* (*) write space left for putc() */ @@ -144,8 +144,11 @@ typedef struct __sFILE { int _fl_count; /* recursive lock count */ int _orientation; /* orientation for fwide() */ __mbstate_t _mbstate; /* multibyte conversion state */ -} FILE; - +}; +#ifndef _STDFILE_DECLARED +#define _STDFILE_DECLARED +typedef struct __sFILE FILE; +#endif #ifndef _STDSTREAM_DECLARED __BEGIN_DECLS extern FILE *__stdinp; @@ -467,6 +470,7 @@ static __inline int __sputc(int _c, FILE __swbuf((int)(c), p) : \ (*(p)->_p = (c), (int)*(p)->_p++)) #endif +#ifndef __cplusplus #define __sfeof(p) (((p)->_flags & __SEOF) != 0) #define __sferror(p) (((p)->_flags & __SERR) != 0) @@ -506,6 +510,7 @@ extern int __isthreaded; #define getchar_unlocked() getc_unlocked(stdin) #define putchar_unlocked(x) putc_unlocked(x, stdout) #endif +#endif /* __cplusplus */ __END_DECLS #endif /* !_STDIO_H_ */ Modified: head/include/wchar.h ============================================================================== --- head/include/wchar.h Sun Nov 13 11:53:18 2011 (r227486) +++ head/include/wchar.h Sun Nov 13 16:18:48 2011 (r227487) @@ -97,20 +97,23 @@ typedef __wint_t wint_t; #define WEOF ((wint_t)-1) #endif -struct __sFILE; +#ifndef _STDFILE_DECLARED +#define _STDFILE_DECLARED +typedef struct __sFILE FILE; +#endif struct tm; __BEGIN_DECLS wint_t btowc(int); -wint_t fgetwc(struct __sFILE *); +wint_t fgetwc(FILE *); wchar_t * - fgetws(wchar_t * __restrict, int, struct __sFILE * __restrict); -wint_t fputwc(wchar_t, struct __sFILE *); -int fputws(const wchar_t * __restrict, struct __sFILE * __restrict); -int fwide(struct __sFILE *, int); -int fwprintf(struct __sFILE * __restrict, const wchar_t * __restrict, ...); -int fwscanf(struct __sFILE * __restrict, const wchar_t * __restrict, ...); -wint_t getwc(struct __sFILE *); + fgetws(wchar_t * __restrict, int, FILE * __restrict); +wint_t fputwc(wchar_t, FILE *); +int fputws(const wchar_t * __restrict, FILE * __restrict); +int fwide(FILE *, int); +int fwprintf(FILE * __restrict, const wchar_t * __restrict, ...); +int fwscanf(FILE * __restrict, const wchar_t * __restrict, ...); +wint_t getwc(FILE *); wint_t getwchar(void); size_t mbrlen(const char * __restrict, size_t, mbstate_t * __restrict); size_t mbrtowc(wchar_t * __restrict, const char * __restrict, size_t, @@ -118,13 +121,13 @@ size_t mbrtowc(wchar_t * __restrict, con int mbsinit(const mbstate_t *); size_t mbsrtowcs(wchar_t * __restrict, const char ** __restrict, size_t, mbstate_t * __restrict); -wint_t putwc(wchar_t, struct __sFILE *); +wint_t putwc(wchar_t, FILE *); wint_t putwchar(wchar_t); int swprintf(wchar_t * __restrict, size_t n, const wchar_t * __restrict, ...); int swscanf(const wchar_t * __restrict, const wchar_t * __restrict, ...); -wint_t ungetwc(wint_t, struct __sFILE *); -int vfwprintf(struct __sFILE * __restrict, const wchar_t * __restrict, +wint_t ungetwc(wint_t, FILE *); +int vfwprintf(FILE * __restrict, const wchar_t * __restrict, __va_list); int vswprintf(wchar_t * __restrict, size_t n, const wchar_t * __restrict, __va_list); @@ -167,9 +170,9 @@ int wprintf(const wchar_t * __restrict, int wscanf(const wchar_t * __restrict, ...); #ifndef _STDSTREAM_DECLARED -extern struct __sFILE *__stdinp; -extern struct __sFILE *__stdoutp; -extern struct __sFILE *__stderrp; +extern FILE *__stdinp; +extern FILE *__stdoutp; +extern FILE *__stderrp; #define _STDSTREAM_DECLARED #endif @@ -179,7 +182,7 @@ extern struct __sFILE *__stderrp; #define putwchar(wc) fputwc(wc, __stdoutp) #if __ISO_C_VISIBLE >= 1999 -int vfwscanf(struct __sFILE * __restrict, const wchar_t * __restrict, +int vfwscanf(FILE * __restrict, const wchar_t * __restrict, __va_list); int vswscanf(const wchar_t * __restrict, const wchar_t * __restrict, __va_list); @@ -217,7 +220,7 @@ size_t wcsnrtombs(char * __restrict, con #endif #if __BSD_VISIBLE -wchar_t *fgetwln(struct __sFILE * __restrict, size_t * __restrict); +wchar_t *fgetwln(FILE * __restrict, size_t * __restrict); size_t wcslcat(wchar_t *, const wchar_t *, size_t); size_t wcslcpy(wchar_t *, const wchar_t *, size_t); #endif From owner-svn-src-all@FreeBSD.ORG Sun Nov 13 16:35:48 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7BD7106566B; Sun, 13 Nov 2011 16:35:47 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CD6798FC08; Sun, 13 Nov 2011 16:35:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pADGZlqV000359; Sun, 13 Nov 2011 16:35:47 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pADGZlsG000356; Sun, 13 Nov 2011 16:35:47 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201111131635.pADGZlsG000356@svn.freebsd.org> From: Eitan Adler Date: Sun, 13 Nov 2011 16:35:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227488 - head/sbin/md5 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Nov 2011 16:35:48 -0000 Author: eadler (ports committer) Date: Sun Nov 13 16:35:47 2011 New Revision: 227488 URL: http://svn.freebsd.org/changeset/base/227488 Log: - add "check" option to MD5 and friends to compare files against known hash. PR: bin/146541 Submitted by: eadler Reviewed by: jhell@dataix.net Approved by: secteam (cperciva) Approved by: cperciva MFC after: 3 weeks Modified: head/sbin/md5/md5.1 head/sbin/md5/md5.c Modified: head/sbin/md5/md5.1 ============================================================================== --- head/sbin/md5/md5.1 Sun Nov 13 16:18:48 2011 (r227487) +++ head/sbin/md5/md5.1 Sun Nov 13 16:35:47 2011 (r227488) @@ -8,18 +8,22 @@ .Sh SYNOPSIS .Nm md5 .Op Fl pqrtx +.Op Fl c Ar string .Op Fl s Ar string .Op Ar .Nm sha1 .Op Fl pqrtx +.Op Fl c Ar string .Op Fl s Ar string .Op Ar .Nm sha256 .Op Fl pqrtx +.Op Fl c Ar string .Op Fl s Ar string .Op Ar .Nm rmd160 .Op Fl pqrtx +.Op Fl c Ar string .Op Fl s Ar string .Op Ar .Sh DESCRIPTION @@ -73,6 +77,9 @@ precede any files named on the command l The hexadecimal checksum of each file listed on the command line is printed after the options are processed. .Bl -tag -width indent +.It Fl c Ar string +Compare files to this md5 string. (Note that this option is not yet useful +if multiple files are specified.) .It Fl s Ar string Print a checksum of the given .Ar string . @@ -101,7 +108,8 @@ The and .Nm rmd160 utilities exit 0 on success, -and 1 if at least one of the input files could not be read. +1 if at least one of the input files could not be read, +and 2 if at least one file does not have the same hash as the -c option. .Sh SEE ALSO .Xr cksum 1 , .Xr md5 3 , Modified: head/sbin/md5/md5.c ============================================================================== --- head/sbin/md5/md5.c Sun Nov 13 16:18:48 2011 (r227487) +++ head/sbin/md5/md5.c Sun Nov 13 16:35:47 2011 (r227488) @@ -44,6 +44,8 @@ __FBSDID("$FreeBSD$"); int qflag; int rflag; int sflag; +unsigned char* checkAgainst; +int checksFailed; typedef void (DIGEST_Init)(void *); typedef void (DIGEST_Update)(void *, const unsigned char *, size_t); @@ -138,8 +140,13 @@ main(int argc, char *argv[]) digest = 0; failed = 0; - while ((ch = getopt(argc, argv, "pqrs:tx")) != -1) + checkAgainst = NULL; + checksFailed = 0; + while ((ch = getopt(argc, argv, "c:pqrs:tx")) != -1) switch (ch) { + case 'c': + checkAgainst = optarg; + break; case 'p': MDFilter(&Algorithm[digest], 1); break; @@ -173,12 +180,19 @@ main(int argc, char *argv[]) failed++; } else { if (qflag) - printf("%s\n", p); + printf("%s", p); else if (rflag) - printf("%s %s\n", p, *argv); + printf("%s %s", p, *argv); else - printf("%s (%s) = %s\n", + printf("%s (%s) = %s", Algorithm[digest].name, *argv, p); + if (checkAgainst && strcmp(checkAgainst,p)) + { + checksFailed++; + if (!qflag) + printf(" [ Failed ]"); + } + printf("\n"); } } while (*++argv); } else if (!sflag && (optind == 1 || qflag || rflag)) @@ -186,6 +200,8 @@ main(int argc, char *argv[]) if (failed != 0) return (1); + if (checksFailed != 0) + return (2); return (0); } @@ -198,12 +214,20 @@ MDString(Algorithm_t *alg, const char *s size_t len = strlen(string); char buf[HEX_DIGEST_LENGTH]; + alg->Data(string,len,buf); if (qflag) - printf("%s\n", alg->Data(string, len, buf)); + printf("%s", buf); else if (rflag) - printf("%s \"%s\"\n", alg->Data(string, len, buf), string); + printf("%s \"%s\"", buf, string); else - printf("%s (\"%s\") = %s\n", alg->name, string, alg->Data(string, len, buf)); + printf("%s (\"%s\") = %s", alg->name, string, buf); + if (checkAgainst && strcmp(buf,checkAgainst)) + { + checksFailed++; + if (!qflag) + printf(" [ failed ]"); + } + printf("\n"); } /* * Measures the time to digest TEST_BLOCK_COUNT TEST_BLOCK_LEN-byte blocks. From owner-svn-src-all@FreeBSD.ORG Sun Nov 13 17:06:34 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 23A62106566B; Sun, 13 Nov 2011 17:06:34 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 11EAC8FC0C; Sun, 13 Nov 2011 17:06:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pADH6X9V001417; Sun, 13 Nov 2011 17:06:33 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pADH6X8c001407; Sun, 13 Nov 2011 17:06:33 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201111131706.pADH6X8c001407@svn.freebsd.org> From: Eitan Adler Date: Sun, 13 Nov 2011 17:06:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227489 - in head: sbin/gvinum sbin/ipfw sys/cam/scsi sys/fs/devfs sys/netinet usr.sbin/mtree usr.sbin/pmcstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Nov 2011 17:06:34 -0000 Author: eadler (ports committer) Date: Sun Nov 13 17:06:33 2011 New Revision: 227489 URL: http://svn.freebsd.org/changeset/base/227489 Log: - fix duplicate "a a" in some comments Submitted by: eadler Approved by: simon MFC after: 3 days Modified: head/sbin/gvinum/gvinum.c head/sbin/ipfw/main.c head/sys/cam/scsi/scsi_ch.h head/sys/cam/scsi/scsi_ses.c head/sys/fs/devfs/devfs_rule.c head/sys/netinet/sctp_structs.h head/usr.sbin/mtree/mtree.5 head/usr.sbin/pmcstat/pmcstat.c Modified: head/sbin/gvinum/gvinum.c ============================================================================== --- head/sbin/gvinum/gvinum.c Sun Nov 13 16:35:47 2011 (r227488) +++ head/sbin/gvinum/gvinum.c Sun Nov 13 17:06:33 2011 (r227489) @@ -557,7 +557,7 @@ find_pattern(char *line, char *pattern) return (NULL); } -/* Find a free name for an object given a a prefix. */ +/* Find a free name for an object given a prefix. */ char * find_name(const char *prefix, int type, int namelen) { Modified: head/sbin/ipfw/main.c ============================================================================== --- head/sbin/ipfw/main.c Sun Nov 13 16:35:47 2011 (r227488) +++ head/sbin/ipfw/main.c Sun Nov 13 17:06:33 2011 (r227489) @@ -87,7 +87,7 @@ help(void) * which includes the program name and a NULL entry at the end. * If we are called with a single string, we split it on whitespace. * Also, arguments with a trailing ',' are joined to the next one. - * The pointers (av[]) and data are in a a single chunk of memory. + * The pointers (av[]) and data are in a single chunk of memory. * av[0] points to the original program name, all other entries * point into the allocated chunk. */ Modified: head/sys/cam/scsi/scsi_ch.h ============================================================================== --- head/sys/cam/scsi/scsi_ch.h Sun Nov 13 16:35:47 2011 (r227488) +++ head/sys/cam/scsi/scsi_ch.h Sun Nov 13 17:06:33 2011 (r227489) @@ -359,7 +359,7 @@ struct page_device_capabilities { * Some of these fields can be a little confusing, so an explanation * is in order. * - * Each component within a a medium changer apparatus is called an + * Each component within a medium changer apparatus is called an * "element". * * The "medium transport element address" is the address of the first Modified: head/sys/cam/scsi/scsi_ses.c ============================================================================== --- head/sys/cam/scsi/scsi_ses.c Sun Nov 13 16:35:47 2011 (r227488) +++ head/sys/cam/scsi/scsi_ses.c Sun Nov 13 17:06:33 2011 (r227489) @@ -714,7 +714,7 @@ ses_log(struct ses_softc *ssc, const cha /* * Is this a device that supports enclosure services? * - * It's a a pretty simple ruleset- if it is device type 0x0D (13), it's + * It's a pretty simple ruleset- if it is device type 0x0D (13), it's * an SES device. If it happens to be an old UNISYS SEN device, we can * handle that too. */ Modified: head/sys/fs/devfs/devfs_rule.c ============================================================================== --- head/sys/fs/devfs/devfs_rule.c Sun Nov 13 16:35:47 2011 (r227488) +++ head/sys/fs/devfs/devfs_rule.c Sun Nov 13 17:06:33 2011 (r227489) @@ -617,7 +617,7 @@ devfs_rule_run(struct devfs_krule *dk, s * XXX: not work as this is called when devices are created * XXX: long time after the rules were instantiated. * XXX: a printf() would probably give too much noise, or - * XXX: DoS the machine. I guess a a rate-limited message + * XXX: DoS the machine. I guess a rate-limited message * XXX: might work. */ if (depth > 0) { Modified: head/sys/netinet/sctp_structs.h ============================================================================== --- head/sys/netinet/sctp_structs.h Sun Nov 13 16:35:47 2011 (r227488) +++ head/sys/netinet/sctp_structs.h Sun Nov 13 17:06:33 2011 (r227489) @@ -416,7 +416,7 @@ TAILQ_HEAD(sctpchunk_listhead, sctp_tmit #define CHUNK_FLAGS_PR_SCTP_BUF SCTP_PR_SCTP_BUF #define CHUNK_FLAGS_PR_SCTP_RTX SCTP_PR_SCTP_RTX -/* The upper byte is used a a bit mask */ +/* The upper byte is used as a bit mask */ #define CHUNK_FLAGS_FRAGMENT_OK 0x0100 struct chk_id { Modified: head/usr.sbin/mtree/mtree.5 ============================================================================== --- head/usr.sbin/mtree/mtree.5 Sun Nov 13 16:35:47 2011 (r227488) +++ head/usr.sbin/mtree/mtree.5 Sun Nov 13 17:06:33 2011 (r227489) @@ -48,7 +48,7 @@ Leading whitespace is always ignored. .Pp When encoding file or pathnames, any backslash character or character outside of the 95 printable ASCII characters must be -encoded as a a backslash followed by three +encoded as a backslash followed by three octal digits. When reading mtree files, any appearance of a backslash followed by three octal digits should be converted into the Modified: head/usr.sbin/pmcstat/pmcstat.c ============================================================================== --- head/usr.sbin/pmcstat/pmcstat.c Sun Nov 13 16:35:47 2011 (r227488) +++ head/usr.sbin/pmcstat/pmcstat.c Sun Nov 13 17:06:33 2011 (r227489) @@ -1022,7 +1022,7 @@ main(int argc, char **argv) /* * Check if "-k kerneldir" was specified, and if whether - * 'kerneldir' actually refers to a a file. If so, use + * 'kerneldir' actually refers to a file. If so, use * `dirname path` to determine the kernel directory. */ if (args.pa_flags & FLAG_HAS_KERNELPATH) { From owner-svn-src-all@FreeBSD.ORG Sun Nov 13 17:07:27 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B9FE106564A; Sun, 13 Nov 2011 17:07:27 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1C1938FC17; Sun, 13 Nov 2011 17:07:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pADH7QPl001474; Sun, 13 Nov 2011 17:07:26 GMT (envelope-from theraven@svn.freebsd.org) Received: (from theraven@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pADH7QnD001472; Sun, 13 Nov 2011 17:07:26 GMT (envelope-from theraven@svn.freebsd.org) Message-Id: <201111131707.pADH7QnD001472@svn.freebsd.org> From: David Chisnall Date: Sun, 13 Nov 2011 17:07:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227490 - head/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Nov 2011 17:07:27 -0000 Author: theraven Date: Sun Nov 13 17:07:26 2011 New Revision: 227490 URL: http://svn.freebsd.org/changeset/base/227490 Log: Hide some more macros that will break C++ when compiling in C++ mode. Approved by: dim (mentor) Modified: head/include/ctype.h Modified: head/include/ctype.h ============================================================================== --- head/include/ctype.h Sun Nov 13 17:06:33 2011 (r227489) +++ head/include/ctype.h Sun Nov 13 17:07:26 2011 (r227490) @@ -80,6 +80,7 @@ int isspecial(int); #endif __END_DECLS +#ifndef __cplusplus #define isalnum(c) __sbistype((c), _CTYPE_A|_CTYPE_D) #define isalpha(c) __sbistype((c), _CTYPE_A) #define iscntrl(c) __sbistype((c), _CTYPE_C) @@ -93,6 +94,7 @@ __END_DECLS #define isxdigit(c) __isctype((c), _CTYPE_X) /* ANSI -- locale independent */ #define tolower(c) __sbtolower(c) #define toupper(c) __sbtoupper(c) +#endif /* !__cplusplus */ #if __XSI_VISIBLE /* @@ -112,7 +114,7 @@ __END_DECLS #define toascii(c) ((c) & 0x7F) #endif -#if __ISO_C_VISIBLE >= 1999 +#if __ISO_C_VISIBLE >= 1999 && !defined(__cplusplus) #define isblank(c) __sbistype((c), _CTYPE_B) #endif From owner-svn-src-all@FreeBSD.ORG Sun Nov 13 17:07:43 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D26991065670; Sun, 13 Nov 2011 17:07:43 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C2F6D8FC14; Sun, 13 Nov 2011 17:07:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pADH7hNa001517; Sun, 13 Nov 2011 17:07:43 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pADH7h98001515; Sun, 13 Nov 2011 17:07:43 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201111131707.pADH7h98001515@svn.freebsd.org> From: Eitan Adler Date: Sun, 13 Nov 2011 17:07:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227491 - head/sbin/md5 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Nov 2011 17:07:43 -0000 Author: eadler (ports committer) Date: Sun Nov 13 17:07:43 2011 New Revision: 227491 URL: http://svn.freebsd.org/changeset/base/227491 Log: - new sentence should start on new line. PR: bin/146541 Submitted by: bjk Approved by: bjk Modified: head/sbin/md5/md5.1 Modified: head/sbin/md5/md5.1 ============================================================================== --- head/sbin/md5/md5.1 Sun Nov 13 17:07:26 2011 (r227490) +++ head/sbin/md5/md5.1 Sun Nov 13 17:07:43 2011 (r227491) @@ -78,8 +78,8 @@ The hexadecimal checksum of each file li after the options are processed. .Bl -tag -width indent .It Fl c Ar string -Compare files to this md5 string. (Note that this option is not yet useful -if multiple files are specified.) +Compare files to this md5 string. +(Note that this option is not yet useful if multiple files are specified.) .It Fl s Ar string Print a checksum of the given .Ar string . From owner-svn-src-all@FreeBSD.ORG Sun Nov 13 18:26:11 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CAB5E1065680; Sun, 13 Nov 2011 18:26:11 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 2AC418FC17; Sun, 13 Nov 2011 18:26:10 +0000 (UTC) Received: from alf.home (alf.kiev.zoral.com.ua [10.1.1.177]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id pADIQ5h0008524 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 13 Nov 2011 20:26:05 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from alf.home (kostik@localhost [127.0.0.1]) by alf.home (8.14.5/8.14.5) with ESMTP id pADIQ5gE095014; Sun, 13 Nov 2011 20:26:05 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by alf.home (8.14.5/8.14.5/Submit) id pADIQ51r095013; Sun, 13 Nov 2011 20:26:05 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: alf.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 13 Nov 2011 20:26:05 +0200 From: Kostik Belousov To: Eitan Adler Message-ID: <20111113182605.GA50300@deviant.kiev.zoral.com.ua> References: <201111131707.pADH7h98001515@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="YO/4IGSS/EY2lHf5" Content-Disposition: inline In-Reply-To: <201111131707.pADH7h98001515@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r227491 - head/sbin/md5 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Nov 2011 18:26:11 -0000 --YO/4IGSS/EY2lHf5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Nov 13, 2011 at 05:07:43PM +0000, Eitan Adler wrote: > Author: eadler (ports committer) > Date: Sun Nov 13 17:07:43 2011 > New Revision: 227491 > URL: http://svn.freebsd.org/changeset/base/227491 >=20 > Log: > - new sentence should start on new line. > =20 > PR: bin/146541 > Submitted by: bjk > Approved by: bjk >=20 > Modified: > head/sbin/md5/md5.1 >=20 > Modified: head/sbin/md5/md5.1 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sbin/md5/md5.1 Sun Nov 13 17:07:26 2011 (r227490) > +++ head/sbin/md5/md5.1 Sun Nov 13 17:07:43 2011 (r227491) > @@ -78,8 +78,8 @@ The hexadecimal checksum of each file li > after the options are processed. > .Bl -tag -width indent > .It Fl c Ar string > -Compare files to this md5 string. (Note that this option is not yet usef= ul > -if multiple files are specified.) > +Compare files to this md5 string. > +(Note that this option is not yet useful if multiple files are specified= .) I doubt that you compare files to md5 hash. Rather, you compare the md5 hash of file with provided string. > .It Fl s Ar string > Print a checksum of the given > .Ar string . --YO/4IGSS/EY2lHf5 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk7AC70ACgkQC3+MBN1Mb4hkAgCfVIxnWkant4bKzpaxrx+P6TYv /kYAn3ksV342fBntgi4f4ywmARFDAwJ/ =yMn+ -----END PGP SIGNATURE----- --YO/4IGSS/EY2lHf5-- From owner-svn-src-all@FreeBSD.ORG Sun Nov 13 20:17:54 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E7EB1065670; Sun, 13 Nov 2011 20:17:54 +0000 (UTC) (envelope-from erik@cederstrand.dk) Received: from csmtp2.one.com (csmtp2.one.com [91.198.169.22]) by mx1.freebsd.org (Postfix) with ESMTP id E73D48FC08; Sun, 13 Nov 2011 20:17:53 +0000 (UTC) Received: from [192.168.1.104] (unknown [217.74.213.42]) by csmtp2.one.com (Postfix) with ESMTPA id E7DAF3043825; Sun, 13 Nov 2011 19:59:09 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Erik Cederstrand In-Reply-To: <201111121439.pACEdKrN048887@svn.freebsd.org> Date: Sun, 13 Nov 2011 20:59:09 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201111121439.pACEdKrN048887@svn.freebsd.org> To: David Chisnall X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r227467 - head/share/monetdef X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Nov 2011 20:17:54 -0000 Hi David, Those aren't Swiss Francs. They're yuan renminbi (CNY). It does seen = they have 2 digits, though. Thanks, Erik Den 12/11/2011 kl. 15.39 skrev David Chisnall: > Author: theraven > Date: Sat Nov 12 14:39:20 2011 > New Revision: 227467 > URL: http://svn.freebsd.org/changeset/base/227467 >=20 > Log: > Fix the number of decimal digits used for Swiss Francs (0 -> 2). = Found by the libc++ test suite. If there is some locale test suite = somewhere, it might be worth running it... >=20 > Approved by: dim (mentor) >=20 > Modified: > head/share/monetdef/zh_CN.UTF-8.src >=20 > Modified: head/share/monetdef/zh_CN.UTF-8.src > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/share/monetdef/zh_CN.UTF-8.src Sat Nov 12 10:30:14 2011 = (r227466) > +++ head/share/monetdef/zh_CN.UTF-8.src Sat Nov 12 14:39:20 2011 = (r227467) > @@ -18,9 +18,9 @@ CNY=20 > # negative_sign > - > # int_frac_digits > -0 > +2 > # frac_digits > -0 > +2 > # p_cs_precedes > 1 > # p_sep_by_space From owner-svn-src-all@FreeBSD.ORG Sun Nov 13 20:32:39 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C32B31065675; Sun, 13 Nov 2011 20:32:39 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from theravensnest.org (theravensnest.org [109.169.23.128]) by mx1.freebsd.org (Postfix) with ESMTP id 62E578FC14; Sun, 13 Nov 2011 20:32:36 +0000 (UTC) Received: from [192.168.0.2] (cpc2-cwma5-0-0-cust875.7-3.cable.virginmedia.com [86.11.39.108]) (authenticated bits=0) by theravensnest.org (8.14.4/8.14.4) with ESMTP id pADKKoYF023880 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Sun, 13 Nov 2011 20:20:51 GMT (envelope-from theraven@FreeBSD.org) Mime-Version: 1.0 (Apple Message framework v1251.1) Content-Type: text/plain; charset=us-ascii From: David Chisnall In-Reply-To: Date: Sun, 13 Nov 2011 20:20:45 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <7E35F996-F0E2-4972-8E7C-3FAB2004C52D@FreeBSD.org> References: <201111121439.pACEdKrN048887@svn.freebsd.org> To: Erik Cederstrand X-Mailer: Apple Mail (2.1251.1) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r227467 - head/share/monetdef X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Nov 2011 20:32:39 -0000 Hmm, apparently I can't tell the difference between H and N. Still, as = long as the fix is right, even if the explanation isn't... David On 13 Nov 2011, at 19:59, Erik Cederstrand wrote: > Hi David, >=20 > Those aren't Swiss Francs. They're yuan renminbi (CNY). It does seen = they have 2 digits, though. >=20 > Thanks, > Erik >=20 > Den 12/11/2011 kl. 15.39 skrev David Chisnall: >=20 >> Author: theraven >> Date: Sat Nov 12 14:39:20 2011 >> New Revision: 227467 >> URL: http://svn.freebsd.org/changeset/base/227467 >>=20 >> Log: >> Fix the number of decimal digits used for Swiss Francs (0 -> 2). = Found by the libc++ test suite. If there is some locale test suite = somewhere, it might be worth running it... >>=20 >> Approved by: dim (mentor) >>=20 >> Modified: >> head/share/monetdef/zh_CN.UTF-8.src >>=20 >> Modified: head/share/monetdef/zh_CN.UTF-8.src >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/share/monetdef/zh_CN.UTF-8.src Sat Nov 12 10:30:14 2011 = (r227466) >> +++ head/share/monetdef/zh_CN.UTF-8.src Sat Nov 12 14:39:20 2011 = (r227467) >> @@ -18,9 +18,9 @@ CNY=20 >> # negative_sign >> - >> # int_frac_digits >> -0 >> +2 >> # frac_digits >> -0 >> +2 >> # p_cs_precedes >> 1 >> # p_sep_by_space >=20 >=20 From owner-svn-src-all@FreeBSD.ORG Sun Nov 13 21:26:33 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 4ECF11065672; Sun, 13 Nov 2011 21:26:33 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 172-17-198-245.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id DEE2914EE7B; Sun, 13 Nov 2011 21:26:32 +0000 (UTC) Message-ID: <4EC03608.1050807@FreeBSD.org> Date: Sun, 13 Nov 2011 13:26:32 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:8.0) Gecko/20111110 Thunderbird/8.0 MIME-Version: 1.0 To: Jilles Tjoelker References: <201111130318.pAD3IvGr074144@svn.freebsd.org> <32EF12FA-07AC-481C-A407-3C8B578484C4@gmail.com> <20111113122150.GA62828@stack.nl> In-Reply-To: <20111113122150.GA62828@stack.nl> X-Enigmail-Version: undefined OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Garrett Cooper , svn-src-head@freebsd.org, svn-src-all@freebsd.org, Alfred Perlstein , src-committers@freebsd.org Subject: Re: svn commit: r227483 - head/usr.sbin/portsnap/portsnap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Nov 2011 21:26:33 -0000 On 11/13/2011 04:21, Jilles Tjoelker wrote: > Given that you are already using 'local', why not use it everywhere? You > may need to split up some functions to do this. You might want to look more deeply at the portsnap code before you recommend that Alfred take responsibility for roto-tilling it. :) I looked at it, and ran away screaming. The fact that Alfred is willing to take on the task of making some incremental improvements is a feature. Doug -- "We could put the whole Internet into a book." "Too practical." Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ From owner-svn-src-all@FreeBSD.ORG Sun Nov 13 22:09:13 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6BC0A106564A; Sun, 13 Nov 2011 22:09:13 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id E593E8FC0A; Sun, 13 Nov 2011 22:09:12 +0000 (UTC) Received: from localhost (58.wheelsystems.com [83.12.187.58]) by mail.dawidek.net (Postfix) with ESMTPSA id AB5C4D97; Sun, 13 Nov 2011 23:09:10 +0100 (CET) Date: Sun, 13 Nov 2011 23:08:17 +0100 From: Pawel Jakub Dawidek To: Garrett Cooper Message-ID: <20111113220817.GC1677@garage.freebsd.pl> References: <201111122001.pACK1UML059238@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="7iMSBzlTiPOCCT2k" Content-Disposition: inline In-Reply-To: X-OS: FreeBSD 9.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, Alexander Motin , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r227473 - head/sbin/geom/class/multipath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Nov 2011 22:09:13 -0000 --7iMSBzlTiPOCCT2k Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Nov 12, 2011 at 12:16:23PM -0800, Garrett Cooper wrote: > On Sat, Nov 12, 2011 at 12:01 PM, Alexander Motin wrote: > > Author: mav > > Date: Sat Nov 12 20:01:30 2011 > > New Revision: 227473 > > URL: http://svn.freebsd.org/changeset/base/227473 > > > > Log: > > =A0Fix build on some archs after r227464. > > > > Modified: > > =A0head/sbin/geom/class/multipath/geom_multipath.c > > > > Modified: head/sbin/geom/class/multipath/geom_multipath.c > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- head/sbin/geom/class/multipath/geom_multipath.c =A0 =A0 Sat Nov 12 = 19:55:48 2011 =A0 =A0 =A0 =A0(r227472) > > +++ head/sbin/geom/class/multipath/geom_multipath.c =A0 =A0 Sat Nov 12 = 20:01:30 2011 =A0 =A0 =A0 =A0(r227473) > > @@ -133,7 +133,8 @@ mp_label(struct gctl_req *req) > > =A0 =A0 =A0 =A0uint8_t *sector, *rsector; > > =A0 =A0 =A0 =A0char *ptr; > > =A0 =A0 =A0 =A0uuid_t uuid; > > - =A0 =A0 =A0 uint32_t secsize =3D 0, ssize, status; > > + =A0 =A0 =A0 ssize_t secsize =3D 0, ssize; > > + =A0 =A0 =A0 uint32_t status; > > =A0 =A0 =A0 =A0const char *name, *name2, *mpname; > > =A0 =A0 =A0 =A0int error, i, nargs, fd; > > > > @@ -161,8 +162,8 @@ mp_label(struct gctl_req *req) > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0disksize =3D msize; > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} else { > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (secsize !=3D ssize) { > > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 gctl_erro= r(req, "%s sector size %u different.", > > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 n= ame, ssize); > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 gctl_erro= r(req, "%s sector size %ju different.", > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 n= ame, (intmax_t)ssize); >=20 > Shouldn't that be uintmax_t, not intmax_t ? No, ssize_t is signed. Although the best would be to use %zd for ssize_t. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://yomoli.com --7iMSBzlTiPOCCT2k Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAk7AP9EACgkQForvXbEpPzQ7wwCffcAZNzJKHhNaOOqM/9MdR97D lw8AoPMt9npvACECUTj0pj+Olpw4XVb9 =pE42 -----END PGP SIGNATURE----- --7iMSBzlTiPOCCT2k-- From owner-svn-src-all@FreeBSD.ORG Sun Nov 13 22:46:40 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5F1ED106564A; Sun, 13 Nov 2011 22:46:40 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-gx0-f182.google.com (mail-gx0-f182.google.com [209.85.161.182]) by mx1.freebsd.org (Postfix) with ESMTP id 7CBCD8FC0A; Sun, 13 Nov 2011 22:46:39 +0000 (UTC) Received: by ggnk3 with SMTP id k3so7975510ggn.13 for ; Sun, 13 Nov 2011 14:46:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=J82XRQKOrWK5K56xXBL4bOLJd17p0E09W6jF2FQtpLA=; b=kQEUs+XhP1IVl2OZip6ch2q/wtzvn78OXOzF1v41s6jlDQ8dp/ND67EYsljktf1k92 /rTix4A/ke9AjVRf2jGtgRqTRWwwXZ3TrmuQ+tyMnzOSi/OZdAMBnWIwdtc9NKK7Hol+ JDKOenUtM9KQAJpzkWNs53uAGaHZLE+S7lMQU= MIME-Version: 1.0 Received: by 10.182.216.105 with SMTP id op9mr4473401obc.57.1321224398914; Sun, 13 Nov 2011 14:46:38 -0800 (PST) Received: by 10.182.7.34 with HTTP; Sun, 13 Nov 2011 14:46:38 -0800 (PST) In-Reply-To: <20111113220817.GC1677@garage.freebsd.pl> References: <201111122001.pACK1UML059238@svn.freebsd.org> <20111113220817.GC1677@garage.freebsd.pl> Date: Sun, 13 Nov 2011 14:46:38 -0800 Message-ID: From: Garrett Cooper To: Pawel Jakub Dawidek Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, Alexander Motin , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r227473 - head/sbin/geom/class/multipath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Nov 2011 22:46:40 -0000 On Sun, Nov 13, 2011 at 2:08 PM, Pawel Jakub Dawidek wrot= e: > On Sat, Nov 12, 2011 at 12:16:23PM -0800, Garrett Cooper wrote: >> On Sat, Nov 12, 2011 at 12:01 PM, Alexander Motin wrot= e: >> > Author: mav >> > Date: Sat Nov 12 20:01:30 2011 >> > New Revision: 227473 >> > URL: http://svn.freebsd.org/changeset/base/227473 >> > >> > Log: >> > =A0Fix build on some archs after r227464. >> > >> > Modified: >> > =A0head/sbin/geom/class/multipath/geom_multipath.c >> > >> > Modified: head/sbin/geom/class/multipath/geom_multipath.c >> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >> > --- head/sbin/geom/class/multipath/geom_multipath.c =A0 =A0 Sat Nov 12= 19:55:48 2011 =A0 =A0 =A0 =A0(r227472) >> > +++ head/sbin/geom/class/multipath/geom_multipath.c =A0 =A0 Sat Nov 12= 20:01:30 2011 =A0 =A0 =A0 =A0(r227473) >> > @@ -133,7 +133,8 @@ mp_label(struct gctl_req *req) >> > =A0 =A0 =A0 =A0uint8_t *sector, *rsector; >> > =A0 =A0 =A0 =A0char *ptr; >> > =A0 =A0 =A0 =A0uuid_t uuid; >> > - =A0 =A0 =A0 uint32_t secsize =3D 0, ssize, status; >> > + =A0 =A0 =A0 ssize_t secsize =3D 0, ssize; >> > + =A0 =A0 =A0 uint32_t status; >> > =A0 =A0 =A0 =A0const char *name, *name2, *mpname; >> > =A0 =A0 =A0 =A0int error, i, nargs, fd; >> > >> > @@ -161,8 +162,8 @@ mp_label(struct gctl_req *req) >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0disksize =3D msize; >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} else { >> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (secsize !=3D ssize)= { >> > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 gctl_err= or(req, "%s sector size %u different.", >> > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = name, ssize); >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 gctl_err= or(req, "%s sector size %ju different.", >> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = name, (intmax_t)ssize); >> >> Shouldn't that be uintmax_t, not intmax_t ? > > No, ssize_t is signed. Although the best would be to use %zd for > ssize_t. Thanks... Missed the leading s. -Garrett From owner-svn-src-all@FreeBSD.ORG Sun Nov 13 23:09:26 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF6BC106564A; Sun, 13 Nov 2011 23:09:26 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CF8728FC12; Sun, 13 Nov 2011 23:09:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pADN9Qrv012600; Sun, 13 Nov 2011 23:09:26 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pADN9QQ8012598; Sun, 13 Nov 2011 23:09:26 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201111132309.pADN9QQ8012598@svn.freebsd.org> From: Rick Macklem Date: Sun, 13 Nov 2011 23:09:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227493 - head/sys/fs/nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Nov 2011 23:09:27 -0000 Author: rmacklem Date: Sun Nov 13 23:09:26 2011 New Revision: 227493 URL: http://svn.freebsd.org/changeset/base/227493 Log: Move the assignment of default values for some mount options to before the nfs_decode_args() call in the new NFS client, so they don't overwrite the value specified on the command line. MFC after: 2 weeks Modified: head/sys/fs/nfsclient/nfs_clvfsops.c Modified: head/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvfsops.c Sun Nov 13 21:36:20 2011 (r227492) +++ head/sys/fs/nfsclient/nfs_clvfsops.c Sun Nov 13 23:09:26 2011 (r227493) @@ -1212,7 +1212,16 @@ mountnfs(struct nfs_args *argp, struct m vfs_getnewfsid(mp); nmp->nm_mountp = mp; mtx_init(&nmp->nm_mtx, "NFSmount lock", NULL, MTX_DEF | MTX_DUPOK); + + /* + * Since nfs_decode_args() might optionally set them, these need to + * set to defaults before the call, so that the optional settings + * aren't overwritten. + */ nmp->nm_negnametimeo = negnametimeo; + nmp->nm_timeo = NFS_TIMEO; + nmp->nm_retry = NFS_RETRANS; + nmp->nm_readahead = NFS_DEFRAHEAD; nfs_decode_args(mp, nmp, argp, hst, cred, td); @@ -1231,8 +1240,6 @@ mountnfs(struct nfs_args *argp, struct m else nmp->nm_maxfilesize = OFF_MAX; - nmp->nm_timeo = NFS_TIMEO; - nmp->nm_retry = NFS_RETRANS; if ((argp->flags & (NFSMNT_NFSV3 | NFSMNT_NFSV4)) == 0) { nmp->nm_wsize = NFS_WSIZE; nmp->nm_rsize = NFS_RSIZE; @@ -1240,7 +1247,6 @@ mountnfs(struct nfs_args *argp, struct m } nmp->nm_wcommitsize = hibufspace / (desiredvnodes / 1000); nmp->nm_numgrps = NFS_MAXGRPS; - nmp->nm_readahead = NFS_DEFRAHEAD; nmp->nm_tprintf_delay = nfs_tprintf_delay; if (nmp->nm_tprintf_delay < 0) nmp->nm_tprintf_delay = 0; From owner-svn-src-all@FreeBSD.ORG Sun Nov 13 23:20:55 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3BBD51065690; Sun, 13 Nov 2011 23:20:55 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-pz0-f44.google.com (mail-pz0-f44.google.com [209.85.210.44]) by mx1.freebsd.org (Postfix) with ESMTP id F00518FC13; Sun, 13 Nov 2011 23:20:54 +0000 (UTC) Received: by pzk33 with SMTP id 33so21959612pzk.3 for ; Sun, 13 Nov 2011 15:20:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=CTUo3LOxDv+/lCRpkPZ2mABkar/vdA6uTfkdeJi+HEE=; b=RECKfmPM0xY6Ivdai5lm7cdKm6PXR56Gkj4rNB6Jov1+fAZbSbsRQd6Ta/uwfxUXNE yWfNdQbt1XD3T9LDWMD3jRqWaX9/U8Hnda/QvJSxYDLXcjOfyOUv8MWlxq68IHUkbrnD j4YsAcrOCI1XNiqYKy4YOOk20npKZQ0y5kDuk= MIME-Version: 1.0 Received: by 10.68.27.166 with SMTP id u6mr44332803pbg.59.1321225029628; Sun, 13 Nov 2011 14:57:09 -0800 (PST) Sender: mdf356@gmail.com Received: by 10.68.56.97 with HTTP; Sun, 13 Nov 2011 14:57:09 -0800 (PST) In-Reply-To: References: <201111122001.pACK1UML059238@svn.freebsd.org> <20111113220817.GC1677@garage.freebsd.pl> Date: Sun, 13 Nov 2011 14:57:09 -0800 X-Google-Sender-Auth: OejJTDKKnAYD1w85Q5siyHo2EWA Message-ID: From: mdf@FreeBSD.org To: Garrett Cooper Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, Alexander Motin , src-committers@freebsd.org, Pawel Jakub Dawidek , svn-src-all@freebsd.org Subject: Re: svn commit: r227473 - head/sbin/geom/class/multipath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Nov 2011 23:20:55 -0000 On Sun, Nov 13, 2011 at 2:46 PM, Garrett Cooper wrote: > On Sun, Nov 13, 2011 at 2:08 PM, Pawel Jakub Dawidek wr= ote: >> On Sat, Nov 12, 2011 at 12:16:23PM -0800, Garrett Cooper wrote: >>> On Sat, Nov 12, 2011 at 12:01 PM, Alexander Motin wro= te: >>> > Author: mav >>> > Date: Sat Nov 12 20:01:30 2011 >>> > New Revision: 227473 >>> > URL: http://svn.freebsd.org/changeset/base/227473 >>> > >>> > Log: >>> > =A0Fix build on some archs after r227464. >>> > >>> > Modified: >>> > =A0head/sbin/geom/class/multipath/geom_multipath.c >>> > >>> > Modified: head/sbin/geom/class/multipath/geom_multipath.c >>> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>> > --- head/sbin/geom/class/multipath/geom_multipath.c =A0 =A0 Sat Nov 1= 2 19:55:48 2011 =A0 =A0 =A0 =A0(r227472) >>> > +++ head/sbin/geom/class/multipath/geom_multipath.c =A0 =A0 Sat Nov 1= 2 20:01:30 2011 =A0 =A0 =A0 =A0(r227473) >>> > @@ -133,7 +133,8 @@ mp_label(struct gctl_req *req) >>> > =A0 =A0 =A0 =A0uint8_t *sector, *rsector; >>> > =A0 =A0 =A0 =A0char *ptr; >>> > =A0 =A0 =A0 =A0uuid_t uuid; >>> > - =A0 =A0 =A0 uint32_t secsize =3D 0, ssize, status; >>> > + =A0 =A0 =A0 ssize_t secsize =3D 0, ssize; >>> > + =A0 =A0 =A0 uint32_t status; >>> > =A0 =A0 =A0 =A0const char *name, *name2, *mpname; >>> > =A0 =A0 =A0 =A0int error, i, nargs, fd; >>> > >>> > @@ -161,8 +162,8 @@ mp_label(struct gctl_req *req) >>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0disksize =3D msize; >>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} else { >>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (secsize !=3D ssize= ) { >>> > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 gctl_er= ror(req, "%s sector size %u different.", >>> > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= name, ssize); >>> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 gctl_er= ror(req, "%s sector size %ju different.", >>> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= name, (intmax_t)ssize); >>> >>> Shouldn't that be uintmax_t, not intmax_t ? >> >> No, ssize_t is signed. Although the best would be to use %zd for >> ssize_t. > > Thanks... Missed the leading s. ... except that the cast and conversion specifier aren't in sync. The cast is signed; the conversion specifier is unsigned. %zd is still best, since it's the conversion specifier for the variable's type. Next best is %jd and cast to intmax_t, since the signedness is preserved. But in the end it doesn't matter a lot since whatever is printed in the error message, it's likely derivable from reading the code what the actual value used was. Cheers, matthew From owner-svn-src-all@FreeBSD.ORG Mon Nov 14 00:10:12 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 096D7106566C; Mon, 14 Nov 2011 00:10:12 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EDCEC8FC0A; Mon, 14 Nov 2011 00:10:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAE0ABcA014647; Mon, 14 Nov 2011 00:10:11 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAE0ABvg014645; Mon, 14 Nov 2011 00:10:11 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201111140010.pAE0ABvg014645@svn.freebsd.org> From: Rick Macklem Date: Mon, 14 Nov 2011 00:10:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227494 - head/sys/fs/nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Nov 2011 00:10:12 -0000 Author: rmacklem Date: Mon Nov 14 00:10:11 2011 New Revision: 227494 URL: http://svn.freebsd.org/changeset/base/227494 Log: Since NFSv4 byte range locking only works for regular files, add a sanity check for the vnode type to the NFSv4 client. MFC after: 2 weeks Modified: head/sys/fs/nfsclient/nfs_clvnops.c Modified: head/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvnops.c Sun Nov 13 23:09:26 2011 (r227493) +++ head/sys/fs/nfsclient/nfs_clvnops.c Mon Nov 14 00:10:11 2011 (r227494) @@ -2941,6 +2941,8 @@ nfs_advlock(struct vop_advlock_args *ap) u_quad_t size; if (NFS_ISV4(vp) && (ap->a_flags & (F_POSIX | F_FLOCK)) != 0) { + if (vp->v_type != VREG) + return (EINVAL); if ((ap->a_flags & F_POSIX) != 0) cred = p->p_ucred; else From owner-svn-src-all@FreeBSD.ORG Mon Nov 14 00:45:25 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA1D5106566C; Mon, 14 Nov 2011 00:45:25 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A9AD18FC16; Mon, 14 Nov 2011 00:45:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAE0jP0j015842; Mon, 14 Nov 2011 00:45:25 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAE0jPIV015840; Mon, 14 Nov 2011 00:45:25 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <201111140045.pAE0jPIV015840@svn.freebsd.org> From: Ken Smith Date: Mon, 14 Nov 2011 00:45:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227495 - stable/9/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Nov 2011 00:45:25 -0000 Author: kensmith Date: Mon Nov 14 00:45:25 2011 New Revision: 227495 URL: http://svn.freebsd.org/changeset/base/227495 Log: The releng/9.0 release branch has been created so convert stable/9 over to our standard "Politically Correct" name for the balance of the 9.0-RELEASE release cycle. Approved by: re (implicit) Modified: stable/9/sys/conf/newvers.sh Modified: stable/9/sys/conf/newvers.sh ============================================================================== --- stable/9/sys/conf/newvers.sh Mon Nov 14 00:10:11 2011 (r227494) +++ stable/9/sys/conf/newvers.sh Mon Nov 14 00:45:25 2011 (r227495) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="9.0" -BRANCH="RC2" +BRANCH="PRERELEASE" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@FreeBSD.ORG Mon Nov 14 05:31:26 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76E61106566C; Mon, 14 Nov 2011 05:31:26 +0000 (UTC) (envelope-from peterjeremy@acm.org) Received: from mail17.syd.optusnet.com.au (mail17.syd.optusnet.com.au [211.29.132.198]) by mx1.freebsd.org (Postfix) with ESMTP id 079D98FC0C; Mon, 14 Nov 2011 05:31:25 +0000 (UTC) Received: from server.vk2pj.dyndns.org (c220-239-116-103.belrs4.nsw.optusnet.com.au [220.239.116.103]) by mail17.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id pAE5VHBH019707 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 14 Nov 2011 16:31:18 +1100 X-Bogosity: Ham, spamicity=0.000000 Received: from server.vk2pj.dyndns.org (localhost.vk2pj.dyndns.org [127.0.0.1]) by server.vk2pj.dyndns.org (8.14.5/8.14.4) with ESMTP id pAE5VHZh091333; Mon, 14 Nov 2011 16:31:17 +1100 (EST) (envelope-from peter@server.vk2pj.dyndns.org) Received: (from peter@localhost) by server.vk2pj.dyndns.org (8.14.5/8.14.4/Submit) id pAE5VG2O091332; Mon, 14 Nov 2011 16:31:16 +1100 (EST) (envelope-from peter) Date: Mon, 14 Nov 2011 16:31:16 +1100 From: Peter Jeremy To: David Chisnall Message-ID: <20111114053116.GA91295@server.vk2pj.dyndns.org> References: <201111122016.pACKG7sr059722@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="OXfL5xGRrasGEqWY" Content-Disposition: inline In-Reply-To: <201111122016.pACKG7sr059722@svn.freebsd.org> X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r227474 - head/sys/amd64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Nov 2011 05:31:26 -0000 --OXfL5xGRrasGEqWY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2011-Nov-12 20:16:07 +0000, David Chisnall wrote: > Fix SIGATOMIC_M{IN,AX} on x86-64. Thanks for that. I have two comments: 1) Could you please wrap your log messages so that lines do not exceed 80 characters. > /* Limits of sig_atomic_t. */ >-#define SIG_ATOMIC_MIN INT32_MIN >-#define SIG_ATOMIC_MAX INT32_MAX >+#define SIG_ATOMIC_MIN LONG_MIN >+#define SIG_ATOMIC_MAX LONG_MAX 2) As far as I can see, all other defines in _stdint.h, across all architectures, have explicit lengths, so I believe this would be better specified as: #define SIG_ATOMIC_MIN INT64_MIN #define SIG_ATOMIC_MAX INT64_MAX --=20 Peter Jeremy --OXfL5xGRrasGEqWY Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk7Ap6QACgkQ/opHv/APuIeRbQCfW2Y3QbNypiPI6v6jRgmbyguG ehgAnAgE/wPsM63+QkKLT3tmatXX/ini =/kNB -----END PGP SIGNATURE----- --OXfL5xGRrasGEqWY-- From owner-svn-src-all@FreeBSD.ORG Mon Nov 14 07:12:10 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9908D106564A; Mon, 14 Nov 2011 07:12:10 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 882578FC16; Mon, 14 Nov 2011 07:12:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAE7CAsU031300; Mon, 14 Nov 2011 07:12:10 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAE7CARc031296; Mon, 14 Nov 2011 07:12:10 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201111140712.pAE7CARc031296@svn.freebsd.org> From: Alfred Perlstein Date: Mon, 14 Nov 2011 07:12:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227496 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Nov 2011 07:12:10 -0000 Author: alfred Date: Mon Nov 14 07:12:10 2011 New Revision: 227496 URL: http://svn.freebsd.org/changeset/base/227496 Log: Constify args to copyiniov and copyinuio. Modified: head/sys/kern/subr_uio.c head/sys/sys/uio.h Modified: head/sys/kern/subr_uio.c ============================================================================== --- head/sys/kern/subr_uio.c Mon Nov 14 00:45:25 2011 (r227495) +++ head/sys/kern/subr_uio.c Mon Nov 14 07:12:10 2011 (r227496) @@ -437,7 +437,7 @@ copyinstrfrom(const void * __restrict sr } int -copyiniov(struct iovec *iovp, u_int iovcnt, struct iovec **iov, int error) +copyiniov(const struct iovec *iovp, u_int iovcnt, struct iovec **iov, int error) { u_int iovlen; @@ -455,7 +455,7 @@ copyiniov(struct iovec *iovp, u_int iovc } int -copyinuio(struct iovec *iovp, u_int iovcnt, struct uio **uiop) +copyinuio(const struct iovec *iovp, u_int iovcnt, struct uio **uiop) { struct iovec *iov; struct uio *uio; Modified: head/sys/sys/uio.h ============================================================================== --- head/sys/sys/uio.h Mon Nov 14 00:45:25 2011 (r227495) +++ head/sys/sys/uio.h Mon Nov 14 07:12:10 2011 (r227496) @@ -89,11 +89,11 @@ struct vm_page; struct uio *cloneuio(struct uio *uiop); int copyinfrom(const void * __restrict src, void * __restrict dst, size_t len, int seg); -int copyiniov(struct iovec *iovp, u_int iovcnt, struct iovec **iov, +int copyiniov(const struct iovec *iovp, u_int iovcnt, struct iovec **iov, int error); int copyinstrfrom(const void * __restrict src, void * __restrict dst, size_t len, size_t * __restrict copied, int seg); -int copyinuio(struct iovec *iovp, u_int iovcnt, struct uio **uiop); +int copyinuio(const struct iovec *iovp, u_int iovcnt, struct uio **uiop); int copyout_map(struct thread *td, vm_offset_t *addr, size_t sz); int copyout_unmap(struct thread *td, vm_offset_t addr, size_t sz); int uiomove(void *cp, int n, struct uio *uio); From owner-svn-src-all@FreeBSD.ORG Mon Nov 14 08:01:23 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C7030106566B; Mon, 14 Nov 2011 08:01:23 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id 860C18FC12; Mon, 14 Nov 2011 08:01:23 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:d8ac:9806:a63d:a8d4] (unknown [IPv6:2001:7b8:3a7:0:d8ac:9806:a63d:a8d4]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id AD8D95C59; Mon, 14 Nov 2011 09:01:22 +0100 (CET) Message-ID: <4EC0CAD0.1070100@FreeBSD.org> Date: Mon, 14 Nov 2011 09:01:20 +0100 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 To: Peter Jeremy References: <201111122016.pACKG7sr059722@svn.freebsd.org> <20111114053116.GA91295@server.vk2pj.dyndns.org> In-Reply-To: <20111114053116.GA91295@server.vk2pj.dyndns.org> X-Enigmail-Version: 1.3.3 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, David Chisnall Subject: Re: svn commit: r227474 - head/sys/amd64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Nov 2011 08:01:23 -0000 On 2011-11-14 06:31, Peter Jeremy wrote: > On 2011-Nov-12 20:16:07 +0000, David Chisnall wrote: ... >> +#define SIG_ATOMIC_MIN LONG_MIN >> +#define SIG_ATOMIC_MAX LONG_MAX > > 2) As far as I can see, all other defines in _stdint.h, across all > architectures, have explicit lengths, so I believe this would be > better specified as: > > #define SIG_ATOMIC_MIN INT64_MIN > #define SIG_ATOMIC_MAX INT64_MAX Why? On amd64, sig_atomic_t is defined as long, so LONG_MIN and LONG_MAX are more logical. In fact, for all architectures, sig_atomic_t is either int or long, so INTnn_MIN/MAX is rather strangely chosen. From owner-svn-src-all@FreeBSD.ORG Mon Nov 14 08:21:35 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D4AC1065670; Mon, 14 Nov 2011 08:21:35 +0000 (UTC) (envelope-from stefan@fafoe.narf.at) Received: from fep18.mx.upcmail.net (fep18.mx.upcmail.net [62.179.121.38]) by mx1.freebsd.org (Postfix) with ESMTP id C5D9E8FC16; Mon, 14 Nov 2011 08:21:33 +0000 (UTC) Received: from edge01.upcmail.net ([192.168.13.236]) by viefep18-int.chello.at (InterMail vM.8.01.02.02 201-2260-120-106-20100312) with ESMTP id <20111114082131.EDTG1564.viefep18-int.chello.at@edge01.upcmail.net>; Mon, 14 Nov 2011 09:21:31 +0100 Received: from mole.fafoe.narf.at ([213.47.85.26]) by edge01.upcmail.net with edge id wwMW1h0120a5KZh01wMXFp; Mon, 14 Nov 2011 09:21:31 +0100 X-SourceIP: 213.47.85.26 Received: by mole.fafoe.narf.at (Postfix, from userid 1001) id 485DE6D421; Mon, 14 Nov 2011 09:21:30 +0100 (CET) Date: Mon, 14 Nov 2011 09:21:30 +0100 From: Stefan Farfeleder To: David Chisnall Message-ID: <20111114082129.GA1596@mole.fafoe.narf.at> References: <201111131618.pADGIm2n099696@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201111131618.pADGIm2n099696@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Cloudmark-Analysis: v=1.1 cv=h6X7fkn2Y8psEldlT1JduSyVgv7YVLWttKdqKtnr7ik= c=1 sm=0 a=wom5GMh1gUkA:10 a=f7SxzaMzl38A:10 a=dBRESv0yCI8A:10 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=Y-fD9IKKHXjQ9bP-RQgA:9 a=CjuIK1q_8ugA:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r227487 - head/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Nov 2011 08:21:35 -0000 On Sun, Nov 13, 2011 at 04:18:48PM +0000, David Chisnall wrote: > Author: theraven > Date: Sun Nov 13 16:18:48 2011 > New Revision: 227487 > URL: http://svn.freebsd.org/changeset/base/227487 > > Log: > The spec says that FILE must be defined in wchar.h, but it wasn't. It > is now. Also hide some macros in C++ mode that will break C++ > namespaced calls. > > Approved by: dim (mentor) I think this change is wrong. Whic spec are you referring to? C99 defines FILE only in 7.19.1#2 (stdio.h). In other headers FILE is used as parameter type for functions but that does not mean it is exported to user space. Stefan From owner-svn-src-all@FreeBSD.ORG Mon Nov 14 08:29:50 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 489CC106564A; Mon, 14 Nov 2011 08:29:50 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D88B58FC14; Mon, 14 Nov 2011 08:29:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAE8TncN034753; Mon, 14 Nov 2011 08:29:49 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAE8TngF034751; Mon, 14 Nov 2011 08:29:49 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201111140829.pAE8TngF034751@svn.freebsd.org> From: Martin Matuska Date: Mon, 14 Nov 2011 08:29:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227497 - head/cddl/contrib/opensolaris/cmd/zpool X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Nov 2011 08:29:50 -0000 Author: mm Date: Mon Nov 14 08:29:49 2011 New Revision: 227497 URL: http://svn.freebsd.org/changeset/base/227497 Log: Import upstream changesets for the output of the "zpool" command: 952 separate intent logs should be obvious in 'zpool iostat' output 1337 `zpool status -D' should tell if there are no DDT entries References: https://www.illumos.org/issues/952 https://www.illumos.org/issues/1337 Obtained from: Illumos (issues 952, 1337; changesets 13384, 13432) MFC after: 1 week Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Mon Nov 14 07:12:10 2011 (r227496) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Mon Nov 14 08:29:49 2011 (r227497) @@ -21,6 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright 2011 Nexenta Systems, Inc. All rights reserved. */ #include @@ -2206,10 +2207,15 @@ print_vdev_stats(zpool_handle_t *zhp, co return; for (c = 0; c < children; c++) { - uint64_t ishole = B_FALSE; + uint64_t ishole = B_FALSE, islog = B_FALSE; - if (nvlist_lookup_uint64(newchild[c], - ZPOOL_CONFIG_IS_HOLE, &ishole) == 0 && ishole) + (void) nvlist_lookup_uint64(newchild[c], ZPOOL_CONFIG_IS_HOLE, + &ishole); + + (void) nvlist_lookup_uint64(newchild[c], ZPOOL_CONFIG_IS_LOG, + &islog); + + if (ishole || islog) continue; vname = zpool_vdev_name(g_zfs, zhp, newchild[c], B_FALSE); @@ -2219,6 +2225,31 @@ print_vdev_stats(zpool_handle_t *zhp, co } /* + * Log device section + */ + + if (num_logs(newnv) > 0) { + (void) printf("%-*s - - - - - " + "-\n", cb->cb_namewidth, "logs"); + + for (c = 0; c < children; c++) { + uint64_t islog = B_FALSE; + (void) nvlist_lookup_uint64(newchild[c], + ZPOOL_CONFIG_IS_LOG, &islog); + + if (islog) { + vname = zpool_vdev_name(g_zfs, zhp, newchild[c], + B_FALSE); + print_vdev_stats(zhp, vname, oldnv ? + oldchild[c] : NULL, newchild[c], + cb, depth + 2); + free(vname); + } + } + + } + + /* * Include level 2 ARC devices in iostat output */ if (nvlist_lookup_nvlist_array(newnv, ZPOOL_CONFIG_L2CACHE, @@ -3565,10 +3596,16 @@ print_dedup_stats(nvlist_t *config) * table continue processing the stats. */ if (nvlist_lookup_uint64_array(config, ZPOOL_CONFIG_DDT_OBJ_STATS, - (uint64_t **)&ddo, &c) != 0 || ddo->ddo_count == 0) + (uint64_t **)&ddo, &c) != 0) return; (void) printf("\n"); + (void) printf(gettext(" dedup: ")); + if (ddo->ddo_count == 0) { + (void) printf(gettext("no DDT entries\n")); + return; + } + (void) printf("DDT entries %llu, size %llu on disk, %llu in core\n", (u_longlong_t)ddo->ddo_count, (u_longlong_t)ddo->ddo_dspace, From owner-svn-src-all@FreeBSD.ORG Mon Nov 14 09:01:59 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 482251065673; Mon, 14 Nov 2011 09:01:59 +0000 (UTC) (envelope-from bright@elvis.mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 339AB8FC12; Mon, 14 Nov 2011 09:01:59 +0000 (UTC) Received: by elvis.mu.org (Postfix, from userid 1192) id BDA311A3C6C; Mon, 14 Nov 2011 01:01:58 -0800 (PST) Date: Mon, 14 Nov 2011 01:01:58 -0800 From: Alfred Perlstein To: Doug Barton Message-ID: <20111114090157.GB1455@elvis.mu.org> References: <201111130318.pAD3IvGr074144@svn.freebsd.org> <32EF12FA-07AC-481C-A407-3C8B578484C4@gmail.com> <20111113122150.GA62828@stack.nl> <4EC03608.1050807@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4EC03608.1050807@FreeBSD.org> User-Agent: Mutt/1.4.2.3i Cc: Garrett Cooper , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Jilles Tjoelker Subject: Re: svn commit: r227483 - head/usr.sbin/portsnap/portsnap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Nov 2011 09:01:59 -0000 * Doug Barton [111113 13:26] wrote: > On 11/13/2011 04:21, Jilles Tjoelker wrote: > > Given that you are already using 'local', why not use it everywhere? You > > may need to split up some functions to do this. > > You might want to look more deeply at the portsnap code before you > recommend that Alfred take responsibility for roto-tilling it. :) I > looked at it, and ran away screaming. The fact that Alfred is willing to > take on the task of making some incremental improvements is a feature. http://memegenerator.net/cache/instances/400x/10/11149/11417307.jpg -- - Alfred Perlstein .- VMOA #5191, 03 vmax, 92 gs500, 85 ch250, 07 zx10 .- FreeBSD committer From owner-svn-src-all@FreeBSD.ORG Mon Nov 14 10:00:37 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 13CA610656B3; Mon, 14 Nov 2011 10:00:37 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id C81A28FC0C; Mon, 14 Nov 2011 10:00:36 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:d8ac:9806:a63d:a8d4] (unknown [IPv6:2001:7b8:3a7:0:d8ac:9806:a63d:a8d4]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 9F7CB5C59; Mon, 14 Nov 2011 11:00:35 +0100 (CET) Message-ID: <4EC0E6C2.4010509@FreeBSD.org> Date: Mon, 14 Nov 2011 11:00:34 +0100 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 To: Stefan Farfeleder References: <201111131618.pADGIm2n099696@svn.freebsd.org> <20111114082129.GA1596@mole.fafoe.narf.at> In-Reply-To: <20111114082129.GA1596@mole.fafoe.narf.at> X-Enigmail-Version: 1.3.3 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, David Chisnall Subject: Re: svn commit: r227487 - head/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Nov 2011 10:00:37 -0000 On 2011-11-14 09:21, Stefan Farfeleder wrote: > On Sun, Nov 13, 2011 at 04:18:48PM +0000, David Chisnall wrote: >> Author: theraven >> Date: Sun Nov 13 16:18:48 2011 >> New Revision: 227487 >> URL: http://svn.freebsd.org/changeset/base/227487 >> >> Log: >> The spec says that FILE must be defined in wchar.h, but it wasn't. It >> is now. Also hide some macros in C++ mode that will break C++ >> namespaced calls. >> >> Approved by: dim (mentor) > > I think this change is wrong. Whic spec are you referring to? C99 > defines FILE only in 7.19.1#2 (stdio.h). In other headers FILE is used > as parameter type for functions but that does not mean it is exported to > user space. http://pubs.opengroup.org/onlinepubs/007908799/xsh/wchar.h.html From owner-svn-src-all@FreeBSD.ORG Mon Nov 14 15:10:02 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B6B6106564A; Mon, 14 Nov 2011 15:10:02 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E91258FC14; Mon, 14 Nov 2011 15:10:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAEFA19R054425; Mon, 14 Nov 2011 15:10:01 GMT (envelope-from pho@svn.freebsd.org) Received: (from pho@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAEFA1O7054423; Mon, 14 Nov 2011 15:10:01 GMT (envelope-from pho@svn.freebsd.org) Message-Id: <201111141510.pAEFA1O7054423@svn.freebsd.org> From: Peter Holm Date: Mon, 14 Nov 2011 15:10:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227498 - stable/8/sys/fs/tmpfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Nov 2011 15:10:02 -0000 Author: pho Date: Mon Nov 14 15:10:01 2011 New Revision: 227498 URL: http://svn.freebsd.org/changeset/base/227498 Log: MFC: r226987 Added missing cache purge of from argument for rename(). Modified: stable/8/sys/fs/tmpfs/tmpfs_vnops.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- stable/8/sys/fs/tmpfs/tmpfs_vnops.c Mon Nov 14 08:29:49 2011 (r227497) +++ stable/8/sys/fs/tmpfs/tmpfs_vnops.c Mon Nov 14 15:10:01 2011 (r227498) @@ -1080,6 +1080,7 @@ tmpfs_rename(struct vop_rename_args *v) * really reclaimed. */ tmpfs_free_dirent(VFS_TO_TMPFS(tvp->v_mount), de, TRUE); } + cache_purge(fvp); error = 0; From owner-svn-src-all@FreeBSD.ORG Mon Nov 14 15:10:43 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 049B21065686; Mon, 14 Nov 2011 15:10:43 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E91268FC21; Mon, 14 Nov 2011 15:10:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAEFAgX8054482; Mon, 14 Nov 2011 15:10:42 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAEFAg7E054480; Mon, 14 Nov 2011 15:10:42 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201111141510.pAEFAg7E054480@svn.freebsd.org> From: Andre Oppermann Date: Mon, 14 Nov 2011 15:10:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227499 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Nov 2011 15:10:43 -0000 Author: andre Date: Mon Nov 14 15:10:42 2011 New Revision: 227499 URL: http://svn.freebsd.org/changeset/base/227499 Log: Note the ip_len bug fixed in r226105 in the BUGS section. Modified: head/share/man/man4/ip.4 Modified: head/share/man/man4/ip.4 ============================================================================== --- head/share/man/man4/ip.4 Mon Nov 14 15:10:01 2011 (r227498) +++ head/share/man/man4/ip.4 Mon Nov 14 15:10:42 2011 (r227499) @@ -32,7 +32,7 @@ .\" @(#)ip.4 8.2 (Berkeley) 11/30/93 .\" $FreeBSD$ .\" -.Dd June 1, 2009 +.Dd November 14, 2011 .Dt IP 4 .Os .Sh NAME @@ -847,3 +847,9 @@ The .Vt ip_mreqn structure appeared in .Tn Linux 2.4 . +.Sh BUGS +Before +.Fx 10.0 packets received on raw IP sockets had the +.Va ip_hl +subtracted from the +.Va ip_len field. From owner-svn-src-all@FreeBSD.ORG Mon Nov 14 15:14:42 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E49AA1065673; Mon, 14 Nov 2011 15:14:42 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D48D58FC16; Mon, 14 Nov 2011 15:14:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAEFEgEn054642; Mon, 14 Nov 2011 15:14:42 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAEFEgvu054640; Mon, 14 Nov 2011 15:14:42 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201111141514.pAEFEgvu054640@svn.freebsd.org> From: Andre Oppermann Date: Mon, 14 Nov 2011 15:14:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227500 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Nov 2011 15:14:43 -0000 Author: andre Date: Mon Nov 14 15:14:42 2011 New Revision: 227500 URL: http://svn.freebsd.org/changeset/base/227500 Log: Remove mention of ss_fltsz and ss_fltsz_local which were retired in r226447. Modified: head/share/man/man4/tcp.4 Modified: head/share/man/man4/tcp.4 ============================================================================== --- head/share/man/man4/tcp.4 Mon Nov 14 15:10:42 2011 (r227499) +++ head/share/man/man4/tcp.4 Mon Nov 14 15:14:42 2011 (r227500) @@ -38,7 +38,7 @@ .\" From: @(#)tcp.4 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd September 15, 2011 +.Dd November 14, 2011 .Dt TCP 4 .Os .Sh NAME @@ -290,14 +290,6 @@ That of 2 results in any packets to closed ports being logged. Any value unlisted above disables the logging (default is 0, i.e., the logging is disabled). -.It Va slowstart_flightsize -The number of packets allowed to be in-flight during the -.Tn TCP -slow-start phase on a non-local network. -.It Va local_slowstart_flightsize -The number of packets allowed to be in-flight during the -.Tn TCP -slow-start phase to local machines in the same subnet. .It Va msl The Maximum Segment Lifetime, in milliseconds, for a packet. .It Va keepinit @@ -411,15 +403,6 @@ maximum segment size. This helps throughput in general, but particularly affects short transfers and high-bandwidth large propagation-delay connections. -.Pp -When this feature is enabled, the -.Va slowstart_flightsize -and -.Va local_slowstart_flightsize -settings are not observed for new -connection slow starts, but they are still used for slow starts -that occur when the connection has been idle and starts sending -again. .It Va sack.enable Enable support for RFC 2018, TCP Selective Acknowledgment option, which allows the receiver to inform the sender about all successfully From owner-svn-src-all@FreeBSD.ORG Mon Nov 14 15:39:00 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DCE6C106566B; Mon, 14 Nov 2011 15:39:00 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-yx0-f182.google.com (mail-yx0-f182.google.com [209.85.213.182]) by mx1.freebsd.org (Postfix) with ESMTP id 63A628FC0A; Mon, 14 Nov 2011 15:39:00 +0000 (UTC) Received: by yenl11 with SMTP id l11so1593008yen.13 for ; Mon, 14 Nov 2011 07:38:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=7nhyNTuwcWzOwzXch/uxk47MQa92EzPM0OHqD84C5i8=; b=k8nekzyWLHP7lUwSNOyOl26ve7UFJf0ycCilTjN50C/SNEk9HG70hae8qNLzTPZcNy g5Y5L3DXlfY2F6pWXMREDos48ppugjEoBuKM+V3eGcy+kSSNpgV4OwyzUxWH2dmtiHRg nA8ZHzn2nR+2DA6rTqiKj7bs3U81aDXq9k+FU= MIME-Version: 1.0 Received: by 10.182.59.49 with SMTP id w17mr5082615obq.37.1321285139753; Mon, 14 Nov 2011 07:38:59 -0800 (PST) Received: by 10.182.7.34 with HTTP; Mon, 14 Nov 2011 07:38:59 -0800 (PST) In-Reply-To: <201111141510.pAEFAg7E054480@svn.freebsd.org> References: <201111141510.pAEFAg7E054480@svn.freebsd.org> Date: Mon, 14 Nov 2011 07:38:59 -0800 Message-ID: From: Garrett Cooper To: Andre Oppermann Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r227499 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Nov 2011 15:39:01 -0000 On Mon, Nov 14, 2011 at 7:10 AM, Andre Oppermann wrote: > Author: andre > Date: Mon Nov 14 15:10:42 2011 > New Revision: 227499 > URL: http://svn.freebsd.org/changeset/base/227499 > > Log: > =A0Note the ip_len bug fixed in r226105 in the BUGS section. > > Modified: > =A0head/share/man/man4/ip.4 > > Modified: head/share/man/man4/ip.4 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/share/man/man4/ip.4 =A0 =A0Mon Nov 14 15:10:01 2011 =A0 =A0 =A0 = =A0(r227498) > +++ head/share/man/man4/ip.4 =A0 =A0Mon Nov 14 15:10:42 2011 =A0 =A0 =A0 = =A0(r227499) > @@ -32,7 +32,7 @@ > =A0.\" =A0 =A0 @(#)ip.4 =A0 =A0 =A0 8.2 (Berkeley) 11/30/93 > =A0.\" $FreeBSD$ > =A0.\" > -.Dd June 1, 2009 > +.Dd November 14, 2011 > =A0.Dt IP 4 > =A0.Os > =A0.Sh NAME > @@ -847,3 +847,9 @@ The > =A0.Vt ip_mreqn > =A0structure appeared in > =A0.Tn Linux 2.4 . > +.Sh BUGS > +Before > +.Fx 10.0 packets received on raw IP sockets had the > +.Va ip_hl > +subtracted from the > +.Va ip_len field. Isn't the fix going to be MFCed? -Garrett From owner-svn-src-all@FreeBSD.ORG Mon Nov 14 15:55:43 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 40D2C1065674 for ; Mon, 14 Nov 2011 15:55:43 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.freebsd.org (Postfix) with ESMTP id A43398FC0C for ; Mon, 14 Nov 2011 15:55:42 +0000 (UTC) Received: (qmail 18777 invoked from network); 14 Nov 2011 14:30:46 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 14 Nov 2011 14:30:45 -0000 Message-ID: <4EC139FC.8020301@freebsd.org> Date: Mon, 14 Nov 2011 16:55:40 +0100 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 To: Garrett Cooper References: <201111141510.pAEFAg7E054480@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r227499 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Nov 2011 15:55:43 -0000 On 14.11.2011 16:38, Garrett Cooper wrote: > On Mon, Nov 14, 2011 at 7:10 AM, Andre Oppermann wrote: >> Author: andre >> Date: Mon Nov 14 15:10:42 2011 >> New Revision: 227499 >> URL: http://svn.freebsd.org/changeset/base/227499 >> >> Log: >> Note the ip_len bug fixed in r226105 in the BUGS section. >> >> Modified: >> head/share/man/man4/ip.4 >> >> Modified: head/share/man/man4/ip.4 >> ============================================================================== >> --- head/share/man/man4/ip.4 Mon Nov 14 15:10:01 2011 (r227498) >> +++ head/share/man/man4/ip.4 Mon Nov 14 15:10:42 2011 (r227499) >> @@ -32,7 +32,7 @@ >> .\" @(#)ip.4 8.2 (Berkeley) 11/30/93 >> .\" $FreeBSD$ >> .\" >> -.Dd June 1, 2009 >> +.Dd November 14, 2011 >> .Dt IP 4 >> .Os >> .Sh NAME >> @@ -847,3 +847,9 @@ The >> .Vt ip_mreqn >> structure appeared in >> .Tn Linux 2.4 . >> +.Sh BUGS >> +Before >> +.Fx 10.0 packets received on raw IP sockets had the >> +.Va ip_hl >> +subtracted from the >> +.Va ip_len field. > > Isn't the fix going to be MFCed? It was. However there are some ports depending on this bug and due to the late stage we are in the release cycle we decided to back out the MFC. -- Andre From owner-svn-src-all@FreeBSD.ORG Mon Nov 14 15:57:04 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 26D52106566C; Mon, 14 Nov 2011 15:57:04 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1719D8FC12; Mon, 14 Nov 2011 15:57:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAEFv32n055950; Mon, 14 Nov 2011 15:57:03 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAEFv3xS055948; Mon, 14 Nov 2011 15:57:03 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201111141557.pAEFv3xS055948@svn.freebsd.org> From: Andre Oppermann Date: Mon, 14 Nov 2011 15:57:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227501 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Nov 2011 15:57:04 -0000 Author: andre Date: Mon Nov 14 15:57:03 2011 New Revision: 227501 URL: http://svn.freebsd.org/changeset/base/227501 Log: mdoc fix for r227499. Reported by: brueffer Modified: head/share/man/man4/ip.4 Modified: head/share/man/man4/ip.4 ============================================================================== --- head/share/man/man4/ip.4 Mon Nov 14 15:14:42 2011 (r227500) +++ head/share/man/man4/ip.4 Mon Nov 14 15:57:03 2011 (r227501) @@ -849,7 +849,8 @@ structure appeared in .Tn Linux 2.4 . .Sh BUGS Before -.Fx 10.0 packets received on raw IP sockets had the +.Fx 10.0 +packets received on raw IP sockets had the .Va ip_hl subtracted from the .Va ip_len field. From owner-svn-src-all@FreeBSD.ORG Mon Nov 14 18:00:21 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 03B5F1065689; Mon, 14 Nov 2011 18:00:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8C4E78FC1C; Mon, 14 Nov 2011 18:00:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAEI0FE0060023; Mon, 14 Nov 2011 18:00:15 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAEI0FPY060019; Mon, 14 Nov 2011 18:00:15 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201111141800.pAEI0FPY060019@svn.freebsd.org> From: John Baldwin Date: Mon, 14 Nov 2011 18:00:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227502 - in head/sys: compat/freebsd32 kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Nov 2011 18:00:21 -0000 Author: jhb Date: Mon Nov 14 18:00:15 2011 New Revision: 227502 URL: http://svn.freebsd.org/changeset/base/227502 Log: - Split out a kern_posix_fadvise() from the posix_fadvise() system call so it can be used by in-kernel consumers. - Make kern_posix_fallocate() public. - Use kern_posix_fadvise() and kern_posix_fallocate() to implement the freebsd32 wrappers for the two system calls. Modified: head/sys/compat/freebsd32/freebsd32_misc.c head/sys/kern/vfs_syscalls.c head/sys/sys/syscallsubr.h Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Mon Nov 14 15:57:03 2011 (r227501) +++ head/sys/compat/freebsd32/freebsd32_misc.c Mon Nov 14 18:00:15 2011 (r227502) @@ -2828,23 +2828,16 @@ int freebsd32_posix_fallocate(struct thread *td, struct freebsd32_posix_fallocate_args *uap) { - struct posix_fallocate_args ap; - ap.fd = uap->fd; - ap.offset = PAIR32TO64(off_t, uap->offset); - ap.len = PAIR32TO64(off_t, uap->len); - return (sys_posix_fallocate(td, &ap)); + return (kern_posix_fallocate(td, uap->fd, + PAIR32TO64(off_t, uap->offset), PAIR32TO64(off_t, uap->len))); } int freebsd32_posix_fadvise(struct thread *td, struct freebsd32_posix_fadvise_args *uap) { - struct posix_fadvise_args ap; - ap.fd = uap->fd; - ap.offset = PAIR32TO64(off_t, uap->offset); - ap.len = PAIR32TO64(off_t, uap->len); - ap.advice = uap->advice; - return (sys_posix_fadvise(td, &ap)); + return (kern_posix_fadvise(td, uap->fd, PAIR32TO64(off_t, uap->offset), + PAIR32TO64(off_t, uap->len), uap->advice)); } Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Mon Nov 14 15:57:03 2011 (r227501) +++ head/sys/kern/vfs_syscalls.c Mon Nov 14 18:00:15 2011 (r227502) @@ -4753,7 +4753,7 @@ out: return (error); } -static int +int kern_posix_fallocate(struct thread *td, int fd, off_t offset, off_t len) { struct file *fp; @@ -4855,7 +4855,8 @@ sys_posix_fallocate(struct thread *td, s * region of any current setting. */ int -sys_posix_fadvise(struct thread *td, struct posix_fadvise_args *uap) +kern_posix_fadvise(struct thread *td, int fd, off_t offset, off_t len, + int advice) { struct fadvise_info *fa, *new; struct file *fp; @@ -4863,10 +4864,9 @@ sys_posix_fadvise(struct thread *td, str off_t end; int error; - if (uap->offset < 0 || uap->len < 0 || - uap->offset > OFF_MAX - uap->len) + if (offset < 0 || len < 0 || offset > OFF_MAX - len) return (EINVAL); - switch (uap->advice) { + switch (advice) { case POSIX_FADV_SEQUENTIAL: case POSIX_FADV_RANDOM: case POSIX_FADV_NOREUSE: @@ -4881,7 +4881,7 @@ sys_posix_fadvise(struct thread *td, str return (EINVAL); } /* XXX: CAP_POSIX_FADVISE? */ - error = fget(td, uap->fd, 0, &fp); + error = fget(td, fd, 0, &fp); if (error != 0) goto out; @@ -4901,11 +4901,11 @@ sys_posix_fadvise(struct thread *td, str error = ENODEV; goto out; } - if (uap->len == 0) + if (len == 0) end = OFF_MAX; else - end = uap->offset + uap->len - 1; - switch (uap->advice) { + end = offset + len - 1; + switch (advice) { case POSIX_FADV_SEQUENTIAL: case POSIX_FADV_RANDOM: case POSIX_FADV_NOREUSE: @@ -4916,17 +4916,17 @@ sys_posix_fadvise(struct thread *td, str */ mtx_pool_lock(mtxpool_sleep, fp); fa = fp->f_advice; - if (fa != NULL && fa->fa_advice == uap->advice && - ((fa->fa_start <= end && fa->fa_end >= uap->offset) || + if (fa != NULL && fa->fa_advice == advice && + ((fa->fa_start <= end && fa->fa_end >= offset) || (end != OFF_MAX && fa->fa_start == end + 1) || - (fa->fa_end != OFF_MAX && fa->fa_end + 1 == uap->offset))) { - if (uap->offset < fa->fa_start) - fa->fa_start = uap->offset; + (fa->fa_end != OFF_MAX && fa->fa_end + 1 == offset))) { + if (offset < fa->fa_start) + fa->fa_start = offset; if (end > fa->fa_end) fa->fa_end = end; } else { - new->fa_advice = uap->advice; - new->fa_start = uap->offset; + new->fa_advice = advice; + new->fa_start = offset; new->fa_end = end; fp->f_advice = new; new = fa; @@ -4942,18 +4942,15 @@ sys_posix_fadvise(struct thread *td, str mtx_pool_lock(mtxpool_sleep, fp); fa = fp->f_advice; if (fa != NULL) { - if (uap->offset <= fa->fa_start && - end >= fa->fa_end) { + if (offset <= fa->fa_start && end >= fa->fa_end) { new = fa; fp->f_advice = NULL; - } else if (uap->offset <= fa->fa_start && - end >= fa->fa_start) + } else if (offset <= fa->fa_start && + end >= fa->fa_start) fa->fa_start = end + 1; - else if (uap->offset <= fa->fa_end && - end >= fa->fa_end) - fa->fa_end = uap->offset - 1; - else if (uap->offset >= fa->fa_start && - end <= fa->fa_end) { + else if (offset <= fa->fa_end && end >= fa->fa_end) + fa->fa_end = offset - 1; + else if (offset >= fa->fa_start && end <= fa->fa_end) { /* * If the "normal" region is a middle * portion of the existing @@ -4970,7 +4967,7 @@ sys_posix_fadvise(struct thread *td, str break; case POSIX_FADV_WILLNEED: case POSIX_FADV_DONTNEED: - error = VOP_ADVISE(vp, uap->offset, end, uap->advice); + error = VOP_ADVISE(vp, offset, end, advice); break; } out: @@ -4979,3 +4976,11 @@ out: free(new, M_FADVISE); return (error); } + +int +sys_posix_fadvise(struct thread *td, struct posix_fadvise_args *uap) +{ + + return (kern_posix_fadvise(td, uap->fd, uap->offset, uap->len, + uap->advice)); +} Modified: head/sys/sys/syscallsubr.h ============================================================================== --- head/sys/sys/syscallsubr.h Mon Nov 14 15:57:03 2011 (r227501) +++ head/sys/sys/syscallsubr.h Mon Nov 14 18:00:15 2011 (r227502) @@ -153,6 +153,10 @@ int kern_openat(struct thread *td, int f int kern_pathconf(struct thread *td, char *path, enum uio_seg pathseg, int name, u_long flags); int kern_pipe(struct thread *td, int fildes[2]); +int kern_posix_fadvise(struct thread *td, int fd, off_t offset, off_t len, + int advice); +int kern_posix_fallocate(struct thread *td, int fd, off_t offset, + off_t len); int kern_preadv(struct thread *td, int fd, struct uio *auio, off_t offset); int kern_pselect(struct thread *td, int nd, fd_set *in, fd_set *ou, fd_set *ex, struct timeval *tvp, sigset_t *uset, int abi_nfdbits); From owner-svn-src-all@FreeBSD.ORG Mon Nov 14 18:02:42 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C12A3106566B; Mon, 14 Nov 2011 18:02:42 +0000 (UTC) (envelope-from das@FreeBSD.ORG) Received: from zim.MIT.EDU (ZIM.MIT.EDU [18.95.3.101]) by mx1.freebsd.org (Postfix) with ESMTP id 30EE18FC15; Mon, 14 Nov 2011 18:02:35 +0000 (UTC) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.5/8.14.2) with ESMTP id pAEI2Zch058370; Mon, 14 Nov 2011 13:02:35 -0500 (EST) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by zim.MIT.EDU (8.14.5/8.14.2/Submit) id pAEI2ZlL058369; Mon, 14 Nov 2011 13:02:35 -0500 (EST) (envelope-from das@FreeBSD.ORG) Date: Mon, 14 Nov 2011 13:02:35 -0500 From: David Schultz To: Dimitry Andric Message-ID: <20111114180235.GA58284@zim.MIT.EDU> Mail-Followup-To: Dimitry Andric , Stefan Farfeleder , David Chisnall , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201111131618.pADGIm2n099696@svn.freebsd.org> <20111114082129.GA1596@mole.fafoe.narf.at> <4EC0E6C2.4010509@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4EC0E6C2.4010509@FreeBSD.org> Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, Stefan Farfeleder , David Chisnall , src-committers@FreeBSD.ORG Subject: Re: svn commit: r227487 - head/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Nov 2011 18:02:42 -0000 On Mon, Nov 14, 2011, Dimitry Andric wrote: > On 2011-11-14 09:21, Stefan Farfeleder wrote: > > On Sun, Nov 13, 2011 at 04:18:48PM +0000, David Chisnall wrote: > >> Author: theraven > >> Date: Sun Nov 13 16:18:48 2011 > >> New Revision: 227487 > >> URL: http://svn.freebsd.org/changeset/base/227487 > >> > >> Log: > >> The spec says that FILE must be defined in wchar.h, but it wasn't. It > >> is now. Also hide some macros in C++ mode that will break C++ > >> namespaced calls. > >> > >> Approved by: dim (mentor) > > > > I think this change is wrong. Whic spec are you referring to? C99 > > defines FILE only in 7.19.1#2 (stdio.h). In other headers FILE is used > > as parameter type for functions but that does not mean it is exported to > > user space. > > http://pubs.opengroup.org/onlinepubs/007908799/xsh/wchar.h.html It's a niggling detail, but that's an extension to the C standard, so properly speaking, it belongs in an #if __POSIX_VISIBLE >= 200809 || XSI_VISIBLE (or something like that). The formals were struct __sFILE * instead of FILE * for that reason -- see r103177. P.S. You're looking at a very old version of POSIX. Check out: http://pubs.opengroup.org/onlinepubs/9699919799/ From owner-svn-src-all@FreeBSD.ORG Mon Nov 14 18:21:27 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9CB471065678; Mon, 14 Nov 2011 18:21:27 +0000 (UTC) (envelope-from rmh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 731DC8FC17; Mon, 14 Nov 2011 18:21:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAEILRH4060725; Mon, 14 Nov 2011 18:21:27 GMT (envelope-from rmh@svn.freebsd.org) Received: (from rmh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAEILRmY060721; Mon, 14 Nov 2011 18:21:27 GMT (envelope-from rmh@svn.freebsd.org) Message-Id: <201111141821.pAEILRmY060721@svn.freebsd.org> From: Robert Millan Date: Mon, 14 Nov 2011 18:21:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227503 - in head/sys: dev/bktr kern net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Nov 2011 18:21:27 -0000 Author: rmh Date: Mon Nov 14 18:21:27 2011 New Revision: 227503 URL: http://svn.freebsd.org/changeset/base/227503 Log: Remove a few bits of FreeBSD 2.x compatibility code. Approved by: kib (mentor) Modified: head/sys/dev/bktr/bktr_reg.h head/sys/kern/uipc_socket.c head/sys/net/if_spppfr.c Modified: head/sys/dev/bktr/bktr_reg.h ============================================================================== --- head/sys/dev/bktr/bktr_reg.h Mon Nov 14 18:00:15 2011 (r227502) +++ head/sys/dev/bktr/bktr_reg.h Mon Nov 14 18:21:27 2011 (r227503) @@ -717,10 +717,6 @@ struct bt848_card_sig { /* ioctl_cmd_t int on old versions, u_long on new versions */ /***********************************************************/ -#if (__FreeBSD__ == 2) -typedef int ioctl_cmd_t; -#endif - #if defined(__FreeBSD__) typedef u_long ioctl_cmd_t; #endif Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Mon Nov 14 18:00:15 2011 (r227502) +++ head/sys/kern/uipc_socket.c Mon Nov 14 18:21:27 2011 (r227503) @@ -2828,7 +2828,6 @@ bad: return (error); } -/* XXX; prepare mbuf for (__FreeBSD__ < 3) routines. */ int soopt_getm(struct sockopt *sopt, struct mbuf **mp) { @@ -2877,7 +2876,6 @@ soopt_getm(struct sockopt *sopt, struct return (0); } -/* XXX; copyin sopt data into mbuf chain for (__FreeBSD__ < 3) routines. */ int soopt_mcopyin(struct sockopt *sopt, struct mbuf *m) { @@ -2906,7 +2904,6 @@ soopt_mcopyin(struct sockopt *sopt, stru return (0); } -/* XXX; copyout mbuf chain data into soopt for (__FreeBSD__ < 3) routines. */ int soopt_mcopyout(struct sockopt *sopt, struct mbuf *m) { Modified: head/sys/net/if_spppfr.c ============================================================================== --- head/sys/net/if_spppfr.c Mon Nov 14 18:00:15 2011 (r227502) +++ head/sys/net/if_spppfr.c Mon Nov 14 18:21:27 2011 (r227503) @@ -25,7 +25,7 @@ #include -#if defined(__FreeBSD__) && __FreeBSD__ >= 3 +#if defined(__FreeBSD__) #include "opt_inet.h" #include "opt_inet6.h" #include "opt_ipx.h" @@ -45,7 +45,7 @@ #include #include #include -#if defined(__FreeBSD__) && __FreeBSD__ >= 3 +#if defined(__FreeBSD__) #include #endif #include @@ -149,7 +149,7 @@ struct arp_req { unsigned short ptarget2; } __packed; -#if defined(__FreeBSD__) && __FreeBSD__ >= 3 && __FreeBSD_version < 501113 +#if defined(__FreeBSD__) && __FreeBSD_version < 501113 #define SPP_FMT "%s%d: " #define SPP_ARGS(ifp) (ifp)->if_name, (ifp)->if_unit #else From owner-svn-src-all@FreeBSD.ORG Mon Nov 14 18:23:51 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5968C106566C; Mon, 14 Nov 2011 18:23:51 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 49B308FC16; Mon, 14 Nov 2011 18:23:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAEINpKA060856; Mon, 14 Nov 2011 18:23:51 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAEINpbs060854; Mon, 14 Nov 2011 18:23:51 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201111141823.pAEINpbs060854@svn.freebsd.org> From: John Baldwin Date: Mon, 14 Nov 2011 18:23:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227504 - head/sys/fs/nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Nov 2011 18:23:51 -0000 Author: jhb Date: Mon Nov 14 18:23:50 2011 New Revision: 227504 URL: http://svn.freebsd.org/changeset/base/227504 Log: Sync with the old NFS client: Remove an obsolete comment. Modified: head/sys/fs/nfsclient/nfs_clvfsops.c Modified: head/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvfsops.c Mon Nov 14 18:21:27 2011 (r227503) +++ head/sys/fs/nfsclient/nfs_clvfsops.c Mon Nov 14 18:23:50 2011 (r227504) @@ -1232,8 +1232,6 @@ mountnfs(struct nfs_args *argp, struct m * * For V3, ncl_fsinfo will adjust this as necessary. Assume maximum * that we can handle until we find out otherwise. - * XXX Our "safe" limit on the client is what we can store in our - * buffer cache using signed(!) block numbers. */ if ((argp->flags & (NFSMNT_NFSV3 | NFSMNT_NFSV4)) == 0) nmp->nm_maxfilesize = 0xffffffffLL; From owner-svn-src-all@FreeBSD.ORG Mon Nov 14 18:40:04 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C7341065672; Mon, 14 Nov 2011 18:40:04 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 63DC18FC14; Mon, 14 Nov 2011 18:40:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAEIe4ke061386; Mon, 14 Nov 2011 18:40:04 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAEIe42w061383; Mon, 14 Nov 2011 18:40:04 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201111141840.pAEIe42w061383@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 14 Nov 2011 18:40:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227505 - head/sys/dev/ti X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Nov 2011 18:40:04 -0000 Author: yongari Date: Mon Nov 14 18:40:04 2011 New Revision: 227505 URL: http://svn.freebsd.org/changeset/base/227505 Log: It's bad idea to allocate large memory, 4KB, from stack. Pre-allocate the memory in device attach time. While I'm here remove unnecessary reassignment of error variable as it was already initialized. Also added a missing driver lock in TIIOCSETTRACE handler. Modified: head/sys/dev/ti/if_ti.c head/sys/dev/ti/if_tireg.h Modified: head/sys/dev/ti/if_ti.c ============================================================================== --- head/sys/dev/ti/if_ti.c Mon Nov 14 18:23:50 2011 (r227504) +++ head/sys/dev/ti/if_ti.c Mon Nov 14 18:40:04 2011 (r227505) @@ -497,7 +497,6 @@ ti_copy_mem(struct ti_softc *sc, uint32_ int segptr, segsize, cnt; caddr_t ptr; uint32_t origwin; - uint8_t tmparray[TI_WINLEN], tmparray2[TI_WINLEN]; int resid, segresid; int first_pass; @@ -557,51 +556,53 @@ ti_copy_mem(struct ti_softc *sc, uint32_ if (readdata) { bus_space_read_region_4(sc->ti_btag, sc->ti_bhandle, - ti_offset, (uint32_t *)tmparray, segsize >> 2); + ti_offset, (uint32_t *)sc->ti_membuf, segsize >> 2); if (useraddr) { /* * Yeah, this is a little on the kludgy * side, but at least this code is only * used for debugging. */ - ti_bcopy_swap(tmparray, tmparray2, segsize, - TI_SWAP_NTOH); + ti_bcopy_swap(sc->ti_membuf, sc->ti_membuf2, + segsize, TI_SWAP_NTOH); TI_UNLOCK(sc); if (first_pass) { - copyout(&tmparray2[segresid], ptr, + copyout(&sc->ti_membuf2[segresid], ptr, segsize - segresid); first_pass = 0; } else - copyout(tmparray2, ptr, segsize); + copyout(sc->ti_membuf2, ptr, segsize); TI_LOCK(sc); } else { if (first_pass) { - ti_bcopy_swap(tmparray, tmparray2, - segsize, TI_SWAP_NTOH); + + ti_bcopy_swap(sc->ti_membuf, + sc->ti_membuf2, segsize, + TI_SWAP_NTOH); TI_UNLOCK(sc); - bcopy(&tmparray2[segresid], ptr, + bcopy(&sc->ti_membuf2[segresid], ptr, segsize - segresid); TI_LOCK(sc); first_pass = 0; } else - ti_bcopy_swap(tmparray, ptr, segsize, - TI_SWAP_NTOH); + ti_bcopy_swap(sc->ti_membuf, ptr, + segsize, TI_SWAP_NTOH); } } else { if (useraddr) { TI_UNLOCK(sc); - copyin(ptr, tmparray2, segsize); + copyin(ptr, sc->ti_membuf2, segsize); TI_LOCK(sc); - ti_bcopy_swap(tmparray2, tmparray, segsize, - TI_SWAP_HTON); + ti_bcopy_swap(sc->ti_membuf2, sc->ti_membuf, + segsize, TI_SWAP_HTON); } else - ti_bcopy_swap(ptr, tmparray, segsize, + ti_bcopy_swap(ptr, sc->ti_membuf, segsize, TI_SWAP_HTON); bus_space_write_region_4(sc->ti_btag, sc->ti_bhandle, - ti_offset, (uint32_t *)tmparray, segsize >> 2); + ti_offset, (uint32_t *)sc->ti_membuf, segsize >> 2); } segptr += segsize; ptr += segsize; @@ -2231,6 +2232,16 @@ ti_attach(device_t dev) goto fail; } + /* Allocate working area for memory dump. */ + sc->ti_membuf = malloc(sizeof(uint8_t) * TI_WINLEN, M_DEVBUF, M_NOWAIT); + sc->ti_membuf2 = malloc(sizeof(uint8_t) * TI_WINLEN, M_DEVBUF, + M_NOWAIT); + if (sc->ti_membuf == NULL || sc->ti_membuf2 == NULL) { + device_printf(dev, "cannot allocate memory buffer\n"); + error = ENOMEM; + goto fail; + } + /* Allocate the general information block and ring buffers. */ if (bus_dma_tag_create(bus_get_dma_tag(dev), /* parent */ 1, 0, /* algnmnt, boundary */ @@ -2494,6 +2505,10 @@ ti_detach(device_t dev) } if (ifp) if_free(ifp); + if (sc->ti_membuf) + free(sc->ti_membuf, M_DEVBUF); + if (sc->ti_membuf2) + free(sc->ti_membuf2, M_DEVBUF); mtx_destroy(&sc->ti_mtx); @@ -3538,9 +3553,6 @@ ti_ioctl2(struct cdev *dev, u_long cmd, params->ti_tx_buf_ratio = sc->ti_tx_buf_ratio; params->param_mask = TI_PARAM_ALL; TI_UNLOCK(sc); - - error = 0; - break; } case TIIOCSETPARAMS: @@ -3585,9 +3597,6 @@ ti_ioctl2(struct cdev *dev, u_long cmd, sc->ti_tx_buf_ratio); } TI_UNLOCK(sc); - - error = 0; - break; } case TIIOCSETTRACE: { @@ -3600,10 +3609,9 @@ ti_ioctl2(struct cdev *dev, u_long cmd, * this register to 0 should have the effect of disabling * tracing. */ + TI_LOCK(sc); CSR_WRITE_4(sc, TI_GCR_NIC_TRACING, trace_type); - - error = 0; - + TI_UNLOCK(sc); break; } case TIIOCGETTRACE: { @@ -3637,7 +3645,6 @@ ti_ioctl2(struct cdev *dev, u_long cmd, } else trace_buf->fill_len = 0; TI_UNLOCK(sc); - break; } @@ -3659,7 +3666,6 @@ ti_ioctl2(struct cdev *dev, u_long cmd, * you're interested in every ioctl, you'll only be * able to debug one board at a time. */ - error = 0; break; case ALT_READ_TG_MEM: case ALT_WRITE_TG_MEM: @@ -3715,7 +3721,6 @@ ti_ioctl2(struct cdev *dev, u_long cmd, error = EINVAL; } TI_UNLOCK(sc); - break; } case ALT_READ_TG_REG: @@ -3751,7 +3756,6 @@ ti_ioctl2(struct cdev *dev, u_long cmd, regs->addr, &tmpval, 1); } TI_UNLOCK(sc); - break; } default: Modified: head/sys/dev/ti/if_tireg.h ============================================================================== --- head/sys/dev/ti/if_tireg.h Mon Nov 14 18:23:50 2011 (r227504) +++ head/sys/dev/ti/if_tireg.h Mon Nov 14 18:40:04 2011 (r227505) @@ -1015,6 +1015,8 @@ struct ti_softc { struct callout ti_watchdog; int ti_timer; ti_flag_vals ti_flags; + uint8_t *ti_membuf; + uint8_t *ti_membuf2; struct cdev *dev; }; From owner-svn-src-all@FreeBSD.ORG Mon Nov 14 18:51:39 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7587A1065672; Mon, 14 Nov 2011 18:51:39 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 648508FC0A; Mon, 14 Nov 2011 18:51:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAEIpdhd061850; Mon, 14 Nov 2011 18:51:39 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAEIpdWE061849; Mon, 14 Nov 2011 18:51:39 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201111141851.pAEIpdWE061849@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 14 Nov 2011 18:51:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227506 - head/sys/boot/fdt/dts X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Nov 2011 18:51:39 -0000 Author: marcel Date: Mon Nov 14 18:51:39 2011 New Revision: 227506 URL: http://svn.freebsd.org/changeset/base/227506 Log: Add DTS for the Freescale P3041DS. Added: head/sys/boot/fdt/dts/p3041ds.dts (contents, props changed) Added: head/sys/boot/fdt/dts/p3041ds.dts ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/p3041ds.dts Mon Nov 14 18:51:39 2011 (r227506) @@ -0,0 +1,753 @@ +/* + * P3041DS Device Tree Source + * + * Copyright 2010-2011 Freescale Semiconductor Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of Freescale Semiconductor nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * + * ALTERNATIVELY, this software may be distributed under the terms of the + * GNU General Public License ("GPL") as published by the Free Software + * Foundation, either version 2 of that License or (at your option) any + * later version. + * + * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``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 Freescale Semiconductor BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +/* $FreeBSD$ */ + +/dts-v1/; + +/ { + model = "fsl,P3041DS"; + compatible = "fsl,P3041DS"; + #address-cells = <2>; + #size-cells = <2>; + interrupt-parent = <&mpic>; + + aliases { + ccsr = &soc; + + serial0 = &serial0; + serial1 = &serial1; + serial2 = &serial2; + serial3 = &serial3; + pci0 = &pci0; + pci1 = &pci1; + pci2 = &pci2; + pci3 = &pci3; + usb0 = &usb0; + usb1 = &usb1; + dma0 = &dma0; + dma1 = &dma1; + sdhc = &sdhc; + msi0 = &msi0; + msi1 = &msi1; + msi2 = &msi2; + + crypto = &crypto; + sec_jr0 = &sec_jr0; + sec_jr1 = &sec_jr1; + sec_jr2 = &sec_jr2; + sec_jr3 = &sec_jr3; + rtic_a = &rtic_a; + rtic_b = &rtic_b; + rtic_c = &rtic_c; + rtic_d = &rtic_d; + sec_mon = &sec_mon; + }; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + + cpu0: PowerPC,e500mc@0 { + device_type = "cpu"; + reg = <0>; + next-level-cache = <&L2_0>; + L2_0: l2-cache { + next-level-cache = <&cpc>; + }; + }; + cpu1: PowerPC,e500mc@1 { + device_type = "cpu"; + reg = <1>; + next-level-cache = <&L2_1>; + L2_1: l2-cache { + next-level-cache = <&cpc>; + }; + }; + cpu2: PowerPC,e500mc@2 { + device_type = "cpu"; + reg = <2>; + next-level-cache = <&L2_2>; + L2_2: l2-cache { + next-level-cache = <&cpc>; + }; + }; + cpu3: PowerPC,e500mc@3 { + device_type = "cpu"; + reg = <3>; + next-level-cache = <&L2_3>; + L2_3: l2-cache { + next-level-cache = <&cpc>; + }; + }; + }; + + memory { + device_type = "memory"; + }; + + soc: soc@ffe000000 { + #address-cells = <1>; + #size-cells = <1>; + device_type = "soc"; + compatible = "simple-bus"; + ranges = <0x00000000 0xf 0xfe000000 0x1000000>; + reg = <0xf 0xfe000000 0 0x00001000>; + + soc-sram-error { + compatible = "fsl,soc-sram-error"; + interrupts = <16 2 1 29>; + }; + + corenet-law@0 { + compatible = "fsl,corenet-law"; + reg = <0x0 0x1000>; + fsl,num-laws = <32>; + }; + + memory-controller@8000 { + compatible = "fsl,qoriq-memory-controller-v4.5", "fsl,qoriq-memory-controller"; + reg = <0x8000 0x1000>; + interrupts = <16 2 1 23>; + }; + + cpc: l3-cache-controller@10000 { + compatible = "fsl,p3041-l3-cache-controller", "fsl,p4080-l3-cache-controller", "cache"; + reg = <0x10000 0x1000>; + interrupts = <16 2 1 27>; + }; + + corenet-cf@18000 { + compatible = "fsl,corenet-cf"; + reg = <0x18000 0x1000>; + interrupts = <16 2 1 31>; + fsl,ccf-num-csdids = <32>; + fsl,ccf-num-snoopids = <32>; + }; + + iommu@20000 { + compatible = "fsl,pamu-v1.0", "fsl,pamu"; + reg = <0x20000 0x4000>; + interrupts = < + 24 2 0 0 + 16 2 1 30>; + }; + + mpic: pic@40000 { + clock-frequency = <0>; + interrupt-controller; + #address-cells = <0>; + #interrupt-cells = <4>; + reg = <0x40000 0x40000>; + compatible = "fsl,mpic", "chrp,open-pic"; + device_type = "open-pic"; + }; + + msi0: msi@41600 { + compatible = "fsl,mpic-msi"; + reg = <0x41600 0x200>; + msi-available-ranges = <0 0x100>; + interrupts = < + 0xe0 0 0 0 + 0xe1 0 0 0 + 0xe2 0 0 0 + 0xe3 0 0 0 + 0xe4 0 0 0 + 0xe5 0 0 0 + 0xe6 0 0 0 + 0xe7 0 0 0>; + }; + + msi1: msi@41800 { + compatible = "fsl,mpic-msi"; + reg = <0x41800 0x200>; + msi-available-ranges = <0 0x100>; + interrupts = < + 0xe8 0 0 0 + 0xe9 0 0 0 + 0xea 0 0 0 + 0xeb 0 0 0 + 0xec 0 0 0 + 0xed 0 0 0 + 0xee 0 0 0 + 0xef 0 0 0>; + }; + + msi2: msi@41a00 { + compatible = "fsl,mpic-msi"; + reg = <0x41a00 0x200>; + msi-available-ranges = <0 0x100>; + interrupts = < + 0xf0 0 0 0 + 0xf1 0 0 0 + 0xf2 0 0 0 + 0xf3 0 0 0 + 0xf4 0 0 0 + 0xf5 0 0 0 + 0xf6 0 0 0 + 0xf7 0 0 0>; + }; + + guts: global-utilities@e0000 { + compatible = "fsl,qoriq-device-config-1.0"; + reg = <0xe0000 0xe00>; + fsl,has-rstcr; + #sleep-cells = <1>; + fsl,liodn-bits = <12>; + }; + + pins: global-utilities@e0e00 { + compatible = "fsl,qoriq-pin-control-1.0"; + reg = <0xe0e00 0x200>; + #sleep-cells = <2>; + }; + + clockgen: global-utilities@e1000 { + compatible = "fsl,p3041-clockgen", "fsl,qoriq-clockgen-1.0"; + reg = <0xe1000 0x1000>; + clock-frequency = <0>; + }; + + rcpm: global-utilities@e2000 { + compatible = "fsl,qoriq-rcpm-1.0"; + reg = <0xe2000 0x1000>; + #sleep-cells = <1>; + }; + + sfp: sfp@e8000 { + compatible = "fsl,p3041-sfp", "fsl,qoriq-sfp-1.0"; + reg = <0xe8000 0x1000>; + }; + + serdes: serdes@ea000 { + compatible = "fsl,p3041-serdes"; + reg = <0xea000 0x1000>; + }; + + dma0: dma@100300 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "fsl,p3041-dma", "fsl,eloplus-dma"; + reg = <0x100300 0x4>; + ranges = <0x0 0x100100 0x200>; + cell-index = <0>; + dma-channel@0 { + compatible = "fsl,p3041-dma-channel", + "fsl,eloplus-dma-channel"; + reg = <0x0 0x80>; + cell-index = <0>; + interrupts = <28 2 0 0>; + }; + dma-channel@80 { + compatible = "fsl,p3041-dma-channel", + "fsl,eloplus-dma-channel"; + reg = <0x80 0x80>; + cell-index = <1>; + interrupts = <29 2 0 0>; + }; + dma-channel@100 { + compatible = "fsl,p3041-dma-channel", + "fsl,eloplus-dma-channel"; + reg = <0x100 0x80>; + cell-index = <2>; + interrupts = <30 2 0 0>; + }; + dma-channel@180 { + compatible = "fsl,p3041-dma-channel", + "fsl,eloplus-dma-channel"; + reg = <0x180 0x80>; + cell-index = <3>; + interrupts = <31 2 0 0>; + }; + }; + + dma1: dma@101300 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "fsl,p3041-dma", "fsl,eloplus-dma"; + reg = <0x101300 0x4>; + ranges = <0x0 0x101100 0x200>; + cell-index = <1>; + dma-channel@0 { + compatible = "fsl,p3041-dma-channel", + "fsl,eloplus-dma-channel"; + reg = <0x0 0x80>; + cell-index = <0>; + interrupts = <32 2 0 0>; + }; + dma-channel@80 { + compatible = "fsl,p3041-dma-channel", + "fsl,eloplus-dma-channel"; + reg = <0x80 0x80>; + cell-index = <1>; + interrupts = <33 2 0 0>; + }; + dma-channel@100 { + compatible = "fsl,p3041-dma-channel", + "fsl,eloplus-dma-channel"; + reg = <0x100 0x80>; + cell-index = <2>; + interrupts = <34 2 0 0>; + }; + dma-channel@180 { + compatible = "fsl,p3041-dma-channel", + "fsl,eloplus-dma-channel"; + reg = <0x180 0x80>; + cell-index = <3>; + interrupts = <35 2 0 0>; + }; + }; + + spi@110000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "fsl,p3041-espi", "fsl,mpc8536-espi"; + reg = <0x110000 0x1000>; + interrupts = <53 0x2 0 0>; + fsl,espi-num-chipselects = <4>; + + flash@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "spansion,s25sl12801"; + reg = <0>; + spi-max-frequency = <40000000>; /* input clock */ + partition@u-boot { + label = "u-boot"; + reg = <0x00000000 0x00100000>; + read-only; + }; + partition@kernel { + label = "kernel"; + reg = <0x00100000 0x00500000>; + read-only; + }; + partition@dtb { + label = "dtb"; + reg = <0x00600000 0x00100000>; + read-only; + }; + partition@fs { + label = "file system"; + reg = <0x00700000 0x00900000>; + }; + }; + }; + + sdhc: sdhc@114000 { + compatible = "fsl,p3041-esdhc", "fsl,esdhc"; + reg = <0x114000 0x1000>; + interrupts = <48 2 0 0>; + sdhci,auto-cmd12; + clock-frequency = <0>; + }; + + i2c@118000 { + #address-cells = <1>; + #size-cells = <0>; + cell-index = <0>; + compatible = "fsl-i2c"; + reg = <0x118000 0x100>; + interrupts = <38 2 0 0>; + dfsrr; + }; + + i2c@118100 { + #address-cells = <1>; + #size-cells = <0>; + cell-index = <1>; + compatible = "fsl-i2c"; + reg = <0x118100 0x100>; + interrupts = <38 2 0 0>; + dfsrr; + eeprom@51 { + compatible = "at24,24c256"; + reg = <0x51>; + }; + eeprom@52 { + compatible = "at24,24c256"; + reg = <0x52>; + }; + }; + + i2c@119000 { + #address-cells = <1>; + #size-cells = <0>; + cell-index = <2>; + compatible = "fsl-i2c"; + reg = <0x119000 0x100>; + interrupts = <39 2 0 0>; + dfsrr; + }; + + i2c@119100 { + #address-cells = <1>; + #size-cells = <0>; + cell-index = <3>; + compatible = "fsl-i2c"; + reg = <0x119100 0x100>; + interrupts = <39 2 0 0>; + dfsrr; + rtc@68 { + compatible = "dallas,ds3232"; + reg = <0x68>; + interrupts = <0x1 0x1 0 0>; + }; + }; + + serial0: serial@11c500 { + cell-index = <0>; + device_type = "serial"; + compatible = "ns16550"; + reg = <0x11c500 0x100>; + clock-frequency = <0>; + interrupts = <36 2 0 0>; + }; + + serial1: serial@11c600 { + cell-index = <1>; + device_type = "serial"; + compatible = "ns16550"; + reg = <0x11c600 0x100>; + clock-frequency = <0>; + interrupts = <36 2 0 0>; + }; + + serial2: serial@11d500 { + cell-index = <2>; + device_type = "serial"; + compatible = "ns16550"; + reg = <0x11d500 0x100>; + clock-frequency = <0>; + interrupts = <37 2 0 0>; + }; + + serial3: serial@11d600 { + cell-index = <3>; + device_type = "serial"; + compatible = "ns16550"; + reg = <0x11d600 0x100>; + clock-frequency = <0>; + interrupts = <37 2 0 0>; + }; + + gpio0: gpio@130000 { + compatible = "fsl,p3041-gpio", "fsl,qoriq-gpio"; + reg = <0x130000 0x1000>; + interrupts = <55 2 0 0>; + #gpio-cells = <2>; + gpio-controller; + }; + + usb0: usb@210000 { + compatible = "fsl,p3041-usb2-mph", + "fsl,mpc85xx-usb2-mph", "fsl-usb2-mph"; + reg = <0x210000 0x1000>; + #address-cells = <1>; + #size-cells = <0>; + interrupts = <44 0x2 0 0>; + phy_type = "utmi"; + port0; + }; + + usb1: usb@211000 { + compatible = "fsl,p3041-usb2-dr", + "fsl,mpc85xx-usb2-dr", "fsl-usb2-dr"; + reg = <0x211000 0x1000>; + #address-cells = <1>; + #size-cells = <0>; + interrupts = <45 0x2 0 0>; + dr_mode = "host"; + phy_type = "utmi"; + }; + + sata@220000 { + compatible = "fsl,p3041-sata", "fsl,pq-sata-v2"; + reg = <0x220000 0x1000>; + interrupts = <68 0x2 0 0>; + }; + + sata@221000 { + compatible = "fsl,p3041-sata", "fsl,pq-sata-v2"; + reg = <0x221000 0x1000>; + interrupts = <69 0x2 0 0>; + }; + + crypto: crypto@300000 { + compatible = "fsl,sec-v4.2", "fsl,sec-v4.0"; + #address-cells = <1>; + #size-cells = <1>; + reg = <0x300000 0x10000>; + ranges = <0 0x300000 0x10000>; + interrupts = <92 2 0 0>; + + sec_jr0: jr@1000 { + compatible = "fsl,sec-v4.2-job-ring", + "fsl,sec-v4.0-job-ring"; + reg = <0x1000 0x1000>; + interrupts = <88 2 0 0>; + }; + + sec_jr1: jr@2000 { + compatible = "fsl,sec-v4.2-job-ring", + "fsl,sec-v4.0-job-ring"; + reg = <0x2000 0x1000>; + interrupts = <89 2 0 0>; + }; + + sec_jr2: jr@3000 { + compatible = "fsl,sec-v4.2-job-ring", + "fsl,sec-v4.0-job-ring"; + reg = <0x3000 0x1000>; + interrupts = <90 2 0 0>; + }; + + sec_jr3: jr@4000 { + compatible = "fsl,sec-v4.2-job-ring", + "fsl,sec-v4.0-job-ring"; + reg = <0x4000 0x1000>; + interrupts = <91 2 0 0>; + }; + + rtic@6000 { + compatible = "fsl,sec-v4.2-rtic", + "fsl,sec-v4.0-rtic"; + #address-cells = <1>; + #size-cells = <1>; + reg = <0x6000 0x100>; + ranges = <0x0 0x6100 0xe00>; + + rtic_a: rtic-a@0 { + compatible = "fsl,sec-v4.2-rtic-memory", + "fsl,sec-v4.0-rtic-memory"; + reg = <0x00 0x20 0x100 0x80>; + }; + + rtic_b: rtic-b@20 { + compatible = "fsl,sec-v4.2-rtic-memory", + "fsl,sec-v4.0-rtic-memory"; + reg = <0x20 0x20 0x200 0x80>; + }; + + rtic_c: rtic-c@40 { + compatible = "fsl,sec-v4.2-rtic-memory", + "fsl,sec-v4.0-rtic-memory"; + reg = <0x40 0x20 0x300 0x80>; + }; + + rtic_d: rtic-d@60 { + compatible = "fsl,sec-v4.2-rtic-memory", + "fsl,sec-v4.0-rtic-memory"; + reg = <0x60 0x20 0x500 0x80>; + }; + }; + }; + + sec_mon: sec_mon@314000 { + compatible = "fsl,sec-v4.2-mon", "fsl,sec-v4.0-mon"; + reg = <0x314000 0x1000>; + interrupts = <93 2 0 0>; + }; + }; + + localbus@ffe124000 { + compatible = "fsl,p3041-elbc", "fsl,elbc", "simple-bus"; + reg = <0xf 0xfe124000 0 0x1000>; + interrupts = <25 2 0 0>; + #address-cells = <2>; + #size-cells = <1>; + + ranges = <0 0 0xf 0xe8000000 0x08000000 + 3 0 0xf 0xffdf0000 0x00008000>; + + flash@0,0 { + compatible = "cfi-flash"; + reg = <0 0 0x08000000>; + bank-width = <2>; + device-width = <2>; + }; + + board-control@3,0 { + compatible = "fsl,p3041ds-pixis"; + reg = <3 0 0x20>; + }; + }; + + pci0: pcie@ffe200000 { + compatible = "fsl,p3041-pcie", "fsl,qoriq-pcie-v2.2"; + device_type = "pci"; + #size-cells = <2>; + #address-cells = <3>; + reg = <0xf 0xfe200000 0 0x1000>; + bus-range = <0x0 0xff>; + ranges = <0x02000000 0 0xe0000000 0xc 0x00000000 0x0 0x20000000 + 0x01000000 0 0x00000000 0xf 0xf8000000 0x0 0x00010000>; + clock-frequency = <0x1fca055>; + fsl,msi = <&msi0>; + interrupts = <16 2 1 15>; + pcie@0 { + reg = <0 0 0 0 0>; + #interrupt-cells = <1>; + #size-cells = <2>; + #address-cells = <3>; + device_type = "pci"; + interrupts = <16 2 1 15>; + interrupt-map-mask = <0xf800 0 0 7>; + interrupt-map = < + /* IDSEL 0x0 */ + 0000 0 0 1 &mpic 40 1 0 0 + 0000 0 0 2 &mpic 1 1 0 0 + 0000 0 0 3 &mpic 2 1 0 0 + 0000 0 0 4 &mpic 3 1 0 0 + >; + ranges = <0x02000000 0 0xe0000000 + 0x02000000 0 0xe0000000 + 0 0x20000000 + + 0x01000000 0 0x00000000 + 0x01000000 0 0x00000000 + 0 0x00010000>; + }; + }; + + pci1: pcie@ffe201000 { + compatible = "fsl,p3041-pcie", "fsl,qoriq-pcie-v2.2"; + device_type = "pci"; + #size-cells = <2>; + #address-cells = <3>; + reg = <0xf 0xfe201000 0 0x1000>; + bus-range = <0 0xff>; + ranges = <0x02000000 0x0 0xe0000000 0xc 0x20000000 0x0 0x20000000 + 0x01000000 0x0 0x00000000 0xf 0xf8010000 0x0 0x00010000>; + clock-frequency = <0x1fca055>; + fsl,msi = <&msi1>; + interrupts = <16 2 1 14>; + pcie@0 { + reg = <0 0 0 0 0>; + #interrupt-cells = <1>; + #size-cells = <2>; + #address-cells = <3>; + device_type = "pci"; + interrupts = <16 2 1 14>; + interrupt-map-mask = <0xf800 0 0 7>; + interrupt-map = < + /* IDSEL 0x0 */ + 0000 0 0 1 &mpic 41 1 0 0 + 0000 0 0 2 &mpic 5 1 0 0 + 0000 0 0 3 &mpic 6 1 0 0 + 0000 0 0 4 &mpic 7 1 0 0 + >; + ranges = <0x02000000 0 0xe0000000 + 0x02000000 0 0xe0000000 + 0 0x20000000 + + 0x01000000 0 0x00000000 + 0x01000000 0 0x00000000 + 0 0x00010000>; + }; + }; + + pci2: pcie@ffe202000 { + compatible = "fsl,p3041-pcie", "fsl,qoriq-pcie-v2.2"; + device_type = "pci"; + #size-cells = <2>; + #address-cells = <3>; + reg = <0xf 0xfe202000 0 0x1000>; + bus-range = <0x0 0xff>; + ranges = <0x02000000 0 0xe0000000 0xc 0x40000000 0 0x20000000 + 0x01000000 0 0x00000000 0xf 0xf8020000 0 0x00010000>; + clock-frequency = <0x1fca055>; + fsl,msi = <&msi2>; + interrupts = <16 2 1 13>; + pcie@0 { + reg = <0 0 0 0 0>; + #interrupt-cells = <1>; + #size-cells = <2>; + #address-cells = <3>; + device_type = "pci"; + interrupts = <16 2 1 13>; + interrupt-map-mask = <0xf800 0 0 7>; + interrupt-map = < + /* IDSEL 0x0 */ + 0000 0 0 1 &mpic 42 1 0 0 + 0000 0 0 2 &mpic 9 1 0 0 + 0000 0 0 3 &mpic 10 1 0 0 + 0000 0 0 4 &mpic 11 1 0 0 + >; + ranges = <0x02000000 0 0xe0000000 + 0x02000000 0 0xe0000000 + 0 0x20000000 + + 0x01000000 0 0x00000000 + 0x01000000 0 0x00000000 + 0 0x00010000>; + }; + }; + + pci3: pcie@ffe203000 { + compatible = "fsl,p3041-pcie", "fsl,qoriq-pcie-v2.2"; + device_type = "pci"; + #size-cells = <2>; + #address-cells = <3>; + reg = <0xf 0xfe203000 0 0x1000>; + bus-range = <0x0 0xff>; + ranges = <0x02000000 0 0xe0000000 0xc 0x60000000 0 0x20000000 + 0x01000000 0 0x00000000 0xf 0xf8030000 0 0x00010000>; + clock-frequency = <0x1fca055>; + fsl,msi = <&msi2>; + interrupts = <16 2 1 12>; + pcie@0 { + reg = <0 0 0 0 0>; + #interrupt-cells = <1>; + #size-cells = <2>; + #address-cells = <3>; + device_type = "pci"; + interrupts = <16 2 1 12>; + interrupt-map-mask = <0xf800 0 0 7>; + interrupt-map = < + /* IDSEL 0x0 */ + 0000 0 0 1 &mpic 43 1 0 0 + 0000 0 0 2 &mpic 0 1 0 0 + 0000 0 0 3 &mpic 4 1 0 0 + 0000 0 0 4 &mpic 8 1 0 0 + >; + ranges = <0x02000000 0 0xe0000000 + 0x02000000 0 0xe0000000 + 0 0x20000000 + + 0x01000000 0 0x00000000 + 0x01000000 0 0x00000000 + 0 0x00010000>; + }; + }; +}; From owner-svn-src-all@FreeBSD.ORG Mon Nov 14 18:52:07 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B125B106564A; Mon, 14 Nov 2011 18:52:07 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 966698FC12; Mon, 14 Nov 2011 18:52:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAEIq75j061905; Mon, 14 Nov 2011 18:52:07 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAEIq71t061900; Mon, 14 Nov 2011 18:52:07 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201111141852.pAEIq71t061900@svn.freebsd.org> From: John Baldwin Date: Mon, 14 Nov 2011 18:52:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227507 - in head: sbin/mount_nfs sys/fs/nfsclient sys/nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Nov 2011 18:52:07 -0000 Author: jhb Date: Mon Nov 14 18:52:07 2011 New Revision: 227507 URL: http://svn.freebsd.org/changeset/base/227507 Log: Finish making 'wcommitsize' an NFS client mount option. Reviewed by: rmacklem MFC after: 1 week Modified: head/sbin/mount_nfs/mount_nfs.8 head/sbin/mount_nfs/mount_nfs.c head/sys/fs/nfsclient/nfs_clvfsops.c head/sys/nfsclient/nfs_vfsops.c Modified: head/sbin/mount_nfs/mount_nfs.8 ============================================================================== --- head/sbin/mount_nfs/mount_nfs.8 Mon Nov 14 18:51:39 2011 (r227506) +++ head/sbin/mount_nfs/mount_nfs.8 Mon Nov 14 18:52:07 2011 (r227507) @@ -318,6 +318,10 @@ tune the timeout interval.) .It Cm udp Use UDP transport. +.It Cm wcommitsize Ns = Ns Aq Ar value +Set the maximum pending write commit size to the specified value. +This determines the maximum amount of pending write data that the NFS +client is willing to cache for each file. .It Cm wsize Ns = Ns Aq Ar value Set the write data size to the specified value. Ditto the comments w.r.t.\& the Modified: head/sbin/mount_nfs/mount_nfs.c ============================================================================== --- head/sbin/mount_nfs/mount_nfs.c Mon Nov 14 18:51:39 2011 (r227506) +++ head/sbin/mount_nfs/mount_nfs.c Mon Nov 14 18:52:07 2011 (r227507) @@ -612,6 +612,13 @@ fallback_mount(struct iovec *iov, int io } args.flags |= NFSMNT_ACDIRMAX; } + if (findopt(iov, iovlen, "wcommitsize", &opt, NULL) == 0) { + ret = sscanf(opt, "%d", &args.wcommitsize); + if (ret != 1 || args.wcommitsize < 0) { + errx(1, "illegal wcommitsize: %s", opt); + } + args.flags |= NFSMNT_WCOMMITSIZE; + } if (findopt(iov, iovlen, "deadthresh", &opt, NULL) == 0) { ret = sscanf(opt, "%d", &args.deadthresh); if (ret != 1 || args.deadthresh <= 0) { Modified: head/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvfsops.c Mon Nov 14 18:51:39 2011 (r227506) +++ head/sys/fs/nfsclient/nfs_clvfsops.c Mon Nov 14 18:52:07 2011 (r227507) @@ -715,7 +715,7 @@ static const char *nfs_opts[] = { "from" "retrans", "acregmin", "acregmax", "acdirmin", "acdirmax", "resvport", "readahead", "hostname", "timeout", "addr", "fh", "nfsv3", "sec", "principal", "nfsv4", "gssname", "allgssname", "dirpath", - "negnametimeo", "nocto", + "negnametimeo", "nocto", "wcommitsize", NULL }; /* @@ -949,6 +949,15 @@ nfs_mount(struct mount *mp) } args.flags |= NFSMNT_ACDIRMAX; } + if (vfs_getopt(mp->mnt_optnew, "wcommitsize", (void **)&opt, NULL) == 0) { + ret = sscanf(opt, "%d", &args.wcommitsize); + if (ret != 1 || args.wcommitsize < 0) { + vfs_mount_error(mp, "illegal wcommitsize: %s", opt); + error = EINVAL; + goto out; + } + args.flags |= NFSMNT_WCOMMITSIZE; + } if (vfs_getopt(mp->mnt_optnew, "timeout", (void **)&opt, NULL) == 0) { ret = sscanf(opt, "%d", &args.timeo); if (ret != 1 || args.timeo <= 0) { Modified: head/sys/nfsclient/nfs_vfsops.c ============================================================================== --- head/sys/nfsclient/nfs_vfsops.c Mon Nov 14 18:51:39 2011 (r227506) +++ head/sys/nfsclient/nfs_vfsops.c Mon Nov 14 18:52:07 2011 (r227507) @@ -787,7 +787,7 @@ static const char *nfs_opts[] = { "from" "readahead", "readdirsize", "soft", "hard", "mntudp", "tcp", "udp", "wsize", "rsize", "retrans", "acregmin", "acregmax", "acdirmin", "acdirmax", "deadthresh", "hostname", "timeout", "addr", "fh", "nfsv3", - "sec", "maxgroups", "principal", "negnametimeo", "nocto", + "sec", "maxgroups", "principal", "negnametimeo", "nocto", "wcommitsize", NULL }; /* @@ -1019,6 +1019,15 @@ nfs_mount(struct mount *mp) } args.flags |= NFSMNT_ACDIRMAX; } + if (vfs_getopt(mp->mnt_optnew, "wcommitsize", (void **)&opt, NULL) == 0) { + ret = sscanf(opt, "%d", &args.wcommitsize); + if (ret != 1 || args.wcommitsize < 0) { + vfs_mount_error(mp, "illegal wcommitsize: %s", opt); + error = EINVAL; + goto out; + } + args.flags |= NFSMNT_WCOMMITSIZE; + } if (vfs_getopt(mp->mnt_optnew, "deadthresh", (void **)&opt, NULL) == 0) { ret = sscanf(opt, "%d", &args.deadthresh); if (ret != 1 || args.deadthresh <= 0) { From owner-svn-src-all@FreeBSD.ORG Mon Nov 14 19:04:24 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 29CEC106564A; Mon, 14 Nov 2011 19:04:24 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from theravensnest.org (theravensnest.org [109.169.23.128]) by mx1.freebsd.org (Postfix) with ESMTP id A0BAC8FC1A; Mon, 14 Nov 2011 19:04:23 +0000 (UTC) Received: from [192.168.0.2] (cpc2-cwma5-0-0-cust875.7-3.cable.virginmedia.com [86.11.39.108]) (authenticated bits=0) by theravensnest.org (8.14.4/8.14.4) with ESMTP id pAEJ4Ls5033696 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Mon, 14 Nov 2011 19:04:22 GMT (envelope-from theraven@FreeBSD.org) Mime-Version: 1.0 (Apple Message framework v1251.1) Content-Type: text/plain; charset=us-ascii From: David Chisnall In-Reply-To: <20111114180235.GA58284@zim.MIT.EDU> Date: Mon, 14 Nov 2011 19:04:16 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <3B8C1412-E18D-47E3-A09D-4847DD078963@FreeBSD.org> References: <201111131618.pADGIm2n099696@svn.freebsd.org> <20111114082129.GA1596@mole.fafoe.narf.at> <4EC0E6C2.4010509@FreeBSD.org> <20111114180235.GA58284@zim.MIT.EDU> To: David Schultz X-Mailer: Apple Mail (2.1251.1) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Stefan Farfeleder , Dimitry Andric , src-committers@FreeBSD.org Subject: Re: svn commit: r227487 - head/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Nov 2011 19:04:24 -0000 On 14 Nov 2011, at 18:02, David Schultz wrote: > On Mon, Nov 14, 2011, Dimitry Andric wrote: >> On 2011-11-14 09:21, Stefan Farfeleder wrote: >>> On Sun, Nov 13, 2011 at 04:18:48PM +0000, David Chisnall wrote: >>>> Author: theraven >>>> Date: Sun Nov 13 16:18:48 2011 >>>> New Revision: 227487 >>>> URL: http://svn.freebsd.org/changeset/base/227487 >>>>=20 >>>> Log: >>>> The spec says that FILE must be defined in wchar.h, but it wasn't. = It >>>> is now. Also hide some macros in C++ mode that will break C++ >>>> namespaced calls. >>>>=20 >>>> Approved by: dim (mentor) >>>=20 >>> I think this change is wrong. Whic spec are you referring to? C99 >>> defines FILE only in 7.19.1#2 (stdio.h). In other headers FILE is = used >>> as parameter type for functions but that does not mean it is = exported to >>> user space. >>=20 >> http://pubs.opengroup.org/onlinepubs/007908799/xsh/wchar.h.html >=20 > It's a niggling detail, but that's an extension to the C standard, > so properly speaking, it belongs in an > #if __POSIX_VISIBLE >=3D 200809 || XSI_VISIBLE > (or something like that). The formals were struct __sFILE * > instead of FILE * for that reason -- see r103177. >=20 > P.S. You're looking at a very old version of POSIX. Check out: > http://pubs.opengroup.org/onlinepubs/9699919799/ The C99 and C1x specifications both seem to require stdio.h to be = included before wchar.h. I think this therefore places including = wchar.h and not stdio.h in the category of undefined (or, at least, not = defined) behaviour, so we are free to do anything in this case. I would = say that accepting the code and working as the programmer expected is = the least harmful thing to do here. This is what Darwin libc does = (actually, it #includes stdio.h in wchar.h). =20 David= From owner-svn-src-all@FreeBSD.ORG Mon Nov 14 19:06:29 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B6A81065674; Mon, 14 Nov 2011 19:06:29 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0A6EB8FC16; Mon, 14 Nov 2011 19:06:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAEJ6TWv062415; Mon, 14 Nov 2011 19:06:29 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAEJ6T1S062413; Mon, 14 Nov 2011 19:06:29 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201111141906.pAEJ6T1S062413@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 14 Nov 2011 19:06:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227508 - head/sys/boot/fdt/dts X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Nov 2011 19:06:29 -0000 Author: marcel Date: Mon Nov 14 19:06:28 2011 New Revision: 227508 URL: http://svn.freebsd.org/changeset/base/227508 Log: Add DTS for the Freescale P1020RDB. Added: head/sys/boot/fdt/dts/p1020rdb.dts (contents, props changed) Added: head/sys/boot/fdt/dts/p1020rdb.dts ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/p1020rdb.dts Mon Nov 14 19:06:28 2011 (r227508) @@ -0,0 +1,627 @@ +/* + * P1020 RDB Device Tree Source + * + * Copyright 2009 Freescale Semiconductor Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of Freescale Semiconductor nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * + * ALTERNATIVELY, this software may be distributed under the terms of the + * GNU General Public License ("GPL") as published by the Free Software + * Foundation, either version 2 of that License or (at your option) any + * later version. + * + * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``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 Freescale Semiconductor BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +/* $FreeBSD$ */ + +/dts-v1/; + +/ { + model = "fsl,P1020"; + compatible = "fsl,P1020RDB"; + #address-cells = <2>; + #size-cells = <2>; + + aliases { + serial0 = &serial0; + serial1 = &serial1; + ethernet0 = &enet0; + ethernet1 = &enet1; + ethernet2 = &enet2; + pci0 = &pci0; + pci1 = &pci1; + }; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + + PowerPC,P1020@0 { + device_type = "cpu"; + reg = <0x0>; + next-level-cache = <&L2>; + }; + + PowerPC,P1020@1 { + device_type = "cpu"; + reg = <0x1>; + next-level-cache = <&L2>; + }; + }; + + memory { + device_type = "memory"; + }; + + localbus@ffe05000 { + #address-cells = <2>; + #size-cells = <1>; + compatible = "fsl,p1020-elbc", "fsl,elbc", "simple-bus"; + reg = <0 0xffe05000 0 0x1000>; + interrupts = <19 2>; + interrupt-parent = <&mpic>; + + /* NOR, NAND Flashes and Vitesse 5 port L2 switch */ + ranges = <0x0 0x0 0x0 0xef000000 0x01000000 + 0x1 0x0 0x0 0xffa00000 0x00040000 + 0x2 0x0 0x0 0xffb00000 0x00020000>; + + nor@0,0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "cfi-flash"; + reg = <0x0 0x0 0x1000000>; + bank-width = <2>; + device-width = <1>; + + partition@0 { + /* This location must not be altered */ + /* 256KB for Vitesse 7385 Switch firmware */ + reg = <0x0 0x00040000>; + label = "NOR (RO) Vitesse-7385 Firmware"; + read-only; + }; + + partition@40000 { + /* 256KB for DTB Image */ + reg = <0x00040000 0x00040000>; + label = "NOR (RO) DTB Image"; + read-only; + }; + + partition@80000 { + /* 3.5 MB for Linux Kernel Image */ + reg = <0x00080000 0x00380000>; + label = "NOR (RO) Linux Kernel Image"; + read-only; + }; + + partition@400000 { + /* 11MB for JFFS2 based Root file System */ + reg = <0x00400000 0x00b00000>; + label = "NOR (RW) JFFS2 Root File System"; + }; + + partition@f00000 { + /* This location must not be altered */ + /* 512KB for u-boot Bootloader Image */ + /* 512KB for u-boot Environment Variables */ + reg = <0x00f00000 0x00100000>; + label = "NOR (RO) U-Boot Image"; + read-only; + }; + }; + + nand@1,0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "fsl,p1020-fcm-nand", + "fsl,elbc-fcm-nand"; + reg = <0x1 0x0 0x40000>; + + partition@0 { + /* This location must not be altered */ + /* 1MB for u-boot Bootloader Image */ + reg = <0x0 0x00100000>; + label = "NAND (RO) U-Boot Image"; + read-only; + }; + + partition@100000 { + /* 1MB for DTB Image */ + reg = <0x00100000 0x00100000>; + label = "NAND (RO) DTB Image"; + read-only; + }; + + partition@200000 { + /* 4MB for Linux Kernel Image */ + reg = <0x00200000 0x00400000>; + label = "NAND (RO) Linux Kernel Image"; + read-only; + }; + + partition@600000 { + /* 4MB for Compressed Root file System Image */ + reg = <0x00600000 0x00400000>; + label = "NAND (RO) Compressed RFS Image"; + read-only; + }; + + partition@a00000 { + /* 7MB for JFFS2 based Root file System */ + reg = <0x00a00000 0x00700000>; + label = "NAND (RW) JFFS2 Root File System"; + }; + + partition@1100000 { + /* 15MB for JFFS2 based Root file System */ + reg = <0x01100000 0x00f00000>; + label = "NAND (RW) Writable User area"; + }; + }; + + L2switch@2,0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "vitesse-7385"; + reg = <0x2 0x0 0x20000>; + }; + + }; + + soc@ffe00000 { + #address-cells = <1>; + #size-cells = <1>; + device_type = "soc"; + compatible = "fsl,p1020-immr", "simple-bus"; + ranges = <0x0 0x0 0xffe00000 0x100000>; + bus-frequency = <0>; // Filled out by uboot. + + ecm-law@0 { + compatible = "fsl,ecm-law"; + reg = <0x0 0x1000>; + fsl,num-laws = <12>; + }; + + ecm@1000 { + compatible = "fsl,p1020-ecm", "fsl,ecm"; + reg = <0x1000 0x1000>; + interrupts = <16 2>; + interrupt-parent = <&mpic>; + }; + + memory-controller@2000 { + compatible = "fsl,p1020-memory-controller"; + reg = <0x2000 0x1000>; + interrupt-parent = <&mpic>; + interrupts = <16 2>; + }; + + i2c@3000 { + #address-cells = <1>; + #size-cells = <0>; + cell-index = <0>; + compatible = "fsl-i2c"; + reg = <0x3000 0x100>; + interrupts = <43 2>; + interrupt-parent = <&mpic>; + dfsrr; + rtc@68 { + compatible = "dallas,ds1339"; + reg = <0x68>; + }; + }; + + i2c@3100 { + #address-cells = <1>; + #size-cells = <0>; + cell-index = <1>; + compatible = "fsl-i2c"; + reg = <0x3100 0x100>; + interrupts = <43 2>; + interrupt-parent = <&mpic>; + dfsrr; + }; + + serial0: serial@4500 { + cell-index = <0>; + device_type = "serial"; + compatible = "ns16550"; + reg = <0x4500 0x100>; + clock-frequency = <0>; + interrupts = <42 2>; + interrupt-parent = <&mpic>; + }; + + serial1: serial@4600 { + cell-index = <1>; + device_type = "serial"; + compatible = "ns16550"; + reg = <0x4600 0x100>; + clock-frequency = <0>; + interrupts = <42 2>; + interrupt-parent = <&mpic>; + }; + + spi@7000 { + cell-index = <0>; + #address-cells = <1>; + #size-cells = <0>; + compatible = "fsl,espi"; + reg = <0x7000 0x1000>; + interrupts = <59 0x2>; + interrupt-parent = <&mpic>; + mode = "cpu"; + + fsl_m25p80@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "fsl,espi-flash"; + reg = <0>; + linux,modalias = "fsl_m25p80"; + modal = "s25sl128b"; + spi-max-frequency = <50000000>; + mode = <0>; + + partition@0 { + /* 512KB for u-boot Bootloader Image */ + reg = <0x0 0x00080000>; + label = "SPI (RO) U-Boot Image"; + read-only; + }; + + partition@80000 { + /* 512KB for DTB Image */ + reg = <0x00080000 0x00080000>; + label = "SPI (RO) DTB Image"; + read-only; + }; + + partition@100000 { + /* 4MB for Linux Kernel Image */ + reg = <0x00100000 0x00400000>; + label = "SPI (RO) Linux Kernel Image"; + read-only; + }; + + partition@500000 { + /* 4MB for Compressed RFS Image */ + reg = <0x00500000 0x00400000>; + label = "SPI (RO) Compressed RFS Image"; + read-only; + }; + + partition@900000 { + /* 7MB for JFFS2 based RFS */ + reg = <0x00900000 0x00700000>; + label = "SPI (RW) JFFS2 RFS"; + }; + }; + }; + + gpio: gpio-controller@f000 { + #gpio-cells = <2>; + compatible = "fsl,mpc8572-gpio"; + reg = <0xf000 0x100>; + interrupts = <47 0x2>; + interrupt-parent = <&mpic>; + gpio-controller; + }; + + L2: l2-cache-controller@20000 { + compatible = "fsl,p1020-l2-cache-controller"; + reg = <0x20000 0x1000>; + cache-line-size = <32>; // 32 bytes + cache-size = <0x40000>; // L2,256K + interrupt-parent = <&mpic>; + interrupts = <16 2>; + }; + + dma@21300 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "fsl,eloplus-dma"; + reg = <0x21300 0x4>; + ranges = <0x0 0x21100 0x200>; + cell-index = <0>; + dma-channel@0 { + compatible = "fsl,eloplus-dma-channel"; + reg = <0x0 0x80>; + cell-index = <0>; + interrupt-parent = <&mpic>; + interrupts = <20 2>; + }; + dma-channel@80 { + compatible = "fsl,eloplus-dma-channel"; + reg = <0x80 0x80>; + cell-index = <1>; + interrupt-parent = <&mpic>; + interrupts = <21 2>; + }; + dma-channel@100 { + compatible = "fsl,eloplus-dma-channel"; + reg = <0x100 0x80>; + cell-index = <2>; + interrupt-parent = <&mpic>; + interrupts = <22 2>; + }; + dma-channel@180 { + compatible = "fsl,eloplus-dma-channel"; + reg = <0x180 0x80>; + cell-index = <3>; + interrupt-parent = <&mpic>; + interrupts = <23 2>; + }; + }; + + mdio@24000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "fsl,etsec2-mdio"; + reg = <0x24000 0x1000 0xb0030 0x4>; + + phy0: ethernet-phy@0 { + interrupt-parent = <&mpic>; + interrupts = <3 1>; + reg = <0x0>; + }; + + phy1: ethernet-phy@1 { + interrupt-parent = <&mpic>; + interrupts = <2 1>; + reg = <0x1>; + }; + }; + + mdio@25000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "fsl,etsec2-tbi"; + reg = <0x25000 0x1000 0xb1030 0x4>; + + tbi0: tbi-phy@11 { + reg = <0x11>; + device_type = "tbi-phy"; + }; + }; + + enet0: ethernet@b0000 { + #address-cells = <1>; + #size-cells = <1>; + device_type = "network"; + model = "eTSEC"; + compatible = "fsl,etsec2"; + fsl,num_rx_queues = <0x8>; + fsl,num_tx_queues = <0x8>; + local-mac-address = [ 00 00 00 00 00 00 ]; + interrupt-parent = <&mpic>; + fixed-link = <1 1 1000 0 0>; + phy-connection-type = "rgmii-id"; + + queue-group@0 { + #address-cells = <1>; + #size-cells = <1>; + reg = <0xb0000 0x1000>; + interrupts = <29 2 30 2 34 2>; + }; + + queue-group@1 { + #address-cells = <1>; + #size-cells = <1>; + reg = <0xb4000 0x1000>; + interrupts = <17 2 18 2 24 2>; + }; + }; + + enet1: ethernet@b1000 { + #address-cells = <1>; + #size-cells = <1>; + device_type = "network"; + model = "eTSEC"; + compatible = "fsl,etsec2"; + fsl,num_rx_queues = <0x8>; + fsl,num_tx_queues = <0x8>; + local-mac-address = [ 00 00 00 00 00 00 ]; + interrupt-parent = <&mpic>; + phy-handle = <&phy0>; + tbi-handle = <&tbi0>; + phy-connection-type = "sgmii"; + + queue-group@0 { + #address-cells = <1>; + #size-cells = <1>; + reg = <0xb1000 0x1000>; + interrupts = <35 2 36 2 40 2>; + }; + + queue-group@1 { + #address-cells = <1>; + #size-cells = <1>; + reg = <0xb5000 0x1000>; + interrupts = <51 2 52 2 67 2>; + }; + }; + + enet2: ethernet@b2000 { + #address-cells = <1>; + #size-cells = <1>; + device_type = "network"; + model = "eTSEC"; + compatible = "fsl,etsec2"; + fsl,num_rx_queues = <0x8>; + fsl,num_tx_queues = <0x8>; + local-mac-address = [ 00 00 00 00 00 00 ]; + interrupt-parent = <&mpic>; + phy-handle = <&phy1>; + phy-connection-type = "rgmii-id"; + + queue-group@0 { + #address-cells = <1>; + #size-cells = <1>; + reg = <0xb2000 0x1000>; + interrupts = <31 2 32 2 33 2>; + }; + + queue-group@1 { + #address-cells = <1>; + #size-cells = <1>; + reg = <0xb6000 0x1000>; + interrupts = <25 2 26 2 27 2>; + }; + }; + + usb@22000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "fsl-usb2-dr"; + reg = <0x22000 0x1000>; + interrupt-parent = <&mpic>; + interrupts = <28 0x2>; + phy_type = "ulpi"; + }; + + /* USB2 is shared with localbus, so it must be disabled + by default. We can't put 'status = "disabled";' here + since U-Boot doesn't clear the status property when + it enables USB2. OTOH, U-Boot does create a new node + when there isn't any. So, just comment it out. + usb@23000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "fsl-usb2-dr"; + reg = <0x23000 0x1000>; + interrupt-parent = <&mpic>; + interrupts = <46 0x2>; + phy_type = "ulpi"; + }; + */ + + sdhci@2e000 { + compatible = "fsl,p1020-esdhc", "fsl,esdhc"; + reg = <0x2e000 0x1000>; + interrupts = <72 0x2>; + interrupt-parent = <&mpic>; + /* Filled in by U-Boot */ + clock-frequency = <0>; + }; + + crypto@30000 { + compatible = "fsl,sec3.1", "fsl,sec3.0", "fsl,sec2.4", + "fsl,sec2.2", "fsl,sec2.1", "fsl,sec2.0"; + reg = <0x30000 0x10000>; + interrupts = <45 2 58 2>; + interrupt-parent = <&mpic>; + fsl,num-channels = <4>; + fsl,channel-fifo-len = <24>; + fsl,exec-units-mask = <0xbfe>; + fsl,descriptor-types-mask = <0x3ab0ebf>; + }; + + mpic: pic@40000 { + interrupt-controller; + #address-cells = <0>; + #interrupt-cells = <2>; + reg = <0x40000 0x40000>; + compatible = "chrp,open-pic"; + device_type = "open-pic"; + }; + + msi@41600 { + compatible = "fsl,p1020-msi", "fsl,mpic-msi"; + reg = <0x41600 0x80>; + msi-available-ranges = <0 0x100>; + interrupts = < + 0xe0 0 + 0xe1 0 + 0xe2 0 + 0xe3 0 + 0xe4 0 + 0xe5 0 + 0xe6 0 + 0xe7 0>; + interrupt-parent = <&mpic>; + }; + + global-utilities@e0000 { //global utilities block + compatible = "fsl,p1020-guts"; + reg = <0xe0000 0x1000>; + fsl,has-rstcr; + }; + }; + + pci0: pcie@ffe09000 { + compatible = "fsl,mpc8548-pcie"; + device_type = "pci"; + #interrupt-cells = <1>; + #size-cells = <2>; + #address-cells = <3>; + reg = <0 0xffe09000 0 0x1000>; + bus-range = <0 255>; + ranges = <0x2000000 0x0 0xa0000000 0 0xa0000000 0x0 0x20000000 + 0x1000000 0x0 0x00000000 0 0xffc30000 0x0 0x10000>; + clock-frequency = <33333333>; + interrupt-parent = <&mpic>; + interrupts = <16 2>; + pcie@0 { + reg = <0x0 0x0 0x0 0x0 0x0>; + #size-cells = <2>; + #address-cells = <3>; + device_type = "pci"; + ranges = <0x2000000 0x0 0xa0000000 + 0x2000000 0x0 0xa0000000 + 0x0 0x20000000 + + 0x1000000 0x0 0x0 + 0x1000000 0x0 0x0 + 0x0 0x100000>; + }; + }; + + pci1: pcie@ffe0a000 { + compatible = "fsl,mpc8548-pcie"; + device_type = "pci"; + #interrupt-cells = <1>; + #size-cells = <2>; + #address-cells = <3>; + reg = <0 0xffe0a000 0 0x1000>; + bus-range = <0 255>; + ranges = <0x2000000 0x0 0xc0000000 0 0xc0000000 0x0 0x20000000 + 0x1000000 0x0 0x00000000 0 0xffc20000 0x0 0x10000>; + clock-frequency = <33333333>; + interrupt-parent = <&mpic>; + interrupts = <16 2>; + pcie@0 { + reg = <0x0 0x0 0x0 0x0 0x0>; + #size-cells = <2>; + #address-cells = <3>; + device_type = "pci"; + ranges = <0x2000000 0x0 0xc0000000 + 0x2000000 0x0 0xc0000000 + 0x0 0x20000000 + + 0x1000000 0x0 0x0 + 0x1000000 0x0 0x0 + 0x0 0x100000>; + }; + }; +}; From owner-svn-src-all@FreeBSD.ORG Mon Nov 14 19:10:21 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 52E08106566B; Mon, 14 Nov 2011 19:10:21 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 08B8D8FC17; Mon, 14 Nov 2011 19:10:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAEJAKKb062564; Mon, 14 Nov 2011 19:10:20 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAEJAKoK062562; Mon, 14 Nov 2011 19:10:20 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201111141910.pAEJAKoK062562@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 14 Nov 2011 19:10:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227509 - head/sys/dev/ti X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Nov 2011 19:10:21 -0000 Author: yongari Date: Mon Nov 14 19:10:20 2011 New Revision: 227509 URL: http://svn.freebsd.org/changeset/base/227509 Log: Export sysctl node for various interrupt moderation parameters and have administrators control them. ti(4) provides a character device to control various other features of driver via ioctls but users had to write their own code to manipulate these parameters. It seems some default values for these parameters are not optimal on today's system but leave it as it was and let administrators change them. The following parameters could be changed: dev.ti.%d.rx_coal_ticks dev.ti.%d.rx_max_coal_bds dev.ti.%d.tx_coal_ticks dev.ti.%d.tx_max_coal_bds dev.ti.%d.tx_buf_ratio dev.ti.%d.stat_ticks The interface has to be brought down and up again before a change takes effect. ti(4) controller supports hardware MAC counters with additional DMA statistics. So it's doable to export these counters via sysctl interface. Unfortunately, these counters are cumulative such that driver have to either send an explicit clear command to controller after extracting them or have to maintain internal counters to get actual changes. Neither look good to me so counters were not exported via sysctl. Modified: head/sys/dev/ti/if_ti.c Modified: head/sys/dev/ti/if_ti.c ============================================================================== --- head/sys/dev/ti/if_ti.c Mon Nov 14 19:06:28 2011 (r227508) +++ head/sys/dev/ti/if_ti.c Mon Nov 14 19:10:20 2011 (r227509) @@ -125,6 +125,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #define TI_CSUM_FEATURES (CSUM_IP | CSUM_TCP | CSUM_UDP | CSUM_IP_FRAGS) /* * We can only turn on header splitting if we're using extended receive @@ -247,6 +249,8 @@ static __inline void ti_hdr_split(struct int idx); #endif /* TI_JUMBO_HDRSPLIT */ +static void ti_sysctl_node(struct ti_softc *); + static device_method_t ti_methods[] = { /* Device interface */ DEVMETHOD(device_probe, ti_probe), @@ -2083,7 +2087,7 @@ ti_gibinit(struct ti_softc *sc) bus_dmamap_sync(sc->ti_rdata_dmat, sc->ti_rdata_dmamap, BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE); - /* Set up tuneables */ + /* Set up tunables */ #if 0 if (ifp->if_mtu > (ETHERMTU + ETHER_HDR_LEN + ETHER_CRC_LEN)) CSR_WRITE_4(sc, TI_GCR_RX_COAL_TICKS, @@ -2352,19 +2356,8 @@ ti_attach(device_t dev) pci_get_device(dev) == NG_DEVICEID_GA620T) sc->ti_copper = 1; - /* Set default tuneable values. */ - sc->ti_stat_ticks = 2 * TI_TICKS_PER_SEC; -#if 0 - sc->ti_rx_coal_ticks = TI_TICKS_PER_SEC / 5000; -#endif - sc->ti_rx_coal_ticks = 170; - sc->ti_tx_coal_ticks = TI_TICKS_PER_SEC / 500; - sc->ti_rx_max_coal_bds = 64; -#if 0 - sc->ti_tx_max_coal_bds = 128; -#endif - sc->ti_tx_max_coal_bds = 32; - sc->ti_tx_buf_ratio = 21; + /* Set default tunable values. */ + ti_sysctl_node(sc); /* Set up ifnet structure */ ifp->if_softc = sc; @@ -3858,3 +3851,58 @@ ti_shutdown(device_t dev) return (0); } + +static void +ti_sysctl_node(struct ti_softc *sc) +{ + struct sysctl_ctx_list *ctx; + struct sysctl_oid_list *child; + + ctx = device_get_sysctl_ctx(sc->ti_dev); + child = SYSCTL_CHILDREN(device_get_sysctl_tree(sc->ti_dev)); + + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "rx_coal_ticks", CTLFLAG_RW, + &sc->ti_rx_coal_ticks, 0, "Receive coalcesced ticks"); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "rx_max_coal_bds", CTLFLAG_RW, + &sc->ti_rx_max_coal_bds, 0, "Receive max coalcesced BDs"); + + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "tx_coal_ticks", CTLFLAG_RW, + &sc->ti_tx_coal_ticks, 0, "Send coalcesced ticks"); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "tx_max_coal_bds", CTLFLAG_RW, + &sc->ti_tx_max_coal_bds, 0, "Send max coalcesced BDs"); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "tx_buf_ratio", CTLFLAG_RW, + &sc->ti_tx_buf_ratio, 0, + "Ratio of NIC memory devoted to TX buffer"); + + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "stat_ticks", CTLFLAG_RW, + &sc->ti_stat_ticks, 0, + "Number of clock ticks for statistics update interval"); + + /* Pull in device tunables. */ + sc->ti_rx_coal_ticks = 170; + resource_int_value(device_get_name(sc->ti_dev), + device_get_unit(sc->ti_dev), "rx_coal_ticks", + &sc->ti_rx_coal_ticks); + sc->ti_rx_max_coal_bds = 64; + resource_int_value(device_get_name(sc->ti_dev), + device_get_unit(sc->ti_dev), "rx_max_coal_bds", + &sc->ti_rx_max_coal_bds); + + sc->ti_tx_coal_ticks = TI_TICKS_PER_SEC / 500; + resource_int_value(device_get_name(sc->ti_dev), + device_get_unit(sc->ti_dev), "tx_coal_ticks", + &sc->ti_tx_coal_ticks); + sc->ti_tx_max_coal_bds = 32; + resource_int_value(device_get_name(sc->ti_dev), + device_get_unit(sc->ti_dev), "tx_max_coal_bds", + &sc->ti_tx_max_coal_bds); + sc->ti_tx_buf_ratio = 21; + resource_int_value(device_get_name(sc->ti_dev), + device_get_unit(sc->ti_dev), "tx_buf_ratio", + &sc->ti_tx_buf_ratio); + + sc->ti_stat_ticks = 2 * TI_TICKS_PER_SEC; + resource_int_value(device_get_name(sc->ti_dev), + device_get_unit(sc->ti_dev), "stat_ticks", + &sc->ti_stat_ticks); +} From owner-svn-src-all@FreeBSD.ORG Mon Nov 14 19:19:16 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2BF8A106566C; Mon, 14 Nov 2011 19:19:16 +0000 (UTC) (envelope-from das@freebsd.org) Received: from zim.MIT.EDU (ZIM.MIT.EDU [18.95.3.101]) by mx1.freebsd.org (Postfix) with ESMTP id C2DAF8FC1D; Mon, 14 Nov 2011 19:19:15 +0000 (UTC) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.5/8.14.2) with ESMTP id pAEJJEs1058722; Mon, 14 Nov 2011 14:19:14 -0500 (EST) (envelope-from das@freebsd.org) Received: (from das@localhost) by zim.MIT.EDU (8.14.5/8.14.2/Submit) id pAEJJEXh058721; Mon, 14 Nov 2011 14:19:14 -0500 (EST) (envelope-from das@freebsd.org) Date: Mon, 14 Nov 2011 14:19:14 -0500 From: David Schultz To: David Chisnall Message-ID: <20111114191914.GA58676@zim.MIT.EDU> Mail-Followup-To: David Chisnall , Dimitry Andric , Stefan Farfeleder , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201111131618.pADGIm2n099696@svn.freebsd.org> <20111114082129.GA1596@mole.fafoe.narf.at> <4EC0E6C2.4010509@FreeBSD.org> <20111114180235.GA58284@zim.MIT.EDU> <3B8C1412-E18D-47E3-A09D-4847DD078963@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3B8C1412-E18D-47E3-A09D-4847DD078963@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Stefan Farfeleder , Dimitry Andric , src-committers@freebsd.org Subject: Re: svn commit: r227487 - head/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Nov 2011 19:19:16 -0000 On Mon, Nov 14, 2011, David Chisnall wrote: > On 14 Nov 2011, at 18:02, David Schultz wrote: > > > On Mon, Nov 14, 2011, Dimitry Andric wrote: > >> On 2011-11-14 09:21, Stefan Farfeleder wrote: > >>> On Sun, Nov 13, 2011 at 04:18:48PM +0000, David Chisnall wrote: > >>>> Author: theraven > >>>> Date: Sun Nov 13 16:18:48 2011 > >>>> New Revision: 227487 > >>>> URL: http://svn.freebsd.org/changeset/base/227487 > >>>> > >>>> Log: > >>>> The spec says that FILE must be defined in wchar.h, but it wasn't. It > >>>> is now. Also hide some macros in C++ mode that will break C++ > >>>> namespaced calls. > >>>> > >>>> Approved by: dim (mentor) > >>> > >>> I think this change is wrong. Whic spec are you referring to? C99 > >>> defines FILE only in 7.19.1#2 (stdio.h). In other headers FILE is used > >>> as parameter type for functions but that does not mean it is exported to > >>> user space. > >> > >> http://pubs.opengroup.org/onlinepubs/007908799/xsh/wchar.h.html > > > > It's a niggling detail, but that's an extension to the C standard, > > so properly speaking, it belongs in an > > #if __POSIX_VISIBLE >= 200809 || XSI_VISIBLE > > (or something like that). The formals were struct __sFILE * > > instead of FILE * for that reason -- see r103177. > > > > P.S. You're looking at a very old version of POSIX. Check out: > > http://pubs.opengroup.org/onlinepubs/9699919799/ > > The C99 and C1x specifications both seem to require stdio.h to be included before wchar.h. I think this therefore places including wchar.h and not stdio.h in the category of undefined (or, at least, not defined) behaviour, so we are free to do anything in this case. I would say that accepting the code and working as the programmer expected is the least harmful thing to do here. This is what Darwin libc does (actually, it #includes stdio.h in wchar.h). The C99 standard has plenty of examples of programs including but not . The latter is only required to call the functions that take a FILE * parameter. It's mostly an academic point because no sane programmer would ever create a new type named FILE, but FreeBSD actually did right by C99 before you reverted r103177. From owner-svn-src-all@FreeBSD.ORG Mon Nov 14 19:32:06 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 05FA9106564A; Mon, 14 Nov 2011 19:32:06 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D08828FC0A; Mon, 14 Nov 2011 19:32:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAEJW5JA063252; Mon, 14 Nov 2011 19:32:05 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAEJW5wn063250; Mon, 14 Nov 2011 19:32:05 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201111141932.pAEJW5wn063250@svn.freebsd.org> From: Alexander Motin Date: Mon, 14 Nov 2011 19:32:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227510 - head/sys/geom X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Nov 2011 19:32:06 -0000 Author: mav Date: Mon Nov 14 19:32:05 2011 New Revision: 227510 URL: http://svn.freebsd.org/changeset/base/227510 Log: Temporary revert r227009 to fix freeze on UP systems without PREEMPTION. Before r215687, if some withered geom or provider could not be destroyed, g_event thread went to sleep for 0.1s before retrying. After that change it is just restarting immediately. r227009 made orphaned (withered) provider to not detach immediately, but only after context switch. That made loop inside g_event thread infinite on UP systems without PREEMPTION. To address original problem with possible dead lock addressed by r227009 we have to fix r215687 change first, that needs some time to think and test. Modified: head/sys/geom/geom_dev.c Modified: head/sys/geom/geom_dev.c ============================================================================== --- head/sys/geom/geom_dev.c Mon Nov 14 19:10:20 2011 (r227509) +++ head/sys/geom/geom_dev.c Mon Nov 14 19:32:05 2011 (r227510) @@ -506,32 +506,6 @@ g_dev_strategy(struct bio *bp) */ static void -g_dev_cleanup(void *arg) -{ - struct g_geom *gp; - struct g_consumer *cp; - - mtx_unlock(&Giant); - cp = arg; - gp = cp->geom; - g_trace(G_T_TOPOLOGY, "g_dev_cleanup(%p(%s))", cp, cp->provider->name); - - /* Wait for the cows to come home */ - while (cp->nstart != cp->nend) - pause("gdevcleanup", hz / 10); - - g_topology_lock(); - if (cp->acr > 0 || cp->acw > 0 || cp->ace > 0) - g_access(cp, -cp->acr, -cp->acw, -cp->ace); - - g_detach(cp); - g_destroy_consumer(cp); - g_destroy_geom(gp); - g_topology_unlock(); - mtx_lock(&Giant); -} - -static void g_dev_orphan(struct g_consumer *cp) { struct g_geom *gp; @@ -547,7 +521,18 @@ g_dev_orphan(struct g_consumer *cp) set_dumper(NULL); /* Destroy the struct cdev *so we get no more requests */ - destroy_dev_sched_cb(dev, g_dev_cleanup, cp); + destroy_dev(dev); + + /* Wait for the cows to come home */ + while (cp->nstart != cp->nend) + pause("gdevorphan", hz / 10); + + if (cp->acr > 0 || cp->acw > 0 || cp->ace > 0) + g_access(cp, -cp->acr, -cp->acw, -cp->ace); + + g_detach(cp); + g_destroy_consumer(cp); + g_destroy_geom(gp); } DECLARE_GEOM_CLASS(g_dev_class, g_dev); From owner-svn-src-all@FreeBSD.ORG Mon Nov 14 19:39:13 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B6AF0106564A; Mon, 14 Nov 2011 19:39:13 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id D6E1A8FC0C; Mon, 14 Nov 2011 19:39:12 +0000 (UTC) Received: by bkbzs8 with SMTP id zs8so8671886bkb.13 for ; Mon, 14 Nov 2011 11:39:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=MtG5TVXXYEDoWneYYUeSC0MuJufulqxU0BuHaOTJLLE=; b=JjfGUkgzMKDue35psscekueQxEKBWZWKM5/SRlEDMSr/dS+zD2TsN9JBQw6euN5H/s 8UUR7Id57JSlv+obEJv6Vms5NZwxfxHPIR72aSvVmB0tO9+CjiB4VytxtIDaGTXcDpI4 /eKM1W+Xyc7DYPJShOL84VEWhMwZXbeCnW6iw= Received: by 10.204.133.197 with SMTP id g5mr20616051bkt.43.1321299551670; Mon, 14 Nov 2011 11:39:11 -0800 (PST) Received: from mavbook2.mavhome.dp.ua (pc.mavhome.dp.ua. [212.86.226.226]) by mx.google.com with ESMTPS id o7sm24398976bkw.16.2011.11.14.11.39.09 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 14 Nov 2011 11:39:10 -0800 (PST) Sender: Alexander Motin Message-ID: <4EC16E5C.50806@FreeBSD.org> Date: Mon, 14 Nov 2011 21:39:08 +0200 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:7.0.1) Gecko/20111003 Thunderbird/7.0.1 MIME-Version: 1.0 To: Marius Strobl References: <201111012312.pA1NCNuY089112@svn.freebsd.org> <20111112210900.GJ56603@alchemy.franken.de> In-Reply-To: <20111112210900.GJ56603@alchemy.franken.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r227009 - head/sys/geom X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Nov 2011 19:39:13 -0000 On 11/12/11 23:09, Marius Strobl wrote: > On Tue, Nov 01, 2011 at 11:12:23PM +0000, Alexander Motin wrote: >> Author: mav >> Date: Tue Nov 1 23:12:22 2011 >> New Revision: 227009 >> URL: http://svn.freebsd.org/changeset/base/227009 >> >> Log: >> Make orphan() method in geom_dev asynchronous using destroy_dev_sched_cb() >> instead of destroy_dev(). It moves device destruction waiting out of the >> topology lock and so fixes dead lock between orphanization and closing. >> Real provider and geom destruction called from swi context after device >> destroyed as callback of the destroy_dev_sched_cb(). >> > > This change causes fsck_ffs(8) and mount(8) to hang unkillably on > sparc64 when the kernel is built with either GEOM_PART_GPT or > GEOM_LABEL. Thank you for the report. I have found cause of the freeze. r227009 temporary reverted at r227510. I am sorry. -- Alexander Motin. From owner-svn-src-all@FreeBSD.ORG Mon Nov 14 19:44:27 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 943F7106566B; Mon, 14 Nov 2011 19:44:27 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) by mx1.freebsd.org (Postfix) with ESMTP id B9D078FC13; Mon, 14 Nov 2011 19:44:26 +0000 (UTC) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.14.4/8.14.4/ALCHEMY.FRANKEN.DE) with ESMTP id pAEJiPQo083782; Mon, 14 Nov 2011 20:44:25 +0100 (CET) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.14.4/8.14.4/Submit) id pAEJiPkd083781; Mon, 14 Nov 2011 20:44:25 +0100 (CET) (envelope-from marius) Date: Mon, 14 Nov 2011 20:44:25 +0100 From: Marius Strobl To: Alexander Motin Message-ID: <20111114194425.GV93221@alchemy.franken.de> References: <201111012312.pA1NCNuY089112@svn.freebsd.org> <20111112210900.GJ56603@alchemy.franken.de> <4EC16E5C.50806@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4EC16E5C.50806@FreeBSD.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r227009 - head/sys/geom X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Nov 2011 19:44:27 -0000 On Mon, Nov 14, 2011 at 09:39:08PM +0200, Alexander Motin wrote: > On 11/12/11 23:09, Marius Strobl wrote: > > On Tue, Nov 01, 2011 at 11:12:23PM +0000, Alexander Motin wrote: > >> Author: mav > >> Date: Tue Nov 1 23:12:22 2011 > >> New Revision: 227009 > >> URL: http://svn.freebsd.org/changeset/base/227009 > >> > >> Log: > >> Make orphan() method in geom_dev asynchronous using destroy_dev_sched_cb() > >> instead of destroy_dev(). It moves device destruction waiting out of the > >> topology lock and so fixes dead lock between orphanization and closing. > >> Real provider and geom destruction called from swi context after device > >> destroyed as callback of the destroy_dev_sched_cb(). > >> > > > > This change causes fsck_ffs(8) and mount(8) to hang unkillably on > > sparc64 when the kernel is built with either GEOM_PART_GPT or > > GEOM_LABEL. > > Thank you for the report. I have found cause of the freeze. r227009 > temporary reverted at r227510. I am sorry. > Thanks! Marius From owner-svn-src-all@FreeBSD.ORG Mon Nov 14 20:32:39 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ED87D106567C; Mon, 14 Nov 2011 20:32:39 +0000 (UTC) (envelope-from rm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DD9DE8FC23; Mon, 14 Nov 2011 20:32:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAEKWdqp065185; Mon, 14 Nov 2011 20:32:39 GMT (envelope-from rm@svn.freebsd.org) Received: (from rm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAEKWdkG065183; Mon, 14 Nov 2011 20:32:39 GMT (envelope-from rm@svn.freebsd.org) Message-Id: <201111142032.pAEKWdkG065183@svn.freebsd.org> From: Ruslan Mahmatkhanov Date: Mon, 14 Nov 2011 20:32:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227511 - head/share/misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Nov 2011 20:32:40 -0000 Author: rm (ports committer) Date: Mon Nov 14 20:32:39 2011 New Revision: 227511 URL: http://svn.freebsd.org/changeset/base/227511 Log: - add my co-mentors Approved by: novel (mentor) Modified: head/share/misc/committers-ports.dot Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Mon Nov 14 19:32:05 2011 (r227510) +++ head/share/misc/committers-ports.dot Mon Nov 14 20:32:39 2011 (r227511) @@ -281,6 +281,7 @@ garga -> xride glarkin -> avl glarkin -> cs +glarkin -> rm glewis -> hq glewis -> jkim @@ -353,6 +354,7 @@ miwi -> mandree miwi -> mva miwi -> nox miwi -> pawel +miwi -> rm miwi -> sbz miwi -> sylvio miwi -> tabthorpe From owner-svn-src-all@FreeBSD.ORG Mon Nov 14 20:38:14 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EC60A106566B; Mon, 14 Nov 2011 20:38:14 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DA5B98FC0C; Mon, 14 Nov 2011 20:38:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAEKcEjJ065416; Mon, 14 Nov 2011 20:38:14 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAEKcEsL065413; Mon, 14 Nov 2011 20:38:14 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201111142038.pAEKcEsL065413@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 14 Nov 2011 20:38:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227512 - head/sys/dev/ti X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Nov 2011 20:38:15 -0000 Author: yongari Date: Mon Nov 14 20:38:14 2011 New Revision: 227512 URL: http://svn.freebsd.org/changeset/base/227512 Log: Overhaul bus_dma(9) usage in driver: - Don't use a single big DMA block for all rings. Create separate DMA area for each ring instead. Currently the following DMA areas are created: Event ring, standard RX ring, jumbo RX ring, RX return ring, hardware MAC statistics and producer/consumer status area. For Tigon II, mini RX ring and TX ring are additionally created. - Added missing bus_dmamap_sync(9) in various TX/RX paths. - TX ring is no longer created for Tigon 1 such that it saves more resources on Tigon 1. - Data sheet is not clear about alignment requirement of each ring so use 32 bytes alignment for normal DMA area but use 64 bytes alignment for jumbo RX ring where the extended RX descriptor size is 64 bytes. - For each TX/RX buffers use separate DMA tag(e.g. the size of a DMA segment, total size of DMA segments etc). - Tigon allows separate DMA area for event producer, RX return producer and TX consumer which is really cool feature. This means TX and RX path could be independently run in parallel. However ti(4) uses a single driver lock so it's meaningless to have separate DMA area for these producer/consumer such that this change creates a single status DMA area. - It seems Tigon has no limits on DMA address space and I also don't see any problem with that but old comments in driver indicates there could be issues on descriptors being located in 64bit region. Introduce a tunable, dev.ti.%d.dac, to disable using 64bit DMA in driver. The default is 0 which means it would use full 64bit DMA. If there are DMA issues, users can disable it by setting the tunable to 0. - Do not increase watchdog timer in ti_txeof(). Previously driver increased the watchdog timer whenever there are queued TX frames. - When stat ticks is set to 0, skip processing ti_stats_update(), avoiding bus_dmamap_sync(9) and updating if_collisions counter. - MTU does not include FCS bytes, replace it with ETHER_VLAN_ENCAP_LEN. With these changes, ti(4) should work on PAE environments. Many thanks to Jay Borkenhagen for remote hardware access. Modified: head/sys/dev/ti/if_ti.c head/sys/dev/ti/if_tireg.h Modified: head/sys/dev/ti/if_ti.c ============================================================================== --- head/sys/dev/ti/if_ti.c Mon Nov 14 20:32:39 2011 (r227511) +++ head/sys/dev/ti/if_ti.c Mon Nov 14 20:38:14 2011 (r227512) @@ -220,9 +220,13 @@ static void ti_loadfw(struct ti_softc *) static void ti_cmd(struct ti_softc *, struct ti_cmd_desc *); static void ti_cmd_ext(struct ti_softc *, struct ti_cmd_desc *, caddr_t, int); static void ti_handle_events(struct ti_softc *); -static int ti_alloc_dmamaps(struct ti_softc *); -static void ti_free_dmamaps(struct ti_softc *); -static int ti_alloc_jumbo_mem(struct ti_softc *); +static void ti_dma_map_addr(void *, bus_dma_segment_t *, int, int); +static int ti_dma_alloc(struct ti_softc *); +static void ti_dma_free(struct ti_softc *); +static int ti_dma_ring_alloc(struct ti_softc *, bus_size_t, bus_size_t, + bus_dma_tag_t *, uint8_t **, bus_dmamap_t *, bus_addr_t *, const char *); +static void ti_dma_ring_free(struct ti_softc *, bus_dma_tag_t *, uint8_t **, + bus_dmamap_t *); static int ti_newbuf_std(struct ti_softc *, int); static int ti_newbuf_mini(struct ti_softc *, int); static int ti_newbuf_jumbo(struct ti_softc *, int, struct mbuf *); @@ -911,11 +915,13 @@ ti_handle_events(struct ti_softc *sc) { struct ti_event_desc *e; - if (sc->ti_rdata->ti_event_ring == NULL) + if (sc->ti_rdata.ti_event_ring == NULL) return; + bus_dmamap_sync(sc->ti_cdata.ti_event_ring_tag, + sc->ti_cdata.ti_event_ring_map, BUS_DMASYNC_POSTREAD); while (sc->ti_ev_saved_considx != sc->ti_ev_prodidx.ti_idx) { - e = &sc->ti_rdata->ti_event_ring[sc->ti_ev_saved_considx]; + e = &sc->ti_rdata.ti_event_ring[sc->ti_ev_saved_considx]; switch (TI_EVENT_EVENT(e)) { case TI_EV_LINKSTAT_CHANGED: sc->ti_linkstat = TI_EVENT_CODE(e); @@ -967,181 +973,402 @@ ti_handle_events(struct ti_softc *sc) TI_INC(sc->ti_ev_saved_considx, TI_EVENT_RING_CNT); CSR_WRITE_4(sc, TI_GCR_EVENTCONS_IDX, sc->ti_ev_saved_considx); } + bus_dmamap_sync(sc->ti_cdata.ti_event_ring_tag, + sc->ti_cdata.ti_event_ring_map, BUS_DMASYNC_PREREAD); +} + +struct ti_dmamap_arg { + bus_addr_t ti_busaddr; +}; + +static void +ti_dma_map_addr(void *arg, bus_dma_segment_t *segs, int nseg, int error) +{ + struct ti_dmamap_arg *ctx; + + if (error) + return; + + KASSERT(nseg == 1, ("%s: %d segments returned!", __func__, nseg)); + + ctx = arg; + ctx->ti_busaddr = segs->ds_addr; } static int -ti_alloc_dmamaps(struct ti_softc *sc) +ti_dma_ring_alloc(struct ti_softc *sc, bus_size_t alignment, bus_size_t maxsize, + bus_dma_tag_t *tag, uint8_t **ring, bus_dmamap_t *map, bus_addr_t *paddr, + const char *msg) { - int i; + struct ti_dmamap_arg ctx; + int error; - for (i = 0; i < TI_TX_RING_CNT; i++) { - sc->ti_cdata.ti_txdesc[i].tx_m = NULL; - sc->ti_cdata.ti_txdesc[i].tx_dmamap = NULL; - if (bus_dmamap_create(sc->ti_mbuftx_dmat, 0, - &sc->ti_cdata.ti_txdesc[i].tx_dmamap)) { - device_printf(sc->ti_dev, - "cannot create DMA map for TX\n"); - return (ENOBUFS); - } + error = bus_dma_tag_create(sc->ti_cdata.ti_parent_tag, + alignment, 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, + NULL, maxsize, 1, maxsize, 0, NULL, NULL, tag); + if (error != 0) { + device_printf(sc->ti_dev, + "could not create %s dma tag\n", msg); + return (error); + } + /* Allocate DMA'able memory for ring. */ + error = bus_dmamem_alloc(*tag, (void **)ring, + BUS_DMA_NOWAIT | BUS_DMA_ZERO | BUS_DMA_COHERENT, map); + if (error != 0) { + device_printf(sc->ti_dev, + "could not allocate DMA'able memory for %s\n", msg); + return (error); } + /* Load the address of the ring. */ + ctx.ti_busaddr = 0; + error = bus_dmamap_load(*tag, *map, *ring, maxsize, ti_dma_map_addr, + &ctx, BUS_DMA_NOWAIT); + if (error != 0) { + device_printf(sc->ti_dev, + "could not load DMA'able memory for %s\n", msg); + return (error); + } + *paddr = ctx.ti_busaddr; + return (0); +} + +static void +ti_dma_ring_free(struct ti_softc *sc, bus_dma_tag_t *tag, uint8_t **ring, + bus_dmamap_t *map) +{ + + if (*map != NULL) + bus_dmamap_unload(*tag, *map); + if (*map != NULL && *ring != NULL) { + bus_dmamem_free(*tag, *ring, *map); + *ring = NULL; + *map = NULL; + } + if (*tag) { + bus_dma_tag_destroy(*tag); + *tag = NULL; + } +} + +static int +ti_dma_alloc(struct ti_softc *sc) +{ + bus_addr_t lowaddr; + int i, error; + + lowaddr = BUS_SPACE_MAXADDR; + if (sc->ti_dac == 0) + lowaddr = BUS_SPACE_MAXADDR_32BIT; + + error = bus_dma_tag_create(bus_get_dma_tag(sc->ti_dev), 1, 0, lowaddr, + BUS_SPACE_MAXADDR, NULL, NULL, BUS_SPACE_MAXSIZE_32BIT, 0, + BUS_SPACE_MAXSIZE_32BIT, 0, NULL, NULL, + &sc->ti_cdata.ti_parent_tag); + if (error != 0) { + device_printf(sc->ti_dev, + "could not allocate parent dma tag\n"); + return (ENOMEM); + } + + error = ti_dma_ring_alloc(sc, TI_RING_ALIGN, sizeof(struct ti_gib), + &sc->ti_cdata.ti_gib_tag, (uint8_t **)&sc->ti_rdata.ti_info, + &sc->ti_cdata.ti_gib_map, &sc->ti_rdata.ti_info_paddr, "GIB"); + if (error) + return (error); + + /* Producer/consumer status */ + error = ti_dma_ring_alloc(sc, TI_RING_ALIGN, sizeof(struct ti_status), + &sc->ti_cdata.ti_status_tag, (uint8_t **)&sc->ti_rdata.ti_status, + &sc->ti_cdata.ti_status_map, &sc->ti_rdata.ti_status_paddr, + "event ring"); + if (error) + return (error); + + /* Event ring */ + error = ti_dma_ring_alloc(sc, TI_RING_ALIGN, TI_EVENT_RING_SZ, + &sc->ti_cdata.ti_event_ring_tag, + (uint8_t **)&sc->ti_rdata.ti_event_ring, + &sc->ti_cdata.ti_event_ring_map, &sc->ti_rdata.ti_event_ring_paddr, + "event ring"); + if (error) + return (error); + + /* Command ring lives in shared memory so no need to create DMA area. */ + + /* Standard RX ring */ + error = ti_dma_ring_alloc(sc, TI_RING_ALIGN, TI_STD_RX_RING_SZ, + &sc->ti_cdata.ti_rx_std_ring_tag, + (uint8_t **)&sc->ti_rdata.ti_rx_std_ring, + &sc->ti_cdata.ti_rx_std_ring_map, + &sc->ti_rdata.ti_rx_std_ring_paddr, "RX ring"); + if (error) + return (error); + + /* Jumbo RX ring */ + error = ti_dma_ring_alloc(sc, TI_JUMBO_RING_ALIGN, TI_JUMBO_RX_RING_SZ, + &sc->ti_cdata.ti_rx_jumbo_ring_tag, + (uint8_t **)&sc->ti_rdata.ti_rx_jumbo_ring, + &sc->ti_cdata.ti_rx_jumbo_ring_map, + &sc->ti_rdata.ti_rx_jumbo_ring_paddr, "jumbo RX ring"); + if (error) + return (error); + + /* RX return ring */ + error = ti_dma_ring_alloc(sc, TI_RING_ALIGN, TI_RX_RETURN_RING_SZ, + &sc->ti_cdata.ti_rx_return_ring_tag, + (uint8_t **)&sc->ti_rdata.ti_rx_return_ring, + &sc->ti_cdata.ti_rx_return_ring_map, + &sc->ti_rdata.ti_rx_return_ring_paddr, "RX return ring"); + if (error) + return (error); + + /* Create DMA tag for standard RX mbufs. */ + error = bus_dma_tag_create(sc->ti_cdata.ti_parent_tag, 1, 0, + BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, MCLBYTES, 1, + MCLBYTES, 0, NULL, NULL, &sc->ti_cdata.ti_rx_std_tag); + if (error) { + device_printf(sc->ti_dev, "could not allocate RX dma tag\n"); + return (error); + } + + /* Create DMA tag for jumbo RX mbufs. */ +#ifdef TI_SF_BUF_JUMBO + /* + * The VM system will take care of providing aligned pages. Alignment + * is set to 1 here so that busdma resources won't be wasted. + */ + error = bus_dma_tag_create(sc->ti_cdata.ti_parent_tag, 1, 0, + BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, PAGE_SIZE * 4, 4, + PAGE_SIZE, 0, NULL, NULL, &sc->ti_cdata.ti_rx_jumbo_tag); +#else + error = bus_dma_tag_create(sc->ti_cdata.ti_parent_tag, 1, 0, + BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, MJUM9BYTES, 1, + MJUM9BYTES, 0, NULL, NULL, &sc->ti_cdata.ti_rx_jumbo_tag); +#endif + if (error) { + device_printf(sc->ti_dev, + "could not allocate jumbo RX dma tag\n"); + return (error); + } + + /* Create DMA tag for TX mbufs. */ + error = bus_dma_tag_create(sc->ti_cdata.ti_parent_tag, 1, + 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, + MCLBYTES * TI_MAXTXSEGS, TI_MAXTXSEGS, MCLBYTES, 0, NULL, NULL, + &sc->ti_cdata.ti_tx_tag); + if (error) { + device_printf(sc->ti_dev, "could not allocate TX dma tag\n"); + return (ENOMEM); + } + + /* Create DMA maps for RX buffers. */ for (i = 0; i < TI_STD_RX_RING_CNT; i++) { - if (bus_dmamap_create(sc->ti_mbufrx_dmat, 0, - &sc->ti_cdata.ti_rx_std_maps[i])) { + error = bus_dmamap_create(sc->ti_cdata.ti_rx_std_tag, 0, + &sc->ti_cdata.ti_rx_std_maps[i]); + if (error) { device_printf(sc->ti_dev, - "cannot create DMA map for RX\n"); - return (ENOBUFS); + "could not create DMA map for RX\n"); + return (error); } } - if (bus_dmamap_create(sc->ti_mbufrx_dmat, 0, - &sc->ti_cdata.ti_rx_std_sparemap)) { + error = bus_dmamap_create(sc->ti_cdata.ti_rx_std_tag, 0, + &sc->ti_cdata.ti_rx_std_sparemap); + if (error) { device_printf(sc->ti_dev, - "cannot create spare DMA map for RX\n"); - return (ENOBUFS); + "could not create spare DMA map for RX\n"); + return (error); } + /* Create DMA maps for jumbo RX buffers. */ for (i = 0; i < TI_JUMBO_RX_RING_CNT; i++) { - if (bus_dmamap_create(sc->ti_jumbo_dmat, 0, - &sc->ti_cdata.ti_rx_jumbo_maps[i])) { + error = bus_dmamap_create(sc->ti_cdata.ti_rx_jumbo_tag, 0, + &sc->ti_cdata.ti_rx_jumbo_maps[i]); + if (error) { device_printf(sc->ti_dev, - "cannot create DMA map for jumbo RX\n"); - return (ENOBUFS); + "could not create DMA map for jumbo RX\n"); + return (error); } } - if (bus_dmamap_create(sc->ti_jumbo_dmat, 0, - &sc->ti_cdata.ti_rx_jumbo_sparemap)) { + error = bus_dmamap_create(sc->ti_cdata.ti_rx_jumbo_tag, 0, + &sc->ti_cdata.ti_rx_jumbo_sparemap); + if (error) { device_printf(sc->ti_dev, - "cannot create spare DMA map for jumbo RX\n"); - return (ENOBUFS); + "could not create spare DMA map for jumbo RX\n"); + return (error); + } + + /* Create DMA maps for TX buffers. */ + for (i = 0; i < TI_TX_RING_CNT; i++) { + error = bus_dmamap_create(sc->ti_cdata.ti_tx_tag, 0, + &sc->ti_cdata.ti_txdesc[i].tx_dmamap); + if (error) { + device_printf(sc->ti_dev, + "could not create DMA map for TX\n"); + return (ENOMEM); + } } - /* Mini ring is not available on Tigon 1. */ + /* Mini ring and TX ring is not available on Tigon 1. */ if (sc->ti_hwrev == TI_HWREV_TIGON) return (0); + /* TX ring */ + error = ti_dma_ring_alloc(sc, TI_RING_ALIGN, TI_TX_RING_SZ, + &sc->ti_cdata.ti_tx_ring_tag, (uint8_t **)&sc->ti_rdata.ti_tx_ring, + &sc->ti_cdata.ti_tx_ring_map, &sc->ti_rdata.ti_tx_ring_paddr, + "TX ring"); + if (error) + return (error); + + /* Mini RX ring */ + error = ti_dma_ring_alloc(sc, TI_RING_ALIGN, TI_MINI_RX_RING_SZ, + &sc->ti_cdata.ti_rx_mini_ring_tag, + (uint8_t **)&sc->ti_rdata.ti_rx_mini_ring, + &sc->ti_cdata.ti_rx_mini_ring_map, + &sc->ti_rdata.ti_rx_mini_ring_paddr, "mini RX ring"); + if (error) + return (error); + + /* Create DMA tag for mini RX mbufs. */ + error = bus_dma_tag_create(sc->ti_cdata.ti_parent_tag, 1, 0, + BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, MHLEN, 1, + MHLEN, 0, NULL, NULL, &sc->ti_cdata.ti_rx_mini_tag); + if (error) { + device_printf(sc->ti_dev, + "could not allocate mini RX dma tag\n"); + return (error); + } + + /* Create DMA maps for mini RX buffers. */ for (i = 0; i < TI_MINI_RX_RING_CNT; i++) { - if (bus_dmamap_create(sc->ti_mbufrx_dmat, 0, - &sc->ti_cdata.ti_rx_mini_maps[i])) { + error = bus_dmamap_create(sc->ti_cdata.ti_rx_mini_tag, 0, + &sc->ti_cdata.ti_rx_mini_maps[i]); + if (error) { device_printf(sc->ti_dev, - "cannot create DMA map for mini RX\n"); - return (ENOBUFS); + "could not create DMA map for mini RX\n"); + return (error); } } - if (bus_dmamap_create(sc->ti_mbufrx_dmat, 0, - &sc->ti_cdata.ti_rx_mini_sparemap)) { + error = bus_dmamap_create(sc->ti_cdata.ti_rx_mini_tag, 0, + &sc->ti_cdata.ti_rx_mini_sparemap); + if (error) { device_printf(sc->ti_dev, - "cannot create DMA map for mini RX\n"); - return (ENOBUFS); + "could not create spare DMA map for mini RX\n"); + return (error); } return (0); } static void -ti_free_dmamaps(struct ti_softc *sc) +ti_dma_free(struct ti_softc *sc) { int i; - if (sc->ti_mbuftx_dmat) { - for (i = 0; i < TI_TX_RING_CNT; i++) { - if (sc->ti_cdata.ti_txdesc[i].tx_dmamap) { - bus_dmamap_destroy(sc->ti_mbuftx_dmat, - sc->ti_cdata.ti_txdesc[i].tx_dmamap); - sc->ti_cdata.ti_txdesc[i].tx_dmamap = NULL; - } + /* Destroy DMA maps for RX buffers. */ + for (i = 0; i < TI_STD_RX_RING_CNT; i++) { + if (sc->ti_cdata.ti_rx_std_maps[i]) { + bus_dmamap_destroy(sc->ti_cdata.ti_rx_std_tag, + sc->ti_cdata.ti_rx_std_maps[i]); + sc->ti_cdata.ti_rx_std_maps[i] = NULL; } } - - if (sc->ti_mbufrx_dmat) { - for (i = 0; i < TI_STD_RX_RING_CNT; i++) { - if (sc->ti_cdata.ti_rx_std_maps[i]) { - bus_dmamap_destroy(sc->ti_mbufrx_dmat, - sc->ti_cdata.ti_rx_std_maps[i]); - sc->ti_cdata.ti_rx_std_maps[i] = NULL; - } - } - if (sc->ti_cdata.ti_rx_std_sparemap) { - bus_dmamap_destroy(sc->ti_mbufrx_dmat, - sc->ti_cdata.ti_rx_std_sparemap); - sc->ti_cdata.ti_rx_std_sparemap = NULL; - } + if (sc->ti_cdata.ti_rx_std_sparemap) { + bus_dmamap_destroy(sc->ti_cdata.ti_rx_std_tag, + sc->ti_cdata.ti_rx_std_sparemap); + sc->ti_cdata.ti_rx_std_sparemap = NULL; + } + if (sc->ti_cdata.ti_rx_std_tag) { + bus_dma_tag_destroy(sc->ti_cdata.ti_rx_std_tag); + sc->ti_cdata.ti_rx_std_tag = NULL; } - if (sc->ti_jumbo_dmat) { - for (i = 0; i < TI_JUMBO_RX_RING_CNT; i++) { - if (sc->ti_cdata.ti_rx_jumbo_maps[i]) { - bus_dmamap_destroy(sc->ti_jumbo_dmat, - sc->ti_cdata.ti_rx_jumbo_maps[i]); - sc->ti_cdata.ti_rx_jumbo_maps[i] = NULL; - } - } - if (sc->ti_cdata.ti_rx_jumbo_sparemap) { - bus_dmamap_destroy(sc->ti_jumbo_dmat, - sc->ti_cdata.ti_rx_jumbo_sparemap); - sc->ti_cdata.ti_rx_jumbo_sparemap = NULL; + /* Destroy DMA maps for jumbo RX buffers. */ + for (i = 0; i < TI_JUMBO_RX_RING_CNT; i++) { + if (sc->ti_cdata.ti_rx_jumbo_maps[i]) { + bus_dmamap_destroy(sc->ti_cdata.ti_rx_jumbo_tag, + sc->ti_cdata.ti_rx_jumbo_maps[i]); + sc->ti_cdata.ti_rx_jumbo_maps[i] = NULL; } } + if (sc->ti_cdata.ti_rx_jumbo_sparemap) { + bus_dmamap_destroy(sc->ti_cdata.ti_rx_jumbo_tag, + sc->ti_cdata.ti_rx_jumbo_sparemap); + sc->ti_cdata.ti_rx_jumbo_sparemap = NULL; + } + if (sc->ti_cdata.ti_rx_jumbo_tag) { + bus_dma_tag_destroy(sc->ti_cdata.ti_rx_jumbo_tag); + sc->ti_cdata.ti_rx_jumbo_tag = NULL; + } - if (sc->ti_mbufrx_dmat) { - for (i = 0; i < TI_MINI_RX_RING_CNT; i++) { - if (sc->ti_cdata.ti_rx_mini_maps[i]) { - bus_dmamap_destroy(sc->ti_mbufrx_dmat, - sc->ti_cdata.ti_rx_mini_maps[i]); - sc->ti_cdata.ti_rx_mini_maps[i] = NULL; - } - } - if (sc->ti_cdata.ti_rx_mini_sparemap) { - bus_dmamap_destroy(sc->ti_mbufrx_dmat, - sc->ti_cdata.ti_rx_mini_sparemap); - sc->ti_cdata.ti_rx_mini_sparemap = NULL; + /* Destroy DMA maps for mini RX buffers. */ + for (i = 0; i < TI_MINI_RX_RING_CNT; i++) { + if (sc->ti_cdata.ti_rx_mini_maps[i]) { + bus_dmamap_destroy(sc->ti_cdata.ti_rx_mini_tag, + sc->ti_cdata.ti_rx_mini_maps[i]); + sc->ti_cdata.ti_rx_mini_maps[i] = NULL; } } -} - -#ifndef TI_SF_BUF_JUMBO - -static int -ti_alloc_jumbo_mem(struct ti_softc *sc) -{ - - if (bus_dma_tag_create(sc->ti_parent_dmat, 1, 0, BUS_SPACE_MAXADDR, - BUS_SPACE_MAXADDR, NULL, NULL, MJUM9BYTES, 1, MJUM9BYTES, 0, NULL, - NULL, &sc->ti_jumbo_dmat) != 0) { - device_printf(sc->ti_dev, "Failed to allocate jumbo dmat\n"); - return (ENOBUFS); + if (sc->ti_cdata.ti_rx_mini_sparemap) { + bus_dmamap_destroy(sc->ti_cdata.ti_rx_mini_tag, + sc->ti_cdata.ti_rx_mini_sparemap); + sc->ti_cdata.ti_rx_mini_sparemap = NULL; } - return (0); -} - -#else - -static int -ti_alloc_jumbo_mem(struct ti_softc *sc) -{ - - /* - * The VM system will take care of providing aligned pages. Alignment - * is set to 1 here so that busdma resources won't be wasted. - */ - if (bus_dma_tag_create(sc->ti_parent_dmat, /* parent */ - 1, 0, /* algnmnt, boundary */ - BUS_SPACE_MAXADDR, /* lowaddr */ - BUS_SPACE_MAXADDR, /* highaddr */ - NULL, NULL, /* filter, filterarg */ - PAGE_SIZE * 4 /*XXX*/, /* maxsize */ - 4, /* nsegments */ - PAGE_SIZE, /* maxsegsize */ - 0, /* flags */ - NULL, NULL, /* lockfunc, lockarg */ - &sc->ti_jumbo_dmat) != 0) { - device_printf(sc->ti_dev, "Failed to allocate jumbo dmat\n"); - return (ENOBUFS); + if (sc->ti_cdata.ti_rx_mini_tag) { + bus_dma_tag_destroy(sc->ti_cdata.ti_rx_mini_tag); + sc->ti_cdata.ti_rx_mini_tag = NULL; } - return (0); + /* Destroy DMA maps for TX buffers. */ + for (i = 0; i < TI_TX_RING_CNT; i++) { + if (sc->ti_cdata.ti_txdesc[i].tx_dmamap) { + bus_dmamap_destroy(sc->ti_cdata.ti_tx_tag, + sc->ti_cdata.ti_txdesc[i].tx_dmamap); + sc->ti_cdata.ti_txdesc[i].tx_dmamap = NULL; + } + } + if (sc->ti_cdata.ti_tx_tag) { + bus_dma_tag_destroy(sc->ti_cdata.ti_tx_tag); + sc->ti_cdata.ti_tx_tag = NULL; + } + + /* Destroy standard RX ring. */ + ti_dma_ring_free(sc, &sc->ti_cdata.ti_rx_std_ring_tag, + (void *)&sc->ti_rdata.ti_rx_std_ring, + &sc->ti_cdata.ti_rx_std_ring_map); + /* Destroy jumbo RX ring. */ + ti_dma_ring_free(sc, &sc->ti_cdata.ti_rx_jumbo_ring_tag, + (void *)&sc->ti_rdata.ti_rx_jumbo_ring, + &sc->ti_cdata.ti_rx_jumbo_ring_map); + /* Destroy mini RX ring. */ + ti_dma_ring_free(sc, &sc->ti_cdata.ti_rx_mini_ring_tag, + (void *)&sc->ti_rdata.ti_rx_mini_ring, + &sc->ti_cdata.ti_rx_mini_ring_map); + /* Destroy RX return ring. */ + ti_dma_ring_free(sc, &sc->ti_cdata.ti_rx_return_ring_tag, + (void *)&sc->ti_rdata.ti_rx_return_ring, + &sc->ti_cdata.ti_rx_return_ring_map); + /* Destroy TX ring. */ + ti_dma_ring_free(sc, &sc->ti_cdata.ti_tx_ring_tag, + (void *)&sc->ti_rdata.ti_tx_ring, &sc->ti_cdata.ti_tx_ring_map); + /* Destroy status block. */ + ti_dma_ring_free(sc, &sc->ti_cdata.ti_status_tag, + (void *)&sc->ti_rdata.ti_status, &sc->ti_cdata.ti_status_map); + /* Destroy event ring. */ + ti_dma_ring_free(sc, &sc->ti_cdata.ti_event_ring_tag, + (void *)&sc->ti_rdata.ti_event_ring, + &sc->ti_cdata.ti_event_ring_map); + /* Destroy GIB */ + ti_dma_ring_free(sc, &sc->ti_cdata.ti_gib_tag, + (void *)&sc->ti_rdata.ti_info, &sc->ti_cdata.ti_gib_map); + + /* Destroy the parent tag. */ + if (sc->ti_cdata.ti_parent_tag) { + bus_dma_tag_destroy(sc->ti_cdata.ti_parent_tag); + sc->ti_cdata.ti_parent_tag = NULL; + } } -#endif /* TI_SF_BUF_JUMBO */ - /* * Intialize a standard receive ring descriptor. */ @@ -1160,7 +1387,7 @@ ti_newbuf_std(struct ti_softc *sc, int i m->m_len = m->m_pkthdr.len = MCLBYTES; m_adj(m, ETHER_ALIGN); - error = bus_dmamap_load_mbuf_sg(sc->ti_mbufrx_dmat, + error = bus_dmamap_load_mbuf_sg(sc->ti_cdata.ti_rx_std_tag, sc->ti_cdata.ti_rx_std_sparemap, m, segs, &nsegs, 0); if (error != 0) { m_freem(m); @@ -1169,9 +1396,9 @@ ti_newbuf_std(struct ti_softc *sc, int i KASSERT(nsegs == 1, ("%s: %d segments returned!", __func__, nsegs)); if (sc->ti_cdata.ti_rx_std_chain[i] != NULL) { - bus_dmamap_sync(sc->ti_mbufrx_dmat, + bus_dmamap_sync(sc->ti_cdata.ti_rx_std_tag, sc->ti_cdata.ti_rx_std_maps[i], BUS_DMASYNC_POSTREAD); - bus_dmamap_unload(sc->ti_mbufrx_dmat, + bus_dmamap_unload(sc->ti_cdata.ti_rx_std_tag, sc->ti_cdata.ti_rx_std_maps[i]); } @@ -1180,7 +1407,7 @@ ti_newbuf_std(struct ti_softc *sc, int i sc->ti_cdata.ti_rx_std_sparemap = map; sc->ti_cdata.ti_rx_std_chain[i] = m; - r = &sc->ti_rdata->ti_rx_std_ring[i]; + r = &sc->ti_rdata.ti_rx_std_ring[i]; ti_hostaddr64(&r->ti_addr, segs[0].ds_addr); r->ti_len = segs[0].ds_len; r->ti_type = TI_BDTYPE_RECV_BD; @@ -1191,8 +1418,8 @@ ti_newbuf_std(struct ti_softc *sc, int i r->ti_flags |= TI_BDFLAG_TCP_UDP_CKSUM | TI_BDFLAG_IP_CKSUM; r->ti_idx = i; - bus_dmamap_sync(sc->ti_mbufrx_dmat, sc->ti_cdata.ti_rx_std_maps[i], - BUS_DMASYNC_PREREAD); + bus_dmamap_sync(sc->ti_cdata.ti_rx_std_tag, + sc->ti_cdata.ti_rx_std_maps[i], BUS_DMASYNC_PREREAD); return (0); } @@ -1215,7 +1442,7 @@ ti_newbuf_mini(struct ti_softc *sc, int m->m_len = m->m_pkthdr.len = MHLEN; m_adj(m, ETHER_ALIGN); - error = bus_dmamap_load_mbuf_sg(sc->ti_mbufrx_dmat, + error = bus_dmamap_load_mbuf_sg(sc->ti_cdata.ti_rx_mini_tag, sc->ti_cdata.ti_rx_mini_sparemap, m, segs, &nsegs, 0); if (error != 0) { m_freem(m); @@ -1224,9 +1451,9 @@ ti_newbuf_mini(struct ti_softc *sc, int KASSERT(nsegs == 1, ("%s: %d segments returned!", __func__, nsegs)); if (sc->ti_cdata.ti_rx_mini_chain[i] != NULL) { - bus_dmamap_sync(sc->ti_mbufrx_dmat, + bus_dmamap_sync(sc->ti_cdata.ti_rx_mini_tag, sc->ti_cdata.ti_rx_mini_maps[i], BUS_DMASYNC_POSTREAD); - bus_dmamap_unload(sc->ti_mbufrx_dmat, + bus_dmamap_unload(sc->ti_cdata.ti_rx_mini_tag, sc->ti_cdata.ti_rx_mini_maps[i]); } @@ -1235,7 +1462,7 @@ ti_newbuf_mini(struct ti_softc *sc, int sc->ti_cdata.ti_rx_mini_sparemap = map; sc->ti_cdata.ti_rx_mini_chain[i] = m; - r = &sc->ti_rdata->ti_rx_mini_ring[i]; + r = &sc->ti_rdata.ti_rx_mini_ring[i]; ti_hostaddr64(&r->ti_addr, segs[0].ds_addr); r->ti_len = segs[0].ds_len; r->ti_type = TI_BDTYPE_RECV_BD; @@ -1246,8 +1473,8 @@ ti_newbuf_mini(struct ti_softc *sc, int r->ti_flags |= TI_BDFLAG_TCP_UDP_CKSUM | TI_BDFLAG_IP_CKSUM; r->ti_idx = i; - bus_dmamap_sync(sc->ti_mbufrx_dmat, sc->ti_cdata.ti_rx_mini_maps[i], - BUS_DMASYNC_PREREAD); + bus_dmamap_sync(sc->ti_cdata.ti_rx_mini_tag, + sc->ti_cdata.ti_rx_mini_maps[i], BUS_DMASYNC_PREREAD); return (0); } @@ -1274,7 +1501,7 @@ ti_newbuf_jumbo(struct ti_softc *sc, int m->m_len = m->m_pkthdr.len = MJUM9BYTES; m_adj(m, ETHER_ALIGN); - error = bus_dmamap_load_mbuf_sg(sc->ti_jumbo_dmat, + error = bus_dmamap_load_mbuf_sg(sc->ti_cdata.ti_rx_jumbo_tag, sc->ti_cdata.ti_rx_jumbo_sparemap, m, segs, &nsegs, 0); if (error != 0) { m_freem(m); @@ -1283,9 +1510,9 @@ ti_newbuf_jumbo(struct ti_softc *sc, int KASSERT(nsegs == 1, ("%s: %d segments returned!", __func__, nsegs)); if (sc->ti_cdata.ti_rx_jumbo_chain[i] != NULL) { - bus_dmamap_sync(sc->ti_jumbo_dmat, + bus_dmamap_sync(sc->ti_cdata.ti_rx_jumbo_tag, sc->ti_cdata.ti_rx_jumbo_maps[i], BUS_DMASYNC_POSTREAD); - bus_dmamap_unload(sc->ti_jumbo_dmat, + bus_dmamap_unload(sc->ti_cdata.ti_rx_jumbo_tag, sc->ti_cdata.ti_rx_jumbo_maps[i]); } @@ -1294,7 +1521,7 @@ ti_newbuf_jumbo(struct ti_softc *sc, int sc->ti_cdata.ti_rx_jumbo_sparemap = map; sc->ti_cdata.ti_rx_jumbo_chain[i] = m; - r = &sc->ti_rdata->ti_rx_jumbo_ring[i]; + r = &sc->ti_rdata.ti_rx_jumbo_ring[i]; ti_hostaddr64(&r->ti_addr, segs[0].ds_addr); r->ti_len = segs[0].ds_len; r->ti_type = TI_BDTYPE_RECV_JUMBO_BD; @@ -1305,8 +1532,8 @@ ti_newbuf_jumbo(struct ti_softc *sc, int r->ti_flags |= TI_BDFLAG_TCP_UDP_CKSUM | TI_BDFLAG_IP_CKSUM; r->ti_idx = i; - bus_dmamap_sync(sc->ti_jumbo_dmat, sc->ti_cdata.ti_rx_jumbo_maps[i], - BUS_DMASYNC_PREREAD); + bus_dmamap_sync(sc->ti_cdata.ti_rx_jumbo_tag, + sc->ti_cdata.ti_rx_jumbo_maps[i], BUS_DMASYNC_PREREAD); return (0); } @@ -1417,11 +1644,11 @@ ti_newbuf_jumbo(struct ti_softc *sc, int } /* Set up the descriptor. */ - r = &sc->ti_rdata->ti_rx_jumbo_ring[idx]; + r = &sc->ti_rdata.ti_rx_jumbo_ring[idx]; sc->ti_cdata.ti_rx_jumbo_chain[idx] = m_new; map = sc->ti_cdata.ti_rx_jumbo_maps[i]; - if (bus_dmamap_load_mbuf_sg(sc->ti_jumbo_dmat, map, m_new, segs, - &nsegs, 0)) + if (bus_dmamap_load_mbuf_sg(sc->ti_cdata.ti_rx_jumbo_tag, map, m_new, + segs, &nsegs, 0)) return (ENOBUFS); if ((nsegs < 1) || (nsegs > 4)) return (ENOBUFS); @@ -1449,7 +1676,7 @@ ti_newbuf_jumbo(struct ti_softc *sc, int r->ti_idx = idx; - bus_dmamap_sync(sc->ti_jumbo_dmat, map, BUS_DMASYNC_PREREAD); + bus_dmamap_sync(sc->ti_cdata.ti_rx_jumbo_tag, map, BUS_DMASYNC_PREREAD); return (0); nobufs: @@ -1505,15 +1732,16 @@ ti_free_rx_ring_std(struct ti_softc *sc) for (i = 0; i < TI_STD_RX_RING_CNT; i++) { if (sc->ti_cdata.ti_rx_std_chain[i] != NULL) { map = sc->ti_cdata.ti_rx_std_maps[i]; - bus_dmamap_sync(sc->ti_mbufrx_dmat, map, + bus_dmamap_sync(sc->ti_cdata.ti_rx_std_tag, map, BUS_DMASYNC_POSTREAD); - bus_dmamap_unload(sc->ti_mbufrx_dmat, map); + bus_dmamap_unload(sc->ti_cdata.ti_rx_std_tag, map); m_freem(sc->ti_cdata.ti_rx_std_chain[i]); sc->ti_cdata.ti_rx_std_chain[i] = NULL; } - bzero((char *)&sc->ti_rdata->ti_rx_std_ring[i], - sizeof(struct ti_rx_desc)); } + bzero(sc->ti_rdata.ti_rx_std_ring, TI_STD_RX_RING_SZ); + bus_dmamap_sync(sc->ti_cdata.ti_rx_std_ring_tag, + sc->ti_cdata.ti_rx_std_ring_map, BUS_DMASYNC_PREWRITE); } static int @@ -1542,15 +1770,16 @@ ti_free_rx_ring_jumbo(struct ti_softc *s for (i = 0; i < TI_JUMBO_RX_RING_CNT; i++) { if (sc->ti_cdata.ti_rx_jumbo_chain[i] != NULL) { map = sc->ti_cdata.ti_rx_jumbo_maps[i]; - bus_dmamap_sync(sc->ti_jumbo_dmat, map, + bus_dmamap_sync(sc->ti_cdata.ti_rx_jumbo_tag, map, BUS_DMASYNC_POSTREAD); - bus_dmamap_unload(sc->ti_jumbo_dmat, map); + bus_dmamap_unload(sc->ti_cdata.ti_rx_jumbo_tag, map); m_freem(sc->ti_cdata.ti_rx_jumbo_chain[i]); sc->ti_cdata.ti_rx_jumbo_chain[i] = NULL; } - bzero((char *)&sc->ti_rdata->ti_rx_jumbo_ring[i], - sizeof(struct ti_rx_desc)); } + bzero(sc->ti_rdata.ti_rx_jumbo_ring, TI_JUMBO_RX_RING_SZ); + bus_dmamap_sync(sc->ti_cdata.ti_rx_jumbo_ring_tag, + sc->ti_cdata.ti_rx_jumbo_ring_map, BUS_DMASYNC_PREWRITE); } static int @@ -1575,18 +1804,22 @@ ti_free_rx_ring_mini(struct ti_softc *sc bus_dmamap_t map; int i; + if (sc->ti_rdata.ti_rx_mini_ring == NULL) + return; + for (i = 0; i < TI_MINI_RX_RING_CNT; i++) { if (sc->ti_cdata.ti_rx_mini_chain[i] != NULL) { map = sc->ti_cdata.ti_rx_mini_maps[i]; - bus_dmamap_sync(sc->ti_mbufrx_dmat, map, + bus_dmamap_sync(sc->ti_cdata.ti_rx_mini_tag, map, BUS_DMASYNC_POSTREAD); - bus_dmamap_unload(sc->ti_mbufrx_dmat, map); + bus_dmamap_unload(sc->ti_cdata.ti_rx_mini_tag, map); m_freem(sc->ti_cdata.ti_rx_mini_chain[i]); sc->ti_cdata.ti_rx_mini_chain[i] = NULL; } - bzero((char *)&sc->ti_rdata->ti_rx_mini_ring[i], - sizeof(struct ti_rx_desc)); } + bzero(sc->ti_rdata.ti_rx_mini_ring, TI_MINI_RX_RING_SZ); + bus_dmamap_sync(sc->ti_cdata.ti_rx_mini_ring_tag, + sc->ti_cdata.ti_rx_mini_ring_map, BUS_DMASYNC_PREWRITE); } static void @@ -1595,21 +1828,23 @@ ti_free_tx_ring(struct ti_softc *sc) struct ti_txdesc *txd; int i; - if (sc->ti_rdata->ti_tx_ring == NULL) + if (sc->ti_rdata.ti_tx_ring == NULL) return; for (i = 0; i < TI_TX_RING_CNT; i++) { txd = &sc->ti_cdata.ti_txdesc[i]; if (txd->tx_m != NULL) { - bus_dmamap_sync(sc->ti_mbuftx_dmat, txd->tx_dmamap, + bus_dmamap_sync(sc->ti_cdata.ti_tx_tag, txd->tx_dmamap, BUS_DMASYNC_POSTWRITE); - bus_dmamap_unload(sc->ti_mbuftx_dmat, txd->tx_dmamap); + bus_dmamap_unload(sc->ti_cdata.ti_tx_tag, + txd->tx_dmamap); m_freem(txd->tx_m); txd->tx_m = NULL; } - bzero((char *)&sc->ti_rdata->ti_tx_ring[i], - sizeof(struct ti_tx_desc)); } + bzero(sc->ti_rdata.ti_tx_ring, TI_TX_RING_SZ); + bus_dmamap_sync(sc->ti_cdata.ti_tx_ring_tag, + sc->ti_cdata.ti_tx_ring_map, BUS_DMASYNC_PREWRITE); } static int @@ -1941,25 +2176,20 @@ ti_gibinit(struct ti_softc *sc) { struct ifnet *ifp; struct ti_rcb *rcb; - uint32_t rdphys; int i; TI_LOCK_ASSERT(sc); ifp = sc->ti_ifp; - rdphys = sc->ti_rdata_phys; /* Disable interrupts for now. */ CSR_WRITE_4(sc, TI_MB_HOSTINTR, 1); - /* - * Tell the chip where to find the general information block. - * While this struct could go into >4GB memory, we allocate it in a - * single slab with the other descriptors, and those don't seem to - * support being located in a 64-bit region. - */ - CSR_WRITE_4(sc, TI_GCR_GENINFO_HI, 0); - CSR_WRITE_4(sc, TI_GCR_GENINFO_LO, rdphys + TI_RD_OFF(ti_info)); + /* Tell the chip where to find the general information block. */ + CSR_WRITE_4(sc, TI_GCR_GENINFO_HI, + (uint64_t)sc->ti_rdata.ti_info_paddr >> 32); + CSR_WRITE_4(sc, TI_GCR_GENINFO_LO, + sc->ti_rdata.ti_info_paddr & 0xFFFFFFFF); /* Load the firmware into SRAM. */ ti_loadfw(sc); @@ -1967,20 +2197,20 @@ ti_gibinit(struct ti_softc *sc) /* Set up the contents of the general info and ring control blocks. */ /* Set up the event ring and producer pointer. */ - rcb = &sc->ti_rdata->ti_info.ti_ev_rcb; - - TI_HOSTADDR(rcb->ti_hostaddr) = rdphys + TI_RD_OFF(ti_event_ring); + bzero(sc->ti_rdata.ti_event_ring, TI_EVENT_RING_SZ); + rcb = &sc->ti_rdata.ti_info->ti_ev_rcb; + ti_hostaddr64(&rcb->ti_hostaddr, sc->ti_rdata.ti_event_ring_paddr); rcb->ti_flags = 0; - TI_HOSTADDR(sc->ti_rdata->ti_info.ti_ev_prodidx_ptr) = - rdphys + TI_RD_OFF(ti_ev_prodidx_r); + ti_hostaddr64(&sc->ti_rdata.ti_info->ti_ev_prodidx_ptr, + sc->ti_rdata.ti_status_paddr + + offsetof(struct ti_status, ti_ev_prodidx_r)); sc->ti_ev_prodidx.ti_idx = 0; CSR_WRITE_4(sc, TI_GCR_EVENTCONS_IDX, 0); sc->ti_ev_saved_considx = 0; /* Set up the command ring and producer mailbox. */ - rcb = &sc->ti_rdata->ti_info.ti_cmd_rcb; - - TI_HOSTADDR(rcb->ti_hostaddr) = TI_GCR_NIC_ADDR(TI_GCR_CMDRING); + rcb = &sc->ti_rdata.ti_info->ti_cmd_rcb; + ti_hostaddr64(&rcb->ti_hostaddr, TI_GCR_NIC_ADDR(TI_GCR_CMDRING)); rcb->ti_flags = 0; rcb->ti_max_len = 0; for (i = 0; i < TI_CMD_RING_CNT; i++) { @@ -1995,12 +2225,13 @@ ti_gibinit(struct ti_softc *sc) * We re-use the current stats buffer for this to * conserve memory. */ - TI_HOSTADDR(sc->ti_rdata->ti_info.ti_refresh_stats_ptr) = - rdphys + TI_RD_OFF(ti_info.ti_stats); + bzero(&sc->ti_rdata.ti_info->ti_stats, sizeof(struct ti_stats)); + ti_hostaddr64(&sc->ti_rdata.ti_info->ti_refresh_stats_ptr, + sc->ti_rdata.ti_info_paddr + offsetof(struct ti_gib, ti_stats)); /* Set up the standard receive ring. */ - rcb = &sc->ti_rdata->ti_info.ti_std_rx_rcb; - TI_HOSTADDR(rcb->ti_hostaddr) = rdphys + TI_RD_OFF(ti_rx_std_ring); + rcb = &sc->ti_rdata.ti_info->ti_std_rx_rcb; + ti_hostaddr64(&rcb->ti_hostaddr, sc->ti_rdata.ti_rx_std_ring_paddr); rcb->ti_max_len = TI_FRAMELEN; rcb->ti_flags = 0; if (sc->ti_ifp->if_capenable & IFCAP_RXCSUM) @@ -2010,8 +2241,8 @@ ti_gibinit(struct ti_softc *sc) rcb->ti_flags |= TI_RCB_FLAG_VLAN_ASSIST; /* Set up the jumbo receive ring. */ - rcb = &sc->ti_rdata->ti_info.ti_jumbo_rx_rcb; - TI_HOSTADDR(rcb->ti_hostaddr) = rdphys + TI_RD_OFF(ti_rx_jumbo_ring); + rcb = &sc->ti_rdata.ti_info->ti_jumbo_rx_rcb; + ti_hostaddr64(&rcb->ti_hostaddr, sc->ti_rdata.ti_rx_jumbo_ring_paddr); #ifndef TI_SF_BUF_JUMBO rcb->ti_max_len = MJUM9BYTES - ETHER_ALIGN; @@ -2031,8 +2262,8 @@ ti_gibinit(struct ti_softc *sc) * Tigon 2 but the slot in the config block is * still there on the Tigon 1. */ - rcb = &sc->ti_rdata->ti_info.ti_mini_rx_rcb; - TI_HOSTADDR(rcb->ti_hostaddr) = rdphys + TI_RD_OFF(ti_rx_mini_ring); + rcb = &sc->ti_rdata.ti_info->ti_mini_rx_rcb; + ti_hostaddr64(&rcb->ti_hostaddr, sc->ti_rdata.ti_rx_mini_ring_paddr); rcb->ti_max_len = MHLEN - ETHER_ALIGN; if (sc->ti_hwrev == TI_HWREV_TIGON) rcb->ti_flags = TI_RCB_FLAG_RING_DISABLED; @@ -2047,12 +2278,13 @@ ti_gibinit(struct ti_softc *sc) /* * Set up the receive return ring. */ - rcb = &sc->ti_rdata->ti_info.ti_return_rcb; - TI_HOSTADDR(rcb->ti_hostaddr) = rdphys + TI_RD_OFF(ti_rx_return_ring); + rcb = &sc->ti_rdata.ti_info->ti_return_rcb; + ti_hostaddr64(&rcb->ti_hostaddr, sc->ti_rdata.ti_rx_return_ring_paddr); rcb->ti_flags = 0; rcb->ti_max_len = TI_RETURN_RING_CNT; - TI_HOSTADDR(sc->ti_rdata->ti_info.ti_return_prodidx_ptr) = - rdphys + TI_RD_OFF(ti_return_prodidx_r); + ti_hostaddr64(&sc->ti_rdata.ti_info->ti_return_prodidx_ptr, + sc->ti_rdata.ti_status_paddr + + offsetof(struct ti_status, ti_return_prodidx_r)); /* * Set up the tx ring. Note: for the Tigon 2, we have the option @@ -2064,9 +2296,9 @@ ti_gibinit(struct ti_softc *sc) * a Tigon 1 chip. */ CSR_WRITE_4(sc, TI_WINBASE, TI_TX_RING_BASE); - bzero((char *)sc->ti_rdata->ti_tx_ring, - TI_TX_RING_CNT * sizeof(struct ti_tx_desc)); - rcb = &sc->ti_rdata->ti_info.ti_tx_rcb; + if (sc->ti_rdata.ti_tx_ring != NULL) + bzero(sc->ti_rdata.ti_tx_ring, TI_TX_RING_SZ); + rcb = &sc->ti_rdata.ti_info->ti_tx_rcb; if (sc->ti_hwrev == TI_HWREV_TIGON) rcb->ti_flags = 0; else @@ -2078,18 +2310,28 @@ ti_gibinit(struct ti_softc *sc) TI_RCB_FLAG_IP_CKSUM | TI_RCB_FLAG_NO_PHDR_CKSUM; rcb->ti_max_len = TI_TX_RING_CNT; if (sc->ti_hwrev == TI_HWREV_TIGON) - TI_HOSTADDR(rcb->ti_hostaddr) = TI_TX_RING_BASE; + ti_hostaddr64(&rcb->ti_hostaddr, TI_TX_RING_BASE); else - TI_HOSTADDR(rcb->ti_hostaddr) = rdphys + TI_RD_OFF(ti_tx_ring); - TI_HOSTADDR(sc->ti_rdata->ti_info.ti_tx_considx_ptr) = - rdphys + TI_RD_OFF(ti_tx_considx_r); - - bus_dmamap_sync(sc->ti_rdata_dmat, sc->ti_rdata_dmamap, - BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE); + ti_hostaddr64(&rcb->ti_hostaddr, + sc->ti_rdata.ti_tx_ring_paddr); + ti_hostaddr64(&sc->ti_rdata.ti_info->ti_tx_considx_ptr, + sc->ti_rdata.ti_status_paddr + + offsetof(struct ti_status, ti_tx_considx_r)); + + bus_dmamap_sync(sc->ti_cdata.ti_gib_tag, sc->ti_cdata.ti_gib_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + bus_dmamap_sync(sc->ti_cdata.ti_status_tag, sc->ti_cdata.ti_status_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + bus_dmamap_sync(sc->ti_cdata.ti_event_ring_tag, + sc->ti_cdata.ti_event_ring_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + if (sc->ti_rdata.ti_tx_ring != NULL) + bus_dmamap_sync(sc->ti_cdata.ti_tx_ring_tag, + sc->ti_cdata.ti_tx_ring_map, BUS_DMASYNC_PREWRITE); /* Set up tunables */ #if 0 - if (ifp->if_mtu > (ETHERMTU + ETHER_HDR_LEN + ETHER_CRC_LEN)) + if (ifp->if_mtu > ETHERMTU + ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN) CSR_WRITE_4(sc, TI_GCR_RX_COAL_TICKS, (sc->ti_rx_coal_ticks / 10)); else @@ -2111,23 +2353,6 @@ ti_gibinit(struct ti_softc *sc) return (0); } -static void -ti_rdata_cb(void *arg, bus_dma_segment_t *segs, int nseg, int error) -{ - struct ti_softc *sc; - - sc = arg; - if (error || nseg != 1) - return; - - /* - * All of the Tigon data structures need to live at <4GB. This - * cast is fine since busdma was told about this constraint. - */ - sc->ti_rdata_phys = segs[0].ds_addr; - return; -} - /* * Probe for a Tigon chip. Check the PCI vendor and device IDs * against our list and return its name if we find a match. @@ -2229,8 +2454,7 @@ ti_attach(device_t dev) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Nov 14 21:59:49 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C34751065672; Mon, 14 Nov 2011 21:59:49 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A99B98FC16; Mon, 14 Nov 2011 21:59:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAELxn9J067917; Mon, 14 Nov 2011 21:59:49 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAELxnP3067915; Mon, 14 Nov 2011 21:59:49 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201111142159.pAELxnP3067915@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 14 Nov 2011 21:59:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227513 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Nov 2011 21:59:49 -0000 Author: yongari Date: Mon Nov 14 21:59:49 2011 New Revision: 227513 URL: http://svn.freebsd.org/changeset/base/227513 Log: Document newly introduced a loader tunable and sysctl variables. Modified: head/share/man/man4/ti.4 Modified: head/share/man/man4/ti.4 ============================================================================== --- head/share/man/man4/ti.4 Mon Nov 14 20:38:14 2011 (r227512) +++ head/share/man/man4/ti.4 Mon Nov 14 21:59:49 2011 (r227513) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 8, 2011 +.Dd November 14, 2011 .Dt TI 4 .Os .Sh NAME @@ -202,6 +202,93 @@ NEC Gigabit Ethernet .It Silicon Graphics PCI Gigabit Ethernet adapter .El +.Sh LOADER TUNABLES +Tunables can be set at the +.Xr loader 8 +prompt before booting the kernel or stored in +.Xr loader.conf 5 . +.Bl -tag -width "xxxxxx" +.It Va hw.ti.%d.dac +This tunable disables DAC (Dual Address Cycle). +The default value is 1 which means driver will use full 64bit +DMA addressing. +.El +.Sh SYSCTL VARIABLES +The following variables are available as both +.Xr sysctl 8 +variables and +.Xr loader 8 +tunables. +The interface has to be brought down and up again before a +change takes effect when any of the following tunables are +changed. +The one microsecond clock tick referenced below is a nominal +time and the actual hardware may not provide granularity to +this level. +For example, on Tigon 2 (revision 6) cards with release 12.0 +the clock granularity is 5 microseconds. +.Bl -tag -width "xxxxxx" +.It Va dev.ti.%d.rx_coal_ticks +This value, receive coalesced ticks, controls the number of clock +ticks (of 1 microseconds each) that must elapse before the NIC DMAs +the receive return producer pointer to the Host and generates an +interrupt. +This parameter works in conjunction with the rx_max_coal_bds, +receive max coalesced BDs, tunable parameter. +The NIC will return the receive return producer pointer to the Host +when either of the thresholds is exceeded. +A value of 0 means that this parameter is ignored and receive BDs +will only be returned when the receive max coalesced BDs value is +reached. +The default valus is 170. +.It Va dev.ti.%d.rx_max_coal_bds +This value, receive max coalesced BDs, controls the number of +receive buffer descriptors that will be coalesced before the NIC +updates the receive return ring producer index. +If this value is set to 0 it will disable receive buffer descriptor +coalescing. +The default valus is 64. +.It Va dev.ti.%d.ti_tx_coal_ticks +This value, send coalesced ticks, controls the number of clock +ticks (of 1 microseconds each) that must elapse before the NIC DMAs +the send consumer pointer to the Host and generates an interrupt. +This parameter works in conjunction with the tx_max_coal_bds, +send max coalesced BDs, tunable parameter. +The NIC will return the send consumer pointer to the Host when +either of the thresholds is exceeded. +A value of 0 means that this parameter is ignored and send BDs will +only be returned when the send max coalesced BDs value is reached. +The default value is 2000. +.It Va dev.ti.%d.tx_max_coal_bds +This value, send max coalesced BDs, controls the number of send +buffer descriptors that will be coalesced before the NIC updates +the send consumer index. +If this valus is set to 0 it will disable send buffer descriptor +coalescing. +The default valus is 32. +.It Va dev.ti.%d.tx_buf_ratio +This value controls the ratio of the remaining memory in the NIC +that should be devoted to transmit buffer vs. receive buffer. +The lower 7 bits are used to indicate the ratio in 1/64th increments. +For example, setting this value to 16 will set the transmit buffer +to 1/4 of the remaining buffer space. +In no cases will the transmit or receive buffer be reduced below +68 KB. +For a 1 MB NIC the approximate total space for data buffers is +800 KB. +For a 512 KB NIC that number is 300 KB. +The default value is 21. +.It Va dev.ti.%d.stat_ticks +The value, stat ticks, controls the number of clock ticks +(of 1 microseconds each) that must elapse before the NIC DMAs +the statistics block to the Host and generates a STATS_UPDATED +event. +If set to zero then statistics are never DMAed to the Host. +It is recommended that this value be set to a high enough +frequency to not mislead someone reading statistics refreshes. +Several times a second is enough. +The default value is 2000000 (2 seconds). +.El .Sh IOCTLS In addition to the standard .Xr socket 2 From owner-svn-src-all@FreeBSD.ORG Mon Nov 14 22:16:12 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E59E5106564A; Mon, 14 Nov 2011 22:16:12 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D57E98FC12; Mon, 14 Nov 2011 22:16:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAEMGC3e068510; Mon, 14 Nov 2011 22:16:12 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAEMGCNx068508; Mon, 14 Nov 2011 22:16:12 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201111142216.pAEMGCNx068508@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 14 Nov 2011 22:16:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227514 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Nov 2011 22:16:13 -0000 Author: yongari Date: Mon Nov 14 22:16:12 2011 New Revision: 227514 URL: http://svn.freebsd.org/changeset/base/227514 Log: Clarify hw.ti.%d.dac tunable. Modified: head/share/man/man4/ti.4 Modified: head/share/man/man4/ti.4 ============================================================================== --- head/share/man/man4/ti.4 Mon Nov 14 21:59:49 2011 (r227513) +++ head/share/man/man4/ti.4 Mon Nov 14 22:16:12 2011 (r227514) @@ -209,7 +209,7 @@ prompt before booting the kernel or stor .Xr loader.conf 5 . .Bl -tag -width "xxxxxx" .It Va hw.ti.%d.dac -This tunable disables DAC (Dual Address Cycle). +If this tunable is set to 0 it will disable DAC (Dual Address Cycle). The default value is 1 which means driver will use full 64bit DMA addressing. .El From owner-svn-src-all@FreeBSD.ORG Mon Nov 14 22:57:47 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6BBF8106564A; Mon, 14 Nov 2011 22:57:47 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5AE9D8FC12; Mon, 14 Nov 2011 22:57:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAEMvl4P069844; Mon, 14 Nov 2011 22:57:47 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAEMvl2I069842; Mon, 14 Nov 2011 22:57:47 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201111142257.pAEMvl2I069842@svn.freebsd.org> From: Christian Brueffer Date: Mon, 14 Nov 2011 22:57:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227515 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Nov 2011 22:57:47 -0000 Author: brueffer Date: Mon Nov 14 22:57:47 2011 New Revision: 227515 URL: http://svn.freebsd.org/changeset/base/227515 Log: Remove list nesting in the hardware notes section, thus making it compatible with the hardware notes generation script. MFC after: 3 days Modified: head/share/man/man4/mvs.4 Modified: head/share/man/man4/mvs.4 ============================================================================== --- head/share/man/man4/mvs.4 Mon Nov 14 22:16:12 2011 (r227514) +++ head/share/man/man4/mvs.4 Mon Nov 14 22:57:47 2011 (r227515) @@ -120,9 +120,8 @@ The .Nm driver supports the following controllers: .Pp -.Bl -tag -compact -.It Gen-I (SATA 1.5Gbps): -.Bl -bullet -compact +Gen-I (SATA 1.5Gbps): +.Bl -bullet -compact -offset "xxxxxx" .It 88SX5040 .It @@ -132,8 +131,9 @@ driver supports the following controller .It 88SX5081 .El -.It Gen-II (SATA 3Gbps, NCQ, PMP): -.Bl -bullet -compact +.Pp +Gen-II (SATA 3Gbps, NCQ, PMP): +.Bl -bullet -compact -offset "xxxxxx" .It 88SX6040 .It @@ -143,8 +143,9 @@ driver supports the following controller .It 88SX6081 .El -.It Gen-IIe (SATA 3Gbps, NCQ, PMP with FBS): -.Bl -bullet -compact +.Pp +Gen-IIe (SATA 3Gbps, NCQ, PMP with FBS): +.Bl -bullet -compact -offset "xxxxxx" .It 88SX6042 .It @@ -156,7 +157,6 @@ driver supports the following controller .It MV78100 SoC .El -.El .Pp Note, that this hardware supports command queueing and FIS-based switching only for ATA DMA commands. From owner-svn-src-all@FreeBSD.ORG Mon Nov 14 23:01:08 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8579F106564A; Mon, 14 Nov 2011 23:01:08 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 750998FC17; Mon, 14 Nov 2011 23:01:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAEN18lh070007; Mon, 14 Nov 2011 23:01:08 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAEN180G070005; Mon, 14 Nov 2011 23:01:08 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201111142301.pAEN180G070005@svn.freebsd.org> From: Christian Brueffer Date: Mon, 14 Nov 2011 23:01:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227516 - head/release/doc/en_US.ISO8859-1/hardware X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Nov 2011 23:01:08 -0000 Author: brueffer Date: Mon Nov 14 23:01:08 2011 New Revision: 227516 URL: http://svn.freebsd.org/changeset/base/227516 Log: Re-apply r227466 to generate hardware notes for mps(4) and mvs(4), the issues were fixes. Thanks to: gjb, manolis Pointy hat ++: brueffer MFC after: 3 days Modified: head/release/doc/en_US.ISO8859-1/hardware/article.sgml Modified: head/release/doc/en_US.ISO8859-1/hardware/article.sgml ============================================================================== --- head/release/doc/en_US.ISO8859-1/hardware/article.sgml Mon Nov 14 22:57:47 2011 (r227515) +++ head/release/doc/en_US.ISO8859-1/hardware/article.sgml Mon Nov 14 23:01:08 2011 (r227516) @@ -798,8 +798,12 @@ &hwlist.mly; + &hwlist.mps; + &hwlist.mpt; + &hwlist.mvs; + &hwlist.ncr; &hwlist.ncv; From owner-svn-src-all@FreeBSD.ORG Tue Nov 15 01:39:02 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA210106564A; Tue, 15 Nov 2011 01:39:02 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9A4A48FC0A; Tue, 15 Nov 2011 01:39:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAF1d2x4075003; Tue, 15 Nov 2011 01:39:02 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAF1d2gc075001; Tue, 15 Nov 2011 01:39:02 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201111150139.pAF1d2gc075001@svn.freebsd.org> From: Rick Macklem Date: Tue, 15 Nov 2011 01:39:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227517 - head/sys/fs/nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Nov 2011 01:39:02 -0000 Author: rmacklem Date: Tue Nov 15 01:39:02 2011 New Revision: 227517 URL: http://svn.freebsd.org/changeset/base/227517 Log: Move the setting of the default value for nm_wcommitsize to before the nfs_decode_args() call in the new NFS client, so that a specfied command line value won't be overwritten. Also, modify the calculation for small values of desiredvnodes to avoid an unusually large value or a divide by zero crash. It seems that the default value for nm_wcommitsize is very conservative and may need to change at some time. PR: kern/159351 Submitted by: onwahe at gmail.com (earlier version) Reviewed by: jhb MFC after: 2 weeks Modified: head/sys/fs/nfsclient/nfs_clvfsops.c Modified: head/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvfsops.c Mon Nov 14 23:01:08 2011 (r227516) +++ head/sys/fs/nfsclient/nfs_clvfsops.c Tue Nov 15 01:39:02 2011 (r227517) @@ -1231,6 +1231,10 @@ mountnfs(struct nfs_args *argp, struct m nmp->nm_timeo = NFS_TIMEO; nmp->nm_retry = NFS_RETRANS; nmp->nm_readahead = NFS_DEFRAHEAD; + if (desiredvnodes >= 11000) + nmp->nm_wcommitsize = hibufspace / (desiredvnodes / 1000); + else + nmp->nm_wcommitsize = hibufspace / 10; nfs_decode_args(mp, nmp, argp, hst, cred, td); @@ -1252,7 +1256,6 @@ mountnfs(struct nfs_args *argp, struct m nmp->nm_rsize = NFS_RSIZE; nmp->nm_readdirsize = NFS_READDIRSIZE; } - nmp->nm_wcommitsize = hibufspace / (desiredvnodes / 1000); nmp->nm_numgrps = NFS_MAXGRPS; nmp->nm_tprintf_delay = nfs_tprintf_delay; if (nmp->nm_tprintf_delay < 0) From owner-svn-src-all@FreeBSD.ORG Tue Nov 15 01:48:53 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4FF5106566B; Tue, 15 Nov 2011 01:48:53 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BBC948FC0A; Tue, 15 Nov 2011 01:48:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAF1mrG4075328; Tue, 15 Nov 2011 01:48:53 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAF1mrCd075326; Tue, 15 Nov 2011 01:48:53 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201111150148.pAF1mrCd075326@svn.freebsd.org> From: "David E. O'Brien" Date: Tue, 15 Nov 2011 01:48:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227518 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Nov 2011 01:48:54 -0000 Author: obrien Date: Tue Nov 15 01:48:53 2011 New Revision: 227518 URL: http://svn.freebsd.org/changeset/base/227518 Log: Reformat comment to be more readable in standard Xterm. (while I'm here, wrap other long lines) Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Tue Nov 15 01:39:02 2011 (r227517) +++ head/sys/kern/kern_descrip.c Tue Nov 15 01:48:53 2011 (r227518) @@ -838,12 +838,12 @@ do_dup(struct thread *td, int flags, int if (flags & DUP_FIXED) { if (new >= fdp->fd_nfiles) { /* - * The resource limits are here instead of e.g. fdalloc(), - * because the file descriptor table may be shared between - * processes, so we can't really use racct_add()/racct_sub(). - * Instead of counting the number of actually allocated - * descriptors, just put the limit on the size of the file - * descriptor table. + * The resource limits are here instead of e.g. + * fdalloc(), because the file descriptor table may be + * shared between processes, so we can't really use + * racct_add()/racct_sub(). Instead of counting the + * number of actually allocated descriptors, just put + * the limit on the size of the file descriptor table. */ #ifdef RACCT PROC_LOCK(p); @@ -1516,7 +1516,7 @@ fdalloc(struct thread *td, int minfd, in FILEDESC_XLOCK_ASSERT(fdp); if (fdp->fd_freefile > minfd) - minfd = fdp->fd_freefile; + minfd = fdp->fd_freefile; PROC_LOCK(p); maxfd = min((int)lim_cur(p, RLIMIT_NOFILE), maxfilesperproc); @@ -2248,7 +2248,7 @@ closef(struct file *fp, struct thread *t /* * Initialize the file pointer with the specified properties. - * + * * The ops are set with release semantics to be certain that the flags, type, * and data are visible when ops is. This is to prevent ops methods from being * called with bad data. @@ -3758,28 +3758,32 @@ SYSINIT(select, SI_SUB_LOCK, SI_ORDER_FI /*-------------------------------------------------------------------*/ static int -badfo_readwrite(struct file *fp, struct uio *uio, struct ucred *active_cred, int flags, struct thread *td) +badfo_readwrite(struct file *fp, struct uio *uio, struct ucred *active_cred, + int flags, struct thread *td) { return (EBADF); } static int -badfo_truncate(struct file *fp, off_t length, struct ucred *active_cred, struct thread *td) +badfo_truncate(struct file *fp, off_t length, struct ucred *active_cred, + struct thread *td) { return (EINVAL); } static int -badfo_ioctl(struct file *fp, u_long com, void *data, struct ucred *active_cred, struct thread *td) +badfo_ioctl(struct file *fp, u_long com, void *data, struct ucred *active_cred, + struct thread *td) { return (EBADF); } static int -badfo_poll(struct file *fp, int events, struct ucred *active_cred, struct thread *td) +badfo_poll(struct file *fp, int events, struct ucred *active_cred, + struct thread *td) { return (0); @@ -3793,7 +3797,8 @@ badfo_kqfilter(struct file *fp, struct k } static int -badfo_stat(struct file *fp, struct stat *sb, struct ucred *active_cred, struct thread *td) +badfo_stat(struct file *fp, struct stat *sb, struct ucred *active_cred, + struct thread *td) { return (EBADF); From owner-svn-src-all@FreeBSD.ORG Tue Nov 15 05:45:47 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 60A5F1065670; Tue, 15 Nov 2011 05:45:47 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 460838FC0C; Tue, 15 Nov 2011 05:45:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAF5jlA1082890; Tue, 15 Nov 2011 05:45:47 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAF5jl0S082888; Tue, 15 Nov 2011 05:45:47 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201111150545.pAF5jl0S082888@svn.freebsd.org> From: David Schultz Date: Tue, 15 Nov 2011 05:45:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227519 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Nov 2011 05:45:47 -0000 Author: das Date: Tue Nov 15 05:45:46 2011 New Revision: 227519 URL: http://svn.freebsd.org/changeset/base/227519 Log: Sync the style, comments, and variable names of arc4random.c with OpenBSD's version (r1.22). While some of our style changes were indeed small improvements, being able to easily track functionality changes in OpenBSD seems more useful. Also fix style bugs in the FreeBSD-specific parts of this file. No functional changes, as verified with md5. Modified: head/lib/libc/gen/arc4random.c Modified: head/lib/libc/gen/arc4random.c ============================================================================== --- head/lib/libc/gen/arc4random.c Tue Nov 15 01:48:53 2011 (r227518) +++ head/lib/libc/gen/arc4random.c Tue Nov 15 05:45:46 2011 (r227519) @@ -1,3 +1,5 @@ +/* $OpenBSD: arc4random.c,v 1.22 2010/12/22 08:23:42 otto Exp $ */ + /* * Copyright (c) 1996, David Mazieres * Copyright (c) 2008, Damien Miller @@ -24,11 +26,6 @@ * which is a trade secret). The same algorithm is used as a stream * cipher called "arcfour" in Tatu Ylonen's ssh package. * - * Here the stream cipher has been modified always to include the time - * when initializing the state. That makes it impossible to - * regenerate the same random sequence twice, so this can't be used - * for encryption, but will generate good random numbers. - * * RC4 is a registered trademark of RSA Laboratories. */ @@ -46,6 +43,12 @@ __FBSDID("$FreeBSD$"); #include "libc_private.h" #include "un-namespace.h" +#ifdef __GNUC__ +#define inline __inline +#else /* !__GNUC__ */ +#define inline +#endif /* !__GNUC__ */ + struct arc4_stream { u_int8_t i; u_int8_t j; @@ -55,14 +58,14 @@ struct arc4_stream { static pthread_mutex_t arc4random_mtx = PTHREAD_MUTEX_INITIALIZER; #define RANDOMDEV "/dev/random" -#define KEYSIZE 128 -#define THREAD_LOCK() \ +#define KEYSIZE 128 +#define _ARC4_LOCK() \ do { \ if (__isthreaded) \ _pthread_mutex_lock(&arc4random_mtx); \ } while (0) -#define THREAD_UNLOCK() \ +#define _ARC4_UNLOCK() \ do { \ if (__isthreaded) \ _pthread_mutex_unlock(&arc4random_mtx); \ @@ -107,11 +110,11 @@ arc4_addrandom(u_char *dat, int datlen) static void arc4_stir(void) { - int done, fd, n; + int done, fd, i; struct { struct timeval tv; - pid_t pid; - u_int8_t rnd[KEYSIZE]; + pid_t pid; + u_char rnd[KEYSIZE]; } rdat; fd = _open(RANDOMDEV, O_RDONLY, 0); @@ -120,7 +123,7 @@ arc4_stir(void) if (_read(fd, &rdat, KEYSIZE) == KEYSIZE) done = 1; (void)_close(fd); - } + } if (!done) { (void)gettimeofday(&rdat.tv, NULL); rdat.pid = getpid(); @@ -130,14 +133,11 @@ arc4_stir(void) arc4_addrandom((u_char *)&rdat, KEYSIZE); /* - * Throw away the first N bytes of output, as suggested in the - * paper "Weaknesses in the Key Scheduling Algorithm of RC4" - * by Fluher, Mantin, and Shamir. N=1024 is based on - * suggestions in the paper "(Not So) Random Shuffles of RC4" - * by Ilya Mironov. + * Discard early keystream, as per recommendations in: + * "(Not So) Random Shuffles of RC4" by Ilya Mironov. */ - for (n = 0; n < 1024; n++) - (void) arc4_getbyte(); + for (i = 0; i < 1024; i++) + (void)arc4_getbyte(); arc4_count = 1600000; } @@ -152,7 +152,6 @@ arc4_getbyte(void) sj = rs.s[rs.j]; rs.s[rs.i] = sj; rs.s[rs.j] = si; - return (rs.s[(si + sj) & 0xff]); } @@ -160,13 +159,11 @@ static inline u_int32_t arc4_getword(void) { u_int32_t val; - val = arc4_getbyte() << 24; val |= arc4_getbyte() << 16; val |= arc4_getbyte() << 8; val |= arc4_getbyte(); - - return (val); + return val; } static void @@ -190,51 +187,48 @@ arc4_check_stir(void) void arc4random_stir(void) { - THREAD_LOCK(); + _ARC4_LOCK(); arc4_check_init(); arc4_stir(); rs_stired = 1; - THREAD_UNLOCK(); + _ARC4_UNLOCK(); } void arc4random_addrandom(u_char *dat, int datlen) { - THREAD_LOCK(); + _ARC4_LOCK(); arc4_check_init(); arc4_check_stir(); arc4_addrandom(dat, datlen); - THREAD_UNLOCK(); + _ARC4_UNLOCK(); } u_int32_t arc4random(void) { - u_int32_t rnd; - - THREAD_LOCK(); + u_int32_t val; + _ARC4_LOCK(); arc4_check_init(); arc4_check_stir(); - rnd = arc4_getword(); + val = arc4_getword(); arc4_count -= 4; - THREAD_UNLOCK(); - - return (rnd); + _ARC4_UNLOCK(); + return val; } void arc4random_buf(void *_buf, size_t n) { u_char *buf = (u_char *)_buf; - - THREAD_LOCK(); + _ARC4_LOCK(); arc4_check_init(); while (n--) { arc4_check_stir(); buf[n] = arc4_getbyte(); arc4_count--; } - THREAD_UNLOCK(); + _ARC4_UNLOCK(); } /* @@ -253,7 +247,7 @@ arc4random_uniform(u_int32_t upper_bound u_int32_t r, min; if (upper_bound < 2) - return (0); + return 0; #if (ULONG_MAX > 0xffffffffUL) min = 0x100000000UL % upper_bound; @@ -279,7 +273,7 @@ arc4random_uniform(u_int32_t upper_bound break; } - return (r % upper_bound); + return r % upper_bound; } #if 0 From owner-svn-src-all@FreeBSD.ORG Tue Nov 15 05:49:24 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A9D54106566B; Tue, 15 Nov 2011 05:49:24 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 99C388FC0A; Tue, 15 Nov 2011 05:49:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAF5nOZM083031; Tue, 15 Nov 2011 05:49:24 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAF5nOu8083029; Tue, 15 Nov 2011 05:49:24 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201111150549.pAF5nOu8083029@svn.freebsd.org> From: David Schultz Date: Tue, 15 Nov 2011 05:49:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227520 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Nov 2011 05:49:24 -0000 Author: das Date: Tue Nov 15 05:49:24 2011 New Revision: 227520 URL: http://svn.freebsd.org/changeset/base/227520 Log: Further reduce diffs with OpenBSD's arc4random. The main functional change here is to ensure that when a process forks after arc4random is seeded, the parent and child don't observe the same random sequence. OpenBSD's fix introduces some additional overhead in the form of a getpid() call. This could be improved upon, e.g., by setting a flag in fork(), if it proves to be a problem. This was discussed with secteam (simon, csjp, rwatson) in 2008, shortly prior to my going out of town and forgetting all about it. The conclusion was that the problem with forks is worrisome, but it doesn't appear to have introduced an actual vulnerability for any known programs. The only significant remaining difference between our arc4random and OpenBSD's is in how we seed the generator in arc4_stir(). Modified: head/lib/libc/gen/arc4random.c Modified: head/lib/libc/gen/arc4random.c ============================================================================== --- head/lib/libc/gen/arc4random.c Tue Nov 15 05:45:46 2011 (r227519) +++ head/lib/libc/gen/arc4random.c Tue Nov 15 05:49:24 2011 (r227520) @@ -33,11 +33,13 @@ __FBSDID("$FreeBSD$"); #include "namespace.h" -#include -#include -#include #include +#include +#include #include +#include +#include +#include #include #include "libc_private.h" @@ -71,9 +73,9 @@ static pthread_mutex_t arc4random_mtx = _pthread_mutex_unlock(&arc4random_mtx); \ } while (0) -static struct arc4_stream rs; static int rs_initialized; -static int rs_stired; +static struct arc4_stream rs; +static pid_t arc4_stir_pid; static int arc4_count; static inline u_int8_t arc4_getbyte(void); @@ -117,6 +119,10 @@ arc4_stir(void) u_char rnd[KEYSIZE]; } rdat; + if (!rs_initialized) { + arc4_init(); + rs_initialized = 1; + } fd = _open(RANDOMDEV, O_RDONLY, 0); done = 0; if (fd >= 0) { @@ -141,6 +147,18 @@ arc4_stir(void) arc4_count = 1600000; } +static void +arc4_stir_if_needed(void) +{ + pid_t pid = getpid(); + + if (arc4_count <= 0 || !rs_initialized || arc4_stir_pid != pid) + { + arc4_stir_pid = pid; + arc4_stir(); + } +} + static inline u_int8_t arc4_getbyte(void) { @@ -166,31 +184,11 @@ arc4_getword(void) return val; } -static void -arc4_check_init(void) -{ - if (!rs_initialized) { - arc4_init(); - rs_initialized = 1; - } -} - -static inline void -arc4_check_stir(void) -{ - if (!rs_stired || arc4_count <= 0) { - arc4_stir(); - rs_stired = 1; - } -} - void arc4random_stir(void) { _ARC4_LOCK(); - arc4_check_init(); arc4_stir(); - rs_stired = 1; _ARC4_UNLOCK(); } @@ -198,8 +196,8 @@ void arc4random_addrandom(u_char *dat, int datlen) { _ARC4_LOCK(); - arc4_check_init(); - arc4_check_stir(); + if (!rs_initialized) + arc4_stir(); arc4_addrandom(dat, datlen); _ARC4_UNLOCK(); } @@ -209,10 +207,9 @@ arc4random(void) { u_int32_t val; _ARC4_LOCK(); - arc4_check_init(); - arc4_check_stir(); - val = arc4_getword(); arc4_count -= 4; + arc4_stir_if_needed(); + val = arc4_getword(); _ARC4_UNLOCK(); return val; } @@ -222,11 +219,11 @@ arc4random_buf(void *_buf, size_t n) { u_char *buf = (u_char *)_buf; _ARC4_LOCK(); - arc4_check_init(); + arc4_stir_if_needed(); while (n--) { - arc4_check_stir(); + if (--arc4_count <= 0) + arc4_stir(); buf[n] = arc4_getbyte(); - arc4_count--; } _ARC4_UNLOCK(); } From owner-svn-src-all@FreeBSD.ORG Tue Nov 15 05:55:16 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C5F7106566B; Tue, 15 Nov 2011 05:55:16 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4BB818FC14; Tue, 15 Nov 2011 05:55:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAF5tG1v083305; Tue, 15 Nov 2011 05:55:16 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAF5tGE7083302; Tue, 15 Nov 2011 05:55:16 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201111150555.pAF5tGE7083302@svn.freebsd.org> From: David Schultz Date: Tue, 15 Nov 2011 05:55:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227522 - head/tools/regression/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Nov 2011 05:55:16 -0000 Author: das Date: Tue Nov 15 05:55:15 2011 New Revision: 227522 URL: http://svn.freebsd.org/changeset/base/227522 Log: A regression test to ensure that arc4random returns different sequences in parent and child processes after a fork. Added: head/tools/regression/lib/libc/gen/test-arc4random.c (contents, props changed) Modified: head/tools/regression/lib/libc/gen/Makefile Modified: head/tools/regression/lib/libc/gen/Makefile ============================================================================== --- head/tools/regression/lib/libc/gen/Makefile Tue Nov 15 05:49:34 2011 (r227521) +++ head/tools/regression/lib/libc/gen/Makefile Tue Nov 15 05:55:15 2011 (r227522) @@ -1,6 +1,7 @@ # $FreeBSD$ -TESTS= test-fmtcheck test-fnmatch test-fpclassify test-posix_spawn test-wordexp +TESTS= test-arc4random test-fmtcheck test-fnmatch \ + test-fpclassify test-posix_spawn test-wordexp .PHONY: tests tests: ${TESTS} Added: head/tools/regression/lib/libc/gen/test-arc4random.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/lib/libc/gen/test-arc4random.c Tue Nov 15 05:55:15 2011 (r227522) @@ -0,0 +1,89 @@ +/*- + * Copyright (c) 2011 David Schultz + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +/* + * BUFSIZE is the number of bytes of rc4 output to compare. The probability + * that this test fails spuriously is 2**(-BUFSIZE * 8). + */ +#define BUFSIZE 8 + +/* + * Test whether arc4random_buf() returns the same sequence of bytes in both + * parent and child processes. (Hint: It shouldn't.) + */ +int main(int argc, char *argv[]) { + struct shared_page { + char parentbuf[BUFSIZE]; + char childbuf[BUFSIZE]; + } *page; + pid_t pid; + char c; + + printf("1..1\n"); + + page = mmap(NULL, sizeof(struct shared_page), PROT_READ | PROT_WRITE, + MAP_ANON | MAP_SHARED, -1, 0); + if (page == MAP_FAILED) { + printf("fail 1 - mmap\n"); + exit(1); + } + + arc4random_buf(&c, 1); + + pid = fork(); + if (pid < 0) { + printf("fail 1 - fork\n"); + exit(1); + } + if (pid == 0) { + /* child */ + arc4random_buf(page->childbuf, BUFSIZE); + exit(0); + } else { + /* parent */ + int status; + arc4random_buf(page->parentbuf, BUFSIZE); + wait(&status); + } + if (memcmp(page->parentbuf, page->childbuf, BUFSIZE) == 0) { + printf("fail 1 - sequences are the same\n"); + exit(1); + } + + printf("ok 1 - sequences are different\n"); + exit(0); +} From owner-svn-src-all@FreeBSD.ORG Tue Nov 15 06:44:07 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CB274106566C; Tue, 15 Nov 2011 06:44:07 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B8C3C8FC0C; Tue, 15 Nov 2011 06:44:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAF6i7Ug085087; Tue, 15 Nov 2011 06:44:07 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAF6i7Qo085081; Tue, 15 Nov 2011 06:44:07 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201111150644.pAF6i7Qo085081@svn.freebsd.org> From: "David E. O'Brien" Date: Tue, 15 Nov 2011 06:44:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227524 - in head/usr.sbin: pmccontrol pmcstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Nov 2011 06:44:07 -0000 Author: obrien Date: Tue Nov 15 06:44:07 2011 New Revision: 227524 URL: http://svn.freebsd.org/changeset/base/227524 Log: Improve the chances of matching an outputted string with the line of code. Modified: head/usr.sbin/pmccontrol/pmccontrol.c head/usr.sbin/pmcstat/pmcpl_calltree.c head/usr.sbin/pmcstat/pmcpl_gprof.c head/usr.sbin/pmcstat/pmcstat.c head/usr.sbin/pmcstat/pmcstat_log.c Modified: head/usr.sbin/pmccontrol/pmccontrol.c ============================================================================== --- head/usr.sbin/pmccontrol/pmccontrol.c Tue Nov 15 06:35:21 2011 (r227523) +++ head/usr.sbin/pmccontrol/pmccontrol.c Tue Nov 15 06:44:07 2011 (r227524) @@ -147,8 +147,9 @@ pmcc_do_enable_disable(struct pmcc_op_li npmc = 0; for (c = 0; c < ncpu; c++) { if ((t = pmc_npmc(c)) < 0) - err(EX_OSERR, "Unable to determine the number of " - "PMCs in CPU %d", c); + err(EX_OSERR, + "Unable to determine the number of PMCs in CPU %d", + c); npmc = t > npmc ? t : npmc; } @@ -211,8 +212,8 @@ pmcc_do_enable_disable(struct pmcc_op_li if (error < 0) err(EX_OSERR, "%s of PMC %d on CPU %d failed", - b == PMCC_OP_ENABLE ? "Enable" : - "Disable", j, i); + b == PMCC_OP_ENABLE ? "Enable" : "Disable", + j, i); } return error; @@ -308,8 +309,9 @@ pmcc_do_list_events(void) printf("%s\n", pmc_name_of_class(c)); if (pmc_event_names_of_class(c, &eventnamelist, &nevents) < 0) - err(EX_OSERR, "ERROR: Cannot find information for " - "event class \"%s\"", pmc_name_of_class(c)); + err(EX_OSERR, +"ERROR: Cannot find information for event class \"%s\"", + pmc_name_of_class(c)); for (j = 0; j < nevents; j++) printf("\t%s\n", eventnamelist[j]); @@ -481,7 +483,8 @@ main(int argc, char **argv) break; case PMCC_ENABLE_DISABLE: if (STAILQ_EMPTY(&head)) - errx(EX_USAGE, "No PMCs specified to enable or disable"); + errx(EX_USAGE, + "No PMCs specified to enable or disable"); error = pmcc_do_enable_disable(&head); break; default: Modified: head/usr.sbin/pmcstat/pmcpl_calltree.c ============================================================================== --- head/usr.sbin/pmcstat/pmcpl_calltree.c Tue Nov 15 06:35:21 2011 (r227523) +++ head/usr.sbin/pmcstat/pmcpl_calltree.c Tue Nov 15 06:44:07 2011 (r227524) @@ -575,7 +575,8 @@ pmcpl_ct_topkeypress(int c, WINDOW *w) switch (c) { case 'f': pmcstat_skiplink = !pmcstat_skiplink; - wprintw(w, "skip empty link %s", pmcstat_skiplink ? "on" : "off"); + wprintw(w, "skip empty link %s", + pmcstat_skiplink ? "on" : "off"); break; } Modified: head/usr.sbin/pmcstat/pmcpl_gprof.c ============================================================================== --- head/usr.sbin/pmcstat/pmcpl_gprof.c Tue Nov 15 06:35:21 2011 (r227523) +++ head/usr.sbin/pmcstat/pmcpl_gprof.c Tue Nov 15 06:44:07 2011 (r227524) @@ -333,8 +333,9 @@ pmcpl_gmon_initimage(struct pmcstat_imag count = 0; do { if (++count > 999) - errx(EX_CANTCREAT, "ERROR: cannot create a " - "gmon file for \"%s\"", name); + errx(EX_CANTCREAT, + "ERROR: cannot create a gmon file for" + " \"%s\"", name); snprintf(name, sizeof(name), "%.*s~%3.3d.gmon", nlen, sn, count); if (pmcstat_string_lookup(name) == NULL) { @@ -516,8 +517,8 @@ pmcpl_gmon_shutdown(FILE *mf) pgf->pgf_pmcid), pgf->pgf_nsamples); if (pgf->pgf_overflow && args.pa_verbosity >= 1) - warnx("WARNING: profile \"%s\" " - "overflowed.", + warnx( +"WARNING: profile \"%s\" overflowed.", pmcstat_string_unintern( pgf->pgf_name)); } Modified: head/usr.sbin/pmcstat/pmcstat.c ============================================================================== --- head/usr.sbin/pmcstat/pmcstat.c Tue Nov 15 06:35:21 2011 (r227523) +++ head/usr.sbin/pmcstat/pmcstat.c Tue Nov 15 06:44:07 2011 (r227524) @@ -156,8 +156,9 @@ pmcstat_get_cpumask(const char *cpuspec, do { cpu = strtol(s, &end, 0); if (cpu < 0 || end == s) - errx(EX_USAGE, "ERROR: Illegal CPU specification " - "\"%s\".", cpuspec); + errx(EX_USAGE, + "ERROR: Illegal CPU specification \"%s\".", + cpuspec); CPU_SET(cpu, cpumask); s = end + strspn(end, ", \t"); } while (*s); @@ -179,9 +180,9 @@ pmcstat_attach_pmcs(void) if (pmc_attach(ev->ev_pmcid, pt->pt_pid) == 0) count++; else if (errno != ESRCH) - err(EX_OSERR, "ERROR: cannot attach pmc " - "\"%s\" to process %d", ev->ev_name, - (int) pt->pt_pid); + err(EX_OSERR, +"ERROR: cannot attach pmc \"%s\" to process %d", + ev->ev_name, (int)pt->pt_pid); } if (count == 0) @@ -198,11 +199,11 @@ pmcstat_cleanup(void) STAILQ_FOREACH_SAFE(ev, &args.pa_events, ev_next, tmp) if (ev->ev_pmcid != PMC_ID_INVALID) { if (pmc_stop(ev->ev_pmcid) < 0) - err(EX_OSERR, "ERROR: cannot stop pmc 0x%x " - "\"%s\"", ev->ev_pmcid, ev->ev_name); + err(EX_OSERR, "ERROR: cannot stop pmc 0x%x \"%s\"", + ev->ev_pmcid, ev->ev_name); if (pmc_release(ev->ev_pmcid) < 0) - err(EX_OSERR, "ERROR: cannot release pmc " - "0x%x \"%s\"", ev->ev_pmcid, ev->ev_name); + err(EX_OSERR, "ERROR: cannot release pmc 0x%x \"%s\"", + ev->ev_pmcid, ev->ev_name); free(ev->ev_name); free(ev->ev_spec); STAILQ_REMOVE(&args.pa_events, ev, pmcstat_ev, ev_next); @@ -424,8 +425,8 @@ pmcstat_print_counters(void) continue; if (pmc_read(ev->ev_pmcid, &value) < 0) - err(EX_OSERR, "ERROR: Cannot read pmc " - "\"%s\"", ev->ev_name); + err(EX_OSERR, "ERROR: Cannot read pmc \"%s\"", + ev->ev_name); (void) fprintf(args.pa_printfile, "%*ju ", ev->ev_fieldwidth + extra_width, @@ -641,8 +642,9 @@ main(int argc, char **argv) err(EX_OSERR, "ERROR: Cannot stat \"%s\"", optarg); if (!S_ISDIR(sb.st_mode)) - errx(EX_USAGE, "ERROR: \"%s\" is not a " - "directory.", optarg); + errx(EX_USAGE, + "ERROR: \"%s\" is not a directory.", + optarg); args.pa_samplesdir = optarg; args.pa_flags |= FLAG_HAS_SAMPLESDIR; args.pa_required |= FLAG_DO_GPROF; @@ -801,15 +803,16 @@ main(int argc, char **argv) args.pa_printfile != stderr) (void) fclose(args.pa_printfile); if ((args.pa_printfile = fopen(optarg, "w")) == NULL) - errx(EX_OSERR, "ERROR: cannot open \"%s\" for " - "writing.", optarg); + errx(EX_OSERR, + "ERROR: cannot open \"%s\" for writing.", + optarg); args.pa_flags |= FLAG_DO_PRINT; break; case 'O': /* sampling output */ if (args.pa_outputpath) - errx(EX_USAGE, "ERROR: option -O may only be " - "specified once."); + errx(EX_USAGE, +"ERROR: option -O may only be specified once."); args.pa_outputpath = optarg; args.pa_flags |= FLAG_HAS_OUTPUT_LOGFILE; break; @@ -824,8 +827,8 @@ main(int argc, char **argv) case 'R': /* read an existing log file */ if (args.pa_inputpath != NULL) - errx(EX_USAGE, "ERROR: option -R may only be " - "specified once."); + errx(EX_USAGE, +"ERROR: option -R may only be specified once."); args.pa_inputpath = optarg; if (args.pa_printfile == stderr) args.pa_printfile = stdout; @@ -855,8 +858,9 @@ main(int argc, char **argv) case 'w': /* wait interval */ interval = strtod(optarg, &end); if (*end != '\0' || interval <= 0) - errx(EX_USAGE, "ERROR: Illegal wait interval " - "value \"%s\".", optarg); + errx(EX_USAGE, +"ERROR: Illegal wait interval value \"%s\".", + optarg); args.pa_flags |= FLAG_HAS_WAIT_INTERVAL; args.pa_interval = interval; break; @@ -870,8 +874,9 @@ main(int argc, char **argv) case 'z': graphdepth = strtod(optarg, &end); if (*end != '\0' || graphdepth <= 0) - errx(EX_USAGE, "ERROR: Illegal callchain " - "depth \"%s\".", optarg); + errx(EX_USAGE, + "ERROR: Illegal callchain depth \"%s\".", + optarg); args.pa_graphdepth = graphdepth; args.pa_required |= FLAG_DO_CALLGRAPHS; break; @@ -908,8 +913,8 @@ main(int argc, char **argv) /* disallow -O and -R together */ if (args.pa_outputpath && args.pa_inputpath) - errx(EX_USAGE, "ERROR: options -O and -R are mutually " - "exclusive."); + errx(EX_USAGE, + "ERROR: options -O and -R are mutually exclusive."); /* -m option is allowed with -R only. */ if (args.pa_flags & FLAG_DO_ANNOTATE && args.pa_inputpath == NULL) @@ -918,8 +923,8 @@ main(int argc, char **argv) /* -m option is not allowed combined with -g or -G. */ if (args.pa_flags & FLAG_DO_ANNOTATE && args.pa_flags & (FLAG_DO_GPROF | FLAG_DO_CALLGRAPHS)) - errx(EX_USAGE, "ERROR: option -m and -g | -G are mutually " - "exclusive"); + errx(EX_USAGE, + "ERROR: option -m and -g | -G are mutually exclusive"); if (args.pa_flags & FLAG_READ_LOGFILE) { errmsg = NULL; @@ -930,8 +935,9 @@ main(int argc, char **argv) else if (!STAILQ_EMPTY(&args.pa_events)) errmsg = "a PMC event specification"; if (errmsg) - errx(EX_USAGE, "ERROR: option -R may not be used with " - "%s.", errmsg); + errx(EX_USAGE, + "ERROR: option -R may not be used with %s.", + errmsg); } else if (STAILQ_EMPTY(&args.pa_events)) /* All other uses require a PMC spec. */ pmcstat_show_usage(); @@ -939,58 +945,66 @@ main(int argc, char **argv) /* check for -t pid without a process PMC spec */ if ((args.pa_required & FLAG_HAS_TARGET) && (args.pa_flags & FLAG_HAS_PROCESS_PMCS) == 0) - errx(EX_USAGE, "ERROR: option -t requires a process mode PMC " - "to be specified."); + errx(EX_USAGE, +"ERROR: option -t requires a process mode PMC to be specified." + ); /* check for process-mode options without a command or -t pid */ if ((args.pa_required & FLAG_HAS_PROCESS_PMCS) && (args.pa_flags & (FLAG_HAS_COMMANDLINE | FLAG_HAS_TARGET)) == 0) - errx(EX_USAGE, "ERROR: options -d, -E, -p, -P, and -W require " - "a command line or target process."); + errx(EX_USAGE, +"ERROR: options -d, -E, -p, -P, and -W require a command line or target process." + ); /* check for -p | -P without a target process of some sort */ if ((args.pa_required & (FLAG_HAS_COMMANDLINE | FLAG_HAS_TARGET)) && (args.pa_flags & (FLAG_HAS_COMMANDLINE | FLAG_HAS_TARGET)) == 0) - errx(EX_USAGE, "ERROR: options -P and -p require a " - "target process or a command line."); + errx(EX_USAGE, +"ERROR: options -P and -p require a target process or a command line." + ); /* check for process-mode options without a process-mode PMC */ if ((args.pa_required & FLAG_HAS_PROCESS_PMCS) && (args.pa_flags & FLAG_HAS_PROCESS_PMCS) == 0) - errx(EX_USAGE, "ERROR: options -d, -E, and -W require a " - "process mode PMC to be specified."); + errx(EX_USAGE, +"ERROR: options -d, -E, and -W require a process mode PMC to be specified." + ); /* check for -c cpu with no system mode PMCs or logfile. */ if ((args.pa_required & FLAG_HAS_SYSTEM_PMCS) && (args.pa_flags & FLAG_HAS_SYSTEM_PMCS) == 0 && (args.pa_flags & FLAG_READ_LOGFILE) == 0) - errx(EX_USAGE, "ERROR: option -c requires at least one " - "system mode PMC to be specified."); + errx(EX_USAGE, +"ERROR: option -c requires at least one system mode PMC to be specified." + ); /* check for counting mode options without a counting PMC */ if ((args.pa_required & FLAG_HAS_COUNTING_PMCS) && (args.pa_flags & FLAG_HAS_COUNTING_PMCS) == 0) - errx(EX_USAGE, "ERROR: options -C, -W and -o require at " - "least one counting mode PMC to be specified."); + errx(EX_USAGE, +"ERROR: options -C, -W and -o require at least one counting mode PMC to be specified." + ); /* check for sampling mode options without a sampling PMC spec */ if ((args.pa_required & FLAG_HAS_SAMPLING_PMCS) && (args.pa_flags & FLAG_HAS_SAMPLING_PMCS) == 0) - errx(EX_USAGE, "ERROR: options -N, -n and -O require at " - "least one sampling mode PMC to be specified."); + errx(EX_USAGE, +"ERROR: options -N, -n and -O require at least one sampling mode PMC to be specified." + ); /* check if -g/-G/-m/-T are being used correctly */ if ((args.pa_flags & FLAG_DO_ANALYSIS) && !(args.pa_flags & (FLAG_HAS_SAMPLING_PMCS|FLAG_READ_LOGFILE))) - errx(EX_USAGE, "ERROR: options -g/-G/-m/-T require sampling PMCs " - "or -R to be specified."); + errx(EX_USAGE, +"ERROR: options -g/-G/-m/-T require sampling PMCs or -R to be specified." + ); /* check if -O was spuriously specified */ if ((args.pa_flags & FLAG_HAS_OUTPUT_LOGFILE) && (args.pa_required & FLAG_HAS_OUTPUT_LOGFILE) == 0) errx(EX_USAGE, - "ERROR: option -O is used only with options " - "-E, -P, -S and -W."); +"ERROR: option -O is used only with options -E, -P, -S and -W." + ); /* -k kernel path require -g/-G/-m/-T or -R */ if ((args.pa_flags & FLAG_HAS_KERNELPATH) && @@ -1017,8 +1031,9 @@ main(int argc, char **argv) if ((args.pa_flags & FLAG_HAS_COUNTING_PMCS) && (args.pa_flags & FLAG_HAS_SAMPLING_PMCS) && ((args.pa_flags & FLAG_HAS_OUTPUT_LOGFILE) == 0)) - errx(EX_USAGE, "ERROR: option -O is required if counting and " - "sampling PMCs are specified together."); + errx(EX_USAGE, +"ERROR: option -O is required if counting and sampling PMCs are specified together." + ); /* * Check if "-k kerneldir" was specified, and if whether @@ -1044,8 +1059,9 @@ main(int argc, char **argv) err(EX_OSERR, "ERROR: Cannot stat \"%s\"", buffer); if (!S_ISDIR(sb.st_mode)) - errx(EX_USAGE, "ERROR: \"%s\" is not a " - "directory.", buffer); + errx(EX_USAGE, + "ERROR: \"%s\" is not a directory.", + buffer); } } @@ -1058,8 +1074,9 @@ main(int argc, char **argv) else { args.pa_graphfile = fopen(graphfilename, "w"); if (args.pa_graphfile == NULL) - err(EX_OSERR, "ERROR: cannot open \"%s\" " - "for writing", graphfilename); + err(EX_OSERR, + "ERROR: cannot open \"%s\" for writing", + graphfilename); } } if (args.pa_flags & FLAG_DO_ANNOTATE) { @@ -1073,11 +1090,13 @@ main(int argc, char **argv) if ((args.pa_flags & FLAG_READ_LOGFILE) == 0) { if (pmc_init() < 0) err(EX_UNAVAILABLE, - "ERROR: Initialization of the pmc(3) library failed"); + "ERROR: Initialization of the pmc(3) library failed" + ); if ((npmc = pmc_npmc(0)) < 0) /* assume all CPUs are identical */ - err(EX_OSERR, "ERROR: Cannot determine the number of PMCs " - "on CPU %d", 0); + err(EX_OSERR, +"ERROR: Cannot determine the number of PMCs on CPU %d", + 0); } /* Allocate a kqueue */ @@ -1152,17 +1171,18 @@ main(int argc, char **argv) */ STAILQ_FOREACH(ev, &args.pa_events, ev_next) { - if (pmc_allocate(ev->ev_spec, ev->ev_mode, + if (pmc_allocate(ev->ev_spec, ev->ev_mode, ev->ev_flags, ev->ev_cpu, &ev->ev_pmcid) < 0) - err(EX_OSERR, "ERROR: Cannot allocate %s-mode pmc with " - "specification \"%s\"", - PMC_IS_SYSTEM_MODE(ev->ev_mode) ? "system" : "process", - ev->ev_spec); - - if (PMC_IS_SAMPLING_MODE(ev->ev_mode) && - pmc_set(ev->ev_pmcid, ev->ev_count) < 0) - err(EX_OSERR, "ERROR: Cannot set sampling count " - "for PMC \"%s\"", ev->ev_name); + err(EX_OSERR, +"ERROR: Cannot allocate %s-mode pmc with specification \"%s\"", + PMC_IS_SYSTEM_MODE(ev->ev_mode) ? + "system" : "process", ev->ev_spec); + + if (PMC_IS_SAMPLING_MODE(ev->ev_mode) && + pmc_set(ev->ev_pmcid, ev->ev_count) < 0) + err(EX_OSERR, + "ERROR: Cannot set sampling count for PMC \"%s\"", + ev->ev_name); } /* compute printout widths */ @@ -1204,8 +1224,8 @@ main(int argc, char **argv) EV_SET(&kev, SIGWINCH, EVFILT_SIGNAL, EV_ADD, 0, 0, NULL); if (kevent(pmcstat_kq, &kev, 1, NULL, 0, NULL) < 0) - err(EX_OSERR, "ERROR: Cannot register kevent for " - "SIGWINCH"); + err(EX_OSERR, + "ERROR: Cannot register kevent for SIGWINCH"); args.pa_toptty = 1; } @@ -1248,8 +1268,8 @@ main(int argc, char **argv) args.pa_interval * 1000, NULL); if (kevent(pmcstat_kq, &kev, 1, NULL, 0, NULL) < 0) - err(EX_OSERR, "ERROR: Cannot register kevent for " - "timer"); + err(EX_OSERR, + "ERROR: Cannot register kevent for timer"); } /* attach PMCs to the target process, starting it if specified */ @@ -1262,8 +1282,8 @@ main(int argc, char **argv) /* Attach process pmcs to the target process. */ if (args.pa_flags & (FLAG_HAS_TARGET | FLAG_HAS_COMMANDLINE)) { if (SLIST_EMPTY(&args.pa_targets)) - errx(EX_DATAERR, "ERROR: No matching target " - "processes."); + errx(EX_DATAERR, + "ERROR: No matching target processes."); if (args.pa_flags & FLAG_HAS_PROCESS_PMCS) pmcstat_attach_pmcs(); @@ -1319,7 +1339,8 @@ main(int argc, char **argv) keypad(stdscr, TRUE); clear(); /* Get terminal width / height with ncurses. */ - getmaxyx(stdscr, pmcstat_displayheight, pmcstat_displaywidth); + getmaxyx(stdscr, + pmcstat_displayheight, pmcstat_displaywidth); pmcstat_displayheight--; pmcstat_displaywidth--; atexit(pmcstat_topexit); } @@ -1385,8 +1406,8 @@ main(int argc, char **argv) } else if (kev.ident == SIGWINCH) { if (ioctl(fileno(args.pa_printfile), TIOCGWINSZ, &ws) < 0) - err(EX_OSERR, "ERROR: Cannot determine " - "window size"); + err(EX_OSERR, + "ERROR: Cannot determine window size"); pmcstat_displayheight = ws.ws_row - 1; pmcstat_displaywidth = ws.ws_col - 1; } else @@ -1406,7 +1427,8 @@ main(int argc, char **argv) if (do_print && !do_read) { if ((args.pa_required & FLAG_HAS_OUTPUT_LOGFILE) == 0) { pmcstat_print_pmcs(); - if (runstate == PMCSTAT_FINISHED && /* final newline */ + if (runstate == PMCSTAT_FINISHED && + /* final newline */ (args.pa_flags & FLAG_DO_PRINT) == 0) (void) fprintf(args.pa_printfile, "\n"); } @@ -1433,19 +1455,19 @@ main(int argc, char **argv) /* check if the driver lost any samples or events */ if (check_driver_stats) { if (pmc_get_driver_stats(&ds_end) < 0) - err(EX_OSERR, "ERROR: Cannot retrieve driver " - "statistics"); + err(EX_OSERR, + "ERROR: Cannot retrieve driver statistics"); if (ds_start.pm_intr_bufferfull != ds_end.pm_intr_bufferfull && args.pa_verbosity > 0) - warnx("WARNING: some samples were dropped. Please " - "consider tuning the \"kern.hwpmc.nsamples\" " - "tunable."); + warnx("WARNING: some samples were dropped.\n" +"Please consider tuning the \"kern.hwpmc.nsamples\" tunable." + ); if (ds_start.pm_buffer_requests_failed != ds_end.pm_buffer_requests_failed && args.pa_verbosity > 0) - warnx("WARNING: some events were discarded. Please " - "consider tuning the \"kern.hwpmc.nbuffers\" " - "tunable."); + warnx("WARNING: some events were discarded.\n" +"Please consider tuning the \"kern.hwpmc.nbuffers\" tunable." + ); } exit(EX_OK); Modified: head/usr.sbin/pmcstat/pmcstat_log.c ============================================================================== --- head/usr.sbin/pmcstat/pmcstat_log.c Tue Nov 15 06:35:21 2011 (r227523) +++ head/usr.sbin/pmcstat/pmcstat_log.c Tue Nov 15 06:44:07 2011 (r227524) @@ -421,8 +421,8 @@ pmcstat_image_get_aout_params(struct pmc assert(path != NULL); if (image->pi_iskernelmodule) - errx(EX_SOFTWARE, "ERROR: a.out kernel modules are " - "unsupported \"%s\"", path); + errx(EX_SOFTWARE, + "ERROR: a.out kernel modules are unsupported \"%s\"", path); (void) snprintf(buffer, sizeof(buffer), "%s%s", args.pa_fsroot, path); @@ -645,8 +645,9 @@ pmcstat_image_get_elf_params(struct pmcs } if (gelf_getehdr(e, &eh) != &eh) { - warnx("WARNING: Cannot retrieve the ELF Header for " - "\"%s\": %s.", buffer, elf_errmsg(-1)); + warnx( + "WARNING: Cannot retrieve the ELF Header for \"%s\": %s.", + buffer, elf_errmsg(-1)); goto done; } @@ -667,16 +668,17 @@ pmcstat_image_get_elf_params(struct pmcs */ if (eh.e_type == ET_EXEC) { if (elf_getphnum(e, &nph) == 0) { - warnx("WARNING: Could not determine the number of " - "program headers in \"%s\": %s.", buffer, + warnx( +"WARNING: Could not determine the number of program headers in \"%s\": %s.", + buffer, elf_errmsg(-1)); goto done; } for (i = 0; i < eh.e_phnum; i++) { if (gelf_getphdr(e, i, &ph) != &ph) { - warnx("WARNING: Retrieval of PHDR entry #%ju " - "in \"%s\" failed: %s.", (uintmax_t) i, - buffer, elf_errmsg(-1)); + warnx( +"WARNING: Retrieval of PHDR entry #%ju in \"%s\" failed: %s.", + (uintmax_t) i, buffer, elf_errmsg(-1)); goto done; } switch (ph.p_type) { @@ -685,8 +687,8 @@ pmcstat_image_get_elf_params(struct pmcs break; case PT_INTERP: if ((elfbase = elf_rawfile(e, NULL)) == NULL) { - warnx("WARNING: Cannot retrieve the " - "interpreter for \"%s\": %s.", + warnx( +"WARNING: Cannot retrieve the interpreter for \"%s\": %s.", buffer, elf_errmsg(-1)); goto done; } @@ -706,17 +708,18 @@ pmcstat_image_get_elf_params(struct pmcs * Get the min and max VA associated with this ELF object. */ if (elf_getshnum(e, &nsh) == 0) { - warnx("WARNING: Could not determine the number of sections " - "for \"%s\": %s.", buffer, elf_errmsg(-1)); + warnx( +"WARNING: Could not determine the number of sections for \"%s\": %s.", + buffer, elf_errmsg(-1)); goto done; } for (i = 0; i < nsh; i++) { if ((scn = elf_getscn(e, i)) == NULL || gelf_getshdr(scn, &sh) != &sh) { - warnx("WARNING: Could not retrieve section header " - "#%ju in \"%s\": %s.", (uintmax_t) i, buffer, - elf_errmsg(-1)); + warnx( +"WARNING: Could not retrieve section header #%ju in \"%s\": %s.", + (uintmax_t) i, buffer, elf_errmsg(-1)); goto done; } if (sh.sh_flags & SHF_EXECINSTR) { @@ -912,8 +915,8 @@ pmcstat_image_unmap(struct pmcstat_proce * the new one at [end]. */ if ((pcmnew = malloc(sizeof(*pcmnew))) == NULL) - err(EX_OSERR, "ERROR: Cannot split a map " - "entry"); + err(EX_OSERR, + "ERROR: Cannot split a map entry"); pcmnew->ppm_image = pcm->ppm_image; @@ -964,8 +967,9 @@ pmcstat_image_addr2line(struct pmcstat_i if (image->pi_addr2line == NULL) { if (!addr2line_warn) { addr2line_warn = 1; - warnx("WARNING: addr2line is needed" - "for source code information."); + warnx( +"WARNING: addr2line is needed for source code information." + ); } return (0); } @@ -1283,8 +1287,9 @@ pmcstat_process_exec(struct pmcstat_proc break; default: - err(EX_SOFTWARE, "ERROR: Unsupported executable type for " - "\"%s\"", pmcstat_string_unintern(path)); + err(EX_SOFTWARE, + "ERROR: Unsupported executable type for \"%s\"", + pmcstat_string_unintern(path)); } } @@ -1338,10 +1343,9 @@ pmcstat_analyze_log(void) case PMCLOG_TYPE_INITIALIZE: if ((ev.pl_u.pl_i.pl_version & 0xFF000000) != PMC_VERSION_MAJOR << 24 && args.pa_verbosity > 0) - warnx("WARNING: Log version 0x%x does not " - "match compiled version 0x%x.", - ev.pl_u.pl_i.pl_version, - PMC_VERSION_MAJOR); + warnx( +"WARNING: Log version 0x%x does not match compiled version 0x%x.", + ev.pl_u.pl_i.pl_version, PMC_VERSION_MAJOR); break; case PMCLOG_TYPE_MAP_IN: @@ -1556,8 +1560,9 @@ pmcstat_analyze_log(void) else if (ev.pl_state == PMCLOG_REQUIRE_DATA) return (PMCSTAT_RUNNING); - err(EX_DATAERR, "ERROR: event parsing failed (record %jd, " - "offset 0x%jx)", (uintmax_t) ev.pl_count + 1, ev.pl_offset); + err(EX_DATAERR, + "ERROR: event parsing failed (record %jd, offset 0x%jx)", + (uintmax_t) ev.pl_count + 1, ev.pl_offset); } /* @@ -1597,9 +1602,9 @@ pmcstat_print_log(void) pmc_name_of_cputype(ev.pl_u.pl_i.pl_arch)); if ((ev.pl_u.pl_i.pl_version & 0xFF000000) != PMC_VERSION_MAJOR << 24 && args.pa_verbosity > 0) - warnx("WARNING: Log version 0x%x != expected " - "version 0x%x.", ev.pl_u.pl_i.pl_version, - PMC_VERSION); + warnx( +"WARNING: Log version 0x%x != expected version 0x%x.", + ev.pl_u.pl_i.pl_version, PMC_VERSION); break; case PMCLOG_TYPE_MAP_IN: PMCSTAT_PRINT_ENTRY("map-in","%d %p \"%s\"", @@ -1680,8 +1685,8 @@ pmcstat_print_log(void) else if (ev.pl_state == PMCLOG_REQUIRE_DATA) return (PMCSTAT_RUNNING); - errx(EX_DATAERR, "ERROR: event parsing failed " - "(record %jd, offset 0x%jx).", + errx(EX_DATAERR, + "ERROR: event parsing failed (record %jd, offset 0x%jx).", (uintmax_t) ev.pl_count + 1, ev.pl_offset); /*NOTREACHED*/ } From owner-svn-src-all@FreeBSD.ORG Tue Nov 15 06:50:10 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E75F6106566C; Tue, 15 Nov 2011 06:50:10 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D4A1A8FC17; Tue, 15 Nov 2011 06:50:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAF6oAxA085358; Tue, 15 Nov 2011 06:50:10 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAF6oAOZ085356; Tue, 15 Nov 2011 06:50:10 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201111150650.pAF6oAOZ085356@svn.freebsd.org> From: "David E. O'Brien" Date: Tue, 15 Nov 2011 06:50:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227526 - head/usr.sbin/pmcstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Nov 2011 06:50:11 -0000 Author: obrien Date: Tue Nov 15 06:50:10 2011 New Revision: 227526 URL: http://svn.freebsd.org/changeset/base/227526 Log: KNF Modified: head/usr.sbin/pmcstat/pmcstat_log.c Modified: head/usr.sbin/pmcstat/pmcstat_log.c ============================================================================== --- head/usr.sbin/pmcstat/pmcstat_log.c Tue Nov 15 06:45:51 2011 (r227525) +++ head/usr.sbin/pmcstat/pmcstat_log.c Tue Nov 15 06:50:10 2011 (r227526) @@ -1218,22 +1218,23 @@ pmcstat_process_lookup(pid_t pid, int al hash = (uint32_t) pid & PMCSTAT_HASH_MASK; /* simplicity wins */ LIST_FOREACH_SAFE(pp, &pmcstat_process_hash[hash], pp_next, pptmp) - if (pp->pp_pid == pid) { - /* Found a descriptor, check and process zombies */ - if (allocate && pp->pp_isactive == 0) { - /* remove maps */ - TAILQ_FOREACH_SAFE(ppm, &pp->pp_map, ppm_next, - ppmtmp) { - TAILQ_REMOVE(&pp->pp_map, ppm, ppm_next); - free(ppm); - } - /* remove process entry */ - LIST_REMOVE(pp, pp_next); - free(pp); - break; - } - return (pp); - } + if (pp->pp_pid == pid) { + /* Found a descriptor, check and process zombies */ + if (allocate && pp->pp_isactive == 0) { + /* remove maps */ + TAILQ_FOREACH_SAFE(ppm, &pp->pp_map, ppm_next, + ppmtmp) { + TAILQ_REMOVE(&pp->pp_map, ppm, + ppm_next); + free(ppm); + } + /* remove process entry */ + LIST_REMOVE(pp, pp_next); + free(pp); + break; + } + return (pp); + } if (!allocate) return (NULL); From owner-svn-src-all@FreeBSD.ORG Tue Nov 15 07:14:11 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A673106564A; Tue, 15 Nov 2011 07:14:11 +0000 (UTC) (envelope-from ache@vniz.net) Received: from vniz.net (vniz.net [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id 9EAAB8FC15; Tue, 15 Nov 2011 07:14:10 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vniz.net (8.14.5/8.14.5) with ESMTP id pAF7E8g6090331; Tue, 15 Nov 2011 11:14:09 +0400 (MSK) (envelope-from ache@vniz.net) Received: (from ache@localhost) by localhost (8.14.5/8.14.5/Submit) id pAF7E8Yr090330; Tue, 15 Nov 2011 11:14:08 +0400 (MSK) (envelope-from ache) Date: Tue, 15 Nov 2011 11:14:08 +0400 From: Andrey Chernov To: David Schultz Message-ID: <20111115071407.GB86944@vniz.net> Mail-Followup-To: Andrey Chernov , David Schultz , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <201111150549.pAF5nOu8083029@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201111150549.pAF5nOu8083029@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 Subject: Re: svn commit: r227520 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Nov 2011 07:14:11 -0000 On Tue, Nov 15, 2011 at 05:49:24AM +0000, David Schultz wrote: > Author: das > Date: Tue Nov 15 05:49:24 2011 > New Revision: 227520 > URL: http://svn.freebsd.org/changeset/base/227520 > > Log: > Further reduce diffs with OpenBSD's arc4random. The main functional > change here is to ensure that when a process forks after arc4random > is seeded, the parent and child don't observe the same random sequence. > OpenBSD's fix introduces some additional overhead in the form of a > getpid() call. This could be improved upon, e.g., by setting a flag > in fork(), if it proves to be a problem. > > This was discussed with secteam (simon, csjp, rwatson) in 2008, shortly > prior to my going out of town and forgetting all about it. The conclusion > was that the problem with forks is worrisome, but it doesn't appear to > have introduced an actual vulnerability for any known programs. > > The only significant remaining difference between our arc4random and > OpenBSD's is in how we seed the generator in arc4_stir(). Thanx for taking that! -- http://ache.vniz.net/ From owner-svn-src-all@FreeBSD.ORG Tue Nov 15 09:23:22 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4F161106564A; Tue, 15 Nov 2011 09:23:22 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3F2378FC16; Tue, 15 Nov 2011 09:23:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAF9NLQ2090051; Tue, 15 Nov 2011 09:23:21 GMT (envelope-from pho@svn.freebsd.org) Received: (from pho@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAF9NLMA090049; Tue, 15 Nov 2011 09:23:21 GMT (envelope-from pho@svn.freebsd.org) Message-Id: <201111150923.pAF9NLMA090049@svn.freebsd.org> From: Peter Holm Date: Tue, 15 Nov 2011 09:23:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227527 - head/sys/fs/pseudofs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Nov 2011 09:23:22 -0000 Author: pho Date: Tue Nov 15 09:23:21 2011 New Revision: 227527 URL: http://svn.freebsd.org/changeset/base/227527 Log: Removed extra PRELE() call. MFC after: 1 week Modified: head/sys/fs/pseudofs/pseudofs_vnops.c Modified: head/sys/fs/pseudofs/pseudofs_vnops.c ============================================================================== --- head/sys/fs/pseudofs/pseudofs_vnops.c Tue Nov 15 06:50:10 2011 (r227526) +++ head/sys/fs/pseudofs/pseudofs_vnops.c Tue Nov 15 09:23:21 2011 (r227527) @@ -632,8 +632,6 @@ pfs_read(struct vop_read_args *va) (offset = uio->uio_offset) != uio->uio_offset || (resid = uio->uio_resid) != uio->uio_resid || (buflen = offset + resid + 1) < offset || buflen > INT_MAX) { - if (proc != NULL) - PRELE(proc); error = EINVAL; goto ret; } From owner-svn-src-all@FreeBSD.ORG Tue Nov 15 12:59:07 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B1C4A106567A; Tue, 15 Nov 2011 12:59:07 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A13768FC17; Tue, 15 Nov 2011 12:59:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAFCx7xp099263; Tue, 15 Nov 2011 12:59:07 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAFCx7TW099261; Tue, 15 Nov 2011 12:59:07 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201111151259.pAFCx7TW099261@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 15 Nov 2011 12:59:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227528 - head/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Nov 2011 12:59:07 -0000 Author: glebius Date: Tue Nov 15 12:59:07 2011 New Revision: 227528 URL: http://svn.freebsd.org/changeset/base/227528 Log: On some laptops it is important to re-open /dev/psm after resume. moused(8) was capable to do this upon SIGHUP for more than a decade. Automate this via rc.resume in default installation. Modified: head/etc/rc.resume Modified: head/etc/rc.resume ============================================================================== --- head/etc/rc.resume Tue Nov 15 09:23:21 2011 (r227527) +++ head/etc/rc.resume Tue Nov 15 12:59:07 2011 (r227528) @@ -49,6 +49,10 @@ if [ -r /var/run/rc.suspend.tch ]; then /bin/rm -f /var/run/rc.suspend.tch fi +if [ -r /var/run/moused.pid ]; then + kill -HUP `head -1 /var/run/moused.pid` +fi + # Turns on a power supply of a card in the slot inactivated. # See also contrib/pccardq.c (only for PAO users). # pccardq | awk -F '~' '$5 == "inactive" \ From owner-svn-src-all@FreeBSD.ORG Tue Nov 15 14:09:53 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 70BDF106566B; Tue, 15 Nov 2011 14:09:53 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 60C678FC15; Tue, 15 Nov 2011 14:09:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAFE9rSp003631; Tue, 15 Nov 2011 14:09:53 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAFE9r2W003629; Tue, 15 Nov 2011 14:09:53 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201111151409.pAFE9r2W003629@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 15 Nov 2011 14:09:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227529 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Nov 2011 14:09:53 -0000 Author: kib Date: Tue Nov 15 14:09:53 2011 New Revision: 227529 URL: http://svn.freebsd.org/changeset/base/227529 Log: Remove the condition that is always true. Submitted by: alc MFC after: 1 week Modified: head/sys/vm/vm_pager.c Modified: head/sys/vm/vm_pager.c ============================================================================== --- head/sys/vm/vm_pager.c Tue Nov 15 12:59:07 2011 (r227528) +++ head/sys/vm/vm_pager.c Tue Nov 15 14:09:53 2011 (r227529) @@ -188,7 +188,7 @@ vm_pager_init() * Initialize known pagers */ for (pgops = pagertab; pgops < &pagertab[npagers]; pgops++) - if (pgops && ((*pgops)->pgo_init != NULL)) + if ((*pgops)->pgo_init != NULL) (*(*pgops)->pgo_init) (); } From owner-svn-src-all@FreeBSD.ORG Tue Nov 15 14:40:01 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1FEDA106566C; Tue, 15 Nov 2011 14:40:01 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 07F3D8FC12; Tue, 15 Nov 2011 14:40:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAFEe0DK004640; Tue, 15 Nov 2011 14:40:00 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAFEe0xJ004636; Tue, 15 Nov 2011 14:40:00 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201111151440.pAFEe0xJ004636@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 15 Nov 2011 14:40:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227530 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Nov 2011 14:40:01 -0000 Author: kib Date: Tue Nov 15 14:40:00 2011 New Revision: 227530 URL: http://svn.freebsd.org/changeset/base/227530 Log: Update the device pager interface, while keeping the compatibility layer for old KPI and KBI. New interface should be used together with d_mmap_single cdevsw method. Device pager can be allocated with the cdev_pager_allocate(9) function, which takes struct cdev_pager_ops, containing constructor/destructor and page fault handler methods supplied by driver. Constructor and destructor, called at the pager allocation and deallocation time, allow the driver to handle per-object private data. The pager handler is called to handle page fault on the vm map entry backed by the driver pager. Driver shall return either the vm_page_t which should be mapped, or error code (which does not cause kernel panic anymore). The page handler interface has a placeholder to specify the access mode causing the fault, but currently PROT_READ is always passed there. Sponsored by: The FreeBSD Foundation Reviewed by: alc MFC after: 1 month Modified: head/sys/vm/device_pager.c head/sys/vm/vm_object.h head/sys/vm/vm_pager.h Modified: head/sys/vm/device_pager.c ============================================================================== --- head/sys/vm/device_pager.c Tue Nov 15 14:09:53 2011 (r227529) +++ head/sys/vm/device_pager.c Tue Nov 15 14:40:00 2011 (r227530) @@ -76,6 +76,18 @@ struct pagerops devicepagerops = { .pgo_haspage = dev_pager_haspage, }; +static int old_dev_pager_ctor(void *handle, vm_ooffset_t size, vm_prot_t prot, + vm_ooffset_t foff, struct ucred *cred, u_short *color); +static void old_dev_pager_dtor(void *handle); +static int old_dev_pager_fault(vm_object_t object, vm_ooffset_t offset, + int prot, vm_page_t *mres); + +static struct cdev_pager_ops old_dev_pager_ops = { + .cdev_pg_ctor = old_dev_pager_ctor, + .cdev_pg_dtor = old_dev_pager_dtor, + .cdev_pg_fault = old_dev_pager_fault +}; + static void dev_pager_init() { @@ -83,22 +95,28 @@ dev_pager_init() mtx_init(&dev_pager_mtx, "dev_pager list", NULL, MTX_DEF); } -/* - * MPSAFE - */ -static vm_object_t -dev_pager_alloc(void *handle, vm_ooffset_t size, vm_prot_t prot, - vm_ooffset_t foff, struct ucred *cred) +vm_object_t +cdev_pager_lookup(void *handle) +{ + vm_object_t object; + + mtx_lock(&dev_pager_mtx); + object = vm_pager_object_lookup(&dev_pager_object_list, handle); + vm_object_reference(object); + mtx_unlock(&dev_pager_mtx); + return (object); +} + +vm_object_t +cdev_pager_allocate(void *handle, enum obj_type tp, struct cdev_pager_ops *ops, + vm_ooffset_t size, vm_prot_t prot, vm_ooffset_t foff, struct ucred *cred) { - struct cdev *dev; vm_object_t object, object1; vm_pindex_t pindex; - unsigned int npages; - vm_paddr_t paddr; - vm_ooffset_t off; - vm_memattr_t dummy; - struct cdevsw *csw; - int ref; + u_short color; + + if (tp != OBJT_DEVICE) + return (NULL); /* * Offset should be page aligned. @@ -109,27 +127,8 @@ dev_pager_alloc(void *handle, vm_ooffset size = round_page(size); pindex = OFF_TO_IDX(foff + size); - /* - * Make sure this device can be mapped. - */ - dev = handle; - csw = dev_refthread(dev, &ref); - if (csw == NULL) + if (ops->cdev_pg_ctor(handle, size, prot, foff, cred, &color) != 0) return (NULL); - - /* - * Check that the specified range of the device allows the desired - * protection. - * - * XXX assumes VM_PROT_* == PROT_* - */ - npages = OFF_TO_IDX(size); - for (off = foff; npages--; off += PAGE_SIZE) - if (csw->d_mmap(dev, off, &paddr, (int)prot, &dummy) != 0) { - dev_relthread(dev, ref); - return (NULL); - } - mtx_lock(&dev_pager_mtx); /* @@ -144,9 +143,11 @@ dev_pager_alloc(void *handle, vm_ooffset * device's memory. */ mtx_unlock(&dev_pager_mtx); - object1 = vm_object_allocate(OBJT_DEVICE, pindex); + object1 = vm_object_allocate(tp, pindex); object1->flags |= OBJ_COLORED; - object1->pg_color = atop(paddr) - OFF_TO_IDX(off - PAGE_SIZE); + object1->pg_color = color; + object1->handle = handle; + object1->un_pager.devp.ops = ops; TAILQ_INIT(&object1->un_pager.devp.devp_pglist); mtx_lock(&dev_pager_mtx); object = vm_pager_object_lookup(&dev_pager_object_list, handle); @@ -162,13 +163,14 @@ dev_pager_alloc(void *handle, vm_ooffset object->handle = handle; TAILQ_INSERT_TAIL(&dev_pager_object_list, object, pager_object_list); + KASSERT(object->type == tp, + ("Inconsistent device pager type %p %d", object, tp)); } } else { if (pindex > object->size) object->size = pindex; } mtx_unlock(&dev_pager_mtx); - dev_relthread(dev, ref); if (object1 != NULL) { object1->handle = object1; mtx_lock(&dev_pager_mtx); @@ -180,6 +182,24 @@ dev_pager_alloc(void *handle, vm_ooffset return (object); } +static vm_object_t +dev_pager_alloc(void *handle, vm_ooffset_t size, vm_prot_t prot, + vm_ooffset_t foff, struct ucred *cred) +{ + + return (cdev_pager_allocate(handle, OBJT_DEVICE, &old_dev_pager_ops, + size, prot, foff, cred)); +} + +void +cdev_pager_free_page(vm_object_t object, vm_page_t m) +{ + + VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); + TAILQ_REMOVE(&object->un_pager.devp.devp_pglist, m, pageq); + vm_page_putfake(m); +} + static void dev_pager_dealloc(object) vm_object_t object; @@ -187,6 +207,8 @@ dev_pager_dealloc(object) vm_page_t m; VM_OBJECT_UNLOCK(object); + object->un_pager.devp.ops->cdev_pg_dtor(object->handle); + mtx_lock(&dev_pager_mtx); TAILQ_REMOVE(&dev_pager_object_list, object, pager_object_list); mtx_unlock(&dev_pager_mtx); @@ -194,35 +216,57 @@ dev_pager_dealloc(object) /* * Free up our fake pages. */ - while ((m = TAILQ_FIRST(&object->un_pager.devp.devp_pglist)) != NULL) { - TAILQ_REMOVE(&object->un_pager.devp.devp_pglist, m, pageq); - vm_page_putfake(m); + while ((m = TAILQ_FIRST(&object->un_pager.devp.devp_pglist)) != NULL) + cdev_pager_free_page(object, m); +} + +static int +dev_pager_getpages(vm_object_t object, vm_page_t *ma, int count, int reqpage) +{ + int error, i; + + VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); + error = object->un_pager.devp.ops->cdev_pg_fault(object, + IDX_TO_OFF(ma[reqpage]->pindex), PROT_READ, &ma[reqpage]); + + VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); + + for (i = 0; i < count; i++) { + if (i != reqpage) { + vm_page_lock(ma[i]); + vm_page_free(ma[i]); + vm_page_unlock(ma[i]); + } + } + + if (error == VM_PAGER_OK) { + TAILQ_INSERT_TAIL(&object->un_pager.devp.devp_pglist, + ma[reqpage], pageq); } + + return (error); } static int -dev_pager_getpages(object, m, count, reqpage) - vm_object_t object; - vm_page_t *m; - int count; - int reqpage; +old_dev_pager_fault(vm_object_t object, vm_ooffset_t offset, int prot, + vm_page_t *mres) { - vm_pindex_t offset; + vm_pindex_t pidx; vm_paddr_t paddr; vm_page_t m_paddr, page; - vm_memattr_t memattr; struct cdev *dev; - int i, ref, ret; struct cdevsw *csw; - struct thread *td; struct file *fpop; + struct thread *td; + vm_memattr_t memattr; + int ref, ret; - VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); - dev = object->handle; - page = m[reqpage]; - offset = page->pindex; + pidx = OFF_TO_IDX(offset); memattr = object->memattr; + VM_OBJECT_UNLOCK(object); + + dev = object->handle; csw = dev_refthread(dev, &ref); if (csw == NULL) { VM_OBJECT_LOCK(object); @@ -231,11 +275,16 @@ dev_pager_getpages(object, m, count, req td = curthread; fpop = td->td_fpop; td->td_fpop = NULL; - ret = csw->d_mmap(dev, (vm_ooffset_t)offset << PAGE_SHIFT, &paddr, - PROT_READ, &memattr); - KASSERT(ret == 0, ("dev_pager_getpage: map function returns error")); + ret = csw->d_mmap(dev, offset, &paddr, prot, &memattr); td->td_fpop = fpop; dev_relthread(dev, ref); + if (ret != 0) { + printf( + "WARNING: dev_pager_getpage: map function returns error %d", ret); + VM_OBJECT_LOCK(object); + return (VM_PAGER_FAIL); + } + /* If "paddr" is a real page, perform a sanity check on "memattr". */ if ((m_paddr = vm_phys_paddr_to_vm_page(paddr)) != NULL && pmap_page_get_memattr(m_paddr) != memattr) { @@ -243,23 +292,14 @@ dev_pager_getpages(object, m, count, req printf( "WARNING: A device driver has set \"memattr\" inconsistently.\n"); } - if ((page->flags & PG_FICTITIOUS) != 0) { + if (((*mres)->flags & PG_FICTITIOUS) != 0) { /* - * If the passed in reqpage page is a fake page, update it with + * If the passed in result page is a fake page, update it with * the new physical address. */ + page = *mres; VM_OBJECT_LOCK(object); vm_page_updatefake(page, paddr, memattr); - if (count > 1) { - - for (i = 0; i < count; i++) { - if (i != reqpage) { - vm_page_lock(m[i]); - vm_page_free(m[i]); - vm_page_unlock(m[i]); - } - } - } } else { /* * Replace the passed in reqpage page with our own fake page and @@ -267,14 +307,11 @@ dev_pager_getpages(object, m, count, req */ page = vm_page_getfake(paddr, memattr); VM_OBJECT_LOCK(object); - TAILQ_INSERT_TAIL(&object->un_pager.devp.devp_pglist, page, pageq); - for (i = 0; i < count; i++) { - vm_page_lock(m[i]); - vm_page_free(m[i]); - vm_page_unlock(m[i]); - } - vm_page_insert(page, object, offset); - m[reqpage] = page; + vm_page_lock(*mres); + vm_page_free(*mres); + vm_page_unlock(*mres); + *mres = page; + vm_page_insert(page, object, pidx); } page->valid = VM_PAGE_BITS_ALL; return (VM_PAGER_OK); @@ -288,6 +325,7 @@ dev_pager_putpages(object, m, count, syn boolean_t sync; int *rtvals; { + panic("dev_pager_putpage called"); } @@ -304,3 +342,50 @@ dev_pager_haspage(object, pindex, before *after = 0; return (TRUE); } + +static int +old_dev_pager_ctor(void *handle, vm_ooffset_t size, vm_prot_t prot, + vm_ooffset_t foff, struct ucred *cred, u_short *color) +{ + struct cdev *dev; + struct cdevsw *csw; + vm_memattr_t dummy; + vm_ooffset_t off; + vm_paddr_t paddr; + unsigned int npages; + int ref; + + /* + * Make sure this device can be mapped. + */ + dev = handle; + csw = dev_refthread(dev, &ref); + if (csw == NULL) + return (ENXIO); + + /* + * Check that the specified range of the device allows the desired + * protection. + * + * XXX assumes VM_PROT_* == PROT_* + */ + npages = OFF_TO_IDX(size); + for (off = foff; npages--; off += PAGE_SIZE) { + if (csw->d_mmap(dev, off, &paddr, (int)prot, &dummy) != 0) { + dev_relthread(dev, ref); + return (EINVAL); + } + } + + dev_ref(dev); + dev_relthread(dev, ref); + *color = atop(paddr) - OFF_TO_IDX(off - PAGE_SIZE); + return (0); +} + +static void +old_dev_pager_dtor(void *handle) +{ + + dev_rel(handle); +} Modified: head/sys/vm/vm_object.h ============================================================================== --- head/sys/vm/vm_object.h Tue Nov 15 14:09:53 2011 (r227529) +++ head/sys/vm/vm_object.h Tue Nov 15 14:40:00 2011 (r227530) @@ -121,6 +121,7 @@ struct vm_object { */ struct { TAILQ_HEAD(, vm_page) devp_pglist; + struct cdev_pager_ops *ops; } devp; /* Modified: head/sys/vm/vm_pager.h ============================================================================== --- head/sys/vm/vm_pager.h Tue Nov 15 14:09:53 2011 (r227529) +++ head/sys/vm/vm_pager.h Tue Nov 15 14:40:00 2011 (r227530) @@ -192,5 +192,19 @@ vm_pager_page_unswapped(vm_page_t m) (*pagertab[m->object->type]->pgo_pageunswapped)(m); } +struct cdev_pager_ops { + int (*cdev_pg_fault)(vm_object_t vm_obj, vm_ooffset_t offset, + int prot, vm_page_t *mres); + int (*cdev_pg_ctor)(void *handle, vm_ooffset_t size, vm_prot_t prot, + vm_ooffset_t foff, struct ucred *cred, u_short *color); + void (*cdev_pg_dtor)(void *handle); +}; + +vm_object_t cdev_pager_allocate(void *handle, enum obj_type tp, + struct cdev_pager_ops *ops, vm_ooffset_t size, vm_prot_t prot, + vm_ooffset_t foff, struct ucred *cred); +vm_object_t cdev_pager_lookup(void *handle); +void cdev_pager_free_page(vm_object_t object, vm_page_t m); + #endif /* _KERNEL */ #endif /* _VM_PAGER_ */ From owner-svn-src-all@FreeBSD.ORG Tue Nov 15 16:20:39 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BDF86106566C; Tue, 15 Nov 2011 16:20:39 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ADE938FC1C; Tue, 15 Nov 2011 16:20:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAFGKdGu007754; Tue, 15 Nov 2011 16:20:39 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAFGKd2g007752; Tue, 15 Nov 2011 16:20:39 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201111151620.pAFGKd2g007752@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Tue, 15 Nov 2011 16:20:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227531 - head/rescue/rescue X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Nov 2011 16:20:39 -0000 Author: des Date: Tue Nov 15 16:20:39 2011 New Revision: 227531 URL: http://svn.freebsd.org/changeset/base/227531 Log: Add netcat (nc) to /rescue. MFC after: 3 weeks Modified: head/rescue/rescue/Makefile Modified: head/rescue/rescue/Makefile ============================================================================== --- head/rescue/rescue/Makefile Tue Nov 15 14:40:00 2011 (r227530) +++ head/rescue/rescue/Makefile Tue Nov 15 16:20:39 2011 (r227531) @@ -181,7 +181,7 @@ CRUNCH_BUILDOPTS_dhclient= -DRELEASE_CRU # CRUNCH_SRCDIRS+= usr.bin -CRUNCH_PROGS_usr.bin= head mt sed tail tee +CRUNCH_PROGS_usr.bin= head mt nc sed tail tee CRUNCH_PROGS_usr.bin+= gzip CRUNCH_ALIAS_gzip= gunzip gzcat zcat From owner-svn-src-all@FreeBSD.ORG Tue Nov 15 17:15:09 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BF57B1065675; Tue, 15 Nov 2011 17:15:09 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AF1BF8FC20; Tue, 15 Nov 2011 17:15:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAFHF9n1009451; Tue, 15 Nov 2011 17:15:09 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAFHF9me009449; Tue, 15 Nov 2011 17:15:09 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201111151715.pAFHF9me009449@svn.freebsd.org> From: Eitan Adler Date: Tue, 15 Nov 2011 17:15:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227532 - head/sys/dev/sio X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Nov 2011 17:15:09 -0000 Author: eadler (ports committer) Date: Tue Nov 15 17:15:09 2011 New Revision: 227532 URL: http://svn.freebsd.org/changeset/base/227532 Log: - add support for Broadcom 802.11bg/EDGE/GPRS CardBus (Serial) - correct mislabeling of 0x432214e4 device PR: kern/119606 Submitted by: Joe Greco Approved by: jhb MFC after: 1 week Modified: head/sys/dev/sio/sio_pci.c Modified: head/sys/dev/sio/sio_pci.c ============================================================================== --- head/sys/dev/sio/sio_pci.c Tue Nov 15 16:20:39 2011 (r227531) +++ head/sys/dev/sio/sio_pci.c Tue Nov 15 17:15:09 2011 (r227532) @@ -76,7 +76,8 @@ static struct pci_ids pci_ids[] = { { 0x7101135e, "SeaLevel Ultra 530.PCI Single Port Serial", 0x18 }, { 0x0000151f, "SmartLink 5634PCV SurfRider", 0x10 }, { 0x0103115d, "Xircom Cardbus modem", 0x10 }, - { 0x432214e4, "Broadcom 802.11g/GPRS CardBus (Serial)", 0x10 }, + { 0x432214e4, "Broadcom 802.11b/GPRS CardBus (Serial)", 0x10 }, + { 0x434414e4, "Broadcom 802.11bg/EDGE/GPRS CardBus (Serial)", 0x10 }, { 0x01c0135c, "Quatech SSCLP-200/300", 0x18 /* * NB: You must mount the "SPAD" jumper to correctly detect From owner-svn-src-all@FreeBSD.ORG Tue Nov 15 17:30:04 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1EBB0106566C; Tue, 15 Nov 2011 17:30:04 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 08A428FC15; Tue, 15 Nov 2011 17:30:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAFHU3jr009963; Tue, 15 Nov 2011 17:30:03 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAFHU3ij009961; Tue, 15 Nov 2011 17:30:03 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201111151730.pAFHU3ij009961@svn.freebsd.org> From: Xin LI Date: Tue, 15 Nov 2011 17:30:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227533 - stable/9/sys/dev/mfi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Nov 2011 17:30:04 -0000 Author: delphij Date: Tue Nov 15 17:30:03 2011 New Revision: 227533 URL: http://svn.freebsd.org/changeset/base/227533 Log: MFC r227409: Do a dummy read to flush the interrupt ACK that we just performed, ensuring that everything is really, truly consistent. This fixes certain cases where one will see various: mfi0: COMMAND 0xffffffXXXXXXXXXX TIMEOUT AFTER XX SECONDS Submitted by: scottl Ok'ed by: jhb Approved by: re (kib) Modified: stable/9/sys/dev/mfi/mfi.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/dev/mfi/mfi.c ============================================================================== --- stable/9/sys/dev/mfi/mfi.c Tue Nov 15 17:15:09 2011 (r227532) +++ stable/9/sys/dev/mfi/mfi.c Tue Nov 15 17:30:03 2011 (r227533) @@ -932,6 +932,12 @@ mfi_intr(void *arg) if (sc->mfi_check_clear_intr(sc)) return; + /* + * Do a dummy read to flush the interrupt ACK that we just performed, + * ensuring that everything is really, truly consistent. + */ + (void)sc->mfi_read_fw_status(sc); + pi = sc->mfi_comms->hw_pi; ci = sc->mfi_comms->hw_ci; mtx_lock(&sc->mfi_io_lock); From owner-svn-src-all@FreeBSD.ORG Tue Nov 15 17:42:00 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E464106564A; Tue, 15 Nov 2011 17:42:00 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7DDC58FC14; Tue, 15 Nov 2011 17:42:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAFHg0kR010340; Tue, 15 Nov 2011 17:42:00 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAFHg0UF010337; Tue, 15 Nov 2011 17:42:00 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201111151742.pAFHg0UF010337@svn.freebsd.org> From: Xin LI Date: Tue, 15 Nov 2011 17:42:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227534 - releng/9.0/sys/dev/mfi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Nov 2011 17:42:00 -0000 Author: delphij Date: Tue Nov 15 17:42:00 2011 New Revision: 227534 URL: http://svn.freebsd.org/changeset/base/227534 Log: MFC r227409: Do a dummy read to flush the interrupt ACK that we just performed, ensuring that everything is really, truly consistent. This fixes certain cases where one will see various: mfi0: COMMAND 0xffffffXXXXXXXXXX TIMEOUT AFTER XX SECONDS Submitted by: scottl Ok'ed by: jhb Approved by: re (kib) Modified: releng/9.0/sys/dev/mfi/mfi.c Directory Properties: releng/9.0/sys/ (props changed) Modified: releng/9.0/sys/dev/mfi/mfi.c ============================================================================== --- releng/9.0/sys/dev/mfi/mfi.c Tue Nov 15 17:30:03 2011 (r227533) +++ releng/9.0/sys/dev/mfi/mfi.c Tue Nov 15 17:42:00 2011 (r227534) @@ -932,6 +932,12 @@ mfi_intr(void *arg) if (sc->mfi_check_clear_intr(sc)) return; + /* + * Do a dummy read to flush the interrupt ACK that we just performed, + * ensuring that everything is really, truly consistent. + */ + (void)sc->mfi_read_fw_status(sc); + pi = sc->mfi_comms->hw_pi; ci = sc->mfi_comms->hw_ci; mtx_lock(&sc->mfi_io_lock); From owner-svn-src-all@FreeBSD.ORG Tue Nov 15 17:53:29 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA6D7106564A; Tue, 15 Nov 2011 17:53:29 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DA1F78FC18; Tue, 15 Nov 2011 17:53:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAFHrTsk010773; Tue, 15 Nov 2011 17:53:29 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAFHrTn5010771; Tue, 15 Nov 2011 17:53:29 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201111151753.pAFHrTn5010771@svn.freebsd.org> From: Eitan Adler Date: Tue, 15 Nov 2011 17:53:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227535 - head/sys/dev/puc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Nov 2011 17:53:30 -0000 Author: eadler (ports committer) Date: Tue Nov 15 17:53:29 2011 New Revision: 227535 URL: http://svn.freebsd.org/changeset/base/227535 Log: - add support for Titan VScom PCIex-800H PR: kern/124128 Submitted by: Maxim Frolov (original) Approved by: jhb MFC after: 1 week Modified: head/sys/dev/puc/pucdata.c Modified: head/sys/dev/puc/pucdata.c ============================================================================== --- head/sys/dev/puc/pucdata.c Tue Nov 15 17:42:00 2011 (r227534) +++ head/sys/dev/puc/pucdata.c Tue Nov 15 17:53:29 2011 (r227535) @@ -864,6 +864,18 @@ const struct puc_cfg puc_pci_devices[] = PUC_PORT_2S, 0x10, 4, 0, }, + { 0x14d2, 0xa007, 0xffff, 0, + "Titan VScom PCIex-800H", + DEFAULT_RCLK * 8, + PUC_PORT_4S, 0x10, 0, 8, + }, + + { 0x14d2, 0xa008, 0xffff, 0, + "Titan VScom PCIex-800H", + DEFAULT_RCLK * 8, + PUC_PORT_4S, 0x10, 0, 8, + }, + { 0x14db, 0x2130, 0xffff, 0, "Avlab Technology, PCI IO 2S", DEFAULT_RCLK, From owner-svn-src-all@FreeBSD.ORG Tue Nov 15 18:49:27 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B77F51065670; Tue, 15 Nov 2011 18:49:27 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A69D28FC13; Tue, 15 Nov 2011 18:49:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAFInRIo012612; Tue, 15 Nov 2011 18:49:27 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAFInR3K012609; Tue, 15 Nov 2011 18:49:27 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201111151849.pAFInR3K012609@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 15 Nov 2011 18:49:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227536 - in head: release share/man/man7 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Nov 2011 18:49:27 -0000 Author: nwhitehorn Date: Tue Nov 15 18:49:27 2011 New Revision: 227536 URL: http://svn.freebsd.org/changeset/base/227536 Log: Further automate production release generation by naming files the right things and generating checksums. MFC after: 1 week Modified: head/release/generate-release.sh head/share/man/man7/release.7 Modified: head/release/generate-release.sh ============================================================================== --- head/release/generate-release.sh Tue Nov 15 17:53:29 2011 (r227535) +++ head/release/generate-release.sh Tue Nov 15 18:49:27 2011 (r227536) @@ -14,6 +14,7 @@ # SVNROOT: SVN URL to FreeBSD source repository (by default, # svn://svn.freebsd.org/base) # MAKE_FLAGS: optional flags to pass to make (e.g. -j) +# RELSTRING: optional base name for media images (e.g. FreeBSD-9.0-RC2-amd64) # # Note: Since this requires a chroot, release cross-builds will not work! # @@ -65,3 +66,12 @@ chroot $2 make -C /usr/src $MAKE_FLAGS b chroot $2 make -C /usr/src/release release chroot $2 make -C /usr/src/release install DESTDIR=/R +: ${RELSTRING=`chroot $2 uname -s`-`chroot $2 uname -r`-`chroot $2 uname -p`} + +cd $2/R +for i in release.iso bootonly.iso memstick; do + mv $i $RELSTRING-$i +done +sha256 $RELSTRING-* > CHECKSUM.SHA256 +md5 $RELSTRING-* > CHECKSUM.MD5 + Modified: head/share/man/man7/release.7 ============================================================================== --- head/share/man/man7/release.7 Tue Nov 15 17:53:29 2011 (r227535) +++ head/share/man/man7/release.7 Tue Nov 15 18:49:27 2011 (r227536) @@ -149,6 +149,11 @@ when invoked by the script. .It Ev SVNROOT The location of the FreeBSD SVN source repository. Defaults to .Pa svn://svn.freebsd.org/base . +.It Ev RELSTRING +Optional base name for generated media images (e.g. FreeBSD-9.0-RC2-amd64). +Defaults to the output of +.Ic `uname -s`-`uname -r`-`uname -p` +within the chroot. .El .Sh MAKEFILE TARGETS The release makefile From owner-svn-src-all@FreeBSD.ORG Tue Nov 15 20:11:03 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF122106566B; Tue, 15 Nov 2011 20:11:03 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9CD958FC19; Tue, 15 Nov 2011 20:11:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAFKB3qv015153; Tue, 15 Nov 2011 20:11:03 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAFKB3e1015145; Tue, 15 Nov 2011 20:11:03 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201111152011.pAFKB3e1015145@svn.freebsd.org> From: Marius Strobl Date: Tue, 15 Nov 2011 20:11:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227537 - in head: share/man/man9 sys/dev/ofw sys/kern sys/powerpc/powerpc sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Nov 2011 20:11:03 -0000 Author: marius Date: Tue Nov 15 20:11:03 2011 New Revision: 227537 URL: http://svn.freebsd.org/changeset/base/227537 Log: As it turns out, r186347 actually is insufficient to avoid the use of the curthread-accessing part of mtx_{,un}lock(9) when using a r210623-style curthread implementation on sparc64, crashing the kernel in its early cycles as PCPU isn't set up, yet (and can't be set up as OFW is one of the things we need for that, which leads to a chicken-and-egg problem). What happens is that due to the fact that the idea of r210623 actually is to allow the compiler to cache invocations of curthread, it factors out obtaining curthread needed for both mtx_lock(9) and mtx_unlock(9) to before the branch based on kobj_mutex_inited when compiling the kernel without the debugging options. So change kobj_class_compile_static(9) to just never acquire kobj_mtx, effectively restricting it to its documented use, and add a kobj_init_static(9) for initializing objects using a class compiled with the former and that also avoids using mutex(9) (and malloc(9)). Also assert in both of these functions that they are used in their intended way only. While at it, inline kobj_register_method() and kobj_unregister_method() as there wasn't much point for factoring them out in the first place and so that a reader of the code has to figure out the locking for fewer functions missing a KOBJ_ASSERT. Tested on powerpc{,64} by andreast. Reviewed by: nwhitehorn (earlier version), jhb MFC after: 3 days Modified: head/share/man/man9/Makefile head/share/man/man9/kobj.9 head/sys/dev/ofw/openfirm.c head/sys/kern/subr_kobj.c head/sys/powerpc/powerpc/platform.c head/sys/powerpc/powerpc/pmap_dispatch.c head/sys/sys/kobj.h Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Tue Nov 15 18:49:27 2011 (r227536) +++ head/share/man/man9/Makefile Tue Nov 15 20:11:03 2011 (r227537) @@ -724,7 +724,8 @@ MLINKS+=kobj.9 DEFINE_CLASS.9 \ kobj.9 kobj_class_free.9 \ kobj.9 kobj_create.9 \ kobj.9 kobj_delete.9 \ - kobj.9 kobj_init.9 + kobj.9 kobj_init.9 \ + kobj.9 kobj_init_static.9 MLINKS+=kproc.9 kproc_create.9 \ kproc.9 kproc_exit.9 \ kproc.9 kproc_resume.9 \ Modified: head/share/man/man9/kobj.9 ============================================================================== --- head/share/man/man9/kobj.9 Tue Nov 15 18:49:27 2011 (r227536) +++ head/share/man/man9/kobj.9 Tue Nov 15 20:11:03 2011 (r227537) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 4, 2000 +.Dd November 14, 2011 .Dt KOBJ 9 .Os .Sh NAME @@ -48,6 +48,8 @@ .Ft void .Fn kobj_init "kobj_t obj" "kobj_class_t cls" .Ft void +.Fn kobj_init_static "kobj_t obj" "kobj_class_t cls" +.Ft void .Fn kobj_delete "kobj_t obj" "struct malloc_type *mtype" .Fn DEFINE_CLASS name "kobj_method_t *methods" "size_t size" .Sh DESCRIPTION @@ -88,10 +90,14 @@ Objects created in this way should be fr Clients which would like to manage the allocation of memory themselves should call .Fn kobj_init +or +.Fn kobj_init_static with a pointer to the memory for the object and the class which implements it. It is also possible to use .Fn kobj_init +and +.Fn kobj_init_static to change the class for an object. This should be done with care as the classes must agree on the layout of the object. @@ -109,13 +115,19 @@ A client should not normally need to cal will automatically be compiled the first time it is used. If a class is to be used before .Xr malloc 9 -is initialised, +and +.Xr mutex 9 +are initialised, then .Fn kobj_class_compile_static should be called with the class and a pointer to a statically allocated .Vt kobj_ops structure before the class is used to initialise any objects. +In that case, also +.Fn kobj_init_static +should be used instead of +.Fn kobj_init . .Pp To define a class, first define a simple array of .Vt kobj_method_t . Modified: head/sys/dev/ofw/openfirm.c ============================================================================== --- head/sys/dev/ofw/openfirm.c Tue Nov 15 18:49:27 2011 (r227536) +++ head/sys/dev/ofw/openfirm.c Tue Nov 15 20:11:03 2011 (r227537) @@ -127,7 +127,7 @@ OF_init(void *cookie) * then statically initialize the OFW object. */ kobj_class_compile_static(ofw_def_impl, &ofw_kernel_kops); - kobj_init((kobj_t)ofw_obj, ofw_def_impl); + kobj_init_static((kobj_t)ofw_obj, ofw_def_impl); rv = OFW_INIT(ofw_obj, cookie); Modified: head/sys/kern/subr_kobj.c ============================================================================== --- head/sys/kern/subr_kobj.c Tue Nov 15 18:49:27 2011 (r227536) +++ head/sys/kern/subr_kobj.c Tue Nov 15 20:11:03 2011 (r227537) @@ -60,18 +60,9 @@ static struct mtx kobj_mtx; static int kobj_mutex_inited; static int kobj_next_id = 1; -/* - * In the event that kobj_mtx has not been initialized yet, - * we will ignore it, and run without locks in order to support - * use of KOBJ before mutexes are available. This early in the boot - * process, everything is single threaded and so races should not - * happen. This is used to provide the PMAP layer on PowerPC, as well - * as board support. - */ - -#define KOBJ_LOCK() if (kobj_mutex_inited) mtx_lock(&kobj_mtx); -#define KOBJ_UNLOCK() if (kobj_mutex_inited) mtx_unlock(&kobj_mtx); -#define KOBJ_ASSERT(what) if (kobj_mutex_inited) mtx_assert(&kobj_mtx,what); +#define KOBJ_LOCK() mtx_lock(&kobj_mtx) +#define KOBJ_UNLOCK() mtx_unlock(&kobj_mtx) +#define KOBJ_ASSERT(what) mtx_assert(&kobj_mtx, what); SYSCTL_INT(_kern, OID_AUTO, kobj_methodcount, CTLFLAG_RD, &kobj_next_id, 0, ""); @@ -104,28 +95,11 @@ kobj_error_method(void) } static void -kobj_register_method(struct kobjop_desc *desc) -{ - KOBJ_ASSERT(MA_OWNED); - - if (desc->id == 0) { - desc->id = kobj_next_id++; - } -} - -static void -kobj_unregister_method(struct kobjop_desc *desc) -{ -} - -static void kobj_class_compile_common(kobj_class_t cls, kobj_ops_t ops) { kobj_method_t *m; int i; - KOBJ_ASSERT(MA_OWNED); - /* * Don't do anything if we are already compiled. */ @@ -135,8 +109,10 @@ kobj_class_compile_common(kobj_class_t c /* * First register any methods which need it. */ - for (i = 0, m = cls->methods; m->desc; i++, m++) - kobj_register_method(m->desc); + for (i = 0, m = cls->methods; m->desc; i++, m++) { + if (m->desc->id == 0) + m->desc->id = kobj_next_id++; + } /* * Then initialise the ops table. @@ -159,7 +135,7 @@ kobj_class_compile(kobj_class_t cls) */ ops = malloc(sizeof(struct kobj_ops), M_KOBJ, M_NOWAIT); if (!ops) - panic("kobj_compile_methods: out of memory"); + panic("%s: out of memory", __func__); KOBJ_LOCK(); @@ -182,17 +158,14 @@ void kobj_class_compile_static(kobj_class_t cls, kobj_ops_t ops) { - KOBJ_ASSERT(MA_NOTOWNED); + KASSERT(kobj_mutex_inited == 0, + ("%s: only supported during early cycles", __func__)); /* * Increment refs to make sure that the ops table is not freed. */ - KOBJ_LOCK(); - cls->refs++; kobj_class_compile_common(cls, ops); - - KOBJ_UNLOCK(); } static kobj_method_t* @@ -259,8 +232,6 @@ kobj_lookup_method(kobj_class_t cls, void kobj_class_free(kobj_class_t cls) { - int i; - kobj_method_t *m; void* ops = NULL; KOBJ_ASSERT(MA_NOTOWNED); @@ -272,10 +243,9 @@ kobj_class_free(kobj_class_t cls) */ if (cls->refs == 0) { /* - * Unregister any methods which are no longer used. + * For now we don't do anything to unregister any methods + * which are no longer used. */ - for (i = 0, m = cls->methods; m->desc; i++, m++) - kobj_unregister_method(m->desc); /* * Free memory and clean up. @@ -308,6 +278,14 @@ kobj_create(kobj_class_t cls, return obj; } +static void +kobj_init_common(kobj_t obj, kobj_class_t cls) +{ + + obj->ops = cls->ops; + cls->refs++; +} + void kobj_init(kobj_t obj, kobj_class_t cls) { @@ -329,13 +307,22 @@ kobj_init(kobj_t obj, kobj_class_t cls) goto retry; } - obj->ops = cls->ops; - cls->refs++; + kobj_init_common(obj, cls); KOBJ_UNLOCK(); } void +kobj_init_static(kobj_t obj, kobj_class_t cls) +{ + + KASSERT(kobj_mutex_inited == 0, + ("%s: only supported during early cycles", __func__)); + + kobj_init_common(obj, cls); +} + +void kobj_delete(kobj_t obj, struct malloc_type *mtype) { kobj_class_t cls = obj->ops->cls; Modified: head/sys/powerpc/powerpc/platform.c ============================================================================== --- head/sys/powerpc/powerpc/platform.c Tue Nov 15 18:49:27 2011 (r227536) +++ head/sys/powerpc/powerpc/platform.c Tue Nov 15 20:11:03 2011 (r227537) @@ -184,7 +184,7 @@ platform_probe_and_attach() * then statically initialise the MMU object */ kobj_class_compile_static(platp, &plat_kernel_kops); - kobj_init((kobj_t)plat_obj, platp); + kobj_init_static((kobj_t)plat_obj, platp); prio = PLATFORM_PROBE(plat_obj); @@ -223,7 +223,7 @@ platform_probe_and_attach() */ kobj_class_compile_static(plat_def_impl, &plat_kernel_kops); - kobj_init((kobj_t)plat_obj, plat_def_impl); + kobj_init_static((kobj_t)plat_obj, plat_def_impl); strlcpy(plat_name,plat_def_impl->name,sizeof(plat_name)); Modified: head/sys/powerpc/powerpc/pmap_dispatch.c ============================================================================== --- head/sys/powerpc/powerpc/pmap_dispatch.c Tue Nov 15 18:49:27 2011 (r227536) +++ head/sys/powerpc/powerpc/pmap_dispatch.c Tue Nov 15 20:11:03 2011 (r227537) @@ -410,7 +410,7 @@ pmap_bootstrap(vm_offset_t start, vm_off * then statically initialise the MMU object */ kobj_class_compile_static(mmu_def_impl, &mmu_kernel_kops); - kobj_init((kobj_t)mmu_obj, mmu_def_impl); + kobj_init_static((kobj_t)mmu_obj, mmu_def_impl); MMU_BOOTSTRAP(mmu_obj, start, end); } Modified: head/sys/sys/kobj.h ============================================================================== --- head/sys/sys/kobj.h Tue Nov 15 18:49:27 2011 (r227536) +++ head/sys/sys/kobj.h Tue Nov 15 20:11:03 2011 (r227537) @@ -201,6 +201,7 @@ kobj_t kobj_create(kobj_class_t cls, * Initialise a pre-allocated object. */ void kobj_init(kobj_t obj, kobj_class_t cls); +void kobj_init_static(kobj_t obj, kobj_class_t cls); /* * Delete an object. If mtype is non-zero, free the memory. From owner-svn-src-all@FreeBSD.ORG Tue Nov 15 20:15:59 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 292D71065670; Tue, 15 Nov 2011 20:15:59 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0EA6E8FC13; Tue, 15 Nov 2011 20:15:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAFKFwxm015334; Tue, 15 Nov 2011 20:15:58 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAFKFwqb015331; Tue, 15 Nov 2011 20:15:58 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201111152015.pAFKFwqb015331@svn.freebsd.org> From: Dimitry Andric Date: Tue, 15 Nov 2011 20:15:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227538 - head/tools/build X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Nov 2011 20:15:59 -0000 Author: dim Date: Tue Nov 15 20:15:58 2011 New Revision: 227538 URL: http://svn.freebsd.org/changeset/base/227538 Log: LLVM uses atomic operations, which are not supported on i386 and GCC emits calls for them, rather than expanding them inline. Older FreeBSD versions compile for i386 by default and as such we end up with unresolved symbols when we build LLVM's TableGen utility as a build tool on them. Add the functions that GCC emits here, but don't bother to make them atomic. Such is not needed. Submitted by: marcel MFC after: 1 week Added: head/tools/build/atomic.c (contents, props changed) Modified: head/tools/build/Makefile Modified: head/tools/build/Makefile ============================================================================== --- head/tools/build/Makefile Tue Nov 15 20:11:03 2011 (r227537) +++ head/tools/build/Makefile Tue Nov 15 20:15:58 2011 (r227538) @@ -7,6 +7,10 @@ SRCS= INCSGROUPS= INCS INCS= +.if ${MACHINE_ARCH} == i386 +SRCS+= atomic.c +.endif + BOOTSTRAPPING?= 0 .if empty(SRCS) Added: head/tools/build/atomic.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/atomic.c Tue Nov 15 20:15:58 2011 (r227538) @@ -0,0 +1,56 @@ +/*- + * Copyright (c) 2011 Marcel Moolenaar + * 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$ + */ + +#include + +uint32_t __sync_add_and_fetch_4(uint32_t *, uint32_t); +uint32_t __sync_sub_and_fetch_4(uint32_t *, uint32_t); +uint32_t __sync_val_compare_and_swap_4(uint32_t *, uint32_t, uint32_t); + +uint32_t +__sync_add_and_fetch_4(uint32_t *ptr, uint32_t val) +{ + *ptr += val; + return *ptr; +} + +uint32_t +__sync_sub_and_fetch_4(uint32_t *ptr, uint32_t val) +{ + *ptr -= val; + return *ptr; +} + +uint32_t +__sync_val_compare_and_swap_4(uint32_t *ptr, uint32_t oldval, uint32_t newval) +{ + uint32_t res = *ptr; + if (res == oldval) + *ptr = newval; + return res; +} From owner-svn-src-all@FreeBSD.ORG Tue Nov 15 20:17:19 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C7F61065676; Tue, 15 Nov 2011 20:17:19 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3C96F8FC15; Tue, 15 Nov 2011 20:17:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAFKHJvY015414; Tue, 15 Nov 2011 20:17:19 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAFKHJrL015412; Tue, 15 Nov 2011 20:17:19 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201111152017.pAFKHJrL015412@svn.freebsd.org> From: Marius Strobl Date: Tue, 15 Nov 2011 20:17:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227539 - head/sys/sparc64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Nov 2011 20:17:19 -0000 Author: marius Date: Tue Nov 15 20:17:18 2011 New Revision: 227539 URL: http://svn.freebsd.org/changeset/base/227539 Log: Define curthread as an inline function that loads the thread pointer directly from g7, the pcpu pointer. This guarantees correct behavior when the thread migrates to a different CPU. Commit message stolen from r205431. Additional testing by Peter Jeremy. MFC after: 3 days Modified: head/sys/sparc64/include/pcpu.h Modified: head/sys/sparc64/include/pcpu.h ============================================================================== --- head/sys/sparc64/include/pcpu.h Tue Nov 15 20:15:58 2011 (r227538) +++ head/sys/sparc64/include/pcpu.h Tue Nov 15 20:17:18 2011 (r227539) @@ -74,6 +74,16 @@ register struct pcpu *pcpup __asm__(__XS #define PCPU_GET(member) (pcpup->pc_ ## member) +static __inline __pure2 struct thread * +__curthread(void) +{ + struct thread *td; + + __asm("ldx [%" __XSTRING(PCPU_REG) "], %0" : "=r" (td)); + return (td); +} +#define curthread (__curthread()) + /* * XXX The implementation of this operation should be made atomic * with respect to preemption. From owner-svn-src-all@FreeBSD.ORG Tue Nov 15 20:41:51 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 705CA1065691; Tue, 15 Nov 2011 20:41:51 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 46F218FC12; Tue, 15 Nov 2011 20:41:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAFKfpcG016199; Tue, 15 Nov 2011 20:41:51 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAFKfpeZ016197; Tue, 15 Nov 2011 20:41:51 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201111152041.pAFKfpeZ016197@svn.freebsd.org> From: Michael Tuexen Date: Tue, 15 Nov 2011 20:41:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227540 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Nov 2011 20:41:51 -0000 Author: tuexen Date: Tue Nov 15 20:41:50 2011 New Revision: 227540 URL: http://svn.freebsd.org/changeset/base/227540 Log: Set the MTU of an path to an approriate value if the interface MTU can't be determined. MFC after: 3 days. Modified: head/sys/netinet/sctp_pcb.c Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Tue Nov 15 20:17:18 2011 (r227539) +++ head/sys/netinet/sctp_pcb.c Tue Nov 15 20:41:50 2011 (r227540) @@ -4064,13 +4064,8 @@ sctp_add_remote_addr(struct sctp_tcb *st /* Now get the interface MTU */ if (net->ro._s_addr && net->ro._s_addr->ifn_p) { net->mtu = SCTP_GATHER_MTU_FROM_INTFC(net->ro._s_addr->ifn_p); - } else { - net->mtu = 0; } - if (net->mtu == 0) { - /* Huh ?? */ - net->mtu = SCTP_DEFAULT_MTU; - } else { + if (net->mtu > 0) { uint32_t rmtu; rmtu = SCTP_GATHER_MTU_FROM_ROUTE(net->ro._s_addr, &net->ro._l_addr.sa, net->ro.ro_rt); @@ -4090,11 +4085,31 @@ sctp_add_remote_addr(struct sctp_tcb *st net->mtu = rmtu; } } - if (from == SCTP_ALLOC_ASOC) { - stcb->asoc.smallest_mtu = net->mtu; + } + if (net->mtu == 0) { + switch (newaddr->sa_family) { +#ifdef INET + case AF_INET: + net->mtu = SCTP_DEFAULT_MTU; + break; +#endif +#ifdef INET6 + case AF_INET6: + net->mtu = 1280; + break; +#endif + default: + break; } - } else { - net->mtu = stcb->asoc.smallest_mtu; + } + if (net->port) { + net->mtu -= (uint32_t) sizeof(struct udphdr); + } + if (from == SCTP_ALLOC_ASOC) { + stcb->asoc.smallest_mtu = net->mtu; + } + if (stcb->asoc.smallest_mtu > net->mtu) { + stcb->asoc.smallest_mtu = net->mtu; } #ifdef INET6 if (newaddr->sa_family == AF_INET6) { @@ -4104,12 +4119,7 @@ sctp_add_remote_addr(struct sctp_tcb *st (void)sa6_recoverscope(sin6); } #endif - if (net->port) { - net->mtu -= sizeof(struct udphdr); - } - if (stcb->asoc.smallest_mtu > net->mtu) { - stcb->asoc.smallest_mtu = net->mtu; - } + /* JRS - Use the congestion control given in the CC module */ if (stcb->asoc.cc_functions.sctp_set_initial_cc_param != NULL) (*stcb->asoc.cc_functions.sctp_set_initial_cc_param) (stcb, net); From owner-svn-src-all@FreeBSD.ORG Tue Nov 15 20:47:29 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 74ACA106566C; Tue, 15 Nov 2011 20:47:29 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id B9E328FC24; Tue, 15 Nov 2011 20:47:28 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:a187:ded0:e7e9:99d4] (unknown [IPv6:2001:7b8:3a7:0:a187:ded0:e7e9:99d4]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 008335C59; Tue, 15 Nov 2011 21:47:26 +0100 (CET) Message-ID: <4EC2CFDD.7070206@FreeBSD.org> Date: Tue, 15 Nov 2011 21:47:25 +0100 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201111152015.pAFKFwqb015331@svn.freebsd.org> In-Reply-To: <201111152015.pAFKFwqb015331@svn.freebsd.org> X-Enigmail-Version: 1.3.3 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: Subject: Re: svn commit: r227538 - head/tools/build X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Nov 2011 20:47:29 -0000 On 2011-11-15 21:15, Dimitry Andric wrote: > Author: dim > Date: Tue Nov 15 20:15:58 2011 > New Revision: 227538 > URL: http://svn.freebsd.org/changeset/base/227538 > > Log: > LLVM uses atomic operations, which are not supported on i386 and GCC > emits calls for them, rather than expanding them inline. Older FreeBSD > versions compile for i386 by default and as such we end up with > unresolved symbols when we build LLVM's TableGen utility as a build > tool on them. Add the functions that GCC emits here, but don't bother > to make them atomic. Such is not needed. > > Submitted by: marcel > MFC after: 1 week Note, this commit is a workaround for people upgrading their i386 machine to head from an older version, specifically head before r198344. Before this revision, gcc defaulted to emitting code for real i386 CPU's, which lack support for gcc's atomic builtins. Since the LLVM code in head uses these, you would get link errors similar to: [...building world...] c++ -O2 -pipe -I/usr/src/usr.bin/clang/tblgen/../../../contrib/llvm/include -I/usr/src/usr.bin/clang/tblgen/../../../contrib/llvm/tools/clang/include -I/usr/src/usr.bin/clang/tblgen/../../../contrib/llvm/utils/TableGen -I. -I/usr/src/usr.bin/clang/tblgen/../../../contrib/llvm/../../lib/clang/include -DLLVM_ON_UNIX -DLLVM_ON_FREEBSD -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -DLLVM_HOSTTRIPLE=\"i386-unknown-freebsd9.0\" -I/usr/obj/usr/src/tmp/legacy/usr/include -static -L/usr/obj/usr/src/tmp/legacy/usr/lib -o tblgen ARMDecoderEmitter.o AsmMatcherEmitter.o AsmWriterEmitter.o AsmWriterInst.o CallingConvEmitter.o CodeEmitterGen.o CodeGenDAGPatterns.o CodeGenInstruction.o CodeGenRegisters.o CodeGenTarget.o DAGISelEmitter.o DAGISelMatcher.o DAGISelMatcherEmitter.o DAGISelMatcherGen.o DAGISelMatcherOpt.o DisassemblerEmitter.o EDEmitter.o FastISelEmitter.o FixedLenDecoderEmitter.o InstrEnumEmitter.o InstrInfoEmitter.o IntrinsicEmitter.o PseudoLoweringEmitter.o RegisterInfoEmitt er.o SetTheory.o StringMatcher.o SubtargetEmitter.o TGValueTypes.o TableGen.o X86DisassemblerTables.o X86RecognizableInstr.o /usr/obj/usr/src/tmp/usr/src/usr.bin/clang/tblgen/../../../lib/clang/libllvmtablegen/libllvmtablegen.a /usr/obj/usr/src/tmp/usr/src/usr.bin/clang/tblgen/../../../lib/clang/libllvmsupport/libllvmsupport.a -legacy /usr/obj/usr/src/tmp/usr/src/usr.bin/clang/tblgen/../../../lib/clang/libllvmsupport/libllvmsupport.a(Atomic.o)(.text+0x25): In function `llvm::sys::AtomicIncrement(unsigned int volatile*)': : undefined reference to `__sync_add_and_fetch_4' /usr/obj/usr/src/tmp/usr/src/usr.bin/clang/tblgen/../../../lib/clang/libllvmsupport/libllvmsupport.a(Atomic.o)(.text+0x45): In function `llvm::sys::AtomicDecrement(unsigned int volatile*)': : undefined reference to `__sync_sub_and_fetch_4' /usr/obj/usr/src/tmp/usr/src/usr.bin/clang/tblgen/../../../lib/clang/libllvmsupport/libllvmsupport.a(Atomic.o)(.text+0x5): In function `llvm::sys::AtomicAdd(unsigned int volatile*, unsigned int)': : undefined reference to `__sync_add_and_fetch_4' /usr/obj/usr/src/tmp/usr/src/usr.bin/clang/tblgen/../../../lib/clang/libllvmsupport/libllvmsupport.a(Atomic.o)(.text+0x61): In function `llvm::sys::CompareAndSwap(unsigned int volatile*, unsigned int, unsigned int)': : undefined reference to `__sync_val_compare_and_swap_4' *** Error code 1 Because it is not possible to reliably detect support for these atomic builtins at compile time, Marcel provided these placeholder functions to help the build complete successfully. Note all the final executables will use 'real' atomic operations. That is, unless you compile with CPUTYPE?=i386, and I wish you the best of luck in that case, you'll need it. :) From owner-svn-src-all@FreeBSD.ORG Tue Nov 15 20:48:57 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C5CA8106566C; Tue, 15 Nov 2011 20:48:57 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B57A58FC16; Tue, 15 Nov 2011 20:48:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAFKmvt0016454; Tue, 15 Nov 2011 20:48:57 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAFKmvNC016452; Tue, 15 Nov 2011 20:48:57 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201111152048.pAFKmvNC016452@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 15 Nov 2011 20:48:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227541 - head/sys/dev/usb/controller X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Nov 2011 20:48:57 -0000 Author: hselasky Date: Tue Nov 15 20:48:57 2011 New Revision: 227541 URL: http://svn.freebsd.org/changeset/base/227541 Log: Some brands of XHCI controllers needs more time to reset. Reported by: Jan Henrik Sylvester MFC after: 1 week Modified: head/sys/dev/usb/controller/xhci.c Modified: head/sys/dev/usb/controller/xhci.c ============================================================================== --- head/sys/dev/usb/controller/xhci.c Tue Nov 15 20:41:50 2011 (r227540) +++ head/sys/dev/usb/controller/xhci.c Tue Nov 15 20:48:57 2011 (r227541) @@ -292,7 +292,7 @@ xhci_start_controller(struct xhci_softc XWRITE4(sc, oper, XHCI_USBCMD, XHCI_CMD_HCRST); for (i = 0; i != 100; i++) { - usb_pause_mtx(NULL, hz / 1000); + usb_pause_mtx(NULL, hz / 100); temp = XREAD4(sc, oper, XHCI_USBCMD) & (XHCI_CMD_HCRST | XHCI_STS_CNR); if (!temp) @@ -453,7 +453,7 @@ xhci_start_controller(struct xhci_softc XHCI_CMD_INTE | XHCI_CMD_HSEE); for (i = 0; i != 100; i++) { - usb_pause_mtx(NULL, hz / 1000); + usb_pause_mtx(NULL, hz / 100); temp = XREAD4(sc, oper, XHCI_USBSTS) & XHCI_STS_HCH; if (!temp) break; @@ -487,7 +487,7 @@ xhci_halt_controller(struct xhci_softc * XWRITE4(sc, oper, XHCI_USBCMD, 0); for (i = 0; i != 100; i++) { - usb_pause_mtx(NULL, hz / 1000); + usb_pause_mtx(NULL, hz / 100); temp = XREAD4(sc, oper, XHCI_USBSTS) & XHCI_STS_HCH; if (temp) break; From owner-svn-src-all@FreeBSD.ORG Tue Nov 15 20:54:30 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6592D106564A; Tue, 15 Nov 2011 20:54:30 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-gx0-f182.google.com (mail-gx0-f182.google.com [209.85.161.182]) by mx1.freebsd.org (Postfix) with ESMTP id DE3FF8FC18; Tue, 15 Nov 2011 20:54:29 +0000 (UTC) Received: by ggnk3 with SMTP id k3so11239559ggn.13 for ; Tue, 15 Nov 2011 12:54:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=CnXDcX6wBp4h9e3XeWXWTETzA5WKLzkHmSSxOJGXXIM=; b=EN9qwQIXQJD6LU1gQwMRARyMwq9nXuZtPkv7WlATrQ2Y+CBUfZrgovWnrFxMRDkiV1 lvRlsNCqn+nCtEazaMhSI5h+2KXsbv3TX/kHKcEQzomnxct8V2IuiBm4ZWKJC8PNrrqn /zsUmA4H85pt4tnmtKoo7Z2vqwgO4nWqv0dAk= MIME-Version: 1.0 Received: by 10.68.33.134 with SMTP id r6mr45165034pbi.76.1321390468700; Tue, 15 Nov 2011 12:54:28 -0800 (PST) Sender: mdf356@gmail.com Received: by 10.68.56.97 with HTTP; Tue, 15 Nov 2011 12:54:28 -0800 (PST) In-Reply-To: <201111152048.pAFKmvNC016452@svn.freebsd.org> References: <201111152048.pAFKmvNC016452@svn.freebsd.org> Date: Tue, 15 Nov 2011 12:54:28 -0800 X-Google-Sender-Auth: -K05PwodM79mP2ii76YH8H_m4bw Message-ID: From: mdf@FreeBSD.org To: Hans Petter Selasky Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r227541 - head/sys/dev/usb/controller X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Nov 2011 20:54:30 -0000 On Tue, Nov 15, 2011 at 12:48 PM, Hans Petter Selasky wrote: > Author: hselasky > Date: Tue Nov 15 20:48:57 2011 > New Revision: 227541 > URL: http://svn.freebsd.org/changeset/base/227541 > > Log: > =A0Some brands of XHCI controllers needs more time to reset. ... and since there's no guarantee that hz is 1000 or has any particular value, most of these seem a bit spurious. Is there some reason these functions aren't asking for a delay in terms of milli- or microseconds, and converting to hz internally? I would expect a delay while waiting for hardware to have a wall-clock time, not a time relative to hz, which has no predefined range. Thanks, matthew > =A0Reported by: =A0Jan Henrik Sylvester > =A0MFC after: =A0 =A01 week > > Modified: > =A0head/sys/dev/usb/controller/xhci.c > > Modified: head/sys/dev/usb/controller/xhci.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/usb/controller/xhci.c =A0Tue Nov 15 20:41:50 2011 =A0 = =A0 =A0 =A0(r227540) > +++ head/sys/dev/usb/controller/xhci.c =A0Tue Nov 15 20:48:57 2011 =A0 = =A0 =A0 =A0(r227541) > @@ -292,7 +292,7 @@ xhci_start_controller(struct xhci_softc > =A0 =A0 =A0 =A0XWRITE4(sc, oper, XHCI_USBCMD, XHCI_CMD_HCRST); > > =A0 =A0 =A0 =A0for (i =3D 0; i !=3D 100; i++) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 usb_pause_mtx(NULL, hz / 1000); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 usb_pause_mtx(NULL, hz / 100); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0temp =3D XREAD4(sc, oper, XHCI_USBCMD) & > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(XHCI_CMD_HCRST | XHCI_STS_CNR); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (!temp) > @@ -453,7 +453,7 @@ xhci_start_controller(struct xhci_softc > =A0 =A0 =A0 =A0 =A0 =A0XHCI_CMD_INTE | XHCI_CMD_HSEE); > > =A0 =A0 =A0 =A0for (i =3D 0; i !=3D 100; i++) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 usb_pause_mtx(NULL, hz / 1000); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 usb_pause_mtx(NULL, hz / 100); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0temp =3D XREAD4(sc, oper, XHCI_USBSTS) & X= HCI_STS_HCH; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (!temp) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0break; > @@ -487,7 +487,7 @@ xhci_halt_controller(struct xhci_softc * > =A0 =A0 =A0 =A0XWRITE4(sc, oper, XHCI_USBCMD, 0); > > =A0 =A0 =A0 =A0for (i =3D 0; i !=3D 100; i++) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 usb_pause_mtx(NULL, hz / 1000); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 usb_pause_mtx(NULL, hz / 100); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0temp =3D XREAD4(sc, oper, XHCI_USBSTS) & X= HCI_STS_HCH; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (temp) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0break; > From owner-svn-src-all@FreeBSD.ORG Tue Nov 15 21:05:12 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9329106566B; Tue, 15 Nov 2011 21:05:12 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe04.c2i.net [212.247.154.98]) by mx1.freebsd.org (Postfix) with ESMTP id 01BEA8FC12; Tue, 15 Nov 2011 21:05:11 +0000 (UTC) X-T2-Spam-Status: No, hits=2.5 required=5.0 tests=ALL_TRUSTED, BAYES_99 Received: from [188.126.198.129] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe04.swip.net (CommuniGate Pro SMTP 5.2.19) with ESMTPA id 203774857; Tue, 15 Nov 2011 22:05:09 +0100 From: Hans Petter Selasky To: mdf@freebsd.org Date: Tue, 15 Nov 2011 22:02:24 +0100 User-Agent: KMail/1.13.5 (FreeBSD/8.2-STABLE; KDE/4.4.5; amd64; ; ) References: <201111152048.pAFKmvNC016452@svn.freebsd.org> In-Reply-To: X-Face: *nPdTl_}RuAI6^PVpA02T?$%Xa^>@hE0uyUIoiha$pC:9TVgl.Oq,NwSZ4V" =?windows-1252?q?=7CLR=2E+tj=7Dg5=0A=09=25V?=,x^qOs~mnU3]Gn; cQLv&.N>TrxmSFf+p6(30a/{)KUU!s}w\IhQBj}[g}bj0I3^glmC( =?windows-1252?q?=0A=09=3AAuzV9=3A=2EhESm-x4h240C=609=3Dw?= MIME-Version: 1.0 Content-Type: Text/Plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Message-Id: <201111152202.24093.hselasky@c2i.net> Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Subject: Re: svn commit: r227541 - head/sys/dev/usb/controller X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Nov 2011 21:05:12 -0000 On Tuesday 15 November 2011 21:54:28 mdf@freebsd.org wrote: > On Tue, Nov 15, 2011 at 12:48 PM, Hans Petter Selasky > > wrote: > > Author: hselasky > > Date: Tue Nov 15 20:48:57 2011 > > New Revision: 227541 > > URL: http://svn.freebsd.org/changeset/base/227541 > > > > Log: > > Some brands of XHCI controllers needs more time to reset. > Hi, > ... and since there's no guarantee that hz is 1000 or has any > particular value, most of these seem a bit spurious. The delays are a bit loosely defined, hence I think there is no clear definition what the minimum and maximum delay time is in the XHCI spec. The delay given just defines the minimum. It is not critical if the delay is larger, just that there is some kind of timeout. I use pause() because that doesn't block if the modules are loaded after boot. usb_pause_mtx() has an "if (cold)" check inside. > > Is there some reason these functions aren't asking for a delay in > terms of milli- or microseconds, and converting to hz internally? I > would expect a delay while waiting for hardware to have a wall-clock > time, not a time relative to hz, which has no predefined range. I have some macros that convert from hz to ms internally in the USB stack, though I see your point that if hz is low, then the specified value derivates from the real delay time. For USB compliant operation, the USB stack requires hz to be greater or equal to 250 hz, to put it like that. Mostly a requirement in USB gadget/device mode. --HPS From owner-svn-src-all@FreeBSD.ORG Tue Nov 15 21:11:04 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3EBB41065670; Tue, 15 Nov 2011 21:11:04 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe05.c2i.net [212.247.154.130]) by mx1.freebsd.org (Postfix) with ESMTP id 505A18FC0C; Tue, 15 Nov 2011 21:11:02 +0000 (UTC) X-T2-Spam-Status: No, hits=2.0 required=5.0 tests=ALL_TRUSTED, BAYES_95 Received: from [188.126.198.129] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe05.swip.net (CommuniGate Pro SMTP 5.2.19) with ESMTPA id 202167473; Tue, 15 Nov 2011 22:11:01 +0100 From: Hans Petter Selasky To: mdf@freebsd.org Date: Tue, 15 Nov 2011 22:08:15 +0100 User-Agent: KMail/1.13.5 (FreeBSD/8.2-STABLE; KDE/4.4.5; amd64; ; ) References: <201111152048.pAFKmvNC016452@svn.freebsd.org> In-Reply-To: X-Face: *nPdTl_}RuAI6^PVpA02T?$%Xa^>@hE0uyUIoiha$pC:9TVgl.Oq, NwSZ4V"|LR.+tj}g5 %V,x^qOs~mnU3]Gn; cQLv&.N>TrxmSFf+p6(30a/{)KUU!s}w\IhQBj}[g}bj0I3^glmC( :AuzV9:.hESm-x4h240C`9=w MIME-Version: 1.0 Content-Type: Text/Plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Message-Id: <201111152208.15443.hselasky@c2i.net> Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Subject: Re: svn commit: r227541 - head/sys/dev/usb/controller X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Nov 2011 21:11:04 -0000 On Tuesday 15 November 2011 21:54:28 mdf@freebsd.org wrote: > Is there some reason these functions aren't asking for a delay in > terms of milli- or microseconds, and converting to hz internally? There is no strong reason for this except, that when everything is computed in system ticks, there is no need for further conversion when interfacing to the pause(), cv_timedwait() etc. Integer division can be quite expensive on embedded systems, and there are now several ports of my USB stack to other platforms :-) where most of them don't have anything near GHz CPU's. --HPS From owner-svn-src-all@FreeBSD.ORG Tue Nov 15 21:14:50 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9DD021065670; Tue, 15 Nov 2011 21:14:50 +0000 (UTC) (envelope-from das@FreeBSD.ORG) Received: from zim.MIT.EDU (ZIM.MIT.EDU [18.95.3.101]) by mx1.freebsd.org (Postfix) with ESMTP id 4964D8FC17; Tue, 15 Nov 2011 21:14:49 +0000 (UTC) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.5/8.14.2) with ESMTP id pAFLEnBr000486; Tue, 15 Nov 2011 16:14:49 -0500 (EST) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by zim.MIT.EDU (8.14.5/8.14.2/Submit) id pAFLEnPg000485; Tue, 15 Nov 2011 16:14:49 -0500 (EST) (envelope-from das@FreeBSD.ORG) Date: Tue, 15 Nov 2011 16:14:49 -0500 From: David Schultz To: Dimitry Andric Message-ID: <20111115211449.GA476@zim.MIT.EDU> Mail-Followup-To: Dimitry Andric , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201111152015.pAFKFwqb015331@svn.freebsd.org> <4EC2CFDD.7070206@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4EC2CFDD.7070206@FreeBSD.org> Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r227538 - head/tools/build X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Nov 2011 21:14:50 -0000 On Tue, Nov 15, 2011, Dimitry Andric wrote: > Note all the final executables will use 'real' atomic operations. That > is, unless you compile with CPUTYPE?=i386, and I wish you the best of > luck in that case, you'll need it. :) I thought we dropped support for anything less than a 486DX years ago. From owner-svn-src-all@FreeBSD.ORG Tue Nov 15 21:20:21 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 983D5106566B; Tue, 15 Nov 2011 21:20:21 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-ey0-f182.google.com (mail-ey0-f182.google.com [209.85.215.182]) by mx1.freebsd.org (Postfix) with ESMTP id C591F8FC19; Tue, 15 Nov 2011 21:20:20 +0000 (UTC) Received: by eyd10 with SMTP id 10so8174699eyd.13 for ; Tue, 15 Nov 2011 13:20:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=9JQ2NZBa+5cEqW9TigByUMuAeJudxVlRE/ExIWy0cRc=; b=KG4hh7bdYwdBdQvBZTERDmSjIre8+O/BEwCcWQye867qjfmLy8MX/qcGwqpWXVm3RX F3SFEGU2Sa2IS3ZoajM0d8GQWNJ7k79C8couLnP5fzLUxeskQxJcXtt2PbMEl+LYqg4d pAQ9zkHNufeiEzItLwNHuApddo7+x5HfccV1A= MIME-Version: 1.0 Received: by 10.68.60.225 with SMTP id k1mr57855699pbr.25.1321392018613; Tue, 15 Nov 2011 13:20:18 -0800 (PST) Sender: mdf356@gmail.com Received: by 10.68.56.97 with HTTP; Tue, 15 Nov 2011 13:20:18 -0800 (PST) In-Reply-To: <201111152202.24093.hselasky@c2i.net> References: <201111152048.pAFKmvNC016452@svn.freebsd.org> <201111152202.24093.hselasky@c2i.net> Date: Tue, 15 Nov 2011 13:20:18 -0800 X-Google-Sender-Auth: -fLp3kWlCEBthnEurByn-0OaJT8 Message-ID: From: mdf@FreeBSD.org To: Hans Petter Selasky Content-Type: text/plain; charset=ISO-8859-1 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Subject: Re: svn commit: r227541 - head/sys/dev/usb/controller X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Nov 2011 21:20:21 -0000 On Tue, Nov 15, 2011 at 1:02 PM, Hans Petter Selasky wrote: > For USB compliant operation, the USB stack requires hz to be greater or equal > to 250 hz, to put it like that. Mostly a requirement in USB gadget/device > mode. Really? That's news to me. Is that documented somewhere? I know we still use hz=100 internally, but we're on stable/7 still so not using the new USB stack yet. Thanks, matthew From owner-svn-src-all@FreeBSD.ORG Tue Nov 15 21:21:34 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9263E106566B; Tue, 15 Nov 2011 21:21:34 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-ey0-f182.google.com (mail-ey0-f182.google.com [209.85.215.182]) by mx1.freebsd.org (Postfix) with ESMTP id 9CFB28FC20; Tue, 15 Nov 2011 21:21:33 +0000 (UTC) Received: by eyd10 with SMTP id 10so8176119eyd.13 for ; Tue, 15 Nov 2011 13:21:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=k3v1b0S3XUGl9F8z8T8A5A3zplNW3f5cBGnwfUVHmx0=; b=UI7F6lDM2voZSKxJ0ONLqZPERcDC5Kc1dOf8YYqcsBqcCwoWqTybLWHnE1t0kaL6j+ tRAsIaLv5YNpccR22R0kEPz3EGKUyW0M+VYp6exXcyqSXEp1t3tSh9nGfqucr51PicMT Bz/RrO0HC431issK9uT/YC3kD56Lv0bN7oB4w= MIME-Version: 1.0 Received: by 10.68.33.134 with SMTP id r6mr45342986pbi.76.1321392091653; Tue, 15 Nov 2011 13:21:31 -0800 (PST) Sender: mdf356@gmail.com Received: by 10.68.56.97 with HTTP; Tue, 15 Nov 2011 13:21:31 -0800 (PST) In-Reply-To: References: <201111152048.pAFKmvNC016452@svn.freebsd.org> <201111152202.24093.hselasky@c2i.net> Date: Tue, 15 Nov 2011 13:21:31 -0800 X-Google-Sender-Auth: Y69BSkjEKvMMiGZo0V1APJoH6R8 Message-ID: From: mdf@FreeBSD.org To: Hans Petter Selasky Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Subject: Re: svn commit: r227541 - head/sys/dev/usb/controller X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Nov 2011 21:21:34 -0000 On Tue, Nov 15, 2011 at 1:20 PM, wrote: > On Tue, Nov 15, 2011 at 1:02 PM, Hans Petter Selasky w= rote: >> For USB compliant operation, the USB stack requires hz to be greater or = equal >> to 250 hz, to put it like that. Mostly a requirement in USB gadget/devic= e >> mode. > > Really? =A0That's news to me. =A0Is that documented somewhere? =A0I know = we > still use hz=3D100 internally, but we're on stable/7 still so not using > the new USB stack yet. ... and I also just remembered that I have seen recommendations that, when FreeBSD is used as a virtual machine, hz should be set to 100 so that the virtual interrupt overhead is reduced. Those two recommendations are at odds with each other. Thanks, matthew From owner-svn-src-all@FreeBSD.ORG Tue Nov 15 21:25:05 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9DDA6106564A; Tue, 15 Nov 2011 21:25:05 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe05.c2i.net [212.247.154.130]) by mx1.freebsd.org (Postfix) with ESMTP id A04598FC12; Tue, 15 Nov 2011 21:25:04 +0000 (UTC) X-T2-Spam-Status: No, hits=2.5 required=5.0 tests=ALL_TRUSTED, BAYES_99 Received: from [188.126.198.129] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe05.swip.net (CommuniGate Pro SMTP 5.2.19) with ESMTPA id 202171092; Tue, 15 Nov 2011 22:25:03 +0100 From: Hans Petter Selasky To: mdf@freebsd.org Date: Tue, 15 Nov 2011 22:22:17 +0100 User-Agent: KMail/1.13.5 (FreeBSD/8.2-STABLE; KDE/4.4.5; amd64; ; ) References: <201111152048.pAFKmvNC016452@svn.freebsd.org> <201111152202.24093.hselasky@c2i.net> In-Reply-To: X-Face: *nPdTl_}RuAI6^PVpA02T?$%Xa^>@hE0uyUIoiha$pC:9TVgl.Oq,NwSZ4V" =?iso-8859-1?q?=7CLR=2E+tj=7Dg5=0A=09=25V?=,x^qOs~mnU3]Gn; cQLv&.N>TrxmSFf+p6(30a/{)KUU!s}w\IhQBj}[g}bj0I3^glmC( =?iso-8859-1?q?=0A=09=3AAuzV9=3A=2EhESm-x4h240C=609=3Dw?= MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201111152222.17549.hselasky@c2i.net> Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Subject: Re: svn commit: r227541 - head/sys/dev/usb/controller X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Nov 2011 21:25:05 -0000 On Tuesday 15 November 2011 22:20:18 mdf@freebsd.org wrote: > On Tue, Nov 15, 2011 at 1:02 PM, Hans Petter Selasky wrote: > > For USB compliant operation, the USB stack requires hz to be greater or > > equal to 250 hz, to put it like that. Mostly a requirement in USB > > gadget/device mode. > > Really? That's news to me. Is that documented somewhere? I know we > still use hz=100 internally, but we're on stable/7 still so not using > the new USB stack yet. No it is not documented anywhere. This delay is mostly critical if you enable USB power saving features like suspend and resume. Then there are some software timers which should not derive too much. Most of the time the delays in USB are not critical. Transfer timers are in the seconds range and that works fine with hz=100. Where and how should I document such are requirement? Add something during system init? if (hz < 250) printf("USB: hz is too low (ignored)\n"); --HPS From owner-svn-src-all@FreeBSD.ORG Tue Nov 15 21:27:16 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E068B106564A; Tue, 15 Nov 2011 21:27:16 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe09.c2i.net [212.247.155.2]) by mx1.freebsd.org (Postfix) with ESMTP id B76C68FC14; Tue, 15 Nov 2011 21:27:15 +0000 (UTC) X-T2-Spam-Status: No, hits=2.5 required=5.0 tests=ALL_TRUSTED, BAYES_99 Received: from [188.126.198.129] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe09.swip.net (CommuniGate Pro SMTP 5.2.19) with ESMTPA id 29290341; Tue, 15 Nov 2011 22:27:13 +0100 From: Hans Petter Selasky To: mdf@freebsd.org Date: Tue, 15 Nov 2011 22:24:27 +0100 User-Agent: KMail/1.13.5 (FreeBSD/8.2-STABLE; KDE/4.4.5; amd64; ; ) References: <201111152048.pAFKmvNC016452@svn.freebsd.org> In-Reply-To: X-Face: *nPdTl_}RuAI6^PVpA02T?$%Xa^>@hE0uyUIoiha$pC:9TVgl.Oq,NwSZ4V" =?iso-8859-1?q?=7CLR=2E+tj=7Dg5=0A=09=25V?=,x^qOs~mnU3]Gn; cQLv&.N>TrxmSFf+p6(30a/{)KUU!s}w\IhQBj}[g}bj0I3^glmC( =?iso-8859-1?q?=0A=09=3AAuzV9=3A=2EhESm-x4h240C=609=3Dw?= MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201111152224.27868.hselasky@c2i.net> Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Subject: Re: svn commit: r227541 - head/sys/dev/usb/controller X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Nov 2011 21:27:17 -0000 On Tuesday 15 November 2011 22:21:31 mdf@freebsd.org wrote: > On Tue, Nov 15, 2011 at 1:20 PM, wrote: > > On Tue, Nov 15, 2011 at 1:02 PM, Hans Petter Selasky wrote: > >> For USB compliant operation, the USB stack requires hz to be greater or > >> equal to 250 hz, to put it like that. Mostly a requirement in USB > >> gadget/device mode. > > > > Really? That's news to me. Is that documented somewhere? I know we > > still use hz=100 internally, but we're on stable/7 still so not using > > the new USB stack yet. > > ... and I also just remembered that I have seen recommendations that, > when FreeBSD is used as a virtual machine, hz should be set to 100 so > that the virtual interrupt overhead is reduced. Those two > recommendations are at odds with each other. USB in virtual machines is a completely different story. All the timing critical stuff is handled by the real USB host operating system. The OS inside the VM just has to respond to some "virtual" USB events. Timing does not matter very much as far as I'm aware. --HPS From owner-svn-src-all@FreeBSD.ORG Tue Nov 15 21:45:15 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4F13B1065672; Tue, 15 Nov 2011 21:45:15 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-yw0-f54.google.com (mail-yw0-f54.google.com [209.85.213.54]) by mx1.freebsd.org (Postfix) with ESMTP id D31D68FC14; Tue, 15 Nov 2011 21:45:14 +0000 (UTC) Received: by ywe9 with SMTP id 9so6096705ywe.13 for ; Tue, 15 Nov 2011 13:45:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=subject:mime-version:content-type:from:in-reply-to:date:cc :message-id:references:to:x-mailer; bh=QXV7CetnLR9QTAQnSTXrWuoMFKmi3qIbeXWi3XJ84DQ=; b=gCbiwHYt85NyUT0JkygNRmxFnaTxHhMGZzCTIWOW9FfaPnyRU2aihziVMcKZliRVOs sLURgg53na3bu0SOboH0o6rzaA2tOblR3Bpz1L4Zrshdmb1gfXEqZ/F6ZQ3JHYftyudK aEbTR79OW5JFbv/wMDSSefwYjN9ZGYd9aAenY= Received: by 10.68.21.202 with SMTP id x10mr45161476pbe.128.1321393513429; Tue, 15 Nov 2011 13:45:13 -0800 (PST) Received: from kruse-180.4.ixsystems.com (drawbridge.ixsystems.com. [206.40.55.65]) by mx.google.com with ESMTPS id w8sm4381880pbw.18.2011.11.15.13.45.11 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 15 Nov 2011 13:45:12 -0800 (PST) Mime-Version: 1.0 (Apple Message framework v1084) From: Garrett Cooper In-Reply-To: <201111152224.27868.hselasky@c2i.net> Date: Tue, 15 Nov 2011 13:45:10 -0800 Message-Id: <1A1FDBC6-90A1-4C4A-B2C6-62B40FD2B523@gmail.com> References: <201111152048.pAFKmvNC016452@svn.freebsd.org> <201111152224.27868.hselasky@c2i.net> To: Hans Petter Selasky X-Mailer: Apple Mail (2.1084) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: "svn-src-head@freebsd.org" , mdf@freebsd.org, "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Subject: Re: svn commit: r227541 - head/sys/dev/usb/controller X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Nov 2011 21:45:15 -0000 On Nov 15, 2011, at 1:24 PM, Hans Petter Selasky wrote: >>=20 >> ... and I also just remembered that I have seen recommendations that, >> when FreeBSD is used as a virtual machine, hz should be set to 100 so >> that the virtual interrupt overhead is reduced. Those two >> recommendations are at odds with each other. >=20 > USB in virtual machines is a completely different story. All the = timing=20 > critical stuff is handled by the real USB host operating system. The = OS inside=20 > the VM just has to respond to some "virtual" USB events. Timing does = not=20 kern.hz=3D100 (!=3D 1000) recommendation matters because: 1. It causes too many interrupts on multicore systems, which folks = reported caused performance degradation. 2. In VMs it caused clock skew IIRC. I could dig up sources if you need them. Thanks, -Garrett= From owner-svn-src-all@FreeBSD.ORG Tue Nov 15 21:49:08 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D8A13106566B; Tue, 15 Nov 2011 21:49:08 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-ey0-f182.google.com (mail-ey0-f182.google.com [209.85.215.182]) by mx1.freebsd.org (Postfix) with ESMTP id 1B7038FC0A; Tue, 15 Nov 2011 21:49:07 +0000 (UTC) Received: by eyd10 with SMTP id 10so8209382eyd.13 for ; Tue, 15 Nov 2011 13:49:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=mFdU7LJAu5j4gomWlb6obiORY1mtiMVbVWH8DL29HDQ=; b=Kw4RQUPMWPOyOPxcjw2NJExx3nmt/fnZFERXN5cjPTHQw2JmxajTv7BQ8sfxmSKCdu bcxcZhvQA4xDys6XUW6J7dgE3knwFmeG3LcYx8r+KvLjW3n0KNdvNqst/fvwaAFrRXUP YR+VHTf0Sj1vvePIuaujE6maYlfKgIWxxdkk8= MIME-Version: 1.0 Received: by 10.68.38.5 with SMTP id c5mr24533443pbk.93.1321393746164; Tue, 15 Nov 2011 13:49:06 -0800 (PST) Sender: mdf356@gmail.com Received: by 10.68.56.97 with HTTP; Tue, 15 Nov 2011 13:49:06 -0800 (PST) In-Reply-To: <201111152222.17549.hselasky@c2i.net> References: <201111152048.pAFKmvNC016452@svn.freebsd.org> <201111152202.24093.hselasky@c2i.net> <201111152222.17549.hselasky@c2i.net> Date: Tue, 15 Nov 2011 13:49:06 -0800 X-Google-Sender-Auth: S0BkyNV8JZbKsGrzRsCs7C15o7w Message-ID: From: mdf@FreeBSD.org To: Hans Petter Selasky Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Subject: Re: svn commit: r227541 - head/sys/dev/usb/controller X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Nov 2011 21:49:08 -0000 On Tue, Nov 15, 2011 at 1:22 PM, Hans Petter Selasky wro= te: > On Tuesday 15 November 2011 22:20:18 mdf@freebsd.org wrote: >> On Tue, Nov 15, 2011 at 1:02 PM, Hans Petter Selasky > wrote: >> > For USB compliant operation, the USB stack requires hz to be greater o= r >> > equal to 250 hz, to put it like that. Mostly a requirement in USB >> > gadget/device mode. >> >> Really? =A0That's news to me. =A0Is that documented somewhere? =A0I know= we >> still use hz=3D100 internally, but we're on stable/7 still so not using >> the new USB stack yet. > > No it is not documented anywhere. This delay is mostly critical if you en= able > USB power saving features like suspend and resume. Then there are some > software timers which should not derive too much. > > Most of the time the delays in USB are not critical. Transfer timers are = in > the seconds range and that works fine with hz=3D100. > > Where and how should I document such are requirement? > > Add something during system init? > > if (hz < 250) > =A0 printf("USB: hz is too low (ignored)\n"); I'm not sure what functions we have for detecting the OS instance is virtualized, but something like that would be useful if it's really important. Perhaps: "USB: hz value less than 250 may cause functional issues" Thanks, matthew From owner-svn-src-all@FreeBSD.ORG Tue Nov 15 21:52:05 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 624171065676; Tue, 15 Nov 2011 21:52:05 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id 246888FC17; Tue, 15 Nov 2011 21:52:05 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:a187:ded0:e7e9:99d4] (unknown [IPv6:2001:7b8:3a7:0:a187:ded0:e7e9:99d4]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 61DA85C59; Tue, 15 Nov 2011 22:52:04 +0100 (CET) Message-ID: <4EC2DF02.7030602@FreeBSD.org> Date: Tue, 15 Nov 2011 22:52:02 +0100 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201111152015.pAFKFwqb015331@svn.freebsd.org> <4EC2CFDD.7070206@FreeBSD.org> <20111115211449.GA476@zim.MIT.EDU> In-Reply-To: <20111115211449.GA476@zim.MIT.EDU> X-Enigmail-Version: 1.3.3 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Subject: Re: svn commit: r227538 - head/tools/build X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Nov 2011 21:52:05 -0000 On 2011-11-15 22:14, David Schultz wrote: > On Tue, Nov 15, 2011, Dimitry Andric wrote: >> Note all the final executables will use 'real' atomic operations. That >> is, unless you compile with CPUTYPE?=i386, and I wish you the best of >> luck in that case, you'll need it. :) > > I thought we dropped support for anything less than a 486DX years ago. Well, theoretically you could still attempt to build for i386, but it is almost sure to have bitrotted beyond any working state. The CPUTYPE stuff in bsd.cpu.mk still seems to support it, as does gcc itself, of course. And as mentioned in the commit message, until 2 years ago, the default CPU for gcc was i386; which is the only reason for this commit. Indeed, I386_CPU support was removed from GENERIC more than 10 years ago, in r71025. But even there it says: "Remove I386_CPU from GENERIC. Support for the 386 seriously pessimizes performance on other x86 processors. Custom kernels can still be built that will run on the 386." I wonder if that's still true... maybe it is time to really clean up any pre-i486 leftovers. :) From owner-svn-src-all@FreeBSD.ORG Tue Nov 15 22:08:51 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D47AA106566B; Tue, 15 Nov 2011 22:08:51 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id AB6348FC17; Tue, 15 Nov 2011 22:08:51 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 4D55A46B06; Tue, 15 Nov 2011 17:08:51 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id E55008A050; Tue, 15 Nov 2011 17:08:50 -0500 (EST) From: John Baldwin To: Dimitry Andric Date: Tue, 15 Nov 2011 17:08:50 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p8; KDE/4.5.5; amd64; ; ) References: <201111152015.pAFKFwqb015331@svn.freebsd.org> <20111115211449.GA476@zim.MIT.EDU> <4EC2DF02.7030602@FreeBSD.org> In-Reply-To: <4EC2DF02.7030602@FreeBSD.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201111151708.50363.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Tue, 15 Nov 2011 17:08:51 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r227538 - head/tools/build X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Nov 2011 22:08:51 -0000 On Tuesday, November 15, 2011 4:52:02 pm Dimitry Andric wrote: > On 2011-11-15 22:14, David Schultz wrote: > > On Tue, Nov 15, 2011, Dimitry Andric wrote: > >> Note all the final executables will use 'real' atomic operations. That > >> is, unless you compile with CPUTYPE?=i386, and I wish you the best of > >> luck in that case, you'll need it. :) > > > > I thought we dropped support for anything less than a 486DX years ago. > > Well, theoretically you could still attempt to build for i386, but it is > almost sure to have bitrotted beyond any working state. The CPUTYPE > stuff in bsd.cpu.mk still seems to support it, as does gcc itself, of > course. And as mentioned in the commit message, until 2 years ago, the > default CPU for gcc was i386; which is the only reason for this commit. > > Indeed, I386_CPU support was removed from GENERIC more than 10 years > ago, in r71025. But even there it says: > > "Remove I386_CPU from GENERIC. Support for the 386 seriously pessimizes > performance on other x86 processors. Custom kernels can still be built > that will run on the 386." > > I wonder if that's still true... maybe it is time to really clean up any > pre-i486 leftovers. :) I think I removed all the i386 bits from the kernel a few years ago already: r137784 | jhb | 2004-11-16 15:42:32 -0500 (Tue, 16 Nov 2004) | 3 lines Initiate deorbit burn sequence for 80386 support in FreeBSD: Remove 80386 (I386_CPU) support from the kernel. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Tue Nov 15 22:19:05 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BF3DD106564A; Tue, 15 Nov 2011 22:19:05 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-gx0-f182.google.com (mail-gx0-f182.google.com [209.85.161.182]) by mx1.freebsd.org (Postfix) with ESMTP id 533B28FC08; Tue, 15 Nov 2011 22:19:05 +0000 (UTC) Received: by ggnk3 with SMTP id k3so11357430ggn.13 for ; Tue, 15 Nov 2011 14:19:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=QE9tlEh21NajaMo+vbmWche7soSw8MWq1euyiKubDnE=; b=DdOGQ+//nShgEPuMIjZ0tpbp0sT6us+/QTQ1jsw6gw4HyVjgXrnheQPPzabCkQNOYd yHjMd/tEm86pGxzUtyoxEyvT4DDSZ4Ii8mrzZRvm+2sslu2xpS2JRyHr9mQa4uK5EM+2 KQXcH56o/5UbM9vSszKQcKMXGGLQZbx71QCjc= MIME-Version: 1.0 Received: by 10.68.0.193 with SMTP id 1mr45281339pbg.110.1321395544355; Tue, 15 Nov 2011 14:19:04 -0800 (PST) Sender: mdf356@gmail.com Received: by 10.68.56.97 with HTTP; Tue, 15 Nov 2011 14:19:04 -0800 (PST) In-Reply-To: <201111152222.17549.hselasky@c2i.net> References: <201111152048.pAFKmvNC016452@svn.freebsd.org> <201111152202.24093.hselasky@c2i.net> <201111152222.17549.hselasky@c2i.net> Date: Tue, 15 Nov 2011 14:19:04 -0800 X-Google-Sender-Auth: nImWpgVpWs9u2qjDv0x6rQ3Moc4 Message-ID: From: mdf@FreeBSD.org To: Hans Petter Selasky Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Subject: Re: svn commit: r227541 - head/sys/dev/usb/controller X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Nov 2011 22:19:05 -0000 On Tue, Nov 15, 2011 at 1:22 PM, Hans Petter Selasky wro= te: > On Tuesday 15 November 2011 22:20:18 mdf@freebsd.org wrote: >> On Tue, Nov 15, 2011 at 1:02 PM, Hans Petter Selasky > wrote: >> > For USB compliant operation, the USB stack requires hz to be greater o= r >> > equal to 250 hz, to put it like that. Mostly a requirement in USB >> > gadget/device mode. >> >> Really? =A0That's news to me. =A0Is that documented somewhere? =A0I know= we >> still use hz=3D100 internally, but we're on stable/7 still so not using >> the new USB stack yet. > > No it is not documented anywhere. This delay is mostly critical if you en= able > USB power saving features like suspend and resume. Then there are some > software timers which should not derive too much. Actually, if the bug is only with the power_save mode, then perhaps it should only be warned when that mode is enabled. Thanks, matthew From owner-svn-src-all@FreeBSD.ORG Tue Nov 15 22:24:53 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B381B1065672; Tue, 15 Nov 2011 22:24:53 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe01.c2i.net [212.247.154.2]) by mx1.freebsd.org (Postfix) with ESMTP id 9F71E8FC0C; Tue, 15 Nov 2011 22:24:52 +0000 (UTC) X-T2-Spam-Status: No, hits=2.5 required=5.0 tests=ALL_TRUSTED, BAYES_99 Received: from [188.126.198.129] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe01.swip.net (CommuniGate Pro SMTP 5.2.19) with ESMTPA id 205941102; Tue, 15 Nov 2011 23:24:50 +0100 From: Hans Petter Selasky To: mdf@freebsd.org Date: Tue, 15 Nov 2011 23:22:05 +0100 User-Agent: KMail/1.13.5 (FreeBSD/8.2-STABLE; KDE/4.4.5; amd64; ; ) References: <201111152222.17549.hselasky@c2i.net> In-Reply-To: X-Face: *nPdTl_}RuAI6^PVpA02T?$%Xa^>@hE0uyUIoiha$pC:9TVgl.Oq,NwSZ4V" =?iso-8859-1?q?=7CLR=2E+tj=7Dg5=0A=09=25V?=,x^qOs~mnU3]Gn; cQLv&.N>TrxmSFf+p6(30a/{)KUU!s}w\IhQBj}[g}bj0I3^glmC( =?iso-8859-1?q?=0A=09=3AAuzV9=3A=2EhESm-x4h240C=609=3Dw?= MIME-Version: 1.0 Content-Type: Text/Plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Message-Id: <201111152322.05143.hselasky@c2i.net> Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Subject: Re: svn commit: r227541 - head/sys/dev/usb/controller X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Nov 2011 22:24:53 -0000 In response to this thread I've updated: http://wiki.freebsd.org/TuningPowerConsumption --HPS From owner-svn-src-all@FreeBSD.ORG Tue Nov 15 23:35:44 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 39CA9106566C; Tue, 15 Nov 2011 23:35:44 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E487D8FC12; Tue, 15 Nov 2011 23:35:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAFNZhSX021663; Tue, 15 Nov 2011 23:35:43 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAFNZhJ7021661; Tue, 15 Nov 2011 23:35:43 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201111152335.pAFNZhJ7021661@svn.freebsd.org> From: Rick Macklem Date: Tue, 15 Nov 2011 23:35:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227543 - head/sys/fs/nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Nov 2011 23:35:44 -0000 Author: rmacklem Date: Tue Nov 15 23:35:43 2011 New Revision: 227543 URL: http://svn.freebsd.org/changeset/base/227543 Log: Modify the new NFS client so that nfs_fsync() only calls ncl_flush() for regular files. Since other file types don't write into the buffer cache, calling ncl_flush() is almost a no-op. However, it does clear the NMODIFIED flag and this shouldn't be done by nfs_fsync() for directories. MFC after: 2 weeks Modified: head/sys/fs/nfsclient/nfs_clvnops.c Modified: head/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvnops.c Tue Nov 15 23:32:30 2011 (r227542) +++ head/sys/fs/nfsclient/nfs_clvnops.c Tue Nov 15 23:35:43 2011 (r227543) @@ -2580,6 +2580,16 @@ nfs_strategy(struct vop_strategy_args *a static int nfs_fsync(struct vop_fsync_args *ap) { + + if (ap->a_vp->v_type != VREG) { + /* + * For NFS, metadata is changed synchronously on the server, + * so there is nothing to flush. Also, ncl_flush() clears + * the NMODIFIED flag and that shouldn't be done here for + * directories. + */ + return (0); + } return (ncl_flush(ap->a_vp, ap->a_waitfor, NULL, ap->a_td, 1, 0)); } From owner-svn-src-all@FreeBSD.ORG Tue Nov 15 23:46:26 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A7FB106564A; Tue, 15 Nov 2011 23:46:26 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 39D9D8FC08; Tue, 15 Nov 2011 23:46:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAFNkQkA022083; Tue, 15 Nov 2011 23:46:26 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAFNkQp2022081; Tue, 15 Nov 2011 23:46:26 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201111152346.pAFNkQp2022081@svn.freebsd.org> From: "David E. O'Brien" Date: Tue, 15 Nov 2011 23:46:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227545 - stable/8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Nov 2011 23:46:26 -0000 Author: obrien Date: Tue Nov 15 23:46:25 2011 New Revision: 227545 URL: http://svn.freebsd.org/changeset/base/227545 Log: MFC: r220954 & r221469: Note which of the built kernels is being installed. PR: 156579 Modified: stable/8/Makefile.inc1 (contents, props changed) Directory Properties: stable/8/ (props changed) Modified: stable/8/Makefile.inc1 ============================================================================== --- stable/8/Makefile.inc1 Tue Nov 15 23:37:15 2011 (r227544) +++ stable/8/Makefile.inc1 Tue Nov 15 23:46:25 2011 (r227545) @@ -813,7 +813,7 @@ reinstallkernel reinstallkernel.debug: i false .endif @echo "--------------------------------------------------------------" - @echo ">>> Installing kernel" + @echo ">>> Installing kernel ${INSTALLKERNEL}" @echo "--------------------------------------------------------------" cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \ ${CROSSENV} PATH=${TMPPATH} \ From owner-svn-src-all@FreeBSD.ORG Wed Nov 16 02:00:56 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1636D106566B; Wed, 16 Nov 2011 02:00:56 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 05C578FC19; Wed, 16 Nov 2011 02:00:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAG20tPk026346; Wed, 16 Nov 2011 02:00:55 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAG20tkg026344; Wed, 16 Nov 2011 02:00:55 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201111160200.pAG20tkg026344@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 16 Nov 2011 02:00:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227547 - head/sys/dev/qlxgb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2011 02:00:56 -0000 Author: bz Date: Wed Nov 16 02:00:55 2011 New Revision: 227547 URL: http://svn.freebsd.org/changeset/base/227547 Log: The maximum TSO frame size should be: maximum IP datagram size (65535 bytes) + Ethernet header size (14 bytes) + 2 * VLAN tag size (4 bytes) [1]. [1] We need to multiply by 2 to account for the double VLAN tag provision added in IEEE 802.1ad. Submitted by: David Somayajulu (david.somayajulu qlogic.com) MFC after: 4 days Modified: head/sys/dev/qlxgb/qla_def.h Modified: head/sys/dev/qlxgb/qla_def.h ============================================================================== --- head/sys/dev/qlxgb/qla_def.h Wed Nov 16 02:00:27 2011 (r227546) +++ head/sys/dev/qlxgb/qla_def.h Wed Nov 16 02:00:55 2011 (r227547) @@ -86,7 +86,7 @@ typedef struct qla_tx_buf qla_tx_buf_t; #define QLA_MAX_SEGMENTS 63 /* maximum # of segs in a sg list */ #define QLA_MAX_FRAME_SIZE MJUM9BYTES #define QLA_STD_FRAME_SIZE 1514 -#define QLA_MAX_TSO_FRAME_SIZE (64 * 1024 - 1) +#define QLA_MAX_TSO_FRAME_SIZE ((64 * 1024 - 1) + 22) /* Number of MSIX/MSI Vectors required */ #define Q8_MSI_COUNT 4 From owner-svn-src-all@FreeBSD.ORG Wed Nov 16 02:52:25 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3F581106564A; Wed, 16 Nov 2011 02:52:25 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E80FD8FC13; Wed, 16 Nov 2011 02:52:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAG2qOLc028012; Wed, 16 Nov 2011 02:52:24 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAG2qOIa028009; Wed, 16 Nov 2011 02:52:24 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201111160252.pAG2qOIa028009@svn.freebsd.org> From: Matt Jacob Date: Wed, 16 Nov 2011 02:52:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227548 - head/sys/dev/isp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2011 02:52:25 -0000 Author: mjacob Date: Wed Nov 16 02:52:24 2011 New Revision: 227548 URL: http://svn.freebsd.org/changeset/base/227548 Log: Was chasing down a failure to load f/w on a 2400. It turns out that the card is actually broken, or needs a BIOS upgrade for 64 bit loads, but this uncovered a couple of misplaced opcode definitions and some missing continual mbox command cases, so might as well update them here. Modified: head/sys/dev/isp/isp.c head/sys/dev/isp/isp_pci.c Modified: head/sys/dev/isp/isp.c ============================================================================== --- head/sys/dev/isp/isp.c Wed Nov 16 02:00:55 2011 (r227547) +++ head/sys/dev/isp/isp.c Wed Nov 16 02:52:24 2011 (r227548) @@ -748,11 +748,13 @@ isp_reset(ispsoftc_t *isp, int do_load_d if (dodnld && IS_24XX(isp)) { const uint32_t *ptr = isp->isp_mdvec->dv_ispfw; + int wordload; /* * Keep loading until we run out of f/w. */ code_org = ptr[2]; /* 1st load address is our start addr */ + wordload = 0; for (;;) { uint32_t la, wi, wl; @@ -777,6 +779,7 @@ isp_reset(ispsoftc_t *isp, int do_load_d wl--; } MEMORYBARRIER(isp, SYNC_REQUEST, 0, ISP_QUEUE_SIZE(RQUEST_QUEUE_LEN(isp)), -1); + again: ISP_MEMZERO(&mbs, sizeof (mbs)); if (la < 0x10000 && nw < 0x10000) { mbs.param[0] = MBOX_LOAD_RISC_RAM_2100; @@ -786,6 +789,23 @@ isp_reset(ispsoftc_t *isp, int do_load_d mbs.param[4] = nw; mbs.param[6] = DMA_WD3(isp->isp_rquest_dma); mbs.param[7] = DMA_WD2(isp->isp_rquest_dma); + isp_prt(isp, ISP_LOGDEBUG0, "LOAD RISC RAM 2100 %u words at load address 0x%x", nw, la); + } else if (wordload) { + union { + const uint32_t *cp; + uint32_t *np; + } ucd; + ucd.cp = (const uint32_t *)cp; + mbs.param[0] = MBOX_WRITE_RAM_WORD_EXTENDED; + mbs.param[1] = la; + mbs.param[2] = (*ucd.np); + mbs.param[3] = (*ucd.np) >> 16; + mbs.param[8] = la >> 16; + isp->isp_mbxwrk0 = nw - 1; + isp->isp_mbxworkp = ucd.np+1; + isp->isp_mbxwrk1 = (la + 1); + isp->isp_mbxwrk8 = (la + 1) >> 16; + isp_prt(isp, ISP_LOGDEBUG0, "WRITE RAM WORD EXTENDED %u words at load address 0x%x", nw, la); } else { mbs.param[0] = MBOX_LOAD_RISC_RAM; mbs.param[1] = la; @@ -796,10 +816,16 @@ isp_reset(ispsoftc_t *isp, int do_load_d mbs.param[6] = DMA_WD3(isp->isp_rquest_dma); mbs.param[7] = DMA_WD2(isp->isp_rquest_dma); mbs.param[8] = la >> 16; + isp_prt(isp, ISP_LOGDEBUG0, "LOAD RISC RAM %u words at load address 0x%x", nw, la); } mbs.logval = MBLOGALL; isp_mboxcmd(isp, &mbs); if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { + if (mbs.param[0] == MBOX_HOST_INTERFACE_ERROR) { + isp_prt(isp, ISP_LOGERR, "switching to word load"); + wordload = 1; + goto again; + } isp_prt(isp, ISP_LOGERR, "F/W Risc Ram Load Failed"); ISP_RESET0(isp); return; @@ -855,6 +881,7 @@ isp_reset(ispsoftc_t *isp, int do_load_d mbs.param[4] = nw; mbs.param[6] = DMA_WD3(isp->isp_rquest_dma); mbs.param[7] = DMA_WD2(isp->isp_rquest_dma); + isp_prt(isp, ISP_LOGDEBUG1, "LOAD RISC RAM 2100 %u words at load address 0x%x\n", nw, la); } else { mbs.param[0] = MBOX_LOAD_RISC_RAM; mbs.param[1] = la; @@ -864,6 +891,7 @@ isp_reset(ispsoftc_t *isp, int do_load_d mbs.param[6] = DMA_WD3(isp->isp_rquest_dma); mbs.param[7] = DMA_WD2(isp->isp_rquest_dma); mbs.param[8] = la >> 16; + isp_prt(isp, ISP_LOGDEBUG1, "LOAD RISC RAM %u words at load address 0x%x\n", nw, la); } mbs.logval = MBLOGALL; isp_mboxcmd(isp, &mbs); @@ -910,6 +938,7 @@ isp_reset(ispsoftc_t *isp, int do_load_d mbs.param[1] = code_org; mbs.param[2] = ucd.np[0]; mbs.logval = MBLOGNONE; + isp_prt(isp, ISP_LOGDEBUG1, "WRITE RAM %u words at load address 0x%x\n", ucd.np[3], code_org); isp_mboxcmd(isp, &mbs); if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { isp_prt(isp, ISP_LOGERR, "F/W download failed at word %d", isp->isp_mbxwrk1 - code_org); @@ -6589,23 +6618,39 @@ isp_mbox_continue(ispsoftc_t *isp) mbs.param[1] = isp->isp_mbxwrk1++; break; case MBOX_WRITE_RAM_WORD_EXTENDED: + if (IS_24XX(isp)) { + uint32_t *lptr = (uint32_t *)ptr; + mbs.param[2] = lptr[0]; + mbs.param[3] = lptr[0] >> 16; + lptr++; + ptr = (uint16_t *)lptr; + } else { + mbs.param[2] = *ptr++; + } offset = isp->isp_mbxwrk1; offset |= isp->isp_mbxwrk8 << 16; - - mbs.param[2] = *ptr++; mbs.param[1] = offset; mbs.param[8] = offset >> 16; - isp->isp_mbxwrk1 = ++offset; + offset++; + isp->isp_mbxwrk1 = offset; isp->isp_mbxwrk8 = offset >> 16; break; case MBOX_READ_RAM_WORD_EXTENDED: + if (IS_24XX(isp)) { + uint32_t *lptr = (uint32_t *)ptr; + uint32_t val = isp->isp_mboxtmp[2]; + val |= (isp->isp_mboxtmp[3]) << 16; + *lptr++ = val; + ptr = (uint16_t *)lptr; + } else { + *ptr++ = isp->isp_mboxtmp[2]; + } offset = isp->isp_mbxwrk1; offset |= isp->isp_mbxwrk8 << 16; - - *ptr++ = isp->isp_mboxtmp[2]; mbs.param[1] = offset; mbs.param[8] = offset >> 16; - isp->isp_mbxwrk1 = ++offset; + offset++; + isp->isp_mbxwrk1 = offset; isp->isp_mbxwrk8 = offset >> 16; break; } @@ -6830,7 +6875,7 @@ static const uint32_t mbpfc[] = { ISPOPMAP(0x00, 0x00), /* 0x0c: */ ISPOPMAP(0x10f, 0x01), /* 0x0d: MBOX_WRITE_RAM_WORD_EXTENDED */ ISPOPMAP(0x01, 0x05), /* 0x0e: MBOX_CHECK_FIRMWARE */ - ISPOPMAP(0x10f, 0x05), /* 0x0f: MBOX_READ_RAM_WORD_EXTENDED */ + ISPOPMAP(0x103, 0x0d), /* 0x0f: MBOX_READ_RAM_WORD_EXTENDED */ ISPOPMAP(0x1f, 0x11), /* 0x10: MBOX_INIT_REQ_QUEUE */ ISPOPMAP(0x2f, 0x21), /* 0x11: MBOX_INIT_RES_QUEUE */ ISPOPMAP(0x0f, 0x01), /* 0x12: MBOX_EXECUTE_IOCB */ @@ -6962,13 +7007,13 @@ static const char *fc_mbcmd_names[] = { "MAILBOX REG TEST", "VERIFY CHECKSUM", "ABOUT FIRMWARE", - "LOAD RAM", + "LOAD RAM (2100)", "DUMP RAM", - "WRITE RAM WORD EXTENDED", + "LOAD RISC RAM", NULL, - "READ RAM WORD EXTENDED", + "WRITE RAM WORD EXTENDED", "CHECK FIRMWARE", - NULL, + "READ RAM WORD EXTENDED", "INIT REQUEST QUEUE", "INIT RESULT QUEUE", "EXECUTE IOCB", Modified: head/sys/dev/isp/isp_pci.c ============================================================================== --- head/sys/dev/isp/isp_pci.c Wed Nov 16 02:00:55 2011 (r227547) +++ head/sys/dev/isp/isp_pci.c Wed Nov 16 02:52:24 2011 (r227548) @@ -1458,6 +1458,7 @@ imc(void *arg, bus_dma_segment_t *segs, imushp->error = EINVAL; return; } + isp_prt(imushp->isp, ISP_LOGDEBUG0, "request/result area @ 0x%jx/0x%jx", (uintmax_t) segs->ds_addr, (uintmax_t) segs->ds_len); imushp->isp->isp_rquest = imushp->vbase; imushp->isp->isp_rquest_dma = segs->ds_addr; segs->ds_addr += ISP_QUEUE_SIZE(RQUEST_QUEUE_LEN(imushp->isp)); @@ -1487,6 +1488,7 @@ imc1(void *arg, bus_dma_segment_t *segs, imushp->error = EINVAL; return; } + isp_prt(imushp->isp, ISP_LOGDEBUG0, "scdma @ 0x%jx/0x%jx", (uintmax_t) segs->ds_addr, (uintmax_t) segs->ds_len); FCPARAM(imushp->isp, imushp->chan)->isp_scdma = segs->ds_addr; FCPARAM(imushp->isp, imushp->chan)->isp_scratch = imushp->vbase; } From owner-svn-src-all@FreeBSD.ORG Wed Nov 16 05:05:14 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 018451065675; Wed, 16 Nov 2011 05:05:14 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CA5A18FC17; Wed, 16 Nov 2011 05:05:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAG55Dhg032346; Wed, 16 Nov 2011 05:05:13 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAG55D5R032343; Wed, 16 Nov 2011 05:05:13 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201111160505.pAG55D5R032343@svn.freebsd.org> From: Rick Macklem Date: Wed, 16 Nov 2011 05:05:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227549 - stable/7/sys/nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2011 05:05:14 -0000 Author: rmacklem Date: Wed Nov 16 05:05:13 2011 New Revision: 227549 URL: http://svn.freebsd.org/changeset/base/227549 Log: MFC: r224604 Fix a LOR in the NFS client which could cause a deadlock. This was reported to the mailing list freebsd-net@freebsd.org on July 21, 2011 under the subject "LOR with nfsclient sillyrename". The LOR occurred when nfs_inactive() called vrele(sp->s_dvp) while holding the vnode lock on the file in s_dvp. This patch modifies the client so that it performs the vrele(sp->s_dvp) as a separate task to avoid the LOR. This fix was discussed with jhb@ and kib@, who both proposed variations of it. Modified: stable/7/sys/nfsclient/nfs_node.c stable/7/sys/nfsclient/nfsnode.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/nfsclient/nfs_node.c ============================================================================== --- stable/7/sys/nfsclient/nfs_node.c Wed Nov 16 02:52:24 2011 (r227548) +++ stable/7/sys/nfsclient/nfs_node.c Wed Nov 16 05:05:13 2011 (r227549) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -59,6 +60,8 @@ __FBSDID("$FreeBSD$"); static uma_zone_t nfsnode_zone; +static void nfs_freesillyrename(void *arg, __unused int pending); + #define TRUE 1 #define FALSE 0 @@ -191,6 +194,20 @@ nfs_nget(struct mount *mntp, nfsfh_t *fh return (0); } +/* + * Do the vrele(sp->s_dvp) as a separate task in order to avoid a + * deadlock because of a LOR when vrele() locks the directory vnode. + */ +static void +nfs_freesillyrename(void *arg, __unused int pending) +{ + struct sillyrename *sp; + + sp = arg; + vrele(sp->s_dvp); + free(sp, M_NFSREQ); +} + int nfs_inactive(struct vop_inactive_args *ap) { @@ -213,8 +230,8 @@ nfs_inactive(struct vop_inactive_args *a */ (sp->s_removeit)(sp); crfree(sp->s_cred); - vrele(sp->s_dvp); - FREE((caddr_t)sp, M_NFSREQ); + TASK_INIT(&sp->s_task, 0, nfs_freesillyrename, sp); + taskqueue_enqueue(taskqueue_thread, &sp->s_task); } np->n_flag &= NMODIFIED; return (0); Modified: stable/7/sys/nfsclient/nfsnode.h ============================================================================== --- stable/7/sys/nfsclient/nfsnode.h Wed Nov 16 02:52:24 2011 (r227548) +++ stable/7/sys/nfsclient/nfsnode.h Wed Nov 16 05:05:13 2011 (r227549) @@ -36,6 +36,7 @@ #ifndef _NFSCLIENT_NFSNODE_H_ #define _NFSCLIENT_NFSNODE_H_ +#include #if !defined(_NFSCLIENT_NFS_H_) && !defined(_KERNEL) #include #endif @@ -45,6 +46,7 @@ * can be removed by nfs_inactive() */ struct sillyrename { + struct task s_task; struct ucred *s_cred; struct vnode *s_dvp; int (*s_removeit)(struct sillyrename *sp); From owner-svn-src-all@FreeBSD.ORG Wed Nov 16 05:46:17 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 093EA106566B; Wed, 16 Nov 2011 05:46:17 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [70.36.220.4]) by mx1.freebsd.org (Postfix) with ESMTP id A60DB8FC0A; Wed, 16 Nov 2011 05:46:16 +0000 (UTC) Received: from dhcp-192-168-2-22.wifi.xcllnt.net (atm.xcllnt.net [70.36.220.6]) (authenticated bits=0) by mail.xcllnt.net (8.14.5/8.14.5) with ESMTP id pAG5kARP020674 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Tue, 15 Nov 2011 21:46:15 -0800 (PST) (envelope-from marcel@xcllnt.net) Mime-Version: 1.0 (Apple Message framework v1251.1) Content-Type: text/plain; charset=us-ascii From: Marcel Moolenaar In-Reply-To: <20111115211449.GA476@zim.MIT.EDU> Date: Tue, 15 Nov 2011 21:46:09 -0800 Content-Transfer-Encoding: 7bit Message-Id: <69610C67-D009-48B1-85A5-167D5E7CCFE3@xcllnt.net> References: <201111152015.pAFKFwqb015331@svn.freebsd.org> <4EC2CFDD.7070206@FreeBSD.org> <20111115211449.GA476@zim.MIT.EDU> To: David Schultz X-Mailer: Apple Mail (2.1251.1) Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG, Dimitry Andric Subject: Re: svn commit: r227538 - head/tools/build X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2011 05:46:17 -0000 On Nov 15, 2011, at 1:14 PM, David Schultz wrote: > On Tue, Nov 15, 2011, Dimitry Andric wrote: >> Note all the final executables will use 'real' atomic operations. That >> is, unless you compile with CPUTYPE?=i386, and I wish you the best of >> luck in that case, you'll need it. :) > > I thought we dropped support for anything less than a 486DX years ago. That's besides the point. GCC by default targets i386 on older FreeBSD versions, which means that GCC does not expand atomic operations inline and simple emits calls for them. It's all about how GCC behaves and it has nothing to do with whether we support 80386 CPUs or not. -- Marcel Moolenaar marcel@xcllnt.net From owner-svn-src-all@FreeBSD.ORG Wed Nov 16 06:02:55 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E9B81065677; Wed, 16 Nov 2011 06:02:55 +0000 (UTC) (envelope-from das@freebsd.org) Received: from zim.MIT.EDU (ZIM.MIT.EDU [18.95.3.101]) by mx1.freebsd.org (Postfix) with ESMTP id F3C9A8FC0C; Wed, 16 Nov 2011 06:02:54 +0000 (UTC) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.5/8.14.2) with ESMTP id pAG62sKp002531; Wed, 16 Nov 2011 01:02:54 -0500 (EST) (envelope-from das@freebsd.org) Received: (from das@localhost) by zim.MIT.EDU (8.14.5/8.14.2/Submit) id pAG62sR6002530; Wed, 16 Nov 2011 01:02:54 -0500 (EST) (envelope-from das@freebsd.org) Date: Wed, 16 Nov 2011 01:02:54 -0500 From: David Schultz To: Marcel Moolenaar Message-ID: <20111116060254.GA2460@zim.MIT.EDU> Mail-Followup-To: Marcel Moolenaar , Dimitry Andric , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201111152015.pAFKFwqb015331@svn.freebsd.org> <4EC2CFDD.7070206@FreeBSD.org> <20111115211449.GA476@zim.MIT.EDU> <69610C67-D009-48B1-85A5-167D5E7CCFE3@xcllnt.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <69610C67-D009-48B1-85A5-167D5E7CCFE3@xcllnt.net> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Dimitry Andric Subject: Re: svn commit: r227538 - head/tools/build X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2011 06:02:55 -0000 On Tue, Nov 15, 2011, Marcel Moolenaar wrote: > > On Nov 15, 2011, at 1:14 PM, David Schultz wrote: > > > On Tue, Nov 15, 2011, Dimitry Andric wrote: > >> Note all the final executables will use 'real' atomic operations. That > >> is, unless you compile with CPUTYPE?=i386, and I wish you the best of > >> luck in that case, you'll need it. :) > > > > I thought we dropped support for anything less than a 486DX years ago. > > That's besides the point. GCC by default targets i386 on older > FreeBSD versions, which means that GCC does not expand atomic > operations inline and simple emits calls for them. It's all > about how GCC behaves and it has nothing to do with whether we > support 80386 CPUs or not. Understood. I didn't realize that nobody dragged the default gcc target into the 1990's until 2009. From owner-svn-src-all@FreeBSD.ORG Wed Nov 16 10:11:56 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4EA33106564A; Wed, 16 Nov 2011 10:11:56 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3E9E48FC12; Wed, 16 Nov 2011 10:11:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAGABuSJ041700; Wed, 16 Nov 2011 10:11:56 GMT (envelope-from pho@svn.freebsd.org) Received: (from pho@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAGABt9u041698; Wed, 16 Nov 2011 10:11:56 GMT (envelope-from pho@svn.freebsd.org) Message-Id: <201111161011.pAGABt9u041698@svn.freebsd.org> From: Peter Holm Date: Wed, 16 Nov 2011 10:11:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227550 - head/sys/fs/pseudofs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2011 10:11:56 -0000 Author: pho Date: Wed Nov 16 10:11:55 2011 New Revision: 227550 URL: http://svn.freebsd.org/changeset/base/227550 Log: Handle invalid large values for getdirentries(2) data buffer size. In collaboration with: kib Reviewed by: des Reported by: The iknowthis syscall fuzzer. MFC after: 1 week Modified: head/sys/fs/pseudofs/pseudofs_vnops.c Modified: head/sys/fs/pseudofs/pseudofs_vnops.c ============================================================================== --- head/sys/fs/pseudofs/pseudofs_vnops.c Wed Nov 16 05:05:13 2011 (r227549) +++ head/sys/fs/pseudofs/pseudofs_vnops.c Wed Nov 16 10:11:55 2011 (r227550) @@ -711,6 +711,13 @@ pfs_iterate(struct thread *td, struct pr return (0); } +/* Directory entry list */ +struct pfsentry { + STAILQ_ENTRY(pfsentry) link; + struct dirent entry; +}; +STAILQ_HEAD(pfsdirentlist, pfsentry); + /* * Return directory entries. */ @@ -723,12 +730,14 @@ pfs_readdir(struct vop_readdir_args *va) pid_t pid = pvd->pvd_pid; struct proc *p, *proc; struct pfs_node *pn; - struct dirent *entry; struct uio *uio; + struct pfsentry *pfsent, *pfsent2; + struct pfsdirentlist lst; off_t offset; int error, i, resid; - char *buf, *ent; + STAILQ_INIT(&lst); + error = 0; KASSERT(pd->pn_info == vn->v_mount->mnt_data, ("%s(): pn_info does not match mountpoint", __func__)); PFS_TRACE(("%s pid %lu", pd->pn_name, (unsigned long)pid)); @@ -748,8 +757,6 @@ pfs_readdir(struct vop_readdir_args *va) if (resid == 0) PFS_RETURN (0); - /* can't do this while holding the proc lock... */ - buf = malloc(resid, M_IOV, M_WAITOK | M_ZERO); sx_slock(&allproc_lock); pfs_lock(pd); @@ -757,7 +764,6 @@ pfs_readdir(struct vop_readdir_args *va) if (!pfs_visible(curthread, pd, pid, &proc)) { sx_sunlock(&allproc_lock); pfs_unlock(pd); - free(buf, M_IOV); PFS_RETURN (ENOENT); } KASSERT(pid == NO_PID || proc != NULL, @@ -771,57 +777,64 @@ pfs_readdir(struct vop_readdir_args *va) PROC_UNLOCK(proc); pfs_unlock(pd); sx_sunlock(&allproc_lock); - free(buf, M_IOV); PFS_RETURN (0); } } /* fill in entries */ - ent = buf; while (pfs_iterate(curthread, proc, pd, &pn, &p) != -1 && resid >= PFS_DELEN) { - entry = (struct dirent *)ent; - entry->d_reclen = PFS_DELEN; - entry->d_fileno = pn_fileno(pn, pid); + if ((pfsent = malloc(sizeof(struct pfsentry), M_IOV, + M_NOWAIT | M_ZERO)) == NULL) { + error = ENOMEM; + break; + } + pfsent->entry.d_reclen = PFS_DELEN; + pfsent->entry.d_fileno = pn_fileno(pn, pid); /* PFS_DELEN was picked to fit PFS_NAMLEN */ for (i = 0; i < PFS_NAMELEN - 1 && pn->pn_name[i] != '\0'; ++i) - entry->d_name[i] = pn->pn_name[i]; - entry->d_name[i] = 0; - entry->d_namlen = i; + pfsent->entry.d_name[i] = pn->pn_name[i]; + pfsent->entry.d_name[i] = 0; + pfsent->entry.d_namlen = i; switch (pn->pn_type) { case pfstype_procdir: KASSERT(p != NULL, ("reached procdir node with p == NULL")); - entry->d_namlen = snprintf(entry->d_name, + pfsent->entry.d_namlen = snprintf(pfsent->entry.d_name, PFS_NAMELEN, "%d", p->p_pid); /* fall through */ case pfstype_root: case pfstype_dir: case pfstype_this: case pfstype_parent: - entry->d_type = DT_DIR; + pfsent->entry.d_type = DT_DIR; break; case pfstype_file: - entry->d_type = DT_REG; + pfsent->entry.d_type = DT_REG; break; case pfstype_symlink: - entry->d_type = DT_LNK; + pfsent->entry.d_type = DT_LNK; break; default: panic("%s has unexpected node type: %d", pn->pn_name, pn->pn_type); } - PFS_TRACE(("%s", entry->d_name)); + PFS_TRACE(("%s", pfsent->entry.d_name)); + STAILQ_INSERT_TAIL(&lst, pfsent, link); offset += PFS_DELEN; resid -= PFS_DELEN; - ent += PFS_DELEN; } if (proc != NULL) PROC_UNLOCK(proc); pfs_unlock(pd); sx_sunlock(&allproc_lock); - PFS_TRACE(("%zd bytes", ent - buf)); - error = uiomove(buf, ent - buf, uio); - free(buf, M_IOV); + i = 0; + STAILQ_FOREACH_SAFE(pfsent, &lst, link, pfsent2) { + if (error == 0) + error = uiomove(&pfsent->entry, PFS_DELEN, uio); + free(pfsent, M_IOV); + i++; + } + PFS_TRACE(("%zd bytes", i * PFS_DELEN)); PFS_RETURN (error); } From owner-svn-src-all@FreeBSD.ORG Wed Nov 16 14:28:36 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F3DDD1065672; Wed, 16 Nov 2011 14:28:35 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from sakura.ccs.furiru.org (sakura.ccs.furiru.org [IPv6:2001:2f0:104:8060::1]) by mx1.freebsd.org (Postfix) with ESMTP id 845D78FC08; Wed, 16 Nov 2011 14:28:35 +0000 (UTC) Received: from localhost (authenticated bits=0) by sakura.ccs.furiru.org (unknown) with ESMTP id pAGESSmA096102; Wed, 16 Nov 2011 23:28:33 +0900 (JST) (envelope-from nyan@FreeBSD.org) Date: Wed, 16 Nov 2011 23:28:28 +0900 (JST) Message-Id: <20111116.232828.343708041526200614.nyan@FreeBSD.org> To: nwhitehorn@freebsd.org From: TAKAHASHI Yoshihiro In-Reply-To: <201111151849.pAFInR3K012609@svn.freebsd.org> References: <201111151849.pAFInR3K012609@svn.freebsd.org> X-Mailer: Mew version 6.3 on Emacs 23.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r227536 - in head: release share/man/man7 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2011 14:28:36 -0000 In article <201111151849.pAFInR3K012609@svn.freebsd.org> Nathan Whitehorn writes: > Log: > Further automate production release generation by naming files the right > things and generating checksums. > > Modified: head/release/generate-release.sh > ============================================================================== > --- head/release/generate-release.sh Tue Nov 15 17:53:29 2011 (r227535) > +++ head/release/generate-release.sh Tue Nov 15 18:49:27 2011 (r227536) > @@ -65,3 +66,12 @@ chroot $2 make -C /usr/src $MAKE_FLAGS b > chroot $2 make -C /usr/src/release release > chroot $2 make -C /usr/src/release install DESTDIR=/R > > +: ${RELSTRING=`chroot $2 uname -s`-`chroot $2 uname -r`-`chroot $2 uname -p`} Should this be 'uname -m' rather than 'uname -p'? --- TAKAHASHI Yoshihiro From owner-svn-src-all@FreeBSD.ORG Wed Nov 16 14:33:30 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B07E106566C; Wed, 16 Nov 2011 14:33:30 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 69B7C8FC14; Wed, 16 Nov 2011 14:33:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAGEXU0H052663; Wed, 16 Nov 2011 14:33:30 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAGEXUZd052661; Wed, 16 Nov 2011 14:33:30 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <201111161433.pAGEXUZd052661@svn.freebsd.org> From: Fabien Thomas Date: Wed, 16 Nov 2011 14:33:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227551 - stable/8/contrib/gcc/config/arm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2011 14:33:30 -0000 Author: fabient Date: Wed Nov 16 14:33:30 2011 New Revision: 227551 URL: http://svn.freebsd.org/changeset/base/227551 Log: MFC r227391: Import gcc fix for -fstack-protector that produces segfaulting binaries on arm/armel. Related gcc bug: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35965 Author kindly accepted that all of his patches can be use as GPLv2. PR: 161128 Modified: stable/8/contrib/gcc/config/arm/arm.c Directory Properties: stable/8/contrib/gcc/ (props changed) Modified: stable/8/contrib/gcc/config/arm/arm.c ============================================================================== --- stable/8/contrib/gcc/config/arm/arm.c Wed Nov 16 10:11:55 2011 (r227550) +++ stable/8/contrib/gcc/config/arm/arm.c Wed Nov 16 14:33:30 2011 (r227551) @@ -3217,7 +3217,8 @@ legitimize_pic_address (rtx orig, enum m gcc_assert (!no_new_pseudos); if (arm_pic_register != INVALID_REGNUM) { - cfun->machine->pic_reg = gen_rtx_REG (Pmode, arm_pic_register); + if (!cfun->machine->pic_reg) + cfun->machine->pic_reg = gen_rtx_REG (Pmode, arm_pic_register); /* Play games to avoid marking the function as needing pic if we are being called as part of the cost-estimation @@ -3229,7 +3230,8 @@ legitimize_pic_address (rtx orig, enum m { rtx seq; - cfun->machine->pic_reg = gen_reg_rtx (Pmode); + if (!cfun->machine->pic_reg) + cfun->machine->pic_reg = gen_reg_rtx (Pmode); /* Play games to avoid marking the function as needing pic if we are being called as part of the cost-estimation From owner-svn-src-all@FreeBSD.ORG Wed Nov 16 14:37:48 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 68E47106566B; Wed, 16 Nov 2011 14:37:48 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 57ACE8FC14; Wed, 16 Nov 2011 14:37:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAGEbmsV052842; Wed, 16 Nov 2011 14:37:48 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAGEbmOp052840; Wed, 16 Nov 2011 14:37:48 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <201111161437.pAGEbmOp052840@svn.freebsd.org> From: Fabien Thomas Date: Wed, 16 Nov 2011 14:37:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227552 - stable/7/contrib/gcc/config/arm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2011 14:37:48 -0000 Author: fabient Date: Wed Nov 16 14:37:47 2011 New Revision: 227552 URL: http://svn.freebsd.org/changeset/base/227552 Log: MFC r227391: Import gcc fix for -fstack-protector that produces segfaulting binaries on arm/armel. Related gcc bug: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35965 Author kindly accepted that all of his patches can be use as GPLv2. PR: 161128 Modified: stable/7/contrib/gcc/config/arm/arm.c Directory Properties: stable/7/contrib/gcc/ (props changed) Modified: stable/7/contrib/gcc/config/arm/arm.c ============================================================================== --- stable/7/contrib/gcc/config/arm/arm.c Wed Nov 16 14:33:30 2011 (r227551) +++ stable/7/contrib/gcc/config/arm/arm.c Wed Nov 16 14:37:47 2011 (r227552) @@ -3217,7 +3217,8 @@ legitimize_pic_address (rtx orig, enum m gcc_assert (!no_new_pseudos); if (arm_pic_register != INVALID_REGNUM) { - cfun->machine->pic_reg = gen_rtx_REG (Pmode, arm_pic_register); + if (!cfun->machine->pic_reg) + cfun->machine->pic_reg = gen_rtx_REG (Pmode, arm_pic_register); /* Play games to avoid marking the function as needing pic if we are being called as part of the cost-estimation @@ -3229,7 +3230,8 @@ legitimize_pic_address (rtx orig, enum m { rtx seq; - cfun->machine->pic_reg = gen_reg_rtx (Pmode); + if (!cfun->machine->pic_reg) + cfun->machine->pic_reg = gen_reg_rtx (Pmode); /* Play games to avoid marking the function as needing pic if we are being called as part of the cost-estimation From owner-svn-src-all@FreeBSD.ORG Wed Nov 16 15:23:19 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B9A0B106566C; Wed, 16 Nov 2011 15:23:19 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A87D38FC12; Wed, 16 Nov 2011 15:23:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAGFNJUB054404; Wed, 16 Nov 2011 15:23:19 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAGFNJZa054402; Wed, 16 Nov 2011 15:23:19 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201111161523.pAGFNJZa054402@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Wed, 16 Nov 2011 15:23:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227553 - stable/9/usr.sbin/boot0cfg X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2011 15:23:19 -0000 Author: ae Date: Wed Nov 16 15:23:19 2011 New Revision: 227553 URL: http://svn.freebsd.org/changeset/base/227553 Log: MFC r227274: Add reference to gpart(8). MFC r227298: Remove a note about disabling of GEOM protection mechanism. boot0cfg should work without such hack. Approved by: re (kib) Modified: stable/9/usr.sbin/boot0cfg/boot0cfg.8 Directory Properties: stable/9/usr.sbin/boot0cfg/ (props changed) Modified: stable/9/usr.sbin/boot0cfg/boot0cfg.8 ============================================================================== --- stable/9/usr.sbin/boot0cfg/boot0cfg.8 Wed Nov 16 14:37:47 2011 (r227552) +++ stable/9/usr.sbin/boot0cfg/boot0cfg.8 Wed Nov 16 15:23:19 2011 (r227553) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 13, 2009 +.Dd November 7, 2011 .Dt BOOT0CFG 8 .Os .Sh NAME @@ -153,21 +153,6 @@ Set the timeout value to .It Fl v Verbose: display information about the slices defined, etc. .El -.Sh NOTE -Protection mechanisms in the -.Xr geom 4 -subsystem might prevent -.Nm -from being able to update the MBR on a mounted disk. -Instructions for temporarily disabling these protection mechanisms -can be found in the -.Xr geom 4 -manpage. Specifically, do a -.Pp -.Dl sysctl kern.geom.debugflags=0x10 -.Pp -to allow writing to the MBR, and restore it to 0 afterwards. -.Pp .Sh FILES .Bl -tag -width /boot/boot0sio -compact .It Pa /boot/boot0 @@ -197,7 +182,8 @@ to install the default MBR: .Sh SEE ALSO .Xr geom 4 , .Xr boot 8 , -.Xr fdisk 8 +.Xr fdisk 8 , +.Xr gpart 8 .Sh AUTHORS .An Robert Nordier Aq rnordier@FreeBSD.org . .Sh BUGS From owner-svn-src-all@FreeBSD.ORG Wed Nov 16 15:23:42 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AC899106566B; Wed, 16 Nov 2011 15:23:42 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9BB668FC16; Wed, 16 Nov 2011 15:23:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAGFNgQJ054449; Wed, 16 Nov 2011 15:23:42 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAGFNg3N054447; Wed, 16 Nov 2011 15:23:42 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201111161523.pAGFNg3N054447@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Wed, 16 Nov 2011 15:23:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227554 - releng/9.0/usr.sbin/boot0cfg X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2011 15:23:42 -0000 Author: ae Date: Wed Nov 16 15:23:42 2011 New Revision: 227554 URL: http://svn.freebsd.org/changeset/base/227554 Log: MFC r227274: Add reference to gpart(8). MFC r227298: Remove a note about disabling of GEOM protection mechanism. boot0cfg should work without such hack. Approved by: re (kib) Modified: releng/9.0/usr.sbin/boot0cfg/boot0cfg.8 Directory Properties: releng/9.0/usr.sbin/boot0cfg/ (props changed) Modified: releng/9.0/usr.sbin/boot0cfg/boot0cfg.8 ============================================================================== --- releng/9.0/usr.sbin/boot0cfg/boot0cfg.8 Wed Nov 16 15:23:19 2011 (r227553) +++ releng/9.0/usr.sbin/boot0cfg/boot0cfg.8 Wed Nov 16 15:23:42 2011 (r227554) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 13, 2009 +.Dd November 7, 2011 .Dt BOOT0CFG 8 .Os .Sh NAME @@ -153,21 +153,6 @@ Set the timeout value to .It Fl v Verbose: display information about the slices defined, etc. .El -.Sh NOTE -Protection mechanisms in the -.Xr geom 4 -subsystem might prevent -.Nm -from being able to update the MBR on a mounted disk. -Instructions for temporarily disabling these protection mechanisms -can be found in the -.Xr geom 4 -manpage. Specifically, do a -.Pp -.Dl sysctl kern.geom.debugflags=0x10 -.Pp -to allow writing to the MBR, and restore it to 0 afterwards. -.Pp .Sh FILES .Bl -tag -width /boot/boot0sio -compact .It Pa /boot/boot0 @@ -197,7 +182,8 @@ to install the default MBR: .Sh SEE ALSO .Xr geom 4 , .Xr boot 8 , -.Xr fdisk 8 +.Xr fdisk 8 , +.Xr gpart 8 .Sh AUTHORS .An Robert Nordier Aq rnordier@FreeBSD.org . .Sh BUGS From owner-svn-src-all@FreeBSD.ORG Wed Nov 16 15:24:20 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00F89106566C; Wed, 16 Nov 2011 15:24:20 +0000 (UTC) (envelope-from kensmith@buffalo.edu) Received: from localmailA.acsu.buffalo.edu (localmail.buffalo.edu [128.205.5.196]) by mx1.freebsd.org (Postfix) with ESMTP id 523378FC29; Wed, 16 Nov 2011 15:24:19 +0000 (UTC) Received: from localmailA.acsu.buffalo.edu (localhost [127.0.0.1]) by localhost (Postfix) with SMTP id 58085D673; Wed, 16 Nov 2011 10:24:13 -0500 (EST) Received: from localmailA.acsu.buffalo.edu (localhost [127.0.0.1]) by localmailA.acsu.buffalo.edu (Postfix) with ESMTP id 78977D608; Wed, 16 Nov 2011 10:24:11 -0500 (EST) Received: from smtp3.acsu.buffalo.edu (smtp3.acsu.buffalo.edu [128.205.5.226]) by localmailA.acsu.buffalo.edu (Prefixe) with ESMTP id 5AC5AD606; Wed, 16 Nov 2011 10:24:11 -0500 (EST) Received: from [128.205.32.76] (bauer.cse.buffalo.edu [128.205.32.76]) (Authenticated sender: kensmith@buffalo.edu) by smtp3.acsu.buffalo.edu (Postfix) with ESMTPSA id 402F8491F1; Wed, 16 Nov 2011 10:24:11 -0500 (EST) From: Ken Smith To: Nathan Whitehorn In-Reply-To: <4EC3D40A.5040204@freebsd.org> References: <201111151849.pAFInR3K012609@svn.freebsd.org> <20111116.232828.343708041526200614.nyan@FreeBSD.org> <4EC3D40A.5040204@freebsd.org> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-7czs4ClBsrUr8sV2iqiw" Date: Wed, 16 Nov 2011 10:24:10 -0500 Message-ID: <1321457050.78238.10.camel@bauer.cse.buffalo.edu> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port X-PM-EL-Spam-Prob: : 8% Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, TAKAHASHI Yoshihiro Subject: Re: svn commit: r227536 - in head: release share/man/man7 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2011 15:24:20 -0000 --=-7czs4ClBsrUr8sV2iqiw Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable On Wed, 2011-11-16 at 09:17 -0600, Nathan Whitehorn wrote: > On 11/16/11 08:28, TAKAHASHI Yoshihiro wrote: > > In article<201111151849.pAFInR3K012609@svn.freebsd.org> > > Nathan Whitehorn writes: > > > >> Log: > >> Further automate production release generation by naming files the = right > >> things and generating checksums. > >> > >> Modified: head/release/generate-release.sh > >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > >> --- head/release/generate-release.sh Tue Nov 15 17:53:29 2011 (r227535= ) > >> +++ head/release/generate-release.sh Tue Nov 15 18:49:27 2011 (r227536= ) > >> @@ -65,3 +66,12 @@ chroot $2 make -C /usr/src $MAKE_FLAGS b > >> chroot $2 make -C /usr/src/release release > >> chroot $2 make -C /usr/src/release install DESTDIR=3D/R > >> > >> +: ${RELSTRING=3D`chroot $2 uname -s`-`chroot $2 uname -r`-`chroot $2 = uname -p`} > > Should this be 'uname -m' rather than 'uname -p'? >=20 > There isn't a good option here when there is only one tag -- most of the= =20 > time, I imagine this will get specified in the builder's environment. I= =20 > picked uname -p because there are more possibilities than uname -m: it= =20 > breaks the degeneracies for PPC, ARM, and MIPS, leaving only one for=20 > i386/pc98. uname -m would have been the other way around. > -Nathan >=20 Or both? We're heading in the direction of having both for the FTP server tree. Kinda gross but "FBSD-9.0-RELEASE-amd64-amd64-bootonly.iso"? I don't see a good option among the three possibilities, which are: 1) uname -m only 2) uname -p only 3) both Option 3 at least has the benefit of not being abiguous and covers all the possibilities for builds given the new infrastructure. --=20 Ken Smith - From there to here, from here to | kensmith@buffalo.edu there, funny things are everywhere. | - Theodor Geisel | --=-7czs4ClBsrUr8sV2iqiw Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEABECAAYFAk7D1YwACgkQ/G14VSmup/YECgCfXvlHtuq2w6NIZ0Kqep85PsV/ srQAnRgjHRV7RUdPyDvtRsoyXYft5G4n =Y5eV -----END PGP SIGNATURE----- --=-7czs4ClBsrUr8sV2iqiw-- From owner-svn-src-all@FreeBSD.ORG Wed Nov 16 15:25:13 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 93D8B106564A; Wed, 16 Nov 2011 15:25:13 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 80F328FC1F; Wed, 16 Nov 2011 15:25:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAGFPDrq054544; Wed, 16 Nov 2011 15:25:13 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAGFPDQ6054533; Wed, 16 Nov 2011 15:25:13 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <201111161525.pAGFPDQ6054533@svn.freebsd.org> From: Fabien Thomas Date: Wed, 16 Nov 2011 15:25:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227555 - in stable/8: lib/libpmc sys/dev/hwpmc sys/sys usr.sbin/pmcstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2011 15:25:13 -0000 Author: fabient Date: Wed Nov 16 15:25:12 2011 New Revision: 227555 URL: http://svn.freebsd.org/changeset/base/227555 Log: MFC r226514,r226526,r226986: Add a flush of the current PMC log buffer before displaying the next top. As the underlying block is 4KB if the PMC throughput is low the measurement will be reported on the next tick. pmcstat(8) use the modified flush API to reclaim current buffer before displaying next top. Modified: stable/8/lib/libpmc/libpmc.c stable/8/lib/libpmc/pmc.3 stable/8/lib/libpmc/pmc.h stable/8/lib/libpmc/pmc_configure_logfile.3 stable/8/sys/dev/hwpmc/hwpmc_logging.c stable/8/sys/dev/hwpmc/hwpmc_mod.c stable/8/sys/sys/pmc.h stable/8/sys/sys/pmclog.h stable/8/usr.sbin/pmcstat/pmcstat.c stable/8/usr.sbin/pmcstat/pmcstat_log.c Directory Properties: stable/8/lib/libpmc/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/usr.sbin/pmcstat/ (props changed) Modified: stable/8/lib/libpmc/libpmc.c ============================================================================== --- stable/8/lib/libpmc/libpmc.c Wed Nov 16 15:23:42 2011 (r227554) +++ stable/8/lib/libpmc/libpmc.c Wed Nov 16 15:25:12 2011 (r227555) @@ -2560,6 +2560,12 @@ pmc_flush_logfile(void) } int +pmc_close_logfile(void) +{ + return (PMC_CALL(CLOSELOG,0)); +} + +int pmc_get_driver_stats(struct pmc_driverstats *ds) { struct pmc_op_getdriverstats gms; Modified: stable/8/lib/libpmc/pmc.3 ============================================================================== --- stable/8/lib/libpmc/pmc.3 Wed Nov 16 15:23:42 2011 (r227554) +++ stable/8/lib/libpmc/pmc.3 Wed Nov 16 15:25:12 2011 (r227555) @@ -322,6 +322,10 @@ to write logged events to. Flush all pending log data in .Xr hwpmc 4 Ns Ap s buffers. +.It Fn pmc_close_logfile +Flush all pending log data and close +.Xr hwpmc 4 Ns Ap s +side of the stream. .It Fn pmc_writelog Append arbitrary user data to the current log file. .El Modified: stable/8/lib/libpmc/pmc.h ============================================================================== --- stable/8/lib/libpmc/pmc.h Wed Nov 16 15:23:42 2011 (r227554) +++ stable/8/lib/libpmc/pmc.h Wed Nov 16 15:25:12 2011 (r227555) @@ -76,6 +76,7 @@ int pmc_attach(pmc_id_t _pmcid, pid_t _p int pmc_capabilities(pmc_id_t _pmc, uint32_t *_caps); int pmc_configure_logfile(int _fd); int pmc_flush_logfile(void); +int pmc_close_logfile(void); int pmc_detach(pmc_id_t _pmcid, pid_t _pid); int pmc_disable(int _cpu, int _pmc); int pmc_enable(int _cpu, int _pmc); Modified: stable/8/lib/libpmc/pmc_configure_logfile.3 ============================================================================== --- stable/8/lib/libpmc/pmc_configure_logfile.3 Wed Nov 16 15:23:42 2011 (r227554) +++ stable/8/lib/libpmc/pmc_configure_logfile.3 Wed Nov 16 15:25:12 2011 (r227555) @@ -29,7 +29,8 @@ .Sh NAME .Nm pmc_configure_logfile , .Nm pmc_flush_logfile , -.Nm pmc_writelog +.Nm pmc_writelog , +.Nm pmc_close_logfile .Nd log file management .Sh LIBRARY .Lb libpmc @@ -41,6 +42,8 @@ .Fn pmc_flush_logfile void .Ft int .Fn pmc_writelog "uint32_t userdata" +.Ft int +.Fn pmc_close_logfile void .Sh DESCRIPTION The functions manage logging of .Xr hwpmc 4 @@ -72,6 +75,12 @@ Function will append a log entry containing the value of argument .Fa userdata to the log file. +.Pp +Function +.Fn pmc_close_logfile +will flush all pending log data and close +.Xr hwpmc 4 Ns Ap s +side of the stream. .Sh RETURN VALUES .Rv -std .Sh ERRORS Modified: stable/8/sys/dev/hwpmc/hwpmc_logging.c ============================================================================== --- stable/8/sys/dev/hwpmc/hwpmc_logging.c Wed Nov 16 15:23:42 2011 (r227554) +++ stable/8/sys/dev/hwpmc/hwpmc_logging.c Wed Nov 16 15:25:12 2011 (r227555) @@ -237,7 +237,7 @@ pmclog_get_buffer(struct pmc_owner *po) static void pmclog_loop(void *arg) { - int error, last_buffer; + int error; struct pmc_owner *po; struct pmclog_buffer *lb; struct proc *p; @@ -252,7 +252,6 @@ pmclog_loop(void *arg) p = po->po_owner; td = curthread; mycred = td->td_ucred; - last_buffer = 0; PROC_LOCK(p); ownercred = crhold(p->p_ucred); @@ -285,14 +284,22 @@ pmclog_loop(void *arg) if ((lb = TAILQ_FIRST(&po->po_logbuffers)) == NULL) { mtx_unlock_spin(&po->po_mtx); + if (po->po_flags & PMC_PO_SHUTDOWN) { + mtx_unlock(&pmc_kthread_mtx); + /* + * Close the file to get PMCLOG_EOF + * error in pmclog(3). + */ + fo_close(po->po_file, curthread); + mtx_lock(&pmc_kthread_mtx); + } + (void) msleep(po, &pmc_kthread_mtx, PWAIT, "pmcloop", 0); continue; } TAILQ_REMOVE(&po->po_logbuffers, lb, plb_next); - if (po->po_flags & PMC_PO_SHUTDOWN) - last_buffer = TAILQ_EMPTY(&po->po_logbuffers); mtx_unlock_spin(&po->po_mtx); } @@ -335,14 +342,6 @@ pmclog_loop(void *arg) break; } - if (last_buffer) { - /* - * Close the file to get PMCLOG_EOF error - * in pmclog(3). - */ - fo_close(po->po_file, curthread); - } - mtx_lock(&pmc_kthread_mtx); /* put the used buffer back into the global pool */ @@ -692,6 +691,7 @@ int pmclog_flush(struct pmc_owner *po) { int error; + struct pmclog_buffer *lb; PMCDBG(LOG,FLS,1, "po=%p", po); @@ -714,11 +714,38 @@ pmclog_flush(struct pmc_owner *po) } /* - * Schedule the current buffer if any. + * Schedule the current buffer if any and not empty. + */ + mtx_lock_spin(&po->po_mtx); + lb = po->po_curbuf; + if (lb && lb->plb_ptr != lb->plb_base) { + pmclog_schedule_io(po); + } else + error = ENOBUFS; + mtx_unlock_spin(&po->po_mtx); + + error: + mtx_unlock(&pmc_kthread_mtx); + + return (error); +} + +int +pmclog_close(struct pmc_owner *po) +{ + + PMCDBG(LOG,CLO,1, "po=%p", po); + + mtx_lock(&pmc_kthread_mtx); + + /* + * Schedule the current buffer. */ mtx_lock_spin(&po->po_mtx); if (po->po_curbuf) pmclog_schedule_io(po); + else + wakeup_one(po); mtx_unlock_spin(&po->po_mtx); /* @@ -727,13 +754,11 @@ pmclog_flush(struct pmc_owner *po) */ po->po_flags |= PMC_PO_SHUTDOWN; - error: mtx_unlock(&pmc_kthread_mtx); - return (error); + return (0); } - void pmclog_process_callchain(struct pmc *pm, struct pmc_sample *ps) { Modified: stable/8/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- stable/8/sys/dev/hwpmc/hwpmc_mod.c Wed Nov 16 15:23:42 2011 (r227554) +++ stable/8/sys/dev/hwpmc/hwpmc_mod.c Wed Nov 16 15:25:12 2011 (r227555) @@ -2891,7 +2891,7 @@ pmc_syscall_handler(struct thread *td, v error = pmclog_configure_log(md, po, cl.pm_logfd); } else if (po->po_flags & PMC_PO_OWNS_LOGFILE) { pmclog_process_closelog(po); - error = pmclog_flush(po); + error = pmclog_close(po); if (error == 0) { LIST_FOREACH(pm, &po->po_pmcs, pm_next) if (pm->pm_flags & PMC_F_NEEDS_LOGFILE && @@ -2907,7 +2907,6 @@ pmc_syscall_handler(struct thread *td, v } break; - /* * Flush a log file. */ @@ -2928,6 +2927,25 @@ pmc_syscall_handler(struct thread *td, v break; /* + * Close a log file. + */ + + case PMC_OP_CLOSELOG: + { + struct pmc_owner *po; + + sx_assert(&pmc_sx, SX_XLOCKED); + + if ((po = pmc_find_owner_descriptor(td->td_proc)) == NULL) { + error = EINVAL; + break; + } + + error = pmclog_close(po); + } + break; + + /* * Retrieve hardware configuration. */ Modified: stable/8/sys/sys/pmc.h ============================================================================== --- stable/8/sys/sys/pmc.h Wed Nov 16 15:23:42 2011 (r227554) +++ stable/8/sys/sys/pmc.h Wed Nov 16 15:25:12 2011 (r227555) @@ -300,7 +300,8 @@ enum pmc_event { __PMC_OP(PMCSETCOUNT, "Set initial count/sampling rate") \ __PMC_OP(PMCSTART, "Start a PMC") \ __PMC_OP(PMCSTOP, "Start a PMC") \ - __PMC_OP(WRITELOG, "Write a cookie to the log file") + __PMC_OP(WRITELOG, "Write a cookie to the log file") \ + __PMC_OP(CLOSELOG, "Close log file") enum pmc_ops { @@ -1037,6 +1038,7 @@ extern struct pmc_debugflags pmc_debugfl #define PMC_DEBUG_MIN_SIO 9 /* schedule i/o */ #define PMC_DEBUG_MIN_FLS 10 /* flush */ #define PMC_DEBUG_MIN_SAM 11 /* sample */ +#define PMC_DEBUG_MIN_CLO 12 /* close */ #else #define PMCDBG(M,N,L,F,...) /* nothing */ Modified: stable/8/sys/sys/pmclog.h ============================================================================== --- stable/8/sys/sys/pmclog.h Wed Nov 16 15:23:42 2011 (r227554) +++ stable/8/sys/sys/pmclog.h Wed Nov 16 15:25:12 2011 (r227555) @@ -243,6 +243,7 @@ int pmclog_configure_log(struct pmc_mdep int _logfd); int pmclog_deconfigure_log(struct pmc_owner *_po); int pmclog_flush(struct pmc_owner *_po); +int pmclog_close(struct pmc_owner *_po); void pmclog_initialize(void); void pmclog_process_callchain(struct pmc *_pm, struct pmc_sample *_ps); void pmclog_process_closelog(struct pmc_owner *po); Modified: stable/8/usr.sbin/pmcstat/pmcstat.c ============================================================================== --- stable/8/usr.sbin/pmcstat/pmcstat.c Wed Nov 16 15:23:42 2011 (r227554) +++ stable/8/usr.sbin/pmcstat/pmcstat.c Wed Nov 16 15:25:12 2011 (r227555) @@ -555,7 +555,7 @@ main(int argc, char **argv) int option, npmc, ncpu, haltedcpus; int c, check_driver_stats, current_cpu, current_sampling_count; int do_callchain, do_descendants, do_logproccsw, do_logprocexit; - int do_print; + int do_print, do_read; size_t dummy; int graphdepth; int pipefd[2], rfd; @@ -797,7 +797,9 @@ main(int argc, char **argv) break; case 'o': /* outputfile */ - if (args.pa_printfile != NULL) + if (args.pa_printfile != NULL && + args.pa_printfile != stdout && + args.pa_printfile != stderr) (void) fclose(args.pa_printfile); if ((args.pa_printfile = fopen(optarg, "w")) == NULL) errx(EX_OSERR, "ERROR: cannot open \"%s\" for " @@ -1329,7 +1331,7 @@ main(int argc, char **argv) * are killed by a SIGINT. */ runstate = PMCSTAT_RUNNING; - do_print = 0; + do_print = do_read = 0; do { if ((c = kevent(pmcstat_kq, NULL, 0, &kev, 1, NULL)) <= 0) { if (errno != EINTR) @@ -1352,8 +1354,10 @@ main(int argc, char **argv) (args.pa_flags & FLAG_DO_TOP)) { if (pmcstat_keypress_log()) runstate = pmcstat_close_log(); - } else + } else { + do_read = 0; runstate = pmcstat_process_log(); + } break; case EVFILT_SIGNAL: @@ -1378,9 +1382,6 @@ main(int argc, char **argv) /* Kill the child process if we started it */ if (args.pa_flags & FLAG_HAS_COMMANDLINE) pmcstat_kill_process(); - /* Close the pipe to self, if present. */ - if (args.pa_flags & FLAG_HAS_PIPE) - (void) close(pipefd[READPIPEFD]); runstate = pmcstat_close_log(); } else if (kev.ident == SIGWINCH) { if (ioctl(fileno(args.pa_printfile), @@ -1395,12 +1396,15 @@ main(int argc, char **argv) break; case EVFILT_TIMER: /* print out counting PMCs */ + if ((args.pa_flags & FLAG_DO_TOP) && + pmc_flush_logfile() == 0) + do_read = 1; do_print = 1; break; } - if (do_print) { + if (do_print && !do_read) { if ((args.pa_required & FLAG_HAS_OUTPUT_LOGFILE) == 0) { pmcstat_print_pmcs(); if (runstate == PMCSTAT_FINISHED && /* final newline */ @@ -1421,7 +1425,7 @@ main(int argc, char **argv) /* flush any pending log entries */ if (args.pa_flags & (FLAG_HAS_OUTPUT_LOGFILE | FLAG_HAS_PIPE)) - pmc_flush_logfile(); + pmc_close_logfile(); pmcstat_cleanup(); Modified: stable/8/usr.sbin/pmcstat/pmcstat_log.c ============================================================================== --- stable/8/usr.sbin/pmcstat/pmcstat_log.c Wed Nov 16 15:23:42 2011 (r227554) +++ stable/8/usr.sbin/pmcstat/pmcstat_log.c Wed Nov 16 15:25:12 2011 (r227555) @@ -1703,7 +1703,7 @@ pmcstat_close_log(void) * so keep the status to EXITING. */ if (args.pa_logfd != -1) { - if (pmc_flush_logfile() < 0) + if (pmc_close_logfile() < 0) err(EX_OSERR, "ERROR: logging failed"); } From owner-svn-src-all@FreeBSD.ORG Wed Nov 16 15:32:32 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9838B1065675; Wed, 16 Nov 2011 15:32:32 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8707A8FC19; Wed, 16 Nov 2011 15:32:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAGFWWU2054790; Wed, 16 Nov 2011 15:32:32 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAGFWWbH054788; Wed, 16 Nov 2011 15:32:32 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201111161532.pAGFWWbH054788@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Wed, 16 Nov 2011 15:32:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227556 - stable/9/sbin/bsdlabel X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2011 15:32:32 -0000 Author: ae Date: Wed Nov 16 15:32:32 2011 New Revision: 227556 URL: http://svn.freebsd.org/changeset/base/227556 Log: MFC r227231: To be in sync with GEOM_PART_BSD limit the maximum number of supported partitions to 20. MFC r227248: bsdlabel(8) could automatically fill many of disklabel's deprecated fields, but user could specify some of those fields when edits disklabel with `bsdlabel -e`. But without -A flag these fields might be overwritten with default values from the virgin disklabel. So, don't overwrite such fields if they are not zero. Also add checks to prevent creating disklabel with less than DEFPARTITIONS and more than MAXPARTITIONS partitions. PR: bin/162332 Tested by: Eugene Grosbein MFC r227262: Remove unneeded checks. MFC r227270: Add recommendation to use gpart(8) when user tries write disklabel or bootcode to already opened provider. MFC r227296: Fix multi-line comment formatting. Approved by: re (kib) Modified: stable/9/sbin/bsdlabel/bsdlabel.c Directory Properties: stable/9/sbin/bsdlabel/ (props changed) Modified: stable/9/sbin/bsdlabel/bsdlabel.c ============================================================================== --- stable/9/sbin/bsdlabel/bsdlabel.c Wed Nov 16 15:25:12 2011 (r227555) +++ stable/9/sbin/bsdlabel/bsdlabel.c Wed Nov 16 15:32:32 2011 (r227556) @@ -63,7 +63,7 @@ __FBSDID("$FreeBSD$"); #include #define DKTYPENAMES #define FSTYPENAMES -#define MAXPARTITIONS 26 +#define MAXPARTITIONS 20 #include #include @@ -80,7 +80,7 @@ __FBSDID("$FreeBSD$"); #include "pathnames.h" static void makelabel(const char *, struct disklabel *); -static int geom_bsd_available(void); +static int geom_class_available(const char *); static int writelabel(void); static int readlabel(int flag); static void display(FILE *, const struct disklabel *); @@ -355,7 +355,7 @@ readboot(void) } static int -geom_bsd_available(void) +geom_class_available(const char *name) { struct gclass *class; struct gmesh mesh; @@ -366,7 +366,7 @@ geom_bsd_available(void) errc(1, error, "Cannot get GEOM tree"); LIST_FOREACH(class, &mesh.lg_class, lg_class) { - if (strcmp(class->lg_name, "BSD") == 0) { + if (strcmp(class->lg_name, name) == 0) { geom_deletetree(&mesh); return (1); } @@ -411,8 +411,20 @@ writelabel(void) } else serrno = errno; + if (geom_class_available("PART") != 0) { + /* + * Since we weren't able open provider for + * writing, then recommend user to use gpart(8). + */ + warnc(serrno, + "cannot open provider %s for writing label", + specname); + warnx("Try to use gpart(8)."); + return (1); + } + /* Give up if GEOM_BSD is not available. */ - if (geom_bsd_available() == 0) { + if (geom_class_available("BSD") == 0) { warnc(serrno, "%s", specname); return (1); } @@ -831,11 +843,16 @@ getasciilabel(FILE *f, struct disklabel continue; } if (sscanf(cp, "%lu partitions", &v) == 1) { - if (v == 0 || v > MAXPARTITIONS) { + if (v > MAXPARTITIONS) { fprintf(stderr, "line %d: bad # of partitions\n", lineno); lp->d_npartitions = MAXPARTITIONS; errors++; + } else if (v < DEFPARTITIONS) { + fprintf(stderr, + "line %d: bad # of partitions\n", lineno); + lp->d_npartitions = DEFPARTITIONS; + errors++; } else lp->d_npartitions = v; continue; @@ -1149,23 +1166,41 @@ checklabel(struct disklabel *lp) errors++; } else if (lp->d_bbsize % lp->d_secsize) warnx("boot block size %% sector-size != 0"); - if (lp->d_npartitions > MAXPARTITIONS) + if (lp->d_npartitions > MAXPARTITIONS) { warnx("number of partitions (%lu) > MAXPARTITIONS (%d)", (u_long)lp->d_npartitions, MAXPARTITIONS); + errors++; + } + if (lp->d_npartitions < DEFPARTITIONS) { + warnx("number of partitions (%lu) < DEFPARTITIONS (%d)", + (u_long)lp->d_npartitions, DEFPARTITIONS); + errors++; + } } else { struct disklabel *vl; vl = getvirginlabel(); - lp->d_secsize = vl->d_secsize; - lp->d_nsectors = vl->d_nsectors; - lp->d_ntracks = vl->d_ntracks; - lp->d_ncylinders = vl->d_ncylinders; - lp->d_rpm = vl->d_rpm; - lp->d_interleave = vl->d_interleave; - lp->d_secpercyl = vl->d_secpercyl; - lp->d_secperunit = vl->d_secperunit; - lp->d_bbsize = vl->d_bbsize; - lp->d_npartitions = vl->d_npartitions; + if (lp->d_secsize == 0) + lp->d_secsize = vl->d_secsize; + if (lp->d_nsectors == 0) + lp->d_nsectors = vl->d_nsectors; + if (lp->d_ntracks == 0) + lp->d_ntracks = vl->d_ntracks; + if (lp->d_ncylinders == 0) + lp->d_ncylinders = vl->d_ncylinders; + if (lp->d_rpm == 0) + lp->d_rpm = vl->d_rpm; + if (lp->d_interleave == 0) + lp->d_interleave = vl->d_interleave; + if (lp->d_secpercyl == 0) + lp->d_secpercyl = vl->d_secpercyl; + if (lp->d_secperunit == 0) + lp->d_secperunit = vl->d_secperunit; + if (lp->d_bbsize == 0) + lp->d_bbsize = vl->d_bbsize; + if (lp->d_npartitions < DEFPARTITIONS || + lp->d_npartitions > MAXPARTITIONS) + lp->d_npartitions = vl->d_npartitions; } From owner-svn-src-all@FreeBSD.ORG Wed Nov 16 15:32:53 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 469C51065670; Wed, 16 Nov 2011 15:32:53 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3615B8FC1E; Wed, 16 Nov 2011 15:32:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAGFWrf2054837; Wed, 16 Nov 2011 15:32:53 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAGFWr2D054835; Wed, 16 Nov 2011 15:32:53 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201111161532.pAGFWr2D054835@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Wed, 16 Nov 2011 15:32:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227557 - releng/9.0/sbin/bsdlabel X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2011 15:32:53 -0000 Author: ae Date: Wed Nov 16 15:32:52 2011 New Revision: 227557 URL: http://svn.freebsd.org/changeset/base/227557 Log: MFC r227231: To be in sync with GEOM_PART_BSD limit the maximum number of supported partitions to 20. MFC r227248: bsdlabel(8) could automatically fill many of disklabel's deprecated fields, but user could specify some of those fields when edits disklabel with `bsdlabel -e`. But without -A flag these fields might be overwritten with default values from the virgin disklabel. So, don't overwrite such fields if they are not zero. Also add checks to prevent creating disklabel with less than DEFPARTITIONS and more than MAXPARTITIONS partitions. PR: bin/162332 Tested by: Eugene Grosbein MFC r227262: Remove unneeded checks. MFC r227270: Add recommendation to use gpart(8) when user tries write disklabel or bootcode to already opened provider. MFC r227296: Fix multi-line comment formatting. Approved by: re (kib) Modified: releng/9.0/sbin/bsdlabel/bsdlabel.c Directory Properties: releng/9.0/sbin/bsdlabel/ (props changed) Modified: releng/9.0/sbin/bsdlabel/bsdlabel.c ============================================================================== --- releng/9.0/sbin/bsdlabel/bsdlabel.c Wed Nov 16 15:32:32 2011 (r227556) +++ releng/9.0/sbin/bsdlabel/bsdlabel.c Wed Nov 16 15:32:52 2011 (r227557) @@ -63,7 +63,7 @@ __FBSDID("$FreeBSD$"); #include #define DKTYPENAMES #define FSTYPENAMES -#define MAXPARTITIONS 26 +#define MAXPARTITIONS 20 #include #include @@ -80,7 +80,7 @@ __FBSDID("$FreeBSD$"); #include "pathnames.h" static void makelabel(const char *, struct disklabel *); -static int geom_bsd_available(void); +static int geom_class_available(const char *); static int writelabel(void); static int readlabel(int flag); static void display(FILE *, const struct disklabel *); @@ -355,7 +355,7 @@ readboot(void) } static int -geom_bsd_available(void) +geom_class_available(const char *name) { struct gclass *class; struct gmesh mesh; @@ -366,7 +366,7 @@ geom_bsd_available(void) errc(1, error, "Cannot get GEOM tree"); LIST_FOREACH(class, &mesh.lg_class, lg_class) { - if (strcmp(class->lg_name, "BSD") == 0) { + if (strcmp(class->lg_name, name) == 0) { geom_deletetree(&mesh); return (1); } @@ -411,8 +411,20 @@ writelabel(void) } else serrno = errno; + if (geom_class_available("PART") != 0) { + /* + * Since we weren't able open provider for + * writing, then recommend user to use gpart(8). + */ + warnc(serrno, + "cannot open provider %s for writing label", + specname); + warnx("Try to use gpart(8)."); + return (1); + } + /* Give up if GEOM_BSD is not available. */ - if (geom_bsd_available() == 0) { + if (geom_class_available("BSD") == 0) { warnc(serrno, "%s", specname); return (1); } @@ -831,11 +843,16 @@ getasciilabel(FILE *f, struct disklabel continue; } if (sscanf(cp, "%lu partitions", &v) == 1) { - if (v == 0 || v > MAXPARTITIONS) { + if (v > MAXPARTITIONS) { fprintf(stderr, "line %d: bad # of partitions\n", lineno); lp->d_npartitions = MAXPARTITIONS; errors++; + } else if (v < DEFPARTITIONS) { + fprintf(stderr, + "line %d: bad # of partitions\n", lineno); + lp->d_npartitions = DEFPARTITIONS; + errors++; } else lp->d_npartitions = v; continue; @@ -1149,23 +1166,41 @@ checklabel(struct disklabel *lp) errors++; } else if (lp->d_bbsize % lp->d_secsize) warnx("boot block size %% sector-size != 0"); - if (lp->d_npartitions > MAXPARTITIONS) + if (lp->d_npartitions > MAXPARTITIONS) { warnx("number of partitions (%lu) > MAXPARTITIONS (%d)", (u_long)lp->d_npartitions, MAXPARTITIONS); + errors++; + } + if (lp->d_npartitions < DEFPARTITIONS) { + warnx("number of partitions (%lu) < DEFPARTITIONS (%d)", + (u_long)lp->d_npartitions, DEFPARTITIONS); + errors++; + } } else { struct disklabel *vl; vl = getvirginlabel(); - lp->d_secsize = vl->d_secsize; - lp->d_nsectors = vl->d_nsectors; - lp->d_ntracks = vl->d_ntracks; - lp->d_ncylinders = vl->d_ncylinders; - lp->d_rpm = vl->d_rpm; - lp->d_interleave = vl->d_interleave; - lp->d_secpercyl = vl->d_secpercyl; - lp->d_secperunit = vl->d_secperunit; - lp->d_bbsize = vl->d_bbsize; - lp->d_npartitions = vl->d_npartitions; + if (lp->d_secsize == 0) + lp->d_secsize = vl->d_secsize; + if (lp->d_nsectors == 0) + lp->d_nsectors = vl->d_nsectors; + if (lp->d_ntracks == 0) + lp->d_ntracks = vl->d_ntracks; + if (lp->d_ncylinders == 0) + lp->d_ncylinders = vl->d_ncylinders; + if (lp->d_rpm == 0) + lp->d_rpm = vl->d_rpm; + if (lp->d_interleave == 0) + lp->d_interleave = vl->d_interleave; + if (lp->d_secpercyl == 0) + lp->d_secpercyl = vl->d_secpercyl; + if (lp->d_secperunit == 0) + lp->d_secperunit = vl->d_secperunit; + if (lp->d_bbsize == 0) + lp->d_bbsize = vl->d_bbsize; + if (lp->d_npartitions < DEFPARTITIONS || + lp->d_npartitions > MAXPARTITIONS) + lp->d_npartitions = vl->d_npartitions; } From owner-svn-src-all@FreeBSD.ORG Wed Nov 16 15:35:05 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA2541065670; Wed, 16 Nov 2011 15:35:05 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B95998FC1C; Wed, 16 Nov 2011 15:35:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAGFZ57C054956; Wed, 16 Nov 2011 15:35:05 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAGFZ5lk054954; Wed, 16 Nov 2011 15:35:05 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201111161535.pAGFZ5lk054954@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Wed, 16 Nov 2011 15:35:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227558 - stable/9/sbin/fdisk_pc98 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2011 15:35:05 -0000 Author: ae Date: Wed Nov 16 15:35:05 2011 New Revision: 227558 URL: http://svn.freebsd.org/changeset/base/227558 Log: MFC rr227273: Add reference to gpart(8). Approved by: re (kib) Modified: stable/9/sbin/fdisk_pc98/fdisk.8 Directory Properties: stable/9/sbin/fdisk_pc98/ (props changed) Modified: stable/9/sbin/fdisk_pc98/fdisk.8 ============================================================================== --- stable/9/sbin/fdisk_pc98/fdisk.8 Wed Nov 16 15:32:52 2011 (r227557) +++ stable/9/sbin/fdisk_pc98/fdisk.8 Wed Nov 16 15:35:05 2011 (r227558) @@ -446,6 +446,7 @@ Example: to make slice 1 the active slic .Sh SEE ALSO .Xr boot98cfg 8 , .Xr bsdlabel 8 , +.Xr gpart 8 , .Xr newfs 8 .Sh BUGS The default boot code will not necessarily handle all slice types From owner-svn-src-all@FreeBSD.ORG Wed Nov 16 15:35:22 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9763410656D4; Wed, 16 Nov 2011 15:35:22 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 872F98FC12; Wed, 16 Nov 2011 15:35:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAGFZMWo055004; Wed, 16 Nov 2011 15:35:22 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAGFZMQW055002; Wed, 16 Nov 2011 15:35:22 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201111161535.pAGFZMQW055002@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Wed, 16 Nov 2011 15:35:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227559 - releng/9.0/sbin/fdisk_pc98 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2011 15:35:22 -0000 Author: ae Date: Wed Nov 16 15:35:22 2011 New Revision: 227559 URL: http://svn.freebsd.org/changeset/base/227559 Log: MFC rr227273: Add reference to gpart(8). Approved by: re (kib) Modified: releng/9.0/sbin/fdisk_pc98/fdisk.8 Directory Properties: releng/9.0/sbin/fdisk_pc98/ (props changed) Modified: releng/9.0/sbin/fdisk_pc98/fdisk.8 ============================================================================== --- releng/9.0/sbin/fdisk_pc98/fdisk.8 Wed Nov 16 15:35:05 2011 (r227558) +++ releng/9.0/sbin/fdisk_pc98/fdisk.8 Wed Nov 16 15:35:22 2011 (r227559) @@ -446,6 +446,7 @@ Example: to make slice 1 the active slic .Sh SEE ALSO .Xr boot98cfg 8 , .Xr bsdlabel 8 , +.Xr gpart 8 , .Xr newfs 8 .Sh BUGS The default boot code will not necessarily handle all slice types From owner-svn-src-all@FreeBSD.ORG Wed Nov 16 15:36:53 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D888D106566C; Wed, 16 Nov 2011 15:36:53 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C75738FC1D; Wed, 16 Nov 2011 15:36:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAGFarU3055090; Wed, 16 Nov 2011 15:36:53 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAGFarLF055087; Wed, 16 Nov 2011 15:36:53 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201111161536.pAGFarLF055087@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Wed, 16 Nov 2011 15:36:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227560 - stable/9/sbin/fdisk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2011 15:36:54 -0000 Author: ae Date: Wed Nov 16 15:36:53 2011 New Revision: 227560 URL: http://svn.freebsd.org/changeset/base/227560 Log: MFC r227272: Add reference to gpart(8). MFC r227280: Initialize "acc" value inside the loop to reset failed attempts. PR: misc/162262 MFC r227292: Improve error reporting when MBR can not be written. Remove obsolete code which uses DIOCSMBR ioctl. When writing MBR first check that GEOM_MBR is available, if it is not available, then try write MBR directly to provider. If both are failed, then recommend to use gpart(8). MFC r227295: Fix multi-line comment formatting. Pointed by: jh Approved by: re (kib) Modified: stable/9/sbin/fdisk/fdisk.8 stable/9/sbin/fdisk/fdisk.c Directory Properties: stable/9/sbin/fdisk/ (props changed) Modified: stable/9/sbin/fdisk/fdisk.8 ============================================================================== --- stable/9/sbin/fdisk/fdisk.8 Wed Nov 16 15:35:22 2011 (r227559) +++ stable/9/sbin/fdisk/fdisk.8 Wed Nov 16 15:36:53 2011 (r227560) @@ -476,6 +476,7 @@ The default boot code. .Sh SEE ALSO .Xr boot0cfg 8 , .Xr bsdlabel 8 , +.Xr gpart 8 , .Xr newfs 8 .Sh BUGS The default boot code will not necessarily handle all slice types Modified: stable/9/sbin/fdisk/fdisk.c ============================================================================== --- stable/9/sbin/fdisk/fdisk.c Wed Nov 16 15:35:22 2011 (r227559) +++ stable/9/sbin/fdisk/fdisk.c Wed Nov 16 15:36:53 2011 (r227560) @@ -232,6 +232,7 @@ get_type(int t) } +static int geom_class_available(const char *); static void print_s0(void); static void print_part(const struct dos_partition *); static void init_sector0(unsigned long start); @@ -767,49 +768,76 @@ read_disk(off_t sector, void *buf) } static int -write_disk(off_t sector, void *buf) +geom_class_available(const char *name) { + struct gclass *class; + struct gmesh mesh; int error; + + error = geom_gettree(&mesh); + if (error != 0) + errc(1, error, "Cannot get GEOM tree"); + + LIST_FOREACH(class, &mesh.lg_class, lg_class) { + if (strcmp(class->lg_name, name) == 0) { + geom_deletetree(&mesh); + return (1); + } + } + + geom_deletetree(&mesh); + + return (0); +} + +static int +write_disk(off_t sector, void *buf) +{ struct gctl_req *grq; const char *errmsg; - char fbuf[BUFSIZ], *pname; - int i, fdw; + char *pname; + int error; - grq = gctl_get_handle(); - gctl_ro_param(grq, "verb", -1, "write MBR"); - gctl_ro_param(grq, "class", -1, "MBR"); - pname = g_providername(fd); - if (pname == NULL) { - warn("Error getting providername for %s", disk); - return (-1); - } - gctl_ro_param(grq, "geom", -1, pname); - gctl_ro_param(grq, "data", secsize, buf); - errmsg = gctl_issue(grq); - free(pname); - if (errmsg == NULL) { + /* Check that GEOM_MBR is available */ + if (geom_class_available("MBR") != 0) { + grq = gctl_get_handle(); + gctl_ro_param(grq, "verb", -1, "write MBR"); + gctl_ro_param(grq, "class", -1, "MBR"); + pname = g_providername(fd); + if (pname == NULL) { + warn("Error getting providername for %s", disk); + return (-1); + } + gctl_ro_param(grq, "geom", -1, pname); + gctl_ro_param(grq, "data", secsize, buf); + errmsg = gctl_issue(grq); + free(pname); + if (errmsg == NULL) { + gctl_free(grq); + return(0); + } + if (!q_flag) + warnx("GEOM_MBR: %s", errmsg); gctl_free(grq); - return(0); - } - if (!q_flag) /* GEOM errors are benign, not all devices supported */ - warnx("%s", errmsg); - gctl_free(grq); - - error = pwrite(fd, buf, secsize, (sector * 512)); - if (error == secsize) - return (0); - - for (i = 1; i < 5; i++) { - sprintf(fbuf, "%ss%d", disk, i); - fdw = open(fbuf, O_RDWR, 0); - if (fdw < 0) - continue; - error = ioctl(fdw, DIOCSMBR, buf); - close(fdw); - if (error == 0) + } else { + /* + * Try to write MBR directly. This may help when disk + * is not in use. + * XXX: hardcoded sectorsize + */ + error = pwrite(fd, buf, secsize, (sector * 512)); + if (error == secsize) return (0); } - warnx("Failed to write sector zero"); + + /* + * GEOM_MBR is not available or failed to write MBR. + * Now check that we have GEOM_PART and recommend to use gpart (8). + */ + if (geom_class_available("PART") != 0) + warnx("Failed to write MBR. Try to use gpart(8)."); + else + warnx("Failed to write sector zero"); return(EINVAL); } @@ -920,11 +948,12 @@ ok(const char *str) static int decimal(const char *str, int *num, int deflt, uint32_t maxval) { - long long acc = 0; + long long acc; int c; char *cp; while (1) { + acc = 0; printf("Supply a decimal value for \"%s\" [%d] ", str, deflt); fflush(stdout); if (fgets(lbuf, LBUF, stdin) == NULL) @@ -960,7 +989,6 @@ decimal(const char *str, int *num, int d printf("%s is an invalid decimal number. Try again.\n", lbuf); } - } From owner-svn-src-all@FreeBSD.ORG Wed Nov 16 15:37:14 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 58365106566B; Wed, 16 Nov 2011 15:37:14 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 479C18FC17; Wed, 16 Nov 2011 15:37:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAGFbEcv055140; Wed, 16 Nov 2011 15:37:14 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAGFbEF8055137; Wed, 16 Nov 2011 15:37:14 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201111161537.pAGFbEF8055137@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Wed, 16 Nov 2011 15:37:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227561 - releng/9.0/sbin/fdisk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2011 15:37:14 -0000 Author: ae Date: Wed Nov 16 15:37:13 2011 New Revision: 227561 URL: http://svn.freebsd.org/changeset/base/227561 Log: MFC r227272: Add reference to gpart(8). MFC r227280: Initialize "acc" value inside the loop to reset failed attempts. PR: misc/162262 MFC r227292: Improve error reporting when MBR can not be written. Remove obsolete code which uses DIOCSMBR ioctl. When writing MBR first check that GEOM_MBR is available, if it is not available, then try write MBR directly to provider. If both are failed, then recommend to use gpart(8). MFC r227295: Fix multi-line comment formatting. Pointed by: jh Approved by: re (kib) Modified: releng/9.0/sbin/fdisk/fdisk.8 releng/9.0/sbin/fdisk/fdisk.c Directory Properties: releng/9.0/sbin/fdisk/ (props changed) Modified: releng/9.0/sbin/fdisk/fdisk.8 ============================================================================== --- releng/9.0/sbin/fdisk/fdisk.8 Wed Nov 16 15:36:53 2011 (r227560) +++ releng/9.0/sbin/fdisk/fdisk.8 Wed Nov 16 15:37:13 2011 (r227561) @@ -476,6 +476,7 @@ The default boot code. .Sh SEE ALSO .Xr boot0cfg 8 , .Xr bsdlabel 8 , +.Xr gpart 8 , .Xr newfs 8 .Sh BUGS The default boot code will not necessarily handle all slice types Modified: releng/9.0/sbin/fdisk/fdisk.c ============================================================================== --- releng/9.0/sbin/fdisk/fdisk.c Wed Nov 16 15:36:53 2011 (r227560) +++ releng/9.0/sbin/fdisk/fdisk.c Wed Nov 16 15:37:13 2011 (r227561) @@ -232,6 +232,7 @@ get_type(int t) } +static int geom_class_available(const char *); static void print_s0(void); static void print_part(const struct dos_partition *); static void init_sector0(unsigned long start); @@ -767,49 +768,76 @@ read_disk(off_t sector, void *buf) } static int -write_disk(off_t sector, void *buf) +geom_class_available(const char *name) { + struct gclass *class; + struct gmesh mesh; int error; + + error = geom_gettree(&mesh); + if (error != 0) + errc(1, error, "Cannot get GEOM tree"); + + LIST_FOREACH(class, &mesh.lg_class, lg_class) { + if (strcmp(class->lg_name, name) == 0) { + geom_deletetree(&mesh); + return (1); + } + } + + geom_deletetree(&mesh); + + return (0); +} + +static int +write_disk(off_t sector, void *buf) +{ struct gctl_req *grq; const char *errmsg; - char fbuf[BUFSIZ], *pname; - int i, fdw; + char *pname; + int error; - grq = gctl_get_handle(); - gctl_ro_param(grq, "verb", -1, "write MBR"); - gctl_ro_param(grq, "class", -1, "MBR"); - pname = g_providername(fd); - if (pname == NULL) { - warn("Error getting providername for %s", disk); - return (-1); - } - gctl_ro_param(grq, "geom", -1, pname); - gctl_ro_param(grq, "data", secsize, buf); - errmsg = gctl_issue(grq); - free(pname); - if (errmsg == NULL) { + /* Check that GEOM_MBR is available */ + if (geom_class_available("MBR") != 0) { + grq = gctl_get_handle(); + gctl_ro_param(grq, "verb", -1, "write MBR"); + gctl_ro_param(grq, "class", -1, "MBR"); + pname = g_providername(fd); + if (pname == NULL) { + warn("Error getting providername for %s", disk); + return (-1); + } + gctl_ro_param(grq, "geom", -1, pname); + gctl_ro_param(grq, "data", secsize, buf); + errmsg = gctl_issue(grq); + free(pname); + if (errmsg == NULL) { + gctl_free(grq); + return(0); + } + if (!q_flag) + warnx("GEOM_MBR: %s", errmsg); gctl_free(grq); - return(0); - } - if (!q_flag) /* GEOM errors are benign, not all devices supported */ - warnx("%s", errmsg); - gctl_free(grq); - - error = pwrite(fd, buf, secsize, (sector * 512)); - if (error == secsize) - return (0); - - for (i = 1; i < 5; i++) { - sprintf(fbuf, "%ss%d", disk, i); - fdw = open(fbuf, O_RDWR, 0); - if (fdw < 0) - continue; - error = ioctl(fdw, DIOCSMBR, buf); - close(fdw); - if (error == 0) + } else { + /* + * Try to write MBR directly. This may help when disk + * is not in use. + * XXX: hardcoded sectorsize + */ + error = pwrite(fd, buf, secsize, (sector * 512)); + if (error == secsize) return (0); } - warnx("Failed to write sector zero"); + + /* + * GEOM_MBR is not available or failed to write MBR. + * Now check that we have GEOM_PART and recommend to use gpart (8). + */ + if (geom_class_available("PART") != 0) + warnx("Failed to write MBR. Try to use gpart(8)."); + else + warnx("Failed to write sector zero"); return(EINVAL); } @@ -920,11 +948,12 @@ ok(const char *str) static int decimal(const char *str, int *num, int deflt, uint32_t maxval) { - long long acc = 0; + long long acc; int c; char *cp; while (1) { + acc = 0; printf("Supply a decimal value for \"%s\" [%d] ", str, deflt); fflush(stdout); if (fgets(lbuf, LBUF, stdin) == NULL) @@ -960,7 +989,6 @@ decimal(const char *str, int *num, int d printf("%s is an invalid decimal number. Try again.\n", lbuf); } - } From owner-svn-src-all@FreeBSD.ORG Wed Nov 16 15:39:27 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9DF5D1065676; Wed, 16 Nov 2011 15:39:27 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8D7478FC18; Wed, 16 Nov 2011 15:39:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAGFdRJI055248; Wed, 16 Nov 2011 15:39:27 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAGFdRsY055242; Wed, 16 Nov 2011 15:39:27 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201111161539.pAGFdRsY055242@svn.freebsd.org> From: John Baldwin Date: Wed, 16 Nov 2011 15:39:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227562 - head/sys/dev/mfi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2011 15:39:27 -0000 Author: jhb Date: Wed Nov 16 15:39:27 2011 New Revision: 227562 URL: http://svn.freebsd.org/changeset/base/227562 Log: Add single-message MSI support to mfi(4). It is disabled by default but can be enabled via the hw.mfi.msi tunable. Many mfi(4) controllers also support MSI-X, but in testing it seems that many adapters do not work with MSI-X but do work with MSI. MFC after: 2 weeks Modified: head/sys/dev/mfi/mfi.c head/sys/dev/mfi/mfi_cam.c head/sys/dev/mfi/mfi_disk.c head/sys/dev/mfi/mfi_pci.c head/sys/dev/mfi/mfivar.h Modified: head/sys/dev/mfi/mfi.c ============================================================================== --- head/sys/dev/mfi/mfi.c Wed Nov 16 15:37:13 2011 (r227561) +++ head/sys/dev/mfi/mfi.c Wed Nov 16 15:39:27 2011 (r227562) @@ -117,7 +117,7 @@ static int mfi_check_clear_intr_ppc(str static void mfi_issue_cmd_xscale(struct mfi_softc *sc,uint32_t bus_add,uint32_t frame_cnt); static void mfi_issue_cmd_ppc(struct mfi_softc *sc,uint32_t bus_add,uint32_t frame_cnt); -static SYSCTL_NODE(_hw, OID_AUTO, mfi, CTLFLAG_RD, 0, "MFI driver parameters"); +SYSCTL_NODE(_hw, OID_AUTO, mfi, CTLFLAG_RD, 0, "MFI driver parameters"); static int mfi_event_locale = MFI_EVT_LOCALE_ALL; TUNABLE_INT("hw.mfi.event_locale", &mfi_event_locale); SYSCTL_INT(_hw_mfi, OID_AUTO, event_locale, CTLFLAG_RW, &mfi_event_locale, @@ -484,15 +484,8 @@ mfi_attach(struct mfi_softc *sc) mtx_unlock(&sc->mfi_io_lock); /* - * Set up the interrupt handler. XXX This should happen in - * mfi_pci.c + * Set up the interrupt handler. */ - sc->mfi_irq_rid = 0; - if ((sc->mfi_irq = bus_alloc_resource_any(sc->mfi_dev, SYS_RES_IRQ, - &sc->mfi_irq_rid, RF_SHAREABLE | RF_ACTIVE)) == NULL) { - device_printf(sc->mfi_dev, "Cannot allocate interrupt\n"); - return (EINVAL); - } if (bus_setup_intr(sc->mfi_dev, sc->mfi_irq, INTR_MPSAFE|INTR_TYPE_BIO, NULL, mfi_intr, sc, &sc->mfi_intr)) { device_printf(sc->mfi_dev, "Cannot set up interrupt\n"); Modified: head/sys/dev/mfi/mfi_cam.c ============================================================================== --- head/sys/dev/mfi/mfi_cam.c Wed Nov 16 15:37:13 2011 (r227561) +++ head/sys/dev/mfi/mfi_cam.c Wed Nov 16 15:39:27 2011 (r227562) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: head/sys/dev/mfi/mfi_disk.c ============================================================================== --- head/sys/dev/mfi/mfi_disk.c Wed Nov 16 15:37:13 2011 (r227561) +++ head/sys/dev/mfi/mfi_disk.c Wed Nov 16 15:39:27 2011 (r227562) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: head/sys/dev/mfi/mfi_pci.c ============================================================================== --- head/sys/dev/mfi/mfi_pci.c Wed Nov 16 15:37:13 2011 (r227561) +++ head/sys/dev/mfi/mfi_pci.c Wed Nov 16 15:39:27 2011 (r227562) @@ -66,6 +66,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -107,6 +108,11 @@ static devclass_t mfi_devclass; DRIVER_MODULE(mfi, pci, mfi_pci_driver, mfi_devclass, 0, 0); MODULE_VERSION(mfi, 1); +static int mfi_msi = 0; +TUNABLE_INT("hw.mfi.msi", &mfi_msi); +SYSCTL_INT(_hw_mfi, OID_AUTO, msi, CTLFLAG_RDTUN, &mfi_msi, 0, + "Enable use of MSI interrupts"); + struct mfi_ident { uint16_t vendor; uint16_t device; @@ -169,7 +175,7 @@ mfi_pci_attach(device_t dev) struct mfi_softc *sc; struct mfi_ident *m; uint32_t command; - int error; + int count, error; sc = device_get_softc(dev); bzero(sc, sizeof(*sc)); @@ -226,6 +232,20 @@ mfi_pci_attach(device_t dev) goto out; } + /* Allocate IRQ resource. */ + sc->mfi_irq_rid = 0; + count = 1; + if (mfi_msi && pci_alloc_msi(sc->mfi_dev, &count) == 0) { + device_printf(sc->mfi_dev, "Using MSI\n"); + sc->mfi_irq_rid = 1; + } + if ((sc->mfi_irq = bus_alloc_resource_any(sc->mfi_dev, SYS_RES_IRQ, + &sc->mfi_irq_rid, RF_SHAREABLE | RF_ACTIVE)) == NULL) { + device_printf(sc->mfi_dev, "Cannot allocate interrupt\n"); + error = EINVAL; + goto out; + } + error = mfi_attach(sc); out: if (error) { @@ -280,6 +300,8 @@ mfi_pci_free(struct mfi_softc *sc) bus_release_resource(sc->mfi_dev, SYS_RES_MEMORY, sc->mfi_regs_rid, sc->mfi_regs_resource); } + if (sc->mfi_irq_rid != 0) + pci_release_msi(sc->mfi_dev); return; } Modified: head/sys/dev/mfi/mfivar.h ============================================================================== --- head/sys/dev/mfi/mfivar.h Wed Nov 16 15:37:13 2011 (r227561) +++ head/sys/dev/mfi/mfivar.h Wed Nov 16 15:39:27 2011 (r227562) @@ -395,6 +395,7 @@ mfi_print_sense(struct mfi_softc *sc, vo (sc)->mfi_bhandle, (reg)) MALLOC_DECLARE(M_MFIBUF); +SYSCTL_DECL(_hw_mfi); #define MFI_CMD_TIMEOUT 30 #define MFI_MAXPHYS (128 * 1024) From owner-svn-src-all@FreeBSD.ORG Wed Nov 16 16:15:32 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 707A4106566C; Wed, 16 Nov 2011 16:15:32 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5D8038FC08; Wed, 16 Nov 2011 16:15:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAGGFWAf056544; Wed, 16 Nov 2011 16:15:32 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAGGFWhG056533; Wed, 16 Nov 2011 16:15:32 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <201111161615.pAGGFWhG056533@svn.freebsd.org> From: Fabien Thomas Date: Wed, 16 Nov 2011 16:15:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227563 - in stable/7: lib/libpmc sys/dev/hwpmc sys/sys usr.sbin/pmcstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2011 16:15:32 -0000 Author: fabient Date: Wed Nov 16 16:15:31 2011 New Revision: 227563 URL: http://svn.freebsd.org/changeset/base/227563 Log: MFC r226514,r226526,r226986: Add a flush of the current PMC log buffer before displaying the next top. As the underlying block is 4KB if the PMC throughput is low the measurement will be reported on the next tick. pmcstat(8) use the modified flush API to reclaim current buffer before displaying next top. Modified: stable/7/lib/libpmc/libpmc.c stable/7/lib/libpmc/pmc.3 stable/7/lib/libpmc/pmc.h stable/7/lib/libpmc/pmc_configure_logfile.3 stable/7/sys/dev/hwpmc/hwpmc_logging.c stable/7/sys/dev/hwpmc/hwpmc_mod.c stable/7/sys/sys/pmc.h stable/7/sys/sys/pmclog.h stable/7/usr.sbin/pmcstat/pmcstat.c stable/7/usr.sbin/pmcstat/pmcstat_log.c Directory Properties: stable/7/lib/libpmc/ (props changed) stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/usr.sbin/pmcstat/ (props changed) Modified: stable/7/lib/libpmc/libpmc.c ============================================================================== --- stable/7/lib/libpmc/libpmc.c Wed Nov 16 15:39:27 2011 (r227562) +++ stable/7/lib/libpmc/libpmc.c Wed Nov 16 16:15:31 2011 (r227563) @@ -2498,6 +2498,12 @@ pmc_flush_logfile(void) } int +pmc_close_logfile(void) +{ + return (PMC_CALL(CLOSELOG,0)); +} + +int pmc_get_driver_stats(struct pmc_driverstats *ds) { struct pmc_op_getdriverstats gms; Modified: stable/7/lib/libpmc/pmc.3 ============================================================================== --- stable/7/lib/libpmc/pmc.3 Wed Nov 16 15:39:27 2011 (r227562) +++ stable/7/lib/libpmc/pmc.3 Wed Nov 16 16:15:31 2011 (r227563) @@ -322,6 +322,10 @@ to write logged events to. Flush all pending log data in .Xr hwpmc 4 Ns Ap s buffers. +.It Fn pmc_close_logfile +Flush all pending log data and close +.Xr hwpmc 4 Ns Ap s +side of the stream. .It Fn pmc_writelog Append arbitrary user data to the current log file. .El Modified: stable/7/lib/libpmc/pmc.h ============================================================================== --- stable/7/lib/libpmc/pmc.h Wed Nov 16 15:39:27 2011 (r227562) +++ stable/7/lib/libpmc/pmc.h Wed Nov 16 16:15:31 2011 (r227563) @@ -76,6 +76,7 @@ int pmc_attach(pmc_id_t _pmcid, pid_t _p int pmc_capabilities(pmc_id_t _pmc, uint32_t *_caps); int pmc_configure_logfile(int _fd); int pmc_flush_logfile(void); +int pmc_close_logfile(void); int pmc_detach(pmc_id_t _pmcid, pid_t _pid); int pmc_disable(int _cpu, int _pmc); int pmc_enable(int _cpu, int _pmc); Modified: stable/7/lib/libpmc/pmc_configure_logfile.3 ============================================================================== --- stable/7/lib/libpmc/pmc_configure_logfile.3 Wed Nov 16 15:39:27 2011 (r227562) +++ stable/7/lib/libpmc/pmc_configure_logfile.3 Wed Nov 16 16:15:31 2011 (r227563) @@ -29,7 +29,8 @@ .Sh NAME .Nm pmc_configure_logfile , .Nm pmc_flush_logfile , -.Nm pmc_writelog +.Nm pmc_writelog , +.Nm pmc_close_logfile .Nd log file management .Sh LIBRARY .Lb libpmc @@ -41,6 +42,8 @@ .Fn pmc_flush_logfile void .Ft int .Fn pmc_writelog "uint32_t userdata" +.Ft int +.Fn pmc_close_logfile void .Sh DESCRIPTION The functions manage logging of .Xr hwpmc 4 @@ -72,6 +75,12 @@ Function will append a log entry containing the value of argument .Fa userdata to the log file. +.Pp +Function +.Fn pmc_close_logfile +will flush all pending log data and close +.Xr hwpmc 4 Ns Ap s +side of the stream. .Sh RETURN VALUES .Rv -std .Sh ERRORS Modified: stable/7/sys/dev/hwpmc/hwpmc_logging.c ============================================================================== --- stable/7/sys/dev/hwpmc/hwpmc_logging.c Wed Nov 16 15:39:27 2011 (r227562) +++ stable/7/sys/dev/hwpmc/hwpmc_logging.c Wed Nov 16 16:15:31 2011 (r227563) @@ -237,7 +237,7 @@ pmclog_get_buffer(struct pmc_owner *po) static void pmclog_loop(void *arg) { - int error, last_buffer; + int error; struct pmc_owner *po; struct pmclog_buffer *lb; struct proc *p; @@ -252,7 +252,6 @@ pmclog_loop(void *arg) p = po->po_owner; td = curthread; mycred = td->td_ucred; - last_buffer = 0; PROC_LOCK(p); ownercred = crhold(p->p_ucred); @@ -285,14 +284,22 @@ pmclog_loop(void *arg) if ((lb = TAILQ_FIRST(&po->po_logbuffers)) == NULL) { mtx_unlock_spin(&po->po_mtx); + if (po->po_flags & PMC_PO_SHUTDOWN) { + mtx_unlock(&pmc_kthread_mtx); + /* + * Close the file to get PMCLOG_EOF + * error in pmclog(3). + */ + fo_close(po->po_file, curthread); + mtx_lock(&pmc_kthread_mtx); + } + (void) msleep(po, &pmc_kthread_mtx, PWAIT, "pmcloop", 0); continue; } TAILQ_REMOVE(&po->po_logbuffers, lb, plb_next); - if (po->po_flags & PMC_PO_SHUTDOWN) - last_buffer = TAILQ_EMPTY(&po->po_logbuffers); mtx_unlock_spin(&po->po_mtx); } @@ -335,14 +342,6 @@ pmclog_loop(void *arg) break; } - if (last_buffer) { - /* - * Close the file to get PMCLOG_EOF error - * in pmclog(3). - */ - fo_close(po->po_file, curthread); - } - mtx_lock(&pmc_kthread_mtx); /* put the used buffer back into the global pool */ @@ -692,6 +691,7 @@ int pmclog_flush(struct pmc_owner *po) { int error; + struct pmclog_buffer *lb; PMCDBG(LOG,FLS,1, "po=%p", po); @@ -714,11 +714,38 @@ pmclog_flush(struct pmc_owner *po) } /* - * Schedule the current buffer if any. + * Schedule the current buffer if any and not empty. + */ + mtx_lock_spin(&po->po_mtx); + lb = po->po_curbuf; + if (lb && lb->plb_ptr != lb->plb_base) { + pmclog_schedule_io(po); + } else + error = ENOBUFS; + mtx_unlock_spin(&po->po_mtx); + + error: + mtx_unlock(&pmc_kthread_mtx); + + return (error); +} + +int +pmclog_close(struct pmc_owner *po) +{ + + PMCDBG(LOG,CLO,1, "po=%p", po); + + mtx_lock(&pmc_kthread_mtx); + + /* + * Schedule the current buffer. */ mtx_lock_spin(&po->po_mtx); if (po->po_curbuf) pmclog_schedule_io(po); + else + wakeup_one(po); mtx_unlock_spin(&po->po_mtx); /* @@ -727,13 +754,11 @@ pmclog_flush(struct pmc_owner *po) */ po->po_flags |= PMC_PO_SHUTDOWN; - error: mtx_unlock(&pmc_kthread_mtx); - return (error); + return (0); } - void pmclog_process_callchain(struct pmc *pm, struct pmc_sample *ps) { Modified: stable/7/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- stable/7/sys/dev/hwpmc/hwpmc_mod.c Wed Nov 16 15:39:27 2011 (r227562) +++ stable/7/sys/dev/hwpmc/hwpmc_mod.c Wed Nov 16 16:15:31 2011 (r227563) @@ -2894,7 +2894,7 @@ pmc_syscall_handler(struct thread *td, v error = pmclog_configure_log(md, po, cl.pm_logfd); } else if (po->po_flags & PMC_PO_OWNS_LOGFILE) { pmclog_process_closelog(po); - error = pmclog_flush(po); + error = pmclog_close(po); if (error == 0) { LIST_FOREACH(pm, &po->po_pmcs, pm_next) if (pm->pm_flags & PMC_F_NEEDS_LOGFILE && @@ -2910,7 +2910,6 @@ pmc_syscall_handler(struct thread *td, v } break; - /* * Flush a log file. */ @@ -2931,6 +2930,25 @@ pmc_syscall_handler(struct thread *td, v break; /* + * Close a log file. + */ + + case PMC_OP_CLOSELOG: + { + struct pmc_owner *po; + + sx_assert(&pmc_sx, SX_XLOCKED); + + if ((po = pmc_find_owner_descriptor(td->td_proc)) == NULL) { + error = EINVAL; + break; + } + + error = pmclog_close(po); + } + break; + + /* * Retrieve hardware configuration. */ Modified: stable/7/sys/sys/pmc.h ============================================================================== --- stable/7/sys/sys/pmc.h Wed Nov 16 15:39:27 2011 (r227562) +++ stable/7/sys/sys/pmc.h Wed Nov 16 16:15:31 2011 (r227563) @@ -298,7 +298,8 @@ enum pmc_event { __PMC_OP(PMCSETCOUNT, "Set initial count/sampling rate") \ __PMC_OP(PMCSTART, "Start a PMC") \ __PMC_OP(PMCSTOP, "Start a PMC") \ - __PMC_OP(WRITELOG, "Write a cookie to the log file") + __PMC_OP(WRITELOG, "Write a cookie to the log file") \ + __PMC_OP(CLOSELOG, "Close log file") enum pmc_ops { @@ -1040,6 +1041,7 @@ extern struct pmc_debugflags pmc_debugfl #define PMC_DEBUG_MIN_SIO 9 /* schedule i/o */ #define PMC_DEBUG_MIN_FLS 10 /* flush */ #define PMC_DEBUG_MIN_SAM 11 /* sample */ +#define PMC_DEBUG_MIN_CLO 12 /* close */ #else #define PMCDBG(M,N,L,F,...) /* nothing */ Modified: stable/7/sys/sys/pmclog.h ============================================================================== --- stable/7/sys/sys/pmclog.h Wed Nov 16 15:39:27 2011 (r227562) +++ stable/7/sys/sys/pmclog.h Wed Nov 16 16:15:31 2011 (r227563) @@ -243,6 +243,7 @@ int pmclog_configure_log(struct pmc_mdep int _logfd); int pmclog_deconfigure_log(struct pmc_owner *_po); int pmclog_flush(struct pmc_owner *_po); +int pmclog_close(struct pmc_owner *_po); void pmclog_initialize(void); void pmclog_process_callchain(struct pmc *_pm, struct pmc_sample *_ps); void pmclog_process_closelog(struct pmc_owner *po); Modified: stable/7/usr.sbin/pmcstat/pmcstat.c ============================================================================== --- stable/7/usr.sbin/pmcstat/pmcstat.c Wed Nov 16 15:39:27 2011 (r227562) +++ stable/7/usr.sbin/pmcstat/pmcstat.c Wed Nov 16 16:15:31 2011 (r227563) @@ -555,7 +555,7 @@ main(int argc, char **argv) int option, npmc, ncpu, haltedcpus; int c, check_driver_stats, current_cpu, current_sampling_count; int do_callchain, do_descendants, do_logproccsw, do_logprocexit; - int do_print; + int do_print, do_read; size_t dummy; int graphdepth; int pipefd[2], rfd; @@ -797,7 +797,9 @@ main(int argc, char **argv) break; case 'o': /* outputfile */ - if (args.pa_printfile != NULL) + if (args.pa_printfile != NULL && + args.pa_printfile != stdout && + args.pa_printfile != stderr) (void) fclose(args.pa_printfile); if ((args.pa_printfile = fopen(optarg, "w")) == NULL) errx(EX_OSERR, "ERROR: cannot open \"%s\" for " @@ -1329,7 +1331,7 @@ main(int argc, char **argv) * are killed by a SIGINT. */ runstate = PMCSTAT_RUNNING; - do_print = 0; + do_print = do_read = 0; do { if ((c = kevent(pmcstat_kq, NULL, 0, &kev, 1, NULL)) <= 0) { if (errno != EINTR) @@ -1352,8 +1354,10 @@ main(int argc, char **argv) (args.pa_flags & FLAG_DO_TOP)) { if (pmcstat_keypress_log()) runstate = pmcstat_close_log(); - } else + } else { + do_read = 0; runstate = pmcstat_process_log(); + } break; case EVFILT_SIGNAL: @@ -1378,9 +1382,6 @@ main(int argc, char **argv) /* Kill the child process if we started it */ if (args.pa_flags & FLAG_HAS_COMMANDLINE) pmcstat_kill_process(); - /* Close the pipe to self, if present. */ - if (args.pa_flags & FLAG_HAS_PIPE) - (void) close(pipefd[READPIPEFD]); runstate = pmcstat_close_log(); } else if (kev.ident == SIGWINCH) { if (ioctl(fileno(args.pa_printfile), @@ -1395,12 +1396,15 @@ main(int argc, char **argv) break; case EVFILT_TIMER: /* print out counting PMCs */ + if ((args.pa_flags & FLAG_DO_TOP) && + pmc_flush_logfile() == 0) + do_read = 1; do_print = 1; break; } - if (do_print) { + if (do_print && !do_read) { if ((args.pa_required & FLAG_HAS_OUTPUT_LOGFILE) == 0) { pmcstat_print_pmcs(); if (runstate == PMCSTAT_FINISHED && /* final newline */ @@ -1421,7 +1425,7 @@ main(int argc, char **argv) /* flush any pending log entries */ if (args.pa_flags & (FLAG_HAS_OUTPUT_LOGFILE | FLAG_HAS_PIPE)) - pmc_flush_logfile(); + pmc_close_logfile(); pmcstat_cleanup(); Modified: stable/7/usr.sbin/pmcstat/pmcstat_log.c ============================================================================== --- stable/7/usr.sbin/pmcstat/pmcstat_log.c Wed Nov 16 15:39:27 2011 (r227562) +++ stable/7/usr.sbin/pmcstat/pmcstat_log.c Wed Nov 16 16:15:31 2011 (r227563) @@ -1703,7 +1703,7 @@ pmcstat_close_log(void) * so keep the status to EXITING. */ if (args.pa_logfd != -1) { - if (pmc_flush_logfile() < 0) + if (pmc_close_logfile() < 0) err(EX_OSERR, "ERROR: logging failed"); } From owner-svn-src-all@FreeBSD.ORG Wed Nov 16 16:24:36 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD9961065670; Wed, 16 Nov 2011 16:24:36 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CC9A78FC17; Wed, 16 Nov 2011 16:24:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAGGOavm056898; Wed, 16 Nov 2011 16:24:36 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAGGOa0n056896; Wed, 16 Nov 2011 16:24:36 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201111161624.pAGGOa0n056896@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Wed, 16 Nov 2011 16:24:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227564 - stable/8/sbin/bsdlabel X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2011 16:24:37 -0000 Author: ae Date: Wed Nov 16 16:24:36 2011 New Revision: 227564 URL: http://svn.freebsd.org/changeset/base/227564 Log: MFC r227231: To be in sync with GEOM_PART_BSD limit the maximum number of supported partitions to 20. MFC r227248: bsdlabel(8) could automatically fill many of disklabel's deprecated fields, but user could specify some of those fields when edits disklabel with `bsdlabel -e`. But without -A flag these fields might be overwritten with default values from the virgin disklabel. So, don't overwrite such fields if they are not zero. Also add checks to prevent creating disklabel with less than DEFPARTITIONS and more than MAXPARTITIONS partitions. PR: bin/162332 Tested by: Eugene Grosbein MFC r227262: Remove unneeded checks. MFC r227270: Add recommendation to use gpart(8) when user tries write disklabel or bootcode to already opened provider. M2C r227296: Fix multi-line comment formatting. Modified: stable/8/sbin/bsdlabel/bsdlabel.c Directory Properties: stable/8/sbin/bsdlabel/ (props changed) Modified: stable/8/sbin/bsdlabel/bsdlabel.c ============================================================================== --- stable/8/sbin/bsdlabel/bsdlabel.c Wed Nov 16 16:15:31 2011 (r227563) +++ stable/8/sbin/bsdlabel/bsdlabel.c Wed Nov 16 16:24:36 2011 (r227564) @@ -63,7 +63,7 @@ __FBSDID("$FreeBSD$"); #include #define DKTYPENAMES #define FSTYPENAMES -#define MAXPARTITIONS 26 +#define MAXPARTITIONS 20 #include #include @@ -80,7 +80,7 @@ __FBSDID("$FreeBSD$"); #include "pathnames.h" static void makelabel(const char *, struct disklabel *); -static int geom_bsd_available(void); +static int geom_class_available(const char *); static int writelabel(void); static int readlabel(int flag); static void display(FILE *, const struct disklabel *); @@ -354,7 +354,7 @@ readboot(void) } static int -geom_bsd_available(void) +geom_class_available(const char *name) { struct gclass *class; struct gmesh mesh; @@ -365,7 +365,7 @@ geom_bsd_available(void) errc(1, error, "Cannot get GEOM tree"); LIST_FOREACH(class, &mesh.lg_class, lg_class) { - if (strcmp(class->lg_name, "BSD") == 0) { + if (strcmp(class->lg_name, name) == 0) { geom_deletetree(&mesh); return (1); } @@ -410,8 +410,20 @@ writelabel(void) } else serrno = errno; + if (geom_class_available("PART") != 0) { + /* + * Since we weren't able open provider for + * writing, then recommend user to use gpart(8). + */ + warnc(serrno, + "cannot open provider %s for writing label", + specname); + warnx("Try to use gpart(8)."); + return (1); + } + /* Give up if GEOM_BSD is not available. */ - if (geom_bsd_available() == 0) { + if (geom_class_available("BSD") == 0) { warnc(serrno, "%s", specname); return (1); } @@ -824,11 +836,16 @@ getasciilabel(FILE *f, struct disklabel continue; } if (sscanf(cp, "%lu partitions", &v) == 1) { - if (v == 0 || v > MAXPARTITIONS) { + if (v > MAXPARTITIONS) { fprintf(stderr, "line %d: bad # of partitions\n", lineno); lp->d_npartitions = MAXPARTITIONS; errors++; + } else if (v < DEFPARTITIONS) { + fprintf(stderr, + "line %d: bad # of partitions\n", lineno); + lp->d_npartitions = DEFPARTITIONS; + errors++; } else lp->d_npartitions = v; continue; @@ -1142,23 +1159,41 @@ checklabel(struct disklabel *lp) errors++; } else if (lp->d_bbsize % lp->d_secsize) warnx("boot block size %% sector-size != 0"); - if (lp->d_npartitions > MAXPARTITIONS) + if (lp->d_npartitions > MAXPARTITIONS) { warnx("number of partitions (%lu) > MAXPARTITIONS (%d)", (u_long)lp->d_npartitions, MAXPARTITIONS); + errors++; + } + if (lp->d_npartitions < DEFPARTITIONS) { + warnx("number of partitions (%lu) < DEFPARTITIONS (%d)", + (u_long)lp->d_npartitions, DEFPARTITIONS); + errors++; + } } else { struct disklabel *vl; vl = getvirginlabel(); - lp->d_secsize = vl->d_secsize; - lp->d_nsectors = vl->d_nsectors; - lp->d_ntracks = vl->d_ntracks; - lp->d_ncylinders = vl->d_ncylinders; - lp->d_rpm = vl->d_rpm; - lp->d_interleave = vl->d_interleave; - lp->d_secpercyl = vl->d_secpercyl; - lp->d_secperunit = vl->d_secperunit; - lp->d_bbsize = vl->d_bbsize; - lp->d_npartitions = vl->d_npartitions; + if (lp->d_secsize == 0) + lp->d_secsize = vl->d_secsize; + if (lp->d_nsectors == 0) + lp->d_nsectors = vl->d_nsectors; + if (lp->d_ntracks == 0) + lp->d_ntracks = vl->d_ntracks; + if (lp->d_ncylinders == 0) + lp->d_ncylinders = vl->d_ncylinders; + if (lp->d_rpm == 0) + lp->d_rpm = vl->d_rpm; + if (lp->d_interleave == 0) + lp->d_interleave = vl->d_interleave; + if (lp->d_secpercyl == 0) + lp->d_secpercyl = vl->d_secpercyl; + if (lp->d_secperunit == 0) + lp->d_secperunit = vl->d_secperunit; + if (lp->d_bbsize == 0) + lp->d_bbsize = vl->d_bbsize; + if (lp->d_npartitions < DEFPARTITIONS || + lp->d_npartitions > MAXPARTITIONS) + lp->d_npartitions = vl->d_npartitions; } From owner-svn-src-all@FreeBSD.ORG Wed Nov 16 16:27:54 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C52A1065676; Wed, 16 Nov 2011 16:27:54 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 31C928FC15; Wed, 16 Nov 2011 16:27:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAGGRsCF057068; Wed, 16 Nov 2011 16:27:54 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAGGRs3q057066; Wed, 16 Nov 2011 16:27:54 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201111161627.pAGGRs3q057066@svn.freebsd.org> From: Eitan Adler Date: Wed, 16 Nov 2011 16:27:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227565 - stable/9/sys/dev/puc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2011 16:27:54 -0000 Author: eadler (ports committer) Date: Wed Nov 16 16:27:53 2011 New Revision: 227565 URL: http://svn.freebsd.org/changeset/base/227565 Log: MFC r226404: - add support for I-O DATA RSA-PCI2/R PR: kern/142999 Submitted by: Takefu Kenji Approved by: jhb Approved by: re (kib) Modified: stable/9/sys/dev/puc/pucdata.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/dev/puc/pucdata.c ============================================================================== --- stable/9/sys/dev/puc/pucdata.c Wed Nov 16 16:24:36 2011 (r227564) +++ stable/9/sys/dev/puc/pucdata.c Wed Nov 16 16:27:53 2011 (r227565) @@ -51,6 +51,7 @@ static puc_config_f puc_config_amc; static puc_config_f puc_config_diva; static puc_config_f puc_config_exar; static puc_config_f puc_config_icbook; +static puc_config_f puc_config_moxa; static puc_config_f puc_config_oxford_pcie; static puc_config_f puc_config_quatech; static puc_config_f puc_config_syba; @@ -518,12 +519,25 @@ const struct puc_cfg puc_pci_devices[] = PUC_PORT_4S, 0x18, 0, 8, }, + { 0x1393, 0x1042, 0xffff, 0, + "Moxa Technologies, Smartio CP-104JU/PCI", + DEFAULT_RCLK * 8, + PUC_PORT_4S, 0x18, 0, 8, + }, + { 0x1393, 0x1043, 0xffff, 0, "Moxa Technologies, Smartio CP-104EL/PCIe", DEFAULT_RCLK * 8, PUC_PORT_4S, 0x18, 0, 8, }, + { 0x1393, 0x1045, 0xffff, 0, + "Moxa Technologies, Smartio CP-104EL-A/PCIe", + DEFAULT_RCLK * 8, + PUC_PORT_4S, 0x14, 0, -1, + .config_function = puc_config_moxa + }, + { 0x1393, 0x1120, 0xffff, 0, "Moxa Technologies, CP-112UL", DEFAULT_RCLK * 8, @@ -645,6 +659,12 @@ const struct puc_cfg puc_pci_devices[] = * As sold by Kouwell . * I/O Flex PCI I/O Card Model-223 with 4 serial and 1 parallel ports. */ + { + 0x1415, 0x9501, 0x10fc ,0xc070, + "I-O DATA RSA-PCI2/R", + DEFAULT_RCLK * 8, + PUC_PORT_2S, 0x10, 0, 8, + }, { 0x1415, 0x9501, 0x131f, 0x2050, "SIIG Cyber 4 PCI 16550", @@ -1080,6 +1100,19 @@ puc_config_icbook(struct puc_softc *sc, } static int +puc_config_moxa(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port, + intptr_t *res) +{ + const struct puc_cfg *cfg = sc->sc_cfg; + + if (cmd == PUC_CFG_GET_OFS && cfg->device == 0x1045) { + *res = ((port == 3) ? 7 : port) * 0x200; + return 0; + } + return (ENXIO); +} + +static int puc_config_quatech(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port, intptr_t *res) { From owner-svn-src-all@FreeBSD.ORG Wed Nov 16 16:29:05 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DDF451065676; Wed, 16 Nov 2011 16:29:05 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B45138FC15; Wed, 16 Nov 2011 16:29:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAGGT5AU057140; Wed, 16 Nov 2011 16:29:05 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAGGT5iC057138; Wed, 16 Nov 2011 16:29:05 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201111161629.pAGGT5iC057138@svn.freebsd.org> From: Eitan Adler Date: Wed, 16 Nov 2011 16:29:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227566 - releng/9.0/sys/dev/puc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2011 16:29:06 -0000 Author: eadler (ports committer) Date: Wed Nov 16 16:29:05 2011 New Revision: 227566 URL: http://svn.freebsd.org/changeset/base/227566 Log: MFC r226404: - add support for I-O DATA RSA-PCI2/R PR: kern/142999 Submitted by: Takefu Kenji Approved by: jhb Approved by: re (kib) Modified: releng/9.0/sys/dev/puc/pucdata.c Directory Properties: releng/9.0/sys/ (props changed) Modified: releng/9.0/sys/dev/puc/pucdata.c ============================================================================== --- releng/9.0/sys/dev/puc/pucdata.c Wed Nov 16 16:27:53 2011 (r227565) +++ releng/9.0/sys/dev/puc/pucdata.c Wed Nov 16 16:29:05 2011 (r227566) @@ -51,6 +51,7 @@ static puc_config_f puc_config_amc; static puc_config_f puc_config_diva; static puc_config_f puc_config_exar; static puc_config_f puc_config_icbook; +static puc_config_f puc_config_moxa; static puc_config_f puc_config_oxford_pcie; static puc_config_f puc_config_quatech; static puc_config_f puc_config_syba; @@ -518,12 +519,25 @@ const struct puc_cfg puc_pci_devices[] = PUC_PORT_4S, 0x18, 0, 8, }, + { 0x1393, 0x1042, 0xffff, 0, + "Moxa Technologies, Smartio CP-104JU/PCI", + DEFAULT_RCLK * 8, + PUC_PORT_4S, 0x18, 0, 8, + }, + { 0x1393, 0x1043, 0xffff, 0, "Moxa Technologies, Smartio CP-104EL/PCIe", DEFAULT_RCLK * 8, PUC_PORT_4S, 0x18, 0, 8, }, + { 0x1393, 0x1045, 0xffff, 0, + "Moxa Technologies, Smartio CP-104EL-A/PCIe", + DEFAULT_RCLK * 8, + PUC_PORT_4S, 0x14, 0, -1, + .config_function = puc_config_moxa + }, + { 0x1393, 0x1120, 0xffff, 0, "Moxa Technologies, CP-112UL", DEFAULT_RCLK * 8, @@ -645,6 +659,12 @@ const struct puc_cfg puc_pci_devices[] = * As sold by Kouwell . * I/O Flex PCI I/O Card Model-223 with 4 serial and 1 parallel ports. */ + { + 0x1415, 0x9501, 0x10fc ,0xc070, + "I-O DATA RSA-PCI2/R", + DEFAULT_RCLK * 8, + PUC_PORT_2S, 0x10, 0, 8, + }, { 0x1415, 0x9501, 0x131f, 0x2050, "SIIG Cyber 4 PCI 16550", @@ -1080,6 +1100,19 @@ puc_config_icbook(struct puc_softc *sc, } static int +puc_config_moxa(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port, + intptr_t *res) +{ + const struct puc_cfg *cfg = sc->sc_cfg; + + if (cmd == PUC_CFG_GET_OFS && cfg->device == 0x1045) { + *res = ((port == 3) ? 7 : port) * 0x200; + return 0; + } + return (ENXIO); +} + +static int puc_config_quatech(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port, intptr_t *res) { From owner-svn-src-all@FreeBSD.ORG Wed Nov 16 16:42:24 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 03557106564A; Wed, 16 Nov 2011 16:42:24 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DD6D78FC1A; Wed, 16 Nov 2011 16:42:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAGGgNfE057629; Wed, 16 Nov 2011 16:42:23 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAGGgN4W057626; Wed, 16 Nov 2011 16:42:23 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201111161642.pAGGgN4W057626@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Wed, 16 Nov 2011 16:42:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227567 - stable/8/sbin/fdisk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2011 16:42:24 -0000 Author: ae Date: Wed Nov 16 16:42:23 2011 New Revision: 227567 URL: http://svn.freebsd.org/changeset/base/227567 Log: MFC r227272: Add reference to gpart(8). MFC r227292: Improve error reporting when MBR can not be written. Remove obsolete code which uses DIOCSMBR ioctl. When writing MBR first check that GEOM_MBR is available, if it is not available, then try write MBR directly to provider. If both are failed, then recommend to use gpart(8). MFC r227295: Fix multi-line comment formatting. Pointed by: jh Modified: stable/8/sbin/fdisk/fdisk.8 stable/8/sbin/fdisk/fdisk.c Directory Properties: stable/8/sbin/fdisk/ (props changed) Modified: stable/8/sbin/fdisk/fdisk.8 ============================================================================== --- stable/8/sbin/fdisk/fdisk.8 Wed Nov 16 16:29:05 2011 (r227566) +++ stable/8/sbin/fdisk/fdisk.8 Wed Nov 16 16:42:23 2011 (r227567) @@ -476,6 +476,7 @@ The default boot code. .Sh SEE ALSO .Xr boot0cfg 8 , .Xr bsdlabel 8 , +.Xr gpart 8 , .Xr newfs 8 .Sh BUGS The default boot code will not necessarily handle all slice types Modified: stable/8/sbin/fdisk/fdisk.c ============================================================================== --- stable/8/sbin/fdisk/fdisk.c Wed Nov 16 16:29:05 2011 (r227566) +++ stable/8/sbin/fdisk/fdisk.c Wed Nov 16 16:42:23 2011 (r227567) @@ -229,6 +229,7 @@ get_type(int t) } +static int geom_class_available(const char *); static void print_s0(void); static void print_part(const struct dos_partition *); static void init_sector0(unsigned long start); @@ -764,49 +765,76 @@ read_disk(off_t sector, void *buf) } static int -write_disk(off_t sector, void *buf) +geom_class_available(const char *name) { + struct gclass *class; + struct gmesh mesh; int error; + + error = geom_gettree(&mesh); + if (error != 0) + errc(1, error, "Cannot get GEOM tree"); + + LIST_FOREACH(class, &mesh.lg_class, lg_class) { + if (strcmp(class->lg_name, name) == 0) { + geom_deletetree(&mesh); + return (1); + } + } + + geom_deletetree(&mesh); + + return (0); +} + +static int +write_disk(off_t sector, void *buf) +{ struct gctl_req *grq; const char *errmsg; - char fbuf[BUFSIZ], *pname; - int i, fdw; + char *pname; + int error; - grq = gctl_get_handle(); - gctl_ro_param(grq, "verb", -1, "write MBR"); - gctl_ro_param(grq, "class", -1, "MBR"); - pname = g_providername(fd); - if (pname == NULL) { - warn("Error getting providername for %s", disk); - return (-1); - } - gctl_ro_param(grq, "geom", -1, pname); - gctl_ro_param(grq, "data", secsize, buf); - errmsg = gctl_issue(grq); - free(pname); - if (errmsg == NULL) { + /* Check that GEOM_MBR is available */ + if (geom_class_available("MBR") != 0) { + grq = gctl_get_handle(); + gctl_ro_param(grq, "verb", -1, "write MBR"); + gctl_ro_param(grq, "class", -1, "MBR"); + pname = g_providername(fd); + if (pname == NULL) { + warn("Error getting providername for %s", disk); + return (-1); + } + gctl_ro_param(grq, "geom", -1, pname); + gctl_ro_param(grq, "data", secsize, buf); + errmsg = gctl_issue(grq); + free(pname); + if (errmsg == NULL) { + gctl_free(grq); + return(0); + } + if (!q_flag) + warnx("GEOM_MBR: %s", errmsg); gctl_free(grq); - return(0); - } - if (!q_flag) /* GEOM errors are benign, not all devices supported */ - warnx("%s", errmsg); - gctl_free(grq); - - error = pwrite(fd, buf, secsize, (sector * 512)); - if (error == secsize) - return (0); - - for (i = 1; i < 5; i++) { - sprintf(fbuf, "%ss%d", disk, i); - fdw = open(fbuf, O_RDWR, 0); - if (fdw < 0) - continue; - error = ioctl(fdw, DIOCSMBR, buf); - close(fdw); - if (error == 0) + } else { + /* + * Try to write MBR directly. This may help when disk + * is not in use. + * XXX: hardcoded sectorsize + */ + error = pwrite(fd, buf, secsize, (sector * 512)); + if (error == secsize) return (0); } - warnx("Failed to write sector zero"); + + /* + * GEOM_MBR is not available or failed to write MBR. + * Now check that we have GEOM_PART and recommend to use gpart (8). + */ + if (geom_class_available("PART") != 0) + warnx("Failed to write MBR. Try to use gpart(8)."); + else + warnx("Failed to write sector zero"); return(EINVAL); } From owner-svn-src-all@FreeBSD.ORG Wed Nov 16 16:46:10 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 39E7C106564A; Wed, 16 Nov 2011 16:46:10 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 286C08FC0A; Wed, 16 Nov 2011 16:46:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAGGkAaN057801; Wed, 16 Nov 2011 16:46:10 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAGGkAuQ057794; Wed, 16 Nov 2011 16:46:10 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201111161646.pAGGkAuQ057794@svn.freebsd.org> From: Alan Cox Date: Wed, 16 Nov 2011 16:46:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227568 - in head/sys: powerpc/aim vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2011 16:46:10 -0000 Author: alc Date: Wed Nov 16 16:46:09 2011 New Revision: 227568 URL: http://svn.freebsd.org/changeset/base/227568 Log: Refactor the code that performs physically contiguous memory allocation, yielding a new public interface, vm_page_alloc_contig(). This new function addresses some of the limitations of the current interfaces, contigmalloc() and kmem_alloc_contig(). For example, the physically contiguous memory that is allocated with those interfaces can only be allocated to the kernel vm object and must be mapped into the kernel virtual address space. It also provides functionality that vm_phys_alloc_contig() doesn't, such as wiring the returned pages. Moreover, unlike that function, it respects the low water marks on the paging queues and wakes up the page daemon when necessary. That said, at present, this new function can't be applied to all types of vm objects. However, that restriction will be eliminated in the coming weeks. From a design standpoint, this change also addresses an inconsistency between vm_phys_alloc_contig() and the other vm_phys_alloc*() functions. Specifically, vm_phys_alloc_contig() manipulated vm_page fields that other functions in vm/vm_phys.c didn't. Moreover, vm_phys_alloc_contig() knew about vnodes and reservations. Now, vm_page_alloc_contig() is responsible for these things. Reviewed by: kib Discussed with: jhb Modified: head/sys/powerpc/aim/slb.c head/sys/vm/vm_contig.c head/sys/vm/vm_page.c head/sys/vm/vm_page.h head/sys/vm/vm_phys.c head/sys/vm/vm_phys.h Modified: head/sys/powerpc/aim/slb.c ============================================================================== --- head/sys/powerpc/aim/slb.c Wed Nov 16 16:42:23 2011 (r227567) +++ head/sys/powerpc/aim/slb.c Wed Nov 16 16:46:09 2011 (r227568) @@ -40,7 +40,6 @@ #include #include #include -#include #include #include @@ -488,15 +487,22 @@ slb_uma_real_alloc(uma_zone_t zone, int static vm_offset_t realmax = 0; void *va; vm_page_t m; + int pflags; if (realmax == 0) realmax = platform_real_maxaddr(); *flags = UMA_SLAB_PRIV; + if ((wait & (M_NOWAIT | M_USE_RESERVE)) == M_NOWAIT) + pflags = VM_ALLOC_INTERRUPT | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED; + else + pflags = VM_ALLOC_SYSTEM | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED; + if (wait & M_ZERO) + pflags |= VM_ALLOC_ZERO; for (;;) { - m = vm_phys_alloc_contig(1, 0, realmax, PAGE_SIZE, - PAGE_SIZE); + m = vm_page_alloc_contig(NULL, 0, pflags, 1, 0, realmax, + PAGE_SIZE, PAGE_SIZE, VM_MEMATTR_DEFAULT); if (m == NULL) { if (wait & M_NOWAIT) return (NULL); @@ -513,10 +519,6 @@ slb_uma_real_alloc(uma_zone_t zone, int if ((wait & M_ZERO) && (m->flags & PG_ZERO) == 0) bzero(va, PAGE_SIZE); - /* vm_phys_alloc_contig does not track wiring */ - atomic_add_int(&cnt.v_wire_count, 1); - m->wire_count = 1; - return (va); } Modified: head/sys/vm/vm_contig.c ============================================================================== --- head/sys/vm/vm_contig.c Wed Nov 16 16:42:23 2011 (r227567) +++ head/sys/vm/vm_contig.c Wed Nov 16 16:46:09 2011 (r227568) @@ -82,7 +82,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include static int @@ -185,22 +184,6 @@ vm_contig_launder(int queue, vm_paddr_t } /* - * Frees the given physically contiguous pages. - * - * N.B.: Any pages with PG_ZERO set must, in fact, be zero filled. - */ -static void -vm_page_release_contig(vm_page_t m, vm_pindex_t count) -{ - - while (count--) { - /* Leave PG_ZERO unchanged. */ - vm_page_free_toq(m); - m++; - } -} - -/* * Increase the number of cached pages. */ void @@ -238,9 +221,10 @@ kmem_alloc_attr(vm_map_t map, vm_size_t vm_paddr_t high, vm_memattr_t memattr) { vm_object_t object = kernel_object; - vm_offset_t addr, i, offset; + vm_offset_t addr; + vm_ooffset_t end_offset, offset; vm_page_t m; - int tries; + int pflags, tries; size = round_page(size); vm_map_lock(map); @@ -252,11 +236,19 @@ kmem_alloc_attr(vm_map_t map, vm_size_t vm_object_reference(object); vm_map_insert(map, object, offset, addr, addr + size, VM_PROT_ALL, VM_PROT_ALL, 0); + if ((flags & (M_NOWAIT | M_USE_RESERVE)) == M_NOWAIT) + pflags = VM_ALLOC_INTERRUPT | VM_ALLOC_NOBUSY; + else + pflags = VM_ALLOC_SYSTEM | VM_ALLOC_NOBUSY; + if (flags & M_ZERO) + pflags |= VM_ALLOC_ZERO; VM_OBJECT_LOCK(object); - for (i = 0; i < size; i += PAGE_SIZE) { + end_offset = offset + size; + for (; offset < end_offset; offset += PAGE_SIZE) { tries = 0; retry: - m = vm_phys_alloc_contig(1, low, high, PAGE_SIZE, 0); + m = vm_page_alloc_contig(object, OFF_TO_IDX(offset), pflags, 1, + low, high, PAGE_SIZE, 0, memattr); if (m == NULL) { VM_OBJECT_UNLOCK(object); if (tries < ((flags & M_NOWAIT) != 0 ? 1 : 3)) { @@ -277,9 +269,6 @@ retry: vm_map_unlock(map); return (0); } - if (memattr != VM_MEMATTR_DEFAULT) - pmap_page_set_memattr(m, memattr); - vm_page_insert(m, object, OFF_TO_IDX(offset + i)); if ((flags & M_ZERO) && (m->flags & PG_ZERO) == 0) pmap_zero_page(m); m->valid = VM_PAGE_BITS_ALL; @@ -299,65 +288,61 @@ retry: * specified through the given flags, then the pages are zeroed * before they are mapped. */ -static vm_offset_t -contigmapping(vm_map_t map, vm_size_t size, vm_page_t m, vm_memattr_t memattr, - int flags) +vm_offset_t +kmem_alloc_contig(vm_map_t map, vm_size_t size, int flags, vm_paddr_t low, + vm_paddr_t high, u_long alignment, vm_paddr_t boundary, + vm_memattr_t memattr) { vm_object_t object = kernel_object; - vm_offset_t addr, tmp_addr; + vm_offset_t addr; + vm_ooffset_t offset; + vm_page_t end_m, m; + int pflags, tries; + size = round_page(size); vm_map_lock(map); if (vm_map_findspace(map, vm_map_min(map), size, &addr)) { vm_map_unlock(map); return (0); } + offset = addr - VM_MIN_KERNEL_ADDRESS; vm_object_reference(object); - vm_map_insert(map, object, addr - VM_MIN_KERNEL_ADDRESS, - addr, addr + size, VM_PROT_ALL, VM_PROT_ALL, 0); - vm_map_unlock(map); + vm_map_insert(map, object, offset, addr, addr + size, VM_PROT_ALL, + VM_PROT_ALL, 0); + if ((flags & (M_NOWAIT | M_USE_RESERVE)) == M_NOWAIT) + pflags = VM_ALLOC_INTERRUPT | VM_ALLOC_NOBUSY; + else + pflags = VM_ALLOC_SYSTEM | VM_ALLOC_NOBUSY; + if (flags & M_ZERO) + pflags |= VM_ALLOC_ZERO; VM_OBJECT_LOCK(object); - for (tmp_addr = addr; tmp_addr < addr + size; tmp_addr += PAGE_SIZE) { - if (memattr != VM_MEMATTR_DEFAULT) - pmap_page_set_memattr(m, memattr); - vm_page_insert(m, object, - OFF_TO_IDX(tmp_addr - VM_MIN_KERNEL_ADDRESS)); - if ((flags & M_ZERO) && (m->flags & PG_ZERO) == 0) - pmap_zero_page(m); - m->valid = VM_PAGE_BITS_ALL; - m++; - } - VM_OBJECT_UNLOCK(object); - vm_map_wire(map, addr, addr + size, - VM_MAP_WIRE_SYSTEM | VM_MAP_WIRE_NOHOLES); - return (addr); -} - -vm_offset_t -kmem_alloc_contig(vm_map_t map, vm_size_t size, int flags, vm_paddr_t low, - vm_paddr_t high, u_long alignment, vm_paddr_t boundary, - vm_memattr_t memattr) -{ - vm_offset_t ret; - vm_page_t pages; - u_long npgs; - int tries; - - size = round_page(size); - npgs = size >> PAGE_SHIFT; tries = 0; retry: - pages = vm_phys_alloc_contig(npgs, low, high, alignment, boundary); - if (pages == NULL) { + m = vm_page_alloc_contig(object, OFF_TO_IDX(offset), pflags, + atop(size), low, high, alignment, boundary, memattr); + if (m == NULL) { + VM_OBJECT_UNLOCK(object); if (tries < ((flags & M_NOWAIT) != 0 ? 1 : 3)) { + vm_map_unlock(map); vm_contig_grow_cache(tries, low, high); + vm_map_lock(map); + VM_OBJECT_LOCK(object); tries++; goto retry; } - ret = 0; - } else { - ret = contigmapping(map, size, pages, memattr, flags); - if (ret == 0) - vm_page_release_contig(pages, npgs); + vm_map_delete(map, addr, addr + size); + vm_map_unlock(map); + return (0); + } + end_m = m + atop(size); + for (; m < end_m; m++) { + if ((flags & M_ZERO) && (m->flags & PG_ZERO) == 0) + pmap_zero_page(m); + m->valid = VM_PAGE_BITS_ALL; } - return (ret); + VM_OBJECT_UNLOCK(object); + vm_map_unlock(map); + vm_map_wire(map, addr, addr + size, VM_MAP_WIRE_SYSTEM | + VM_MAP_WIRE_NOHOLES); + return (addr); } Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Wed Nov 16 16:42:23 2011 (r227567) +++ head/sys/vm/vm_page.c Wed Nov 16 16:46:09 2011 (r227568) @@ -137,6 +137,7 @@ SYSCTL_INT(_vm, OID_AUTO, tryrelock_rest static uma_zone_t fakepg_zone; +static struct vnode *vm_page_alloc_init(vm_page_t m); static void vm_page_clear_dirty_mask(vm_page_t m, vm_page_bits_t pagebits); static void vm_page_queue_remove(int queue, vm_page_t m); static void vm_page_enqueue(int queue, vm_page_t m); @@ -1481,6 +1482,155 @@ vm_page_alloc(vm_object_t object, vm_pin } /* + * vm_page_alloc_contig: + * + * Allocate a contiguous set of physical pages of the given size "npages" + * from the free lists. All of the physical pages must be at or above + * the given physical address "low" and below the given physical address + * "high". The given value "alignment" determines the alignment of the + * first physical page in the set. If the given value "boundary" is + * non-zero, then the set of physical pages cannot cross any physical + * address boundary that is a multiple of that value. Both "alignment" + * and "boundary" must be a power of two. + * + * If the specified memory attribute, "memattr", is VM_MEMATTR_DEFAULT, + * then the memory attribute setting for the physical pages is configured + * to the object's memory attribute setting. Otherwise, the memory + * attribute setting for the physical pages is configured to "memattr", + * overriding the object's memory attribute setting. However, if the + * object's memory attribute setting is not VM_MEMATTR_DEFAULT, then the + * memory attribute setting for the physical pages cannot be configured + * to VM_MEMATTR_DEFAULT. + * + * The caller must always specify an allocation class. + * + * allocation classes: + * VM_ALLOC_NORMAL normal process request + * VM_ALLOC_SYSTEM system *really* needs a page + * VM_ALLOC_INTERRUPT interrupt time request + * + * optional allocation flags: + * VM_ALLOC_NOBUSY do not set the flag VPO_BUSY on the page + * VM_ALLOC_NOOBJ page is not associated with an object and + * should not have the flag VPO_BUSY set + * VM_ALLOC_WIRED wire the allocated page + * VM_ALLOC_ZERO prefer a zeroed page + * + * This routine may not sleep. + */ +vm_page_t +vm_page_alloc_contig(vm_object_t object, vm_pindex_t pindex, int req, + u_long npages, vm_paddr_t low, vm_paddr_t high, u_long alignment, + vm_paddr_t boundary, vm_memattr_t memattr) +{ + struct vnode *drop; + vm_page_t deferred_vdrop_list, m, m_ret; + u_int flags, oflags; + int req_class; + + KASSERT((object != NULL) == ((req & VM_ALLOC_NOOBJ) == 0), + ("vm_page_alloc_contig: inconsistent object/req")); + if (object != NULL) { + VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); + KASSERT(object->type == OBJT_PHYS, + ("vm_page_alloc_contig: object %p isn't OBJT_PHYS", + object)); + } + KASSERT(npages > 0, ("vm_page_alloc_contig: npages is zero")); + req_class = req & VM_ALLOC_CLASS_MASK; + + /* + * The page daemon is allowed to dig deeper into the free page list. + */ + if (curproc == pageproc && req_class != VM_ALLOC_INTERRUPT) + req_class = VM_ALLOC_SYSTEM; + + deferred_vdrop_list = NULL; + mtx_lock(&vm_page_queue_free_mtx); + if (cnt.v_free_count + cnt.v_cache_count >= npages + + cnt.v_free_reserved || (req_class == VM_ALLOC_SYSTEM && + cnt.v_free_count + cnt.v_cache_count >= npages + + cnt.v_interrupt_free_min) || (req_class == VM_ALLOC_INTERRUPT && + cnt.v_free_count + cnt.v_cache_count >= npages)) { +#if VM_NRESERVLEVEL > 0 +retry: +#endif + m_ret = vm_phys_alloc_contig(npages, low, high, alignment, + boundary); + } else { + mtx_unlock(&vm_page_queue_free_mtx); + atomic_add_int(&vm_pageout_deficit, npages); + pagedaemon_wakeup(); + return (NULL); + } + if (m_ret != NULL) + for (m = m_ret; m < &m_ret[npages]; m++) { + drop = vm_page_alloc_init(m); + if (drop != NULL) { + /* + * Enqueue the vnode for deferred vdrop(). + * + * Once the pages are removed from the free + * page list, "pageq" can be safely abused to + * construct a short-lived list of vnodes. + */ + m->pageq.tqe_prev = (void *)drop; + m->pageq.tqe_next = deferred_vdrop_list; + deferred_vdrop_list = m; + } + } + else { +#if VM_NRESERVLEVEL > 0 + if (vm_reserv_reclaim_contig(npages << PAGE_SHIFT, low, high, + alignment, boundary)) + goto retry; +#endif + } + mtx_unlock(&vm_page_queue_free_mtx); + if (m_ret == NULL) + return (NULL); + + /* + * Initialize the pages. Only the PG_ZERO flag is inherited. + */ + flags = 0; + if ((req & VM_ALLOC_ZERO) != 0) + flags = PG_ZERO; + if ((req & VM_ALLOC_WIRED) != 0) + atomic_add_int(&cnt.v_wire_count, npages); + oflags = VPO_UNMANAGED; + if (object != NULL) { + if ((req & VM_ALLOC_NOBUSY) == 0) + oflags |= VPO_BUSY; + if (object->memattr != VM_MEMATTR_DEFAULT && + memattr == VM_MEMATTR_DEFAULT) + memattr = object->memattr; + } + for (m = m_ret; m < &m_ret[npages]; m++) { + m->aflags = 0; + m->flags &= flags; + if ((req & VM_ALLOC_WIRED) != 0) + m->wire_count = 1; + /* Unmanaged pages don't use "act_count". */ + m->oflags = oflags; + if (memattr != VM_MEMATTR_DEFAULT) + pmap_page_set_memattr(m, memattr); + if (object != NULL) + vm_page_insert(m, object, pindex); + else + m->pindex = pindex; + pindex++; + } + while (deferred_vdrop_list != NULL) { + vdrop((struct vnode *)deferred_vdrop_list->pageq.tqe_prev); + deferred_vdrop_list = deferred_vdrop_list->pageq.tqe_next; + } + if (vm_paging_needed()) + pagedaemon_wakeup(); + return (m_ret); +} + +/* * Initialize a page that has been freshly dequeued from a freelist. * The caller has to drop the vnode returned, if it is not NULL. * @@ -1488,7 +1638,7 @@ vm_page_alloc(vm_object_t object, vm_pin * * To be called with vm_page_queue_free_mtx held. */ -struct vnode * +static struct vnode * vm_page_alloc_init(vm_page_t m) { struct vnode *drop; @@ -1529,9 +1679,6 @@ vm_page_alloc_init(vm_page_t m) } /* Don't clear the PG_ZERO flag; we'll need it later. */ m->flags &= PG_ZERO; - m->aflags = 0; - m->oflags = VPO_UNMANAGED; - /* Unmanaged pages don't use "act_count". */ return (drop); } @@ -1598,6 +1745,7 @@ vm_page_alloc_freelist(int flind, int re /* * Initialize the page. Only the PG_ZERO flag is inherited. */ + m->aflags = 0; flags = 0; if ((req & VM_ALLOC_ZERO) != 0) flags = PG_ZERO; @@ -1610,6 +1758,8 @@ vm_page_alloc_freelist(int flind, int re atomic_add_int(&cnt.v_wire_count, 1); m->wire_count = 1; } + /* Unmanaged pages don't use "act_count". */ + m->oflags = VPO_UNMANAGED; if (drop != NULL) vdrop(drop); if (vm_paging_needed()) Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Wed Nov 16 16:42:23 2011 (r227567) +++ head/sys/vm/vm_page.h Wed Nov 16 16:46:09 2011 (r227568) @@ -359,8 +359,10 @@ void vm_pageq_remove(vm_page_t m); void vm_page_activate (vm_page_t); vm_page_t vm_page_alloc (vm_object_t, vm_pindex_t, int); +vm_page_t vm_page_alloc_contig(vm_object_t object, vm_pindex_t pindex, int req, + u_long npages, vm_paddr_t low, vm_paddr_t high, u_long alignment, + vm_paddr_t boundary, vm_memattr_t memattr); vm_page_t vm_page_alloc_freelist(int, int); -struct vnode *vm_page_alloc_init(vm_page_t); vm_page_t vm_page_grab (vm_object_t, vm_pindex_t, int); void vm_page_cache(vm_page_t); void vm_page_cache_free(vm_object_t, vm_pindex_t, vm_pindex_t); Modified: head/sys/vm/vm_phys.c ============================================================================== --- head/sys/vm/vm_phys.c Wed Nov 16 16:42:23 2011 (r227567) +++ head/sys/vm/vm_phys.c Wed Nov 16 16:46:09 2011 (r227568) @@ -29,11 +29,17 @@ * POSSIBILITY OF SUCH DAMAGE. */ +/* + * Physical memory system implementation + * + * Any external functions defined by this module are only to be used by the + * virtual memory system. + */ + #include __FBSDID("$FreeBSD$"); #include "opt_ddb.h" -#include "opt_vm.h" #include #include @@ -45,7 +51,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include @@ -55,7 +60,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include /* * VM_FREELIST_DEFAULT is split into VM_NDOMAIN lists, one for each @@ -755,12 +759,12 @@ vm_phys_alloc_contig(u_long npages, vm_p { struct vm_freelist *fl; struct vm_phys_seg *seg; - struct vnode *vp; vm_paddr_t pa, pa_last, size; - vm_page_t deferred_vdrop_list, m, m_ret; + vm_page_t m, m_ret; u_long npages_end; - int domain, flind, i, oind, order, pind; + int domain, flind, oind, order, pind; + mtx_assert(&vm_page_queue_free_mtx, MA_OWNED); #if VM_NDOMAIN > 1 domain = PCPU_GET(domain); #else @@ -773,13 +777,8 @@ vm_phys_alloc_contig(u_long npages, vm_p ("vm_phys_alloc_contig: alignment must be a power of 2")); KASSERT((boundary & (boundary - 1)) == 0, ("vm_phys_alloc_contig: boundary must be a power of 2")); - deferred_vdrop_list = NULL; /* Compute the queue that is the best fit for npages. */ for (order = 0; (1 << order) < npages; order++); - mtx_lock(&vm_page_queue_free_mtx); -#if VM_NRESERVLEVEL > 0 -retry: -#endif for (flind = 0; flind < vm_nfreelists; flind++) { for (oind = min(order, VM_NFREEORDER - 1); oind < VM_NFREEORDER; oind++) { for (pind = 0; pind < VM_NFREEPOOL; pind++) { @@ -838,11 +837,6 @@ retry: } } } -#if VM_NRESERVLEVEL > 0 - if (vm_reserv_reclaim_contig(size, low, high, alignment, boundary)) - goto retry; -#endif - mtx_unlock(&vm_page_queue_free_mtx); return (NULL); done: for (m = m_ret; m < &m_ret[npages]; m = &m[1 << oind]) { @@ -855,31 +849,10 @@ done: vm_phys_set_pool(VM_FREEPOOL_DEFAULT, m_ret, oind); fl = (*seg->free_queues)[m_ret->pool]; vm_phys_split_pages(m_ret, oind, fl, order); - for (i = 0; i < npages; i++) { - m = &m_ret[i]; - vp = vm_page_alloc_init(m); - if (vp != NULL) { - /* - * Enqueue the vnode for deferred vdrop(). - * - * Unmanaged pages don't use "pageq", so it - * can be safely abused to construct a short- - * lived queue of vnodes. - */ - m->pageq.tqe_prev = (void *)vp; - m->pageq.tqe_next = deferred_vdrop_list; - deferred_vdrop_list = m; - } - } /* Return excess pages to the free lists. */ npages_end = roundup2(npages, 1 << imin(oind, order)); if (npages < npages_end) vm_phys_free_contig(&m_ret[npages], npages_end - npages); - mtx_unlock(&vm_page_queue_free_mtx); - while (deferred_vdrop_list != NULL) { - vdrop((struct vnode *)deferred_vdrop_list->pageq.tqe_prev); - deferred_vdrop_list = deferred_vdrop_list->pageq.tqe_next; - } return (m_ret); } Modified: head/sys/vm/vm_phys.h ============================================================================== --- head/sys/vm/vm_phys.h Wed Nov 16 16:42:23 2011 (r227567) +++ head/sys/vm/vm_phys.h Wed Nov 16 16:46:09 2011 (r227568) @@ -49,6 +49,9 @@ struct mem_affinity { extern struct mem_affinity *mem_affinity; +/* + * The following functions are only to be used by the virtual memory system. + */ void vm_phys_add_page(vm_paddr_t pa); vm_page_t vm_phys_alloc_contig(u_long npages, vm_paddr_t low, vm_paddr_t high, u_long alignment, vm_paddr_t boundary); From owner-svn-src-all@FreeBSD.ORG Wed Nov 16 17:11:18 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF5DA1065761; Wed, 16 Nov 2011 17:11:18 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 07DBB8FC15; Wed, 16 Nov 2011 17:11:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAGHBE5U058633; Wed, 16 Nov 2011 17:11:14 GMT (envelope-from philip@svn.freebsd.org) Received: (from philip@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAGHBDkq058627; Wed, 16 Nov 2011 17:11:13 GMT (envelope-from philip@svn.freebsd.org) Message-Id: <201111161711.pAGHBDkq058627@svn.freebsd.org> From: Philip Paeps Date: Wed, 16 Nov 2011 17:11:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227569 - in head: share/man/man4 sys/conf sys/dev/sfxge sys/dev/sfxge/common sys/modules sys/modules/sfxge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2011 17:11:18 -0000 Author: philip Date: Wed Nov 16 17:11:13 2011 New Revision: 227569 URL: http://svn.freebsd.org/changeset/base/227569 Log: Add the sfxge(4) device driver, providing support for 10Gb Ethernet adapters based on Solarflare SFC9000 family controllers. The driver supports jumbo frames, transmit/receive checksum offload, TCP Segmentation Offload (TSO), Large Receive Offload (LRO), VLAN checksum offload, VLAN TSO, and Receive Side Scaling (RSS) using MSI-X interrupts. This work was sponsored by Solarflare Communications, Inc. My sincere thanks to Ben Hutchings for doing a lot of the hard work! Sponsored by: Solarflare Communications, Inc. MFC after: 3 weeks Added: head/share/man/man4/sfxge.4 (contents, props changed) head/sys/dev/sfxge/ head/sys/dev/sfxge/common/ head/sys/dev/sfxge/common/efsys.h (contents, props changed) head/sys/dev/sfxge/common/efx.h (contents, props changed) head/sys/dev/sfxge/common/efx_bootcfg.c (contents, props changed) head/sys/dev/sfxge/common/efx_ev.c (contents, props changed) head/sys/dev/sfxge/common/efx_filter.c (contents, props changed) head/sys/dev/sfxge/common/efx_impl.h (contents, props changed) head/sys/dev/sfxge/common/efx_intr.c (contents, props changed) head/sys/dev/sfxge/common/efx_mac.c (contents, props changed) head/sys/dev/sfxge/common/efx_mcdi.c (contents, props changed) head/sys/dev/sfxge/common/efx_mcdi.h (contents, props changed) head/sys/dev/sfxge/common/efx_mon.c (contents, props changed) head/sys/dev/sfxge/common/efx_nic.c (contents, props changed) head/sys/dev/sfxge/common/efx_nvram.c (contents, props changed) head/sys/dev/sfxge/common/efx_phy.c (contents, props changed) head/sys/dev/sfxge/common/efx_port.c (contents, props changed) head/sys/dev/sfxge/common/efx_regs.h (contents, props changed) head/sys/dev/sfxge/common/efx_regs_ef10.h (contents, props changed) head/sys/dev/sfxge/common/efx_regs_mcdi.h (contents, props changed) head/sys/dev/sfxge/common/efx_regs_pci.h (contents, props changed) head/sys/dev/sfxge/common/efx_rx.c (contents, props changed) head/sys/dev/sfxge/common/efx_sram.c (contents, props changed) head/sys/dev/sfxge/common/efx_tx.c (contents, props changed) head/sys/dev/sfxge/common/efx_types.h (contents, props changed) head/sys/dev/sfxge/common/efx_vpd.c (contents, props changed) head/sys/dev/sfxge/common/efx_wol.c (contents, props changed) head/sys/dev/sfxge/common/siena_flash.h (contents, props changed) head/sys/dev/sfxge/common/siena_impl.h (contents, props changed) head/sys/dev/sfxge/common/siena_mac.c (contents, props changed) head/sys/dev/sfxge/common/siena_mon.c (contents, props changed) head/sys/dev/sfxge/common/siena_nic.c (contents, props changed) head/sys/dev/sfxge/common/siena_nvram.c (contents, props changed) head/sys/dev/sfxge/common/siena_phy.c (contents, props changed) head/sys/dev/sfxge/common/siena_sram.c (contents, props changed) head/sys/dev/sfxge/common/siena_vpd.c (contents, props changed) head/sys/dev/sfxge/sfxge.c (contents, props changed) head/sys/dev/sfxge/sfxge.h (contents, props changed) head/sys/dev/sfxge/sfxge_dma.c (contents, props changed) head/sys/dev/sfxge/sfxge_ev.c (contents, props changed) head/sys/dev/sfxge/sfxge_intr.c (contents, props changed) head/sys/dev/sfxge/sfxge_mcdi.c (contents, props changed) head/sys/dev/sfxge/sfxge_port.c (contents, props changed) head/sys/dev/sfxge/sfxge_rx.c (contents, props changed) head/sys/dev/sfxge/sfxge_rx.h (contents, props changed) head/sys/dev/sfxge/sfxge_tx.c (contents, props changed) head/sys/dev/sfxge/sfxge_tx.h (contents, props changed) head/sys/modules/sfxge/ head/sys/modules/sfxge/Makefile (contents, props changed) Modified: head/share/man/man4/Makefile head/sys/conf/files head/sys/modules/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Wed Nov 16 16:46:09 2011 (r227568) +++ head/share/man/man4/Makefile Wed Nov 16 17:11:13 2011 (r227569) @@ -377,6 +377,7 @@ MAN= aac.4 \ send.4 \ ses.4 \ sf.4 \ + sfxge.4 \ sge.4 \ si.4 \ siba.4 \ Added: head/share/man/man4/sfxge.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/sfxge.4 Wed Nov 16 17:11:13 2011 (r227569) @@ -0,0 +1,92 @@ +.\" Copyright (c) 2011 Solarflare Communications, Inc. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd November 16, 2011 +.Dt SFXGE 4 +.Os +.Sh NAME +.Nm sfxge +.Nd "Solarflare 10Gb Ethernet adapter driver" +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device sfxge" +.Ed +.Pp +To load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +sfxge_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for 10Gb Ethernet adapters based on +Solarflare SFC9000 family controllers. The driver supports jumbo +frames, transmit/receive checksum offload, TCP Segmentation Offload +(TSO), Large Receive Offload (LRO), VLAN checksum offload, VLAN TSO, +and Receive Side Scaling (RSS) using MSI-X interrupts. +.Pp +The driver allocates 1 receive queue, transmit queue, event queue and +IRQ per CPU up to a maximum of 64. IRQ affinities should be spread +out using +.Xr cpuset 8 . +Interrupt moderation may be controlled through the sysctl +dev.sfxge.\fIindex\fR.int_mod (units are microseconds). +.Pp +For more information on configuring this device, see +.Xr ifconfig 8 . +.Pp +A large number of MAC, PHY and data path statistics are available +under the sysctl dev.sfxge.\fIindex\fR.stats. The adapter's VPD +fields including its serial number are available under the sysctl +dev.sfxge.\fIindex\fR.vpd. +.Sh HARDWARE +The +.Nm +driver supports all 10Gb Ethernet adapters based on Solarflare SFC9000 +family controllers. +.Sh SUPPORT +For general information and support, +go to the Solarflare support website at: +.Pa https://support.solarflare.com . +.Sh SEE ALSO +.Xr arp 4 , +.Xr netintro 4 , +.Xr ng_ether 4 , +.Xr vlan 4 , +.Xr cpuset 8 , +.Xr ifconfig 8 +.Sh AUTHORS +The +.Nm +driver was written by +.An Philip Paeps +and +.An Solarflare Communications, Inc. Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Nov 16 16:46:09 2011 (r227568) +++ head/sys/conf/files Wed Nov 16 17:11:13 2011 (r227569) @@ -1671,6 +1671,37 @@ dev/scd/scd.c optional scd isa dev/scd/scd_isa.c optional scd isa dev/sdhci/sdhci.c optional sdhci pci dev/sf/if_sf.c optional sf pci +dev/sfxge/common/efx_bootcfg.c optional sfxge inet pci +dev/sfxge/common/efx_ev.c optional sfxge inet pci +dev/sfxge/common/efx_filter.c optional sfxge inet pci +dev/sfxge/common/efx_intr.c optional sfxge inet pci +dev/sfxge/common/efx_mac.c optional sfxge inet pci +dev/sfxge/common/efx_mcdi.c optional sfxge inet pci +dev/sfxge/common/efx_mon.c optional sfxge inet pci +dev/sfxge/common/efx_nic.c optional sfxge inet pci +dev/sfxge/common/efx_nvram.c optional sfxge inet pci +dev/sfxge/common/efx_phy.c optional sfxge inet pci +dev/sfxge/common/efx_port.c optional sfxge inet pci +dev/sfxge/common/efx_rx.c optional sfxge inet pci +dev/sfxge/common/efx_sram.c optional sfxge inet pci +dev/sfxge/common/efx_tx.c optional sfxge inet pci +dev/sfxge/common/efx_vpd.c optional sfxge inet pci +dev/sfxge/common/efx_wol.c optional sfxge inet pci +dev/sfxge/common/siena_mac.c optional sfxge inet pci +dev/sfxge/common/siena_mon.c optional sfxge inet pci +dev/sfxge/common/siena_nic.c optional sfxge inet pci +dev/sfxge/common/siena_nvram.c optional sfxge inet pci +dev/sfxge/common/siena_phy.c optional sfxge inet pci +dev/sfxge/common/siena_sram.c optional sfxge inet pci +dev/sfxge/common/siena_vpd.c optional sfxge inet pci +dev/sfxge/sfxge.c optional sfxge inet pci +dev/sfxge/sfxge_dma.c optional sfxge inet pci +dev/sfxge/sfxge_ev.c optional sfxge inet pci +dev/sfxge/sfxge_intr.c optional sfxge inet pci +dev/sfxge/sfxge_mcdi.c optional sfxge inet pci +dev/sfxge/sfxge_port.c optional sfxge inet pci +dev/sfxge/sfxge_rx.c optional sfxge inet pci +dev/sfxge/sfxge_tx.c optional sfxge inet pci dev/sge/if_sge.c optional sge pci dev/si/si.c optional si dev/si/si2_z280.c optional si Added: head/sys/dev/sfxge/common/efsys.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/sfxge/common/efsys.h Wed Nov 16 17:11:13 2011 (r227569) @@ -0,0 +1,800 @@ +/*- + * Copyright (c) 2010-2011 Solarflare Communications, Inc. + * All rights reserved. + * + * This software was developed in part by Philip Paeps under contract for + * Solarflare Communications, Inc. + * + * 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. + */ + +#ifndef _SYS_EFSYS_H +#define _SYS_EFSYS_H + +#include +__FBSDID("$FreeBSD$"); + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#define EFSYS_HAS_UINT64 1 +#define EFSYS_USE_UINT64 0 +#if _BYTE_ORDER == _BIG_ENDIAN +#define EFSYS_IS_BIG_ENDIAN 1 +#define EFSYS_IS_LITTLE_ENDIAN 0 +#elif _BYTE_ORDER == _LITTLE_ENDIAN +#define EFSYS_IS_BIG_ENDIAN 0 +#define EFSYS_IS_LITTLE_ENDIAN 1 +#endif +#include "efx_types.h" + +/* Common code requires this */ +#if __FreeBSD_version < 800068 +#define memmove(d, s, l) bcopy(s, d, l) +#endif + +/* FreeBSD equivalents of Solaris things */ +#ifndef _NOTE +#define _NOTE(s) +#endif + +#ifndef B_FALSE +#define B_FALSE FALSE +#endif +#ifndef B_TRUE +#define B_TRUE TRUE +#endif + +#ifndef IS_P2ALIGNED +#define IS_P2ALIGNED(v, a) ((((uintptr_t)(v)) & ((uintptr_t)(a) - 1)) == 0) +#endif + +#ifndef P2ROUNDUP +#define P2ROUNDUP(x, align) (-(-(x) & -(align))) +#endif + +#ifndef IS2P +#define ISP2(x) (((x) & ((x) - 1)) == 0) +#endif + +#define ENOTACTIVE EINVAL + +/* Memory type to use on FreeBSD */ +MALLOC_DECLARE(M_SFXGE); + +/* Machine dependend prefetch wrappers */ +#if defined(__i386) || defined(__amd64) +static __inline void +prefetch_read_many(void *addr) +{ + __asm__( + "prefetcht0 (%0)" + : + : "r" (addr)); +} + +static __inline void +prefetch_read_once(void *addr) +{ + __asm__( + "prefetchnta (%0)" + : + : "r" (addr)); +} +#endif + +#if defined(__i386__) || defined(__amd64__) +#include +#include +#endif +static __inline void +sfxge_map_mbuf_fast(bus_dma_tag_t tag, bus_dmamap_t map, + struct mbuf *m, bus_dma_segment_t *seg) +{ +#if defined(__i386__) || defined(__amd64__) + seg->ds_addr = pmap_kextract(mtod(m, vm_offset_t)); + seg->ds_len = m->m_len; +#else + int nsegstmp; + + bus_dmamap_load_mbuf_sg(tag, map, m, seg, &nsegstmp, 0); +#endif +} + +/* Modifiers used for DOS builds */ +#define __cs +#define __far + +/* Modifiers used for Windows builds */ +#define __in +#define __in_opt +#define __in_ecount(_n) +#define __in_ecount_opt(_n) +#define __in_bcount(_n) +#define __in_bcount_opt(_n) + +#define __out +#define __out_opt +#define __out_ecount(_n) +#define __out_ecount_opt(_n) +#define __out_bcount(_n) +#define __out_bcount_opt(_n) + +#define __deref_out + +#define __inout +#define __inout_opt +#define __inout_ecount(_n) +#define __inout_ecount_opt(_n) +#define __inout_bcount(_n) +#define __inout_bcount_opt(_n) +#define __inout_bcount_full_opt(_n) + +#define __deref_out_bcount_opt(n) + +#define __checkReturn + +#define __drv_when(_p, _c) + +/* Code inclusion options */ + + +#define EFSYS_OPT_NAMES 1 + +#define EFSYS_OPT_FALCON 0 +#define EFSYS_OPT_FALCON_NIC_CFG_OVERRIDE 0 +#define EFSYS_OPT_SIENA 1 +#ifdef DEBUG +#define EFSYS_OPT_CHECK_REG 1 +#else +#define EFSYS_OPT_CHECK_REG 0 +#endif + +#define EFSYS_OPT_MCDI 1 + +#define EFSYS_OPT_MAC_FALCON_GMAC 0 +#define EFSYS_OPT_MAC_FALCON_XMAC 0 +#define EFSYS_OPT_MAC_STATS 1 + +#define EFSYS_OPT_LOOPBACK 0 + +#define EFSYS_OPT_MON_NULL 0 +#define EFSYS_OPT_MON_LM87 0 +#define EFSYS_OPT_MON_MAX6647 0 +#define EFSYS_OPT_MON_SIENA 0 +#define EFSYS_OPT_MON_STATS 0 + +#define EFSYS_OPT_PHY_NULL 0 +#define EFSYS_OPT_PHY_QT2022C2 0 +#define EFSYS_OPT_PHY_SFX7101 0 +#define EFSYS_OPT_PHY_TXC43128 0 +#define EFSYS_OPT_PHY_PM8358 0 +#define EFSYS_OPT_PHY_SFT9001 0 +#define EFSYS_OPT_PHY_QT2025C 0 +#define EFSYS_OPT_PHY_STATS 1 +#define EFSYS_OPT_PHY_PROPS 0 +#define EFSYS_OPT_PHY_BIST 1 +#define EFSYS_OPT_PHY_LED_CONTROL 1 +#define EFSYS_OPT_PHY_FLAGS 0 + +#define EFSYS_OPT_VPD 1 +#define EFSYS_OPT_NVRAM 1 +#define EFSYS_OPT_NVRAM_FALCON_BOOTROM 0 +#define EFSYS_OPT_NVRAM_SFT9001 0 +#define EFSYS_OPT_NVRAM_SFX7101 0 +#define EFSYS_OPT_BOOTCFG 0 + +#define EFSYS_OPT_PCIE_TUNE 0 +#define EFSYS_OPT_DIAG 0 +#define EFSYS_OPT_WOL 1 +#define EFSYS_OPT_RX_SCALE 1 +#define EFSYS_OPT_QSTATS 1 +#define EFSYS_OPT_FILTER 0 +#define EFSYS_OPT_RX_SCATTER 0 +#define EFSYS_OPT_RX_HDR_SPLIT 0 + +#define EFSYS_OPT_EV_PREFETCH 0 + +#define EFSYS_OPT_DECODE_INTR_FATAL 1 + +/* ID */ + +typedef struct __efsys_identifier_s efsys_identifier_t; + +/* PROBE */ + +#ifndef KDTRACE_HOOKS + +#define EFSYS_PROBE(_name) + +#define EFSYS_PROBE1(_name, _type1, _arg1) + +#define EFSYS_PROBE2(_name, _type1, _arg1, _type2, _arg2) + +#define EFSYS_PROBE3(_name, _type1, _arg1, _type2, _arg2, \ + _type3, _arg3) + +#define EFSYS_PROBE4(_name, _type1, _arg1, _type2, _arg2, \ + _type3, _arg3, _type4, _arg4) + +#define EFSYS_PROBE5(_name, _type1, _arg1, _type2, _arg2, \ + _type3, _arg3, _type4, _arg4, _type5, _arg5) + +#define EFSYS_PROBE6(_name, _type1, _arg1, _type2, _arg2, \ + _type3, _arg3, _type4, _arg4, _type5, _arg5, \ + _type6, _arg6) + +#define EFSYS_PROBE7(_name, _type1, _arg1, _type2, _arg2, \ + _type3, _arg3, _type4, _arg4, _type5, _arg5, \ + _type6, _arg6, _type7, _arg7) + +#else /* KDTRACE_HOOKS */ + +#define EFSYS_PROBE(_name) \ + DTRACE_PROBE(_name) + +#define EFSYS_PROBE1(_name, _type1, _arg1) \ + DTRACE_PROBE1(_name, _type1, _arg1) + +#define EFSYS_PROBE2(_name, _type1, _arg1, _type2, _arg2) \ + DTRACE_PROBE2(_name, _type1, _arg1, _type2, _arg2) + +#define EFSYS_PROBE3(_name, _type1, _arg1, _type2, _arg2, \ + _type3, _arg3) \ + DTRACE_PROBE3(_name, _type1, _arg1, _type2, _arg2, \ + _type3, _arg3) + +#define EFSYS_PROBE4(_name, _type1, _arg1, _type2, _arg2, \ + _type3, _arg3, _type4, _arg4) \ + DTRACE_PROBE4(_name, _type1, _arg1, _type2, _arg2, \ + _type3, _arg3, _type4, _arg4) + +#ifdef DTRACE_PROBE5 +#define EFSYS_PROBE5(_name, _type1, _arg1, _type2, _arg2, \ + _type3, _arg3, _type4, _arg4, _type5, _arg5) \ + DTRACE_PROBE5(_name, _type1, _arg1, _type2, _arg2, \ + _type3, _arg3, _type4, _arg4, _type5, _arg5) +#else +#define EFSYS_PROBE5(_name, _type1, _arg1, _type2, _arg2, \ + _type3, _arg3, _type4, _arg4, _type5, _arg5) \ + DTRACE_PROBE4(_name, _type1, _arg1, _type2, _arg2, \ + _type3, _arg3, _type4, _arg4) +#endif + +#ifdef DTRACE_PROBE6 +#define EFSYS_PROBE6(_name, _type1, _arg1, _type2, _arg2, \ + _type3, _arg3, _type4, _arg4, _type5, _arg5, \ + _type6, _arg6) \ + DTRACE_PROBE6(_name, _type1, _arg1, _type2, _arg2, \ + _type3, _arg3, _type4, _arg4, _type5, _arg5, \ + _type6, _arg6) +#else +#define EFSYS_PROBE6(_name, _type1, _arg1, _type2, _arg2, \ + _type3, _arg3, _type4, _arg4, _type5, _arg5, \ + _type6, _arg6) \ + EFSYS_PROBE5(_name, _type1, _arg1, _type2, _arg2, \ + _type3, _arg3, _type4, _arg4, _type5, _arg5) +#endif + +#ifdef DTRACE_PROBE7 +#define EFSYS_PROBE7(_name, _type1, _arg1, _type2, _arg2, \ + _type3, _arg3, _type4, _arg4, _type5, _arg5, \ + _type6, _arg6, _type7, _arg7) \ + DTRACE_PROBE7(_name, _type1, _arg1, _type2, _arg2, \ + _type3, _arg3, _type4, _arg4, _type5, _arg5, \ + _type6, _arg6, _type7, _arg7) +#else +#define EFSYS_PROBE7(_name, _type1, _arg1, _type2, _arg2, \ + _type3, _arg3, _type4, _arg4, _type5, _arg5, \ + _type6, _arg6, _type7, _arg7) \ + EFSYS_PROBE6(_name, _type1, _arg1, _type2, _arg2, \ + _type3, _arg3, _type4, _arg4, _type5, _arg5, \ + _type6, _arg6) +#endif + +#endif /* KDTRACE_HOOKS */ + +/* DMA */ + +typedef uint64_t efsys_dma_addr_t; + +typedef struct efsys_mem_s { + bus_dma_tag_t esm_tag; + bus_dmamap_t esm_map; + caddr_t esm_base; + efsys_dma_addr_t esm_addr; + size_t esm_size; +} efsys_mem_t; + + +#define EFSYS_MEM_ZERO(_esmp, _size) \ + do { \ + (void) memset((_esmp)->esm_base, 0, (_size)); \ + \ + _NOTE(CONSTANTCONDITION) \ + } while (B_FALSE) + +#define EFSYS_MEM_READD(_esmp, _offset, _edp) \ + do { \ + uint32_t *addr; \ + \ + _NOTE(CONSTANTCONDITION) \ + KASSERT(IS_P2ALIGNED(_offset, sizeof (efx_dword_t)), \ + ("not power of 2 aligned")); \ + \ + addr = (void *)((_esmp)->esm_base + (_offset)); \ + \ + (_edp)->ed_u32[0] = *addr; \ + \ + EFSYS_PROBE2(mem_readd, unsigned int, (_offset), \ + uint32_t, (_edp)->ed_u32[0]); \ + \ + _NOTE(CONSTANTCONDITION) \ + } while (B_FALSE) + +#define EFSYS_MEM_READQ(_esmp, _offset, _eqp) \ + do { \ + uint32_t *addr; \ + \ + _NOTE(CONSTANTCONDITION) \ + KASSERT(IS_P2ALIGNED(_offset, sizeof (efx_qword_t)), \ + ("not power of 2 aligned")); \ + \ + addr = (void *)((_esmp)->esm_base + (_offset)); \ + \ + (_eqp)->eq_u32[0] = *addr++; \ + (_eqp)->eq_u32[1] = *addr; \ + \ + EFSYS_PROBE3(mem_readq, unsigned int, (_offset), \ + uint32_t, (_eqp)->eq_u32[1], \ + uint32_t, (_eqp)->eq_u32[0]); \ + \ + _NOTE(CONSTANTCONDITION) \ + } while (B_FALSE) + +#define EFSYS_MEM_READO(_esmp, _offset, _eop) \ + do { \ + uint32_t *addr; \ + \ + _NOTE(CONSTANTCONDITION) \ + KASSERT(IS_P2ALIGNED(_offset, sizeof (efx_oword_t)), \ + ("not power of 2 aligned")); \ + \ + addr = (void *)((_esmp)->esm_base + (_offset)); \ + \ + (_eop)->eo_u32[0] = *addr++; \ + (_eop)->eo_u32[1] = *addr++; \ + (_eop)->eo_u32[2] = *addr++; \ + (_eop)->eo_u32[3] = *addr; \ + \ + EFSYS_PROBE5(mem_reado, unsigned int, (_offset), \ + uint32_t, (_eop)->eo_u32[3], \ + uint32_t, (_eop)->eo_u32[2], \ + uint32_t, (_eop)->eo_u32[1], \ + uint32_t, (_eop)->eo_u32[0]); \ + \ + _NOTE(CONSTANTCONDITION) \ + } while (B_FALSE) + +#define EFSYS_MEM_WRITED(_esmp, _offset, _edp) \ + do { \ + uint32_t *addr; \ + \ + _NOTE(CONSTANTCONDITION) \ + KASSERT(IS_P2ALIGNED(_offset, sizeof (efx_dword_t)), \ + ("not power of 2 aligned")); \ + \ + EFSYS_PROBE2(mem_writed, unsigned int, (_offset), \ + uint32_t, (_edp)->ed_u32[0]); \ + \ + addr = (void *)((_esmp)->esm_base + (_offset)); \ + \ + *addr = (_edp)->ed_u32[0]; \ + \ + _NOTE(CONSTANTCONDITION) \ + } while (B_FALSE) + +#define EFSYS_MEM_WRITEQ(_esmp, _offset, _eqp) \ + do { \ + uint32_t *addr; \ + \ + _NOTE(CONSTANTCONDITION) \ + KASSERT(IS_P2ALIGNED(_offset, sizeof (efx_qword_t)), \ + ("not power of 2 aligned")); \ + \ + EFSYS_PROBE3(mem_writeq, unsigned int, (_offset), \ + uint32_t, (_eqp)->eq_u32[1], \ + uint32_t, (_eqp)->eq_u32[0]); \ + \ + addr = (void *)((_esmp)->esm_base + (_offset)); \ + \ + *addr++ = (_eqp)->eq_u32[0]; \ + *addr = (_eqp)->eq_u32[1]; \ + \ + _NOTE(CONSTANTCONDITION) \ + } while (B_FALSE) + +#define EFSYS_MEM_WRITEO(_esmp, _offset, _eop) \ + do { \ + uint32_t *addr; \ + \ + _NOTE(CONSTANTCONDITION) \ + KASSERT(IS_P2ALIGNED(_offset, sizeof (efx_oword_t)), \ + ("not power of 2 aligned")); \ + \ + EFSYS_PROBE5(mem_writeo, unsigned int, (_offset), \ + uint32_t, (_eop)->eo_u32[3], \ + uint32_t, (_eop)->eo_u32[2], \ + uint32_t, (_eop)->eo_u32[1], \ + uint32_t, (_eop)->eo_u32[0]); \ + \ + addr = (void *)((_esmp)->esm_base + (_offset)); \ + \ + *addr++ = (_eop)->eo_u32[0]; \ + *addr++ = (_eop)->eo_u32[1]; \ + *addr++ = (_eop)->eo_u32[2]; \ + *addr = (_eop)->eo_u32[3]; \ + \ + _NOTE(CONSTANTCONDITION) \ + } while (B_FALSE) + +#define EFSYS_MEM_ADDR(_esmp) \ + ((_esmp)->esm_addr) + +/* BAR */ + +typedef struct efsys_bar_s { + struct mtx esb_lock; + bus_space_tag_t esb_tag; + bus_space_handle_t esb_handle; + int esb_rid; + struct resource *esb_res; +} efsys_bar_t; + +#define EFSYS_BAR_READD(_esbp, _offset, _edp, _lock) \ + do { \ + _NOTE(CONSTANTCONDITION) \ + KASSERT(IS_P2ALIGNED(_offset, sizeof (efx_dword_t)), \ + ("not power of 2 aligned")); \ + \ + _NOTE(CONSTANTCONDITION) \ + if (_lock) \ + mtx_lock(&((_esbp)->esb_lock)); \ + \ + (_edp)->ed_u32[0] = bus_space_read_4((_esbp)->esb_tag, \ + (_esbp)->esb_handle, (_offset)); \ + \ + EFSYS_PROBE2(bar_readd, unsigned int, (_offset), \ + uint32_t, (_edp)->ed_u32[0]); \ + \ + _NOTE(CONSTANTCONDITION) \ + if (_lock) \ + mtx_unlock(&((_esbp)->esb_lock)); \ + _NOTE(CONSTANTCONDITION) \ + } while (B_FALSE) + +#define EFSYS_BAR_READQ(_esbp, _offset, _eqp) \ + do { \ + _NOTE(CONSTANTCONDITION) \ + KASSERT(IS_P2ALIGNED(_offset, sizeof (efx_qword_t)), \ + ("not power of 2 aligned")); \ + \ + mtx_lock(&((_esbp)->esb_lock)); \ + \ + (_eqp)->eq_u32[0] = bus_space_read_4((_esbp)->esb_tag, \ + (_esbp)->esb_handle, (_offset)); \ + (_eqp)->eq_u32[1] = bus_space_read_4((_esbp)->esb_tag, \ + (_esbp)->esb_handle, (_offset+4)); \ + \ + EFSYS_PROBE3(bar_readq, unsigned int, (_offset), \ + uint32_t, (_eqp)->eq_u32[1], \ + uint32_t, (_eqp)->eq_u32[0]); \ + \ + mtx_unlock(&((_esbp)->esb_lock)); \ + _NOTE(CONSTANTCONDITION) \ + } while (B_FALSE) + +#define EFSYS_BAR_READO(_esbp, _offset, _eop, _lock) \ + do { \ + _NOTE(CONSTANTCONDITION) \ + KASSERT(IS_P2ALIGNED(_offset, sizeof (efx_oword_t)), \ + ("not power of 2 aligned")); \ + \ + _NOTE(CONSTANTCONDITION) \ + if (_lock) \ + mtx_lock(&((_esbp)->esb_lock)); \ + \ + (_eop)->eo_u32[0] = bus_space_read_4((_esbp)->esb_tag, \ + (_esbp)->esb_handle, (_offset)); \ + (_eop)->eo_u32[1] = bus_space_read_4((_esbp)->esb_tag, \ + (_esbp)->esb_handle, (_offset+4)); \ + (_eop)->eo_u32[2] = bus_space_read_4((_esbp)->esb_tag, \ + (_esbp)->esb_handle, (_offset+8)); \ + (_eop)->eo_u32[3] = bus_space_read_4((_esbp)->esb_tag, \ + (_esbp)->esb_handle, (_offset+12)); \ + \ + EFSYS_PROBE5(bar_reado, unsigned int, (_offset), \ + uint32_t, (_eop)->eo_u32[3], \ + uint32_t, (_eop)->eo_u32[2], \ + uint32_t, (_eop)->eo_u32[1], \ + uint32_t, (_eop)->eo_u32[0]); \ + \ + _NOTE(CONSTANTCONDITION) \ + if (_lock) \ + mtx_unlock(&((_esbp)->esb_lock)); \ + _NOTE(CONSTANTCONDITION) \ + } while (B_FALSE) + +#define EFSYS_BAR_WRITED(_esbp, _offset, _edp, _lock) \ + do { \ + _NOTE(CONSTANTCONDITION) \ + KASSERT(IS_P2ALIGNED(_offset, sizeof (efx_dword_t)), \ + ("not power of 2 aligned")); \ + \ + _NOTE(CONSTANTCONDITION) \ + if (_lock) \ + mtx_lock(&((_esbp)->esb_lock)); \ + \ + EFSYS_PROBE2(bar_writed, unsigned int, (_offset), \ + uint32_t, (_edp)->ed_u32[0]); \ + \ + bus_space_write_4((_esbp)->esb_tag, (_esbp)->esb_handle,\ + (_offset), (_edp)->ed_u32[0]); \ + \ + _NOTE(CONSTANTCONDITION) \ + if (_lock) \ + mtx_unlock(&((_esbp)->esb_lock)); \ + _NOTE(CONSTANTCONDITION) \ + } while (B_FALSE) + +#define EFSYS_BAR_WRITEQ(_esbp, _offset, _eqp) \ + do { \ + _NOTE(CONSTANTCONDITION) \ + KASSERT(IS_P2ALIGNED(_offset, sizeof (efx_qword_t)), \ + ("not power of 2 aligned")); \ + \ + mtx_lock(&((_esbp)->esb_lock)); \ + \ + EFSYS_PROBE3(bar_writeq, unsigned int, (_offset), \ + uint32_t, (_eqp)->eq_u32[1], \ + uint32_t, (_eqp)->eq_u32[0]); \ + \ + bus_space_write_4((_esbp)->esb_tag, (_esbp)->esb_handle,\ + (_offset), (_eqp)->eq_u32[0]); \ + bus_space_write_4((_esbp)->esb_tag, (_esbp)->esb_handle,\ + (_offset+4), (_eqp)->eq_u32[1]); \ + \ + mtx_unlock(&((_esbp)->esb_lock)); \ + _NOTE(CONSTANTCONDITION) \ + } while (B_FALSE) + +#define EFSYS_BAR_WRITEO(_esbp, _offset, _eop, _lock) \ + do { \ + _NOTE(CONSTANTCONDITION) \ + KASSERT(IS_P2ALIGNED(_offset, sizeof (efx_oword_t)), \ + ("not power of 2 aligned")); \ + \ + _NOTE(CONSTANTCONDITION) \ + if (_lock) \ + mtx_lock(&((_esbp)->esb_lock)); \ + \ + EFSYS_PROBE5(bar_writeo, unsigned int, (_offset), \ + uint32_t, (_eop)->eo_u32[3], \ + uint32_t, (_eop)->eo_u32[2], \ + uint32_t, (_eop)->eo_u32[1], \ + uint32_t, (_eop)->eo_u32[0]); \ + \ + bus_space_write_4((_esbp)->esb_tag, (_esbp)->esb_handle,\ + (_offset), (_eop)->eo_u32[0]); \ + bus_space_write_4((_esbp)->esb_tag, (_esbp)->esb_handle,\ + (_offset+4), (_eop)->eo_u32[1]); \ + bus_space_write_4((_esbp)->esb_tag, (_esbp)->esb_handle,\ + (_offset+8), (_eop)->eo_u32[2]); \ + bus_space_write_4((_esbp)->esb_tag, (_esbp)->esb_handle,\ + (_offset+12), (_eop)->eo_u32[3]); \ + \ + _NOTE(CONSTANTCONDITION) \ + if (_lock) \ + mtx_unlock(&((_esbp)->esb_lock)); \ + _NOTE(CONSTANTCONDITION) \ + } while (B_FALSE) + +/* SPIN */ + +#define EFSYS_SPIN(_us) \ + do { \ + DELAY(_us); \ + _NOTE(CONSTANTCONDITION) \ + } while (B_FALSE) + +#define EFSYS_SLEEP EFSYS_SPIN + +/* BARRIERS */ + +/* Strict ordering guaranteed by devacc.devacc_attr_dataorder */ +#define EFSYS_MEM_READ_BARRIER() +#define EFSYS_PIO_WRITE_BARRIER() + +/* TIMESTAMP */ + +typedef clock_t efsys_timestamp_t; + +#define EFSYS_TIMESTAMP(_usp) \ + do { \ + clock_t now; \ + \ + now = ticks; \ + *(_usp) = now * hz / 1000000; \ + _NOTE(CONSTANTCONDITION) \ + } while (B_FALSE) + +/* KMEM */ + +#define EFSYS_KMEM_ALLOC(_esip, _size, _p) \ + do { \ + (_esip) = (_esip); \ + (_p) = malloc((_size), M_SFXGE, M_WAITOK|M_ZERO); \ + _NOTE(CONSTANTCONDITION) \ + } while (B_FALSE) + +#define EFSYS_KMEM_FREE(_esip, _size, _p) \ + do { \ + (void) (_esip); \ + (void) (_size); \ + free((_p), M_SFXGE); \ + _NOTE(CONSTANTCONDITION) \ + } while (B_FALSE) + +/* LOCK */ + +typedef struct mtx efsys_lock_t; + +#define EFSYS_LOCK_MAGIC 0x000010c4 + +#define EFSYS_LOCK(_lockp, _state) \ + do { \ + mtx_lock(_lockp); \ + (_state) = EFSYS_LOCK_MAGIC; \ + _NOTE(CONSTANTCONDITION) \ + } while (B_FALSE) + +#define EFSYS_UNLOCK(_lockp, _state) \ + do { \ + if ((_state) != EFSYS_LOCK_MAGIC) \ + KASSERT(B_FALSE, ("not locked")); \ + mtx_unlock(_lockp); \ + _NOTE(CONSTANTCONDITION) \ + } while (B_FALSE) + +/* PREEMPT */ + +#define EFSYS_PREEMPT_DISABLE(_state) \ + do { \ + (_state) = (_state); \ + critical_enter(); \ + _NOTE(CONSTANTCONDITION) \ + } while (B_FALSE) + +#define EFSYS_PREEMPT_ENABLE(_state) \ + do { \ + (_state) = (_state); \ + critical_exit(_state); \ + _NOTE(CONSTANTCONDITION) \ + } while (B_FALSE) + +/* STAT */ + +typedef uint64_t efsys_stat_t; + +#define EFSYS_STAT_INCR(_knp, _delta) \ + do { \ + *(_knp) += (_delta); \ + _NOTE(CONSTANTCONDITION) \ + } while (B_FALSE) + +#define EFSYS_STAT_DECR(_knp, _delta) \ + do { \ + *(_knp) -= (_delta); \ + _NOTE(CONSTANTCONDITION) \ + } while (B_FALSE) + +#define EFSYS_STAT_SET(_knp, _val) \ + do { \ + *(_knp) = (_val); \ + _NOTE(CONSTANTCONDITION) \ + } while (B_FALSE) + +#define EFSYS_STAT_SET_QWORD(_knp, _valp) \ + do { \ + *(_knp) = le64toh((_valp)->eq_u64[0]); \ + _NOTE(CONSTANTCONDITION) \ + } while (B_FALSE) + +#define EFSYS_STAT_SET_DWORD(_knp, _valp) \ + do { \ + *(_knp) = le32toh((_valp)->ed_u32[0]); \ + _NOTE(CONSTANTCONDITION) \ + } while (B_FALSE) + +#define EFSYS_STAT_INCR_QWORD(_knp, _valp) \ + do { \ + *(_knp) += le64toh((_valp)->eq_u64[0]); \ + _NOTE(CONSTANTCONDITION) \ + } while (B_FALSE) + +#define EFSYS_STAT_SUBR_QWORD(_knp, _valp) \ + do { \ + *(_knp) -= le64toh((_valp)->eq_u64[0]); \ + _NOTE(CONSTANTCONDITION) \ + } while (B_FALSE) + +/* ERR */ + +extern void sfxge_err(efsys_identifier_t *, unsigned int, + uint32_t, uint32_t); + +#if EFSYS_OPT_DECODE_INTR_FATAL +#define EFSYS_ERR(_esip, _code, _dword0, _dword1) \ + do { \ + sfxge_err((_esip), (_code), (_dword0), (_dword1)); \ + _NOTE(CONSTANTCONDITION) \ + } while (B_FALSE) +#endif + +/* ASSERT */ + +#define EFSYS_ASSERT(_exp) do { \ + if (!(_exp)) \ + panic(#_exp); \ + } while (0) + +#define EFSYS_ASSERT3(_x, _op, _y, _t) do { \ + const _t __x = (_t)(_x); \ + const _t __y = (_t)(_y); \ + if (!(__x _op __y)) \ + panic("assertion failed at %s:%u", __FILE__, __LINE__); \ + } while(0) + +#define EFSYS_ASSERT3U(_x, _op, _y) EFSYS_ASSERT3(_x, _op, _y, uint64_t) +#define EFSYS_ASSERT3S(_x, _op, _y) EFSYS_ASSERT3(_x, _op, _y, int64_t) +#define EFSYS_ASSERT3P(_x, _op, _y) EFSYS_ASSERT3(_x, _op, _y, uintptr_t) + +#ifdef __cplusplus +} +#endif + +#endif /* _SYS_EFSYS_H */ Added: head/sys/dev/sfxge/common/efx.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/sfxge/common/efx.h Wed Nov 16 17:11:13 2011 (r227569) @@ -0,0 +1,1893 @@ +/*- + * Copyright 2006-2009 Solarflare Communications Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _SYS_EFX_H +#define _SYS_EFX_H + +#include "efsys.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define EFX_STATIC_ASSERT(_cond) ((void)sizeof(char[(_cond) ? 1 : -1])) + +#define EFX_ARRAY_SIZE(_array) (sizeof(_array) / sizeof((_array)[0])) + +#ifndef EFSYS_MEM_IS_NULL +#define EFSYS_MEM_IS_NULL(_esmp) ((_esmp)->esm_base == NULL) +#endif + +typedef enum efx_family_e { + EFX_FAMILY_INVALID, + EFX_FAMILY_FALCON, + EFX_FAMILY_SIENA, + EFX_FAMILY_NTYPES +} efx_family_t; + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Nov 16 17:40:00 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 37CFE106566C; Wed, 16 Nov 2011 17:40:00 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 265DE8FC1B; Wed, 16 Nov 2011 17:40:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAGHe0SK059540; Wed, 16 Nov 2011 17:40:00 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAGHe0gj059538; Wed, 16 Nov 2011 17:40:00 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201111161740.pAGHe0gj059538@svn.freebsd.org> From: Bernhard Schmidt Date: Wed, 16 Nov 2011 17:40:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227570 - stable/9/sys/dev/iwn X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2011 17:40:00 -0000 Author: bschmidt Date: Wed Nov 16 17:39:59 2011 New Revision: 227570 URL: http://svn.freebsd.org/changeset/base/227570 Log: MFC r226679: Let net80211 also know about stopped BA sessions. This fixes some issues where the driver assumed that BA resources are still available due to net80211 saying so. PR: 161407, 159768 Tested by: cperciva, rene Approved by: re (kib) Modified: stable/9/sys/dev/iwn/if_iwn.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/dev/iwn/if_iwn.c ============================================================================== --- stable/9/sys/dev/iwn/if_iwn.c Wed Nov 16 17:11:13 2011 (r227569) +++ stable/9/sys/dev/iwn/if_iwn.c Wed Nov 16 17:39:59 2011 (r227570) @@ -5641,6 +5641,7 @@ iwn_ampdu_tx_stop(struct ieee80211_node sc->qid2tap[qid] = NULL; free(tap->txa_private, M_DEVBUF); tap->txa_private = NULL; + sc->sc_addba_stop(ni, tap); } static void From owner-svn-src-all@FreeBSD.ORG Wed Nov 16 17:41:32 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1C760106566C; Wed, 16 Nov 2011 17:41:32 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0C2F58FC1A; Wed, 16 Nov 2011 17:41:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAGHfVom059623; Wed, 16 Nov 2011 17:41:31 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAGHfV1Z059621; Wed, 16 Nov 2011 17:41:31 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201111161741.pAGHfV1Z059621@svn.freebsd.org> From: Bernhard Schmidt Date: Wed, 16 Nov 2011 17:41:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227571 - releng/9.0/sys/dev/iwn X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2011 17:41:32 -0000 Author: bschmidt Date: Wed Nov 16 17:41:31 2011 New Revision: 227571 URL: http://svn.freebsd.org/changeset/base/227571 Log: MFC r226679: Let net80211 also know about stopped BA sessions. This fixes some issues where the driver assumed that BA resources are still available due to net80211 saying so. PR: 161407, 159768 Tested by: cperciva, rene Approved by: re (kib) Modified: releng/9.0/sys/dev/iwn/if_iwn.c Directory Properties: releng/9.0/sys/ (props changed) Modified: releng/9.0/sys/dev/iwn/if_iwn.c ============================================================================== --- releng/9.0/sys/dev/iwn/if_iwn.c Wed Nov 16 17:39:59 2011 (r227570) +++ releng/9.0/sys/dev/iwn/if_iwn.c Wed Nov 16 17:41:31 2011 (r227571) @@ -5641,6 +5641,7 @@ iwn_ampdu_tx_stop(struct ieee80211_node sc->qid2tap[qid] = NULL; free(tap->txa_private, M_DEVBUF); tap->txa_private = NULL; + sc->sc_addba_stop(ni, tap); } static void From owner-svn-src-all@FreeBSD.ORG Wed Nov 16 17:48:05 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B54FC106564A; Wed, 16 Nov 2011 17:48:05 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9B6E38FC14; Wed, 16 Nov 2011 17:48:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAGHm5Y5059858; Wed, 16 Nov 2011 17:48:05 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAGHm5u8059853; Wed, 16 Nov 2011 17:48:05 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201111161748.pAGHm5u8059853@svn.freebsd.org> From: John Baldwin Date: Wed, 16 Nov 2011 17:48:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227572 - in stable/8/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2011 17:48:05 -0000 Author: jhb Date: Wed Nov 16 17:48:05 2011 New Revision: 227572 URL: http://svn.freebsd.org/changeset/base/227572 Log: Partially MFC 218195, 218424, and 221829: - Put the general logic for being a CPU hog into a new function should_yield(). - Encapsulate the common case of check-and-yield into a new function maybe_yield(). - Add kern_yield() as a more generic version of uio_yield() and reimplement uio_yield() in terms of kern_yield(). To preserve the ABI of struct thread, should_yield() in 8 continues to use PCPU_GET(switchticks) rather than the td_swvolticks added in 9. Also, existing users of uio_yield() are left unchanged. Instead, the routines are merely added for use by new code. Reviewed by: mdf Modified: stable/8/sys/kern/kern_subr.c stable/8/sys/kern/kern_synch.c stable/8/sys/sys/priority.h stable/8/sys/sys/proc.h Modified: stable/8/sys/kern/kern_subr.c ============================================================================== --- stable/8/sys/kern/kern_subr.c Wed Nov 16 17:41:31 2011 (r227571) +++ stable/8/sys/kern/kern_subr.c Wed Nov 16 17:48:05 2011 (r227572) @@ -455,15 +455,8 @@ phashinit(int elements, struct malloc_ty void uio_yield(void) { - struct thread *td; - td = curthread; - DROP_GIANT(); - thread_lock(td); - sched_prio(td, td->td_user_pri); - mi_switch(SW_INVOL | SWT_RELINQUISH, NULL); - thread_unlock(td); - PICKUP_GIANT(); + kern_yield(PRI_USER); } int Modified: stable/8/sys/kern/kern_synch.c ============================================================================== --- stable/8/sys/kern/kern_synch.c Wed Nov 16 17:41:31 2011 (r227571) +++ stable/8/sys/kern/kern_synch.c Wed Nov 16 17:48:05 2011 (r227572) @@ -536,6 +536,38 @@ synch_setup(void *dummy) loadav(NULL); } +int +should_yield(void) +{ + + return (ticks - PCPU_GET(switchticks) >= hogticks); +} + +void +maybe_yield(void) +{ + + if (should_yield()) + kern_yield(PRI_USER); +} + +void +kern_yield(int prio) +{ + struct thread *td; + + td = curthread; + DROP_GIANT(); + thread_lock(td); + if (prio == PRI_USER) + prio = td->td_user_pri; + if (prio >= 0) + sched_prio(td, prio); + mi_switch(SW_VOL | SWT_RELINQUISH, NULL); + thread_unlock(td); + PICKUP_GIANT(); +} + /* * General purpose yield system call. */ Modified: stable/8/sys/sys/priority.h ============================================================================== --- stable/8/sys/sys/priority.h Wed Nov 16 17:41:31 2011 (r227571) +++ stable/8/sys/sys/priority.h Wed Nov 16 17:48:05 2011 (r227572) @@ -117,6 +117,12 @@ #define PRI_MIN_IDLE (224) #define PRI_MAX_IDLE (PRI_MAX) +#ifdef _KERNEL +/* Other arguments for kern_yield(9). */ +#define PRI_USER -2 /* Change to current user priority. */ +#define PRI_UNCHANGED -1 /* Do not change priority. */ +#endif + struct priority { u_char pri_class; /* Scheduling class. */ u_char pri_level; /* Normal priority level. */ Modified: stable/8/sys/sys/proc.h ============================================================================== --- stable/8/sys/sys/proc.h Wed Nov 16 17:41:31 2011 (r227571) +++ stable/8/sys/sys/proc.h Wed Nov 16 17:48:05 2011 (r227572) @@ -817,9 +817,11 @@ void fork_exit(void (*)(void *, struct t struct trapframe *); void fork_return(struct thread *, struct trapframe *); int inferior(struct proc *p); +void kern_yield(int); void kick_proc0(void); int leavepgrp(struct proc *p); int maybe_preempt(struct thread *td); +void maybe_yield(void); void mi_switch(int flags, struct thread *newtd); int p_candebug(struct thread *td, struct proc *p); int p_cansee(struct thread *td, struct proc *p); @@ -842,6 +844,7 @@ void sess_hold(struct session *); void sess_release(struct session *); int setrunnable(struct thread *); void setsugid(struct proc *p); +int should_yield(void); int sigonstack(size_t sp); void sleepinit(void); void stopevent(struct proc *, u_int, u_int); From owner-svn-src-all@FreeBSD.ORG Wed Nov 16 18:33:18 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64CD41065672; Wed, 16 Nov 2011 18:33:18 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 51BC48FC13; Wed, 16 Nov 2011 18:33:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAGIXI0N061315; Wed, 16 Nov 2011 18:33:18 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAGIXHsG061302; Wed, 16 Nov 2011 18:33:17 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201111161833.pAGIXHsG061302@svn.freebsd.org> From: John Baldwin Date: Wed, 16 Nov 2011 18:33:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227573 - in stable/8: lib/libc/sys sys/compat/freebsd32 sys/kern sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2011 18:33:18 -0000 Author: jhb Date: Wed Nov 16 18:33:17 2011 New Revision: 227573 URL: http://svn.freebsd.org/changeset/base/227573 Log: MFC 220791,220793,220846,221836,226364: Add the posix_fallocate(2) syscall. The default implementation in vop_stdallocate() is filesystem agnostic and will run as slow as a read/write loop in userspace; however, it serves to correctly implement the functionality for filesystems that do not implement a VOP_ALLOCATE. Allow VOP_ALLOCATE to be iterative, and have kern_posix_fallocate(9) drive looping and potentially yielding. Reviewed by: mdf Added: stable/8/lib/libc/sys/posix_fallocate.2 - copied unchanged from r220791, head/lib/libc/sys/posix_fallocate.2 Modified: stable/8/lib/libc/sys/Makefile.inc stable/8/lib/libc/sys/Symbol.map stable/8/sys/compat/freebsd32/freebsd32_misc.c stable/8/sys/compat/freebsd32/syscalls.master stable/8/sys/kern/syscalls.master stable/8/sys/kern/vfs_default.c stable/8/sys/kern/vfs_syscalls.c stable/8/sys/kern/vnode_if.src stable/8/sys/sys/fcntl.h stable/8/sys/sys/param.h stable/8/sys/sys/vnode.h Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/lib/libc/sys/Makefile.inc ============================================================================== --- stable/8/lib/libc/sys/Makefile.inc Wed Nov 16 17:48:05 2011 (r227572) +++ stable/8/lib/libc/sys/Makefile.inc Wed Nov 16 18:33:17 2011 (r227573) @@ -86,7 +86,7 @@ MAN+= abort2.2 accept.2 access.2 acct.2 mq_setattr.2 \ msgctl.2 msgget.2 msgrcv.2 msgsnd.2 \ msync.2 munmap.2 nanosleep.2 nfssvc.2 ntp_adjtime.2 open.2 \ - pathconf.2 pipe.2 poll.2 posix_openpt.2 profil.2 \ + pathconf.2 pipe.2 poll.2 posix_fallocate.2 posix_openpt.2 profil.2 \ pselect.2 ptrace.2 quotactl.2 \ read.2 readlink.2 reboot.2 recv.2 rename.2 revoke.2 rfork.2 rmdir.2 \ rtprio.2 Modified: stable/8/lib/libc/sys/Symbol.map ============================================================================== --- stable/8/lib/libc/sys/Symbol.map Wed Nov 16 17:48:05 2011 (r227572) +++ stable/8/lib/libc/sys/Symbol.map Wed Nov 16 18:33:17 2011 (r227573) @@ -360,6 +360,10 @@ FBSD_1.1 { unlinkat; }; +FBSD_1.2 { + posix_fallocate; +}; + FBSDprivate_1.0 { ___acl_aclcheck_fd; __sys___acl_aclcheck_fd; Copied: stable/8/lib/libc/sys/posix_fallocate.2 (from r220791, head/lib/libc/sys/posix_fallocate.2) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/lib/libc/sys/posix_fallocate.2 Wed Nov 16 18:33:17 2011 (r227573, copy of r220791, head/lib/libc/sys/posix_fallocate.2) @@ -0,0 +1,146 @@ +.\" Copyright (c) 1980, 1991, 1993 +.\" The Regents of the University of California. 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. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)open.2 8.2 (Berkeley) 11/16/93 +.\" $FreeBSD$ +.\" +.Dd April 13, 2011 +.Dt POSIX_FALLOCATE 2 +.Os +.Sh NAME +.Nm posix_fallocate +.Nd pre-allocate storage for a range in a file +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In fcntl.h +.Ft int +.Fn posix_fallocate "int fd" "off_t offset" "off_t len" +.Sh DESCRIPTION +Required storage for the range +.Fa offset +to +.Fa offset + +.Fa len +in the file referenced by +.Fa fd +is guarateed to be allocated upon successful return. +That is, if +.Fn posix_fallocate +returns successfully, subsequent writes to the specified file data +will not fail due to lack of free space on the file system storage +media. +Any existing file data in the specified range is unmodified. +If +.Fa offset + +.Fa len +is beyond the current file size, then +.Fn posix_fallocate +will adjust the file size to +.Fa offset + +.Fa len . +Otherwise, the file size will not be changed. +.Pp +Space allocated by +.Fn posix_fallocate +will be freed by a successful call to +.Xr creat 2 +or +.Xr open 2 +that truncates the size of the file. +Space allocated via +.Fn posix_fallocate +may be freed by a successful call to +.Xr ftruncate 2 +that reduces the file size to a size smaller than +.Fa offset + +.Fa len . +.Pp +.Sh RETURN VALUES +If successful, +.Fn posix_fallocate +returns zero. +It returns -1 on failure, and sets +.Va errno +to indicate the error. +.Sh ERRORS +Possible failure conditions: +.Bl -tag -width Er +.It Bq Er EBADF +The +.Fa fd +argument is not a valid file descriptor. +.It Bq Er EBADF +The +.Fa fd +argument references a file that was opened without write permission. +.It Bq Er EFBIG +The value of +.Fa offset + +.Fa len +is greater than the maximum file size. +.It Bq Er EINTR +A signal was caught during execution. +.It Bq Er EINVAL +The +.Fa len +argument was zero or the +.Fa offset +argument was less than zero. +.It Bq Er EIO +An I/O error occurred while reading from or writing to a file system. +.It Bq Er ENODEV +The +.Fa fd +argument does not refer to a regular file. +.It Bq Er ENOSPC +There is insufficient free space remaining on the file system storage +media. +.It Bq Er ESPIPE +The +.Fa fd +argument is associated with a pipe or FIFO. +.El +.Sh SEE ALSO +.Xr creat 2 , +.Xr ftruncate 2 , +.Xr open 2 , +.Xr unlink 2 +.Sh STANDARDS +The +.Fn posix_fallocate +system call conforms to +.St -p1003.1-2004 . +.Sh HISTORY +The +.Fn posix_fallocate +function appeared in +.Fx 9.0 . +.Sh AUTHORS +.Fn posix_fallocate +and this manual page were initially written by +.An Matthew Fleming Aq mdf@FreeBSD.org . Modified: stable/8/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- stable/8/sys/compat/freebsd32/freebsd32_misc.c Wed Nov 16 17:48:05 2011 (r227572) +++ stable/8/sys/compat/freebsd32/freebsd32_misc.c Wed Nov 16 18:33:17 2011 (r227573) @@ -2672,3 +2672,15 @@ freebsd32_kldstat(struct thread *td, str bcopy(&stat.pathname[0], &stat32.pathname[0], sizeof(stat.pathname)); return (copyout(&stat32, uap->stat, version)); } + +int +freebsd32_posix_fallocate(struct thread *td, + struct freebsd32_posix_fallocate_args *uap) +{ + struct posix_fallocate_args ap; + + ap.fd = uap->fd; + ap.offset = PAIR32TO64(off_t, uap->offset); + ap.len = PAIR32TO64(off_t, uap->len); + return (posix_fallocate(td, &ap)); +} Modified: stable/8/sys/compat/freebsd32/syscalls.master ============================================================================== --- stable/8/sys/compat/freebsd32/syscalls.master Wed Nov 16 17:48:05 2011 (r227572) +++ stable/8/sys/compat/freebsd32/syscalls.master Wed Nov 16 18:33:17 2011 (r227573) @@ -963,3 +963,14 @@ fd_set *ou, fd_set *ex, \ const struct timespec32 *ts, \ const sigset_t *sm); } +523 AUE_NULL UNIMPL getloginclass +524 AUE_NULL UNIMPL setloginclass +525 AUE_NULL UNIMPL rctl_get_racct +526 AUE_NULL UNIMPL rctl_get_rules +527 AUE_NULL UNIMPL rctl_get_limits +528 AUE_NULL UNIMPL rctl_add_rule +529 AUE_NULL UNIMPL rctl_remove_rule +530 AUE_NULL STD { int freebsd32_posix_fallocate(int fd,\ + uint32_t offset1, uint32_t offset2,\ + uint32_t len1, uint32_t len2); } +531 AUE_NULL UNIMPL posix_fadvise Modified: stable/8/sys/kern/syscalls.master ============================================================================== --- stable/8/sys/kern/syscalls.master Wed Nov 16 17:48:05 2011 (r227572) +++ stable/8/sys/kern/syscalls.master Wed Nov 16 18:33:17 2011 (r227573) @@ -927,5 +927,15 @@ fd_set *ou, fd_set *ex, \ const struct timespec *ts, \ const sigset_t *sm); } +523 AUE_NULL UNIMPL getloginclass +524 AUE_NULL UNIMPL setloginclass +525 AUE_NULL UNIMPL rctl_get_racct +526 AUE_NULL UNIMPL rctl_get_rules +527 AUE_NULL UNIMPL rctl_get_limits +528 AUE_NULL UNIMPL rctl_add_rule +529 AUE_NULL UNIMPL rctl_remove_rule +530 AUE_NULL STD { int posix_fallocate(int fd, \ + off_t offset, off_t len); } +531 AUE_NULL UNIMPL posix_fadvise ; Please copy any additions and changes to the following compatability tables: ; sys/compat/freebsd32/syscalls.master Modified: stable/8/sys/kern/vfs_default.c ============================================================================== --- stable/8/sys/kern/vfs_default.c Wed Nov 16 17:48:05 2011 (r227572) +++ stable/8/sys/kern/vfs_default.c Wed Nov 16 18:33:17 2011 (r227573) @@ -98,6 +98,7 @@ struct vop_vector default_vnodeops = { .vop_accessx = vop_stdaccessx, .vop_advlock = vop_stdadvlock, .vop_advlockasync = vop_stdadvlockasync, + .vop_allocate = vop_stdallocate, .vop_bmap = vop_stdbmap, .vop_close = VOP_NULL, .vop_fsync = VOP_NULL, @@ -844,6 +845,134 @@ out: return (error); } +int +vop_stdallocate(struct vop_allocate_args *ap) +{ +#ifdef __notyet__ + struct statfs sfs; +#endif + struct iovec aiov; + struct vattr vattr, *vap; + struct uio auio; + off_t fsize, len, cur, offset; + uint8_t *buf; + struct thread *td; + struct vnode *vp; + size_t iosize; + int error; + + buf = NULL; + error = 0; + td = curthread; + vap = &vattr; + vp = ap->a_vp; + len = *ap->a_len; + offset = *ap->a_offset; + + error = VOP_GETATTR(vp, vap, td->td_ucred); + if (error != 0) + goto out; + fsize = vap->va_size; + iosize = vap->va_blocksize; + if (iosize == 0) + iosize = BLKDEV_IOSIZE; + if (iosize > MAXPHYS) + iosize = MAXPHYS; + buf = malloc(iosize, M_TEMP, M_WAITOK); + +#ifdef __notyet__ + /* + * Check if the filesystem sets f_maxfilesize; if not use + * VOP_SETATTR to perform the check. + */ + error = VFS_STATFS(vp->v_mount, &sfs, td); + if (error != 0) + goto out; + if (sfs.f_maxfilesize) { + if (offset > sfs.f_maxfilesize || len > sfs.f_maxfilesize || + offset + len > sfs.f_maxfilesize) { + error = EFBIG; + goto out; + } + } else +#endif + if (offset + len > vap->va_size) { + /* + * Test offset + len against the filesystem's maxfilesize. + */ + VATTR_NULL(vap); + vap->va_size = offset + len; + error = VOP_SETATTR(vp, vap, td->td_ucred); + if (error != 0) + goto out; + VATTR_NULL(vap); + vap->va_size = fsize; + error = VOP_SETATTR(vp, vap, td->td_ucred); + if (error != 0) + goto out; + } + + for (;;) { + /* + * Read and write back anything below the nominal file + * size. There's currently no way outside the filesystem + * to know whether this area is sparse or not. + */ + cur = iosize; + if ((offset % iosize) != 0) + cur -= (offset % iosize); + if (cur > len) + cur = len; + if (offset < fsize) { + aiov.iov_base = buf; + aiov.iov_len = cur; + auio.uio_iov = &aiov; + auio.uio_iovcnt = 1; + auio.uio_offset = offset; + auio.uio_resid = cur; + auio.uio_segflg = UIO_SYSSPACE; + auio.uio_rw = UIO_READ; + auio.uio_td = td; + error = VOP_READ(vp, &auio, 0, td->td_ucred); + if (error != 0) + break; + if (auio.uio_resid > 0) { + bzero(buf + cur - auio.uio_resid, + auio.uio_resid); + } + } else { + bzero(buf, cur); + } + + aiov.iov_base = buf; + aiov.iov_len = cur; + auio.uio_iov = &aiov; + auio.uio_iovcnt = 1; + auio.uio_offset = offset; + auio.uio_resid = cur; + auio.uio_segflg = UIO_SYSSPACE; + auio.uio_rw = UIO_WRITE; + auio.uio_td = td; + + error = VOP_WRITE(vp, &auio, 0, td->td_ucred); + if (error != 0) + break; + + len -= cur; + offset += cur; + if (len == 0) + break; + if (should_yield()) + break; + } + + out: + *ap->a_len = len; + *ap->a_offset = offset; + free(buf, M_TEMP); + return (error); +} + /* * vfs default ops * used to fill the vfs function table to get reasonable default return values. Modified: stable/8/sys/kern/vfs_syscalls.c ============================================================================== --- stable/8/sys/kern/vfs_syscalls.c Wed Nov 16 17:48:05 2011 (r227572) +++ stable/8/sys/kern/vfs_syscalls.c Wed Nov 16 18:33:17 2011 (r227573) @@ -4654,3 +4654,98 @@ out: VFS_UNLOCK_GIANT(vfslocked); return (error); } + +static int +kern_posix_fallocate(struct thread *td, int fd, off_t offset, off_t len) +{ + struct file *fp; + struct mount *mp; + struct vnode *vp; + off_t olen, ooffset; + int error, vfslocked; + + fp = NULL; + vfslocked = 0; + error = fget(td, fd, &fp); + if (error != 0) + goto out; + + switch (fp->f_type) { + case DTYPE_VNODE: + break; + case DTYPE_PIPE: + case DTYPE_FIFO: + error = ESPIPE; + goto out; + default: + error = ENODEV; + goto out; + } + if ((fp->f_flag & FWRITE) == 0) { + error = EBADF; + goto out; + } + vp = fp->f_vnode; + if (vp->v_type != VREG) { + error = ENODEV; + goto out; + } + if (offset < 0 || len <= 0) { + error = EINVAL; + goto out; + } + /* Check for wrap. */ + if (offset > OFF_MAX - len) { + error = EFBIG; + goto out; + } + + /* Allocating blocks may take a long time, so iterate. */ + for (;;) { + olen = len; + ooffset = offset; + + bwillwrite(); + vfslocked = VFS_LOCK_GIANT(vp->v_mount); + mp = NULL; + error = vn_start_write(vp, &mp, V_WAIT | PCATCH); + if (error != 0) { + VFS_UNLOCK_GIANT(vfslocked); + break; + } + error = vn_lock(vp, LK_EXCLUSIVE); + if (error != 0) { + vn_finished_write(mp); + VFS_UNLOCK_GIANT(vfslocked); + break; + } +#ifdef MAC + error = mac_vnode_check_write(td->td_ucred, fp->f_cred, vp); + if (error == 0) +#endif + error = VOP_ALLOCATE(vp, &offset, &len); + VOP_UNLOCK(vp, 0); + vn_finished_write(mp); + VFS_UNLOCK_GIANT(vfslocked); + + if (olen + ooffset != offset + len) { + panic("offset + len changed from %jx/%jx to %jx/%jx", + ooffset, olen, offset, len); + } + if (error != 0 || len == 0) + break; + KASSERT(olen > len, ("Iteration did not make progress?")); + maybe_yield(); + } + out: + if (fp != NULL) + fdrop(fp, td); + return (error); +} + +int +posix_fallocate(struct thread *td, struct posix_fallocate_args *uap) +{ + + return (kern_posix_fallocate(td, uap->fd, uap->offset, uap->len)); +} Modified: stable/8/sys/kern/vnode_if.src ============================================================================== --- stable/8/sys/kern/vnode_if.src Wed Nov 16 17:48:05 2011 (r227572) +++ stable/8/sys/kern/vnode_if.src Wed Nov 16 18:33:17 2011 (r227573) @@ -601,6 +601,7 @@ vop_vptofh { IN struct fid *fhp; }; + %% vptocnp vp L L L %% vptocnp vpp - U - @@ -611,3 +612,12 @@ vop_vptocnp { INOUT char *buf; INOUT int *buflen; }; + + +%% allocate vp E E E + +vop_allocate { + IN struct vnode *vp; + INOUT off_t *offset; + INOUT off_t *len; +}; Modified: stable/8/sys/sys/fcntl.h ============================================================================== --- stable/8/sys/sys/fcntl.h Wed Nov 16 17:48:05 2011 (r227572) +++ stable/8/sys/sys/fcntl.h Wed Nov 16 18:33:17 2011 (r227573) @@ -278,7 +278,7 @@ struct oflock { #endif /* - * XXX missing posix_fadvise() and posix_fallocate(), and POSIX_FADV_* macros. + * XXX missing posix_fadvise() and POSIX_FADV_* macros. */ #ifndef _KERNEL @@ -289,6 +289,9 @@ int fcntl(int, int, ...); #if __BSD_VISIBLE || __POSIX_VISIBLE >= 200809 int openat(int, const char *, int, ...); #endif +#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200112 +int posix_fallocate(int, off_t, off_t); +#endif #if __BSD_VISIBLE int flock(int, int); #endif Modified: stable/8/sys/sys/param.h ============================================================================== --- stable/8/sys/sys/param.h Wed Nov 16 17:48:05 2011 (r227572) +++ stable/8/sys/sys/param.h Wed Nov 16 18:33:17 2011 (r227573) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 802513 /* Master, propagated to newvers */ +#define __FreeBSD_version 802514 /* Master, propagated to newvers */ #ifdef _KERNEL #define P_OSREL_SIGWAIT 700000 Modified: stable/8/sys/sys/vnode.h ============================================================================== --- stable/8/sys/sys/vnode.h Wed Nov 16 17:48:05 2011 (r227572) +++ stable/8/sys/sys/vnode.h Wed Nov 16 18:33:17 2011 (r227573) @@ -688,6 +688,7 @@ int vop_stdaccess(struct vop_access_args int vop_stdaccessx(struct vop_accessx_args *ap); int vop_stdadvlock(struct vop_advlock_args *ap); int vop_stdadvlockasync(struct vop_advlockasync_args *ap); +int vop_stdallocate(struct vop_allocate_args *ap); int vop_stdpathconf(struct vop_pathconf_args *); int vop_stdpoll(struct vop_poll_args *); int vop_stdvptocnp(struct vop_vptocnp_args *ap); From owner-svn-src-all@FreeBSD.ORG Wed Nov 16 18:36:28 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E5AF106564A; Wed, 16 Nov 2011 18:36:28 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5C0B68FC08; Wed, 16 Nov 2011 18:36:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAGIaSxp061495; Wed, 16 Nov 2011 18:36:28 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAGIaSY6061483; Wed, 16 Nov 2011 18:36:28 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201111161836.pAGIaSY6061483@svn.freebsd.org> From: John Baldwin Date: Wed, 16 Nov 2011 18:36:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227575 - in stable/8/sys: compat/freebsd32 kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2011 18:36:28 -0000 Author: jhb Date: Wed Nov 16 18:36:27 2011 New Revision: 227575 URL: http://svn.freebsd.org/changeset/base/227575 Log: Regen. Modified: stable/8/sys/compat/freebsd32/freebsd32_proto.h stable/8/sys/compat/freebsd32/freebsd32_syscall.h stable/8/sys/compat/freebsd32/freebsd32_syscalls.c stable/8/sys/compat/freebsd32/freebsd32_sysent.c stable/8/sys/compat/freebsd32/freebsd32_systrace_args.c stable/8/sys/kern/init_sysent.c stable/8/sys/kern/syscalls.c stable/8/sys/kern/systrace_args.c stable/8/sys/sys/syscall.h stable/8/sys/sys/syscall.mk stable/8/sys/sys/sysproto.h Modified: stable/8/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- stable/8/sys/compat/freebsd32/freebsd32_proto.h Wed Nov 16 18:34:06 2011 (r227574) +++ stable/8/sys/compat/freebsd32/freebsd32_proto.h Wed Nov 16 18:36:27 2011 (r227575) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 220378 2011-04-06 11:12:05Z kib + * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 227573 2011-11-16 18:33:17Z jhb */ #ifndef _FREEBSD32_SYSPROTO_H_ @@ -568,6 +568,13 @@ struct freebsd32_pselect_args { char ts_l_[PADL_(const struct timespec32 *)]; const struct timespec32 * ts; char ts_r_[PADR_(const struct timespec32 *)]; char sm_l_[PADL_(const sigset_t *)]; const sigset_t * sm; char sm_r_[PADR_(const sigset_t *)]; }; +struct freebsd32_posix_fallocate_args { + char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; + char offset1_l_[PADL_(uint32_t)]; uint32_t offset1; char offset1_r_[PADR_(uint32_t)]; + char offset2_l_[PADL_(uint32_t)]; uint32_t offset2; char offset2_r_[PADR_(uint32_t)]; + char len1_l_[PADL_(uint32_t)]; uint32_t len1; char len1_r_[PADR_(uint32_t)]; + char len2_l_[PADL_(uint32_t)]; uint32_t len2; char len2_r_[PADR_(uint32_t)]; +}; #if !defined(PAD64_REQUIRED) && defined(__powerpc__) #define PAD64_REQUIRED #endif @@ -676,6 +683,7 @@ int freebsd32_semctl(struct thread *, st int freebsd32_msgctl(struct thread *, struct freebsd32_msgctl_args *); int freebsd32_shmctl(struct thread *, struct freebsd32_shmctl_args *); int freebsd32_pselect(struct thread *, struct freebsd32_pselect_args *); +int freebsd32_posix_fallocate(struct thread *, struct freebsd32_posix_fallocate_args *); #ifdef COMPAT_43 @@ -1006,6 +1014,7 @@ int freebsd7_freebsd32_shmctl(struct thr #define FREEBSD32_SYS_AUE_freebsd32_msgctl AUE_MSGCTL #define FREEBSD32_SYS_AUE_freebsd32_shmctl AUE_SHMCTL #define FREEBSD32_SYS_AUE_freebsd32_pselect AUE_SELECT +#define FREEBSD32_SYS_AUE_freebsd32_posix_fallocate AUE_NULL #undef PAD_ #undef PADL_ Modified: stable/8/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- stable/8/sys/compat/freebsd32/freebsd32_syscall.h Wed Nov 16 18:34:06 2011 (r227574) +++ stable/8/sys/compat/freebsd32/freebsd32_syscall.h Wed Nov 16 18:36:27 2011 (r227575) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 220378 2011-04-06 11:12:05Z kib + * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 227573 2011-11-16 18:33:17Z jhb */ #define FREEBSD32_SYS_syscall 0 @@ -410,4 +410,5 @@ #define FREEBSD32_SYS_freebsd32_shmctl 512 #define FREEBSD32_SYS_lpathconf 513 #define FREEBSD32_SYS_freebsd32_pselect 522 -#define FREEBSD32_SYS_MAXSYSCALL 523 +#define FREEBSD32_SYS_freebsd32_posix_fallocate 530 +#define FREEBSD32_SYS_MAXSYSCALL 532 Modified: stable/8/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- stable/8/sys/compat/freebsd32/freebsd32_syscalls.c Wed Nov 16 18:34:06 2011 (r227574) +++ stable/8/sys/compat/freebsd32/freebsd32_syscalls.c Wed Nov 16 18:36:27 2011 (r227575) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 220378 2011-04-06 11:12:05Z kib + * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 227573 2011-11-16 18:33:17Z jhb */ const char *freebsd32_syscallnames[] = { @@ -546,4 +546,13 @@ const char *freebsd32_syscallnames[] = { "#520", /* 520 = pdgetpid */ "#521", /* 521 = pdwait */ "freebsd32_pselect", /* 522 = freebsd32_pselect */ + "#523", /* 523 = getloginclass */ + "#524", /* 524 = setloginclass */ + "#525", /* 525 = rctl_get_racct */ + "#526", /* 526 = rctl_get_rules */ + "#527", /* 527 = rctl_get_limits */ + "#528", /* 528 = rctl_add_rule */ + "#529", /* 529 = rctl_remove_rule */ + "freebsd32_posix_fallocate", /* 530 = freebsd32_posix_fallocate */ + "#531", /* 531 = posix_fadvise */ }; Modified: stable/8/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- stable/8/sys/compat/freebsd32/freebsd32_sysent.c Wed Nov 16 18:34:06 2011 (r227574) +++ stable/8/sys/compat/freebsd32/freebsd32_sysent.c Wed Nov 16 18:36:27 2011 (r227575) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 220378 2011-04-06 11:12:05Z kib + * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 227573 2011-11-16 18:33:17Z jhb */ #include "opt_compat.h" @@ -583,4 +583,13 @@ struct sysent freebsd32_sysent[] = { { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 520 = pdgetpid */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 521 = pdwait */ { AS(freebsd32_pselect_args), (sy_call_t *)freebsd32_pselect, AUE_SELECT, NULL, 0, 0, 0 }, /* 522 = freebsd32_pselect */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 523 = getloginclass */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 524 = setloginclass */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 525 = rctl_get_racct */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 526 = rctl_get_rules */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 527 = rctl_get_limits */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 528 = rctl_add_rule */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 529 = rctl_remove_rule */ + { AS(freebsd32_posix_fallocate_args), (sy_call_t *)freebsd32_posix_fallocate, AUE_NULL, NULL, 0, 0, 0 }, /* 530 = freebsd32_posix_fallocate */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 531 = posix_fadvise */ }; Modified: stable/8/sys/compat/freebsd32/freebsd32_systrace_args.c ============================================================================== --- stable/8/sys/compat/freebsd32/freebsd32_systrace_args.c Wed Nov 16 18:34:06 2011 (r227574) +++ stable/8/sys/compat/freebsd32/freebsd32_systrace_args.c Wed Nov 16 18:36:27 2011 (r227575) @@ -2930,6 +2930,17 @@ systrace_args(int sysnum, void *params, *n_args = 6; break; } + /* freebsd32_posix_fallocate */ + case 530: { + struct freebsd32_posix_fallocate_args *p = params; + iarg[0] = p->fd; /* int */ + uarg[1] = p->offset1; /* uint32_t */ + uarg[2] = p->offset2; /* uint32_t */ + uarg[3] = p->len1; /* uint32_t */ + uarg[4] = p->len2; /* uint32_t */ + *n_args = 5; + break; + } default: *n_args = 0; break; @@ -7810,6 +7821,28 @@ systrace_setargdesc(int sysnum, int ndx, break; }; break; + /* freebsd32_posix_fallocate */ + case 530: + switch(ndx) { + case 0: + p = "int"; + break; + case 1: + p = "uint32_t"; + break; + case 2: + p = "uint32_t"; + break; + case 3: + p = "uint32_t"; + break; + case 4: + p = "uint32_t"; + break; + default: + break; + }; + break; default: break; }; Modified: stable/8/sys/kern/init_sysent.c ============================================================================== --- stable/8/sys/kern/init_sysent.c Wed Nov 16 18:34:06 2011 (r227574) +++ stable/8/sys/kern/init_sysent.c Wed Nov 16 18:36:27 2011 (r227575) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/8/sys/kern/syscalls.master 212545 2010-09-13 08:49:08Z kib + * created from FreeBSD: stable/8/sys/kern/syscalls.master 227573 2011-11-16 18:33:17Z jhb */ #include "opt_compat.h" @@ -557,4 +557,13 @@ struct sysent sysent[] = { { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 520 = pdgetpid */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 521 = pdwait */ { AS(pselect_args), (sy_call_t *)pselect, AUE_SELECT, NULL, 0, 0, 0 }, /* 522 = pselect */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 523 = getloginclass */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 524 = setloginclass */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 525 = rctl_get_racct */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 526 = rctl_get_rules */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 527 = rctl_get_limits */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 528 = rctl_add_rule */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 529 = rctl_remove_rule */ + { AS(posix_fallocate_args), (sy_call_t *)posix_fallocate, AUE_NULL, NULL, 0, 0, 0 }, /* 530 = posix_fallocate */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 531 = posix_fadvise */ }; Modified: stable/8/sys/kern/syscalls.c ============================================================================== --- stable/8/sys/kern/syscalls.c Wed Nov 16 18:34:06 2011 (r227574) +++ stable/8/sys/kern/syscalls.c Wed Nov 16 18:36:27 2011 (r227575) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/8/sys/kern/syscalls.master 212545 2010-09-13 08:49:08Z kib + * created from FreeBSD: stable/8/sys/kern/syscalls.master 227573 2011-11-16 18:33:17Z jhb */ const char *syscallnames[] = { @@ -530,4 +530,13 @@ const char *syscallnames[] = { "#520", /* 520 = pdgetpid */ "#521", /* 521 = pdwait */ "pselect", /* 522 = pselect */ + "#523", /* 523 = getloginclass */ + "#524", /* 524 = setloginclass */ + "#525", /* 525 = rctl_get_racct */ + "#526", /* 526 = rctl_get_rules */ + "#527", /* 527 = rctl_get_limits */ + "#528", /* 528 = rctl_add_rule */ + "#529", /* 529 = rctl_remove_rule */ + "posix_fallocate", /* 530 = posix_fallocate */ + "#531", /* 531 = posix_fadvise */ }; Modified: stable/8/sys/kern/systrace_args.c ============================================================================== --- stable/8/sys/kern/systrace_args.c Wed Nov 16 18:34:06 2011 (r227574) +++ stable/8/sys/kern/systrace_args.c Wed Nov 16 18:36:27 2011 (r227575) @@ -3108,6 +3108,15 @@ systrace_args(int sysnum, void *params, *n_args = 6; break; } + /* posix_fallocate */ + case 530: { + struct posix_fallocate_args *p = params; + iarg[0] = p->fd; /* int */ + iarg[1] = p->offset; /* off_t */ + iarg[2] = p->len; /* off_t */ + *n_args = 3; + break; + } default: *n_args = 0; break; @@ -8265,6 +8274,22 @@ systrace_setargdesc(int sysnum, int ndx, break; }; break; + /* posix_fallocate */ + case 530: + switch(ndx) { + case 0: + p = "int"; + break; + case 1: + p = "off_t"; + break; + case 2: + p = "off_t"; + break; + default: + break; + }; + break; default: break; }; Modified: stable/8/sys/sys/syscall.h ============================================================================== --- stable/8/sys/sys/syscall.h Wed Nov 16 18:34:06 2011 (r227574) +++ stable/8/sys/sys/syscall.h Wed Nov 16 18:36:27 2011 (r227575) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/8/sys/kern/syscalls.master 212545 2010-09-13 08:49:08Z kib + * created from FreeBSD: stable/8/sys/kern/syscalls.master 227573 2011-11-16 18:33:17Z jhb */ #define SYS_syscall 0 @@ -431,4 +431,5 @@ #define SYS_shmctl 512 #define SYS_lpathconf 513 #define SYS_pselect 522 -#define SYS_MAXSYSCALL 523 +#define SYS_posix_fallocate 530 +#define SYS_MAXSYSCALL 532 Modified: stable/8/sys/sys/syscall.mk ============================================================================== --- stable/8/sys/sys/syscall.mk Wed Nov 16 18:34:06 2011 (r227574) +++ stable/8/sys/sys/syscall.mk Wed Nov 16 18:36:27 2011 (r227575) @@ -1,7 +1,7 @@ # FreeBSD system call names. # DO NOT EDIT-- this file is automatically generated. # $FreeBSD$ -# created from FreeBSD: stable/8/sys/kern/syscalls.master 212545 2010-09-13 08:49:08Z kib +# created from FreeBSD: stable/8/sys/kern/syscalls.master 227573 2011-11-16 18:33:17Z jhb MIASM = \ syscall.o \ exit.o \ @@ -379,4 +379,5 @@ MIASM = \ msgctl.o \ shmctl.o \ lpathconf.o \ - pselect.o + pselect.o \ + posix_fallocate.o Modified: stable/8/sys/sys/sysproto.h ============================================================================== --- stable/8/sys/sys/sysproto.h Wed Nov 16 18:34:06 2011 (r227574) +++ stable/8/sys/sys/sysproto.h Wed Nov 16 18:36:27 2011 (r227575) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/8/sys/kern/syscalls.master 212545 2010-09-13 08:49:08Z kib + * created from FreeBSD: stable/8/sys/kern/syscalls.master 227573 2011-11-16 18:33:17Z jhb */ #ifndef _SYS_SYSPROTO_H_ @@ -1665,6 +1665,11 @@ struct pselect_args { char ts_l_[PADL_(const struct timespec *)]; const struct timespec * ts; char ts_r_[PADR_(const struct timespec *)]; char sm_l_[PADL_(const sigset_t *)]; const sigset_t * sm; char sm_r_[PADR_(const sigset_t *)]; }; +struct posix_fallocate_args { + char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; + char offset_l_[PADL_(off_t)]; off_t offset; char offset_r_[PADR_(off_t)]; + char len_l_[PADL_(off_t)]; off_t len; char len_r_[PADR_(off_t)]; +}; int nosys(struct thread *, struct nosys_args *); void sys_exit(struct thread *, struct sys_exit_args *); int fork(struct thread *, struct fork_args *); @@ -2026,6 +2031,7 @@ int msgctl(struct thread *, struct msgct int shmctl(struct thread *, struct shmctl_args *); int lpathconf(struct thread *, struct lpathconf_args *); int pselect(struct thread *, struct pselect_args *); +int posix_fallocate(struct thread *, struct posix_fallocate_args *); #ifdef COMPAT_43 @@ -2701,6 +2707,7 @@ int freebsd7_shmctl(struct thread *, str #define SYS_AUE_shmctl AUE_SHMCTL #define SYS_AUE_lpathconf AUE_LPATHCONF #define SYS_AUE_pselect AUE_SELECT +#define SYS_AUE_posix_fallocate AUE_NULL #undef PAD_ #undef PADL_ From owner-svn-src-all@FreeBSD.ORG Wed Nov 16 18:41:59 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E8C95106564A; Wed, 16 Nov 2011 18:41:59 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D8F6A8FC1F; Wed, 16 Nov 2011 18:41:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAGIfx7r061697; Wed, 16 Nov 2011 18:41:59 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAGIfxKh061695; Wed, 16 Nov 2011 18:41:59 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201111161841.pAGIfxKh061695@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 16 Nov 2011 18:41:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227576 - head/sys/fs/pseudofs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2011 18:42:00 -0000 Author: kib Date: Wed Nov 16 18:41:59 2011 New Revision: 227576 URL: http://svn.freebsd.org/changeset/base/227576 Log: Fix build, use %d for int value formatting. Modified: head/sys/fs/pseudofs/pseudofs_vnops.c Modified: head/sys/fs/pseudofs/pseudofs_vnops.c ============================================================================== --- head/sys/fs/pseudofs/pseudofs_vnops.c Wed Nov 16 18:36:27 2011 (r227575) +++ head/sys/fs/pseudofs/pseudofs_vnops.c Wed Nov 16 18:41:59 2011 (r227576) @@ -834,7 +834,7 @@ pfs_readdir(struct vop_readdir_args *va) free(pfsent, M_IOV); i++; } - PFS_TRACE(("%zd bytes", i * PFS_DELEN)); + PFS_TRACE(("%d bytes", i * PFS_DELEN)); PFS_RETURN (error); } From owner-svn-src-all@FreeBSD.ORG Wed Nov 16 18:42:40 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 364161065688; Wed, 16 Nov 2011 18:42:40 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 26A338FC1B; Wed, 16 Nov 2011 18:42:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAGIge1l061757; Wed, 16 Nov 2011 18:42:40 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAGIgeEF061755; Wed, 16 Nov 2011 18:42:40 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201111161842.pAGIgeEF061755@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 16 Nov 2011 18:42:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227577 - head/sys/dev/mfi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2011 18:42:40 -0000 Author: kib Date: Wed Nov 16 18:42:39 2011 New Revision: 227577 URL: http://svn.freebsd.org/changeset/base/227577 Log: The sys/sysctl.h header is needed when MFI_DEBUG is defined. Nod from: jhb Modified: head/sys/dev/mfi/mfi_debug.c Modified: head/sys/dev/mfi/mfi_debug.c ============================================================================== --- head/sys/dev/mfi/mfi_debug.c Wed Nov 16 18:41:59 2011 (r227576) +++ head/sys/dev/mfi/mfi_debug.c Wed Nov 16 18:42:39 2011 (r227577) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include From owner-svn-src-all@FreeBSD.ORG Wed Nov 16 18:42:44 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B6FD106567A; Wed, 16 Nov 2011 18:42:44 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0BAC18FC23; Wed, 16 Nov 2011 18:42:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAGIghkq061793; Wed, 16 Nov 2011 18:42:43 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAGIghxW061791; Wed, 16 Nov 2011 18:42:43 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201111161842.pAGIghxW061791@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 16 Nov 2011 18:42:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227578 - head/sys/sparc64/sbus X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2011 18:42:44 -0000 Author: pjd Date: Wed Nov 16 18:42:43 2011 New Revision: 227578 URL: http://svn.freebsd.org/changeset/base/227578 Log: Fix make universe. Modified: head/sys/sparc64/sbus/lsi64854.c Modified: head/sys/sparc64/sbus/lsi64854.c ============================================================================== --- head/sys/sparc64/sbus/lsi64854.c Wed Nov 16 18:42:39 2011 (r227577) +++ head/sys/sparc64/sbus/lsi64854.c Wed Nov 16 18:42:43 2011 (r227578) @@ -561,7 +561,7 @@ lsi64854_scsi_intr(void *arg) DPRINTF(LDB_SCSI, ("%s: tcl=%d, tcm=%d, tch=%d; trans=%d, resid=%d\n", __func__, NCR_READ_REG(nsc, NCR_TCL), NCR_READ_REG(nsc, NCR_TCM), - (nsc->sc_sc_features & NCR_F_LARGEXFER) != 0 ? + (nsc->sc_features & NCR_F_LARGEXFER) != 0 ? NCR_READ_REG(nsc, NCR_TCH) : 0, trans, resid)); if (dmasize != 0) { From owner-svn-src-all@FreeBSD.ORG Wed Nov 16 18:45:07 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 856BC106567C; Wed, 16 Nov 2011 18:45:07 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 2C6608FC0A; Wed, 16 Nov 2011 18:45:05 +0000 (UTC) Received: by faap15 with SMTP id p15so525673faa.13 for ; Wed, 16 Nov 2011 10:45:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=XWemkCYozUb6AH09UGIpLfAS8NVMlHGJM/CQnvpMkvk=; b=qbBaItEfd7q9eJC1ohUBLtHk+X0lxAxjh1Jdwjy+zeV6ljdicrCFuZ9dkMiGsAktjI ExJ9aCjKC2FC7uvD3E0FiOHja2LwWEk4L2RKs5rWS+lLxx3zPJzG70H5oaSmRjkD4bnG HhjNB9idnMD3UvrDUc1jwdG7gv+Ek0i8Tusoc= MIME-Version: 1.0 Received: by 10.182.50.65 with SMTP id a1mr3822833obo.17.1321469104669; Wed, 16 Nov 2011 10:45:04 -0800 (PST) Received: by 10.182.7.34 with HTTP; Wed, 16 Nov 2011 10:45:04 -0800 (PST) In-Reply-To: <201111161842.pAGIgeEF061755@svn.freebsd.org> References: <201111161842.pAGIgeEF061755@svn.freebsd.org> Date: Wed, 16 Nov 2011 10:45:04 -0800 Message-ID: From: Garrett Cooper To: Konstantin Belousov Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r227577 - head/sys/dev/mfi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2011 18:45:07 -0000 On Wed, Nov 16, 2011 at 10:42 AM, Konstantin Belousov wro= te: > Author: kib > Date: Wed Nov 16 18:42:39 2011 > New Revision: 227577 > URL: http://svn.freebsd.org/changeset/base/227577 > > Log: > =A0The sys/sysctl.h header is needed when MFI_DEBUG is defined. Oh sweet... it's working now :D?! -Garrett From owner-svn-src-all@FreeBSD.ORG Wed Nov 16 15:17:32 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C957E106566B; Wed, 16 Nov 2011 15:17:32 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from agogare.doit.wisc.edu (agogare.doit.wisc.edu [144.92.197.211]) by mx1.freebsd.org (Postfix) with ESMTP id 992A18FC12; Wed, 16 Nov 2011 15:17:32 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII; format=flowed Received: from avs-daemon.smtpauth2.wiscmail.wisc.edu by smtpauth2.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) id <0LUR00H00EH79400@smtpauth2.wiscmail.wisc.edu>; Wed, 16 Nov 2011 09:17:32 -0600 (CST) Received: from anacreon.physics.wisc.edu (anacreon.physics.wisc.edu [128.104.160.176]) by smtpauth2.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) with ESMTPSA id <0LUR00749EH6RK20@smtpauth2.wiscmail.wisc.edu>; Wed, 16 Nov 2011 09:17:31 -0600 (CST) Date: Wed, 16 Nov 2011 09:17:30 -0600 From: Nathan Whitehorn In-reply-to: <20111116.232828.343708041526200614.nyan@FreeBSD.org> To: TAKAHASHI Yoshihiro Message-id: <4EC3D40A.5040204@freebsd.org> X-Spam-Report: AuthenticatedSender=yes, SenderIP=128.104.160.176 X-Spam-PmxInfo: Server=avs-10, Version=5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2011.11.16.150314, SenderIP=128.104.160.176 References: <201111151849.pAFInR3K012609@svn.freebsd.org> <20111116.232828.343708041526200614.nyan@FreeBSD.org> User-Agent: Mozilla/5.0 (X11; U; FreeBSD powerpc; en-US; rv:1.9.2.22) Gecko/20110913 Thunderbird/3.1.14 X-Mailman-Approved-At: Wed, 16 Nov 2011 19:06:28 +0000 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r227536 - in head: release share/man/man7 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2011 15:17:32 -0000 On 11/16/11 08:28, TAKAHASHI Yoshihiro wrote: > In article<201111151849.pAFInR3K012609@svn.freebsd.org> > Nathan Whitehorn writes: > >> Log: >> Further automate production release generation by naming files the right >> things and generating checksums. >> >> Modified: head/release/generate-release.sh >> ============================================================================== >> --- head/release/generate-release.sh Tue Nov 15 17:53:29 2011 (r227535) >> +++ head/release/generate-release.sh Tue Nov 15 18:49:27 2011 (r227536) >> @@ -65,3 +66,12 @@ chroot $2 make -C /usr/src $MAKE_FLAGS b >> chroot $2 make -C /usr/src/release release >> chroot $2 make -C /usr/src/release install DESTDIR=/R >> >> +: ${RELSTRING=`chroot $2 uname -s`-`chroot $2 uname -r`-`chroot $2 uname -p`} > Should this be 'uname -m' rather than 'uname -p'? There isn't a good option here when there is only one tag -- most of the time, I imagine this will get specified in the builder's environment. I picked uname -p because there are more possibilities than uname -m: it breaks the degeneracies for PPC, ARM, and MIPS, leaving only one for i386/pc98. uname -m would have been the other way around. -Nathan From owner-svn-src-all@FreeBSD.ORG Wed Nov 16 19:06:56 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 193F5106568C; Wed, 16 Nov 2011 19:06:56 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F38238FC15; Wed, 16 Nov 2011 19:06:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAGJ6tHq062759; Wed, 16 Nov 2011 19:06:55 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAGJ6tGE062755; Wed, 16 Nov 2011 19:06:55 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201111161906.pAGJ6tGE062755@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 16 Nov 2011 19:06:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227581 - in head: share/man/man9 sys/kern sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2011 19:06:56 -0000 Author: pjd Date: Wed Nov 16 19:06:55 2011 New Revision: 227581 URL: http://svn.freebsd.org/changeset/base/227581 Log: Constify stack argument for functions that don't modify it. Reviewed by: ed, kib, jhb Modified: head/share/man/man9/stack.9 head/sys/kern/subr_stack.c head/sys/sys/stack.h Modified: head/share/man/man9/stack.9 ============================================================================== --- head/share/man/man9/stack.9 Wed Nov 16 18:53:52 2011 (r227580) +++ head/share/man/man9/stack.9 Wed Nov 16 19:06:55 2011 (r227581) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 24, 2009 +.Dd November 16, 2011 .Dt STACK 9 .Os .Sh NAME @@ -46,21 +46,21 @@ In the kernel configuration file: .Ft int .Fn stack_put "struct stack *st" "vm_offset_t pc" .Ft void -.Fn stack_copy "struct stack *src" "struct stack dst" +.Fn stack_copy "const struct stack *src" "struct stack dst" .Ft void .Fn stack_zero "struct stack *st" .Ft void -.Fn stack_print "struct stack *st" +.Fn stack_print "const struct stack *st" .Ft void -.Fn stack_print_ddb "struct stack *st" +.Fn stack_print_ddb "const struct stack *st" .Ft void -.Fn stack_print_short "struct stack *st" +.Fn stack_print_short "const struct stack *st" .Ft void -.Fn stack_print_short_ddb "struct stack *st" +.Fn stack_print_short_ddb "const struct stack *st" .Ft void -.Fn stack_sbuf_print "struct sbuf sb*" "struct stack *st" +.Fn stack_sbuf_print "struct sbuf sb*" "const struct stack *st" .Ft void -.Fn stack_sbuf_print_ddb "struct sbuf sb*" "struct stack *st" +.Fn stack_sbuf_print_ddb "struct sbuf sb*" "const struct stack *st" .Ft void .Fn stack_save "struct stack *st" .Sh DESCRIPTION Modified: head/sys/kern/subr_stack.c ============================================================================== --- head/sys/kern/subr_stack.c Wed Nov 16 18:53:52 2011 (r227580) +++ head/sys/kern/subr_stack.c Wed Nov 16 19:06:55 2011 (r227581) @@ -77,7 +77,7 @@ stack_put(struct stack *st, vm_offset_t } void -stack_copy(struct stack *src, struct stack *dst) +stack_copy(const struct stack *src, struct stack *dst) { *dst = *src; @@ -91,7 +91,7 @@ stack_zero(struct stack *st) } void -stack_print(struct stack *st) +stack_print(const struct stack *st) { char namebuf[64]; long offset; @@ -107,7 +107,7 @@ stack_print(struct stack *st) } void -stack_print_short(struct stack *st) +stack_print_short(const struct stack *st) { char namebuf[64]; long offset; @@ -127,7 +127,7 @@ stack_print_short(struct stack *st) } void -stack_print_ddb(struct stack *st) +stack_print_ddb(const struct stack *st) { const char *name; long offset; @@ -143,7 +143,7 @@ stack_print_ddb(struct stack *st) #ifdef DDB void -stack_print_short_ddb(struct stack *st) +stack_print_short_ddb(const struct stack *st) { const char *name; long offset; @@ -167,7 +167,7 @@ stack_print_short_ddb(struct stack *st) * other for use in the live kernel. */ void -stack_sbuf_print(struct sbuf *sb, struct stack *st) +stack_sbuf_print(struct sbuf *sb, const struct stack *st) { char namebuf[64]; long offset; @@ -184,7 +184,7 @@ stack_sbuf_print(struct sbuf *sb, struct #ifdef DDB void -stack_sbuf_print_ddb(struct sbuf *sb, struct stack *st) +stack_sbuf_print_ddb(struct sbuf *sb, const struct stack *st) { const char *name; long offset; @@ -201,8 +201,8 @@ stack_sbuf_print_ddb(struct sbuf *sb, st #ifdef KTR void -stack_ktr(u_int mask, const char *file, int line, struct stack *st, u_int depth, - int cheap) +stack_ktr(u_int mask, const char *file, int line, const struct stack *st, + u_int depth, int cheap) { #ifdef DDB const char *name; Modified: head/sys/sys/stack.h ============================================================================== --- head/sys/sys/stack.h Wed Nov 16 18:53:52 2011 (r227580) +++ head/sys/sys/stack.h Wed Nov 16 19:06:55 2011 (r227581) @@ -37,16 +37,17 @@ struct sbuf; struct stack *stack_create(void); void stack_destroy(struct stack *); int stack_put(struct stack *, vm_offset_t); -void stack_copy(struct stack *, struct stack *); +void stack_copy(const struct stack *, struct stack *); void stack_zero(struct stack *); -void stack_print(struct stack *); -void stack_print_ddb(struct stack *); -void stack_print_short(struct stack *); -void stack_print_short_ddb(struct stack *); -void stack_sbuf_print(struct sbuf *, struct stack *); -void stack_sbuf_print_ddb(struct sbuf *, struct stack *); +void stack_print(const struct stack *); +void stack_print_ddb(const struct stack *); +void stack_print_short(const struct stack *); +void stack_print_short_ddb(const struct stack *); +void stack_sbuf_print(struct sbuf *, const struct stack *); +void stack_sbuf_print_ddb(struct sbuf *, const struct stack *); #ifdef KTR -void stack_ktr(u_int, const char *, int, struct stack *, u_int, int); +void stack_ktr(u_int, const char *, int, const struct stack *, + u_int, int); #define CTRSTACK(m, st, depth, cheap) do { \ if (KTR_COMPILE & (m)) \ stack_ktr((m), __FILE__, __LINE__, st, depth, cheap); \ From owner-svn-src-all@FreeBSD.ORG Wed Nov 16 19:25:26 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D56210656D4; Wed, 16 Nov 2011 19:25:26 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7BF948FC14; Wed, 16 Nov 2011 19:25:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAGJPQbi063349; Wed, 16 Nov 2011 19:25:26 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAGJPQY1063346; Wed, 16 Nov 2011 19:25:26 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201111161925.pAGJPQY1063346@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 16 Nov 2011 19:25:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227582 - head/sys/dev/msk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2011 19:25:26 -0000 Author: yongari Date: Wed Nov 16 19:25:26 2011 New Revision: 227582 URL: http://svn.freebsd.org/changeset/base/227582 Log: Enable 64bit DMA addressing support for all msk(4) controllers. Unnecessarily complex LE format used on Marvell controller was main reason not to enable 64bit DMA addressing in driver. If high 32bit address of DMA address of TX/RX buffer is changed, driver has to generate a new LE. In TX path, driver will keep track of lastly used high 32bit address of DMA address and generate a new LE whenever it sees high address change in the DMA address. In RX path, driver will always use two LEs to specify 64bit DMA address of RX buffer. If the high 32bit address of DMA address of RX buffer is the same as previous DMA address of RX buffer, driver does not have to use two LEs but driver will use two LEs for simplicity in RX ring management. One of draw back for switching to 64bit DMA addressing is that the large amount of LEs are used to specify 64bit DMA address such that number of available LEs for TX/RX buffers are considerably reduced. To mitigate the issue, increase number of available LEs from 256 to 384 for TX and from 256 to 512 for RX. For 32bit architectures, msk(4) does not use 64bit DMA addressing to save resources. Tested by: das Modified: head/sys/dev/msk/if_msk.c head/sys/dev/msk/if_mskreg.h Modified: head/sys/dev/msk/if_msk.c ============================================================================== --- head/sys/dev/msk/if_msk.c Wed Nov 16 19:06:55 2011 (r227581) +++ head/sys/dev/msk/if_msk.c Wed Nov 16 19:25:26 2011 (r227582) @@ -700,7 +700,7 @@ msk_init_rx_ring(struct msk_if_softc *sc { struct msk_ring_data *rd; struct msk_rxdesc *rxd; - int i, prod; + int i, nbuf, prod; MSK_IF_LOCK_ASSERT(sc_if); @@ -710,11 +710,18 @@ msk_init_rx_ring(struct msk_if_softc *sc rd = &sc_if->msk_rdata; bzero(rd->msk_rx_ring, sizeof(struct msk_rx_desc) * MSK_RX_RING_CNT); - prod = sc_if->msk_cdata.msk_rx_prod; - i = 0; + for (i = prod = 0; i < MSK_RX_RING_CNT; i++) { + rxd = &sc_if->msk_cdata.msk_rxdesc[prod]; + rxd->rx_m = NULL; + rxd->rx_le = &rd->msk_rx_ring[prod]; + MSK_INC(prod, MSK_RX_RING_CNT); + } + nbuf = MSK_RX_BUF_CNT; + prod = 0; /* Have controller know how to compute Rx checksum. */ if ((sc_if->msk_flags & MSK_FLAG_DESCV2) == 0 && (sc_if->msk_ifp->if_capenable & IFCAP_RXCSUM) != 0) { +#ifdef MSK_64BIT_DMA rxd = &sc_if->msk_cdata.msk_rxdesc[prod]; rxd->rx_m = NULL; rxd->rx_le = &rd->msk_rx_ring[prod]; @@ -723,15 +730,21 @@ msk_init_rx_ring(struct msk_if_softc *sc rxd->rx_le->msk_control = htole32(OP_TCPSTART | HW_OWNER); MSK_INC(prod, MSK_RX_RING_CNT); MSK_INC(sc_if->msk_cdata.msk_rx_cons, MSK_RX_RING_CNT); - i++; - } - for (; i < MSK_RX_RING_CNT; i++) { +#endif rxd = &sc_if->msk_cdata.msk_rxdesc[prod]; rxd->rx_m = NULL; rxd->rx_le = &rd->msk_rx_ring[prod]; + rxd->rx_le->msk_addr = htole32(ETHER_HDR_LEN << 16 | + ETHER_HDR_LEN); + rxd->rx_le->msk_control = htole32(OP_TCPSTART | HW_OWNER); + MSK_INC(prod, MSK_RX_RING_CNT); + MSK_INC(sc_if->msk_cdata.msk_rx_cons, MSK_RX_RING_CNT); + nbuf--; + } + for (i = 0; i < nbuf; i++) { if (msk_newbuf(sc_if, prod) != 0) return (ENOBUFS); - MSK_INC(prod, MSK_RX_RING_CNT); + MSK_RX_INC(prod, MSK_RX_RING_CNT); } bus_dmamap_sync(sc_if->msk_cdata.msk_rx_ring_tag, @@ -739,10 +752,11 @@ msk_init_rx_ring(struct msk_if_softc *sc BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); /* Update prefetch unit. */ - sc_if->msk_cdata.msk_rx_prod = MSK_RX_RING_CNT - 1; + sc_if->msk_cdata.msk_rx_prod = prod; CSR_WRITE_2(sc_if->msk_softc, Y2_PREF_Q_ADDR(sc_if->msk_rxq, PREF_UNIT_PUT_IDX_REG), - sc_if->msk_cdata.msk_rx_prod); + (sc_if->msk_cdata.msk_rx_prod + MSK_RX_RING_CNT - 1) % + MSK_RX_RING_CNT); if (msk_rx_fill(sc_if, 0) != 0) return (ENOBUFS); return (0); @@ -753,7 +767,7 @@ msk_init_jumbo_rx_ring(struct msk_if_sof { struct msk_ring_data *rd; struct msk_rxdesc *rxd; - int i, prod; + int i, nbuf, prod; MSK_IF_LOCK_ASSERT(sc_if); @@ -764,11 +778,18 @@ msk_init_jumbo_rx_ring(struct msk_if_sof rd = &sc_if->msk_rdata; bzero(rd->msk_jumbo_rx_ring, sizeof(struct msk_rx_desc) * MSK_JUMBO_RX_RING_CNT); - prod = sc_if->msk_cdata.msk_rx_prod; - i = 0; + for (i = prod = 0; i < MSK_JUMBO_RX_RING_CNT; i++) { + rxd = &sc_if->msk_cdata.msk_jumbo_rxdesc[prod]; + rxd->rx_m = NULL; + rxd->rx_le = &rd->msk_jumbo_rx_ring[prod]; + MSK_INC(prod, MSK_JUMBO_RX_RING_CNT); + } + nbuf = MSK_RX_BUF_CNT; + prod = 0; /* Have controller know how to compute Rx checksum. */ if ((sc_if->msk_flags & MSK_FLAG_DESCV2) == 0 && (sc_if->msk_ifp->if_capenable & IFCAP_RXCSUM) != 0) { +#ifdef MSK_64BIT_DMA rxd = &sc_if->msk_cdata.msk_jumbo_rxdesc[prod]; rxd->rx_m = NULL; rxd->rx_le = &rd->msk_jumbo_rx_ring[prod]; @@ -777,25 +798,33 @@ msk_init_jumbo_rx_ring(struct msk_if_sof rxd->rx_le->msk_control = htole32(OP_TCPSTART | HW_OWNER); MSK_INC(prod, MSK_JUMBO_RX_RING_CNT); MSK_INC(sc_if->msk_cdata.msk_rx_cons, MSK_JUMBO_RX_RING_CNT); - i++; - } - for (; i < MSK_JUMBO_RX_RING_CNT; i++) { +#endif rxd = &sc_if->msk_cdata.msk_jumbo_rxdesc[prod]; rxd->rx_m = NULL; rxd->rx_le = &rd->msk_jumbo_rx_ring[prod]; + rxd->rx_le->msk_addr = htole32(ETHER_HDR_LEN << 16 | + ETHER_HDR_LEN); + rxd->rx_le->msk_control = htole32(OP_TCPSTART | HW_OWNER); + MSK_INC(prod, MSK_JUMBO_RX_RING_CNT); + MSK_INC(sc_if->msk_cdata.msk_rx_cons, MSK_JUMBO_RX_RING_CNT); + nbuf--; + } + for (i = 0; i < nbuf; i++) { if (msk_jumbo_newbuf(sc_if, prod) != 0) return (ENOBUFS); - MSK_INC(prod, MSK_JUMBO_RX_RING_CNT); + MSK_RX_INC(prod, MSK_JUMBO_RX_RING_CNT); } bus_dmamap_sync(sc_if->msk_cdata.msk_jumbo_rx_ring_tag, sc_if->msk_cdata.msk_jumbo_rx_ring_map, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); - sc_if->msk_cdata.msk_rx_prod = MSK_JUMBO_RX_RING_CNT - 1; + /* Update prefetch unit. */ + sc_if->msk_cdata.msk_rx_prod = prod; CSR_WRITE_2(sc_if->msk_softc, Y2_PREF_Q_ADDR(sc_if->msk_rxq, PREF_UNIT_PUT_IDX_REG), - sc_if->msk_cdata.msk_rx_prod); + (sc_if->msk_cdata.msk_rx_prod + MSK_JUMBO_RX_RING_CNT - 1) % + MSK_JUMBO_RX_RING_CNT); if (msk_rx_fill(sc_if, 1) != 0) return (ENOBUFS); return (0); @@ -813,6 +842,7 @@ msk_init_tx_ring(struct msk_if_softc *sc sc_if->msk_cdata.msk_tx_prod = 0; sc_if->msk_cdata.msk_tx_cons = 0; sc_if->msk_cdata.msk_tx_cnt = 0; + sc_if->msk_cdata.msk_tx_high_addr = 0; rd = &sc_if->msk_rdata; bzero(rd->msk_tx_ring, sizeof(struct msk_tx_desc) * MSK_TX_RING_CNT); @@ -834,6 +864,12 @@ msk_discard_rxbuf(struct msk_if_softc *s struct msk_rxdesc *rxd; struct mbuf *m; +#ifdef MSK_64BIT_DMA + rxd = &sc_if->msk_cdata.msk_rxdesc[idx]; + rx_le = rxd->rx_le; + rx_le->msk_control = htole32(OP_ADDR64 | HW_OWNER); + MSK_INC(idx, MSK_RX_RING_CNT); +#endif rxd = &sc_if->msk_cdata.msk_rxdesc[idx]; m = rxd->rx_m; rx_le = rxd->rx_le; @@ -847,6 +883,12 @@ msk_discard_jumbo_rxbuf(struct msk_if_so struct msk_rxdesc *rxd; struct mbuf *m; +#ifdef MSK_64BIT_DMA + rxd = &sc_if->msk_cdata.msk_jumbo_rxdesc[idx]; + rx_le = rxd->rx_le; + rx_le->msk_control = htole32(OP_ADDR64 | HW_OWNER); + MSK_INC(idx, MSK_JUMBO_RX_RING_CNT); +#endif rxd = &sc_if->msk_cdata.msk_jumbo_rxdesc[idx]; m = rxd->rx_m; rx_le = rxd->rx_le; @@ -884,10 +926,18 @@ msk_newbuf(struct msk_if_softc *sc_if, i KASSERT(nsegs == 1, ("%s: %d segments returned!", __func__, nsegs)); rxd = &sc_if->msk_cdata.msk_rxdesc[idx]; +#ifdef MSK_64BIT_DMA + rx_le = rxd->rx_le; + rx_le->msk_addr = htole32(MSK_ADDR_HI(segs[0].ds_addr)); + rx_le->msk_control = htole32(OP_ADDR64 | HW_OWNER); + MSK_INC(idx, MSK_RX_RING_CNT); + rxd = &sc_if->msk_cdata.msk_rxdesc[idx]; +#endif if (rxd->rx_m != NULL) { bus_dmamap_sync(sc_if->msk_cdata.msk_rx_tag, rxd->rx_dmamap, BUS_DMASYNC_POSTREAD); bus_dmamap_unload(sc_if->msk_cdata.msk_rx_tag, rxd->rx_dmamap); + rxd->rx_m = NULL; } map = rxd->rx_dmamap; rxd->rx_dmamap = sc_if->msk_cdata.msk_rx_sparemap; @@ -937,11 +987,19 @@ msk_jumbo_newbuf(struct msk_if_softc *sc KASSERT(nsegs == 1, ("%s: %d segments returned!", __func__, nsegs)); rxd = &sc_if->msk_cdata.msk_jumbo_rxdesc[idx]; +#ifdef MSK_64BIT_DMA + rx_le = rxd->rx_le; + rx_le->msk_addr = htole32(MSK_ADDR_HI(segs[0].ds_addr)); + rx_le->msk_control = htole32(OP_ADDR64 | HW_OWNER); + MSK_INC(idx, MSK_JUMBO_RX_RING_CNT); + rxd = &sc_if->msk_cdata.msk_jumbo_rxdesc[idx]; +#endif if (rxd->rx_m != NULL) { bus_dmamap_sync(sc_if->msk_cdata.msk_jumbo_rx_tag, rxd->rx_dmamap, BUS_DMASYNC_POSTREAD); bus_dmamap_unload(sc_if->msk_cdata.msk_jumbo_rx_tag, rxd->rx_dmamap); + rxd->rx_m = NULL; } map = rxd->rx_dmamap; rxd->rx_dmamap = sc_if->msk_cdata.msk_jumbo_rx_sparemap; @@ -1472,7 +1530,7 @@ mskc_reset(struct msk_softc *sc) /* Clear status list. */ bzero(sc->msk_stat_ring, - sizeof(struct msk_stat_desc) * MSK_STAT_RING_CNT); + sizeof(struct msk_stat_desc) * sc->msk_stat_count); sc->msk_stat_cons = 0; bus_dmamap_sync(sc->msk_stat_tag, sc->msk_stat_map, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); @@ -1483,7 +1541,7 @@ mskc_reset(struct msk_softc *sc) CSR_WRITE_4(sc, STAT_LIST_ADDR_LO, MSK_ADDR_LO(addr)); CSR_WRITE_4(sc, STAT_LIST_ADDR_HI, MSK_ADDR_HI(addr)); /* Set the status list last index. */ - CSR_WRITE_2(sc, STAT_LAST_IDX, MSK_STAT_RING_CNT - 1); + CSR_WRITE_2(sc, STAT_LAST_IDX, sc->msk_stat_count - 1); if (sc->msk_hw_id == CHIP_ID_YUKON_EC && sc->msk_hw_rev == CHIP_REV_YU_EC_A1) { /* WA for dev. #4.3 */ @@ -2083,17 +2141,29 @@ static int msk_status_dma_alloc(struct msk_softc *sc) { struct msk_dmamap_arg ctx; - int error; + bus_size_t stat_sz; + int count, error; + /* + * It seems controller requires number of status LE entries + * is power of 2 and the maximum number of status LE entries + * is 4096. For dual-port controllers, the number of status + * LE entries should be large enough to hold both port's + * status updates. + */ + count = 3 * MSK_RX_RING_CNT + MSK_TX_RING_CNT; + count = imin(4096, roundup2(count, 1024)); + sc->msk_stat_count = count; + stat_sz = count * sizeof(struct msk_stat_desc); error = bus_dma_tag_create( bus_get_dma_tag(sc->msk_dev), /* parent */ MSK_STAT_ALIGN, 0, /* alignment, boundary */ BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ - MSK_STAT_RING_SZ, /* maxsize */ + stat_sz, /* maxsize */ 1, /* nsegments */ - MSK_STAT_RING_SZ, /* maxsegsize */ + stat_sz, /* maxsegsize */ 0, /* flags */ NULL, NULL, /* lockfunc, lockarg */ &sc->msk_stat_tag); @@ -2114,9 +2184,8 @@ msk_status_dma_alloc(struct msk_softc *s } ctx.msk_busaddr = 0; - error = bus_dmamap_load(sc->msk_stat_tag, - sc->msk_stat_map, sc->msk_stat_ring, MSK_STAT_RING_SZ, - msk_dmamap_cb, &ctx, 0); + error = bus_dmamap_load(sc->msk_stat_tag, sc->msk_stat_map, + sc->msk_stat_ring, stat_sz, msk_dmamap_cb, &ctx, BUS_DMA_NOWAIT); if (error != 0) { device_printf(sc->msk_dev, "failed to load DMA'able memory for status ring\n"); @@ -2157,27 +2226,10 @@ msk_txrx_dma_alloc(struct msk_if_softc * int error, i; /* Create parent DMA tag. */ - /* - * XXX - * It seems that Yukon II supports full 64bits DMA operations. But - * it needs two descriptors(list elements) for 64bits DMA operations. - * Since we don't know what DMA address mappings(32bits or 64bits) - * would be used in advance for each mbufs, we limits its DMA space - * to be in range of 32bits address space. Otherwise, we should check - * what DMA address is used and chain another descriptor for the - * 64bits DMA operation. This also means descriptor ring size is - * variable. Limiting DMA address to be in 32bit address space greatly - * simplifies descriptor handling and possibly would increase - * performance a bit due to efficient handling of descriptors. - * Apart from harassing checksum offloading mechanisms, it seems - * it's really bad idea to use a separate descriptor for 64bit - * DMA operation to save small descriptor memory. Anyway, I've - * never seen these exotic scheme on ethernet interface hardware. - */ error = bus_dma_tag_create( bus_get_dma_tag(sc_if->msk_if_dev), /* parent */ 1, 0, /* alignment, boundary */ - BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ + BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ BUS_SPACE_MAXSIZE_32BIT, /* maxsize */ @@ -2283,7 +2335,7 @@ msk_txrx_dma_alloc(struct msk_if_softc * ctx.msk_busaddr = 0; error = bus_dmamap_load(sc_if->msk_cdata.msk_tx_ring_tag, sc_if->msk_cdata.msk_tx_ring_map, sc_if->msk_rdata.msk_tx_ring, - MSK_TX_RING_SZ, msk_dmamap_cb, &ctx, 0); + MSK_TX_RING_SZ, msk_dmamap_cb, &ctx, BUS_DMA_NOWAIT); if (error != 0) { device_printf(sc_if->msk_if_dev, "failed to load DMA'able memory for Tx ring\n"); @@ -2304,7 +2356,7 @@ msk_txrx_dma_alloc(struct msk_if_softc * ctx.msk_busaddr = 0; error = bus_dmamap_load(sc_if->msk_cdata.msk_rx_ring_tag, sc_if->msk_cdata.msk_rx_ring_map, sc_if->msk_rdata.msk_rx_ring, - MSK_RX_RING_SZ, msk_dmamap_cb, &ctx, 0); + MSK_RX_RING_SZ, msk_dmamap_cb, &ctx, BUS_DMA_NOWAIT); if (error != 0) { device_printf(sc_if->msk_if_dev, "failed to load DMA'able memory for Rx ring\n"); @@ -2421,7 +2473,7 @@ msk_rx_dma_jalloc(struct msk_if_softc *s error = bus_dmamap_load(sc_if->msk_cdata.msk_jumbo_rx_ring_tag, sc_if->msk_cdata.msk_jumbo_rx_ring_map, sc_if->msk_rdata.msk_jumbo_rx_ring, MSK_JUMBO_RX_RING_SZ, - msk_dmamap_cb, &ctx, 0); + msk_dmamap_cb, &ctx, BUS_DMA_NOWAIT); if (error != 0) { device_printf(sc_if->msk_if_dev, "failed to load DMA'able memory for jumbo Rx ring\n"); @@ -2781,6 +2833,18 @@ msk_encap(struct msk_if_softc *sc_if, st } } +#ifdef MSK_64BIT_DMA + if (MSK_ADDR_HI(txsegs[0].ds_addr) != + sc_if->msk_cdata.msk_tx_high_addr) { + sc_if->msk_cdata.msk_tx_high_addr = + MSK_ADDR_HI(txsegs[0].ds_addr); + tx_le = &sc_if->msk_rdata.msk_tx_ring[prod]; + tx_le->msk_addr = htole32(MSK_ADDR_HI(txsegs[0].ds_addr)); + tx_le->msk_control = htole32(OP_ADDR64 | HW_OWNER); + sc_if->msk_cdata.msk_tx_cnt++; + MSK_INC(prod, MSK_TX_RING_CNT); + } +#endif si = prod; tx_le = &sc_if->msk_rdata.msk_tx_ring[prod]; tx_le->msk_addr = htole32(MSK_ADDR_LO(txsegs[0].ds_addr)); @@ -2795,6 +2859,20 @@ msk_encap(struct msk_if_softc *sc_if, st for (i = 1; i < nseg; i++) { tx_le = &sc_if->msk_rdata.msk_tx_ring[prod]; +#ifdef MSK_64BIT_DMA + if (MSK_ADDR_HI(txsegs[i].ds_addr) != + sc_if->msk_cdata.msk_tx_high_addr) { + sc_if->msk_cdata.msk_tx_high_addr = + MSK_ADDR_HI(txsegs[i].ds_addr); + tx_le = &sc_if->msk_rdata.msk_tx_ring[prod]; + tx_le->msk_addr = + htole32(MSK_ADDR_HI(txsegs[i].ds_addr)); + tx_le->msk_control = htole32(OP_ADDR64 | HW_OWNER); + sc_if->msk_cdata.msk_tx_cnt++; + MSK_INC(prod, MSK_TX_RING_CNT); + tx_le = &sc_if->msk_rdata.msk_tx_ring[prod]; + } +#endif tx_le->msk_addr = htole32(MSK_ADDR_LO(txsegs[i].ds_addr)); tx_le->msk_control = htole32(txsegs[i].ds_len | control | OP_BUFFER | HW_OWNER); @@ -3147,7 +3225,12 @@ msk_rxeof(struct msk_if_softc *sc_if, ui msk_discard_rxbuf(sc_if, cons); break; } +#ifdef MSK_64BIT_DMA + rxd = &sc_if->msk_cdata.msk_rxdesc[(cons + 1) % + MSK_RX_RING_CNT]; +#else rxd = &sc_if->msk_cdata.msk_rxdesc[cons]; +#endif m = rxd->rx_m; if (msk_newbuf(sc_if, cons) != 0) { ifp->if_iqdrops++; @@ -3175,8 +3258,8 @@ msk_rxeof(struct msk_if_softc *sc_if, ui MSK_IF_LOCK(sc_if); } while (0); - MSK_INC(sc_if->msk_cdata.msk_rx_cons, MSK_RX_RING_CNT); - MSK_INC(sc_if->msk_cdata.msk_rx_prod, MSK_RX_RING_CNT); + MSK_RX_INC(sc_if->msk_cdata.msk_rx_cons, MSK_RX_RING_CNT); + MSK_RX_INC(sc_if->msk_cdata.msk_rx_prod, MSK_RX_RING_CNT); } static void @@ -3207,7 +3290,12 @@ msk_jumbo_rxeof(struct msk_if_softc *sc_ msk_discard_jumbo_rxbuf(sc_if, cons); break; } +#ifdef MSK_64BIT_DMA + jrxd = &sc_if->msk_cdata.msk_jumbo_rxdesc[(cons + 1) % + MSK_JUMBO_RX_RING_CNT]; +#else jrxd = &sc_if->msk_cdata.msk_jumbo_rxdesc[cons]; +#endif m = jrxd->rx_m; if (msk_jumbo_newbuf(sc_if, cons) != 0) { ifp->if_iqdrops++; @@ -3235,8 +3323,8 @@ msk_jumbo_rxeof(struct msk_if_softc *sc_ MSK_IF_LOCK(sc_if); } while (0); - MSK_INC(sc_if->msk_cdata.msk_rx_cons, MSK_JUMBO_RX_RING_CNT); - MSK_INC(sc_if->msk_cdata.msk_rx_prod, MSK_JUMBO_RX_RING_CNT); + MSK_RX_INC(sc_if->msk_cdata.msk_rx_cons, MSK_JUMBO_RX_RING_CNT); + MSK_RX_INC(sc_if->msk_cdata.msk_rx_prod, MSK_JUMBO_RX_RING_CNT); } static void @@ -3581,7 +3669,7 @@ msk_handle_events(struct msk_softc *sc) control & STLE_OP_MASK); break; } - MSK_INC(cons, MSK_STAT_RING_CNT); + MSK_INC(cons, sc->msk_stat_count); if (rxprog > sc->msk_process_limit) break; } Modified: head/sys/dev/msk/if_mskreg.h ============================================================================== --- head/sys/dev/msk/if_mskreg.h Wed Nov 16 19:06:55 2011 (r227581) +++ head/sys/dev/msk/if_mskreg.h Wed Nov 16 19:25:26 2011 (r227582) @@ -2315,35 +2315,48 @@ struct msk_stat_desc { #define BMU_UDP_CHECK (0x57<<16) /* Descr with UDP ext (YUKON only) */ #define BMU_BBC 0xffff /* Bit 15.. 0: Buffer Byte Counter */ +/* + * Controller requires an additional LE op code for 64bit DMA operation. + * Driver uses fixed number of RX buffers such that this limitation + * reduces number of available RX buffers with 64bit DMA so double + * number of RX buffers on platforms that support 64bit DMA. For TX + * side, controller requires an additional OP_ADDR64 op code if a TX + * buffer uses different high address value than previously used one. + * Driver monitors high DMA address change in TX and inserts an + * OP_ADDR64 op code if the high DMA address is changed. Driver + * allocates 50% more total TX buffers on platforms that support 64bit + * DMA. + */ +#if (BUS_SPACE_MAXADDR > 0xFFFFFFFF) +#define MSK_64BIT_DMA +#define MSK_TX_RING_CNT 384 +#define MSK_RX_RING_CNT 512 +#else +#undef MSK_64BIT_DMA #define MSK_TX_RING_CNT 256 #define MSK_RX_RING_CNT 256 +#endif #define MSK_RX_BUF_ALIGN 8 #define MSK_JUMBO_RX_RING_CNT MSK_RX_RING_CNT -#define MSK_STAT_RING_CNT ((1 + 3) * (MSK_TX_RING_CNT + MSK_RX_RING_CNT)) #define MSK_MAXTXSEGS 32 #define MSK_TSO_MAXSGSIZE 4096 #define MSK_TSO_MAXSIZE (65535 + sizeof(struct ether_vlan_header)) /* - * It seems that the hardware requires extra decriptors(LEs) to offload - * TCP/UDP checksum, VLAN hardware tag inserstion and TSO. + * It seems that the hardware requires extra descriptors(LEs) to offload + * TCP/UDP checksum, VLAN hardware tag insertion and TSO. * * 1 descriptor for TCP/UDP checksum offload. * 1 descriptor VLAN hardware tag insertion. * 1 descriptor for TSO(TCP Segmentation Offload) - * 1 descriptor for 64bits DMA : Not applicatable due to the use of - * BUS_SPACE_MAXADDR_32BIT in parent DMA tag creation. + * 1 descriptor for each 64bits DMA transfers */ +#ifdef MSK_64BIT_DMA +#define MSK_RESERVED_TX_DESC_CNT (MSK_MAXTXSEGS + 3) +#else #define MSK_RESERVED_TX_DESC_CNT 3 +#endif -/* - * Jumbo buffer stuff. Note that we must allocate more jumbo - * buffers than there are descriptors in the receive ring. This - * is because we don't know how long it will take for a packet - * to be released after we hand it off to the upper protocol - * layers. To be safe, we allocate 1.5 times the number of - * receive descriptors. - */ #define MSK_JUMBO_FRAMELEN 9022 #define MSK_JUMBO_MTU (MSK_JUMBO_FRAMELEN-ETHER_HDR_LEN-ETHER_CRC_LEN) #define MSK_MAX_FRAMELEN \ @@ -2380,6 +2393,7 @@ struct msk_chain_data { bus_dmamap_t msk_jumbo_rx_sparemap; uint16_t msk_tso_mtu; uint32_t msk_last_csum; + uint32_t msk_tx_high_addr; int msk_tx_prod; int msk_tx_cons; int msk_tx_cnt; @@ -2411,10 +2425,17 @@ struct msk_ring_data { (sizeof(struct msk_rx_desc) * MSK_RX_RING_CNT) #define MSK_JUMBO_RX_RING_SZ \ (sizeof(struct msk_rx_desc) * MSK_JUMBO_RX_RING_CNT) -#define MSK_STAT_RING_SZ \ - (sizeof(struct msk_stat_desc) * MSK_STAT_RING_CNT) #define MSK_INC(x, y) (x) = (x + 1) % y +#ifdef MSK_64BIT_DMA +#define MSK_RX_INC(x, y) (x) = (x + 2) % y +#define MSK_RX_BUF_CNT (MSK_RX_RING_CNT / 2) +#define MSK_JUMBO_RX_BUF_CNT (MSK_JUMBO_RX_RING_CNT / 2) +#else +#define MSK_RX_INC(x, y) (x) = (x + 1) % y +#define MSK_RX_BUF_CNT MSK_RX_RING_CNT +#define MSK_JUMBO_RX_BUF_CNT MSK_JUMBO_RX_RING_CNT +#endif #define MSK_PCI_BUS 0 #define MSK_PCIX_BUS 1 @@ -2519,6 +2540,7 @@ struct msk_softc { int msk_int_holdoff; int msk_process_limit; int msk_stat_cons; + int msk_stat_count; struct mtx msk_mtx; }; From owner-svn-src-all@FreeBSD.ORG Wed Nov 16 19:59:13 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7796106566B; Wed, 16 Nov 2011 19:59:13 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from mx0.hoeg.nl (mx0.hoeg.nl [IPv6:2a01:4f8:101:5343::aa]) by mx1.freebsd.org (Postfix) with ESMTP id 88A218FC0C; Wed, 16 Nov 2011 19:59:13 +0000 (UTC) Received: by mx0.hoeg.nl (Postfix, from userid 1000) id C72092A28CC9; Wed, 16 Nov 2011 20:59:12 +0100 (CET) Date: Wed, 16 Nov 2011 20:59:12 +0100 From: Ed Schouten To: Adrian Chadd Message-ID: <20111116195912.GL36205@hoeg.nl> References: <201111081708.pA8H8CnM040532@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Ublo+h3cBgJ33ahC" Content-Disposition: inline In-Reply-To: <201111081708.pA8H8CnM040532@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 Subject: Re: svn commit: r227344 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2011 19:59:14 -0000 --Ublo+h3cBgJ33ahC Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Adrian, * Adrian Chadd , 20111108 18:08: > -static MALLOC_DEFINE(M_ATHDEV, "athdev", "ath driver dma buffers"); > +MALLOC_DEFINE(M_ATHDEV, "athdev", "ath driver dma buffers"); Is there a reason why we can't mark this static? Thanks, --=20 Ed Schouten WWW: http://80386.nl/ --Ublo+h3cBgJ33ahC Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iQIcBAEBAgAGBQJOxBYQAAoJEG5e2P40kaK7guwP/20BztdMaHe9H3qezJCzvuHI CiZPDzuOapA6klZMv86Bwv00YtQX0fzhd2CIM0+I9v3FRMI9j00Wtgda/Z7yjzpg DsAwvAhA4SUdVU3XaKaOnZU+AHr7O9nKTUM5+kxyT2Mr2z9zNHvYws/uhxTnbnw/ F2NmUf37iWC/K5qBofCavjoVnUznyu1TAR2VqacIgDeMb2PQO9eEEreSDIBL3CxQ as6di7LZrNrJxKfiIfRqDWuAKBsd9rZpi6tAFBIundnvDpWRD3N/Vny0TQj7RC2K nJ1EzF+wLiixK4MfDjYmnK9+OFkSXqbGzhh5jOyWX9qawAxL/P9lWPlHHLEkEhSJ U3D7K3DY+HSZSpPOPtn0IoNre0lCiN/hJRT6LXCGzKjeRqvToT0goOFO/zckpMCV cLu5POa9HncoTuqTWqNtPIYo2Um29Y+G1S3RG2Tbv/CZhMZOd5mYBgdnBbDyieY9 6nQ/LjhXIrV4lXpy0pNslhaKAfUQObiQyqxgaXOh4g6fzD1DNZ/byIqzMkN2QTfF 4p+A3AmyYRID27zNROJMp8f8WNnGmwu8+yhJ01vybA5L5WAyn45R+imcDOa80mqd 7SvW26DDlwU/o/rhxMaRogLqrvorTmKx2Nlxl4PCNEeXm9tGoSb4YrbdhhEFIIKx MmWBAkdS7RHzeid8yQR6 =B2xt -----END PGP SIGNATURE----- --Ublo+h3cBgJ33ahC-- From owner-svn-src-all@FreeBSD.ORG Wed Nov 16 21:11:59 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A0981065674; Wed, 16 Nov 2011 21:11:59 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-vx0-f182.google.com (mail-vx0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id 1EDD98FC18; Wed, 16 Nov 2011 21:11:36 +0000 (UTC) Received: by vcbfy13 with SMTP id fy13so301242vcb.13 for ; Wed, 16 Nov 2011 13:11:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=98oqXUBFXeFgc9aqPqtoMqJRhYA0UyzjITNmPPGA91k=; b=H7L+Sm8m3ACaQRWoxZWvN3VZgLf45zU0yKGFdWqMLUO8/+J0w/BuOYJjvXXoYyxWPW fJ/osjf5HuhJwWWX5f1uxNj2Htd1HHKYg1igxIcGCpC1WN9oToBwyv3kOQ4O6Q9jQZIZ k0yqQtw3ONqMsw8kZyx7M1KhigIIAgWMa2vPs= MIME-Version: 1.0 Received: by 10.52.34.78 with SMTP id x14mr46308598vdi.122.1321477896063; Wed, 16 Nov 2011 13:11:36 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.52.29.198 with HTTP; Wed, 16 Nov 2011 13:11:36 -0800 (PST) In-Reply-To: <20111116195912.GL36205@hoeg.nl> References: <201111081708.pA8H8CnM040532@svn.freebsd.org> <20111116195912.GL36205@hoeg.nl> Date: Wed, 16 Nov 2011 13:11:36 -0800 X-Google-Sender-Auth: XU_QBNai8FtC6bSUXSQEghozcCI Message-ID: From: Adrian Chadd To: Ed Schouten Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r227344 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2011 21:11:59 -0000 On 16 November 2011 11:59, Ed Schouten wrote: > Hi Adrian, > > * Adrian Chadd , 20111108 18:08: >> -static MALLOC_DEFINE(M_ATHDEV, "athdev", "ath driver dma buffers"); >> +MALLOC_DEFINE(M_ATHDEV, "athdev", "ath driver dma buffers"); > > Is there a reason why we can't mark this static? Some future work is going to split out some of the TX and RX DMA buffer management, and this will require the definition to be non-static. Adrian From owner-svn-src-all@FreeBSD.ORG Wed Nov 16 21:22:51 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C4ABB106566B; Wed, 16 Nov 2011 21:22:51 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9AAC48FC08; Wed, 16 Nov 2011 21:22:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAGLMp4M067195; Wed, 16 Nov 2011 21:22:51 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAGLMpJD067193; Wed, 16 Nov 2011 21:22:51 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201111162122.pAGLMpJD067193@svn.freebsd.org> From: Andreas Tobler Date: Wed, 16 Nov 2011 21:22:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227586 - head/contrib/gcc/config/rs6000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2011 21:22:51 -0000 Author: andreast Date: Wed Nov 16 21:22:51 2011 New Revision: 227586 URL: http://svn.freebsd.org/changeset/base/227586 Log: Copy over the ASM_DECLARE_FUNCTION_SIZE macro from linux64.h. This macro declares the proper size of a function. Without this macro recent GNU as will complain about with: 'Error: .size expression for main does not evaluate to a constant.' Up to now we produce this: .L.main: .... .size main, .-main With the macro defined the output is this: .L.main: .... .size main,.-.L.main This affects only the 64-bit compiler. Tested with world and kernel on both, 32 and 64-bit powerpc. Modified: head/contrib/gcc/config/rs6000/freebsd.h Modified: head/contrib/gcc/config/rs6000/freebsd.h ============================================================================== --- head/contrib/gcc/config/rs6000/freebsd.h Wed Nov 16 20:18:25 2011 (r227585) +++ head/contrib/gcc/config/rs6000/freebsd.h Wed Nov 16 21:22:51 2011 (r227586) @@ -253,3 +253,22 @@ extern int dot_symbols; #undef NEED_INDICATE_EXEC_STACK #define NEED_INDICATE_EXEC_STACK 1 + +/* This is how to declare the size of a function. */ +#undef ASM_DECLARE_FUNCTION_SIZE +#define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL) \ + do \ + { \ + if (!flag_inhibit_size_directive) \ + { \ + fputs ("\t.size\t", (FILE)); \ + if (TARGET_64BIT && DOT_SYMBOLS) \ + putc ('.', (FILE)); \ + assemble_name ((FILE), (FNAME)); \ + fputs (",.-", (FILE)); \ + rs6000_output_function_entry (FILE, FNAME); \ + putc ('\n', (FILE)); \ + } \ + } \ + while (0) + From owner-svn-src-all@FreeBSD.ORG Wed Nov 16 21:37:46 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 46D51106566B; Wed, 16 Nov 2011 21:37:46 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 364758FC0C; Wed, 16 Nov 2011 21:37:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAGLbkno067683; Wed, 16 Nov 2011 21:37:46 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAGLbkmS067680; Wed, 16 Nov 2011 21:37:46 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201111162137.pAGLbkmS067680@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 16 Nov 2011 21:37:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227587 - in head/sys: dev/re pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2011 21:37:46 -0000 Author: yongari Date: Wed Nov 16 21:37:45 2011 New Revision: 227587 URL: http://svn.freebsd.org/changeset/base/227587 Log: Add preliminary support for RTL8402 PCIe FastEthernet with integrated card reader. H/W donated by: RealTek Semiconductor Corp. Modified: head/sys/dev/re/if_re.c head/sys/pci/if_rlreg.h Modified: head/sys/dev/re/if_re.c ============================================================================== --- head/sys/dev/re/if_re.c Wed Nov 16 21:22:51 2011 (r227586) +++ head/sys/dev/re/if_re.c Wed Nov 16 21:37:45 2011 (r227587) @@ -220,6 +220,7 @@ static const struct rl_hwrev const re_hw { RL_HWREV_8102EL_SPIN1, RL_8169, "8102EL", RL_MTU }, { RL_HWREV_8103E, RL_8169, "8103E", RL_MTU }, { RL_HWREV_8401E, RL_8169, "8401E", RL_MTU }, + { RL_HWREV_8402, RL_8169, "8402", RL_MTU }, { RL_HWREV_8105E, RL_8169, "8105E", RL_MTU }, { RL_HWREV_8168B_SPIN2, RL_8169, "8168", RL_JUMBO_MTU }, { RL_HWREV_8168B_SPIN3, RL_8169, "8168", RL_JUMBO_MTU }, @@ -1381,6 +1382,7 @@ re_attach(device_t dev) RL_FLAG_AUTOPAD | RL_FLAG_MACSLEEP; break; case RL_HWREV_8401E: + case RL_HWREV_8402: case RL_HWREV_8105E: sc->rl_flags |= RL_FLAG_PHYWAKE | RL_FLAG_PHYWAKE_PM | RL_FLAG_PAR | RL_FLAG_DESCV2 | RL_FLAG_MACSTAT | Modified: head/sys/pci/if_rlreg.h ============================================================================== --- head/sys/pci/if_rlreg.h Wed Nov 16 21:22:51 2011 (r227586) +++ head/sys/pci/if_rlreg.h Wed Nov 16 21:37:45 2011 (r227587) @@ -178,6 +178,7 @@ #define RL_HWREV_8168C_SPIN2 0x3C400000 #define RL_HWREV_8168CP 0x3C800000 #define RL_HWREV_8105E 0x40800000 +#define RL_HWREV_8402 0x44000000 #define RL_HWREV_8139 0x60000000 #define RL_HWREV_8139A 0x70000000 #define RL_HWREV_8139AG 0x70800000 From owner-svn-src-all@FreeBSD.ORG Wed Nov 16 21:51:18 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 43013106566C; Wed, 16 Nov 2011 21:51:18 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 29B688FC15; Wed, 16 Nov 2011 21:51:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAGLpIUv068158; Wed, 16 Nov 2011 21:51:18 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAGLpHIr068140; Wed, 16 Nov 2011 21:51:17 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201111162151.pAGLpHIr068140@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 16 Nov 2011 21:51:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227588 - in head: share/man/man9 sys/kern sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2011 21:51:18 -0000 Author: pjd Date: Wed Nov 16 21:51:17 2011 New Revision: 227588 URL: http://svn.freebsd.org/changeset/base/227588 Log: Constify arguments for locking KPIs where possible. This enables locking consumers to pass their own structures around as const and be able to assert locks embedded into those structures. Reviewed by: ed, kib, jhb Modified: head/share/man/man9/lock.9 head/share/man/man9/mutex.9 head/share/man/man9/rmlock.9 head/share/man/man9/rwlock.9 head/share/man/man9/sx.9 head/sys/kern/kern_lock.c head/sys/kern/kern_mutex.c head/sys/kern/kern_rmlock.c head/sys/kern/kern_rwlock.c head/sys/kern/kern_sx.c head/sys/kern/subr_witness.c head/sys/sys/lock.h head/sys/sys/lockmgr.h head/sys/sys/mutex.h head/sys/sys/rmlock.h head/sys/sys/rwlock.h head/sys/sys/sx.h Modified: head/share/man/man9/lock.9 ============================================================================== --- head/share/man/man9/lock.9 Wed Nov 16 21:37:45 2011 (r227587) +++ head/share/man/man9/lock.9 Wed Nov 16 21:51:17 2011 (r227588) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 16, 2009 +.Dd November 16, 2011 .Dt LOCK 9 .Os .Sh NAME @@ -60,20 +60,20 @@ .Ft void .Fn lockmgr_disown "struct lock *lkp" .Ft void -.Fn lockmgr_printinfo "struct lock *lkp" +.Fn lockmgr_printinfo "const struct lock *lkp" .Ft int -.Fn lockmgr_recursed "struct lock *lkp" +.Fn lockmgr_recursed "const struct lock *lkp" .Ft int .Fn lockmgr_rw "struct lock *lkp" "u_int flags" "struct rwlock *ilk" .Ft int -.Fn lockmgr_waiters "struct lock *lkp" +.Fn lockmgr_waiters "const struct lock *lkp" .Ft int -.Fn lockstatus "struct lock *lkp" +.Fn lockstatus "const struct lock *lkp" .Pp .Cd "options INVARIANTS" .Cd "options INVARIANT_SUPPORT" .Ft void -.Fn lockmgr_assert "struct lock *lkp" "int what" +.Fn lockmgr_assert "const struct lock *lkp" "int what" .Sh DESCRIPTION The .Fn lockinit Modified: head/share/man/man9/mutex.9 ============================================================================== --- head/share/man/man9/mutex.9 Wed Nov 16 21:37:45 2011 (r227587) +++ head/share/man/man9/mutex.9 Wed Nov 16 21:51:17 2011 (r227588) @@ -28,7 +28,7 @@ .\" from BSDI $Id: mutex.4,v 1.1.2.3 1998/04/27 22:53:13 ewv Exp $ .\" $FreeBSD$ .\" -.Dd December 21, 2006 +.Dd November 16, 2011 .Dt MUTEX 9 .Os .Sh NAME @@ -83,16 +83,16 @@ .Ft int .Fn mtx_sleep "void *chan" "struct mtx *mtx" "int priority" "const char *wmesg" "int timo" .Ft int -.Fn mtx_initialized "struct mtx *mutex" +.Fn mtx_initialized "const struct mtx *mutex" .Ft int -.Fn mtx_owned "struct mtx *mutex" +.Fn mtx_owned "const struct mtx *mutex" .Ft int -.Fn mtx_recursed "struct mtx *mutex" +.Fn mtx_recursed "const struct mtx *mutex" .Pp .Cd "options INVARIANTS" .Cd "options INVARIANT_SUPPORT" .Ft void -.Fn mtx_assert "struct mtx *mutex" "int what" +.Fn mtx_assert "const struct mtx *mutex" "int what" .In sys/kernel.h .Fn MTX_SYSINIT "name" "struct mtx *mtx" "const char *description" "int opts" .Sh DESCRIPTION Modified: head/share/man/man9/rmlock.9 ============================================================================== --- head/share/man/man9/rmlock.9 Wed Nov 16 21:37:45 2011 (r227587) +++ head/share/man/man9/rmlock.9 Wed Nov 16 21:51:17 2011 (r227588) @@ -26,7 +26,7 @@ .\" $FreeBSD$ .\" .\" Based on rwlock.9 man page -.Dd November 10, 2007 +.Dd November 16, 2011 .Dt RMLOCK 9 .Os .Sh NAME @@ -63,7 +63,7 @@ .Ft void .Fn rm_wunlock "struct rmlock *rm" .Ft int -.Fn rm_wowned "struct rmlock *rm" +.Fn rm_wowned "const struct rmlock *rm" .In sys/kernel.h .Fn RM_SYSINIT "name" "struct rmlock *rm" "const char *desc" "int opts" .Sh DESCRIPTION @@ -208,7 +208,7 @@ This functions destroys a lock previousl The .Fa rm lock must be unlocked. -.It Fn rm_wowned "struct rmlock *rm" +.It Fn rm_wowned "const struct rmlock *rm" This function returns a non-zero value if the current thread owns an exclusive lock on .Fa rm . Modified: head/share/man/man9/rwlock.9 ============================================================================== --- head/share/man/man9/rwlock.9 Wed Nov 16 21:37:45 2011 (r227587) +++ head/share/man/man9/rwlock.9 Wed Nov 16 21:51:17 2011 (r227588) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 1, 2008 +.Dd November 16, 2011 .Dt RWLOCK 9 .Os .Sh NAME @@ -78,14 +78,14 @@ .Ft int .Fn rw_sleep "void *chan" "struct rwlock *rw" "int priority" "const char *wmesg" "int timo" .Ft int -.Fn rw_initialized "struct rwlock *rw" +.Fn rw_initialized "const struct rwlock *rw" .Ft int -.Fn rw_wowned "struct rwlock *rw" +.Fn rw_wowned "const struct rwlock *rw" .Pp .Cd "options INVARIANTS" .Cd "options INVARIANT_SUPPORT" .Ft void -.Fn rw_assert "struct rwlock *rw" "int what" +.Fn rw_assert "const struct rwlock *rw" "int what" .In sys/kernel.h .Fn RW_SYSINIT "name" "struct rwlock *rw" "const char *desc" .Sh DESCRIPTION @@ -231,7 +231,7 @@ while waiting for an event. For more details on the parameters to this function, see .Xr sleep 9 . -.It Fn rw_initialized "struct rwlock *rw" +.It Fn rw_initialized "const struct rwlock *rw" This function returns non-zero if .Fa rw has been initialized, and zero otherwise. @@ -241,11 +241,11 @@ This functions destroys a lock previousl The .Fa rw lock must be unlocked. -.It Fn rw_wowned "struct rwlock *rw" +.It Fn rw_wowned "const struct rwlock *rw" This function returns a non-zero value if the current thread owns an exclusive lock on .Fa rw . -.It Fn rw_assert "struct rwlock *rw" "int what" +.It Fn rw_assert "const struct rwlock *rw" "int what" This function allows assertions specified in .Fa what to be made about Modified: head/share/man/man9/sx.9 ============================================================================== --- head/share/man/man9/sx.9 Wed Nov 16 21:37:45 2011 (r227587) +++ head/share/man/man9/sx.9 Wed Nov 16 21:51:17 2011 (r227588) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 28, 2009 +.Dd November 16, 2011 .Dt SX 9 .Os .Sh NAME @@ -88,12 +88,12 @@ .Ft "struct thread *" .Fn sx_xholder "struct sx *sx" .Ft int -.Fn sx_xlocked "struct sx *sx" +.Fn sx_xlocked "const struct sx *sx" .Pp .Cd "options INVARIANTS" .Cd "options INVARIANT_SUPPORT" .Ft void -.Fn sx_assert "struct sx *sx" "int what" +.Fn sx_assert "const struct sx *sx" "int what" .In sys/kernel.h .Fn SX_SYSINIT "name" "struct sx *sx" "const char *description" .Sh DESCRIPTION Modified: head/sys/kern/kern_lock.c ============================================================================== --- head/sys/kern/kern_lock.c Wed Nov 16 21:37:45 2011 (r227587) +++ head/sys/kern/kern_lock.c Wed Nov 16 21:51:17 2011 (r227588) @@ -131,15 +131,16 @@ CTASSERT(LK_UNLOCKED == (LK_UNLOCKED & #define lockmgr_xlocked(lk) \ (((lk)->lk_lock & ~(LK_FLAGMASK & ~LK_SHARE)) == (uintptr_t)curthread) -static void assert_lockmgr(struct lock_object *lock, int how); +static void assert_lockmgr(const struct lock_object *lock, int how); #ifdef DDB -static void db_show_lockmgr(struct lock_object *lock); +static void db_show_lockmgr(const struct lock_object *lock); #endif -static void lock_lockmgr(struct lock_object *lock, int how); +static void lock_lockmgr(struct lock_object *lock, int how); #ifdef KDTRACE_HOOKS -static int owner_lockmgr(struct lock_object *lock, struct thread **owner); +static int owner_lockmgr(const struct lock_object *lock, + struct thread **owner); #endif -static int unlock_lockmgr(struct lock_object *lock); +static int unlock_lockmgr(struct lock_object *lock); struct lock_class lock_class_lockmgr = { .lc_name = "lockmgr", @@ -165,7 +166,7 @@ SYSCTL_UINT(_debug_lockmgr, OID_AUTO, lo #endif static __inline struct thread * -lockmgr_xholder(struct lock *lk) +lockmgr_xholder(const struct lock *lk) { uintptr_t x; @@ -335,7 +336,7 @@ wakeupshlk(struct lock *lk, const char * } static void -assert_lockmgr(struct lock_object *lock, int what) +assert_lockmgr(const struct lock_object *lock, int what) { panic("lockmgr locks do not support assertions"); @@ -357,7 +358,7 @@ unlock_lockmgr(struct lock_object *lock) #ifdef KDTRACE_HOOKS static int -owner_lockmgr(struct lock_object *lock, struct thread **owner) +owner_lockmgr(const struct lock_object *lock, struct thread **owner) { panic("lockmgr locks do not support owner inquiring"); @@ -1260,7 +1261,7 @@ _lockmgr_disown(struct lock *lk, const c } void -lockmgr_printinfo(struct lock *lk) +lockmgr_printinfo(const struct lock *lk) { struct thread *td; uintptr_t x; @@ -1289,7 +1290,7 @@ lockmgr_printinfo(struct lock *lk) } int -lockstatus(struct lock *lk) +lockstatus(const struct lock *lk) { uintptr_t v, x; int ret; @@ -1319,7 +1320,7 @@ FEATURE(invariant_support, #endif void -_lockmgr_assert(struct lock *lk, int what, const char *file, int line) +_lockmgr_assert(const struct lock *lk, int what, const char *file, int line) { int slocked = 0; @@ -1412,12 +1413,12 @@ lockmgr_chain(struct thread *td, struct } static void -db_show_lockmgr(struct lock_object *lock) +db_show_lockmgr(const struct lock_object *lock) { struct thread *td; - struct lock *lk; + const struct lock *lk; - lk = (struct lock *)lock; + lk = (const struct lock *)lock; db_printf(" state: "); if (lk->lk_lock == LK_UNLOCKED) Modified: head/sys/kern/kern_mutex.c ============================================================================== --- head/sys/kern/kern_mutex.c Wed Nov 16 21:37:45 2011 (r227587) +++ head/sys/kern/kern_mutex.c Wed Nov 16 21:51:17 2011 (r227588) @@ -85,14 +85,15 @@ __FBSDID("$FreeBSD$"); #define mtx_owner(m) ((struct thread *)((m)->mtx_lock & ~MTX_FLAGMASK)) -static void assert_mtx(struct lock_object *lock, int what); +static void assert_mtx(const struct lock_object *lock, int what); #ifdef DDB -static void db_show_mtx(struct lock_object *lock); +static void db_show_mtx(const struct lock_object *lock); #endif static void lock_mtx(struct lock_object *lock, int how); static void lock_spin(struct lock_object *lock, int how); #ifdef KDTRACE_HOOKS -static int owner_mtx(struct lock_object *lock, struct thread **owner); +static int owner_mtx(const struct lock_object *lock, + struct thread **owner); #endif static int unlock_mtx(struct lock_object *lock); static int unlock_spin(struct lock_object *lock); @@ -134,10 +135,10 @@ struct mtx blocked_lock; struct mtx Giant; void -assert_mtx(struct lock_object *lock, int what) +assert_mtx(const struct lock_object *lock, int what) { - mtx_assert((struct mtx *)lock, what); + mtx_assert((const struct mtx *)lock, what); } void @@ -174,9 +175,9 @@ unlock_spin(struct lock_object *lock) #ifdef KDTRACE_HOOKS int -owner_mtx(struct lock_object *lock, struct thread **owner) +owner_mtx(const struct lock_object *lock, struct thread **owner) { - struct mtx *m = (struct mtx *)lock; + const struct mtx *m = (const struct mtx *)lock; *owner = mtx_owner(m); return (mtx_unowned(m) == 0); @@ -693,7 +694,7 @@ _mtx_unlock_sleep(struct mtx *m, int opt */ #ifdef INVARIANT_SUPPORT void -_mtx_assert(struct mtx *m, int what, const char *file, int line) +_mtx_assert(const struct mtx *m, int what, const char *file, int line) { if (panicstr != NULL || dumping) @@ -871,12 +872,12 @@ mutex_init(void) #ifdef DDB void -db_show_mtx(struct lock_object *lock) +db_show_mtx(const struct lock_object *lock) { struct thread *td; - struct mtx *m; + const struct mtx *m; - m = (struct mtx *)lock; + m = (const struct mtx *)lock; db_printf(" flags: {"); if (LOCK_CLASS(lock) == &lock_class_mtx_spin) Modified: head/sys/kern/kern_rmlock.c ============================================================================== --- head/sys/kern/kern_rmlock.c Wed Nov 16 21:37:45 2011 (r227587) +++ head/sys/kern/kern_rmlock.c Wed Nov 16 21:51:17 2011 (r227588) @@ -69,10 +69,10 @@ static __inline void compiler_memory_bar __asm __volatile("":::"memory"); } -static void assert_rm(struct lock_object *lock, int what); +static void assert_rm(const struct lock_object *lock, int what); static void lock_rm(struct lock_object *lock, int how); #ifdef KDTRACE_HOOKS -static int owner_rm(struct lock_object *lock, struct thread **owner); +static int owner_rm(const struct lock_object *lock, struct thread **owner); #endif static int unlock_rm(struct lock_object *lock); @@ -93,7 +93,7 @@ struct lock_class lock_class_rm = { }; static void -assert_rm(struct lock_object *lock, int what) +assert_rm(const struct lock_object *lock, int what) { panic("assert_rm called"); @@ -115,7 +115,7 @@ unlock_rm(struct lock_object *lock) #ifdef KDTRACE_HOOKS static int -owner_rm(struct lock_object *lock, struct thread **owner) +owner_rm(const struct lock_object *lock, struct thread **owner) { panic("owner_rm called"); @@ -227,7 +227,7 @@ rm_destroy(struct rmlock *rm) } int -rm_wowned(struct rmlock *rm) +rm_wowned(const struct rmlock *rm) { if (rm->lock_object.lo_flags & RM_SLEEPABLE) Modified: head/sys/kern/kern_rwlock.c ============================================================================== --- head/sys/kern/kern_rwlock.c Wed Nov 16 21:37:45 2011 (r227587) +++ head/sys/kern/kern_rwlock.c Wed Nov 16 21:51:17 2011 (r227588) @@ -67,12 +67,12 @@ SYSCTL_INT(_debug_rwlock, OID_AUTO, loop #ifdef DDB #include -static void db_show_rwlock(struct lock_object *lock); +static void db_show_rwlock(const struct lock_object *lock); #endif -static void assert_rw(struct lock_object *lock, int what); +static void assert_rw(const struct lock_object *lock, int what); static void lock_rw(struct lock_object *lock, int how); #ifdef KDTRACE_HOOKS -static int owner_rw(struct lock_object *lock, struct thread **owner); +static int owner_rw(const struct lock_object *lock, struct thread **owner); #endif static int unlock_rw(struct lock_object *lock); @@ -121,10 +121,10 @@ struct lock_class lock_class_rw = { #endif void -assert_rw(struct lock_object *lock, int what) +assert_rw(const struct lock_object *lock, int what) { - rw_assert((struct rwlock *)lock, what); + rw_assert((const struct rwlock *)lock, what); } void @@ -157,9 +157,9 @@ unlock_rw(struct lock_object *lock) #ifdef KDTRACE_HOOKS int -owner_rw(struct lock_object *lock, struct thread **owner) +owner_rw(const struct lock_object *lock, struct thread **owner) { - struct rwlock *rw = (struct rwlock *)lock; + const struct rwlock *rw = (const struct rwlock *)lock; uintptr_t x = rw->rw_lock; *owner = rw_wowner(rw); @@ -223,7 +223,7 @@ rw_sysinit_flags(void *arg) } int -rw_wowned(struct rwlock *rw) +rw_wowned(const struct rwlock *rw) { return (rw_wowner(rw) == curthread); @@ -1011,7 +1011,7 @@ out: * thread owns an rlock. */ void -_rw_assert(struct rwlock *rw, int what, const char *file, int line) +_rw_assert(const struct rwlock *rw, int what, const char *file, int line) { if (panicstr != NULL) @@ -1084,12 +1084,12 @@ _rw_assert(struct rwlock *rw, int what, #ifdef DDB void -db_show_rwlock(struct lock_object *lock) +db_show_rwlock(const struct lock_object *lock) { - struct rwlock *rw; + const struct rwlock *rw; struct thread *td; - rw = (struct rwlock *)lock; + rw = (const struct rwlock *)lock; db_printf(" state: "); if (rw->rw_lock == RW_UNLOCKED) Modified: head/sys/kern/kern_sx.c ============================================================================== --- head/sys/kern/kern_sx.c Wed Nov 16 21:37:45 2011 (r227587) +++ head/sys/kern/kern_sx.c Wed Nov 16 21:51:17 2011 (r227588) @@ -105,13 +105,13 @@ CTASSERT((SX_NOADAPTIVE & LO_CLASSFLAGS) #define sx_recurse lock_object.lo_data #define sx_recursed(sx) ((sx)->sx_recurse != 0) -static void assert_sx(struct lock_object *lock, int what); +static void assert_sx(const struct lock_object *lock, int what); #ifdef DDB -static void db_show_sx(struct lock_object *lock); +static void db_show_sx(const struct lock_object *lock); #endif static void lock_sx(struct lock_object *lock, int how); #ifdef KDTRACE_HOOKS -static int owner_sx(struct lock_object *lock, struct thread **owner); +static int owner_sx(const struct lock_object *lock, struct thread **owner); #endif static int unlock_sx(struct lock_object *lock); @@ -142,10 +142,10 @@ SYSCTL_UINT(_debug_sx, OID_AUTO, loops, #endif void -assert_sx(struct lock_object *lock, int what) +assert_sx(const struct lock_object *lock, int what) { - sx_assert((struct sx *)lock, what); + sx_assert((const struct sx *)lock, what); } void @@ -178,9 +178,9 @@ unlock_sx(struct lock_object *lock) #ifdef KDTRACE_HOOKS int -owner_sx(struct lock_object *lock, struct thread **owner) +owner_sx(const struct lock_object *lock, struct thread **owner) { - struct sx *sx = (struct sx *)lock; + const struct sx *sx = (const struct sx *)lock; uintptr_t x = sx->sx_lock; *owner = (struct thread *)SX_OWNER(x); @@ -1005,7 +1005,7 @@ _sx_sunlock_hard(struct sx *sx, const ch * thread owns an slock. */ void -_sx_assert(struct sx *sx, int what, const char *file, int line) +_sx_assert(const struct sx *sx, int what, const char *file, int line) { #ifndef WITNESS int slocked = 0; @@ -1088,12 +1088,12 @@ _sx_assert(struct sx *sx, int what, cons #ifdef DDB static void -db_show_sx(struct lock_object *lock) +db_show_sx(const struct lock_object *lock) { struct thread *td; - struct sx *sx; + const struct sx *sx; - sx = (struct sx *)lock; + sx = (const struct sx *)lock; db_printf(" state: "); if (sx->sx_lock == SX_LOCK_UNLOCKED) Modified: head/sys/kern/subr_witness.c ============================================================================== --- head/sys/kern/subr_witness.c Wed Nov 16 21:37:45 2011 (r227587) +++ head/sys/kern/subr_witness.c Wed Nov 16 21:51:17 2011 (r227588) @@ -332,7 +332,7 @@ static void depart(struct witness *w); static struct witness *enroll(const char *description, struct lock_class *lock_class); static struct lock_instance *find_instance(struct lock_list_entry *list, - struct lock_object *lock); + const struct lock_object *lock); static int isitmychild(struct witness *parent, struct witness *child); static int isitmydescendant(struct witness *parent, struct witness *child); static void itismychild(struct witness *parent, struct witness *child); @@ -2063,7 +2063,7 @@ witness_lock_list_free(struct lock_list_ } static struct lock_instance * -find_instance(struct lock_list_entry *list, struct lock_object *lock) +find_instance(struct lock_list_entry *list, const struct lock_object *lock) { struct lock_list_entry *lle; struct lock_instance *instance; @@ -2210,7 +2210,8 @@ witness_restore(struct lock_object *lock } void -witness_assert(struct lock_object *lock, int flags, const char *file, int line) +witness_assert(const struct lock_object *lock, int flags, const char *file, + int line) { #ifdef INVARIANT_SUPPORT struct lock_instance *instance; Modified: head/sys/sys/lock.h ============================================================================== --- head/sys/sys/lock.h Wed Nov 16 21:37:45 2011 (r227587) +++ head/sys/sys/lock.h Wed Nov 16 21:51:17 2011 (r227588) @@ -58,10 +58,10 @@ struct thread; struct lock_class { const char *lc_name; u_int lc_flags; - void (*lc_assert)(struct lock_object *lock, int what); - void (*lc_ddb_show)(struct lock_object *lock); + void (*lc_assert)(const struct lock_object *lock, int what); + void (*lc_ddb_show)(const struct lock_object *lock); void (*lc_lock)(struct lock_object *lock, int how); - int (*lc_owner)(struct lock_object *lock, struct thread **owner); + int (*lc_owner)(const struct lock_object *lock, struct thread **owner); int (*lc_unlock)(struct lock_object *lock); }; @@ -215,7 +215,7 @@ void witness_restore(struct lock_object int witness_list_locks(struct lock_list_entry **, int (*)(const char *, ...)); int witness_warn(int, struct lock_object *, const char *, ...); -void witness_assert(struct lock_object *, int, const char *, int); +void witness_assert(const struct lock_object *, int, const char *, int); void witness_display_spinlock(struct lock_object *, struct thread *, int (*)(const char *, ...)); int witness_line(struct lock_object *); Modified: head/sys/sys/lockmgr.h ============================================================================== --- head/sys/sys/lockmgr.h Wed Nov 16 21:37:45 2011 (r227587) +++ head/sys/sys/lockmgr.h Wed Nov 16 21:51:17 2011 (r227588) @@ -69,7 +69,7 @@ struct thread; int __lockmgr_args(struct lock *lk, u_int flags, struct lock_object *ilk, const char *wmesg, int prio, int timo, const char *file, int line); #if defined(INVARIANTS) || defined(INVARIANT_SUPPORT) -void _lockmgr_assert(struct lock *lk, int what, const char *file, int line); +void _lockmgr_assert(const struct lock *lk, int what, const char *file, int line); #endif void _lockmgr_disown(struct lock *lk, const char *file, int line); @@ -82,8 +82,8 @@ void lockinit(struct lock *lk, int prio #ifdef DDB int lockmgr_chain(struct thread *td, struct thread **ownerp); #endif -void lockmgr_printinfo(struct lock *lk); -int lockstatus(struct lock *lk); +void lockmgr_printinfo(const struct lock *lk); +int lockstatus(const struct lock *lk); /* * As far as the ilk can be a static NULL pointer these functions need a Modified: head/sys/sys/mutex.h ============================================================================== --- head/sys/sys/mutex.h Wed Nov 16 21:37:45 2011 (r227587) +++ head/sys/sys/mutex.h Wed Nov 16 21:51:17 2011 (r227588) @@ -105,7 +105,7 @@ void _mtx_lock_spin_flags(struct mtx *m, void _mtx_unlock_spin_flags(struct mtx *m, int opts, const char *file, int line); #if defined(INVARIANTS) || defined(INVARIANT_SUPPORT) -void _mtx_assert(struct mtx *m, int what, const char *file, int line); +void _mtx_assert(const struct mtx *m, int what, const char *file, int line); #endif void _thread_lock_flags(struct thread *, int, const char *, int); Modified: head/sys/sys/rmlock.h ============================================================================== --- head/sys/sys/rmlock.h Wed Nov 16 21:37:45 2011 (r227587) +++ head/sys/sys/rmlock.h Wed Nov 16 21:51:17 2011 (r227588) @@ -49,7 +49,7 @@ void rm_init(struct rmlock *rm, const char *name); void rm_init_flags(struct rmlock *rm, const char *name, int opts); void rm_destroy(struct rmlock *rm); -int rm_wowned(struct rmlock *rm); +int rm_wowned(const struct rmlock *rm); void rm_sysinit(void *arg); void rm_sysinit_flags(void *arg); Modified: head/sys/sys/rwlock.h ============================================================================== --- head/sys/sys/rwlock.h Wed Nov 16 21:37:45 2011 (r227587) +++ head/sys/sys/rwlock.h Wed Nov 16 21:51:17 2011 (r227588) @@ -127,7 +127,7 @@ void rw_init_flags(struct rwlock *rw, co void rw_destroy(struct rwlock *rw); void rw_sysinit(void *arg); void rw_sysinit_flags(void *arg); -int rw_wowned(struct rwlock *rw); +int rw_wowned(const struct rwlock *rw); void _rw_wlock(struct rwlock *rw, const char *file, int line); int _rw_try_wlock(struct rwlock *rw, const char *file, int line); void _rw_wunlock(struct rwlock *rw, const char *file, int line); @@ -141,7 +141,7 @@ void _rw_wunlock_hard(struct rwlock *rw, int _rw_try_upgrade(struct rwlock *rw, const char *file, int line); void _rw_downgrade(struct rwlock *rw, const char *file, int line); #if defined(INVARIANTS) || defined(INVARIANT_SUPPORT) -void _rw_assert(struct rwlock *rw, int what, const char *file, int line); +void _rw_assert(const struct rwlock *rw, int what, const char *file, int line); #endif /* Modified: head/sys/sys/sx.h ============================================================================== --- head/sys/sys/sx.h Wed Nov 16 21:37:45 2011 (r227587) +++ head/sys/sys/sx.h Wed Nov 16 21:51:17 2011 (r227588) @@ -109,7 +109,7 @@ void _sx_xunlock_hard(struct sx *sx, uin line); void _sx_sunlock_hard(struct sx *sx, const char *file, int line); #if defined(INVARIANTS) || defined(INVARIANT_SUPPORT) -void _sx_assert(struct sx *sx, int what, const char *file, int line); +void _sx_assert(const struct sx *sx, int what, const char *file, int line); #endif #ifdef DDB int sx_chain(struct thread *td, struct thread **ownerp); From owner-svn-src-all@FreeBSD.ORG Wed Nov 16 22:03:00 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A68A106564A; Wed, 16 Nov 2011 22:03:00 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3A62A8FC12; Wed, 16 Nov 2011 22:03:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAGM30vR068572; Wed, 16 Nov 2011 22:03:00 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAGM30SA068570; Wed, 16 Nov 2011 22:03:00 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201111162203.pAGM30SA068570@svn.freebsd.org> From: Warner Losh Date: Wed, 16 Nov 2011 22:03:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227589 - head/usr.bin/comm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2011 22:03:00 -0000 Author: imp Date: Wed Nov 16 22:02:59 2011 New Revision: 227589 URL: http://svn.freebsd.org/changeset/base/227589 Log: Add helpful clarification text. While not strictly necessary, these few words make this man page much easier to understand without re-reading prior parts of the man page. Modified: head/usr.bin/comm/comm.1 Modified: head/usr.bin/comm/comm.1 ============================================================================== --- head/usr.bin/comm/comm.1 Wed Nov 16 21:51:17 2011 (r227588) +++ head/usr.bin/comm/comm.1 Wed Nov 16 22:02:59 2011 (r227589) @@ -61,11 +61,13 @@ The filename ``-'' means the standard in The following options are available: .Bl -tag -width indent .It Fl 1 -Suppress printing of column 1. +Suppress printing of column 1, lines only in +.Ar file1 . .It Fl 2 -Suppress printing of column 2. +Suppress printing of column 2, lines only in +.Ar file2 . .It Fl 3 -Suppress printing of column 3. +Suppress printing of column 3, lines common to both. .It Fl i Case insensitive comparison of lines. .El From owner-svn-src-all@FreeBSD.ORG Wed Nov 16 22:05:39 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 14D0C106564A; Wed, 16 Nov 2011 22:05:39 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 047918FC13; Wed, 16 Nov 2011 22:05:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAGM5cMe068690; Wed, 16 Nov 2011 22:05:38 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAGM5c2P068687; Wed, 16 Nov 2011 22:05:38 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201111162205.pAGM5c2P068687@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 16 Nov 2011 22:05:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227590 - in head/sys: dev/re pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2011 22:05:39 -0000 Author: yongari Date: Wed Nov 16 22:05:38 2011 New Revision: 227590 URL: http://svn.freebsd.org/changeset/base/227590 Log: Add preliminary support for RTL8411 PCIe Gigabit ethernet with integrated card reader. H/W donated by: RealTek Semiconductor Corp. Modified: head/sys/dev/re/if_re.c head/sys/pci/if_rlreg.h Modified: head/sys/dev/re/if_re.c ============================================================================== --- head/sys/dev/re/if_re.c Wed Nov 16 22:02:59 2011 (r227589) +++ head/sys/dev/re/if_re.c Wed Nov 16 22:05:38 2011 (r227590) @@ -231,6 +231,7 @@ static const struct rl_hwrev const re_hw { RL_HWREV_8168DP, RL_8169, "8168DP/8111DP", RL_JUMBO_MTU_9K }, { RL_HWREV_8168E, RL_8169, "8168E/8111E", RL_JUMBO_MTU_9K}, { RL_HWREV_8168E_VL, RL_8169, "8168E/8111E-VL", RL_JUMBO_MTU_6K}, + { RL_HWREV_8411, RL_8169, "8411", RL_JUMBO_MTU_9K}, { 0, 0, NULL, 0 } }; @@ -1415,6 +1416,7 @@ re_attach(device_t dev) RL_FLAG_CMDSTOP | RL_FLAG_AUTOPAD | RL_FLAG_JUMBOV2; break; case RL_HWREV_8168E_VL: + case RL_HWREV_8411: sc->rl_flags |= RL_FLAG_PHYWAKE | RL_FLAG_PAR | RL_FLAG_DESCV2 | RL_FLAG_MACSTAT | RL_FLAG_CMDSTOP | RL_FLAG_AUTOPAD | RL_FLAG_JUMBOV2; Modified: head/sys/pci/if_rlreg.h ============================================================================== --- head/sys/pci/if_rlreg.h Wed Nov 16 22:02:59 2011 (r227589) +++ head/sys/pci/if_rlreg.h Wed Nov 16 22:05:38 2011 (r227590) @@ -179,6 +179,7 @@ #define RL_HWREV_8168CP 0x3C800000 #define RL_HWREV_8105E 0x40800000 #define RL_HWREV_8402 0x44000000 +#define RL_HWREV_8411 0x48800000 #define RL_HWREV_8139 0x60000000 #define RL_HWREV_8139A 0x70000000 #define RL_HWREV_8139AG 0x70800000 From owner-svn-src-all@FreeBSD.ORG Wed Nov 16 22:09:15 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 27806106564A; Wed, 16 Nov 2011 22:09:15 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 174528FC0C; Wed, 16 Nov 2011 22:09:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAGM9Ekq068830; Wed, 16 Nov 2011 22:09:14 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAGM9E59068828; Wed, 16 Nov 2011 22:09:14 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201111162209.pAGM9E59068828@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 16 Nov 2011 22:09:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227591 - head/sys/dev/re X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2011 22:09:15 -0000 Author: yongari Date: Wed Nov 16 22:09:14 2011 New Revision: 227591 URL: http://svn.freebsd.org/changeset/base/227591 Log: Add missing driver lock in SIOCSIFCAP handler. Modified: head/sys/dev/re/if_re.c Modified: head/sys/dev/re/if_re.c ============================================================================== --- head/sys/dev/re/if_re.c Wed Nov 16 22:05:38 2011 (r227590) +++ head/sys/dev/re/if_re.c Wed Nov 16 22:09:14 2011 (r227591) @@ -3312,6 +3312,7 @@ re_ioctl(struct ifnet *ifp, u_long comma } } #endif /* DEVICE_POLLING */ + RL_LOCK(sc); if ((mask & IFCAP_TXCSUM) != 0 && (ifp->if_capabilities & IFCAP_TXCSUM) != 0) { ifp->if_capenable ^= IFCAP_TXCSUM; @@ -3370,8 +3371,9 @@ re_ioctl(struct ifnet *ifp, u_long comma } if (reinit && ifp->if_drv_flags & IFF_DRV_RUNNING) { ifp->if_drv_flags &= ~IFF_DRV_RUNNING; - re_init(sc); + re_init_locked(sc); } + RL_UNLOCK(sc); VLAN_CAPABILITIES(ifp); } break; From owner-svn-src-all@FreeBSD.ORG Wed Nov 16 22:12:12 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 137AE106564A; Wed, 16 Nov 2011 22:12:12 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id 7A37C8FC0A; Wed, 16 Nov 2011 22:12:11 +0000 (UTC) Received: by iakl21 with SMTP id l21so1795198iak.13 for ; Wed, 16 Nov 2011 14:12:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=b6K+vuoXEGXlVe0/1vdpI0GUm6dbKgpaHcXrh0YAAgE=; b=He91zrUvpgA6nsoRaHuUeObFf9zaXdc4MGKqrwbOx+pfNuWWdASUHyPeKbX7PuGR4B KHadi+AOodZE9esyrwU19xp92400Zh6wgz5z0ozlq50AgiRfvhZb4teL13Ru8eRMsilX 5TOK5xM8WmaiKf1Ci7WBtLCA+qeolGBX9kqUE= MIME-Version: 1.0 Received: by 10.231.20.218 with SMTP id g26mr8103914ibb.88.1321481530986; Wed, 16 Nov 2011 14:12:10 -0800 (PST) Sender: mdf356@gmail.com Received: by 10.68.56.97 with HTTP; Wed, 16 Nov 2011 14:12:10 -0800 (PST) In-Reply-To: <201111162151.pAGLpHIr068140@svn.freebsd.org> References: <201111162151.pAGLpHIr068140@svn.freebsd.org> Date: Wed, 16 Nov 2011 14:12:10 -0800 X-Google-Sender-Auth: skuw-cRMQhCym2JS6VfL0I7x_y0 Message-ID: From: mdf@FreeBSD.org To: Pawel Jakub Dawidek Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r227588 - in head: share/man/man9 sys/kern sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2011 22:12:12 -0000 On Wed, Nov 16, 2011 at 1:51 PM, Pawel Jakub Dawidek wrot= e: > Author: pjd > Date: Wed Nov 16 21:51:17 2011 > New Revision: 227588 > URL: http://svn.freebsd.org/changeset/base/227588 > > Log: > =A0Constify arguments for locking KPIs where possible. > > =A0This enables locking consumers to pass their own structures around as = const and > =A0be able to assert locks embedded into those structures. Thank you! This is one of many (minor) diffs I have at $WORK. Cheers, matthew From owner-svn-src-all@FreeBSD.ORG Wed Nov 16 23:29:28 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 164181065670; Wed, 16 Nov 2011 23:29:28 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E07428FC08; Wed, 16 Nov 2011 23:29:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAGNTRfw071492; Wed, 16 Nov 2011 23:29:27 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAGNTRK4071489; Wed, 16 Nov 2011 23:29:27 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201111162329.pAGNTRK4071489@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 16 Nov 2011 23:29:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227593 - in head/sys: dev/re pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2011 23:29:28 -0000 Author: yongari Date: Wed Nov 16 23:29:27 2011 New Revision: 227593 URL: http://svn.freebsd.org/changeset/base/227593 Log: Disable PCIe ASPM (Active State Power Management) for all controllers. More and more RealTek controllers started to implement EEE feature. Vendor driver seems to load a kind of firmware for EEE with additional PHY fixups. It is known that the EEE feature may need ASPM support. Unfortunately there is no documentation for EEE of the controller so enabling ASPM may cause more problems. Modified: head/sys/dev/re/if_re.c head/sys/pci/if_rlreg.h Modified: head/sys/dev/re/if_re.c ============================================================================== --- head/sys/dev/re/if_re.c Wed Nov 16 22:14:13 2011 (r227592) +++ head/sys/dev/re/if_re.c Wed Nov 16 23:29:27 2011 (r227593) @@ -1186,6 +1186,7 @@ re_attach(device_t dev) struct rl_softc *sc; struct ifnet *ifp; const struct rl_hwrev *hw_rev; + u_int32_t cap, ctl; int hwrev; u_int16_t devid, re_did = 0; int error = 0, i, phy, rid; @@ -1241,8 +1242,10 @@ re_attach(device_t dev) msic = pci_msi_count(dev); msixc = pci_msix_count(dev); - if (pci_find_cap(dev, PCIY_EXPRESS, ®) == 0) + if (pci_find_cap(dev, PCIY_EXPRESS, ®) == 0) { sc->rl_flags |= RL_FLAG_PCIE; + sc->rl_expcap = reg; + } if (bootverbose) { device_printf(dev, "MSI count : %d\n", msic); device_printf(dev, "MSI-X count : %d\n", msixc); @@ -1334,6 +1337,23 @@ re_attach(device_t dev) CSR_WRITE_1(sc, RL_EECMD, RL_EEMODE_OFF); } + /* Disable ASPM L0S/L1. */ + if (sc->rl_expcap != 0) { + cap = pci_read_config(dev, sc->rl_expcap + + PCIR_EXPRESS_LINK_CAP, 2); + if ((cap & PCIM_LINK_CAP_ASPM) != 0) { + ctl = pci_read_config(dev, sc->rl_expcap + + PCIR_EXPRESS_LINK_CTL, 2); + if ((ctl & 0x0003) != 0) { + ctl &= ~0x0003; + pci_write_config(dev, sc->rl_expcap + + PCIR_EXPRESS_LINK_CTL, ctl, 2); + device_printf(dev, "ASPM disabled\n"); + } + } else + device_printf(dev, "no ASPM capability\n"); + } + hw_rev = re_hwrevs; hwrev = CSR_READ_4(sc, RL_TXCFG); switch (hwrev & 0x70000000) { Modified: head/sys/pci/if_rlreg.h ============================================================================== --- head/sys/pci/if_rlreg.h Wed Nov 16 22:14:13 2011 (r227592) +++ head/sys/pci/if_rlreg.h Wed Nov 16 23:29:27 2011 (r227593) @@ -868,6 +868,7 @@ struct rl_softc { const struct rl_hwrev *rl_hwrev; int rl_eecmd_read; int rl_eewidth; + int rl_expcap; int rl_txthresh; struct rl_chain_data rl_cdata; struct rl_list_data rl_ldata; From owner-svn-src-all@FreeBSD.ORG Thu Nov 17 00:16:16 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA5AE106566C; Thu, 17 Nov 2011 00:16:15 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D020F8FC0C; Thu, 17 Nov 2011 00:16:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAH0GFhQ072955; Thu, 17 Nov 2011 00:16:15 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAH0GFIM072950; Thu, 17 Nov 2011 00:16:15 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201111170016.pAH0GFIM072950@svn.freebsd.org> From: Doug Barton Date: Thu, 17 Nov 2011 00:16:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227594 - in vendor/bind9/dist: . bin/named lib/dns X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2011 00:16:16 -0000 Author: dougb Date: Thu Nov 17 00:16:15 2011 New Revision: 227594 URL: http://svn.freebsd.org/changeset/base/227594 Log: Vendor import of BIND 9.8.1-P1 Modified: vendor/bind9/dist/CHANGES vendor/bind9/dist/bin/named/query.c vendor/bind9/dist/lib/dns/rbtdb.c vendor/bind9/dist/version Modified: vendor/bind9/dist/CHANGES ============================================================================== --- vendor/bind9/dist/CHANGES Wed Nov 16 23:29:27 2011 (r227593) +++ vendor/bind9/dist/CHANGES Thu Nov 17 00:16:15 2011 (r227594) @@ -1,3 +1,9 @@ + --- 9.8.1-P1 released --- + +3218. [security] Cache lookup could return RRSIG data associated with + nonexistent records, leading to an assertion + failure. [RT #26590] + --- 9.8.1 released --- --- 9.8.1rc1 released --- Modified: vendor/bind9/dist/bin/named/query.c ============================================================================== --- vendor/bind9/dist/bin/named/query.c Wed Nov 16 23:29:27 2011 (r227593) +++ vendor/bind9/dist/bin/named/query.c Thu Nov 17 00:16:15 2011 (r227594) @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: query.c,v 1.353.8.11 2011-06-09 03:14:03 marka Exp $ */ +/* $Id: query.c,v 1.353.8.11.4.1 2011-11-16 09:32:08 marka Exp $ */ /*! \file */ @@ -1393,11 +1393,9 @@ query_addadditional(void *arg, dns_name_ goto addname; if (result == DNS_R_NCACHENXRRSET) { dns_rdataset_disassociate(rdataset); - /* - * Negative cache entries don't have sigrdatasets. - */ - INSIST(sigrdataset == NULL || - ! dns_rdataset_isassociated(sigrdataset)); + if (sigrdataset != NULL && + dns_rdataset_isassociated(sigrdataset)) + dns_rdataset_disassociate(sigrdataset); } if (result == ISC_R_SUCCESS) { mname = NULL; @@ -1438,8 +1436,9 @@ query_addadditional(void *arg, dns_name_ goto addname; if (result == DNS_R_NCACHENXRRSET) { dns_rdataset_disassociate(rdataset); - INSIST(sigrdataset == NULL || - ! dns_rdataset_isassociated(sigrdataset)); + if (sigrdataset != NULL && + dns_rdataset_isassociated(sigrdataset)) + dns_rdataset_disassociate(sigrdataset); } if (result == ISC_R_SUCCESS) { mname = NULL; @@ -1889,10 +1888,8 @@ query_addadditional2(void *arg, dns_name goto setcache; if (result == DNS_R_NCACHENXRRSET) { dns_rdataset_disassociate(rdataset); - /* - * Negative cache entries don't have sigrdatasets. - */ - INSIST(! dns_rdataset_isassociated(sigrdataset)); + if (dns_rdataset_isassociated(sigrdataset)) + dns_rdataset_disassociate(sigrdataset); } if (result == ISC_R_SUCCESS) { /* Remember the result as a cache */ Modified: vendor/bind9/dist/lib/dns/rbtdb.c ============================================================================== --- vendor/bind9/dist/lib/dns/rbtdb.c Wed Nov 16 23:29:27 2011 (r227593) +++ vendor/bind9/dist/lib/dns/rbtdb.c Thu Nov 17 00:16:15 2011 (r227594) @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: rbtdb.c,v 1.310.8.5 2011-06-08 23:02:42 each Exp $ */ +/* $Id: rbtdb.c,v 1.310.8.5.4.1 2011-11-16 09:32:08 marka Exp $ */ /*! \file */ @@ -5053,7 +5053,7 @@ cache_find(dns_db_t *db, dns_name_t *nam rdataset); if (need_headerupdate(found, search.now)) update = found; - if (foundsig != NULL) { + if (!NEGATIVE(found) && foundsig != NULL) { bind_rdataset(search.rbtdb, node, foundsig, search.now, sigrdataset); if (need_headerupdate(foundsig, search.now)) @@ -5685,7 +5685,7 @@ cache_findrdataset(dns_db_t *db, dns_dbn } if (found != NULL) { bind_rdataset(rbtdb, rbtnode, found, now, rdataset); - if (foundsig != NULL) + if (!NEGATIVE(found) && foundsig != NULL) bind_rdataset(rbtdb, rbtnode, foundsig, now, sigrdataset); } Modified: vendor/bind9/dist/version ============================================================================== --- vendor/bind9/dist/version Wed Nov 16 23:29:27 2011 (r227593) +++ vendor/bind9/dist/version Thu Nov 17 00:16:15 2011 (r227594) @@ -1,4 +1,4 @@ -# $Id: version,v 1.53.8.9 2011-08-24 02:08:26 marka Exp $ +# $Id: version,v 1.53.8.9.6.1 2011-11-16 09:32:07 marka Exp $ # # This file must follow /bin/sh rules. It is imported directly via # configure. @@ -6,5 +6,5 @@ MAJORVER=9 MINORVER=8 PATCHVER=1 -RELEASETYPE= -RELEASEVER= +RELEASETYPE=-P +RELEASEVER=1 From owner-svn-src-all@FreeBSD.ORG Thu Nov 17 00:16:45 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 38244106564A; Thu, 17 Nov 2011 00:16:45 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0EE4D8FC14; Thu, 17 Nov 2011 00:16:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAH0Gi5u073002; Thu, 17 Nov 2011 00:16:44 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAH0Gi8T073001; Thu, 17 Nov 2011 00:16:44 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201111170016.pAH0Gi8T073001@svn.freebsd.org> From: Doug Barton Date: Thu, 17 Nov 2011 00:16:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227595 - vendor/bind9/9.8.1-P1 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2011 00:16:45 -0000 Author: dougb Date: Thu Nov 17 00:16:44 2011 New Revision: 227595 URL: http://svn.freebsd.org/changeset/base/227595 Log: Tag the 9.8.1-P1 release Added: vendor/bind9/9.8.1-P1/ - copied from r227594, vendor/bind9/dist/ From owner-svn-src-all@FreeBSD.ORG Thu Nov 17 00:25:36 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1C3501065674; Thu, 17 Nov 2011 00:25:36 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0B6328FC16; Thu, 17 Nov 2011 00:25:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAH0PZe5073381; Thu, 17 Nov 2011 00:25:35 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAH0PZBD073376; Thu, 17 Nov 2011 00:25:35 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201111170025.pAH0PZBD073376@svn.freebsd.org> From: Doug Barton Date: Thu, 17 Nov 2011 00:25:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227596 - in head/contrib/bind9: . bin/named lib/dns X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2011 00:25:36 -0000 Author: dougb Date: Thu Nov 17 00:25:35 2011 New Revision: 227596 URL: http://svn.freebsd.org/changeset/base/227596 Log: Upgrade to BIND 9.8.1-P1 to address the following DDOS bug: Recursive name servers are failing with an assertion: INSIST(! dns_rdataset_isassociated(sigrdataset)) At this time it is not thought that authoritative-only servers are affected, but information about this bug is evolving rapidly. Because it may be possible to trigger this bug even on networks that do not allow untrusted users to access the recursive name servers (perhaps via specially crafted e-mail messages, and/or malicious web sites) it is recommended that ALL operators of recursive name servers upgrade immediately. For more information see: https://www.isc.org/software/bind/advisories/cve-2011-tbd which will be updated as more information becomes available. https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-4313 Modified: head/contrib/bind9/CHANGES head/contrib/bind9/bin/named/query.c head/contrib/bind9/lib/dns/rbtdb.c head/contrib/bind9/version Directory Properties: head/contrib/bind9/ (props changed) Modified: head/contrib/bind9/CHANGES ============================================================================== --- head/contrib/bind9/CHANGES Thu Nov 17 00:16:44 2011 (r227595) +++ head/contrib/bind9/CHANGES Thu Nov 17 00:25:35 2011 (r227596) @@ -1,3 +1,9 @@ + --- 9.8.1-P1 released --- + +3218. [security] Cache lookup could return RRSIG data associated with + nonexistent records, leading to an assertion + failure. [RT #26590] + --- 9.8.1 released --- --- 9.8.1rc1 released --- Modified: head/contrib/bind9/bin/named/query.c ============================================================================== --- head/contrib/bind9/bin/named/query.c Thu Nov 17 00:16:44 2011 (r227595) +++ head/contrib/bind9/bin/named/query.c Thu Nov 17 00:25:35 2011 (r227596) @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: query.c,v 1.353.8.11 2011-06-09 03:14:03 marka Exp $ */ +/* $Id: query.c,v 1.353.8.11.4.1 2011-11-16 09:32:08 marka Exp $ */ /*! \file */ @@ -1393,11 +1393,9 @@ query_addadditional(void *arg, dns_name_ goto addname; if (result == DNS_R_NCACHENXRRSET) { dns_rdataset_disassociate(rdataset); - /* - * Negative cache entries don't have sigrdatasets. - */ - INSIST(sigrdataset == NULL || - ! dns_rdataset_isassociated(sigrdataset)); + if (sigrdataset != NULL && + dns_rdataset_isassociated(sigrdataset)) + dns_rdataset_disassociate(sigrdataset); } if (result == ISC_R_SUCCESS) { mname = NULL; @@ -1438,8 +1436,9 @@ query_addadditional(void *arg, dns_name_ goto addname; if (result == DNS_R_NCACHENXRRSET) { dns_rdataset_disassociate(rdataset); - INSIST(sigrdataset == NULL || - ! dns_rdataset_isassociated(sigrdataset)); + if (sigrdataset != NULL && + dns_rdataset_isassociated(sigrdataset)) + dns_rdataset_disassociate(sigrdataset); } if (result == ISC_R_SUCCESS) { mname = NULL; @@ -1889,10 +1888,8 @@ query_addadditional2(void *arg, dns_name goto setcache; if (result == DNS_R_NCACHENXRRSET) { dns_rdataset_disassociate(rdataset); - /* - * Negative cache entries don't have sigrdatasets. - */ - INSIST(! dns_rdataset_isassociated(sigrdataset)); + if (dns_rdataset_isassociated(sigrdataset)) + dns_rdataset_disassociate(sigrdataset); } if (result == ISC_R_SUCCESS) { /* Remember the result as a cache */ Modified: head/contrib/bind9/lib/dns/rbtdb.c ============================================================================== --- head/contrib/bind9/lib/dns/rbtdb.c Thu Nov 17 00:16:44 2011 (r227595) +++ head/contrib/bind9/lib/dns/rbtdb.c Thu Nov 17 00:25:35 2011 (r227596) @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: rbtdb.c,v 1.310.8.5 2011-06-08 23:02:42 each Exp $ */ +/* $Id: rbtdb.c,v 1.310.8.5.4.1 2011-11-16 09:32:08 marka Exp $ */ /*! \file */ @@ -5053,7 +5053,7 @@ cache_find(dns_db_t *db, dns_name_t *nam rdataset); if (need_headerupdate(found, search.now)) update = found; - if (foundsig != NULL) { + if (!NEGATIVE(found) && foundsig != NULL) { bind_rdataset(search.rbtdb, node, foundsig, search.now, sigrdataset); if (need_headerupdate(foundsig, search.now)) @@ -5685,7 +5685,7 @@ cache_findrdataset(dns_db_t *db, dns_dbn } if (found != NULL) { bind_rdataset(rbtdb, rbtnode, found, now, rdataset); - if (foundsig != NULL) + if (!NEGATIVE(found) && foundsig != NULL) bind_rdataset(rbtdb, rbtnode, foundsig, now, sigrdataset); } Modified: head/contrib/bind9/version ============================================================================== --- head/contrib/bind9/version Thu Nov 17 00:16:44 2011 (r227595) +++ head/contrib/bind9/version Thu Nov 17 00:25:35 2011 (r227596) @@ -1,4 +1,4 @@ -# $Id: version,v 1.53.8.9 2011-08-24 02:08:26 marka Exp $ +# $Id: version,v 1.53.8.9.6.1 2011-11-16 09:32:07 marka Exp $ # # This file must follow /bin/sh rules. It is imported directly via # configure. @@ -6,5 +6,5 @@ MAJORVER=9 MINORVER=8 PATCHVER=1 -RELEASETYPE= -RELEASEVER= +RELEASETYPE=-P +RELEASEVER=1 From owner-svn-src-all@FreeBSD.ORG Thu Nov 17 00:33:39 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3550E106566C; Thu, 17 Nov 2011 00:33:39 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1A98B8FC1B; Thu, 17 Nov 2011 00:33:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAH0Xcdm073669; Thu, 17 Nov 2011 00:33:38 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAH0XcRM073664; Thu, 17 Nov 2011 00:33:38 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201111170033.pAH0XcRM073664@svn.freebsd.org> From: Doug Barton Date: Thu, 17 Nov 2011 00:33:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227597 - in vendor/bind9/dist-9.6: . bin/named lib/dns X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2011 00:33:39 -0000 Author: dougb Date: Thu Nov 17 00:33:38 2011 New Revision: 227597 URL: http://svn.freebsd.org/changeset/base/227597 Log: Vendor import of BIND 9.6-ESV-R5-P1 Modified: vendor/bind9/dist-9.6/CHANGES vendor/bind9/dist-9.6/bin/named/query.c vendor/bind9/dist-9.6/lib/dns/rbtdb.c vendor/bind9/dist-9.6/version Modified: vendor/bind9/dist-9.6/CHANGES ============================================================================== --- vendor/bind9/dist-9.6/CHANGES Thu Nov 17 00:25:35 2011 (r227596) +++ vendor/bind9/dist-9.6/CHANGES Thu Nov 17 00:33:38 2011 (r227597) @@ -1,3 +1,9 @@ + --- 9.6-ESV-R5-P1 released --- + +3218. [security] Cache lookup could return RRSIG data associated with + nonexistent records, leading to an assertion + failure. [RT #26590] + --- 9.6-ESV-R5 released --- 3135. [port] FreeBSD: workaround broken IPV6_USE_MIN_MTU processing. Modified: vendor/bind9/dist-9.6/bin/named/query.c ============================================================================== --- vendor/bind9/dist-9.6/bin/named/query.c Thu Nov 17 00:25:35 2011 (r227596) +++ vendor/bind9/dist-9.6/bin/named/query.c Thu Nov 17 00:33:38 2011 (r227597) @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: query.c,v 1.313.20.27 2011-03-19 09:47:54 marka Exp $ */ +/* $Id: query.c,v 1.313.20.27.8.1 2011-11-16 09:11:42 marka Exp $ */ /*! \file */ @@ -1280,11 +1280,9 @@ query_addadditional(void *arg, dns_name_ goto addname; if (result == DNS_R_NCACHENXRRSET) { dns_rdataset_disassociate(rdataset); - /* - * Negative cache entries don't have sigrdatasets. - */ - INSIST(sigrdataset == NULL || - ! dns_rdataset_isassociated(sigrdataset)); + if (sigrdataset != NULL && + dns_rdataset_isassociated(sigrdataset)) + dns_rdataset_disassociate(sigrdataset); } if (result == ISC_R_SUCCESS) { mname = NULL; @@ -1325,8 +1323,9 @@ query_addadditional(void *arg, dns_name_ goto addname; if (result == DNS_R_NCACHENXRRSET) { dns_rdataset_disassociate(rdataset); - INSIST(sigrdataset == NULL || - ! dns_rdataset_isassociated(sigrdataset)); + if (sigrdataset != NULL && + dns_rdataset_isassociated(sigrdataset)) + dns_rdataset_disassociate(sigrdataset); } if (result == ISC_R_SUCCESS) { mname = NULL; @@ -1776,10 +1775,8 @@ query_addadditional2(void *arg, dns_name goto setcache; if (result == DNS_R_NCACHENXRRSET) { dns_rdataset_disassociate(rdataset); - /* - * Negative cache entries don't have sigrdatasets. - */ - INSIST(! dns_rdataset_isassociated(sigrdataset)); + if (dns_rdataset_isassociated(sigrdataset)) + dns_rdataset_disassociate(sigrdataset); } if (result == ISC_R_SUCCESS) { /* Remember the result as a cache */ Modified: vendor/bind9/dist-9.6/lib/dns/rbtdb.c ============================================================================== --- vendor/bind9/dist-9.6/lib/dns/rbtdb.c Thu Nov 17 00:25:35 2011 (r227596) +++ vendor/bind9/dist-9.6/lib/dns/rbtdb.c Thu Nov 17 00:33:38 2011 (r227597) @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: rbtdb.c,v 1.270.12.32 2011-06-09 00:16:35 each Exp $ */ +/* $Id: rbtdb.c,v 1.270.12.32.8.1 2011-11-16 09:11:42 marka Exp $ */ /*! \file */ @@ -4681,7 +4681,7 @@ cache_find(dns_db_t *db, dns_name_t *nam rdataset); if (need_headerupdate(found, search.now)) update = found; - if (foundsig != NULL) { + if (!NEGATIVE(found) && foundsig != NULL) { bind_rdataset(search.rbtdb, node, foundsig, search.now, sigrdataset); if (need_headerupdate(foundsig, search.now)) @@ -5313,7 +5313,7 @@ cache_findrdataset(dns_db_t *db, dns_dbn } if (found != NULL) { bind_rdataset(rbtdb, rbtnode, found, now, rdataset); - if (foundsig != NULL) + if (!NEGATIVE(found) && foundsig != NULL) bind_rdataset(rbtdb, rbtnode, foundsig, now, sigrdataset); } Modified: vendor/bind9/dist-9.6/version ============================================================================== --- vendor/bind9/dist-9.6/version Thu Nov 17 00:25:35 2011 (r227596) +++ vendor/bind9/dist-9.6/version Thu Nov 17 00:33:38 2011 (r227597) @@ -1,4 +1,4 @@ -# $Id: version,v 1.43.12.14 2011-07-21 02:48:13 marka Exp $ +# $Id: version,v 1.43.12.14.10.1 2011-11-16 09:18:28 marka Exp $ # # This file must follow /bin/sh rules. It is imported directly via # configure. @@ -7,4 +7,4 @@ MAJORVER=9 MINORVER=6 PATCHVER= RELEASETYPE=-ESV -RELEASEVER=-R5 +RELEASEVER=-R5-P1 From owner-svn-src-all@FreeBSD.ORG Thu Nov 17 00:34:31 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 81092106566C; Thu, 17 Nov 2011 00:34:31 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 57D5F8FC1A; Thu, 17 Nov 2011 00:34:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAH0YVlA073731; Thu, 17 Nov 2011 00:34:31 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAH0YV4X073730; Thu, 17 Nov 2011 00:34:31 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201111170034.pAH0YV4X073730@svn.freebsd.org> From: Doug Barton Date: Thu, 17 Nov 2011 00:34:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227598 - vendor/bind9/9.6-ESV-R5-P1 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2011 00:34:31 -0000 Author: dougb Date: Thu Nov 17 00:34:31 2011 New Revision: 227598 URL: http://svn.freebsd.org/changeset/base/227598 Log: Tag the 9.6-ESV-R5-P1 release Added: vendor/bind9/9.6-ESV-R5-P1/ - copied from r227597, vendor/bind9/dist-9.6/ From owner-svn-src-all@FreeBSD.ORG Thu Nov 17 00:36:11 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F371106564A; Thu, 17 Nov 2011 00:36:11 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5D94F8FC16; Thu, 17 Nov 2011 00:36:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAH0aBGS073840; Thu, 17 Nov 2011 00:36:11 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAH0aBRi073835; Thu, 17 Nov 2011 00:36:11 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201111170036.pAH0aBRi073835@svn.freebsd.org> From: Doug Barton Date: Thu, 17 Nov 2011 00:36:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227599 - in stable/8/contrib/bind9: . bin/named lib/dns X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2011 00:36:11 -0000 Author: dougb Date: Thu Nov 17 00:36:10 2011 New Revision: 227599 URL: http://svn.freebsd.org/changeset/base/227599 Log: Upgrade to BIND 9.6-ESV-R5-P1 to address the following DDOS bug: Recursive name servers are failing with an assertion: INSIST(! dns_rdataset_isassociated(sigrdataset)) At this time it is not thought that authoritative-only servers are affected, but information about this bug is evolving rapidly. Because it may be possible to trigger this bug even on networks that do not allow untrusted users to access the recursive name servers (perhaps via specially crafted e-mail messages, and/or malicious web sites) it is recommended that ALL operators of recursive name servers upgrade immediately. For more information see: https://www.isc.org/software/bind/advisories/cve-2011-tbd which will be updated as more information becomes available. https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-4313 Modified: stable/8/contrib/bind9/CHANGES stable/8/contrib/bind9/bin/named/query.c stable/8/contrib/bind9/lib/dns/rbtdb.c stable/8/contrib/bind9/version Directory Properties: stable/8/contrib/bind9/ (props changed) Modified: stable/8/contrib/bind9/CHANGES ============================================================================== --- stable/8/contrib/bind9/CHANGES Thu Nov 17 00:34:31 2011 (r227598) +++ stable/8/contrib/bind9/CHANGES Thu Nov 17 00:36:10 2011 (r227599) @@ -1,3 +1,9 @@ + --- 9.6-ESV-R5-P1 released --- + +3218. [security] Cache lookup could return RRSIG data associated with + nonexistent records, leading to an assertion + failure. [RT #26590] + --- 9.6-ESV-R5 released --- 3135. [port] FreeBSD: workaround broken IPV6_USE_MIN_MTU processing. Modified: stable/8/contrib/bind9/bin/named/query.c ============================================================================== --- stable/8/contrib/bind9/bin/named/query.c Thu Nov 17 00:34:31 2011 (r227598) +++ stable/8/contrib/bind9/bin/named/query.c Thu Nov 17 00:36:10 2011 (r227599) @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: query.c,v 1.313.20.27 2011-03-19 09:47:54 marka Exp $ */ +/* $Id: query.c,v 1.313.20.27.8.1 2011-11-16 09:11:42 marka Exp $ */ /*! \file */ @@ -1280,11 +1280,9 @@ query_addadditional(void *arg, dns_name_ goto addname; if (result == DNS_R_NCACHENXRRSET) { dns_rdataset_disassociate(rdataset); - /* - * Negative cache entries don't have sigrdatasets. - */ - INSIST(sigrdataset == NULL || - ! dns_rdataset_isassociated(sigrdataset)); + if (sigrdataset != NULL && + dns_rdataset_isassociated(sigrdataset)) + dns_rdataset_disassociate(sigrdataset); } if (result == ISC_R_SUCCESS) { mname = NULL; @@ -1325,8 +1323,9 @@ query_addadditional(void *arg, dns_name_ goto addname; if (result == DNS_R_NCACHENXRRSET) { dns_rdataset_disassociate(rdataset); - INSIST(sigrdataset == NULL || - ! dns_rdataset_isassociated(sigrdataset)); + if (sigrdataset != NULL && + dns_rdataset_isassociated(sigrdataset)) + dns_rdataset_disassociate(sigrdataset); } if (result == ISC_R_SUCCESS) { mname = NULL; @@ -1776,10 +1775,8 @@ query_addadditional2(void *arg, dns_name goto setcache; if (result == DNS_R_NCACHENXRRSET) { dns_rdataset_disassociate(rdataset); - /* - * Negative cache entries don't have sigrdatasets. - */ - INSIST(! dns_rdataset_isassociated(sigrdataset)); + if (dns_rdataset_isassociated(sigrdataset)) + dns_rdataset_disassociate(sigrdataset); } if (result == ISC_R_SUCCESS) { /* Remember the result as a cache */ Modified: stable/8/contrib/bind9/lib/dns/rbtdb.c ============================================================================== --- stable/8/contrib/bind9/lib/dns/rbtdb.c Thu Nov 17 00:34:31 2011 (r227598) +++ stable/8/contrib/bind9/lib/dns/rbtdb.c Thu Nov 17 00:36:10 2011 (r227599) @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: rbtdb.c,v 1.270.12.32 2011-06-09 00:16:35 each Exp $ */ +/* $Id: rbtdb.c,v 1.270.12.32.8.1 2011-11-16 09:11:42 marka Exp $ */ /*! \file */ @@ -4681,7 +4681,7 @@ cache_find(dns_db_t *db, dns_name_t *nam rdataset); if (need_headerupdate(found, search.now)) update = found; - if (foundsig != NULL) { + if (!NEGATIVE(found) && foundsig != NULL) { bind_rdataset(search.rbtdb, node, foundsig, search.now, sigrdataset); if (need_headerupdate(foundsig, search.now)) @@ -5313,7 +5313,7 @@ cache_findrdataset(dns_db_t *db, dns_dbn } if (found != NULL) { bind_rdataset(rbtdb, rbtnode, found, now, rdataset); - if (foundsig != NULL) + if (!NEGATIVE(found) && foundsig != NULL) bind_rdataset(rbtdb, rbtnode, foundsig, now, sigrdataset); } Modified: stable/8/contrib/bind9/version ============================================================================== --- stable/8/contrib/bind9/version Thu Nov 17 00:34:31 2011 (r227598) +++ stable/8/contrib/bind9/version Thu Nov 17 00:36:10 2011 (r227599) @@ -1,4 +1,4 @@ -# $Id: version,v 1.43.12.14 2011-07-21 02:48:13 marka Exp $ +# $Id: version,v 1.43.12.14.10.1 2011-11-16 09:18:28 marka Exp $ # # This file must follow /bin/sh rules. It is imported directly via # configure. @@ -7,4 +7,4 @@ MAJORVER=9 MINORVER=6 PATCHVER= RELEASETYPE=-ESV -RELEASEVER=-R5 +RELEASEVER=-R5-P1 From owner-svn-src-all@FreeBSD.ORG Thu Nov 17 01:02:34 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2DE09106566B; Thu, 17 Nov 2011 01:02:34 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 136298FC14; Thu, 17 Nov 2011 01:02:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAH12XVA074713; Thu, 17 Nov 2011 01:02:33 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAH12Xwq074708; Thu, 17 Nov 2011 01:02:33 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201111170102.pAH12Xwq074708@svn.freebsd.org> From: Doug Barton Date: Thu, 17 Nov 2011 01:02:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227600 - in vendor/bind9/dist-9.4: . bin/named lib/dns X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2011 01:02:34 -0000 Author: dougb Date: Thu Nov 17 01:02:33 2011 New Revision: 227600 URL: http://svn.freebsd.org/changeset/base/227600 Log: Vendor import of BIND 9.4-ESV-R5-P1 Modified: vendor/bind9/dist-9.4/CHANGES vendor/bind9/dist-9.4/bin/named/query.c vendor/bind9/dist-9.4/lib/dns/rbtdb.c vendor/bind9/dist-9.4/version Modified: vendor/bind9/dist-9.4/CHANGES ============================================================================== --- vendor/bind9/dist-9.4/CHANGES Thu Nov 17 00:36:10 2011 (r227599) +++ vendor/bind9/dist-9.4/CHANGES Thu Nov 17 01:02:33 2011 (r227600) @@ -1,3 +1,9 @@ + --- 9.4-ESV-R5-P1 released --- + +3218. [security] Cache lookup could return RRSIG data associated with + nonexistent records, leading to an assertion + failure. [RT #26590] + --- 9.4-ESV-R5 released --- 3135. [port] FreeBSD: workaround broken IPV6_USE_MIN_MTU processing. Modified: vendor/bind9/dist-9.4/bin/named/query.c ============================================================================== --- vendor/bind9/dist-9.4/bin/named/query.c Thu Nov 17 00:36:10 2011 (r227599) +++ vendor/bind9/dist-9.4/bin/named/query.c Thu Nov 17 01:02:33 2011 (r227600) @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: query.c,v 1.257.18.56 2010-11-17 10:21:01 marka Exp $ */ +/* $Id: query.c,v 1.257.18.56.12.1 2011-11-16 09:33:40 each Exp $ */ /*! \file */ @@ -1251,11 +1251,9 @@ query_addadditional(void *arg, dns_name_ goto addname; if (result == DNS_R_NCACHENXRRSET) { dns_rdataset_disassociate(rdataset); - /* - * Negative cache entries don't have sigrdatasets. - */ - INSIST(sigrdataset == NULL || - ! dns_rdataset_isassociated(sigrdataset)); + if (sigrdataset != NULL && + dns_rdataset_isassociated(sigrdataset)) + dns_rdataset_disassociate(sigrdataset); } if (result == ISC_R_SUCCESS) { mname = NULL; @@ -1296,8 +1294,9 @@ query_addadditional(void *arg, dns_name_ goto addname; if (result == DNS_R_NCACHENXRRSET) { dns_rdataset_disassociate(rdataset); - INSIST(sigrdataset == NULL || - ! dns_rdataset_isassociated(sigrdataset)); + if (sigrdataset != NULL && + dns_rdataset_isassociated(sigrdataset)) + dns_rdataset_disassociate(sigrdataset); } if (result == ISC_R_SUCCESS) { mname = NULL; @@ -1746,10 +1745,8 @@ query_addadditional2(void *arg, dns_name goto setcache; if (result == DNS_R_NCACHENXRRSET) { dns_rdataset_disassociate(rdataset); - /* - * Negative cache entries don't have sigrdatasets. - */ - INSIST(! dns_rdataset_isassociated(sigrdataset)); + if (dns_rdataset_isassociated(sigrdataset)) + dns_rdataset_disassociate(sigrdataset); } if (result == ISC_R_SUCCESS) { /* Remember the result as a cache */ Modified: vendor/bind9/dist-9.4/lib/dns/rbtdb.c ============================================================================== --- vendor/bind9/dist-9.4/lib/dns/rbtdb.c Thu Nov 17 00:36:10 2011 (r227599) +++ vendor/bind9/dist-9.4/lib/dns/rbtdb.c Thu Nov 17 01:02:33 2011 (r227600) @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: rbtdb.c,v 1.196.18.67 2011-06-09 00:42:47 each Exp $ */ +/* $Id: rbtdb.c,v 1.196.18.67.2.1 2011-11-16 09:33:41 each Exp $ */ /*! \file */ @@ -3672,7 +3672,7 @@ cache_find(dns_db_t *db, dns_name_t *nam result == DNS_R_NCACHENXRRSET) { bind_rdataset(search.rbtdb, node, found, search.now, rdataset); - if (foundsig != NULL) + if (!NEGATIVE(found) && foundsig != NULL) bind_rdataset(search.rbtdb, node, foundsig, search.now, sigrdataset); } @@ -4258,7 +4258,7 @@ cache_findrdataset(dns_db_t *db, dns_dbn } if (found != NULL) { bind_rdataset(rbtdb, rbtnode, found, now, rdataset); - if (foundsig != NULL) + if (!NEGATIVE(found) && foundsig != NULL) bind_rdataset(rbtdb, rbtnode, foundsig, now, sigrdataset); } Modified: vendor/bind9/dist-9.4/version ============================================================================== --- vendor/bind9/dist-9.4/version Thu Nov 17 00:36:10 2011 (r227599) +++ vendor/bind9/dist-9.4/version Thu Nov 17 01:02:33 2011 (r227600) @@ -1,4 +1,4 @@ -# $Id: version,v 1.29.134.35 2011-07-21 02:11:00 marka Exp $ +# $Id: version,v 1.29.134.35.2.1 2011-11-16 09:33:40 each Exp $ # # This file must follow /bin/sh rules. It is imported directly via # configure. @@ -7,4 +7,4 @@ MAJORVER=9 MINORVER=4 PATCHVER= RELEASETYPE=-ESV -RELEASEVER=-R5 +RELEASEVER=-R5-P1 From owner-svn-src-all@FreeBSD.ORG Thu Nov 17 01:02:46 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 467D710657B5; Thu, 17 Nov 2011 01:02:46 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1BA978FC17; Thu, 17 Nov 2011 01:02:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAH12jFV074754; Thu, 17 Nov 2011 01:02:45 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAH12j3l074752; Thu, 17 Nov 2011 01:02:45 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201111170102.pAH12j3l074752@svn.freebsd.org> From: Rick Macklem Date: Thu, 17 Nov 2011 01:02:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227601 - stable/8/sys/rpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2011 01:02:46 -0000 Author: rmacklem Date: Thu Nov 17 01:02:45 2011 New Revision: 227601 URL: http://svn.freebsd.org/changeset/base/227601 Log: MFC: r227059 Both a crash reported on freebsd-current on Oct. 18 under the subject heading "mtx_lock() of destroyed mutex on NFS" and PR# 156168 appear to be caused by clnt_dg_destroy() closing down the socket prematurely. When to close down the socket is controlled by a reference count (cs_refs), but clnt_dg_create() checks for sb_upcall being non-NULL to decide if a new socket is needed. I believe the crashes were caused by the following race: clnt_dg_destroy() finds cs_refs == 0 and decides to delete socket clnt_dg_destroy() then loses race with clnt_dg_create() for acquisition of the SOCKBUF_LOCK() clnt_dg_create() finds sb_upcall != NULL and increments cs_refs to 1 clnt_dg_destroy() then acquires SOCKBUF_LOCK(), sets sb_upcall to NULL and destroys socket This patch fixes the above race by changing clnt_dg_destroy() so that it acquires SOCKBUF_LOCK() before testing cs_refs. Tested by: bz Reviewed by: dfr Modified: stable/8/sys/rpc/clnt_dg.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/rpc/clnt_dg.c ============================================================================== --- stable/8/sys/rpc/clnt_dg.c Thu Nov 17 01:02:33 2011 (r227600) +++ stable/8/sys/rpc/clnt_dg.c Thu Nov 17 01:02:45 2011 (r227601) @@ -1001,12 +1001,12 @@ clnt_dg_destroy(CLIENT *cl) cs = cu->cu_socket->so_rcv.sb_upcallarg; clnt_dg_close(cl); + SOCKBUF_LOCK(&cu->cu_socket->so_rcv); mtx_lock(&cs->cs_lock); cs->cs_refs--; if (cs->cs_refs == 0) { mtx_unlock(&cs->cs_lock); - SOCKBUF_LOCK(&cu->cu_socket->so_rcv); soupcall_clear(cu->cu_socket, SO_RCV); clnt_dg_upcallsdone(cu->cu_socket, cs); SOCKBUF_UNLOCK(&cu->cu_socket->so_rcv); @@ -1015,6 +1015,7 @@ clnt_dg_destroy(CLIENT *cl) lastsocketref = TRUE; } else { mtx_unlock(&cs->cs_lock); + SOCKBUF_UNLOCK(&cu->cu_socket->so_rcv); lastsocketref = FALSE; } From owner-svn-src-all@FreeBSD.ORG Thu Nov 17 01:05:57 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9E0361065670; Thu, 17 Nov 2011 01:05:57 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 749278FC14; Thu, 17 Nov 2011 01:05:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAH15v7G074888; Thu, 17 Nov 2011 01:05:57 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAH15vXx074887; Thu, 17 Nov 2011 01:05:57 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201111170105.pAH15vXx074887@svn.freebsd.org> From: Doug Barton Date: Thu, 17 Nov 2011 01:05:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227602 - vendor/bind9/9.4-ESV-R5-P1 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2011 01:05:57 -0000 Author: dougb Date: Thu Nov 17 01:05:57 2011 New Revision: 227602 URL: http://svn.freebsd.org/changeset/base/227602 Log: Tag the 9.4-ESV-R5-P1 release Added: vendor/bind9/9.4-ESV-R5-P1/ - copied from r227601, vendor/bind9/dist-9.4/ From owner-svn-src-all@FreeBSD.ORG Thu Nov 17 01:10:16 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CBDB110657BD; Thu, 17 Nov 2011 01:10:16 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B9EEF8FC08; Thu, 17 Nov 2011 01:10:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAH1AGp7075063; Thu, 17 Nov 2011 01:10:16 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAH1AGCP075058; Thu, 17 Nov 2011 01:10:16 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201111170110.pAH1AGCP075058@svn.freebsd.org> From: Doug Barton Date: Thu, 17 Nov 2011 01:10:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227603 - in stable/7/contrib/bind9: . bin/named lib/dns X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2011 01:10:16 -0000 Author: dougb Date: Thu Nov 17 01:10:16 2011 New Revision: 227603 URL: http://svn.freebsd.org/changeset/base/227603 Log: Upgrade to BIND 9.4-ESV-R5-P1 to address the following DDOS bug: Recursive name servers are failing with an assertion: INSIST(! dns_rdataset_isassociated(sigrdataset)) At this time it is not thought that authoritative-only servers are affected, but information about this bug is evolving rapidly. Because it may be possible to trigger this bug even on networks that do not allow untrusted users to access the recursive name servers (perhaps via specially crafted e-mail messages, and/or malicious web sites) it is recommended that ALL operators of recursive name servers upgrade immediately. For more information see: https://www.isc.org/software/bind/advisories/cve-2011-tbd which will be updated as more information becomes available. https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-4313 Modified: stable/7/contrib/bind9/CHANGES stable/7/contrib/bind9/bin/named/query.c stable/7/contrib/bind9/lib/dns/rbtdb.c stable/7/contrib/bind9/version Directory Properties: stable/7/contrib/bind9/ (props changed) Modified: stable/7/contrib/bind9/CHANGES ============================================================================== --- stable/7/contrib/bind9/CHANGES Thu Nov 17 01:05:57 2011 (r227602) +++ stable/7/contrib/bind9/CHANGES Thu Nov 17 01:10:16 2011 (r227603) @@ -1,3 +1,9 @@ + --- 9.4-ESV-R5-P1 released --- + +3218. [security] Cache lookup could return RRSIG data associated with + nonexistent records, leading to an assertion + failure. [RT #26590] + --- 9.4-ESV-R5 released --- 3135. [port] FreeBSD: workaround broken IPV6_USE_MIN_MTU processing. Modified: stable/7/contrib/bind9/bin/named/query.c ============================================================================== --- stable/7/contrib/bind9/bin/named/query.c Thu Nov 17 01:05:57 2011 (r227602) +++ stable/7/contrib/bind9/bin/named/query.c Thu Nov 17 01:10:16 2011 (r227603) @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: query.c,v 1.257.18.56 2010-11-17 10:21:01 marka Exp $ */ +/* $Id: query.c,v 1.257.18.56.12.1 2011-11-16 09:33:40 each Exp $ */ /*! \file */ @@ -1251,11 +1251,9 @@ query_addadditional(void *arg, dns_name_ goto addname; if (result == DNS_R_NCACHENXRRSET) { dns_rdataset_disassociate(rdataset); - /* - * Negative cache entries don't have sigrdatasets. - */ - INSIST(sigrdataset == NULL || - ! dns_rdataset_isassociated(sigrdataset)); + if (sigrdataset != NULL && + dns_rdataset_isassociated(sigrdataset)) + dns_rdataset_disassociate(sigrdataset); } if (result == ISC_R_SUCCESS) { mname = NULL; @@ -1296,8 +1294,9 @@ query_addadditional(void *arg, dns_name_ goto addname; if (result == DNS_R_NCACHENXRRSET) { dns_rdataset_disassociate(rdataset); - INSIST(sigrdataset == NULL || - ! dns_rdataset_isassociated(sigrdataset)); + if (sigrdataset != NULL && + dns_rdataset_isassociated(sigrdataset)) + dns_rdataset_disassociate(sigrdataset); } if (result == ISC_R_SUCCESS) { mname = NULL; @@ -1746,10 +1745,8 @@ query_addadditional2(void *arg, dns_name goto setcache; if (result == DNS_R_NCACHENXRRSET) { dns_rdataset_disassociate(rdataset); - /* - * Negative cache entries don't have sigrdatasets. - */ - INSIST(! dns_rdataset_isassociated(sigrdataset)); + if (dns_rdataset_isassociated(sigrdataset)) + dns_rdataset_disassociate(sigrdataset); } if (result == ISC_R_SUCCESS) { /* Remember the result as a cache */ Modified: stable/7/contrib/bind9/lib/dns/rbtdb.c ============================================================================== --- stable/7/contrib/bind9/lib/dns/rbtdb.c Thu Nov 17 01:05:57 2011 (r227602) +++ stable/7/contrib/bind9/lib/dns/rbtdb.c Thu Nov 17 01:10:16 2011 (r227603) @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: rbtdb.c,v 1.196.18.67 2011-06-09 00:42:47 each Exp $ */ +/* $Id: rbtdb.c,v 1.196.18.67.2.1 2011-11-16 09:33:41 each Exp $ */ /*! \file */ @@ -3672,7 +3672,7 @@ cache_find(dns_db_t *db, dns_name_t *nam result == DNS_R_NCACHENXRRSET) { bind_rdataset(search.rbtdb, node, found, search.now, rdataset); - if (foundsig != NULL) + if (!NEGATIVE(found) && foundsig != NULL) bind_rdataset(search.rbtdb, node, foundsig, search.now, sigrdataset); } @@ -4258,7 +4258,7 @@ cache_findrdataset(dns_db_t *db, dns_dbn } if (found != NULL) { bind_rdataset(rbtdb, rbtnode, found, now, rdataset); - if (foundsig != NULL) + if (!NEGATIVE(found) && foundsig != NULL) bind_rdataset(rbtdb, rbtnode, foundsig, now, sigrdataset); } Modified: stable/7/contrib/bind9/version ============================================================================== --- stable/7/contrib/bind9/version Thu Nov 17 01:05:57 2011 (r227602) +++ stable/7/contrib/bind9/version Thu Nov 17 01:10:16 2011 (r227603) @@ -1,4 +1,4 @@ -# $Id: version,v 1.29.134.35 2011-07-21 02:11:00 marka Exp $ +# $Id: version,v 1.29.134.35.2.1 2011-11-16 09:33:40 each Exp $ # # This file must follow /bin/sh rules. It is imported directly via # configure. @@ -7,4 +7,4 @@ MAJORVER=9 MINORVER=4 PATCHVER= RELEASETYPE=-ESV -RELEASEVER=-R5 +RELEASEVER=-R5-P1 From owner-svn-src-all@FreeBSD.ORG Thu Nov 17 01:43:50 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E4F57106564A; Thu, 17 Nov 2011 01:43:50 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D4D038FC12; Thu, 17 Nov 2011 01:43:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAH1ho1k076081; Thu, 17 Nov 2011 01:43:50 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAH1ho02076079; Thu, 17 Nov 2011 01:43:50 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201111170143.pAH1ho02076079@svn.freebsd.org> From: David Xu Date: Thu, 17 Nov 2011 01:43:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227604 - head/lib/libthr/thread X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2011 01:43:51 -0000 Author: davidxu Date: Thu Nov 17 01:43:50 2011 New Revision: 227604 URL: http://svn.freebsd.org/changeset/base/227604 Log: Pass CVWAIT flags to kernel, this should handle timeout correctly for pthread_cond_timedwait when it uses kernel-based condition variable. PR: 162403 Submitted by: jilles MFC after: 3 days Modified: head/lib/libthr/thread/thr_umtx.c Modified: head/lib/libthr/thread/thr_umtx.c ============================================================================== --- head/lib/libthr/thread/thr_umtx.c Thu Nov 17 01:10:16 2011 (r227603) +++ head/lib/libthr/thread/thr_umtx.c Thu Nov 17 01:43:50 2011 (r227604) @@ -231,7 +231,7 @@ _thr_ucond_init(struct ucond *cv) int _thr_ucond_wait(struct ucond *cv, struct umutex *m, - const struct timespec *timeout, int check_unparking) + const struct timespec *timeout, int flags) { if (timeout && (timeout->tv_sec < 0 || (timeout->tv_sec == 0 && timeout->tv_nsec <= 0))) { @@ -239,8 +239,7 @@ _thr_ucond_wait(struct ucond *cv, struct _thr_umutex_unlock(m, TID(curthread)); return (ETIMEDOUT); } - return _umtx_op_err(cv, UMTX_OP_CV_WAIT, - check_unparking ? UMTX_CHECK_UNPARKING : 0, + return _umtx_op_err(cv, UMTX_OP_CV_WAIT, flags, m, __DECONST(void*, timeout)); } From owner-svn-src-all@FreeBSD.ORG Thu Nov 17 03:10:47 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA5D81065675; Thu, 17 Nov 2011 03:10:47 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from sakura.ccs.furiru.org (sakura.ccs.furiru.org [IPv6:2001:2f0:104:8060::1]) by mx1.freebsd.org (Postfix) with ESMTP id 597498FC08; Thu, 17 Nov 2011 03:10:47 +0000 (UTC) Received: from localhost (authenticated bits=0) by sakura.ccs.furiru.org (unknown) with ESMTP id pAH3Aegp099447; Thu, 17 Nov 2011 12:10:42 +0900 (JST) (envelope-from nyan@FreeBSD.org) Date: Thu, 17 Nov 2011 12:10:39 +0900 (JST) Message-Id: <20111117.121039.812628220522982454.nyan@FreeBSD.org> To: kensmith@buffalo.edu From: TAKAHASHI Yoshihiro In-Reply-To: <1321457050.78238.10.camel@bauer.cse.buffalo.edu> References: <20111116.232828.343708041526200614.nyan@FreeBSD.org> <4EC3D40A.5040204@freebsd.org> <1321457050.78238.10.camel@bauer.cse.buffalo.edu> X-Mailer: Mew version 6.3 on Emacs 23.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, nwhitehorn@freebsd.org Subject: Re: svn commit: r227536 - in head: release share/man/man7 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2011 03:10:47 -0000 In article <1321457050.78238.10.camel@bauer.cse.buffalo.edu> Ken Smith writes: >> >> +: ${RELSTRING=`chroot $2 uname -s`-`chroot $2 uname -r`-`chroot $2 uname -p`} >> > Should this be 'uname -m' rather than 'uname -p'? >> >> There isn't a good option here when there is only one tag -- most of the >> time, I imagine this will get specified in the builder's environment. I >> picked uname -p because there are more possibilities than uname -m: it >> breaks the degeneracies for PPC, ARM, and MIPS, leaving only one for >> i386/pc98. uname -m would have been the other way around. I see. > Or both? We're heading in the direction of having both for the FTP > server tree. > > Kinda gross but "FBSD-9.0-RELEASE-amd64-amd64-bootonly.iso"? I don't > see a good option among the three possibilities, which are: > > 1) uname -m only > 2) uname -p only > 3) both > > Option 3 at least has the benefit of not being abiguous and covers all > the possibilities for builds given the new infrastructure. I think that the same scheme as the FTP site is better. So I choose (3) option. --- TAKAHASHI Yoshihiro From owner-svn-src-all@FreeBSD.ORG Thu Nov 17 04:01:11 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B2A18106564A; Thu, 17 Nov 2011 04:01:10 +0000 (UTC) (envelope-from bright@elvis.mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 6CC038FC13; Thu, 17 Nov 2011 04:01:10 +0000 (UTC) Received: by elvis.mu.org (Postfix, from userid 1192) id DCDE11A3CA0; Wed, 16 Nov 2011 20:01:09 -0800 (PST) Date: Wed, 16 Nov 2011 20:01:09 -0800 From: Alfred Perlstein To: Rick Macklem Message-ID: <20111117040109.GU1455@elvis.mu.org> References: <201111160505.pAG55D5R032343@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201111160505.pAG55D5R032343@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-7@freebsd.org Subject: Re: svn commit: r227549 - stable/7/sys/nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2011 04:01:11 -0000 Rick, I have a question, what will happen if the nfs_freesillyrename() call happens when the mount is down? Will it block the taskqueue_thread? If so, it might make more sense to make a taskqueue per mount point. If not, excuse me. :-) -Alfred * Rick Macklem [111115 21:05] wrote: > Author: rmacklem > Date: Wed Nov 16 05:05:13 2011 > New Revision: 227549 > URL: http://svn.freebsd.org/changeset/base/227549 > > Log: > MFC: r224604 > Fix a LOR in the NFS client which could cause a deadlock. > This was reported to the mailing list freebsd-net@freebsd.org > on July 21, 2011 under the subject "LOR with nfsclient sillyrename". > The LOR occurred when nfs_inactive() called vrele(sp->s_dvp) > while holding the vnode lock on the file in s_dvp. This patch > modifies the client so that it performs the vrele(sp->s_dvp) > as a separate task to avoid the LOR. This fix was discussed > with jhb@ and kib@, who both proposed variations of it. > > Modified: > stable/7/sys/nfsclient/nfs_node.c > stable/7/sys/nfsclient/nfsnode.h > Directory Properties: > stable/7/sys/ (props changed) > stable/7/sys/cddl/contrib/opensolaris/ (props changed) > stable/7/sys/contrib/dev/acpica/ (props changed) > stable/7/sys/contrib/pf/ (props changed) > > Modified: stable/7/sys/nfsclient/nfs_node.c > ============================================================================== > --- stable/7/sys/nfsclient/nfs_node.c Wed Nov 16 02:52:24 2011 (r227548) > +++ stable/7/sys/nfsclient/nfs_node.c Wed Nov 16 05:05:13 2011 (r227549) > @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > > #include > @@ -59,6 +60,8 @@ __FBSDID("$FreeBSD$"); > > static uma_zone_t nfsnode_zone; > > +static void nfs_freesillyrename(void *arg, __unused int pending); > + > #define TRUE 1 > #define FALSE 0 > > @@ -191,6 +194,20 @@ nfs_nget(struct mount *mntp, nfsfh_t *fh > return (0); > } > > +/* > + * Do the vrele(sp->s_dvp) as a separate task in order to avoid a > + * deadlock because of a LOR when vrele() locks the directory vnode. > + */ > +static void > +nfs_freesillyrename(void *arg, __unused int pending) > +{ > + struct sillyrename *sp; > + > + sp = arg; > + vrele(sp->s_dvp); > + free(sp, M_NFSREQ); > +} > + > int > nfs_inactive(struct vop_inactive_args *ap) > { > @@ -213,8 +230,8 @@ nfs_inactive(struct vop_inactive_args *a > */ > (sp->s_removeit)(sp); > crfree(sp->s_cred); > - vrele(sp->s_dvp); > - FREE((caddr_t)sp, M_NFSREQ); > + TASK_INIT(&sp->s_task, 0, nfs_freesillyrename, sp); > + taskqueue_enqueue(taskqueue_thread, &sp->s_task); > } > np->n_flag &= NMODIFIED; > return (0); > > Modified: stable/7/sys/nfsclient/nfsnode.h > ============================================================================== > --- stable/7/sys/nfsclient/nfsnode.h Wed Nov 16 02:52:24 2011 (r227548) > +++ stable/7/sys/nfsclient/nfsnode.h Wed Nov 16 05:05:13 2011 (r227549) > @@ -36,6 +36,7 @@ > #ifndef _NFSCLIENT_NFSNODE_H_ > #define _NFSCLIENT_NFSNODE_H_ > > +#include > #if !defined(_NFSCLIENT_NFS_H_) && !defined(_KERNEL) > #include > #endif > @@ -45,6 +46,7 @@ > * can be removed by nfs_inactive() > */ > struct sillyrename { > + struct task s_task; > struct ucred *s_cred; > struct vnode *s_dvp; > int (*s_removeit)(struct sillyrename *sp); -- - Alfred Perlstein .- VMOA #5191, 03 vmax, 92 gs500, 85 ch250, 07 zx10 .- FreeBSD committer From owner-svn-src-all@FreeBSD.ORG Thu Nov 17 05:45:38 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4708E1065672; Thu, 17 Nov 2011 05:45:38 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from esa-jnhn.mail.uoguelph.ca (esa-jnhn.mail.uoguelph.ca [131.104.91.44]) by mx1.freebsd.org (Postfix) with ESMTP id ADE6E8FC0C; Thu, 17 Nov 2011 05:45:37 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ap4EAAiYxE6DaFvO/2dsb2JhbABChQGmCoFyAQEFIwRHCxsUBAICDRkCWQYTiAqgeZF6gTCCKYUogRYEiBSMIJIa X-IronPort-AV: E=Sophos;i="4.69,524,1315195200"; d="scan'208";a="145808292" Received: from erie.cs.uoguelph.ca (HELO zcs3.mail.uoguelph.ca) ([131.104.91.206]) by esa-jnhn-pri.mail.uoguelph.ca with ESMTP; 17 Nov 2011 00:16:34 -0500 Received: from zcs3.mail.uoguelph.ca (localhost.localdomain [127.0.0.1]) by zcs3.mail.uoguelph.ca (Postfix) with ESMTP id 0ADE5B3F25; Thu, 17 Nov 2011 00:16:34 -0500 (EST) Date: Thu, 17 Nov 2011 00:16:34 -0500 (EST) From: Rick Macklem To: Alfred Perlstein Message-ID: <462306074.1954190.1321506994004.JavaMail.root@erie.cs.uoguelph.ca> In-Reply-To: <20111117040109.GU1455@elvis.mu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [172.17.91.201] X-Mailer: Zimbra 6.0.10_GA_2692 (ZimbraWebClient - FF3.0 (Win)/6.0.10_GA_2692) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-7@freebsd.org, Rick Macklem Subject: Re: svn commit: r227549 - stable/7/sys/nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2011 05:45:38 -0000 Alfred Perlstein wrote: > Rick, I have a question, what will happen if the nfs_freesillyrename() > call happens when the mount is down? Will it block the > taskqueue_thread? > > If so, it might make more sense to make a taskqueue per mount point. > > If not, excuse me. :-) > Well, all nfs_freesillyrename() does is a vrele() on the parent directory when the file node's use count has gone to 0. I can't think why that would do any RPC, so I don't see a problem? If you do see a problem with vrele() on the directory, please let me know. The problem this fixes is a LOR that would occur when the vrele() on the directory was done by the thread doing VOP_INACTIVE(), since it already has the file vnode lock and the vrele() was locking the parent directory. This could cause a fairly rare deadlock. rick > -Alfred > > * Rick Macklem [111115 21:05] wrote: > > Author: rmacklem > > Date: Wed Nov 16 05:05:13 2011 > > New Revision: 227549 > > URL: http://svn.freebsd.org/changeset/base/227549 > > > > Log: > > MFC: r224604 > > Fix a LOR in the NFS client which could cause a deadlock. > > This was reported to the mailing list freebsd-net@freebsd.org > > on July 21, 2011 under the subject "LOR with nfsclient > > sillyrename". > > The LOR occurred when nfs_inactive() called vrele(sp->s_dvp) > > while holding the vnode lock on the file in s_dvp. This patch > > modifies the client so that it performs the vrele(sp->s_dvp) > > as a separate task to avoid the LOR. This fix was discussed > > with jhb@ and kib@, who both proposed variations of it. > > > > Modified: > > stable/7/sys/nfsclient/nfs_node.c > > stable/7/sys/nfsclient/nfsnode.h > > Directory Properties: > > stable/7/sys/ (props changed) > > stable/7/sys/cddl/contrib/opensolaris/ (props changed) > > stable/7/sys/contrib/dev/acpica/ (props changed) > > stable/7/sys/contrib/pf/ (props changed) > > > > Modified: stable/7/sys/nfsclient/nfs_node.c > > ============================================================================== > > --- stable/7/sys/nfsclient/nfs_node.c Wed Nov 16 02:52:24 2011 > > (r227548) > > +++ stable/7/sys/nfsclient/nfs_node.c Wed Nov 16 05:05:13 2011 > > (r227549) > > @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); > > #include > > #include > > #include > > +#include > > #include > > > > #include > > @@ -59,6 +60,8 @@ __FBSDID("$FreeBSD$"); > > > > static uma_zone_t nfsnode_zone; > > > > +static void nfs_freesillyrename(void *arg, __unused int pending); > > + > > #define TRUE 1 > > #define FALSE 0 > > > > @@ -191,6 +194,20 @@ nfs_nget(struct mount *mntp, nfsfh_t *fh > > return (0); > > } > > > > +/* > > + * Do the vrele(sp->s_dvp) as a separate task in order to avoid a > > + * deadlock because of a LOR when vrele() locks the directory > > vnode. > > + */ > > +static void > > +nfs_freesillyrename(void *arg, __unused int pending) > > +{ > > + struct sillyrename *sp; > > + > > + sp = arg; > > + vrele(sp->s_dvp); > > + free(sp, M_NFSREQ); > > +} > > + > > int > > nfs_inactive(struct vop_inactive_args *ap) > > { > > @@ -213,8 +230,8 @@ nfs_inactive(struct vop_inactive_args *a > > */ > > (sp->s_removeit)(sp); > > crfree(sp->s_cred); > > - vrele(sp->s_dvp); > > - FREE((caddr_t)sp, M_NFSREQ); > > + TASK_INIT(&sp->s_task, 0, nfs_freesillyrename, sp); > > + taskqueue_enqueue(taskqueue_thread, &sp->s_task); > > } > > np->n_flag &= NMODIFIED; > > return (0); > > > > Modified: stable/7/sys/nfsclient/nfsnode.h > > ============================================================================== > > --- stable/7/sys/nfsclient/nfsnode.h Wed Nov 16 02:52:24 2011 > > (r227548) > > +++ stable/7/sys/nfsclient/nfsnode.h Wed Nov 16 05:05:13 2011 > > (r227549) > > @@ -36,6 +36,7 @@ > > #ifndef _NFSCLIENT_NFSNODE_H_ > > #define _NFSCLIENT_NFSNODE_H_ > > > > +#include > > #if !defined(_NFSCLIENT_NFS_H_) && !defined(_KERNEL) > > #include > > #endif > > @@ -45,6 +46,7 @@ > > * can be removed by nfs_inactive() > > */ > > struct sillyrename { > > + struct task s_task; > > struct ucred *s_cred; > > struct vnode *s_dvp; > > int (*s_removeit)(struct sillyrename *sp); > > -- > - Alfred Perlstein > .- VMOA #5191, 03 vmax, 92 gs500, 85 ch250, 07 zx10 > .- FreeBSD committer From owner-svn-src-all@FreeBSD.ORG Thu Nov 17 06:54:50 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D259106566B; Thu, 17 Nov 2011 06:54:50 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3D5C88FC08; Thu, 17 Nov 2011 06:54:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAH6soGD085878; Thu, 17 Nov 2011 06:54:50 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAH6so2A085876; Thu, 17 Nov 2011 06:54:50 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201111170654.pAH6so2A085876@svn.freebsd.org> From: Alan Cox Date: Thu, 17 Nov 2011 06:54:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227606 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2011 06:54:50 -0000 Author: alc Date: Thu Nov 17 06:54:49 2011 New Revision: 227606 URL: http://svn.freebsd.org/changeset/base/227606 Log: Eliminate end-of-line white space. Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Thu Nov 17 03:34:48 2011 (r227605) +++ head/sys/vm/vm_page.c Thu Nov 17 06:54:49 2011 (r227606) @@ -1335,7 +1335,7 @@ vm_page_alloc(vm_object_t object, vm_pin mtx_lock(&vm_page_queue_free_mtx); if (cnt.v_free_count + cnt.v_cache_count > cnt.v_free_reserved || - (req_class == VM_ALLOC_SYSTEM && + (req_class == VM_ALLOC_SYSTEM && cnt.v_free_count + cnt.v_cache_count > cnt.v_interrupt_free_min) || (req_class == VM_ALLOC_INTERRUPT && cnt.v_free_count + cnt.v_cache_count > 0)) { @@ -1723,7 +1723,7 @@ vm_page_alloc_freelist(int flind, int re */ mtx_lock(&vm_page_queue_free_mtx); if (cnt.v_free_count + cnt.v_cache_count > cnt.v_free_reserved || - (req_class == VM_ALLOC_SYSTEM && + (req_class == VM_ALLOC_SYSTEM && cnt.v_free_count + cnt.v_cache_count > cnt.v_interrupt_free_min) || (req_class == VM_ALLOC_INTERRUPT && cnt.v_free_count + cnt.v_cache_count > 0)) From owner-svn-src-all@FreeBSD.ORG Thu Nov 17 08:07:17 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 509B61065670; Thu, 17 Nov 2011 08:07:17 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3FC198FC1A; Thu, 17 Nov 2011 08:07:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAH87HNg088116; Thu, 17 Nov 2011 08:07:17 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAH87H8m088114; Thu, 17 Nov 2011 08:07:17 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201111170807.pAH87H8m088114@svn.freebsd.org> From: Dimitry Andric Date: Thu, 17 Nov 2011 08:07:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227607 - stable/9/etc/rc.d X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2011 08:07:17 -0000 Author: dim Date: Thu Nov 17 08:07:16 2011 New Revision: 227607 URL: http://svn.freebsd.org/changeset/base/227607 Log: MFC r227112: Whenever you boot with nfsv4_server_enable=NO (the default) in rc.conf, the /etc/rc.d/nfsd script sets vfs.nfsd.server_max_nfsvers to 3. Then, when you set nfsv4_server_enable=YES in rc.conf, and restart nfsd via the rc.d script, without rebooting, the sysctl does *not* get reset to max version 4, so NFSv4 still doesn't work. Fix this by explicitly setting vfs.nfsd.server_max_nfsvers to 4 when NFSv4 is requested. I also added resetting of the nfs_privport sysctls, since this has the same issue: nfs_reserved_port_only=YES in rc.conf sets the nfs_privport sysctl to 1, but in the other case, the sysctl doesn't get reset to 0. Reviewed by: rmacklem Silence from: rc@ Approved by: re (kib) Modified: stable/9/etc/rc.d/nfsd Directory Properties: stable/9/etc/ (props changed) Modified: stable/9/etc/rc.d/nfsd ============================================================================== --- stable/9/etc/rc.d/nfsd Thu Nov 17 06:54:49 2011 (r227606) +++ stable/9/etc/rc.d/nfsd Thu Nov 17 08:07:16 2011 (r227607) @@ -29,6 +29,8 @@ nfsd_precmd() if checkyesno nfs_reserved_port_only; then echo 'NFS on reserved port only=YES' sysctl vfs.nfsrv.nfs_privport=1 > /dev/null + else + sysctl vfs.nfsrv.nfs_privport=0 > /dev/null fi else rc_flags="${nfs_server_flags}" @@ -40,9 +42,12 @@ nfsd_precmd() if checkyesno nfs_reserved_port_only; then echo 'NFS on reserved port only=YES' sysctl vfs.nfsd.nfs_privport=1 > /dev/null + else + sysctl vfs.nfsd.nfs_privport=0 > /dev/null fi if checkyesno nfsv4_server_enable; then + sysctl vfs.nfsd.server_max_nfsvers=4 > /dev/null if ! checkyesno nfsuserd_enable && \ ! /etc/rc.d/nfsuserd forcestatus 1>/dev/null 2>&1 then From owner-svn-src-all@FreeBSD.ORG Thu Nov 17 08:12:13 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 36DE3106564A; Thu, 17 Nov 2011 08:12:13 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 268028FC16; Thu, 17 Nov 2011 08:12:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAH8CDl6088335; Thu, 17 Nov 2011 08:12:13 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAH8CDlK088333; Thu, 17 Nov 2011 08:12:13 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201111170812.pAH8CDlK088333@svn.freebsd.org> From: Dimitry Andric Date: Thu, 17 Nov 2011 08:12:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227608 - releng/9.0/etc/rc.d X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2011 08:12:13 -0000 Author: dim Date: Thu Nov 17 08:12:12 2011 New Revision: 227608 URL: http://svn.freebsd.org/changeset/base/227608 Log: MFC r227112: Whenever you boot with nfsv4_server_enable=NO (the default) in rc.conf, the /etc/rc.d/nfsd script sets vfs.nfsd.server_max_nfsvers to 3. Then, when you set nfsv4_server_enable=YES in rc.conf, and restart nfsd via the rc.d script, without rebooting, the sysctl does *not* get reset to max version 4, so NFSv4 still doesn't work. Fix this by explicitly setting vfs.nfsd.server_max_nfsvers to 4 when NFSv4 is requested. I also added resetting of the nfs_privport sysctls, since this has the same issue: nfs_reserved_port_only=YES in rc.conf sets the nfs_privport sysctl to 1, but in the other case, the sysctl doesn't get reset to 0. Reviewed by: rmacklem Silence from: rc@ Approved by: re (kib) Modified: releng/9.0/etc/rc.d/nfsd Directory Properties: releng/9.0/etc/ (props changed) Modified: releng/9.0/etc/rc.d/nfsd ============================================================================== --- releng/9.0/etc/rc.d/nfsd Thu Nov 17 08:07:16 2011 (r227607) +++ releng/9.0/etc/rc.d/nfsd Thu Nov 17 08:12:12 2011 (r227608) @@ -29,6 +29,8 @@ nfsd_precmd() if checkyesno nfs_reserved_port_only; then echo 'NFS on reserved port only=YES' sysctl vfs.nfsrv.nfs_privport=1 > /dev/null + else + sysctl vfs.nfsrv.nfs_privport=0 > /dev/null fi else rc_flags="${nfs_server_flags}" @@ -40,9 +42,12 @@ nfsd_precmd() if checkyesno nfs_reserved_port_only; then echo 'NFS on reserved port only=YES' sysctl vfs.nfsd.nfs_privport=1 > /dev/null + else + sysctl vfs.nfsd.nfs_privport=0 > /dev/null fi if checkyesno nfsv4_server_enable; then + sysctl vfs.nfsd.server_max_nfsvers=4 > /dev/null if ! checkyesno nfsuserd_enable && \ ! /etc/rc.d/nfsuserd forcestatus 1>/dev/null 2>&1 then From owner-svn-src-all@FreeBSD.ORG Thu Nov 17 10:46:52 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3F00C106566B; Thu, 17 Nov 2011 10:46:52 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 14E5A8FC16; Thu, 17 Nov 2011 10:46:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAHAkpAh098784; Thu, 17 Nov 2011 10:46:51 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAHAkpGL098781; Thu, 17 Nov 2011 10:46:51 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201111171046.pAHAkpGL098781@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 17 Nov 2011 10:46:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227610 - in head/sys/dev/usb: . quirk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2011 10:46:52 -0000 Author: hselasky Date: Thu Nov 17 10:46:51 2011 New Revision: 227610 URL: http://svn.freebsd.org/changeset/base/227610 Log: Quirk all of ALCOR's mass storage devices instead of quirking individual devices. Submitted by: Dmitry Luhtionov MFC after: 1 week Modified: head/sys/dev/usb/quirk/usb_quirk.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- head/sys/dev/usb/quirk/usb_quirk.c Thu Nov 17 08:57:39 2011 (r227609) +++ head/sys/dev/usb/quirk/usb_quirk.c Thu Nov 17 10:46:51 2011 (r227610) @@ -148,10 +148,6 @@ static struct usb_quirk_entry usb_quirks UQ_MSC_FORCE_PROTO_SCSI), USB_QUIRK(AIPTEK, POCKETCAM3M, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI), - USB_QUIRK(ALCOR, SDCR_6335, 0x0000, 0xffff, UQ_MSC_NO_TEST_UNIT_READY, - UQ_MSC_NO_SYNC_CACHE), - USB_QUIRK(ALCOR, SDCR_6362, 0x0000, 0xffff, UQ_MSC_NO_TEST_UNIT_READY, - UQ_MSC_NO_SYNC_CACHE), USB_QUIRK(ALCOR, UMCR_9361, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_GETMAXLUN), USB_QUIRK(ALCOR, TRANSCEND, 0x0000, 0xffff, UQ_MSC_NO_GETMAXLUN, @@ -462,6 +458,7 @@ static struct usb_quirk_entry usb_quirks * Quirks for manufacturers which USB devices does not respond * after issuing non-supported commands: */ + USB_QUIRK(ALCOR, DUMMY, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE, UQ_MSC_NO_TEST_UNIT_READY, UQ_MATCH_VENDOR_ONLY), USB_QUIRK(FEIYA, DUMMY, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE, UQ_MATCH_VENDOR_ONLY), USB_QUIRK(REALTEK, DUMMY, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE, UQ_MATCH_VENDOR_ONLY), USB_QUIRK(INITIO, DUMMY, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE, UQ_MATCH_VENDOR_ONLY), Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Thu Nov 17 08:57:39 2011 (r227609) +++ head/sys/dev/usb/usbdevs Thu Nov 17 10:46:51 2011 (r227610) @@ -915,8 +915,10 @@ product ALCATEL OT535 0x02df One Touch /* Alcor Micro, Inc. products */ product ALCOR2 KBD_HUB 0x2802 Kbd Hub +product ALCOR DUMMY 0x0000 Dummy product product ALCOR SDCR_6335 0x6335 SD/MMC Card Reader product ALCOR SDCR_6362 0x6362 SD/MMC Card Reader +product ALCOR SDCR_6366 0x6366 SD/MMC Card Reader product ALCOR TRANSCEND 0x6387 Transcend JetFlash Drive product ALCOR MA_KBD_HUB 0x9213 MacAlly Kbd Hub product ALCOR AU9814 0x9215 AU9814 Hub From owner-svn-src-all@FreeBSD.ORG Thu Nov 17 11:16:57 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A02B7106566C; Thu, 17 Nov 2011 11:16:57 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8F0938FC13; Thu, 17 Nov 2011 11:16:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAHBGvgg001847; Thu, 17 Nov 2011 11:16:57 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAHBGvMs001844; Thu, 17 Nov 2011 11:16:57 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201111171116.pAHBGvMs001844@svn.freebsd.org> From: Xin LI Date: Thu, 17 Nov 2011 11:16:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227611 - in stable: 7/sys/dev/mfi 8/sys/dev/mfi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2011 11:16:57 -0000 Author: delphij Date: Thu Nov 17 11:16:56 2011 New Revision: 227611 URL: http://svn.freebsd.org/changeset/base/227611 Log: MFC r227409: Do a dummy read to flush the interrupt ACK that we just performed, ensuring that everything is really, truly consistent. This fixes certain cases where one will see various: mfi0: COMMAND 0xffffffXXXXXXXXXX TIMEOUT AFTER XX SECONDS Requested by: Vincent Hoffman Modified: stable/8/sys/dev/mfi/mfi.c Directory Properties: stable/8/sys/ (props changed) Changes in other areas also in this revision: Modified: stable/7/sys/dev/mfi/mfi.c Directory Properties: stable/7/sys/ (props changed) Modified: stable/8/sys/dev/mfi/mfi.c ============================================================================== --- stable/8/sys/dev/mfi/mfi.c Thu Nov 17 10:46:51 2011 (r227610) +++ stable/8/sys/dev/mfi/mfi.c Thu Nov 17 11:16:56 2011 (r227611) @@ -932,6 +932,12 @@ mfi_intr(void *arg) if (sc->mfi_check_clear_intr(sc)) return; + /* + * Do a dummy read to flush the interrupt ACK that we just performed, + * ensuring that everything is really, truly consistent. + */ + (void)sc->mfi_read_fw_status(sc); + pi = sc->mfi_comms->hw_pi; ci = sc->mfi_comms->hw_ci; mtx_lock(&sc->mfi_io_lock); From owner-svn-src-all@FreeBSD.ORG Thu Nov 17 11:16:57 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D6B551065672; Thu, 17 Nov 2011 11:16:57 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C5B428FC14; Thu, 17 Nov 2011 11:16:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAHBGv1M001853; Thu, 17 Nov 2011 11:16:57 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAHBGvag001851; Thu, 17 Nov 2011 11:16:57 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201111171116.pAHBGvag001851@svn.freebsd.org> From: Xin LI Date: Thu, 17 Nov 2011 11:16:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227611 - in stable: 7/sys/dev/mfi 8/sys/dev/mfi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2011 11:16:58 -0000 Author: delphij Date: Thu Nov 17 11:16:56 2011 New Revision: 227611 URL: http://svn.freebsd.org/changeset/base/227611 Log: MFC r227409: Do a dummy read to flush the interrupt ACK that we just performed, ensuring that everything is really, truly consistent. This fixes certain cases where one will see various: mfi0: COMMAND 0xffffffXXXXXXXXXX TIMEOUT AFTER XX SECONDS Requested by: Vincent Hoffman Modified: stable/7/sys/dev/mfi/mfi.c Directory Properties: stable/7/sys/ (props changed) Changes in other areas also in this revision: Modified: stable/8/sys/dev/mfi/mfi.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/7/sys/dev/mfi/mfi.c ============================================================================== --- stable/7/sys/dev/mfi/mfi.c Thu Nov 17 10:46:51 2011 (r227610) +++ stable/7/sys/dev/mfi/mfi.c Thu Nov 17 11:16:56 2011 (r227611) @@ -928,6 +928,12 @@ mfi_intr(void *arg) if (sc->mfi_check_clear_intr(sc)) return; + /* + * Do a dummy read to flush the interrupt ACK that we just performed, + * ensuring that everything is really, truly consistent. + */ + (void)sc->mfi_read_fw_status(sc); + pi = sc->mfi_comms->hw_pi; ci = sc->mfi_comms->hw_ci; mtx_lock(&sc->mfi_io_lock); From owner-svn-src-all@FreeBSD.ORG Thu Nov 17 12:08:13 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 338E01065670; Thu, 17 Nov 2011 12:08:13 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 22B348FC18; Thu, 17 Nov 2011 12:08:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAHC8DWv005296; Thu, 17 Nov 2011 12:08:13 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAHC8DQC005295; Thu, 17 Nov 2011 12:08:13 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201111171208.pAHC8DQC005295@svn.freebsd.org> From: Rafal Jaworowski Date: Thu, 17 Nov 2011 12:08:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227613 - head/sys/boot/fdt/dts X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2011 12:08:13 -0000 Author: raj Date: Thu Nov 17 12:08:12 2011 New Revision: 227613 URL: http://svn.freebsd.org/changeset/base/227613 Log: Add DTS for the Freescale P2020DS. Obtained from: Freescale Added: head/sys/boot/fdt/dts/p2020ds.dts (contents, props changed) Added: head/sys/boot/fdt/dts/p2020ds.dts ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/p2020ds.dts Thu Nov 17 12:08:12 2011 (r227613) @@ -0,0 +1,754 @@ +/* + * P2020 DS Device Tree Source + * + * Copyright 2009 Freescale Semiconductor Inc. + * + * Neither the name of Freescale Semiconductor, Inc nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * Freescale hereby publishes it under the following licenses: + * + * BSD License + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 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 COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. + * + * GNU General Public License, version 2 + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. + * + * You may select the license of your choice. + *------------------------------------------------------------------ + */ +/* $FreeBSD$ */ + +/dts-v1/; +/ { + model = "fsl,P2020"; + compatible = "fsl,P2020DS"; + #address-cells = <2>; + #size-cells = <2>; + + aliases { + ethernet0 = &enet0; + ethernet1 = &enet1; + ethernet2 = &enet2; + serial0 = &serial0; + serial1 = &serial1; + pci0 = &pci0; + pci1 = &pci1; + pci2 = &pci2; + }; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + + PowerPC,P2020@0 { + device_type = "cpu"; + reg = <0x0>; + next-level-cache = <&L2>; + }; + + PowerPC,P2020@1 { + device_type = "cpu"; + reg = <0x1>; + next-level-cache = <&L2>; + }; + }; + + memory { + device_type = "memory"; + }; + + localbus@ffe05000 { + #address-cells = <2>; + #size-cells = <1>; + compatible = "fsl,elbc", "simple-bus"; + reg = <0 0xffe05000 0 0x1000>; + interrupts = <19 2>; + interrupt-parent = <&mpic>; + + ranges = <0x0 0x0 0x0 0xe8000000 0x08000000 + 0x1 0x0 0x0 0xe0000000 0x08000000 + 0x2 0x0 0x0 0xffa00000 0x00040000 + 0x3 0x0 0x0 0xffdf0000 0x00008000 + 0x4 0x0 0x0 0xffa40000 0x00040000 + 0x5 0x0 0x0 0xffa80000 0x00040000 + 0x6 0x0 0x0 0xffac0000 0x00040000>; + + nor@0,0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "cfi-flash"; + reg = <0x0 0x0 0x8000000>; + bank-width = <2>; + device-width = <1>; + + ramdisk@0 { + reg = <0x0 0x03000000>; + read-only; + }; + + diagnostic@3000000 { + reg = <0x03000000 0x00e00000>; + read-only; + }; + + dink@3e00000 { + reg = <0x03e00000 0x00200000>; + read-only; + }; + + kernel@4000000 { + reg = <0x04000000 0x00400000>; + read-only; + }; + + jffs2@4400000 { + reg = <0x04400000 0x03b00000>; + }; + + dtb@7f00000 { + reg = <0x07f00000 0x00080000>; + read-only; + }; + + u-boot@7f80000 { + reg = <0x07f80000 0x00080000>; + read-only; + }; + }; + + nand@2,0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "fsl,elbc-fcm-nand"; + reg = <0x2 0x0 0x40000>; + + u-boot@0 { + reg = <0x0 0x02000000>; + read-only; + }; + + jffs2@2000000 { + reg = <0x02000000 0x10000000>; + }; + + ramdisk@12000000 { + reg = <0x12000000 0x08000000>; + read-only; + }; + + kernel@1a000000 { + reg = <0x1a000000 0x04000000>; + }; + + dtb@1e000000 { + reg = <0x1e000000 0x01000000>; + read-only; + }; + + empty@1f000000 { + reg = <0x1f000000 0x21000000>; + }; + }; + + nand@4,0 { + compatible = "fsl,elbc-fcm-nand"; + reg = <0x4 0x0 0x40000>; + }; + + nand@5,0 { + compatible = "fsl,elbc-fcm-nand"; + reg = <0x5 0x0 0x40000>; + }; + + nand@6,0 { + compatible = "fsl,elbc-fcm-nand"; + reg = <0x6 0x0 0x40000>; + }; + }; + + soc@ffe00000 { + #address-cells = <1>; + #size-cells = <1>; + device_type = "soc"; + compatible = "fsl,p2020-immr", "simple-bus"; + ranges = <0x0 0 0xffe00000 0x100000>; + bus-frequency = <0>; // Filled out by uboot. + + ecm-law@0 { + compatible = "fsl,ecm-law"; + reg = <0x0 0x1000>; + fsl,num-laws = <12>; + }; + + ecm@1000 { + compatible = "fsl,p2020-ecm", "fsl,ecm"; + reg = <0x1000 0x1000>; + interrupts = <17 2>; + interrupt-parent = <&mpic>; + }; + + memory-controller@2000 { + compatible = "fsl,p2020-memory-controller"; + reg = <0x2000 0x1000>; + interrupt-parent = <&mpic>; + interrupts = <18 2>; + }; + + i2c@3000 { + #address-cells = <1>; + #size-cells = <0>; + cell-index = <0>; + compatible = "fsl-i2c"; + reg = <0x3000 0x100>; + interrupts = <43 2>; + interrupt-parent = <&mpic>; + dfsrr; + }; + + i2c@3100 { + #address-cells = <1>; + #size-cells = <0>; + cell-index = <1>; + compatible = "fsl-i2c"; + reg = <0x3100 0x100>; + interrupts = <43 2>; + interrupt-parent = <&mpic>; + dfsrr; + }; + + serial0: serial@4500 { + cell-index = <0>; + device_type = "serial"; + compatible = "ns16550"; + reg = <0x4500 0x100>; + clock-frequency = <0>; + interrupts = <42 2>; + interrupt-parent = <&mpic>; + }; + + serial1: serial@4600 { + cell-index = <1>; + device_type = "serial"; + compatible = "ns16550"; + reg = <0x4600 0x100>; + clock-frequency = <0>; + interrupts = <42 2>; + interrupt-parent = <&mpic>; + }; + + spi@7000 { + compatible = "fsl,espi"; + reg = <0x7000 0x1000>; + interrupts = <59 0x2>; + interrupt-parent = <&mpic>; + }; + + dma@c300 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "fsl,eloplus-dma"; + reg = <0xc300 0x4>; + ranges = <0x0 0xc100 0x200>; + cell-index = <1>; + dma-channel@0 { + compatible = "fsl,eloplus-dma-channel"; + reg = <0x0 0x80>; + cell-index = <0>; + interrupt-parent = <&mpic>; + interrupts = <76 2>; + }; + dma-channel@80 { + compatible = "fsl,eloplus-dma-channel"; + reg = <0x80 0x80>; + cell-index = <1>; + interrupt-parent = <&mpic>; + interrupts = <77 2>; + }; + dma-channel@100 { + compatible = "fsl,eloplus-dma-channel"; + reg = <0x100 0x80>; + cell-index = <2>; + interrupt-parent = <&mpic>; + interrupts = <78 2>; + }; + dma-channel@180 { + compatible = "fsl,eloplus-dma-channel"; + reg = <0x180 0x80>; + cell-index = <3>; + interrupt-parent = <&mpic>; + interrupts = <79 2>; + }; + }; + + gpio: gpio-controller@f000 { + #gpio-cells = <2>; + compatible = "fsl,mpc8572-gpio"; + reg = <0xf000 0x100>; + interrupts = <47 0x2>; + interrupt-parent = <&mpic>; + gpio-controller; + }; + + L2: l2-cache-controller@20000 { + compatible = "fsl,p2020-l2-cache-controller"; + reg = <0x20000 0x1000>; + cache-line-size = <32>; // 32 bytes + cache-size = <0x80000>; // L2, 512k + interrupt-parent = <&mpic>; + interrupts = <16 2>; + }; + + dma@21300 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "fsl,eloplus-dma"; + reg = <0x21300 0x4>; + ranges = <0x0 0x21100 0x200>; + cell-index = <0>; + dma-channel@0 { + compatible = "fsl,eloplus-dma-channel"; + reg = <0x0 0x80>; + cell-index = <0>; + interrupt-parent = <&mpic>; + interrupts = <20 2>; + }; + dma-channel@80 { + compatible = "fsl,eloplus-dma-channel"; + reg = <0x80 0x80>; + cell-index = <1>; + interrupt-parent = <&mpic>; + interrupts = <21 2>; + }; + dma-channel@100 { + compatible = "fsl,eloplus-dma-channel"; + reg = <0x100 0x80>; + cell-index = <2>; + interrupt-parent = <&mpic>; + interrupts = <22 2>; + }; + dma-channel@180 { + compatible = "fsl,eloplus-dma-channel"; + reg = <0x180 0x80>; + cell-index = <3>; + interrupt-parent = <&mpic>; + interrupts = <23 2>; + }; + }; + + usb@22000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "fsl-usb2-dr"; + reg = <0x22000 0x1000>; + interrupt-parent = <&mpic>; + interrupts = <28 0x2>; + phy_type = "ulpi"; + }; + + enet0: ethernet@24000 { + #address-cells = <1>; + #size-cells = <1>; + cell-index = <0>; + device_type = "network"; + model = "eTSEC"; + compatible = "gianfar"; + reg = <0x24000 0x1000>; + ranges = <0x0 0x24000 0x1000>; + local-mac-address = [ 00 00 00 00 00 00 ]; + interrupts = <29 2 30 2 34 2>; + interrupt-parent = <&mpic>; + tbi-handle = <&tbi0>; + phy-handle = <&phy0>; + phy-connection-type = "rgmii-id"; + + mdio@520 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "fsl,gianfar-mdio"; + reg = <0x520 0x20>; + + phy0: ethernet-phy@0 { + interrupt-parent = <&mpic>; + interrupts = <3 1>; + reg = <0x0>; + }; + phy1: ethernet-phy@1 { + interrupt-parent = <&mpic>; + interrupts = <3 1>; + reg = <0x1>; + }; + phy2: ethernet-phy@2 { + interrupt-parent = <&mpic>; + interrupts = <3 1>; + reg = <0x2>; + }; + tbi0: tbi-phy@11 { + reg = <0x11>; + device_type = "tbi-phy"; + }; + }; + }; + + enet1: ethernet@25000 { + #address-cells = <1>; + #size-cells = <1>; + cell-index = <1>; + device_type = "network"; + model = "eTSEC"; + compatible = "gianfar"; + reg = <0x25000 0x1000>; + ranges = <0x0 0x25000 0x1000>; + local-mac-address = [ 00 00 00 00 00 00 ]; + interrupts = <35 2 36 2 40 2>; + interrupt-parent = <&mpic>; + tbi-handle = <&tbi1>; + phy-handle = <&phy1>; + phy-connection-type = "rgmii-id"; + + mdio@520 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "fsl,gianfar-tbi"; + reg = <0x520 0x20>; + + tbi1: tbi-phy@11 { + reg = <0x11>; + device_type = "tbi-phy"; + }; + }; + }; + + enet2: ethernet@26000 { + #address-cells = <1>; + #size-cells = <1>; + cell-index = <2>; + device_type = "network"; + model = "eTSEC"; + compatible = "gianfar"; + reg = <0x26000 0x1000>; + ranges = <0x0 0x26000 0x1000>; + local-mac-address = [ 00 00 00 00 00 00 ]; + interrupts = <31 2 32 2 33 2>; + interrupt-parent = <&mpic>; + tbi-handle = <&tbi2>; + phy-handle = <&phy2>; + phy-connection-type = "rgmii-id"; + + mdio@520 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "fsl,gianfar-tbi"; + reg = <0x520 0x20>; + + tbi2: tbi-phy@11 { + reg = <0x11>; + device_type = "tbi-phy"; + }; + }; + }; + + sdhci@2e000 { + compatible = "fsl,p2020-esdhc", "fsl,esdhc"; + reg = <0x2e000 0x1000>; + interrupts = <72 0x2>; + interrupt-parent = <&mpic>; + /* Filled in by U-Boot */ + clock-frequency = <0>; + }; + + crypto@30000 { + compatible = "fsl,sec3.1", "fsl,sec3.0", "fsl,sec2.4", + "fsl,sec2.2", "fsl,sec2.1", "fsl,sec2.0"; + reg = <0x30000 0x10000>; + interrupts = <45 2 58 2>; + interrupt-parent = <&mpic>; + fsl,num-channels = <4>; + fsl,channel-fifo-len = <24>; + fsl,exec-units-mask = <0xbfe>; + fsl,descriptor-types-mask = <0x3ab0ebf>; + }; + + mpic: pic@40000 { + interrupt-controller; + #address-cells = <0>; + #interrupt-cells = <2>; + reg = <0x40000 0x40000>; + compatible = "chrp,open-pic"; + device_type = "open-pic"; + }; + + msi@41600 { + compatible = "fsl,mpic-msi"; + reg = <0x41600 0x80>; + msi-available-ranges = <0 0x100>; + interrupts = < + 0xe0 0 + 0xe1 0 + 0xe2 0 + 0xe3 0 + 0xe4 0 + 0xe5 0 + 0xe6 0 + 0xe7 0>; + interrupt-parent = <&mpic>; + }; + + global-utilities@e0000 { //global utilities block + compatible = "fsl,p2020-guts"; + reg = <0xe0000 0x1000>; + fsl,has-rstcr; + }; + }; + + pci0: pcie@ffe08000 { + compatible = "fsl,mpc8548-pcie"; + device_type = "pci"; + #interrupt-cells = <1>; + #size-cells = <2>; + #address-cells = <3>; + reg = <0 0xffe08000 0 0x1000>; + bus-range = <0 255>; + ranges = <0x2000000 0x0 0x80000000 0 0x80000000 0x0 0x20000000 + 0x1000000 0x0 0x00000000 0 0xffc00000 0x0 0x10000>; + clock-frequency = <33333333>; + interrupt-parent = <&mpic>; + interrupts = <24 2>; + interrupt-map-mask = <0xf800 0x0 0x0 0x7>; + interrupt-map = < + /* IDSEL 0x0 */ + 0000 0x0 0x0 0x1 &mpic 0x8 0x1 + 0000 0x0 0x0 0x2 &mpic 0x9 0x1 + 0000 0x0 0x0 0x3 &mpic 0xa 0x1 + 0000 0x0 0x0 0x4 &mpic 0xb 0x1 + >; + pcie@0 { + reg = <0x0 0x0 0x0 0x0 0x0>; + #size-cells = <2>; + #address-cells = <3>; + device_type = "pci"; + ranges = <0x2000000 0x0 0x80000000 + 0x2000000 0x0 0x80000000 + 0x0 0x20000000 + + 0x1000000 0x0 0x0 + 0x1000000 0x0 0x0 + 0x0 0x10000>; + }; + }; + + pci1: pcie@ffe09000 { + compatible = "fsl,mpc8548-pcie"; + device_type = "pci"; + #interrupt-cells = <1>; + #size-cells = <2>; + #address-cells = <3>; + reg = <0 0xffe09000 0 0x1000>; + bus-range = <0 255>; + ranges = <0x2000000 0x0 0xa0000000 0 0xa0000000 0x0 0x20000000 + 0x1000000 0x0 0x00000000 0 0xffc10000 0x0 0x10000>; + clock-frequency = <33333333>; + interrupt-parent = <&mpic>; + interrupts = <25 2>; + interrupt-map-mask = <0xff00 0x0 0x0 0x7>; + interrupt-map = < + + // IDSEL 0x11 func 0 - PCI slot 1 + 0x8800 0x0 0x0 0x1 &i8259 0x9 0x2 + 0x8800 0x0 0x0 0x2 &i8259 0xa 0x2 + + // IDSEL 0x11 func 1 - PCI slot 1 + 0x8900 0x0 0x0 0x1 &i8259 0x9 0x2 + 0x8900 0x0 0x0 0x2 &i8259 0xa 0x2 + + // IDSEL 0x11 func 2 - PCI slot 1 + 0x8a00 0x0 0x0 0x1 &i8259 0x9 0x2 + 0x8a00 0x0 0x0 0x2 &i8259 0xa 0x2 + + // IDSEL 0x11 func 3 - PCI slot 1 + 0x8b00 0x0 0x0 0x1 &i8259 0x9 0x2 + 0x8b00 0x0 0x0 0x2 &i8259 0xa 0x2 + + // IDSEL 0x11 func 4 - PCI slot 1 + 0x8c00 0x0 0x0 0x1 &i8259 0x9 0x2 + 0x8c00 0x0 0x0 0x2 &i8259 0xa 0x2 + + // IDSEL 0x11 func 5 - PCI slot 1 + 0x8d00 0x0 0x0 0x1 &i8259 0x9 0x2 + 0x8d00 0x0 0x0 0x2 &i8259 0xa 0x2 + + // IDSEL 0x11 func 6 - PCI slot 1 + 0x8e00 0x0 0x0 0x1 &i8259 0x9 0x2 + 0x8e00 0x0 0x0 0x2 &i8259 0xa 0x2 + + // IDSEL 0x11 func 7 - PCI slot 1 + 0x8f00 0x0 0x0 0x1 &i8259 0x9 0x2 + 0x8f00 0x0 0x0 0x2 &i8259 0xa 0x2 + + // IDSEL 0x1d Audio + 0xe800 0x0 0x0 0x1 &i8259 0x6 0x2 + + // IDSEL 0x1e Legacy + 0xf000 0x0 0x0 0x1 &i8259 0x7 0x2 + 0xf100 0x0 0x0 0x1 &i8259 0x7 0x2 + + // IDSEL 0x1f IDE/SATA + 0xf800 0x0 0x0 0x1 &i8259 0xe 0x2 + 0xf900 0x0 0x0 0x1 &i8259 0x5 0x2 + >; + + pcie@0 { + reg = <0x0 0x0 0x0 0x0 0x0>; + #size-cells = <2>; + #address-cells = <3>; + device_type = "pci"; + ranges = <0x2000000 0x0 0xa0000000 + 0x2000000 0x0 0xa0000000 + 0x0 0x20000000 + + 0x1000000 0x0 0x0 + 0x1000000 0x0 0x0 + 0x0 0x10000>; + uli1575@0 { + reg = <0x0 0x0 0x0 0x0 0x0>; + #size-cells = <2>; + #address-cells = <3>; + ranges = <0x2000000 0x0 0xa0000000 + 0x2000000 0x0 0xa0000000 + 0x0 0x20000000 + + 0x1000000 0x0 0x0 + 0x1000000 0x0 0x0 + 0x0 0x10000>; + isa@1e { + device_type = "isa"; + #interrupt-cells = <2>; + #size-cells = <1>; + #address-cells = <2>; + reg = <0xf000 0x0 0x0 0x0 0x0>; + ranges = <0x1 0x0 0x1000000 0x0 0x0 + 0x1000>; + interrupt-parent = <&i8259>; + + i8259: interrupt-controller@20 { + reg = <0x1 0x20 0x2 + 0x1 0xa0 0x2 + 0x1 0x4d0 0x2>; + interrupt-controller; + device_type = "interrupt-controller"; + #address-cells = <0>; + #interrupt-cells = <2>; + compatible = "chrp,iic"; + interrupts = <4 1>; + interrupt-parent = <&mpic>; + }; + + i8042@60 { + #size-cells = <0>; + #address-cells = <1>; + reg = <0x1 0x60 0x1 0x1 0x64 0x1>; + interrupts = <1 3 12 3>; + interrupt-parent = + <&i8259>; + + keyboard@0 { + reg = <0x0>; + compatible = "pnpPNP,303"; + }; + + mouse@1 { + reg = <0x1>; + compatible = "pnpPNP,f03"; + }; + }; + + rtc@70 { + compatible = "pnpPNP,b00"; + reg = <0x1 0x70 0x2>; + }; + + gpio@400 { + reg = <0x1 0x400 0x80>; + }; + }; + }; + }; + + }; + + pci2: pcie@ffe0a000 { + compatible = "fsl,mpc8548-pcie"; + device_type = "pci"; + #interrupt-cells = <1>; + #size-cells = <2>; + #address-cells = <3>; + reg = <0 0xffe0a000 0 0x1000>; + bus-range = <0 255>; + ranges = <0x2000000 0x0 0xc0000000 0 0xc0000000 0x0 0x20000000 + 0x1000000 0x0 0x00000000 0 0xffc20000 0x0 0x10000>; + clock-frequency = <33333333>; + interrupt-parent = <&mpic>; + interrupts = <26 2>; + interrupt-map-mask = <0xf800 0x0 0x0 0x7>; + interrupt-map = < + /* IDSEL 0x0 */ + 0000 0x0 0x0 0x1 &mpic 0x0 0x1 + 0000 0x0 0x0 0x2 &mpic 0x1 0x1 + 0000 0x0 0x0 0x3 &mpic 0x2 0x1 + 0000 0x0 0x0 0x4 &mpic 0x3 0x1 + >; + pcie@0 { + reg = <0x0 0x0 0x0 0x0 0x0>; + #size-cells = <2>; + #address-cells = <3>; + device_type = "pci"; + ranges = <0x2000000 0x0 0xc0000000 + 0x2000000 0x0 0xc0000000 + 0x0 0x20000000 + + 0x1000000 0x0 0x0 + 0x1000000 0x0 0x0 + 0x0 0x10000>; + }; + }; +}; From owner-svn-src-all@FreeBSD.ORG Thu Nov 17 12:17:40 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 95FB6106567D; Thu, 17 Nov 2011 12:17:40 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8312E8FC1A; Thu, 17 Nov 2011 12:17:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAHCHeb4005833; Thu, 17 Nov 2011 12:17:40 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAHCHeLG005827; Thu, 17 Nov 2011 12:17:40 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201111171217.pAHCHeLG005827@svn.freebsd.org> From: Luigi Rizzo Date: Thu, 17 Nov 2011 12:17:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227614 - in head: share/man/man4 sys/dev/netmap sys/net tools/tools tools/tools/netmap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2011 12:17:40 -0000 Author: luigi Date: Thu Nov 17 12:17:39 2011 New Revision: 227614 URL: http://svn.freebsd.org/changeset/base/227614 Log: Bring in support for netmap, a framework for very efficient packet I/O from userspace, capable of line rate at 10G, see http://info.iet.unipi.it/~luigi/netmap/ At this time I am bringing in only the generic code (sys/dev/netmap/ plus two headers under sys/net/), and some sample applications in tools/tools/netmap. There is also a manpage in share/man/man4 [1] In order to make use of the framework you need to build a kernel with "device netmap", and patch individual drivers with the code that you can find in sys/dev/netmap/head.diff The file will go away as the relevant pieces are committed to the various device drivers, which should happen in a few days after talking to the driver maintainers. Netmap support is available at the moment for Intel 10G and 1G cards (ixgbe, em/lem/igb), and for the Realtek 1G card ("re"). I have partial patches for "bge" and am starting to work on "cxgbe". Hopefully changes are trivial enough so interested third parties can submit their patches. Interested people can contact me for advice on how to add netmap support to specific devices. CREDITS: Netmap has been developed by Luigi Rizzo and other collaborators at the Universita` di Pisa, and supported by EU project CHANGE (http://www.change-project.eu/) The code is distributed under a BSD Copyright. [1] In my opinion is a bad idea to have all manpage in one directory. We should place kernel documentation in the same dir that contains the code, which would make it much simpler to keep doc and code in sync, reduce the clutter in share/man/ and incidentally is the policy used for all of userspace code. Makefiles and doc tools can be trivially adjusted to find the manpages in the relevant subdirs. Added: head/share/man/man4/netmap.4 (contents, props changed) head/sys/dev/netmap/ head/sys/dev/netmap/head.diff (contents, props changed) head/sys/dev/netmap/if_em_netmap.h (contents, props changed) head/sys/dev/netmap/if_igb_netmap.h (contents, props changed) head/sys/dev/netmap/if_lem_netmap.h (contents, props changed) head/sys/dev/netmap/if_re_netmap.h (contents, props changed) head/sys/dev/netmap/ixgbe_netmap.h (contents, props changed) head/sys/dev/netmap/netmap.c (contents, props changed) head/sys/dev/netmap/netmap_kern.h (contents, props changed) head/sys/net/netmap.h (contents, props changed) head/sys/net/netmap_user.h (contents, props changed) head/tools/tools/netmap/ head/tools/tools/netmap/Makefile (contents, props changed) head/tools/tools/netmap/README (contents, props changed) head/tools/tools/netmap/bridge.c (contents, props changed) head/tools/tools/netmap/click-test.cfg (contents, props changed) head/tools/tools/netmap/pcap.c (contents, props changed) head/tools/tools/netmap/pkt-gen.c (contents, props changed) Modified: head/share/man/man4/Makefile head/tools/tools/README Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Thu Nov 17 12:08:12 2011 (r227613) +++ head/share/man/man4/Makefile Thu Nov 17 12:17:39 2011 (r227614) @@ -253,6 +253,7 @@ MAN= aac.4 \ net80211.4 \ netgraph.4 \ netintro.4 \ + netmap.4 \ ${_nfe.4} \ ${_nfsmb.4} \ ng_async.4 \ Added: head/share/man/man4/netmap.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/netmap.4 Thu Nov 17 12:17:39 2011 (r227614) @@ -0,0 +1,300 @@ +.\" Copyright (c) 2011 Matteo Landi, Luigi Rizzo, Universita` di Pisa +.\" 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. +.\" +.\" This document is derived in part from the enet man page (enet.4) +.\" distributed with 4.3BSD Unix. +.\" +.\" $FreeBSD$ +.\" $Id: netmap.4 9662 2011-11-16 13:18:06Z luigi $: stable/8/share/man/man4/bpf.4 181694 2008-08-13 17:45:06Z ed $ +.\" +.Dd November 16, 2011 +.Dt NETMAP 4 +.Os +.Sh NAME +.Nm netmap +.Nd a framework for fast packet I/O +.Sh SYNOPSIS +.Cd device netmap +.Sh DESCRIPTION +.Nm +is a framework for fast and safe access to network devices +(reaching 14.88 Mpps at less than 1 GHz). +.Nm +uses memory mapped buffers and metadata +(buffer indexes and lengths) to communicate with the kernel, +which is in charge of validating information through +.Pa ioctl() +and +.Pa select()/poll(). +.Nm +can exploit the parallelism in multiqueue devices and +multicore systems. +.Pp +.Pp +.Nm +requires explicit support in device drivers. +For a list of supported devices, see the end of this manual page. +.Sh OPERATION +.Nm +clients must first open the +.Pa open("/dev/netmap") , +and then issue an +.Pa ioctl(...,NIOCREGIF,...) +to bind the file descriptor to a network device. +.Pp +When a device is put in +.Nm +mode, its data path is disconnected from the host stack. +The processes owning the file descriptor +can exchange packets with the device, or with the host stack, +through an mmapped memory region that contains pre-allocated +buffers and metadata. +.Pp +Non blocking I/O is done with special +.Pa ioctl()'s , +whereas the file descriptor can be passed to +.Pa select()/poll() +to be notified about incoming packet or available transmit buffers. +.Ss Data structures +All data structures for all devices in +.Nm +mode are in a memory +region shared by the kernel and all processes +who open +.Pa /dev/netmap +(NOTE: visibility may be restricted in future implementations). +All references between the shared data structure +are relative (offsets or indexes). Some macros help converting +them into actual pointers. +.Pp +The data structures in shared memory are the following: +.Pp +.Bl -tag -width XXX +.It Dv struct netmap_if (one per interface) +indicates the number of rings supported by an interface, their +sizes, and the offsets of the +.Pa netmap_rings +associated to the interface. +The offset of a +.Pa struct netmap_if +in the shared memory region is indicated by the +.Pa nr_offset +field in the structure returned by the +.Pa NIOCREGIF +(see below). +.Bd -literal +struct netmap_if { + char ni_name[IFNAMSIZ]; /* name of the interface. */ + const u_int ni_num_queues; /* number of hw ring pairs */ + const ssize_t ring_ofs[]; /* offset of tx and rx rings */ +}; +.Ed +.It Dv struct netmap_ring (one per ring) +contains the index of the current read or write slot (cur), +the number of slots available for reception or transmission (avail), +and an array of +.Pa slots +describing the buffers. +There is one ring pair for each of the N hardware ring pairs +supported by the card (numbered 0..N-1), plus +one ring pair (numbered N) for packets from/to the host stack. +.Bd -literal +struct netmap_ring { + const ssize_t buf_ofs; + const uint32_t num_slots; /* number of slots in the ring. */ + uint32_t avail; /* number of usable slots */ + uint32_t cur; /* 'current' index for the user side */ + + const uint16_t nr_buf_size; + uint16_t flags; + struct netmap_slot slot[0]; /* array of slots. */ +} +.Ed +.It Dv struct netmap_slot (one per packet) +contains the metadata for a packet: a buffer index (buf_idx), +a buffer length (len), and some flags. +.Bd -literal +struct netmap_slot { + uint32_t buf_idx; /* buffer index */ + uint16_t len; /* packet length */ + uint16_t flags; /* buf changed, etc. */ +#define NS_BUF_CHANGED 0x0001 /* must resync, buffer changed */ +#define NS_REPORT 0x0002 /* tell hw to report results + * e.g. by generating an interrupt + */ +}; +.Ed +.It Dv packet buffers +are fixed size (approximately 2k) buffers allocated by the kernel +that contain packet data. Buffers addresses are computed through +macros. +.El +.Pp +Some macros support the access to objects in the shared memory +region. In particular: +.Bd -literal +struct netmap_if *nifp; +... +struct netmap_ring *txring = NETMAP_TXRING(nifp, i); +struct netmap_ring *rxring = NETMAP_RXRING(nifp, i); +int i = txring->slot[txring->cur].buf_idx; +char *buf = NETMAP_BUF(txring, i); +.Ed +.Ss IOCTLS +.Pp +.Nm +supports some ioctl() to synchronize the state of the rings +between the kernel and the user processes, plus some +to query and configure the interface. +The former do not require any argument, whereas the latter +use a +.Pa struct netmap_req +defined as follows: +.Bd -literal +struct nmreq { + char nr_name[IFNAMSIZ]; + uint32_t nr_offset; /* nifp offset in the shared region */ + uint32_t nr_memsize; /* size of the shared region */ + uint32_t nr_numdescs; /* descriptors per queue */ + uint16_t nr_numqueues; + uint16_t nr_ringid; /* ring(s) we care about */ +#define NETMAP_HW_RING 0x4000 /* low bits indicate one hw ring */ +#define NETMAP_SW_RING 0x2000 /* we process the sw ring */ +#define NETMAP_NO_TX_POLL 0x1000 /* no gratuitous txsync on poll */ +#define NETMAP_RING_MASK 0xfff /* the actual ring number */ +}; + +.Ed +A device descriptor obtained through +.Pa /dev/netmap +also supports the ioctl supported by network devices. +.Pp +The netmap-specific +.Xr ioctl 2 +command codes below are defined in +.In net/netmap.h +and are: +.Bl -tag -width XXXX +.It Dv NIOCGINFO +returns information about the interface named in nr_name. +On return, nr_memsize indicates the size of the shared netmap +memory region (this is device-independent), +nr_numslots indicates how many buffers are in a ring, +nr_numrings indicates the number of rings supported by the hardware. +.Pp +If the device does not support netmap, the ioctl returns EINVAL. +.It Dv NIOCREGIF +puts the interface named in nr_name into netmap mode, disconnecting +it from the host stack, and/or defines which rings are controlled +through this file descriptor. +On return, it gives the same info as NIOCGINFO, and nr_ringid +indicates the identity of the rings controlled through the file +descriptor. +.Pp +Possible values for nr_ringid are +.Bl -tag -width XXXXX +.It 0 +default, all hardware rings +.It NETMAP_SW_RING +the ``host rings'' connecting to the host stack +.It NETMAP_HW_RING + i +the i-th hardware ring +.El +By default, a +.Nm poll +or +.Nm select +call pushes out any pending packets on the transmit ring, even if +no write events are specified. +The feature can be disabled by or-ing +.Nm NETMAP_NO_TX_SYNC +to nr_ringid. +But normally you should keep this feature unless you are using +separate file descriptors for the send and receive rings, because +otherwise packets are pushed out only if NETMAP_TXSYNC is called, +or the send queue is full. +.Pp +.Pa NIOCREGIF +can be used multiple times to change the association of a +file descriptor to a ring pair, always within the same device. +.It Dv NIOCUNREGIF +brings an interface back to normal mode. +.It Dv NIOCTXSYNC +tells the hardware of new packets to transmit, and updates the +number of slots available for transmission. +.It Dv NIOCRXSYNC +tells the hardware of consumed packets, and asks for newly available +packets. +.El +.Ss SYSTEM CALLS +.Nm +uses +.Nm select +and +.Nm poll +to wake up processes when significant events occur. +.Sh EXAMPLES +The following code implements a traffic generator +.Pp +.Bd -literal -compact +#include +#include +struct netmap_if *nifp; +struct netmap_ring *ring; +struct netmap_request nmr; + +fd = open("/dev/netmap", O_RDWR); +bzero(&nmr, sizeof(nmr)); +strcpy(nmr.nm_name, "ix0"); +ioctl(fd, NIOCREG, &nmr); +p = mmap(0, nmr.memsize, fd); +nifp = NETMAP_IF(p, nmr.offset); +ring = NETMAP_TXRING(nifp, 0); +fds.fd = fd; +fds.events = POLLOUT; +for (;;) { + poll(list, 1, -1); + while (ring->avail-- > 0) { + i = ring->cur; + buf = NETMAP_BUF(ring, ring->slot[i].buf_index); + ... prepare packet in buf ... + ring->slot[i].len = ... packet length ... + ring->cur = NETMAP_RING_NEXT(ring, i); + } +} +.Ed +.Sh SUPPORTED INTERFACES +.Nm +supports the following interfaces: +.Xr em 4 , +.Xr ixgbe 4 , +.Xr re 4 , +.Sh AUTHORS +The +.Nm +framework has been designed and implemented by +.An Luigi Rizzo +and +.An Matteo Landi +in 2011 at the Universita` di Pisa. Added: head/sys/dev/netmap/head.diff ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/netmap/head.diff Thu Nov 17 12:17:39 2011 (r227614) @@ -0,0 +1,654 @@ +Index: conf/NOTES +=================================================================== +--- conf/NOTES (revision 227552) ++++ conf/NOTES (working copy) +@@ -799,6 +799,12 @@ + # option. DHCP requires bpf. + device bpf + ++# The `netmap' device implements memory-mapped access to network ++# devices from userspace, enabling wire-speed packet capture and ++# generation even at 10Gbit/s. Requires support in the device ++# driver. Supported drivers are ixgbe, e1000, re. ++device netmap ++ + # The `disc' device implements a minimal network interface, + # which throws away all packets sent and never receives any. It is + # included for testing and benchmarking purposes. +Index: conf/files +=================================================================== +--- conf/files (revision 227552) ++++ conf/files (working copy) +@@ -1507,6 +1507,7 @@ + dev/my/if_my.c optional my + dev/ncv/ncr53c500.c optional ncv + dev/ncv/ncr53c500_pccard.c optional ncv pccard ++dev/netmap/netmap.c optional netmap + dev/nge/if_nge.c optional nge + dev/nxge/if_nxge.c optional nxge + dev/nxge/xgehal/xgehal-device.c optional nxge +Index: conf/options +=================================================================== +--- conf/options (revision 227552) ++++ conf/options (working copy) +@@ -689,6 +689,7 @@ + + # various 'device presence' options. + DEV_BPF opt_bpf.h ++DEV_NETMAP opt_global.h + DEV_MCA opt_mca.h + DEV_CARP opt_carp.h + DEV_SPLASH opt_splash.h +Index: dev/e1000/if_igb.c +=================================================================== +--- dev/e1000/if_igb.c (revision 227552) ++++ dev/e1000/if_igb.c (working copy) +@@ -369,6 +369,9 @@ + &igb_rx_process_limit, 0, + "Maximum number of received packets to process at a time, -1 means unlimited"); + ++#ifdef DEV_NETMAP ++#include ++#endif /* DEV_NETMAP */ + /********************************************************************* + * Device identification routine + * +@@ -664,6 +667,9 @@ + adapter->led_dev = led_create(igb_led_func, adapter, + device_get_nameunit(dev)); + ++#ifdef DEV_NETMAP ++ igb_netmap_attach(adapter); ++#endif /* DEV_NETMAP */ + INIT_DEBUGOUT("igb_attach: end"); + + return (0); +@@ -742,6 +748,9 @@ + + callout_drain(&adapter->timer); + ++#ifdef DEV_NETMAP ++ netmap_detach(adapter->ifp); ++#endif /* DEV_NETMAP */ + igb_free_pci_resources(adapter); + bus_generic_detach(dev); + if_free(ifp); +@@ -3212,6 +3221,10 @@ + struct adapter *adapter = txr->adapter; + struct igb_tx_buffer *txbuf; + int i; ++#ifdef DEV_NETMAP ++ struct netmap_slot *slot = netmap_reset(NA(adapter->ifp), ++ NR_TX, txr->me, 0); ++#endif + + /* Clear the old descriptor contents */ + IGB_TX_LOCK(txr); +@@ -3231,6 +3244,13 @@ + m_freem(txbuf->m_head); + txbuf->m_head = NULL; + } ++#ifdef DEV_NETMAP ++ if (slot) { ++ netmap_load_map(txr->txtag, txbuf->map, ++ NMB(slot), adapter->rx_mbuf_sz); ++ slot++; ++ } ++#endif /* DEV_NETMAP */ + /* clear the watch index */ + txbuf->next_eop = -1; + } +@@ -3626,6 +3646,19 @@ + + IGB_TX_LOCK_ASSERT(txr); + ++#ifdef DEV_NETMAP ++ if (ifp->if_capenable & IFCAP_NETMAP) { ++ struct netmap_adapter *na = NA(ifp); ++ ++ selwakeuppri(&na->tx_rings[txr->me].si, PI_NET); ++ IGB_TX_UNLOCK(txr); ++ IGB_CORE_LOCK(adapter); ++ selwakeuppri(&na->tx_rings[na->num_queues + 1].si, PI_NET); ++ IGB_CORE_UNLOCK(adapter); ++ IGB_TX_LOCK(txr); // the caller is supposed to own the lock ++ return FALSE; ++ } ++#endif /* DEV_NETMAP */ + if (txr->tx_avail == adapter->num_tx_desc) { + txr->queue_status = IGB_QUEUE_IDLE; + return FALSE; +@@ -3949,6 +3982,10 @@ + bus_dma_segment_t pseg[1], hseg[1]; + struct lro_ctrl *lro = &rxr->lro; + int rsize, nsegs, error = 0; ++#ifdef DEV_NETMAP ++ struct netmap_slot *slot = netmap_reset(NA(rxr->adapter->ifp), ++ NR_RX, rxr->me, 0); ++#endif + + adapter = rxr->adapter; + dev = adapter->dev; +@@ -3974,6 +4011,18 @@ + struct mbuf *mh, *mp; + + rxbuf = &rxr->rx_buffers[j]; ++#ifdef DEV_NETMAP ++ if (slot) { ++ netmap_load_map(rxr->ptag, ++ rxbuf->pmap, NMB(slot), ++ adapter->rx_mbuf_sz); ++ /* Update descriptor */ ++ rxr->rx_base[j].read.pkt_addr = ++ htole64(vtophys(NMB(slot))); ++ slot++; ++ continue; ++ } ++#endif /* DEV_NETMAP */ + if (rxr->hdr_split == FALSE) + goto skip_head; + +@@ -4436,6 +4485,19 @@ + bus_dmamap_sync(rxr->rxdma.dma_tag, rxr->rxdma.dma_map, + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); + ++#ifdef DEV_NETMAP ++ if (ifp->if_capenable & IFCAP_NETMAP) { ++ struct netmap_adapter *na = NA(ifp); ++ ++ selwakeuppri(&na->rx_rings[rxr->me].si, PI_NET); ++ IGB_RX_UNLOCK(rxr); ++ IGB_CORE_LOCK(adapter); ++ selwakeuppri(&na->rx_rings[na->num_queues + 1].si, PI_NET); ++ IGB_CORE_UNLOCK(adapter); ++ return (0); ++ } ++#endif /* DEV_NETMAP */ ++ + /* Main clean loop */ + for (i = rxr->next_to_check; count != 0;) { + struct mbuf *sendmp, *mh, *mp; +Index: dev/e1000/if_lem.c +=================================================================== +--- dev/e1000/if_lem.c (revision 227552) ++++ dev/e1000/if_lem.c (working copy) +@@ -316,6 +316,10 @@ + /* Global used in WOL setup with multiport cards */ + static int global_quad_port_a = 0; + ++#ifdef DEV_NETMAP ++#include ++#endif /* DEV_NETMAP */ ++ + /********************************************************************* + * Device identification routine + * +@@ -646,6 +650,9 @@ + adapter->led_dev = led_create(lem_led_func, adapter, + device_get_nameunit(dev)); + ++#ifdef DEV_NETMAP ++ lem_netmap_attach(adapter); ++#endif /* DEV_NETMAP */ + INIT_DEBUGOUT("lem_attach: end"); + + return (0); +@@ -724,6 +731,9 @@ + callout_drain(&adapter->timer); + callout_drain(&adapter->tx_fifo_timer); + ++#ifdef DEV_NETMAP ++ netmap_detach(ifp); ++#endif /* DEV_NETMAP */ + lem_free_pci_resources(adapter); + bus_generic_detach(dev); + if_free(ifp); +@@ -2637,6 +2647,9 @@ + lem_setup_transmit_structures(struct adapter *adapter) + { + struct em_buffer *tx_buffer; ++#ifdef DEV_NETMAP ++ struct netmap_slot *slot = netmap_reset(NA(adapter->ifp), NR_TX, 0, 0); ++#endif + + /* Clear the old ring contents */ + bzero(adapter->tx_desc_base, +@@ -2650,6 +2663,15 @@ + bus_dmamap_unload(adapter->txtag, tx_buffer->map); + m_freem(tx_buffer->m_head); + tx_buffer->m_head = NULL; ++#ifdef DEV_NETMAP ++ if (slot) { ++ /* reload the map for netmap mode */ ++ netmap_load_map(adapter->txtag, ++ tx_buffer->map, NMB(slot), ++ NA(adapter->ifp)->buff_size); ++ slot++; ++ } ++#endif /* DEV_NETMAP */ + tx_buffer->next_eop = -1; + } + +@@ -2951,6 +2973,12 @@ + + EM_TX_LOCK_ASSERT(adapter); + ++#ifdef DEV_NETMAP ++ if (ifp->if_capenable & IFCAP_NETMAP) { ++ selwakeuppri(&NA(ifp)->tx_rings[0].si, PI_NET); ++ return; ++ } ++#endif /* DEV_NETMAP */ + if (adapter->num_tx_desc_avail == adapter->num_tx_desc) + return; + +@@ -3181,6 +3209,9 @@ + { + struct em_buffer *rx_buffer; + int i, error; ++#ifdef DEV_NETMAP ++ struct netmap_slot *slot = netmap_reset(NA(adapter->ifp), NR_RX, 0, 0); ++#endif + + /* Reset descriptor ring */ + bzero(adapter->rx_desc_base, +@@ -3200,6 +3231,18 @@ + + /* Allocate new ones. */ + for (i = 0; i < adapter->num_rx_desc; i++) { ++#ifdef DEV_NETMAP ++ if (slot) { ++ netmap_load_map(adapter->rxtag, ++ rx_buffer->map, NMB(slot), ++ NA(adapter->ifp)->buff_size); ++ /* Update descriptor */ ++ adapter->rx_desc_base[i].buffer_addr = ++ htole64(vtophys(NMB(slot))); ++ slot++; ++ continue; ++ } ++#endif /* DEV_NETMAP */ + error = lem_get_buf(adapter, i); + if (error) + return (error); +@@ -3407,6 +3450,14 @@ + bus_dmamap_sync(adapter->rxdma.dma_tag, adapter->rxdma.dma_map, + BUS_DMASYNC_POSTREAD); + ++#ifdef DEV_NETMAP ++ if (ifp->if_capenable & IFCAP_NETMAP) { ++ selwakeuppri(&NA(ifp)->rx_rings[0].si, PI_NET); ++ EM_RX_UNLOCK(adapter); ++ return (0); ++ } ++#endif /* DEV_NETMAP */ ++ + if (!((current_desc->status) & E1000_RXD_STAT_DD)) { + if (done != NULL) + *done = rx_sent; +Index: dev/e1000/if_em.c +=================================================================== +--- dev/e1000/if_em.c (revision 227552) ++++ dev/e1000/if_em.c (working copy) +@@ -399,6 +399,10 @@ + /* Global used in WOL setup with multiport cards */ + static int global_quad_port_a = 0; + ++#ifdef DEV_NETMAP ++#include ++#endif /* DEV_NETMAP */ ++ + /********************************************************************* + * Device identification routine + * +@@ -714,6 +718,9 @@ + + adapter->led_dev = led_create(em_led_func, adapter, + device_get_nameunit(dev)); ++#ifdef DEV_NETMAP ++ em_netmap_attach(adapter); ++#endif /* DEV_NETMAP */ + + INIT_DEBUGOUT("em_attach: end"); + +@@ -785,6 +792,10 @@ + ether_ifdetach(adapter->ifp); + callout_drain(&adapter->timer); + ++#ifdef DEV_NETMAP ++ netmap_detach(ifp); ++#endif /* DEV_NETMAP */ ++ + em_free_pci_resources(adapter); + bus_generic_detach(dev); + if_free(ifp); +@@ -3213,6 +3224,10 @@ + struct adapter *adapter = txr->adapter; + struct em_buffer *txbuf; + int i; ++#ifdef DEV_NETMAP ++ struct netmap_slot *slot = netmap_reset(NA(adapter->ifp), ++ NR_TX, txr->me, 0); ++#endif + + /* Clear the old descriptor contents */ + EM_TX_LOCK(txr); +@@ -3232,6 +3247,16 @@ + m_freem(txbuf->m_head); + txbuf->m_head = NULL; + } ++#ifdef DEV_NETMAP ++ if (slot) { ++ /* reload the map for netmap mode */ ++ netmap_load_map(txr->txtag, ++ txbuf->map, NMB(slot), ++ adapter->rx_mbuf_sz); ++ slot++; ++ } ++#endif /* DEV_NETMAP */ ++ + /* clear the watch index */ + txbuf->next_eop = -1; + } +@@ -3682,6 +3707,12 @@ + struct ifnet *ifp = adapter->ifp; + + EM_TX_LOCK_ASSERT(txr); ++#ifdef DEV_NETMAP ++ if (ifp->if_capenable & IFCAP_NETMAP) { ++ selwakeuppri(&NA(ifp)->tx_rings[txr->me].si, PI_NET); ++ return (FALSE); ++ } ++#endif /* DEV_NETMAP */ + + /* No work, make sure watchdog is off */ + if (txr->tx_avail == adapter->num_tx_desc) { +@@ -3978,6 +4009,33 @@ + if (++j == adapter->num_rx_desc) + j = 0; + } ++#ifdef DEV_NETMAP ++ { ++ /* slot is NULL if we are not in netmap mode */ ++ struct netmap_slot *slot = netmap_reset(NA(adapter->ifp), ++ NR_RX, rxr->me, rxr->next_to_check); ++ /* ++ * we need to restore all buffer addresses in the ring as they might ++ * be in the wrong state if we are exiting from netmap mode. ++ */ ++ for (j = 0; j != adapter->num_rx_desc; ++j) { ++ void *addr; ++ rxbuf = &rxr->rx_buffers[j]; ++ if (rxbuf->m_head == NULL && !slot) ++ continue; ++ addr = slot ? NMB(slot) : rxbuf->m_head->m_data; ++ // XXX load or reload ? ++ netmap_load_map(rxr->rxtag, rxbuf->map, addr, adapter->rx_mbuf_sz); ++ /* Update descriptor */ ++ rxr->rx_base[j].buffer_addr = htole64(vtophys(addr)); ++ bus_dmamap_sync(rxr->rxtag, rxbuf->map, BUS_DMASYNC_PREREAD); ++ if (slot) ++ slot++; ++ } ++ /* Setup our descriptor indices */ ++ NA(adapter->ifp)->rx_rings[rxr->me].nr_hwcur = rxr->next_to_check; ++ } ++#endif /* DEV_NETMAP */ + + fail: + rxr->next_to_refresh = i; +@@ -4247,6 +4305,14 @@ + + EM_RX_LOCK(rxr); + ++#ifdef DEV_NETMAP ++ if (ifp->if_capenable & IFCAP_NETMAP) { ++ selwakeuppri(&NA(ifp)->rx_rings[rxr->me].si, PI_NET); ++ EM_RX_UNLOCK(rxr); ++ return (0); ++ } ++#endif /* DEV_NETMAP */ ++ + for (i = rxr->next_to_check, processed = 0; count != 0;) { + + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) +Index: dev/re/if_re.c +=================================================================== +--- dev/re/if_re.c (revision 227552) ++++ dev/re/if_re.c (working copy) +@@ -291,6 +291,10 @@ + static void re_setwol (struct rl_softc *); + static void re_clrwol (struct rl_softc *); + ++#ifdef DEV_NETMAP ++#include ++#endif /* !DEV_NETMAP */ ++ + #ifdef RE_DIAG + static int re_diag (struct rl_softc *); + #endif +@@ -1583,6 +1587,9 @@ + */ + ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header); + ++#ifdef DEV_NETMAP ++ re_netmap_attach(sc); ++#endif /* DEV_NETMAP */ + #ifdef RE_DIAG + /* + * Perform hardware diagnostic on the original RTL8169. +@@ -1778,6 +1785,9 @@ + bus_dma_tag_destroy(sc->rl_ldata.rl_stag); + } + ++#ifdef DEV_NETMAP ++ netmap_detach(ifp); ++#endif /* DEV_NETMAP */ + if (sc->rl_parent_tag) + bus_dma_tag_destroy(sc->rl_parent_tag); + +@@ -1952,6 +1962,9 @@ + sc->rl_ldata.rl_tx_desc_cnt * sizeof(struct rl_desc)); + for (i = 0; i < sc->rl_ldata.rl_tx_desc_cnt; i++) + sc->rl_ldata.rl_tx_desc[i].tx_m = NULL; ++#ifdef DEV_NETMAP ++ re_netmap_tx_init(sc); ++#endif /* DEV_NETMAP */ + /* Set EOR. */ + desc = &sc->rl_ldata.rl_tx_list[sc->rl_ldata.rl_tx_desc_cnt - 1]; + desc->rl_cmdstat |= htole32(RL_TDESC_CMD_EOR); +@@ -1979,6 +1992,9 @@ + if ((error = re_newbuf(sc, i)) != 0) + return (error); + } ++#ifdef DEV_NETMAP ++ re_netmap_rx_init(sc); ++#endif /* DEV_NETMAP */ + + /* Flush the RX descriptors */ + +@@ -2035,6 +2051,12 @@ + RL_LOCK_ASSERT(sc); + + ifp = sc->rl_ifp; ++#ifdef DEV_NETMAP ++ if (ifp->if_capenable & IFCAP_NETMAP) { ++ selwakeuppri(&NA(ifp)->rx_rings->si, PI_NET); ++ return 0; ++ } ++#endif /* DEV_NETMAP */ + if (ifp->if_mtu > RL_MTU && (sc->rl_flags & RL_FLAG_JUMBOV2) != 0) + jumbo = 1; + else +@@ -2276,6 +2298,12 @@ + return; + + ifp = sc->rl_ifp; ++#ifdef DEV_NETMAP ++ if (ifp->if_capenable & IFCAP_NETMAP) { ++ selwakeuppri(&NA(ifp)->tx_rings[0].si, PI_NET); ++ return; ++ } ++#endif /* DEV_NETMAP */ + /* Invalidate the TX descriptor list */ + bus_dmamap_sync(sc->rl_ldata.rl_tx_list_tag, + sc->rl_ldata.rl_tx_list_map, +@@ -2794,6 +2822,20 @@ + + sc = ifp->if_softc; + ++#ifdef DEV_NETMAP ++ if (ifp->if_capenable & IFCAP_NETMAP) { ++ struct netmap_kring *kring = &NA(ifp)->tx_rings[0]; ++ if (sc->rl_ldata.rl_tx_prodidx != kring->nr_hwcur) { ++ /* kick the tx unit */ ++ CSR_WRITE_1(sc, sc->rl_txstart, RL_TXSTART_START); ++#ifdef RE_TX_MODERATION ++ CSR_WRITE_4(sc, RL_TIMERCNT, 1); ++#endif ++ sc->rl_watchdog_timer = 5; ++ } ++ return; ++ } ++#endif /* DEV_NETMAP */ + if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != + IFF_DRV_RUNNING || (sc->rl_flags & RL_FLAG_LINK) == 0) + return; +Index: dev/ixgbe/ixgbe.c +=================================================================== +--- dev/ixgbe/ixgbe.c (revision 227552) ++++ dev/ixgbe/ixgbe.c (working copy) +@@ -313,6 +313,10 @@ + static int fdir_pballoc = 1; + #endif + ++#ifdef DEV_NETMAP ++#include ++#endif /* DEV_NETMAP */ ++ + /********************************************************************* + * Device identification routine + * +@@ -578,6 +582,9 @@ + + ixgbe_add_hw_stats(adapter); + ++#ifdef DEV_NETMAP ++ ixgbe_netmap_attach(adapter); ++#endif /* DEV_NETMAP */ + INIT_DEBUGOUT("ixgbe_attach: end"); + return (0); + err_late: +@@ -652,6 +659,9 @@ + + ether_ifdetach(adapter->ifp); + callout_drain(&adapter->timer); ++#ifdef DEV_NETMAP ++ netmap_detach(adapter->ifp); ++#endif /* DEV_NETMAP */ + ixgbe_free_pci_resources(adapter); + bus_generic_detach(dev); + if_free(adapter->ifp); +@@ -1719,6 +1729,7 @@ + if (++i == adapter->num_tx_desc) + i = 0; + ++ // XXX should we sync each buffer ? + txbuf->m_head = NULL; + txbuf->eop_index = -1; + } +@@ -2813,6 +2824,10 @@ + struct adapter *adapter = txr->adapter; + struct ixgbe_tx_buf *txbuf; + int i; ++#ifdef DEV_NETMAP ++ struct netmap_slot *slot = netmap_reset(NA(adapter->ifp), ++ NR_TX, txr->me, 0); ++#endif + + /* Clear the old ring contents */ + IXGBE_TX_LOCK(txr); +@@ -2832,6 +2847,13 @@ + m_freem(txbuf->m_head); + txbuf->m_head = NULL; + } ++#ifdef DEV_NETMAP ++ if (slot) { ++ netmap_load_map(txr->txtag, txbuf->map, ++ NMB(slot), adapter->rx_mbuf_sz); ++ slot++; ++ } ++#endif /* DEV_NETMAP */ + /* Clear the EOP index */ + txbuf->eop_index = -1; + } +@@ -3310,6 +3332,20 @@ + + mtx_assert(&txr->tx_mtx, MA_OWNED); + ++#ifdef DEV_NETMAP ++ if (ifp->if_capenable & IFCAP_NETMAP) { ++ struct netmap_adapter *na = NA(ifp); ++ ++ selwakeuppri(&na->tx_rings[txr->me].si, PI_NET); ++ IXGBE_TX_UNLOCK(txr); ++ IXGBE_CORE_LOCK(adapter); ++ selwakeuppri(&na->tx_rings[na->num_queues + 1].si, PI_NET); ++ IXGBE_CORE_UNLOCK(adapter); ++ IXGBE_TX_LOCK(txr); // the caller is supposed to own the lock ++ return (FALSE); ++ } ++#endif /* DEV_NETMAP */ ++ + if (txr->tx_avail == adapter->num_tx_desc) { + txr->queue_status = IXGBE_QUEUE_IDLE; + return FALSE; +@@ -3698,6 +3734,10 @@ + bus_dma_segment_t pseg[1], hseg[1]; + struct lro_ctrl *lro = &rxr->lro; + int rsize, nsegs, error = 0; ++#ifdef DEV_NETMAP ++ struct netmap_slot *slot = netmap_reset(NA(rxr->adapter->ifp), ++ NR_RX, rxr->me, 0); ++#endif /* DEV_NETMAP */ + + adapter = rxr->adapter; + ifp = adapter->ifp; +@@ -3721,6 +3761,18 @@ + struct mbuf *mh, *mp; + + rxbuf = &rxr->rx_buffers[j]; ++#ifdef DEV_NETMAP ++ if (slot) { ++ netmap_load_map(rxr->ptag, ++ rxbuf->pmap, NMB(slot), ++ adapter->rx_mbuf_sz); ++ /* Update descriptor */ ++ rxr->rx_base[j].read.pkt_addr = ++ htole64(vtophys(NMB(slot))); ++ slot++; ++ continue; ++ } ++#endif /* DEV_NETMAP */ + /* + ** Don't allocate mbufs if not + ** doing header split, its wasteful +@@ -4148,6 +4200,18 @@ + + IXGBE_RX_LOCK(rxr); + ++#ifdef DEV_NETMAP ++ if (ifp->if_capenable & IFCAP_NETMAP) { ++ struct netmap_adapter *na = NA(ifp); ++ ++ selwakeuppri(&na->rx_rings[rxr->me].si, PI_NET); ++ IXGBE_RX_UNLOCK(rxr); ++ IXGBE_CORE_LOCK(adapter); ++ selwakeuppri(&na->rx_rings[na->num_queues + 1].si, PI_NET); ++ IXGBE_CORE_UNLOCK(adapter); ++ return (0); ++ } ++#endif /* DEV_NETMAP */ + for (i = rxr->next_to_check; count != 0;) { + struct mbuf *sendmp, *mh, *mp; + u32 rsc, ptype; Added: head/sys/dev/netmap/if_em_netmap.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/netmap/if_em_netmap.h Thu Nov 17 12:17:39 2011 (r227614) @@ -0,0 +1,383 @@ +/* + * Copyright (C) 2011 Matteo Landi, Luigi Rizzo. 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$ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Nov 17 12:22:09 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC28A106566B; Thu, 17 Nov 2011 12:22:09 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AB2B28FC15; Thu, 17 Nov 2011 12:22:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAHCM9HS006094; Thu, 17 Nov 2011 12:22:09 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAHCM96j006091; Thu, 17 Nov 2011 12:22:09 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201111171222.pAHCM96j006091@svn.freebsd.org> From: Christian Brueffer Date: Thu, 17 Nov 2011 12:22:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227615 - stable/9/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2011 12:22:09 -0000 Author: brueffer Date: Thu Nov 17 12:22:09 2011 New Revision: 227615 URL: http://svn.freebsd.org/changeset/base/227615 Log: MFC: r227271 Write QLogic consistently. Approved by: re (kib) Modified: stable/9/share/man/man4/qlxgb.4 Directory Properties: stable/9/share/man/man4/ (props changed) Modified: stable/9/share/man/man4/qlxgb.4 ============================================================================== --- stable/9/share/man/man4/qlxgb.4 Thu Nov 17 12:17:39 2011 (r227614) +++ stable/9/share/man/man4/qlxgb.4 Thu Nov 17 12:22:09 2011 (r227615) @@ -90,4 +90,4 @@ The .Nm driver was written by .An David C Somayajulu -at Qlogic Corporation. +at QLogic Corporation. From owner-svn-src-all@FreeBSD.ORG Thu Nov 17 12:23:24 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 953D2106564A; Thu, 17 Nov 2011 12:23:24 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 84E1C8FC17; Thu, 17 Nov 2011 12:23:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAHCNOGG006186; Thu, 17 Nov 2011 12:23:24 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAHCNO8i006184; Thu, 17 Nov 2011 12:23:24 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201111171223.pAHCNO8i006184@svn.freebsd.org> From: Christian Brueffer Date: Thu, 17 Nov 2011 12:23:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227616 - releng/9.0/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2011 12:23:24 -0000 Author: brueffer Date: Thu Nov 17 12:23:24 2011 New Revision: 227616 URL: http://svn.freebsd.org/changeset/base/227616 Log: MFC: r227271 Write QLogic consistently. Approved by: re (kib) Modified: releng/9.0/share/man/man4/qlxgb.4 Directory Properties: releng/9.0/share/man/man4/ (props changed) Modified: releng/9.0/share/man/man4/qlxgb.4 ============================================================================== --- releng/9.0/share/man/man4/qlxgb.4 Thu Nov 17 12:22:09 2011 (r227615) +++ releng/9.0/share/man/man4/qlxgb.4 Thu Nov 17 12:23:24 2011 (r227616) @@ -90,4 +90,4 @@ The .Nm driver was written by .An David C Somayajulu -at Qlogic Corporation. +at QLogic Corporation. From owner-svn-src-all@FreeBSD.ORG Thu Nov 17 12:23:36 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 89167106567C; Thu, 17 Nov 2011 12:23:36 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 335288FC18; Thu, 17 Nov 2011 12:23:35 +0000 (UTC) Received: from localhost (58.wheelsystems.com [83.12.187.58]) by mail.dawidek.net (Postfix) with ESMTPSA id 716D6CB1; Thu, 17 Nov 2011 13:23:34 +0100 (CET) Date: Thu, 17 Nov 2011 13:22:41 +0100 From: Pawel Jakub Dawidek To: Gleb Smirnoff Message-ID: <20111117122241.GA2051@garage.freebsd.pl> References: <201111151259.pAFCx7TW099261@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="2oS5YaxWCcQjTEyO" Content-Disposition: inline In-Reply-To: <201111151259.pAFCx7TW099261@svn.freebsd.org> X-OS: FreeBSD 9.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 Subject: Re: svn commit: r227528 - head/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2011 12:23:36 -0000 --2oS5YaxWCcQjTEyO Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Nov 15, 2011 at 12:59:07PM +0000, Gleb Smirnoff wrote: > Author: glebius > Date: Tue Nov 15 12:59:07 2011 > New Revision: 227528 > URL: http://svn.freebsd.org/changeset/base/227528 >=20 > Log: > On some laptops it is important to re-open /dev/psm after resume. mouse= d(8) > was capable to do this upon SIGHUP for more than a decade. Automate this > via rc.resume in default installation. >=20 > Modified: > head/etc/rc.resume >=20 > Modified: head/etc/rc.resume > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/etc/rc.resume Tue Nov 15 09:23:21 2011 (r227527) > +++ head/etc/rc.resume Tue Nov 15 12:59:07 2011 (r227528) > @@ -49,6 +49,10 @@ if [ -r /var/run/rc.suspend.tch ]; then > /bin/rm -f /var/run/rc.suspend.tch > fi > =20 > +if [ -r /var/run/moused.pid ]; then > + kill -HUP `head -1 /var/run/moused.pid` > +fi You can use 'pkill -F /var/run/moused.pid'. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://yomoli.com --2oS5YaxWCcQjTEyO Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAk7E/JEACgkQForvXbEpPzTHZACgmLdYHhXJv8C0o583mfAPppic nXoAnjJrZ4rzOpgJIEOoH6uissOKQSlW =1Pqq -----END PGP SIGNATURE----- --2oS5YaxWCcQjTEyO-- From owner-svn-src-all@FreeBSD.ORG Thu Nov 17 12:25:16 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3097A1065670; Thu, 17 Nov 2011 12:25:16 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1FAB28FC08; Thu, 17 Nov 2011 12:25:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAHCPFxj006397; Thu, 17 Nov 2011 12:25:15 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAHCPF8N006395; Thu, 17 Nov 2011 12:25:15 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201111171225.pAHCPF8N006395@svn.freebsd.org> From: Christian Brueffer Date: Thu, 17 Nov 2011 12:25:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227617 - stable/9/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2011 12:25:16 -0000 Author: brueffer Date: Thu Nov 17 12:25:15 2011 New Revision: 227617 URL: http://svn.freebsd.org/changeset/base/227617 Log: MFC: r227276 Add qlxgb(4). Approved by: re (kib) Modified: stable/9/share/man/man4/altq.4 Directory Properties: stable/9/share/man/man4/ (props changed) Modified: stable/9/share/man/man4/altq.4 ============================================================================== --- stable/9/share/man/man4/altq.4 Thu Nov 17 12:23:24 2011 (r227616) +++ stable/9/share/man/man4/altq.4 Thu Nov 17 12:25:15 2011 (r227617) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 30, 2010 +.Dd November 6, 2011 .Dt ALTQ 4 .Os .Sh NAME @@ -150,6 +150,7 @@ They have been applied to the following .Xr nge 4 , .Xr npe 4 , .Xr nve 4 , +.Xr qlxgb 4 , .Xr ral 4 , .Xr re 4 , .Xr rl 4 , From owner-svn-src-all@FreeBSD.ORG Thu Nov 17 12:25:39 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 51A36106564A; Thu, 17 Nov 2011 12:25:39 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 412858FC0C; Thu, 17 Nov 2011 12:25:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAHCPdoC006451; Thu, 17 Nov 2011 12:25:39 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAHCPdFX006449; Thu, 17 Nov 2011 12:25:39 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201111171225.pAHCPdFX006449@svn.freebsd.org> From: Christian Brueffer Date: Thu, 17 Nov 2011 12:25:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227618 - releng/9.0/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2011 12:25:39 -0000 Author: brueffer Date: Thu Nov 17 12:25:38 2011 New Revision: 227618 URL: http://svn.freebsd.org/changeset/base/227618 Log: MFC: r227276 Add qlxgb(4). Approved by: re (kib) Modified: releng/9.0/share/man/man4/altq.4 Directory Properties: releng/9.0/share/man/man4/ (props changed) Modified: releng/9.0/share/man/man4/altq.4 ============================================================================== --- releng/9.0/share/man/man4/altq.4 Thu Nov 17 12:25:15 2011 (r227617) +++ releng/9.0/share/man/man4/altq.4 Thu Nov 17 12:25:38 2011 (r227618) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 30, 2010 +.Dd November 6, 2011 .Dt ALTQ 4 .Os .Sh NAME @@ -150,6 +150,7 @@ They have been applied to the following .Xr nge 4 , .Xr npe 4 , .Xr nve 4 , +.Xr qlxgb 4 , .Xr ral 4 , .Xr re 4 , .Xr rl 4 , From owner-svn-src-all@FreeBSD.ORG Thu Nov 17 12:27:20 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A98EF106564A; Thu, 17 Nov 2011 12:27:20 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 988DD8FC0A; Thu, 17 Nov 2011 12:27:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAHCRKcW006583; Thu, 17 Nov 2011 12:27:20 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAHCRKGo006581; Thu, 17 Nov 2011 12:27:20 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201111171227.pAHCRKGo006581@svn.freebsd.org> From: Christian Brueffer Date: Thu, 17 Nov 2011 12:27:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227619 - stable/9/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2011 12:27:20 -0000 Author: brueffer Date: Thu Nov 17 12:27:20 2011 New Revision: 227619 URL: http://svn.freebsd.org/changeset/base/227619 Log: MFC: r227448 Reword a sentence in the HARDWARE section a little to make it more suitable for automatic hardware notes generation. Approved by: re (kib) Modified: stable/9/share/man/man4/mps.4 Directory Properties: stable/9/share/man/man4/ (props changed) Modified: stable/9/share/man/man4/mps.4 ============================================================================== --- stable/9/share/man/man4/mps.4 Thu Nov 17 12:25:38 2011 (r227618) +++ stable/9/share/man/man4/mps.4 Thu Nov 17 12:27:20 2011 (r227619) @@ -60,9 +60,9 @@ driver provides support for LSI Logic Fu .Tn SAS controllers. .Sh HARDWARE -The following controllers are supported by the +The .Nm -driver +driver supports the following controllers: .Pp .Bl -bullet -compact .It From owner-svn-src-all@FreeBSD.ORG Thu Nov 17 12:28:00 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CAA591065673; Thu, 17 Nov 2011 12:28:00 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BA7EE8FC08; Thu, 17 Nov 2011 12:28:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAHCS0RZ006657; Thu, 17 Nov 2011 12:28:00 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAHCS0os006655; Thu, 17 Nov 2011 12:28:00 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201111171228.pAHCS0os006655@svn.freebsd.org> From: Christian Brueffer Date: Thu, 17 Nov 2011 12:28:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227620 - releng/9.0/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2011 12:28:00 -0000 Author: brueffer Date: Thu Nov 17 12:28:00 2011 New Revision: 227620 URL: http://svn.freebsd.org/changeset/base/227620 Log: MFC: r227448 Reword a sentence in the HARDWARE section a little to make it more suitable for automatic hardware notes generation. Approved by: re (kib) Modified: releng/9.0/share/man/man4/mps.4 Directory Properties: releng/9.0/share/man/man4/ (props changed) Modified: releng/9.0/share/man/man4/mps.4 ============================================================================== --- releng/9.0/share/man/man4/mps.4 Thu Nov 17 12:27:20 2011 (r227619) +++ releng/9.0/share/man/man4/mps.4 Thu Nov 17 12:28:00 2011 (r227620) @@ -60,9 +60,9 @@ driver provides support for LSI Logic Fu .Tn SAS controllers. .Sh HARDWARE -The following controllers are supported by the +The .Nm -driver +driver supports the following controllers: .Pp .Bl -bullet -compact .It From owner-svn-src-all@FreeBSD.ORG Thu Nov 17 12:37:51 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3D0D11065672; Thu, 17 Nov 2011 12:37:51 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2C20D8FC15; Thu, 17 Nov 2011 12:37:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAHCbpXc007155; Thu, 17 Nov 2011 12:37:51 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAHCbom9007153; Thu, 17 Nov 2011 12:37:50 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201111171237.pAHCbom9007153@svn.freebsd.org> From: Christian Brueffer Date: Thu, 17 Nov 2011 12:37:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227621 - stable/8/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2011 12:37:51 -0000 Author: brueffer Date: Thu Nov 17 12:37:50 2011 New Revision: 227621 URL: http://svn.freebsd.org/changeset/base/227621 Log: MFC: r227448 Reword a sentence in the HARDWARE section a little to make it more suitable for automatic hardware notes generation. Modified: stable/8/share/man/man4/mps.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/mps.4 ============================================================================== --- stable/8/share/man/man4/mps.4 Thu Nov 17 12:28:00 2011 (r227620) +++ stable/8/share/man/man4/mps.4 Thu Nov 17 12:37:50 2011 (r227621) @@ -60,9 +60,9 @@ driver provides support for LSI Logic Fu .Tn SAS controllers. .Sh HARDWARE -The following controllers are supported by the +The .Nm -driver +driver supports the following controllers: .Pp .Bl -bullet -compact .It From owner-svn-src-all@FreeBSD.ORG Thu Nov 17 12:43:04 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B629F1065672; Thu, 17 Nov 2011 12:43:04 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 5838B8FC14; Thu, 17 Nov 2011 12:43:04 +0000 (UTC) Received: from localhost (58.wheelsystems.com [83.12.187.58]) by mail.dawidek.net (Postfix) with ESMTPSA id DE49DCCC; Thu, 17 Nov 2011 13:43:02 +0100 (CET) Date: Thu, 17 Nov 2011 13:42:10 +0100 From: Pawel Jakub Dawidek To: Ken Smith Message-ID: <20111117124210.GB2051@garage.freebsd.pl> References: <201111151849.pAFInR3K012609@svn.freebsd.org> <20111116.232828.343708041526200614.nyan@FreeBSD.org> <4EC3D40A.5040204@freebsd.org> <1321457050.78238.10.camel@bauer.cse.buffalo.edu> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="LpQ9ahxlCli8rRTG" Content-Disposition: inline In-Reply-To: <1321457050.78238.10.camel@bauer.cse.buffalo.edu> X-OS: FreeBSD 9.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, Nathan Whitehorn , TAKAHASHI Yoshihiro Subject: Re: svn commit: r227536 - in head: release share/man/man7 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2011 12:43:04 -0000 --LpQ9ahxlCli8rRTG Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Nov 16, 2011 at 10:24:10AM -0500, Ken Smith wrote: > On Wed, 2011-11-16 at 09:17 -0600, Nathan Whitehorn wrote: > > On 11/16/11 08:28, TAKAHASHI Yoshihiro wrote: > > > In article<201111151849.pAFInR3K012609@svn.freebsd.org> > > > Nathan Whitehorn writes: > > > > > >> Log: > > >> Further automate production release generation by naming files th= e right > > >> things and generating checksums. > > >> > > >> Modified: head/release/generate-release.sh > > >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > > >> --- head/release/generate-release.sh Tue Nov 15 17:53:29 2011 (r2275= 35) > > >> +++ head/release/generate-release.sh Tue Nov 15 18:49:27 2011 (r2275= 36) > > >> @@ -65,3 +66,12 @@ chroot $2 make -C /usr/src $MAKE_FLAGS b > > >> chroot $2 make -C /usr/src/release release > > >> chroot $2 make -C /usr/src/release install DESTDIR=3D/R > > >> > > >> +: ${RELSTRING=3D`chroot $2 uname -s`-`chroot $2 uname -r`-`chroot $= 2 uname -p`} > > > Should this be 'uname -m' rather than 'uname -p'? > >=20 > > There isn't a good option here when there is only one tag -- most of th= e=20 > > time, I imagine this will get specified in the builder's environment. I= =20 > > picked uname -p because there are more possibilities than uname -m: it= =20 > > breaks the degeneracies for PPC, ARM, and MIPS, leaving only one for=20 > > i386/pc98. uname -m would have been the other way around. > > -Nathan > >=20 >=20 > Or both? We're heading in the direction of having both for the FTP > server tree. >=20 > Kinda gross but "FBSD-9.0-RELEASE-amd64-amd64-bootonly.iso"? Can't we use one if they are equal? --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://yomoli.com --LpQ9ahxlCli8rRTG Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAk7FASIACgkQForvXbEpPzS6BwCdHWcwAjHBLaYResnMHE9/i8+S 5xkAmwS87wA2t3XH9cotbkypiWHv+zJm =+2ZV -----END PGP SIGNATURE----- --LpQ9ahxlCli8rRTG-- From owner-svn-src-all@FreeBSD.ORG Thu Nov 17 13:14:07 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 79025106566C; Thu, 17 Nov 2011 13:14:07 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 692328FC0C; Thu, 17 Nov 2011 13:14:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAHDE7iT008750; Thu, 17 Nov 2011 13:14:07 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAHDE7bJ008748; Thu, 17 Nov 2011 13:14:07 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201111171314.pAHDE7bJ008748@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 17 Nov 2011 13:14:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227622 - head/lib/libc/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2011 13:14:07 -0000 Author: kib Date: Thu Nov 17 13:14:07 2011 New Revision: 227622 URL: http://svn.freebsd.org/changeset/base/227622 Log: Fix typo. Submitted by: arundel MFC after: 3 days Modified: head/lib/libc/sys/stat.2 Modified: head/lib/libc/sys/stat.2 ============================================================================== --- head/lib/libc/sys/stat.2 Thu Nov 17 12:37:50 2011 (r227621) +++ head/lib/libc/sys/stat.2 Thu Nov 17 13:14:07 2011 (r227622) @@ -28,7 +28,7 @@ .\" @(#)stat.2 8.4 (Berkeley) 5/1/95 .\" $FreeBSD$ .\" -.Dd March 28, 2010 +.Dd November 17, 2011 .Dt STAT 2 .Os .Sh NAME @@ -411,7 +411,7 @@ and system calls are expected to conform to .St -p1003.1-90 . The -.Fn fchownat +.Fn fstatat system call follows The Open Group Extended API Set 2 specification. .Sh HISTORY The From owner-svn-src-all@FreeBSD.ORG Thu Nov 17 13:15:00 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F33DC106564A; Thu, 17 Nov 2011 13:14:59 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E24FC8FC13; Thu, 17 Nov 2011 13:14:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAHDEx7f008824; Thu, 17 Nov 2011 13:14:59 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAHDEx9n008822; Thu, 17 Nov 2011 13:14:59 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201111171314.pAHDEx9n008822@svn.freebsd.org> From: "Jayachandran C." Date: Thu, 17 Nov 2011 13:14:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227623 - head/sys/mips/mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2011 13:15:00 -0000 Author: jchandra Date: Thu Nov 17 13:14:59 2011 New Revision: 227623 URL: http://svn.freebsd.org/changeset/base/227623 Log: Do pmap update only on active CPUs. The pmap update_page/invalidate_page/invalidate_all operations has to be done only on active cpus. In the simplest case, if the process is not active on any other CPUs, we can just do the operation on the current CPU. This change replaces the call to smp_rendezvous() for these operations with smp_rendezvous_cpus() in case there more than one active CPU, or with a direct function call if there is just one active CPU. This change give significant performance increase in fork/exec benchmarks on XLR/XLS/XLP with 32 cpus. Reviewed by: alc Modified: head/sys/mips/mips/pmap.c Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Thu Nov 17 13:14:07 2011 (r227622) +++ head/sys/mips/mips/pmap.c Thu Nov 17 13:14:59 2011 (r227623) @@ -181,7 +181,6 @@ static pt_entry_t init_pte_prot(vm_offse #ifdef SMP static void pmap_invalidate_page_action(void *arg); -static void pmap_invalidate_all_action(void *arg); static void pmap_update_page_action(void *arg); #endif @@ -622,119 +621,94 @@ pmap_init(void) * Low level helper routines..... ***************************************************/ +#ifdef SMP static __inline void -pmap_invalidate_all_local(pmap_t pmap) +pmap_call_on_active_cpus(pmap_t pmap, void (*fn)(void *), void *arg) { - u_int cpuid; + int cpuid, cpu, self; + cpuset_t active_cpus; + sched_pin(); + if (is_kernel_pmap(pmap)) { + smp_rendezvous(NULL, fn, NULL, arg); + goto out; + } + /* Force ASID update on inactive CPUs */ + CPU_FOREACH(cpu) { + if (!CPU_ISSET(cpu, &pmap->pm_active)) + pmap->pm_asid[cpu].gen = 0; + } cpuid = PCPU_GET(cpuid); + /* + * XXX: barrier/locking for active? + * + * Take a snapshot of active here, any further changes are ignored. + * tlb update/invalidate should be harmless on inactive CPUs + */ + active_cpus = pmap->pm_active; + self = CPU_ISSET(cpuid, &active_cpus); + CPU_CLR(cpuid, &active_cpus); + /* Optimize for the case where this cpu is the only active one */ + if (CPU_EMPTY(&active_cpus)) { + if (self) + fn(arg); + } else { + if (self) + CPU_SET(cpuid, &active_cpus); + smp_rendezvous_cpus(active_cpus, NULL, fn, NULL, arg); + } +out: + sched_unpin(); +} +#else /* !SMP */ +static __inline void +pmap_call_on_active_cpus(pmap_t pmap, void (*fn)(void *), void *arg) +{ + int cpuid; - if (pmap == kernel_pmap) { - tlb_invalidate_all(); + if (is_kernel_pmap(pmap)) { + fn(arg); return; } - if (CPU_ISSET(cpuid, &pmap->pm_active)) - tlb_invalidate_all_user(pmap); - else + cpuid = PCPU_GET(cpuid); + if (!CPU_ISSET(cpuid, &pmap->pm_active)) pmap->pm_asid[cpuid].gen = 0; + else + fn(arg); } +#endif /* SMP */ -#ifdef SMP static void pmap_invalidate_all(pmap_t pmap) { - smp_rendezvous(0, pmap_invalidate_all_action, 0, pmap); + pmap_call_on_active_cpus(pmap, + (void (*)(void *))tlb_invalidate_all_user, pmap); } -static void -pmap_invalidate_all_action(void *arg) -{ - - pmap_invalidate_all_local((pmap_t)arg); -} -#else -static void -pmap_invalidate_all(pmap_t pmap) -{ - - pmap_invalidate_all_local(pmap); -} -#endif - -static __inline void -pmap_invalidate_page_local(pmap_t pmap, vm_offset_t va) -{ - u_int cpuid; - - cpuid = PCPU_GET(cpuid); - - if (is_kernel_pmap(pmap)) { - tlb_invalidate_address(pmap, va); - return; - } - if (pmap->pm_asid[cpuid].gen != PCPU_GET(asid_generation)) - return; - else if (!CPU_ISSET(cpuid, &pmap->pm_active)) { - pmap->pm_asid[cpuid].gen = 0; - return; - } - tlb_invalidate_address(pmap, va); -} - -#ifdef SMP struct pmap_invalidate_page_arg { pmap_t pmap; vm_offset_t va; }; static void -pmap_invalidate_page(pmap_t pmap, vm_offset_t va) -{ - struct pmap_invalidate_page_arg arg; - - arg.pmap = pmap; - arg.va = va; - smp_rendezvous(0, pmap_invalidate_page_action, 0, &arg); -} - -static void pmap_invalidate_page_action(void *arg) { struct pmap_invalidate_page_arg *p = arg; - pmap_invalidate_page_local(p->pmap, p->va); + tlb_invalidate_address(p->pmap, p->va); } -#else + static void pmap_invalidate_page(pmap_t pmap, vm_offset_t va) { + struct pmap_invalidate_page_arg arg; - pmap_invalidate_page_local(pmap, va); -} -#endif - -static __inline void -pmap_update_page_local(pmap_t pmap, vm_offset_t va, pt_entry_t pte) -{ - u_int cpuid; - - cpuid = PCPU_GET(cpuid); - - if (is_kernel_pmap(pmap)) { - tlb_update(pmap, va, pte); - return; - } - if (pmap->pm_asid[cpuid].gen != PCPU_GET(asid_generation)) - return; - else if (!CPU_ISSET(cpuid, &pmap->pm_active)) { - pmap->pm_asid[cpuid].gen = 0; - return; - } - tlb_update(pmap, va, pte); + arg.pmap = pmap; + arg.va = va; + pmap_call_on_active_cpus(pmap, pmap_invalidate_page_action, &arg); } -#ifdef SMP struct pmap_update_page_arg { pmap_t pmap; vm_offset_t va; @@ -742,31 +716,23 @@ struct pmap_update_page_arg { }; static void -pmap_update_page(pmap_t pmap, vm_offset_t va, pt_entry_t pte) -{ - struct pmap_update_page_arg arg; - - arg.pmap = pmap; - arg.va = va; - arg.pte = pte; - smp_rendezvous(0, pmap_update_page_action, 0, &arg); -} - -static void pmap_update_page_action(void *arg) { struct pmap_update_page_arg *p = arg; - pmap_update_page_local(p->pmap, p->va, p->pte); + tlb_update(p->pmap, p->va, p->pte); } -#else + static void pmap_update_page(pmap_t pmap, vm_offset_t va, pt_entry_t pte) { + struct pmap_update_page_arg arg; - pmap_update_page_local(pmap, va, pte); + arg.pmap = pmap; + arg.va = va; + arg.pte = pte; + pmap_call_on_active_cpus(pmap, pmap_update_page_action, &arg); } -#endif /* * Routine: pmap_extract @@ -3213,7 +3179,7 @@ pmap_emulate_modified(pmap_t pmap, vm_of #ifdef SMP /* It is possible that some other CPU changed m-bit */ if (!pte_test(pte, PTE_V) || pte_test(pte, PTE_D)) { - pmap_update_page_local(pmap, va, *pte); + tlb_update(pmap, va, *pte); PMAP_UNLOCK(pmap); return (0); } @@ -3227,7 +3193,7 @@ pmap_emulate_modified(pmap_t pmap, vm_of return (1); } pte_set(pte, PTE_D); - pmap_update_page_local(pmap, va, *pte); + tlb_update(pmap, va, *pte); pa = TLBLO_PTE_TO_PA(*pte); if (!page_is_managed(pa)) panic("pmap_emulate_modified: unmanaged page"); From owner-svn-src-all@FreeBSD.ORG Thu Nov 17 13:15:22 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C20310656D6; Thu, 17 Nov 2011 13:15:22 +0000 (UTC) (envelope-from kensmith@buffalo.edu) Received: from localmailB.acsu.buffalo.edu (localmailb.acsu.buffalo.edu [128.205.5.200]) by mx1.freebsd.org (Postfix) with ESMTP id 582A78FC0A; Thu, 17 Nov 2011 13:15:21 +0000 (UTC) Received: from localmailB.acsu.buffalo.edu (localhost [127.0.0.1]) by localhost (Postfix) with SMTP id 6CF035902; Thu, 17 Nov 2011 08:03:47 -0500 (EST) Received: from localmailB.acsu.buffalo.edu (localhost [127.0.0.1]) by localmailB.acsu.buffalo.edu (Postfix) with ESMTP id 31CB75D18; Thu, 17 Nov 2011 08:03:46 -0500 (EST) Received: from smtp3.acsu.buffalo.edu (smtp3.acsu.buffalo.edu [128.205.5.226]) by localmailB.acsu.buffalo.edu (Prefixe) with ESMTP id C91734FB7; Thu, 17 Nov 2011 08:03:45 -0500 (EST) Received: from [128.205.32.76] (bauer.cse.buffalo.edu [128.205.32.76]) (Authenticated sender: kensmith@buffalo.edu) by smtp3.acsu.buffalo.edu (Postfix) with ESMTPSA id AF01449D27; Thu, 17 Nov 2011 08:03:45 -0500 (EST) From: Ken Smith To: Pawel Jakub Dawidek In-Reply-To: <20111117124210.GB2051@garage.freebsd.pl> References: <201111151849.pAFInR3K012609@svn.freebsd.org> <20111116.232828.343708041526200614.nyan@FreeBSD.org> <4EC3D40A.5040204@freebsd.org> <1321457050.78238.10.camel@bauer.cse.buffalo.edu> <20111117124210.GB2051@garage.freebsd.pl> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-W+xRwUDXAWlKYsILZbLb" Date: Thu, 17 Nov 2011 08:03:40 -0500 Message-ID: <1321535020.82271.5.camel@bauer.cse.buffalo.edu> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port X-PM-EL-Spam-Prob: : 8% Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Nathan Whitehorn , TAKAHASHI Yoshihiro Subject: Re: svn commit: r227536 - in head: release share/man/man7 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2011 13:15:22 -0000 --=-W+xRwUDXAWlKYsILZbLb Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable On Thu, 2011-11-17 at 13:42 +0100, Pawel Jakub Dawidek wrote: > On Wed, Nov 16, 2011 at 10:24:10AM -0500, Ken Smith wrote: > > On Wed, 2011-11-16 at 09:17 -0600, Nathan Whitehorn wrote: > > > On 11/16/11 08:28, TAKAHASHI Yoshihiro wrote: > > > > In article<201111151849.pAFInR3K012609@svn.freebsd.org> > > > > Nathan Whitehorn writes: > > > > > > > >> Log: > > > >> Further automate production release generation by naming files = the right > > > >> things and generating checksums. > > > >> > > > >> Modified: head/release/generate-release.sh > > > >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > > > >> --- head/release/generate-release.sh Tue Nov 15 17:53:29 2011 (r22= 7535) > > > >> +++ head/release/generate-release.sh Tue Nov 15 18:49:27 2011 (r22= 7536) > > > >> @@ -65,3 +66,12 @@ chroot $2 make -C /usr/src $MAKE_FLAGS b > > > >> chroot $2 make -C /usr/src/release release > > > >> chroot $2 make -C /usr/src/release install DESTDIR=3D/R > > > >> > > > >> +: ${RELSTRING=3D`chroot $2 uname -s`-`chroot $2 uname -r`-`chroot= $2 uname -p`} > > > > Should this be 'uname -m' rather than 'uname -p'? > > >=20 > > > There isn't a good option here when there is only one tag -- most of = the=20 > > > time, I imagine this will get specified in the builder's environment.= I=20 > > > picked uname -p because there are more possibilities than uname -m: i= t=20 > > > breaks the degeneracies for PPC, ARM, and MIPS, leaving only one for= =20 > > > i386/pc98. uname -m would have been the other way around. > > > -Nathan > > >=20 > >=20 > > Or both? We're heading in the direction of having both for the FTP > > server tree. > >=20 > > Kinda gross but "FBSD-9.0-RELEASE-amd64-amd64-bootonly.iso"? >=20 > Can't we use one if they are equal? >=20 I'd prefer consistency. I really don't like any of the options we've got but I'm trying to view 9.0 as a "clean break" (we're being forced into making at least *some* changes due to the improved build infrastructure and the appearance of powerpc64) during which we should do what we can to avoid needing to change things down the road. After all the dust settles (people have a chance to get used to it) I picture a higher percentage of people being confused about why some architectures have one name while other architectures have two versus people being confused about all of them having two names. --=20 Ken Smith - From there to here, from here to | kensmith@buffalo.edu there, funny things are everywhere. | - Theodor Geisel | --=-W+xRwUDXAWlKYsILZbLb Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEABECAAYFAk7FBiMACgkQ/G14VSmup/aebQCghBWkNfMBaagsnl4t5tK0Wzkj /P8An1MjEkCXfq/UWCxyLP8ieMr/PVdf =EvUF -----END PGP SIGNATURE----- --=-W+xRwUDXAWlKYsILZbLb-- From owner-svn-src-all@FreeBSD.ORG Thu Nov 17 14:05:59 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E0E03106566B; Thu, 17 Nov 2011 14:05:59 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CD95C8FC08; Thu, 17 Nov 2011 14:05:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAHE5xxI011033; Thu, 17 Nov 2011 14:05:59 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAHE5xJ9011032; Thu, 17 Nov 2011 14:05:59 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201111171405.pAHE5xJ9011032@svn.freebsd.org> From: Eitan Adler Date: Thu, 17 Nov 2011 14:05:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227624 - in stable/9/sys: . amd64/include/xen boot boot/i386/efi boot/ia64/efi boot/ia64/ski boot/powerpc/boot1.chrp boot/powerpc/ofw cddl/contrib/opensolaris conf contrib/dev/acpica c... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2011 14:06:00 -0000 Author: eadler (ports committer) Date: Thu Nov 17 14:05:59 2011 New Revision: 227624 URL: http://svn.freebsd.org/changeset/base/227624 Log: Record the merge of r227457, which was done as part of r227565 but not mentioned in the commit log PR: kern/142999 PR: kern/151365 Submitted by: Takefu Kenji Submitted by: Joerg Niendorf Approved by: re (kib) Modified: Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) From owner-svn-src-all@FreeBSD.ORG Thu Nov 17 14:06:39 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B05F01065672; Thu, 17 Nov 2011 14:06:39 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9DA278FC13; Thu, 17 Nov 2011 14:06:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAHE6dHV011101; Thu, 17 Nov 2011 14:06:39 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAHE6dua011100; Thu, 17 Nov 2011 14:06:39 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201111171406.pAHE6dua011100@svn.freebsd.org> From: Eitan Adler Date: Thu, 17 Nov 2011 14:06:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227625 - in releng/9.0/sys: . amd64/include/xen boot boot/i386/efi boot/ia64/efi boot/ia64/ski boot/powerpc/boot1.chrp boot/powerpc/ofw cddl/contrib/opensolaris conf contrib/dev/acpica... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2011 14:06:39 -0000 Author: eadler (ports committer) Date: Thu Nov 17 14:06:39 2011 New Revision: 227625 URL: http://svn.freebsd.org/changeset/base/227625 Log: Record the merge of r227457, which was done as part of r227565 but not mentioned in the commit log PR: kern/142999 PR: kern/151365 Submitted by: Takefu Kenji Submitted by: Joerg Niendorf Approved by: re (kib) Modified: Directory Properties: releng/9.0/sys/ (props changed) releng/9.0/sys/amd64/include/xen/ (props changed) releng/9.0/sys/boot/ (props changed) releng/9.0/sys/boot/i386/efi/ (props changed) releng/9.0/sys/boot/ia64/efi/ (props changed) releng/9.0/sys/boot/ia64/ski/ (props changed) releng/9.0/sys/boot/powerpc/boot1.chrp/ (props changed) releng/9.0/sys/boot/powerpc/ofw/ (props changed) releng/9.0/sys/cddl/contrib/opensolaris/ (props changed) releng/9.0/sys/conf/ (props changed) releng/9.0/sys/contrib/dev/acpica/ (props changed) releng/9.0/sys/contrib/octeon-sdk/ (props changed) releng/9.0/sys/contrib/pf/ (props changed) releng/9.0/sys/contrib/x86emu/ (props changed) From owner-svn-src-all@FreeBSD.ORG Thu Nov 17 14:31:49 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id BA588106566C; Thu, 17 Nov 2011 14:31:49 +0000 (UTC) Date: Thu, 17 Nov 2011 14:31:49 +0000 From: Alexey Dokuchaev To: Ken Smith Message-ID: <20111117143149.GA96475@FreeBSD.org> References: <201111151849.pAFInR3K012609@svn.freebsd.org> <20111116.232828.343708041526200614.nyan@FreeBSD.org> <4EC3D40A.5040204@freebsd.org> <1321457050.78238.10.camel@bauer.cse.buffalo.edu> <20111117124210.GB2051@garage.freebsd.pl> <1321535020.82271.5.camel@bauer.cse.buffalo.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <1321535020.82271.5.camel@bauer.cse.buffalo.edu> User-Agent: Mutt/1.4.2.1i Cc: src-committers@freebsd.org, Pawel Jakub Dawidek , svn-src-all@freebsd.org, TAKAHASHI Yoshihiro , Nathan Whitehorn , svn-src-head@freebsd.org Subject: Re: svn commit: r227536 - in head: release share/man/man7 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2011 14:31:49 -0000 On Thu, Nov 17, 2011 at 08:03:40AM -0500, Ken Smith wrote: > On Thu, 2011-11-17 at 13:42 +0100, Pawel Jakub Dawidek wrote: > > On Wed, Nov 16, 2011 at 10:24:10AM -0500, Ken Smith wrote: > > > Or both? We're heading in the direction of having both for the FTP > > > server tree. > > > > > > Kinda gross but "FBSD-9.0-RELEASE-amd64-amd64-bootonly.iso"? > > > > Can't we use one if they are equal? > > I'd prefer consistency. [...] But it looks so plain stupid! > I picture a higher percentage of people being confused about why some > architectures have one name while other architectures have two versus > people being confused about all of them having two names. And people would have to believe that we as a Project are so dumb that we could not figure out how to avoid this trivial redundancy when it is clearly not anywhere being useful. :-( ./danfe From owner-svn-src-all@FreeBSD.ORG Thu Nov 17 14:35:03 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 69D94106566B; Thu, 17 Nov 2011 14:35:03 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from theravensnest.org (theravensnest.org [109.169.23.128]) by mx1.freebsd.org (Postfix) with ESMTP id F07D68FC0C; Thu, 17 Nov 2011 14:35:02 +0000 (UTC) Received: from [192.168.0.2] (cpc2-cwma5-0-0-cust875.7-3.cable.virginmedia.com [86.11.39.108]) (authenticated bits=0) by theravensnest.org (8.14.4/8.14.4) with ESMTP id pAHEZ0q0063367 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Thu, 17 Nov 2011 14:35:00 GMT (envelope-from theraven@FreeBSD.org) Mime-Version: 1.0 (Apple Message framework v1251.1) Content-Type: text/plain; charset=koi8-r From: David Chisnall In-Reply-To: <20111117143149.GA96475@FreeBSD.org> Date: Thu, 17 Nov 2011 14:34:55 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201111151849.pAFInR3K012609@svn.freebsd.org> <20111116.232828.343708041526200614.nyan@FreeBSD.org> <4EC3D40A.5040204@freebsd.org> <1321457050.78238.10.camel@bauer.cse.buffalo.edu> <20111117124210.GB2051@garage.freebsd.pl> <1321535020.82271.5.camel@bauer.cse.buffalo.edu> <20111117143149.GA96475@FreeBSD.org> To: Alexey Dokuchaev X-Mailer: Apple Mail (2.1251.1) Cc: src-committers@FreeBSD.org, Pawel Jakub Dawidek , Ken Smith , svn-src-all@FreeBSD.org, TAKAHASHI Yoshihiro , Nathan Whitehorn , svn-src-head@FreeBSD.org Subject: Re: svn commit: r227536 - in head: release share/man/man7 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2011 14:35:03 -0000 On 17 Nov 2011, at 14:31, Alexey Dokuchaev wrote: >>>> Kinda gross but "FBSD-9.0-RELEASE-amd64-amd64-bootonly.iso"? >>>=20 >>> Can't we use one if they are equal? >>=20 >> I'd prefer consistency. [...] >=20 > But it looks so plain stupid! I've had someone ask me what amd64-amd64 meant when I pointed them as = the RC announcement. I replied that I had no idea and suggested that = possibly RE had been handed over to the department of redundancy = department. Having read this thread, I can now confidently say... that = I still have no idea. But (with my compiler-writer hat on) please tell me that we're not = inventing yet another incompatible form of target triple. We have at = least twice as many as we need already... David= From owner-svn-src-all@FreeBSD.ORG Thu Nov 17 14:44:56 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 977BC106566B; Thu, 17 Nov 2011 14:44:56 +0000 (UTC) (envelope-from kensmith@buffalo.edu) Received: from localmailB.acsu.buffalo.edu (localmailb.acsu.buffalo.edu [128.205.5.200]) by mx1.freebsd.org (Postfix) with ESMTP id 2981A8FC0A; Thu, 17 Nov 2011 14:44:55 +0000 (UTC) Received: from localmailB.acsu.buffalo.edu (localhost [127.0.0.1]) by localhost (Postfix) with SMTP id 7468A4FB7; Thu, 17 Nov 2011 09:44:54 -0500 (EST) Received: from localmailB.acsu.buffalo.edu (localhost [127.0.0.1]) by localmailB.acsu.buffalo.edu (Postfix) with ESMTP id 7B5EE5A3A; Thu, 17 Nov 2011 09:44:53 -0500 (EST) Received: from smtp2.acsu.buffalo.edu (smtp2.acsu.buffalo.edu [128.205.5.254]) by localmailB.acsu.buffalo.edu (Prefixe) with ESMTP id 4745F59CD; Thu, 17 Nov 2011 09:44:53 -0500 (EST) Received: from [128.205.32.76] (bauer.cse.buffalo.edu [128.205.32.76]) (Authenticated sender: kensmith@buffalo.edu) by smtp2.acsu.buffalo.edu (Postfix) with ESMTPSA id 2A8CB477EA; Thu, 17 Nov 2011 09:44:53 -0500 (EST) From: Ken Smith To: David Chisnall In-Reply-To: References: <201111151849.pAFInR3K012609@svn.freebsd.org> <20111116.232828.343708041526200614.nyan@FreeBSD.org> <4EC3D40A.5040204@freebsd.org> <1321457050.78238.10.camel@bauer.cse.buffalo.edu> <20111117124210.GB2051@garage.freebsd.pl> <1321535020.82271.5.camel@bauer.cse.buffalo.edu> <20111117143149.GA96475@FreeBSD.org> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-bUb+CHb+qKVDNlnUWLMf" Date: Thu, 17 Nov 2011 09:44:52 -0500 Message-ID: <1321541092.82271.15.camel@bauer.cse.buffalo.edu> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port X-PM-EL-Spam-Prob: : 8% Cc: Alexey Dokuchaev , src-committers@FreeBSD.org, Pawel Jakub Dawidek , svn-src-all@FreeBSD.org, TAKAHASHI Yoshihiro , Nathan Whitehorn , svn-src-head@FreeBSD.org Subject: Re: svn commit: r227536 - in head: release share/man/man7 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2011 14:44:56 -0000 --=-bUb+CHb+qKVDNlnUWLMf Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable On Thu, 2011-11-17 at 14:34 +0000, David Chisnall wrote: > On 17 Nov 2011, at 14:31, Alexey Dokuchaev wrote: >=20 > >>>> Kinda gross but "FBSD-9.0-RELEASE-amd64-amd64-bootonly.iso"? > >>>=20 > >>> Can't we use one if they are equal? > >>=20 > >> I'd prefer consistency. [...] > >=20 > > But it looks so plain stupid! >=20 > I've had someone ask me what amd64-amd64 meant when I pointed them as the= RC announcement. I replied that I had no idea and suggested that possibly= RE had been handed over to the department of redundancy department. Havin= g read this thread, I can now confidently say... that I still have no idea. >=20 > But (with my compiler-writer hat on) please tell me that we're not invent= ing yet another incompatible form of target triple. We have at least twice= as many as we need already... >=20 > David >=20 This is the problem we are trying to "solve": kim 1 % cd /usr/src kim 2 % make targets Supported TARGET/TARGET_ARCH pairs for world and kernel targets amd64/amd64 arm/arm arm/armeb i386/i386 ia64/ia64 mips/mipsel mips/mipseb mips/mips64el mips/mips64eb mips/mipsn32eb pc98/i386 powerpc/powerpc powerpc/powerpc64 sparc64/sparc64 kim 3 %=20 We currently only do formal builds for a sub-set. But as time goes on who knows... We could, for now, settle on just either `uname -m` or `uname -p` so we only have one "name". But note that's only possible for 9.0 because pc98 builds aren't being done. If we choose a scheme that doesn't cause a conflict between the two powerpc builds we're doing for 9.0 (powerpc and powerpc64) then if pc98 ever comes back we will have a conflict between i386 and pc98. --=20 Ken Smith - From there to here, from here to | kensmith@buffalo.edu there, funny things are everywhere. | - Theodor Geisel | --=-bUb+CHb+qKVDNlnUWLMf Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEABECAAYFAk7FHeQACgkQ/G14VSmup/ZzTgCfVMY8HT77kY1LUILF+o/aMxrq 7noAoIbzZf8+7TWXgrCwU2feBptxSgRp =5HIz -----END PGP SIGNATURE----- --=-bUb+CHb+qKVDNlnUWLMf-- From owner-svn-src-all@FreeBSD.ORG Thu Nov 17 14:57:23 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: by hub.freebsd.org (Postfix, from userid 1033) id C390D1065674; Thu, 17 Nov 2011 14:57:23 +0000 (UTC) Date: Thu, 17 Nov 2011 14:57:23 +0000 From: Alexey Dokuchaev To: Ken Smith Message-ID: <20111117145723.GB96475@FreeBSD.org> References: <201111151849.pAFInR3K012609@svn.freebsd.org> <20111116.232828.343708041526200614.nyan@FreeBSD.org> <4EC3D40A.5040204@freebsd.org> <1321457050.78238.10.camel@bauer.cse.buffalo.edu> <20111117124210.GB2051@garage.freebsd.pl> <1321535020.82271.5.camel@bauer.cse.buffalo.edu> <20111117143149.GA96475@FreeBSD.org> <1321541092.82271.15.camel@bauer.cse.buffalo.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <1321541092.82271.15.camel@bauer.cse.buffalo.edu> User-Agent: Mutt/1.4.2.1i Cc: src-committers@FreeBSD.org, Pawel Jakub Dawidek , svn-src-all@FreeBSD.org, David Chisnall , TAKAHASHI Yoshihiro , Nathan Whitehorn , svn-src-head@FreeBSD.org Subject: Re: svn commit: r227536 - in head: release share/man/man7 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2011 14:57:23 -0000 On Thu, Nov 17, 2011 at 09:44:52AM -0500, Ken Smith wrote: > This is the problem we are trying to "solve": > > Supported TARGET/TARGET_ARCH pairs for world and kernel targets > amd64/amd64 > arm/arm > arm/armeb > i386/i386 > ia64/ia64 > mips/mipsel > mips/mipseb > mips/mips64el > mips/mips64eb > mips/mipsn32eb > pc98/i386 > powerpc/powerpc > powerpc/powerpc64 > sparc64/sparc64 As I see it, for every pair except pc98/i386, second part should be used. For pc98/i386, first (pc98). Problem solved. ;-) ./danfe From owner-svn-src-all@FreeBSD.ORG Thu Nov 17 15:46:37 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C4FDB1065673; Thu, 17 Nov 2011 15:46:37 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B4AC68FC15; Thu, 17 Nov 2011 15:46:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAHFkbA1015516; Thu, 17 Nov 2011 15:46:37 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAHFkbdl015514; Thu, 17 Nov 2011 15:46:37 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201111171546.pAHFkbdl015514@svn.freebsd.org> From: Eitan Adler Date: Thu, 17 Nov 2011 15:46:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227626 - head/sys/dev/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2011 15:46:37 -0000 Author: eadler (ports committer) Date: Thu Nov 17 15:46:37 2011 New Revision: 227626 URL: http://svn.freebsd.org/changeset/base/227626 Log: - be more precise about the unit of measurement Submitted by: Oliver Pinter Approved by: jhb MFC after: 3 days Modified: head/sys/dev/acpica/acpi_thermal.c Modified: head/sys/dev/acpica/acpi_thermal.c ============================================================================== --- head/sys/dev/acpica/acpi_thermal.c Thu Nov 17 14:06:39 2011 (r227625) +++ head/sys/dev/acpica/acpi_thermal.c Thu Nov 17 15:46:37 2011 (r227626) @@ -245,7 +245,7 @@ acpi_tz_attach(device_t dev) SYSCTL_ADD_INT(&acpi_tz_sysctl_ctx, SYSCTL_CHILDREN(acpi_tz_sysctl_tree), OID_AUTO, "polling_rate", CTLFLAG_RW, - &acpi_tz_polling_rate, 0, "monitor polling rate"); + &acpi_tz_polling_rate, 0, "monitor polling rate in seconds"); SYSCTL_ADD_INT(&acpi_tz_sysctl_ctx, SYSCTL_CHILDREN(acpi_tz_sysctl_tree), OID_AUTO, "user_override", CTLFLAG_RW, &acpi_tz_override, 0, From owner-svn-src-all@FreeBSD.ORG Thu Nov 17 15:48:13 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 425F01065673; Thu, 17 Nov 2011 15:48:13 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 31EA98FC18; Thu, 17 Nov 2011 15:48:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAHFmDUS015619; Thu, 17 Nov 2011 15:48:13 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAHFmDUl015617; Thu, 17 Nov 2011 15:48:13 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201111171548.pAHFmDUl015617@svn.freebsd.org> From: Nathan Whitehorn Date: Thu, 17 Nov 2011 15:48:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227627 - head/sys/powerpc/aim X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2011 15:48:13 -0000 Author: nwhitehorn Date: Thu Nov 17 15:48:12 2011 New Revision: 227627 URL: http://svn.freebsd.org/changeset/base/227627 Log: Add an extra invariant here which was useful on 64-bit CPUs. Modified: head/sys/powerpc/aim/mmu_oea.c Modified: head/sys/powerpc/aim/mmu_oea.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea.c Thu Nov 17 15:46:37 2011 (r227626) +++ head/sys/powerpc/aim/mmu_oea.c Thu Nov 17 15:48:12 2011 (r227627) @@ -1624,6 +1624,8 @@ moea_pinit(mmu_t mmu, pmap_t pmap) hash &= 0xfffff & ~(VSID_NBPW - 1); hash |= i; } + KASSERT(!(moea_vsid_bitmap[n] & mask), + ("Allocating in-use VSID group %#x\n", hash)); moea_vsid_bitmap[n] |= mask; for (i = 0; i < 16; i++) pmap->pm_sr[i] = VSID_MAKE(i, hash); From owner-svn-src-all@FreeBSD.ORG Thu Nov 17 15:49:43 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1725C106566C; Thu, 17 Nov 2011 15:49:43 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E15F58FC15; Thu, 17 Nov 2011 15:49:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAHFngX2015706; Thu, 17 Nov 2011 15:49:42 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAHFngPZ015702; Thu, 17 Nov 2011 15:49:42 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201111171549.pAHFngPZ015702@svn.freebsd.org> From: Nathan Whitehorn Date: Thu, 17 Nov 2011 15:49:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227628 - in head/sys/powerpc: aim include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2011 15:49:43 -0000 Author: nwhitehorn Date: Thu Nov 17 15:49:42 2011 New Revision: 227628 URL: http://svn.freebsd.org/changeset/base/227628 Log: Use a global __pure2 function instead of a global register variable for curthread, like on x86 and sparc64. This makes the kernel somewhat more clang friendly, which doesn't support global register variables. Modified: head/sys/powerpc/aim/machdep.c head/sys/powerpc/aim/mp_cpudep.c head/sys/powerpc/include/pcpu.h Modified: head/sys/powerpc/aim/machdep.c ============================================================================== --- head/sys/powerpc/aim/machdep.c Thu Nov 17 15:48:12 2011 (r227627) +++ head/sys/powerpc/aim/machdep.c Thu Nov 17 15:49:42 2011 (r227628) @@ -303,7 +303,12 @@ powerpc_init(vm_offset_t startkernel, vm */ pc = __pcpu; pcpu_init(pc, 0, sizeof(struct pcpu)); - curthread_reg = pc->pc_curthread = &thread0; + pc->pc_curthread = &thread0; +#ifdef __powerpc64__ + __asm __volatile("mr 13,%0" :: "r"(pc->pc_curthread)); +#else + __asm __volatile("mr 2,%0" :: "r"(pc->pc_curthread)); +#endif pc->pc_cpuid = 0; __asm __volatile("mtsprg 0, %0" :: "r"(pc)); Modified: head/sys/powerpc/aim/mp_cpudep.c ============================================================================== --- head/sys/powerpc/aim/mp_cpudep.c Thu Nov 17 15:48:12 2011 (r227627) +++ head/sys/powerpc/aim/mp_cpudep.c Thu Nov 17 15:49:42 2011 (r227628) @@ -88,7 +88,12 @@ cpudep_ap_bootstrap(void) msr = PSL_KERNSET & ~PSL_EE; mtmsr(msr); - curthread_reg = pcpup->pc_curthread = pcpup->pc_idlethread; + pcpup->pc_curthread = pcpup->pc_idlethread; +#ifdef __powerpc64__ + __asm __volatile("mr 13,%0" :: "r"(pcpup->pc_curthread)); +#else + __asm __volatile("mr 2,%0" :: "r"(pcpup->pc_curthread)); +#endif pcpup->pc_curpcb = pcpup->pc_curthread->td_pcb; sp = pcpup->pc_curpcb->pcb_sp; Modified: head/sys/powerpc/include/pcpu.h ============================================================================== --- head/sys/powerpc/include/pcpu.h Thu Nov 17 15:48:12 2011 (r227627) +++ head/sys/powerpc/include/pcpu.h Thu Nov 17 15:49:42 2011 (r227628) @@ -135,13 +135,20 @@ struct pmap; #ifdef _KERNEL #define pcpup ((struct pcpu *) powerpc_get_pcpup()) + +#ifdef AIM /* Book-E not yet adapted */ +static __inline __pure2 struct thread * +__curthread(void) +{ + struct thread *td; #ifdef __powerpc64__ -register struct thread *curthread_reg __asm("%r13"); + __asm __volatile("mr %0,13" : "=r"(td)); #else -register struct thread *curthread_reg __asm("%r2"); + __asm __volatile("mr %0,2" : "=r"(td)); #endif -#ifdef AIM /* Book-E not yet adapted */ -#define curthread curthread_reg + return (td); +} +#define curthread (__curthread()) #endif #define PCPU_GET(member) (pcpup->pc_ ## member) From owner-svn-src-all@FreeBSD.ORG Thu Nov 17 15:50:22 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 93CB5106566C; Thu, 17 Nov 2011 15:50:22 +0000 (UTC) (envelope-from kensmith@buffalo.edu) Received: from localmailB.acsu.buffalo.edu (localmailb.acsu.buffalo.edu [128.205.5.200]) by mx1.freebsd.org (Postfix) with ESMTP id 40FDC8FC14; Thu, 17 Nov 2011 15:50:21 +0000 (UTC) Received: from localmailB.acsu.buffalo.edu (localhost [127.0.0.1]) by localhost (Postfix) with SMTP id 5D4CA5FA6; Thu, 17 Nov 2011 10:11:38 -0500 (EST) Received: from localmailB.acsu.buffalo.edu (localhost [127.0.0.1]) by localmailB.acsu.buffalo.edu (Postfix) with ESMTP id 330815F79; Thu, 17 Nov 2011 10:11:37 -0500 (EST) Received: from smtp2.acsu.buffalo.edu (smtp2.acsu.buffalo.edu [128.205.5.254]) by localmailB.acsu.buffalo.edu (Prefixe) with ESMTP id E4A055D08; Thu, 17 Nov 2011 10:11:36 -0500 (EST) Received: from [128.205.32.76] (bauer.cse.buffalo.edu [128.205.32.76]) (Authenticated sender: kensmith@buffalo.edu) by smtp2.acsu.buffalo.edu (Postfix) with ESMTPSA id A669747BF0; Thu, 17 Nov 2011 10:11:36 -0500 (EST) From: Ken Smith To: Alexey Dokuchaev In-Reply-To: <20111117145723.GB96475@FreeBSD.org> References: <201111151849.pAFInR3K012609@svn.freebsd.org> <20111116.232828.343708041526200614.nyan@FreeBSD.org> <4EC3D40A.5040204@freebsd.org> <1321457050.78238.10.camel@bauer.cse.buffalo.edu> <20111117124210.GB2051@garage.freebsd.pl> <1321535020.82271.5.camel@bauer.cse.buffalo.edu> <20111117143149.GA96475@FreeBSD.org> <1321541092.82271.15.camel@bauer.cse.buffalo.edu> <20111117145723.GB96475@FreeBSD.org> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-pO/u4T7kK8rUTvkMofXi" Date: Thu, 17 Nov 2011 10:11:36 -0500 Message-ID: <1321542696.82271.31.camel@bauer.cse.buffalo.edu> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port X-PM-EL-Spam-Prob: : 8% Cc: src-committers@FreeBSD.org, Pawel Jakub Dawidek , svn-src-all@FreeBSD.org, David Chisnall , Yoshihiro , Nathan Whitehorn , svn-src-head@FreeBSD.org, TAKAHASHI Subject: Re: svn commit: r227536 - in head: release share/man/man7 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2011 15:50:22 -0000 --=-pO/u4T7kK8rUTvkMofXi Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable On Thu, 2011-11-17 at 14:57 +0000, Alexey Dokuchaev wrote: > On Thu, Nov 17, 2011 at 09:44:52AM -0500, Ken Smith wrote: > > This is the problem we are trying to "solve": > >=20 > > Supported TARGET/TARGET_ARCH pairs for world and kernel targets > > amd64/amd64 > > arm/arm > > arm/armeb > > i386/i386 > > ia64/ia64 > > mips/mipsel > > mips/mipseb > > mips/mips64el > > mips/mips64eb > > mips/mipsn32eb > > pc98/i386 > > powerpc/powerpc > > powerpc/powerpc64 > > sparc64/sparc64 >=20 > As I see it, for every pair except pc98/i386, second part should be used. > For pc98/i386, first (pc98). Problem solved. ;-) >=20 > ./danfe >=20 I'd still sort of prefer no special cases. However ... For the ISO / memstick filenames we could just program in `uname -p` and ask the pc98 builder to modify the filenames post-build. But we still have the dual names needed for the FTP site layout. There it needs to be fully automated in the installer. So, given it seemed like we're sort of stuck with having the dual names appearing in other places combined with it never causing us to have special cases and/or conflicts it seemed like just biting the bullet and having them in the ISO / memstick filenames too ... Have I mentioned I don't like any of the options? :-/ --=20 Ken Smith - From there to here, from here to | kensmith@buffalo.edu there, funny things are everywhere. | - Theodor Geisel | --=-pO/u4T7kK8rUTvkMofXi Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEABECAAYFAk7FJCgACgkQ/G14VSmup/ap0wCgk2LahkIwkbvxcvfjyC3Wi/Op GP4An16uTV/0s5oRfqNVJwhDl1b9J+sM =0cp9 -----END PGP SIGNATURE----- --=-pO/u4T7kK8rUTvkMofXi-- From owner-svn-src-all@FreeBSD.ORG Thu Nov 17 15:51:03 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6CD8E1065675; Thu, 17 Nov 2011 15:51:03 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5C83A8FC25; Thu, 17 Nov 2011 15:51:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAHFp33A015805; Thu, 17 Nov 2011 15:51:03 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAHFp3Og015803; Thu, 17 Nov 2011 15:51:03 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201111171551.pAHFp3Og015803@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 17 Nov 2011 15:51:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227629 - head/sys/boot/ia64/common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2011 15:51:03 -0000 Author: marcel Date: Thu Nov 17 15:51:03 2011 New Revision: 227629 URL: http://svn.freebsd.org/changeset/base/227629 Log: Wire the kernel text RWX, rather than RX. We're not quite ready for having kernel text non-writable, because we still need to apply relocations. On top of that, the PBVM page table has all pages marked as RWX, so it's an inconsistency to begin with. Modified: head/sys/boot/ia64/common/exec.c Modified: head/sys/boot/ia64/common/exec.c ============================================================================== --- head/sys/boot/ia64/common/exec.c Thu Nov 17 15:49:42 2011 (r227628) +++ head/sys/boot/ia64/common/exec.c Thu Nov 17 15:51:03 2011 (r227629) @@ -187,7 +187,7 @@ mmu_setup_paged(struct bootinfo *bi) pa = ia64_va2pa(ia64_text_start, &ia64_text_size); ia64_text_size = sz; /* XXX */ shft = sz2shft(ia64_text_start, ia64_text_size); - shft = mmu_wire(ia64_text_start, (uintptr_t)pa, shft, PTE_AR_RX); + shft = mmu_wire(ia64_text_start, (uintptr_t)pa, shft, PTE_AR_RWX); ia64_copyin(&shft, (uintptr_t)&bi->bi_text_mapped, 4); /* Wire as much of the data segment as well. */ From owner-svn-src-all@FreeBSD.ORG Thu Nov 17 16:08:47 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 170361065672; Thu, 17 Nov 2011 16:08:47 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E0CA08FC13; Thu, 17 Nov 2011 16:08:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAHG8kLZ016905; Thu, 17 Nov 2011 16:08:46 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAHG8kDU016903; Thu, 17 Nov 2011 16:08:46 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201111171608.pAHG8kDU016903@svn.freebsd.org> From: Rick Macklem Date: Thu, 17 Nov 2011 16:08:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227630 - stable/9/sys/rpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2011 16:08:47 -0000 Author: rmacklem Date: Thu Nov 17 16:08:46 2011 New Revision: 227630 URL: http://svn.freebsd.org/changeset/base/227630 Log: MFC: r227059 Both a crash reported on freebsd-current on Oct. 18 under the subject heading "mtx_lock() of destroyed mutex on NFS" and PR# 156168 appear to be caused by clnt_dg_destroy() closing down the socket prematurely. When to close down the socket is controlled by a reference count (cs_refs), but clnt_dg_create() checks for sb_upcall being non-NULL to decide if a new socket is needed. I believe the crashes were caused by the following race: clnt_dg_destroy() finds cs_refs == 0 and decides to delete socket clnt_dg_destroy() then loses race with clnt_dg_create() for acquisition of the SOCKBUF_LOCK() clnt_dg_create() finds sb_upcall != NULL and increments cs_refs to 1 clnt_dg_destroy() then acquires SOCKBUF_LOCK(), sets sb_upcall to NULL and destroys socket This patch fixes the above race by changing clnt_dg_destroy() so that it acquires SOCKBUF_LOCK() before testing cs_refs. Tested by: bz Reviewed by: dfr Approved by: re (kib) Modified: stable/9/sys/rpc/clnt_dg.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/rpc/clnt_dg.c ============================================================================== --- stable/9/sys/rpc/clnt_dg.c Thu Nov 17 15:51:03 2011 (r227629) +++ stable/9/sys/rpc/clnt_dg.c Thu Nov 17 16:08:46 2011 (r227630) @@ -1001,12 +1001,12 @@ clnt_dg_destroy(CLIENT *cl) cs = cu->cu_socket->so_rcv.sb_upcallarg; clnt_dg_close(cl); + SOCKBUF_LOCK(&cu->cu_socket->so_rcv); mtx_lock(&cs->cs_lock); cs->cs_refs--; if (cs->cs_refs == 0) { mtx_unlock(&cs->cs_lock); - SOCKBUF_LOCK(&cu->cu_socket->so_rcv); soupcall_clear(cu->cu_socket, SO_RCV); clnt_dg_upcallsdone(cu->cu_socket, cs); SOCKBUF_UNLOCK(&cu->cu_socket->so_rcv); @@ -1015,6 +1015,7 @@ clnt_dg_destroy(CLIENT *cl) lastsocketref = TRUE; } else { mtx_unlock(&cs->cs_lock); + SOCKBUF_UNLOCK(&cu->cu_socket->so_rcv); lastsocketref = FALSE; } From owner-svn-src-all@FreeBSD.ORG Thu Nov 17 16:38:22 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F29F61065679; Thu, 17 Nov 2011 16:38:22 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C813C8FC28; Thu, 17 Nov 2011 16:38:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAHGcMKe018251; Thu, 17 Nov 2011 16:38:22 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAHGcMcK018249; Thu, 17 Nov 2011 16:38:22 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201111171638.pAHGcMcK018249@svn.freebsd.org> From: Rick Macklem Date: Thu, 17 Nov 2011 16:38:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227631 - releng/9.0/sys/rpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2011 16:38:23 -0000 Author: rmacklem Date: Thu Nov 17 16:38:22 2011 New Revision: 227631 URL: http://svn.freebsd.org/changeset/base/227631 Log: MFC: r227059 Both a crash reported on freebsd-current on Oct. 18 under the subject heading "mtx_lock() of destroyed mutex on NFS" and PR# 156168 appear to be caused by clnt_dg_destroy() closing down the socket prematurely. When to close down the socket is controlled by a reference count (cs_refs), but clnt_dg_create() checks for sb_upcall being non-NULL to decide if a new socket is needed. I believe the crashes were caused by the following race: clnt_dg_destroy() finds cs_refs == 0 and decides to delete socket clnt_dg_destroy() then loses race with clnt_dg_create() for acquisition of the SOCKBUF_LOCK() clnt_dg_create() finds sb_upcall != NULL and increments cs_refs to 1 clnt_dg_destroy() then acquires SOCKBUF_LOCK(), sets sb_upcall to NULL and destroys socket This patch fixes the above race by changing clnt_dg_destroy() so that it acquires SOCKBUF_LOCK() before testing cs_refs. Tested by: bz Reviewed by: dfr Approved by: re (kib) Modified: releng/9.0/sys/rpc/clnt_dg.c Directory Properties: releng/9.0/sys/ (props changed) releng/9.0/sys/amd64/include/xen/ (props changed) releng/9.0/sys/boot/ (props changed) releng/9.0/sys/boot/i386/efi/ (props changed) releng/9.0/sys/boot/ia64/efi/ (props changed) releng/9.0/sys/boot/ia64/ski/ (props changed) releng/9.0/sys/boot/powerpc/boot1.chrp/ (props changed) releng/9.0/sys/boot/powerpc/ofw/ (props changed) releng/9.0/sys/cddl/contrib/opensolaris/ (props changed) releng/9.0/sys/conf/ (props changed) releng/9.0/sys/contrib/dev/acpica/ (props changed) releng/9.0/sys/contrib/octeon-sdk/ (props changed) releng/9.0/sys/contrib/pf/ (props changed) releng/9.0/sys/contrib/x86emu/ (props changed) Modified: releng/9.0/sys/rpc/clnt_dg.c ============================================================================== --- releng/9.0/sys/rpc/clnt_dg.c Thu Nov 17 16:08:46 2011 (r227630) +++ releng/9.0/sys/rpc/clnt_dg.c Thu Nov 17 16:38:22 2011 (r227631) @@ -1001,12 +1001,12 @@ clnt_dg_destroy(CLIENT *cl) cs = cu->cu_socket->so_rcv.sb_upcallarg; clnt_dg_close(cl); + SOCKBUF_LOCK(&cu->cu_socket->so_rcv); mtx_lock(&cs->cs_lock); cs->cs_refs--; if (cs->cs_refs == 0) { mtx_unlock(&cs->cs_lock); - SOCKBUF_LOCK(&cu->cu_socket->so_rcv); soupcall_clear(cu->cu_socket, SO_RCV); clnt_dg_upcallsdone(cu->cu_socket, cs); SOCKBUF_UNLOCK(&cu->cu_socket->so_rcv); @@ -1015,6 +1015,7 @@ clnt_dg_destroy(CLIENT *cl) lastsocketref = TRUE; } else { mtx_unlock(&cs->cs_lock); + SOCKBUF_UNLOCK(&cu->cu_socket->so_rcv); lastsocketref = FALSE; } From owner-svn-src-all@FreeBSD.ORG Thu Nov 17 16:41:24 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0526B1065670; Thu, 17 Nov 2011 16:41:24 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id CBB408FC13; Thu, 17 Nov 2011 16:41:23 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 8242746B09; Thu, 17 Nov 2011 11:41:23 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 214B78A053; Thu, 17 Nov 2011 11:41:23 -0500 (EST) From: John Baldwin To: Ken Smith Date: Thu, 17 Nov 2011 11:41:22 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p8; KDE/4.5.5; amd64; ; ) References: <201111151849.pAFInR3K012609@svn.freebsd.org> <20111117145723.GB96475@FreeBSD.org> <1321542696.82271.31.camel@bauer.cse.buffalo.edu> In-Reply-To: <1321542696.82271.31.camel@bauer.cse.buffalo.edu> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201111171141.22648.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Thu, 17 Nov 2011 11:41:23 -0500 (EST) Cc: Alexey Dokuchaev , src-committers@freebsd.org, Pawel Jakub Dawidek , svn-src-all@freebsd.org, David Chisnall , TAKAHASHI Yoshihiro , Nathan Whitehorn , svn-src-head@freebsd.org Subject: Re: svn commit: r227536 - in head: release share/man/man7 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2011 16:41:24 -0000 On Thursday, November 17, 2011 10:11:36 am Ken Smith wrote: > On Thu, 2011-11-17 at 14:57 +0000, Alexey Dokuchaev wrote: > > On Thu, Nov 17, 2011 at 09:44:52AM -0500, Ken Smith wrote: > > > This is the problem we are trying to "solve": > > > > > > Supported TARGET/TARGET_ARCH pairs for world and kernel targets > > > amd64/amd64 > > > arm/arm > > > arm/armeb > > > i386/i386 > > > ia64/ia64 > > > mips/mipsel > > > mips/mipseb > > > mips/mips64el > > > mips/mips64eb > > > mips/mipsn32eb > > > pc98/i386 > > > powerpc/powerpc > > > powerpc/powerpc64 > > > sparc64/sparc64 > > > > As I see it, for every pair except pc98/i386, second part should be used. > > For pc98/i386, first (pc98). Problem solved. ;-) > > > > ./danfe > > > > I'd still sort of prefer no special cases. However ... > > For the ISO / memstick filenames we could just program in `uname -p` > and ask the pc98 builder to modify the filenames post-build. But > we still have the dual names needed for the FTP site layout. There > it needs to be fully automated in the installer. > > So, given it seemed like we're sort of stuck with having the dual > names appearing in other places combined with it never causing us > to have special cases and/or conflicts it seemed like just biting > the bullet and having them in the ISO / memstick filenames too ... > > Have I mentioned I don't like any of the options? :-/ I think collapsing down to one name if uname -m == uname -p is not that terrible and would preserve the existing layout for most of the current cases (only pc98 would change, yes)? -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Thu Nov 17 17:43:16 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 44BFE1065670; Thu, 17 Nov 2011 17:43:16 +0000 (UTC) (envelope-from kensmith@buffalo.edu) Received: from localmailA.acsu.buffalo.edu (localmail.buffalo.edu [128.205.5.196]) by mx1.freebsd.org (Postfix) with ESMTP id E6A278FC12; Thu, 17 Nov 2011 17:43:15 +0000 (UTC) Received: from localmailA.acsu.buffalo.edu (localhost [127.0.0.1]) by localhost (Postfix) with SMTP id EBB27CEA0; Thu, 17 Nov 2011 12:43:14 -0500 (EST) Received: from localmailA.acsu.buffalo.edu (localhost [127.0.0.1]) by localmailA.acsu.buffalo.edu (Postfix) with ESMTP id C6F7ECE3D; Thu, 17 Nov 2011 12:43:13 -0500 (EST) Received: from smtp4.acsu.buffalo.edu (smtp4.acsu.buffalo.edu [128.205.5.229]) by localmailA.acsu.buffalo.edu (Prefixe) with ESMTP id 9A232C75D; Thu, 17 Nov 2011 12:43:13 -0500 (EST) Received: from [128.205.32.76] (bauer.cse.buffalo.edu [128.205.32.76]) (Authenticated sender: kensmith@buffalo.edu) by smtp4.acsu.buffalo.edu (Postfix) with ESMTPSA id 88FAD47E16; Thu, 17 Nov 2011 12:43:13 -0500 (EST) From: Ken Smith To: John Baldwin In-Reply-To: <201111171141.22648.jhb@freebsd.org> References: <201111151849.pAFInR3K012609@svn.freebsd.org> <20111117145723.GB96475@FreeBSD.org> <1321542696.82271.31.camel@bauer.cse.buffalo.edu> <201111171141.22648.jhb@freebsd.org> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-6io+vfZx7UY9Icgqs87w" Date: Thu, 17 Nov 2011 12:43:12 -0500 Message-ID: <1321551793.82271.55.camel@bauer.cse.buffalo.edu> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port X-PM-EL-Spam-Prob: : 8% Cc: Alexey Dokuchaev , src-committers@freebsd.org, Pawel Jakub Dawidek , svn-src-all@freebsd.org, David Chisnall , TAKAHASHI Yoshihiro , Nathan Whitehorn , svn-src-head@freebsd.org Subject: Re: svn commit: r227536 - in head: release share/man/man7 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2011 17:43:16 -0000 --=-6io+vfZx7UY9Icgqs87w Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable On Thu, 2011-11-17 at 11:41 -0500, John Baldwin wrote: > On Thursday, November 17, 2011 10:11:36 am Ken Smith wrote: > > On Thu, 2011-11-17 at 14:57 +0000, Alexey Dokuchaev wrote: > > > On Thu, Nov 17, 2011 at 09:44:52AM -0500, Ken Smith wrote: > > > > This is the problem we are trying to "solve": > > > >=20 > > > > Supported TARGET/TARGET_ARCH pairs for world and kernel targets > > > > amd64/amd64 > > > > arm/arm > > > > arm/armeb > > > > i386/i386 > > > > ia64/ia64 > > > > mips/mipsel > > > > mips/mipseb > > > > mips/mips64el > > > > mips/mips64eb > > > > mips/mipsn32eb > > > > pc98/i386 > > > > powerpc/powerpc > > > > powerpc/powerpc64 > > > > sparc64/sparc64 > > >=20 > > > As I see it, for every pair except pc98/i386, second part should be u= sed. > > > For pc98/i386, first (pc98). Problem solved. ;-) > > >=20 > > > ./danfe > > >=20 > >=20 > > I'd still sort of prefer no special cases. However ... > >=20 > > For the ISO / memstick filenames we could just program in `uname -p` > > and ask the pc98 builder to modify the filenames post-build. But > > we still have the dual names needed for the FTP site layout. There > > it needs to be fully automated in the installer. > >=20 > > So, given it seemed like we're sort of stuck with having the dual > > names appearing in other places combined with it never causing us > > to have special cases and/or conflicts it seemed like just biting > > the bullet and having them in the ISO / memstick filenames too ... > >=20 > > Have I mentioned I don't like any of the options? :-/ >=20 > I think collapsing down to one name if uname -m =3D=3D uname -p is not th= at=20 > terrible and would preserve the existing layout for most of the current > cases (only pc98 would change, yes)? >=20 If you're referring to the FTP directory tree layout we wind up with: .../releases/amd64/9.0-RELEASE .../releases/amd64/ISO-IMAGES/9.0 for an example of uname -m =3D=3D uname -p. But for our two powerpc relate= d architectures we get: .../releases/powerpc/9.0-RELEASE .../releases/powerpc/ISO-IMAGES/9.0 .../releases/powerpc/powerpc64/9.0-RELEASE .../releases/powerpc/powerpc64/ISO-IMAGES/9.0 I'm not sure I like the inconsistency. Or were you referring to the ISO / memstick filenames? If that's what you were referring to then we get FreeBSD-9.0-RELEASE-amd64-bootonly.iso FreeBSD-9.0-RELEASE-powerpc-bootonly.iso FreeBSD-9.0-RELEASE-powerpc-powerpc64-bootonly.iso If pc98 were being done we'd get .../releases/pc98/i386/9.0-RELEASE .../releases/pc98/i386/ISO-IMAGES/9.0 FreeBSD-9.0-RELEASE-pc98-i386-bootonly.iso I guess. Was that the proposal? Again I'm not fond of any of the alternatives but if that's what we wind up with personally I'm more in favor of "silly filenames" over needing to explain the inconsistencies. --=20 Ken Smith - From there to here, from here to | kensmith@buffalo.edu there, funny things are everywhere. | - Theodor Geisel | --=-6io+vfZx7UY9Icgqs87w Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEABECAAYFAk7FR7AACgkQ/G14VSmup/ZLswCeI09Xz/hcs8bIi2okBHGVUfJa 2osAoIzDbOq1NTnm7fXthwqeGOdVddoz =0Zqu -----END PGP SIGNATURE----- --=-6io+vfZx7UY9Icgqs87w-- From owner-svn-src-all@FreeBSD.ORG Thu Nov 17 17:57:36 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 424DB10656F4; Thu, 17 Nov 2011 17:57:36 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 31AF48FC1A; Thu, 17 Nov 2011 17:57:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAHHvawQ021706; Thu, 17 Nov 2011 17:57:36 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAHHvadc021704; Thu, 17 Nov 2011 17:57:36 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201111171757.pAHHvadc021704@svn.freebsd.org> From: Christian Brueffer Date: Thu, 17 Nov 2011 17:57:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227633 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2011 17:57:36 -0000 Author: brueffer Date: Thu Nov 17 17:57:35 2011 New Revision: 227633 URL: http://svn.freebsd.org/changeset/base/227633 Log: Some cleanup: - Start sentences on new lines - Mark up sysctl variables - Use %d in sysctl variables to denote the index, as we do in other manpages Modified: head/share/man/man4/sfxge.4 Modified: head/share/man/man4/sfxge.4 ============================================================================== --- head/share/man/man4/sfxge.4 Thu Nov 17 17:16:43 2011 (r227632) +++ head/share/man/man4/sfxge.4 Thu Nov 17 17:57:35 2011 (r227633) @@ -48,25 +48,29 @@ sfxge_load="YES" The .Nm driver provides support for 10Gb Ethernet adapters based on -Solarflare SFC9000 family controllers. The driver supports jumbo +Solarflare SFC9000 family controllers. +The driver supports jumbo frames, transmit/receive checksum offload, TCP Segmentation Offload (TSO), Large Receive Offload (LRO), VLAN checksum offload, VLAN TSO, and Receive Side Scaling (RSS) using MSI-X interrupts. .Pp The driver allocates 1 receive queue, transmit queue, event queue and -IRQ per CPU up to a maximum of 64. IRQ affinities should be spread -out using +IRQ per CPU up to a maximum of 64. +IRQ affinities should be spread out using .Xr cpuset 8 . Interrupt moderation may be controlled through the sysctl -dev.sfxge.\fIindex\fR.int_mod (units are microseconds). +.Va dev.sfxge.%d.int_mod +(units are microseconds). .Pp For more information on configuring this device, see .Xr ifconfig 8 . .Pp A large number of MAC, PHY and data path statistics are available -under the sysctl dev.sfxge.\fIindex\fR.stats. The adapter's VPD +under the sysctl +.Va dev.sfxge.%d.stats . +The adapter's VPD fields including its serial number are available under the sysctl -dev.sfxge.\fIindex\fR.vpd. +.Va dev.sfxge.%d.vpd . .Sh HARDWARE The .Nm From owner-svn-src-all@FreeBSD.ORG Thu Nov 17 18:02:14 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 38570106566C; Thu, 17 Nov 2011 18:02:14 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 9161D8FC13; Thu, 17 Nov 2011 18:02:13 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 14C8DE26; Thu, 17 Nov 2011 19:02:11 +0100 (CET) Date: Thu, 17 Nov 2011 19:01:18 +0100 From: Pawel Jakub Dawidek To: Ken Smith Message-ID: <20111117180117.GB1683@garage.freebsd.pl> References: <201111151849.pAFInR3K012609@svn.freebsd.org> <20111117145723.GB96475@FreeBSD.org> <1321542696.82271.31.camel@bauer.cse.buffalo.edu> <201111171141.22648.jhb@freebsd.org> <1321551793.82271.55.camel@bauer.cse.buffalo.edu> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="cvVnyQ+4j833TQvp" Content-Disposition: inline In-Reply-To: <1321551793.82271.55.camel@bauer.cse.buffalo.edu> X-OS: FreeBSD 9.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Alexey Dokuchaev , src-committers@freebsd.org, John Baldwin , svn-src-all@freebsd.org, David Chisnall , TAKAHASHI Yoshihiro , Nathan Whitehorn , svn-src-head@freebsd.org Subject: Re: svn commit: r227536 - in head: release share/man/man7 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2011 18:02:14 -0000 --cvVnyQ+4j833TQvp Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Nov 17, 2011 at 12:43:12PM -0500, Ken Smith wrote: > On Thu, 2011-11-17 at 11:41 -0500, John Baldwin wrote: > > On Thursday, November 17, 2011 10:11:36 am Ken Smith wrote: > > > On Thu, 2011-11-17 at 14:57 +0000, Alexey Dokuchaev wrote: > > > > On Thu, Nov 17, 2011 at 09:44:52AM -0500, Ken Smith wrote: > > > > > This is the problem we are trying to "solve": > > > > >=20 > > > > > Supported TARGET/TARGET_ARCH pairs for world and kernel targets > > > > > amd64/amd64 > > > > > arm/arm > > > > > arm/armeb > > > > > i386/i386 > > > > > ia64/ia64 > > > > > mips/mipsel > > > > > mips/mipseb > > > > > mips/mips64el > > > > > mips/mips64eb > > > > > mips/mipsn32eb > > > > > pc98/i386 > > > > > powerpc/powerpc > > > > > powerpc/powerpc64 > > > > > sparc64/sparc64 > > > >=20 > > > > As I see it, for every pair except pc98/i386, second part should be= used. > > > > For pc98/i386, first (pc98). Problem solved. ;-) > > > >=20 > > > > ./danfe > > > >=20 > > >=20 > > > I'd still sort of prefer no special cases. However ... > > >=20 > > > For the ISO / memstick filenames we could just program in `uname -p` > > > and ask the pc98 builder to modify the filenames post-build. But > > > we still have the dual names needed for the FTP site layout. There > > > it needs to be fully automated in the installer. > > >=20 > > > So, given it seemed like we're sort of stuck with having the dual > > > names appearing in other places combined with it never causing us > > > to have special cases and/or conflicts it seemed like just biting > > > the bullet and having them in the ISO / memstick filenames too ... > > >=20 > > > Have I mentioned I don't like any of the options? :-/ > >=20 > > I think collapsing down to one name if uname -m =3D=3D uname -p is not = that=20 > > terrible and would preserve the existing layout for most of the current > > cases (only pc98 would change, yes)? > >=20 >=20 > If you're referring to the FTP directory tree layout we wind up with: >=20 > .../releases/amd64/9.0-RELEASE > .../releases/amd64/ISO-IMAGES/9.0 >=20 > for an example of uname -m =3D=3D uname -p. But for our two powerpc rela= ted > architectures we get: >=20 > .../releases/powerpc/9.0-RELEASE > .../releases/powerpc/ISO-IMAGES/9.0 > .../releases/powerpc/powerpc64/9.0-RELEASE > .../releases/powerpc/powerpc64/ISO-IMAGES/9.0 Or: .../releases/powerpc/9.0-RELEASE .../releases/powerpc/ISO-IMAGES/9.0 .../releases/powerpc-powerpc64/9.0-RELEASE .../releases/powerpc-powerpc64/ISO-IMAGES/9.0 --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://yomoli.com --cvVnyQ+4j833TQvp Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAk7FS+0ACgkQForvXbEpPzSxJQCg1b+r1Dxz0TyYT7l0YmojEQww BB8AoMXiiaDSw7AdWh+JFcmmcQRng/gB =Zqde -----END PGP SIGNATURE----- --cvVnyQ+4j833TQvp-- From owner-svn-src-all@FreeBSD.ORG Thu Nov 17 18:36:43 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 881721065677; Thu, 17 Nov 2011 18:36:43 +0000 (UTC) (envelope-from bright@elvis.mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 72BC88FC0A; Thu, 17 Nov 2011 18:36:43 +0000 (UTC) Received: by elvis.mu.org (Postfix, from userid 1192) id 153061A3C5C; Thu, 17 Nov 2011 10:36:43 -0800 (PST) Date: Thu, 17 Nov 2011 10:36:42 -0800 From: Alfred Perlstein To: Rick Macklem Message-ID: <20111117183642.GY1455@elvis.mu.org> References: <20111117040109.GU1455@elvis.mu.org> <462306074.1954190.1321506994004.JavaMail.root@erie.cs.uoguelph.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <462306074.1954190.1321506994004.JavaMail.root@erie.cs.uoguelph.ca> User-Agent: Mutt/1.4.2.3i Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-7@freebsd.org, Rick Macklem Subject: Re: svn commit: r227549 - stable/7/sys/nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2011 18:36:43 -0000 * Rick Macklem [111116 21:16] wrote: > Alfred Perlstein wrote: > > Rick, I have a question, what will happen if the nfs_freesillyrename() > > call happens when the mount is down? Will it block the > > taskqueue_thread? > > > > If so, it might make more sense to make a taskqueue per mount point. > > > > If not, excuse me. :-) > > > Well, all nfs_freesillyrename() does is a vrele() on the parent > directory when the file node's use count has gone to 0. > I can't think why that would do any RPC, so I don't see a problem? > If you do see a problem with vrele() on the directory, please let me > know. > > The problem this fixes is a LOR that would occur when the vrele() on > the directory was done by the thread doing VOP_INACTIVE(), since it > already has the file vnode lock and the vrele() was locking the parent > directory. This could cause a fairly rare deadlock. Yes, I understand the VFS deadlock. I see, I didn't realize the call was against the directory, thank you for explaining. -Alfred From owner-svn-src-all@FreeBSD.ORG Thu Nov 17 19:16:50 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18BDD1065674; Thu, 17 Nov 2011 19:16:50 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id CB1F88FC0C; Thu, 17 Nov 2011 19:16:49 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 61A6E46B0A; Thu, 17 Nov 2011 14:16:49 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id E03F28A052; Thu, 17 Nov 2011 14:16:48 -0500 (EST) From: John Baldwin To: Ken Smith Date: Thu, 17 Nov 2011 14:16:47 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p8; KDE/4.5.5; amd64; ; ) References: <201111151849.pAFInR3K012609@svn.freebsd.org> <201111171141.22648.jhb@freebsd.org> <1321551793.82271.55.camel@bauer.cse.buffalo.edu> In-Reply-To: <1321551793.82271.55.camel@bauer.cse.buffalo.edu> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201111171416.47725.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Thu, 17 Nov 2011 14:16:49 -0500 (EST) Cc: Alexey Dokuchaev , src-committers@freebsd.org, Pawel Jakub Dawidek , svn-src-all@freebsd.org, David Chisnall , TAKAHASHI Yoshihiro , Nathan Whitehorn , svn-src-head@freebsd.org Subject: Re: svn commit: r227536 - in head: release share/man/man7 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2011 19:16:50 -0000 On Thursday, November 17, 2011 12:43:12 pm Ken Smith wrote: > On Thu, 2011-11-17 at 11:41 -0500, John Baldwin wrote: > > On Thursday, November 17, 2011 10:11:36 am Ken Smith wrote: > > > On Thu, 2011-11-17 at 14:57 +0000, Alexey Dokuchaev wrote: > > > > On Thu, Nov 17, 2011 at 09:44:52AM -0500, Ken Smith wrote: > > > > > This is the problem we are trying to "solve": > > > > > > > > > > Supported TARGET/TARGET_ARCH pairs for world and kernel targets > > > > > amd64/amd64 > > > > > arm/arm > > > > > arm/armeb > > > > > i386/i386 > > > > > ia64/ia64 > > > > > mips/mipsel > > > > > mips/mipseb > > > > > mips/mips64el > > > > > mips/mips64eb > > > > > mips/mipsn32eb > > > > > pc98/i386 > > > > > powerpc/powerpc > > > > > powerpc/powerpc64 > > > > > sparc64/sparc64 > > > > > > > > As I see it, for every pair except pc98/i386, second part should be used. > > > > For pc98/i386, first (pc98). Problem solved. ;-) > > > > > > > > ./danfe > > > > > > > > > > I'd still sort of prefer no special cases. However ... > > > > > > For the ISO / memstick filenames we could just program in `uname -p` > > > and ask the pc98 builder to modify the filenames post-build. But > > > we still have the dual names needed for the FTP site layout. There > > > it needs to be fully automated in the installer. > > > > > > So, given it seemed like we're sort of stuck with having the dual > > > names appearing in other places combined with it never causing us > > > to have special cases and/or conflicts it seemed like just biting > > > the bullet and having them in the ISO / memstick filenames too ... > > > > > > Have I mentioned I don't like any of the options? :-/ > > > > I think collapsing down to one name if uname -m == uname -p is not that > > terrible and would preserve the existing layout for most of the current > > cases (only pc98 would change, yes)? > > > > If you're referring to the FTP directory tree layout we wind up with: > > .../releases/amd64/9.0-RELEASE > .../releases/amd64/ISO-IMAGES/9.0 > > for an example of uname -m == uname -p. But for our two powerpc related > architectures we get: > > .../releases/powerpc/9.0-RELEASE > .../releases/powerpc/ISO-IMAGES/9.0 > .../releases/powerpc/powerpc64/9.0-RELEASE > .../releases/powerpc/powerpc64/ISO-IMAGES/9.0 > > I'm not sure I like the inconsistency. Given the available tradeoffs I prefer this to amd64/amd64. We could also define the rule another way, which is if a given TARGET only has a single TARGET_ARCH you just use TARGET, otherwise you use TARGET/TARGET_ARCH. (This can be parsed out of the output of 'make targets' fairly easily.) That would let you have: releases/amd64/9.0-RELEASE releases/powerpc/powerpc/9.0-RELEASE releases/powerpc/powerpc64/9.0-RELEASE -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Thu Nov 17 19:33:29 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5953B1065673; Thu, 17 Nov 2011 19:33:29 +0000 (UTC) (envelope-from kensmith@buffalo.edu) Received: from localmailA.acsu.buffalo.edu (localmail.buffalo.edu [128.205.5.196]) by mx1.freebsd.org (Postfix) with ESMTP id F12F38FC1B; Thu, 17 Nov 2011 19:33:27 +0000 (UTC) Received: from localmailA.acsu.buffalo.edu (localhost [127.0.0.1]) by localhost (Postfix) with SMTP id 74CF9F0D9; Thu, 17 Nov 2011 14:33:26 -0500 (EST) Received: from localmailA.acsu.buffalo.edu (localhost [127.0.0.1]) by localmailA.acsu.buffalo.edu (Postfix) with ESMTP id 05055F0FB; Thu, 17 Nov 2011 14:33:24 -0500 (EST) Received: from smtp2.acsu.buffalo.edu (smtp2.acsu.buffalo.edu [128.205.5.254]) by localmailA.acsu.buffalo.edu (Prefixe) with ESMTP id C5828F0D9; Thu, 17 Nov 2011 14:33:24 -0500 (EST) Received: from [128.205.32.76] (bauer.cse.buffalo.edu [128.205.32.76]) (Authenticated sender: kensmith@buffalo.edu) by smtp2.acsu.buffalo.edu (Postfix) with ESMTPSA id B20CA47824; Thu, 17 Nov 2011 14:33:24 -0500 (EST) From: Ken Smith To: John Baldwin In-Reply-To: <201111171416.47725.jhb@freebsd.org> References: <201111151849.pAFInR3K012609@svn.freebsd.org> <201111171141.22648.jhb@freebsd.org> <1321551793.82271.55.camel@bauer.cse.buffalo.edu> <201111171416.47725.jhb@freebsd.org> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-IlTpcym9E5bH2WwzRQA2" Date: Thu, 17 Nov 2011 14:33:24 -0500 Message-ID: <1321558404.82271.79.camel@bauer.cse.buffalo.edu> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port X-PM-EL-Spam-Prob: : 8% Cc: Alexey Dokuchaev , src-committers@freebsd.org, Pawel Jakub Dawidek , svn-src-all@freebsd.org, David Chisnall , TAKAHASHI Yoshihiro , Nathan Whitehorn , svn-src-head@freebsd.org Subject: Re: svn commit: r227536 - in head: release share/man/man7 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2011 19:33:29 -0000 --=-IlTpcym9E5bH2WwzRQA2 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable On Thu, 2011-11-17 at 14:16 -0500, John Baldwin wrote: > On Thursday, November 17, 2011 12:43:12 pm Ken Smith wrote: > > On Thu, 2011-11-17 at 11:41 -0500, John Baldwin wrote: > > > On Thursday, November 17, 2011 10:11:36 am Ken Smith wrote: > > > > On Thu, 2011-11-17 at 14:57 +0000, Alexey Dokuchaev wrote: > > > > > On Thu, Nov 17, 2011 at 09:44:52AM -0500, Ken Smith wrote: > > > > > > This is the problem we are trying to "solve": > > > > > >=20 > > > > > > Supported TARGET/TARGET_ARCH pairs for world and kernel targets > > > > > > amd64/amd64 > > > > > > arm/arm > > > > > > arm/armeb > > > > > > i386/i386 > > > > > > ia64/ia64 > > > > > > mips/mipsel > > > > > > mips/mipseb > > > > > > mips/mips64el > > > > > > mips/mips64eb > > > > > > mips/mipsn32eb > > > > > > pc98/i386 > > > > > > powerpc/powerpc > > > > > > powerpc/powerpc64 > > > > > > sparc64/sparc64 > > > > >=20 > > > > > As I see it, for every pair except pc98/i386, second part should = be=20 > used. > > > > > For pc98/i386, first (pc98). Problem solved. ;-) > > > > >=20 > > > > > ./danfe > > > > >=20 > > > >=20 > > > > I'd still sort of prefer no special cases. However ... > > > >=20 > > > > For the ISO / memstick filenames we could just program in `uname -p= ` > > > > and ask the pc98 builder to modify the filenames post-build. But > > > > we still have the dual names needed for the FTP site layout. There > > > > it needs to be fully automated in the installer. > > > >=20 > > > > So, given it seemed like we're sort of stuck with having the dual > > > > names appearing in other places combined with it never causing us > > > > to have special cases and/or conflicts it seemed like just biting > > > > the bullet and having them in the ISO / memstick filenames too ... > > > >=20 > > > > Have I mentioned I don't like any of the options? :-/ > > >=20 > > > I think collapsing down to one name if uname -m =3D=3D uname -p is no= t that=20 > > > terrible and would preserve the existing layout for most of the curre= nt > > > cases (only pc98 would change, yes)? > > >=20 > >=20 > > If you're referring to the FTP directory tree layout we wind up with: > >=20 > > .../releases/amd64/9.0-RELEASE > > .../releases/amd64/ISO-IMAGES/9.0 > >=20 > > for an example of uname -m =3D=3D uname -p. But for our two powerpc re= lated > > architectures we get: > >=20 > > .../releases/powerpc/9.0-RELEASE > > .../releases/powerpc/ISO-IMAGES/9.0 > > .../releases/powerpc/powerpc64/9.0-RELEASE > > .../releases/powerpc/powerpc64/ISO-IMAGES/9.0 > >=20 > > I'm not sure I like the inconsistency. >=20 > Given the available tradeoffs I prefer this to amd64/amd64. We could als= o=20 > define the rule another way, which is if a given TARGET only has a single= =20 > TARGET_ARCH you just use TARGET, otherwise you use TARGET/TARGET_ARCH. (= This=20 > can be parsed out of the output of 'make targets' fairly easily.) That w= ould=20 > let you have: >=20 > releases/amd64/9.0-RELEASE > releases/powerpc/powerpc/9.0-RELEASE > releases/powerpc/powerpc64/9.0-RELEASE >=20 The code that would need to be fixed is in: src/usr.sbin/bsdinstall/scripts/mirrorselect which is running on the machine as it's being installed. I don't think parsing the output of "make targets" in /usr/src is an option at that point. --=20 Ken Smith - From there to here, from here to | kensmith@buffalo.edu there, funny things are everywhere. | - Theodor Geisel | --=-IlTpcym9E5bH2WwzRQA2 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEABECAAYFAk7FYYQACgkQ/G14VSmup/YTrwCfSEw3Mpm4sx5X7sIeZPGxOxXi rEYAn3aYaT0xfQqIf72op93lWTEQr9uH =4amm -----END PGP SIGNATURE----- --=-IlTpcym9E5bH2WwzRQA2-- From owner-svn-src-all@FreeBSD.ORG Thu Nov 17 20:46:51 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D18D51065742; Thu, 17 Nov 2011 20:46:51 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C134C8FC15; Thu, 17 Nov 2011 20:46:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAHKkpXm028817; Thu, 17 Nov 2011 20:46:51 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAHKkpZV028815; Thu, 17 Nov 2011 20:46:51 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201111172046.pAHKkpZV028815@svn.freebsd.org> From: Alexander Motin Date: Thu, 17 Nov 2011 20:46:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227635 - head/sys/dev/ahci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2011 20:46:51 -0000 Author: mav Date: Thu Nov 17 20:46:51 2011 New Revision: 227635 URL: http://svn.freebsd.org/changeset/base/227635 Log: Change the way how "not implemented" AHCI channels handled. Instead of completely skipping them, create ahcich devices for them to allocate unit numbers, but mark them as disabled to prevent driver probe and attach. Last time some BIOSes tend to report unused channels as "not implemented". This change makes ahcichX devices numbering consistent, independently of connected disks. It makes per-channel driver hints usable and CAM devices wiring possible on such systems. Modified: head/sys/dev/ahci/ahci.c Modified: head/sys/dev/ahci/ahci.c ============================================================================== --- head/sys/dev/ahci/ahci.c Thu Nov 17 18:08:56 2011 (r227634) +++ head/sys/dev/ahci/ahci.c Thu Nov 17 20:46:51 2011 (r227635) @@ -498,13 +498,14 @@ ahci_attach(device_t dev) } /* Attach all channels on this controller */ for (unit = 0; unit < ctlr->channels; unit++) { - if ((ctlr->ichannels & (1 << unit)) == 0) - continue; child = device_add_child(dev, "ahcich", -1); - if (child == NULL) + if (child == NULL) { device_printf(dev, "failed to add channel device\n"); - else - device_set_ivars(child, (void *)(intptr_t)unit); + continue; + } + device_set_ivars(child, (void *)(intptr_t)unit); + if ((ctlr->ichannels & (1 << unit)) == 0) + device_disable(child); } bus_generic_attach(dev); return 0; From owner-svn-src-all@FreeBSD.ORG Thu Nov 17 21:06:54 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76F581065672; Thu, 17 Nov 2011 21:06:54 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4C8B28FC08; Thu, 17 Nov 2011 21:06:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAHL6sM8029680; Thu, 17 Nov 2011 21:06:54 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAHL6s47029675; Thu, 17 Nov 2011 21:06:54 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201111172106.pAHL6s47029675@svn.freebsd.org> From: Dimitry Andric Date: Thu, 17 Nov 2011 21:06:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227636 - in head: lib/clang/include/llvm/Config tools/build X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2011 21:06:54 -0000 Author: dim Date: Thu Nov 17 21:06:53 2011 New Revision: 227636 URL: http://svn.freebsd.org/changeset/base/227636 Log: Revert r227538, since it doesn't compile with clang at all (it doesn't allow the built-in operations to be redefined, at least not without excessive force). Instead, just disable LLVM's support for atomic operations for now. Nothing in either clang or the tablegen tools currently depends on it. This still allows users of head built before r198344 to upgrade to top-of-head seamlessly. Deleted: head/tools/build/atomic.c Modified: head/lib/clang/include/llvm/Config/config.h head/lib/clang/include/llvm/Config/llvm-config.h head/tools/build/Makefile Modified: head/lib/clang/include/llvm/Config/config.h ============================================================================== --- head/lib/clang/include/llvm/Config/config.h Thu Nov 17 20:46:51 2011 (r227635) +++ head/lib/clang/include/llvm/Config/config.h Thu Nov 17 21:06:53 2011 (r227636) @@ -552,9 +552,7 @@ /* #undef LLVM_ETCDIR */ /* Has gcc/MSVC atomic intrinsics */ -#ifndef __tune_i386__ -#define LLVM_HAS_ATOMICS 1 -#endif +#define LLVM_HAS_ATOMICS 0 /* Host triple we were built on */ /* #undef LLVM_HOSTTRIPLE */ Modified: head/lib/clang/include/llvm/Config/llvm-config.h ============================================================================== --- head/lib/clang/include/llvm/Config/llvm-config.h Thu Nov 17 20:46:51 2011 (r227635) +++ head/lib/clang/include/llvm/Config/llvm-config.h Thu Nov 17 21:06:53 2011 (r227636) @@ -34,9 +34,7 @@ /* #undef LLVM_ETCDIR */ /* Has gcc/MSVC atomic intrinsics */ -#ifndef __tune_i386__ -#define LLVM_HAS_ATOMICS 1 -#endif +#define LLVM_HAS_ATOMICS 0 /* Host triple we were built on */ /* #undef LLVM_HOSTTRIPLE */ Modified: head/tools/build/Makefile ============================================================================== --- head/tools/build/Makefile Thu Nov 17 20:46:51 2011 (r227635) +++ head/tools/build/Makefile Thu Nov 17 21:06:53 2011 (r227636) @@ -7,10 +7,6 @@ SRCS= INCSGROUPS= INCS INCS= -.if ${MACHINE_ARCH} == i386 -SRCS+= atomic.c -.endif - BOOTSTRAPPING?= 0 .if empty(SRCS) From owner-svn-src-all@FreeBSD.ORG Thu Nov 17 21:07:57 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0696B1065670; Thu, 17 Nov 2011 21:07:57 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D0F738FC0A; Thu, 17 Nov 2011 21:07:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAHL7uHQ029760; Thu, 17 Nov 2011 21:07:56 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAHL7urV029757; Thu, 17 Nov 2011 21:07:56 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201111172107.pAHL7urV029757@svn.freebsd.org> From: Alexander Motin Date: Thu, 17 Nov 2011 21:07:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227637 - head/sys/cam X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2011 21:07:57 -0000 Author: mav Date: Thu Nov 17 21:07:56 2011 New Revision: 227637 URL: http://svn.freebsd.org/changeset/base/227637 Log: Introduce CAM_SIM_POLLED SIM flag, indicating that it works in polling mode. It blocks CAM SWI usage on requests completion, unneeded because of polling and denied during kernel dumping because of blocked scheduler. Before r198899 there was periph flag CAM_PERIPH_POLLED, but that was wrong, because there is whole SIM is polled or handled by SWI, not a single periph. Tested by: kib MFC after: 1 month Modified: head/sys/cam/cam_sim.h head/sys/cam/cam_xpt.c Modified: head/sys/cam/cam_sim.h ============================================================================== --- head/sys/cam/cam_sim.h Thu Nov 17 21:06:53 2011 (r227636) +++ head/sys/cam/cam_sim.h Thu Nov 17 21:07:56 2011 (r227637) @@ -104,7 +104,8 @@ struct cam_sim { u_int32_t flags; #define CAM_SIM_REL_TIMEOUT_PENDING 0x01 #define CAM_SIM_MPSAFE 0x02 -#define CAM_SIM_ON_DONEQ 0x04 +#define CAM_SIM_ON_DONEQ 0x04 +#define CAM_SIM_POLLED 0x08 struct callout callout; struct cam_devq *devq; /* Device Queue to use for this SIM */ int refcount; /* References to the SIM. */ Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Thu Nov 17 21:06:53 2011 (r227636) +++ head/sys/cam/cam_xpt.c Thu Nov 17 21:07:56 2011 (r227637) @@ -2957,6 +2957,9 @@ xpt_polled_action(union ccb *start_ccb) mtx_assert(sim->mtx, MA_OWNED); + /* Don't use ISR for this SIM while polling. */ + sim->flags |= CAM_SIM_POLLED; + /* * Steal an opening so that no other queued requests * can get it before us while we simulate interrupts. @@ -2996,6 +2999,9 @@ xpt_polled_action(union ccb *start_ccb) } else { start_ccb->ccb_h.status = CAM_RESRC_UNAVAIL; } + + /* We will use CAM ISR for this SIM again. */ + sim->flags &= ~CAM_SIM_POLLED; } /* @@ -4224,7 +4230,7 @@ xpt_done(union ccb *done_ccb) TAILQ_INSERT_TAIL(&sim->sim_doneq, &done_ccb->ccb_h, sim_links.tqe); done_ccb->ccb_h.pinfo.index = CAM_DONEQ_INDEX; - if ((sim->flags & CAM_SIM_ON_DONEQ) == 0) { + if ((sim->flags & (CAM_SIM_ON_DONEQ | CAM_SIM_POLLED)) == 0) { mtx_lock(&cam_simq_lock); first = TAILQ_EMPTY(&cam_simq); TAILQ_INSERT_TAIL(&cam_simq, sim, links); From owner-svn-src-all@FreeBSD.ORG Thu Nov 17 21:24:56 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A8217106564A; Thu, 17 Nov 2011 21:24:56 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 977118FC0C; Thu, 17 Nov 2011 21:24:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAHLOu60030504; Thu, 17 Nov 2011 21:24:56 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAHLOush030501; Thu, 17 Nov 2011 21:24:56 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201111172124.pAHLOush030501@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 17 Nov 2011 21:24:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227638 - in head/sys: dev/re pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2011 21:24:56 -0000 Author: yongari Date: Thu Nov 17 21:24:56 2011 New Revision: 227638 URL: http://svn.freebsd.org/changeset/base/227638 Log: Add preliminary support for second generation RTL8105E PCIe FastEthernet. H/W donated by: RealTek Semiconductor Corp. Modified: head/sys/dev/re/if_re.c head/sys/pci/if_rlreg.h Modified: head/sys/dev/re/if_re.c ============================================================================== --- head/sys/dev/re/if_re.c Thu Nov 17 21:07:56 2011 (r227637) +++ head/sys/dev/re/if_re.c Thu Nov 17 21:24:56 2011 (r227638) @@ -222,6 +222,7 @@ static const struct rl_hwrev const re_hw { RL_HWREV_8401E, RL_8169, "8401E", RL_MTU }, { RL_HWREV_8402, RL_8169, "8402", RL_MTU }, { RL_HWREV_8105E, RL_8169, "8105E", RL_MTU }, + { RL_HWREV_8105E_SPIN1, RL_8169, "8105E", RL_MTU }, { RL_HWREV_8168B_SPIN2, RL_8169, "8168", RL_JUMBO_MTU }, { RL_HWREV_8168B_SPIN3, RL_8169, "8168", RL_JUMBO_MTU }, { RL_HWREV_8168C, RL_8169, "8168C/8111C", RL_JUMBO_MTU_6K }, @@ -1405,6 +1406,7 @@ re_attach(device_t dev) case RL_HWREV_8401E: case RL_HWREV_8402: case RL_HWREV_8105E: + case RL_HWREV_8105E_SPIN1: sc->rl_flags |= RL_FLAG_PHYWAKE | RL_FLAG_PHYWAKE_PM | RL_FLAG_PAR | RL_FLAG_DESCV2 | RL_FLAG_MACSTAT | RL_FLAG_FASTETHER | RL_FLAG_CMDSTOP | RL_FLAG_AUTOPAD; Modified: head/sys/pci/if_rlreg.h ============================================================================== --- head/sys/pci/if_rlreg.h Thu Nov 17 21:07:56 2011 (r227637) +++ head/sys/pci/if_rlreg.h Thu Nov 17 21:24:56 2011 (r227638) @@ -178,6 +178,7 @@ #define RL_HWREV_8168C_SPIN2 0x3C400000 #define RL_HWREV_8168CP 0x3C800000 #define RL_HWREV_8105E 0x40800000 +#define RL_HWREV_8105E_SPIN1 0x40C00000 #define RL_HWREV_8402 0x44000000 #define RL_HWREV_8411 0x48800000 #define RL_HWREV_8139 0x60000000 From owner-svn-src-all@FreeBSD.ORG Thu Nov 17 22:07:51 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 65FEB106564A; Thu, 17 Nov 2011 22:07:51 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3C34E8FC12; Thu, 17 Nov 2011 22:07:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAHM7pnZ032298; Thu, 17 Nov 2011 22:07:51 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAHM7pvL032295; Thu, 17 Nov 2011 22:07:51 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201111172207.pAHM7pvL032295@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 17 Nov 2011 22:07:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227639 - in head/sys: dev/re pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2011 22:07:51 -0000 Author: yongari Date: Thu Nov 17 22:07:50 2011 New Revision: 227639 URL: http://svn.freebsd.org/changeset/base/227639 Log: Add preliminary support for RTL8168/8111F PCIe Gigabit ethernet. H/W donated by: RealTek Semiconductor Corp. Modified: head/sys/dev/re/if_re.c head/sys/pci/if_rlreg.h Modified: head/sys/dev/re/if_re.c ============================================================================== --- head/sys/dev/re/if_re.c Thu Nov 17 21:24:56 2011 (r227638) +++ head/sys/dev/re/if_re.c Thu Nov 17 22:07:50 2011 (r227639) @@ -181,7 +181,7 @@ static const struct rl_type const re_dev { RT_VENDORID, RT_DEVICEID_8101E, 0, "RealTek 810xE PCIe 10/100baseTX" }, { RT_VENDORID, RT_DEVICEID_8168, 0, - "RealTek 8168/8111 B/C/CP/D/DP/E PCIe Gigabit Ethernet" }, + "RealTek 8168/8111 B/C/CP/D/DP/E/F PCIe Gigabit Ethernet" }, { RT_VENDORID, RT_DEVICEID_8169, 0, "RealTek 8169/8169S/8169SB(L)/8110S/8110SB(L) Gigabit Ethernet" }, { RT_VENDORID, RT_DEVICEID_8169SC, 0, @@ -232,6 +232,7 @@ static const struct rl_hwrev const re_hw { RL_HWREV_8168DP, RL_8169, "8168DP/8111DP", RL_JUMBO_MTU_9K }, { RL_HWREV_8168E, RL_8169, "8168E/8111E", RL_JUMBO_MTU_9K}, { RL_HWREV_8168E_VL, RL_8169, "8168E/8111E-VL", RL_JUMBO_MTU_6K}, + { RL_HWREV_8168F, RL_8169, "8168F/8111F", RL_JUMBO_MTU_9K}, { RL_HWREV_8411, RL_8169, "8411", RL_JUMBO_MTU_9K}, { 0, 0, NULL, 0 } }; @@ -1438,6 +1439,7 @@ re_attach(device_t dev) RL_FLAG_CMDSTOP | RL_FLAG_AUTOPAD | RL_FLAG_JUMBOV2; break; case RL_HWREV_8168E_VL: + case RL_HWREV_8168F: case RL_HWREV_8411: sc->rl_flags |= RL_FLAG_PHYWAKE | RL_FLAG_PAR | RL_FLAG_DESCV2 | RL_FLAG_MACSTAT | RL_FLAG_CMDSTOP | Modified: head/sys/pci/if_rlreg.h ============================================================================== --- head/sys/pci/if_rlreg.h Thu Nov 17 21:24:56 2011 (r227638) +++ head/sys/pci/if_rlreg.h Thu Nov 17 22:07:50 2011 (r227639) @@ -180,6 +180,7 @@ #define RL_HWREV_8105E 0x40800000 #define RL_HWREV_8105E_SPIN1 0x40C00000 #define RL_HWREV_8402 0x44000000 +#define RL_HWREV_8168F 0x48000000 #define RL_HWREV_8411 0x48800000 #define RL_HWREV_8139 0x60000000 #define RL_HWREV_8139A 0x70000000 From owner-svn-src-all@FreeBSD.ORG Thu Nov 17 22:56:40 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C1D061065672; Thu, 17 Nov 2011 22:56:40 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 97F5B8FC0A; Thu, 17 Nov 2011 22:56:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAHMueS9034492; Thu, 17 Nov 2011 22:56:40 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAHMuemi034488; Thu, 17 Nov 2011 22:56:40 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201111172256.pAHMuemi034488@svn.freebsd.org> From: Marius Strobl Date: Thu, 17 Nov 2011 22:56:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227640 - head/sys/dev/sfxge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2011 22:56:40 -0000 Author: marius Date: Thu Nov 17 22:56:40 2011 New Revision: 227640 URL: http://svn.freebsd.org/changeset/base/227640 Log: Fix compilation on ILP32. Modified: head/sys/dev/sfxge/sfxge_dma.c head/sys/dev/sfxge/sfxge_intr.c head/sys/dev/sfxge/sfxge_tx.c Modified: head/sys/dev/sfxge/sfxge_dma.c ============================================================================== --- head/sys/dev/sfxge/sfxge_dma.c Thu Nov 17 22:07:50 2011 (r227639) +++ head/sys/dev/sfxge/sfxge_dma.c Thu Nov 17 22:56:40 2011 (r227640) @@ -134,8 +134,8 @@ sfxge_dma_alloc(struct sfxge_softc *sc, /* Create the child DMA tag. */ if (bus_dma_tag_create(sc->parent_dma_tag, PAGE_SIZE, 0, - 0x3FFFFFFFFFFFULL, BUS_SPACE_MAXADDR, NULL, NULL, len, 1, len, 0, - NULL, NULL, &esmp->esm_tag) != 0) { + MIN(0x3FFFFFFFFFFFUL, BUS_SPACE_MAXADDR), BUS_SPACE_MAXADDR, NULL, + NULL, len, 1, len, 0, NULL, NULL, &esmp->esm_tag) != 0) { device_printf(sc->dev, "Couldn't allocate txq DMA tag\n"); return (ENOMEM); } Modified: head/sys/dev/sfxge/sfxge_intr.c ============================================================================== --- head/sys/dev/sfxge/sfxge_intr.c Thu Nov 17 22:07:50 2011 (r227639) +++ head/sys/dev/sfxge/sfxge_intr.c Thu Nov 17 22:56:40 2011 (r227640) @@ -146,7 +146,7 @@ sfxge_intr_message(void *arg) do { mask = intr->mask; - } while (atomic_cmpset_long(&intr->mask, mask, + } while (atomic_cmpset_ptr(&intr->mask, mask, mask | (1 << index)) == 0); return; Modified: head/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- head/sys/dev/sfxge/sfxge_tx.c Thu Nov 17 22:07:50 2011 (r227639) +++ head/sys/dev/sfxge/sfxge_tx.c Thu Nov 17 22:56:40 2011 (r227640) @@ -135,7 +135,7 @@ sfxge_tx_qdpl_swizzle(struct sfxge_txq * /* Acquire the put list. */ putp = &stdp->std_put; - put = atomic_readandclear_long(putp); + put = atomic_readandclear_ptr(putp); mbuf = (void *)put; if (mbuf == NULL) @@ -484,7 +484,7 @@ sfxge_tx_qdpl_put(struct sfxge_txq *txq, return ENOBUFS; mbuf->m_pkthdr.csum_data = old_len + 1; mbuf->m_nextpkt = (void *)old; - } while (atomic_cmpset_long(putp, old, new) == 0); + } while (atomic_cmpset_ptr(putp, old, new) == 0); } return (0); @@ -1323,9 +1323,9 @@ sfxge_tx_qinit(struct sfxge_softc *sc, u &txq->buf_base_id); /* Create a DMA tag for packet mappings. */ - if (bus_dma_tag_create(sc->parent_dma_tag, 1, 0x1000, 0x3FFFFFFFFFFFULL, - BUS_SPACE_MAXADDR, NULL, NULL, 0x11000, - SFXGE_TX_MAPPING_MAX_SEG, 0x1000, 0, NULL, NULL, + if (bus_dma_tag_create(sc->parent_dma_tag, 1, 0x1000, + MIN(0x3FFFFFFFFFFFUL, BUS_SPACE_MAXADDR), BUS_SPACE_MAXADDR, NULL, + NULL, 0x11000, SFXGE_TX_MAPPING_MAX_SEG, 0x1000, 0, NULL, NULL, &txq->packet_dma_tag) != 0) { device_printf(sc->dev, "Couldn't allocate txq DMA tag\n"); rc = ENOMEM; From owner-svn-src-all@FreeBSD.ORG Thu Nov 17 22:59:16 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B8464106566C; Thu, 17 Nov 2011 22:59:16 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A82A88FC0A; Thu, 17 Nov 2011 22:59:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAHMxGYZ034627; Thu, 17 Nov 2011 22:59:16 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAHMxGk8034625; Thu, 17 Nov 2011 22:59:16 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201111172259.pAHMxGk8034625@svn.freebsd.org> From: Marius Strobl Date: Thu, 17 Nov 2011 22:59:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227641 - head/sys/dev/sfxge/common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2011 22:59:16 -0000 Author: marius Date: Thu Nov 17 22:59:16 2011 New Revision: 227641 URL: http://svn.freebsd.org/changeset/base/227641 Log: Implement prefetch_read_{many,once}() for sparc64 and fix compilation on other !x86 architectures. Modified: head/sys/dev/sfxge/common/efsys.h Modified: head/sys/dev/sfxge/common/efsys.h ============================================================================== --- head/sys/dev/sfxge/common/efsys.h Thu Nov 17 22:56:40 2011 (r227640) +++ head/sys/dev/sfxge/common/efsys.h Thu Nov 17 22:59:16 2011 (r227641) @@ -97,10 +97,11 @@ extern "C" { MALLOC_DECLARE(M_SFXGE); /* Machine dependend prefetch wrappers */ -#if defined(__i386) || defined(__amd64) +#if defined(__i386__) || defined(__amd64__) static __inline void prefetch_read_many(void *addr) { + __asm__( "prefetcht0 (%0)" : @@ -110,11 +111,44 @@ prefetch_read_many(void *addr) static __inline void prefetch_read_once(void *addr) { + __asm__( "prefetchnta (%0)" : : "r" (addr)); } +#elif defined(__sparc64__) +static __inline void +prefetch_read_many(void *addr) +{ + + __asm__( + "prefetch [%0], 0" + : + : "r" (addr)); +} + +static __inline void +prefetch_read_once(void *addr) +{ + + __asm__( + "prefetch [%0], 1" + : + : "r" (addr)); +} +#else +static __inline void +prefetch_read_many(void *addr) +{ + +} + +static __inline void +prefetch_read_once(void *addr) +{ + +} #endif #if defined(__i386__) || defined(__amd64__) From owner-svn-src-all@FreeBSD.ORG Thu Nov 17 23:04:43 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D436A106566C; Thu, 17 Nov 2011 23:04:43 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C42968FC14; Thu, 17 Nov 2011 23:04:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAHN4hao034931; Thu, 17 Nov 2011 23:04:43 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAHN4hZI034928; Thu, 17 Nov 2011 23:04:43 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201111172304.pAHN4hZI034928@svn.freebsd.org> From: Eitan Adler Date: Thu, 17 Nov 2011 23:04:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227642 - head/sys/dev/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2011 23:04:43 -0000 Author: eadler (ports committer) Date: Thu Nov 17 23:04:43 2011 New Revision: 227642 URL: http://svn.freebsd.org/changeset/base/227642 Log: - be more precise about the unit of measurement Approved by: jhb MFC after: 3 days Modified: head/sys/dev/acpica/acpi_thermal.c Modified: head/sys/dev/acpica/acpi_thermal.c ============================================================================== --- head/sys/dev/acpica/acpi_thermal.c Thu Nov 17 22:59:16 2011 (r227641) +++ head/sys/dev/acpica/acpi_thermal.c Thu Nov 17 23:04:43 2011 (r227642) @@ -245,7 +245,7 @@ acpi_tz_attach(device_t dev) SYSCTL_ADD_INT(&acpi_tz_sysctl_ctx, SYSCTL_CHILDREN(acpi_tz_sysctl_tree), OID_AUTO, "polling_rate", CTLFLAG_RW, - &acpi_tz_polling_rate, 0, "monitor polling rate in seconds"); + &acpi_tz_polling_rate, 0, "monitor polling interval in seconds"); SYSCTL_ADD_INT(&acpi_tz_sysctl_ctx, SYSCTL_CHILDREN(acpi_tz_sysctl_tree), OID_AUTO, "user_override", CTLFLAG_RW, &acpi_tz_override, 0, From owner-svn-src-all@FreeBSD.ORG Fri Nov 18 01:28:52 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B4BAD106566C; Fri, 18 Nov 2011 01:28:52 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A14EF8FC16; Fri, 18 Nov 2011 01:28:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAI1SqW7041461; Fri, 18 Nov 2011 01:28:52 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAI1SqDe041458; Fri, 18 Nov 2011 01:28:52 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201111180128.pAI1SqDe041458@svn.freebsd.org> From: Martin Matuska Date: Fri, 18 Nov 2011 01:28:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227646 - in head/cddl: contrib/opensolaris/cmd/zfs contrib/opensolaris/cmd/zpool sbin/zfs sbin/zpool X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Nov 2011 01:28:52 -0000 Author: mm Date: Fri Nov 18 01:28:52 2011 New Revision: 227646 URL: http://svn.freebsd.org/changeset/base/227646 Log: Update and desolarization of zfs(8) and zpool(8) manual pages: - synchronized to match new vendor code (Illumos rev. 13513) [1] - removed references to sun commands (replaced with FreeBSD commands) - removed ATTRIBUTES sections - updated SEE ALSO sections - properly updated copyright information (required by CDDL) - remove empty lines via MANFILTER zfs(8) only: - replaced "Zones" section with new "Jails" section - removed misleading "ZFS Volumes as Swap or Dump Devices" section - updated shareiscsi and sharesmb option information (not supported on FreeBSD) - replace zoned property with jailed property zpool(8) only: - updated device names in examples Obtained from: Illumos (as of rev. 13513:f84d4672fdbd) [1] MFC after: 1 week Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 head/cddl/sbin/zfs/Makefile head/cddl/sbin/zpool/Makefile Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Fri Nov 18 01:07:08 2011 (r227645) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Fri Nov 18 01:28:52 2011 (r227646) @@ -8,7 +8,9 @@ .\" the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] .\" Copyright 2011 Nexenta Systems, Inc. All rights reserved. .\" Copyright 2011 by Delphix. All rights reserved. -.TH zfs 1M "24 Sep 2009" "SunOS 5.11" "System Administration Commands" +.\" Portions Copyright 2011 Pawel Jakub Dawidek +.\" Portions Copyright 2011 Martin Matuska +.TH ZFS 8 "September 24, 2009" FreeBSD .SH NAME zfs \- configures ZFS file systems .SH SYNOPSIS @@ -39,7 +41,7 @@ zfs \- configures ZFS file systems .LP .nf -\fBzfs\fR \fBsnapshot\fR [\fB-r\fR] [\fB-o\fR \fIproperty\fR=\fIvalue\fR]... +\fBzfs\fR \fBsnapshot\fR [\fB-r\fR] [\fB-o\fR \fIproperty\fR=\fIvalue\fR]... \fIfilesystem@snapname\fR|\fIvolume@snapname\fR .fi @@ -60,7 +62,7 @@ zfs \- configures ZFS file systems .LP .nf -\fBzfs\fR \fBrename\fR \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR +\fBzfs\fR \fBrename\fR \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR .fi @@ -125,7 +127,7 @@ zfs \- configures ZFS file systems .LP .nf -\fBzfs\fR \fBmount\fR +\fBzfs\fR \fBmount\fR .fi .LP @@ -170,7 +172,7 @@ zfs \- configures ZFS file systems .LP .nf -\fBzfs\fR \fBallow\fR [\fB-ldug\fR] "\fIeveryone\fR"|\fIuser\fR|\fIgroup\fR[,...] \fIperm\fR|\fI@setname\fR[,...] +\fBzfs\fR \fBallow\fR [\fB-ldug\fR] "\fIeveryone\fR"|\fIuser\fR|\fIgroup\fR[,...] \fIperm\fR|\fI@setname\fR[,...] \fIfilesystem\fR|\fIvolume\fR .fi @@ -191,7 +193,7 @@ zfs \- configures ZFS file systems .LP .nf -\fBzfs\fR \fBunallow\fR [\fB-rldug\fR] "\fIeveryone\fR"|\fIuser\fR|\fIgroup\fR[,...] [\fIperm\fR|@\fIsetname\fR[,... ]] +\fBzfs\fR \fBunallow\fR [\fB-rldug\fR] "\fIeveryone\fR"|\fIuser\fR|\fIgroup\fR[,...] [\fIperm\fR|@\fIsetname\fR[,... ]] \fIfilesystem\fR|\fIvolume\fR .fi @@ -225,17 +227,22 @@ zfs \- configures ZFS file systems \fBzfs\fR \fBrelease\fR [\fB-r\fR] \fItag\fR \fIsnapshot\fR... .fi -\fBzfs\fR \fBjail\fR \fBjailid\fR \fB\fIfilesystem\fR\fR +.LP +.nf +\fBzfs\fR \fBjail\fR \fIjailid\fR \fIfilesystem\fR .fi + .LP .nf -\fBzfs\fR \fBunjail\fR \fBjailid\fR \fB\fIfilesystem\fR\fR +\fBzfs\fR \fBunjail\fR \fIjailid\fR \fIfilesystem\fR .fi .SH DESCRIPTION .sp .LP -The \fBzfs\fR command configures \fBZFS\fR datasets within a \fBZFS\fR storage pool, as described in \fBzpool\fR(1M). A dataset is identified by a unique path within the \fBZFS\fR namespace. For example: +The \fBzfs\fR command configures \fBZFS\fR datasets within a \fBZFS\fR storage +pool, as described in \fBzpool\fR(8). A dataset is identified by a unique path +within the \fBZFS\fR namespace. For example: .sp .in +2 .nf @@ -252,115 +259,164 @@ where the maximum length of a dataset na A dataset can be one of the following: .sp .ne 2 -.mk .na \fB\fIfile system\fR\fR .ad .sp .6 .RS 4n -A \fBZFS\fR dataset of type \fBfilesystem\fR can be mounted within the standard system namespace and behaves like other file systems. While \fBZFS\fR file systems are designed to be \fBPOSIX\fR compliant, known issues exist that prevent compliance in some cases. Applications that depend on standards conformance might fail due to nonstandard behavior when checking file system free space. +A \fBZFS\fR dataset of type \fBfilesystem\fR can be mounted within the standard +system namespace and behaves like other file systems. While \fBZFS\fR file +systems are designed to be \fBPOSIX\fR compliant, known issues exist that +prevent compliance in some cases. Applications that depend on standards +conformance might fail due to nonstandard behavior when checking file system +free space. .RE .sp .ne 2 -.mk .na \fB\fIvolume\fR\fR .ad .sp .6 .RS 4n -A logical volume exported as a raw or block device. This type of dataset should only be used under special circumstances. File systems are typically used in most environments. +A logical volume exported as a raw or block device. This type of dataset should +only be used under special circumstances. File systems are typically used in +most environments. .RE .sp .ne 2 -.mk .na \fB\fIsnapshot\fR\fR .ad .sp .6 .RS 4n -A read-only version of a file system or volume at a given point in time. It is specified as \fIfilesystem@name\fR or \fIvolume@name\fR. +A read-only version of a file system or volume at a given point in time. It is +specified as \fIfilesystem@name\fR or \fIvolume@name\fR. .RE .SS "ZFS File System Hierarchy" .sp .LP -A \fBZFS\fR storage pool is a logical collection of devices that provide space for datasets. A storage pool is also the root of the \fBZFS\fR file system hierarchy. +A \fBZFS\fR storage pool is a logical collection of devices that provide space +for datasets. A storage pool is also the root of the \fBZFS\fR file system +hierarchy. .sp .LP -The root of the pool can be accessed as a file system, such as mounting and unmounting, taking snapshots, and setting properties. The physical storage characteristics, however, are managed by the \fBzpool\fR(1M) command. +The root of the pool can be accessed as a file system, such as mounting and +unmounting, taking snapshots, and setting properties. The physical storage +characteristics, however, are managed by the \fBzpool\fR(8) command. .sp .LP -See \fBzpool\fR(1M) for more information on creating and administering pools. +See \fBzpool\fR(8) for more information on creating and administering pools. .SS "Snapshots" .sp .LP -A snapshot is a read-only copy of a file system or volume. Snapshots can be created extremely quickly, and initially consume no additional space within the pool. As data within the active dataset changes, the snapshot consumes more data than would otherwise be shared with the active dataset. +A snapshot is a read-only copy of a file system or volume. Snapshots can be +created extremely quickly, and initially consume no additional space within the +pool. As data within the active dataset changes, the snapshot consumes more +data than would otherwise be shared with the active dataset. .sp .LP -Snapshots can have arbitrary names. Snapshots of volumes can be cloned or rolled back, but cannot be accessed independently. +Snapshots can have arbitrary names. Snapshots of volumes can be cloned or +rolled back, but cannot be accessed independently. .sp .LP -File system snapshots can be accessed under the \fB\&.zfs/snapshot\fR directory in the root of the file system. Snapshots are automatically mounted on demand and may be unmounted at regular intervals. The visibility of the \fB\&.zfs\fR directory can be controlled by the \fBsnapdir\fR property. +File system snapshots can be accessed under the \fB\&.zfs/snapshot\fR directory +in the root of the file system. Snapshots are automatically mounted on demand +and may be unmounted at regular intervals. The visibility of the \fB\&.zfs\fR +directory can be controlled by the \fBsnapdir\fR property. .SS "Clones" .sp .LP -A clone is a writable volume or file system whose initial contents are the same as another dataset. As with snapshots, creating a clone is nearly instantaneous, and initially consumes no additional space. -.sp -.LP -Clones can only be created from a snapshot. When a snapshot is cloned, it creates an implicit dependency between the parent and child. Even though the clone is created somewhere else in the dataset hierarchy, the original snapshot cannot be destroyed as long as a clone exists. The \fBorigin\fR property exposes this dependency, and the \fBdestroy\fR command lists any such dependencies, if they exist. -.sp -.LP -The clone parent-child dependency relationship can be reversed by using the \fBpromote\fR subcommand. This causes the "origin" file system to become a clone of the specified file system, which makes it possible to destroy the file system that the clone was created from. +A clone is a writable volume or file system whose initial contents are the same +as another dataset. As with snapshots, creating a clone is nearly +instantaneous, and initially consumes no additional space. +.sp +.LP +Clones can only be created from a snapshot. When a snapshot is cloned, it +creates an implicit dependency between the parent and child. Even though the +clone is created somewhere else in the dataset hierarchy, the original snapshot +cannot be destroyed as long as a clone exists. The \fBorigin\fR property +exposes this dependency, and the \fBdestroy\fR command lists any such +dependencies, if they exist. +.sp +.LP +The clone parent-child dependency relationship can be reversed by using the +\fBpromote\fR subcommand. This causes the "origin" file system to become a +clone of the specified file system, which makes it possible to destroy the file +system that the clone was created from. .SS "Mount Points" .sp .LP -Creating a \fBZFS\fR file system is a simple operation, so the number of file systems per system is likely to be numerous. To cope with this, \fBZFS\fR automatically manages mounting and unmounting file systems without the need to edit the \fB/etc/vfstab\fR file. All automatically managed file systems are mounted by \fBZFS\fR at boot time. +Creating a \fBZFS\fR file system is a simple operation, so the number of file +systems per system is likely to be numerous. To cope with this, \fBZFS\fR +automatically manages mounting and unmounting file systems without the need to +edit the \fB/etc/fstab\fR file. All automatically managed file systems are +mounted by \fBZFS\fR at boot time. .sp .LP -By default, file systems are mounted under \fB/\fIpath\fR\fR, where \fIpath\fR is the name of the file system in the \fBZFS\fR namespace. Directories are created and destroyed as needed. +By default, file systems are mounted under \fB/\fIpath\fR\fR, where \fIpath\fR +is the name of the file system in the \fBZFS\fR namespace. Directories are +created and destroyed as needed. .sp .LP -A file system can also have a mount point set in the \fBmountpoint\fR property. This directory is created as needed, and \fBZFS\fR automatically mounts the file system when the \fBzfs mount -a\fR command is invoked (without editing \fB/etc/vfstab\fR). The \fBmountpoint\fR property can be inherited, so if \fBpool/home\fR has a mount point of \fB/export/stuff\fR, then \fBpool/home/user\fR automatically inherits a mount point of \fB/export/stuff/user\fR. +A file system can also have a mount point set in the \fBmountpoint\fR property. +This directory is created as needed, and \fBZFS\fR automatically mounts the +file system when the \fBzfs mount -a\fR command is invoked (without editing +\fB/etc/fstab\fR). The \fBmountpoint\fR property can be inherited, so if +\fBpool/home\fR has a mount point of \fB/export/stuff\fR, then +\fBpool/home/user\fR automatically inherits a mount point of +\fB/export/stuff/user\fR. .sp .LP -A file system \fBmountpoint\fR property of \fBnone\fR prevents the file system from being mounted. +A file system \fBmountpoint\fR property of \fBnone\fR prevents the file system +from being mounted. .sp .LP -If needed, \fBZFS\fR file systems can also be managed with traditional tools (\fBmount\fR, \fBumount\fR, \fB/etc/vfstab\fR). If a file system's mount point is set to \fBlegacy\fR, \fBZFS\fR makes no attempt to manage the file system, and the administrator is responsible for mounting and unmounting the file system. -.SS "Zones" +If needed, \fBZFS\fR file systems can also be managed with traditional tools +(\fBmount\fR, \fBumount\fR, \fB/etc/fstab\fR). If a file system's mount point +is set to \fBlegacy\fR, \fBZFS\fR makes no attempt to manage the file system, +and the administrator is responsible for mounting and unmounting the file +system. +.SS "Jails" .sp .LP -A \fBZFS\fR file system can be added to a non-global zone by using the \fBzonecfg\fR \fBadd fs\fR subcommand. A \fBZFS\fR file system that is added to a non-global zone must have its \fBmountpoint\fR property set to \fBlegacy\fR. +A \fBZFS\fR dataset can be attached to a jail by using the \fBzfs\fR +\fBjail\fR subcommand. You cannot attach a dataset to one jail and the +children of the same dataset to another jails. To allow managment of the +dataset from within a jail, the "\fBjailed\fR" property has to be set. +The \fBquota\fR property cannot be changed from within a jail. .sp .LP -The physical properties of an added file system are controlled by the global administrator. However, the zone administrator can create, modify, or destroy files within the added file system, depending on how the file system is mounted. +A \fBZFS\fR dataset can be detached from a jail using the \fBzfs\fR +\fBunjail\fR subcommand. .sp .LP -A dataset can also be delegated to a non-global zone by using the \fBzonecfg\fR \fBadd dataset\fR subcommand. You cannot delegate a dataset to one zone and the children of the same dataset to another zone. The zone administrator can change properties of the dataset or any of its children. However, the \fBquota\fR property is controlled by the global administrator. -.sp -.LP -A \fBZFS\fR volume can be added as a device to a non-global zone by using the \fBzonecfg\fR \fBadd device\fR subcommand. However, its physical properties can be modified only by the global administrator. -.sp -.LP -For more information about \fBzonecfg\fR syntax, see \fBzonecfg\fR(1M). -.sp -.LP -After a dataset is delegated to a non-global zone, the \fBzoned\fR property is automatically set. A zoned file system cannot be mounted in the global zone, since the zone administrator might have to set the mount point to an unacceptable value. -.sp -.LP -The global administrator can forcibly clear the \fBzoned\fR property, though this should be done with extreme care. The global administrator should verify that all the mount points are acceptable before clearing the property. +After a dataset is attached to a jail and the \fBjailed\fR property is set, +a jailed file system cannot be mounted outside the jail, since the jail +administrator might have set the mount point to an unacceptable value. .SS "Native Properties" .sp .LP -Properties are divided into two types, native properties and user-defined (or "user") properties. Native properties either export internal statistics or control \fBZFS\fR behavior. In addition, native properties are either editable or read-only. User properties have no effect on \fBZFS\fR behavior, but you can use them to annotate datasets in a way that is meaningful in your environment. For more information about user properties, see the "User Properties" section, below. -.sp -.LP -Every dataset has a set of properties that export statistics about the dataset as well as control various behaviors. Properties are inherited from the parent unless overridden by the child. Some properties apply only to certain types of datasets (file systems, volumes, or snapshots). -.sp -.LP -The values of numeric properties can be specified using human-readable suffixes (for example, \fBk\fR, \fBKB\fR, \fBM\fR, \fBGb\fR, and so forth, up to \fBZ\fR for zettabyte). The following are all valid (and equal) specifications: +Properties are divided into two types, native properties and user-defined (or +"user") properties. Native properties either export internal statistics or +control \fBZFS\fR behavior. In addition, native properties are either editable +or read-only. User properties have no effect on \fBZFS\fR behavior, but you can +use them to annotate datasets in a way that is meaningful in your environment. +For more information about user properties, see the "User Properties" section, +below. +.sp +.LP +Every dataset has a set of properties that export statistics about the dataset +as well as control various behaviors. Properties are inherited from the parent +unless overridden by the child. Some properties apply only to certain types of +datasets (file systems, volumes, or snapshots). +.sp +.LP +The values of numeric properties can be specified using human-readable suffixes +(for example, \fBk\fR, \fBKB\fR, \fBM\fR, \fBGb\fR, and so forth, up to \fBZ\fR +for zettabyte). The following are all valid (and equal) specifications: .sp .in +2 .nf @@ -371,37 +427,47 @@ The values of numeric properties can be .sp .LP -The values of non-numeric properties are case sensitive and must be lowercase, except for \fBmountpoint\fR, \fBsharenfs\fR, and \fBsharesmb\fR. +The values of non-numeric properties are case sensitive and must be lowercase, +except for \fBmountpoint\fR, \fBsharenfs\fR, and \fBsharesmb\fR. .sp .LP -The following native properties consist of read-only statistics about the dataset. These properties can be neither set, nor inherited. Native properties apply to all dataset types unless otherwise noted. +The following native properties consist of read-only statistics about the +dataset. These properties can be neither set, nor inherited. Native properties +apply to all dataset types unless otherwise noted. .sp .ne 2 -.mk .na \fB\fBavailable\fR\fR .ad .sp .6 .RS 4n -The amount of space available to the dataset and all its children, assuming that there is no other activity in the pool. Because space is shared within a pool, availability can be limited by any number of factors, including physical pool size, quotas, reservations, or other datasets within the pool. +The amount of space available to the dataset and all its children, assuming +that there is no other activity in the pool. Because space is shared within a +pool, availability can be limited by any number of factors, including physical +pool size, quotas, reservations, or other datasets within the pool. .sp -This property can also be referred to by its shortened column name, \fBavail\fR. +This property can also be referred to by its shortened column name, +\fBavail\fR. .RE .sp .ne 2 -.mk .na \fB\fBcompressratio\fR\fR .ad .sp .6 .RS 4n -For non-snapshots, the compression ratio achieved for the \fBused\fR space of this dataset, expressed as a multiplier. The \fBused\fR property includes descendant datasets, and, for clones, does not include the space shared with the origin snapshot. For snapshots, the \fBcompressratio\fR is the same as the \fBrefcompressratio\fR property. Compression can be turned on by running: \fBzfs set compression=on \fIdataset\fR\fR. The default value is \fBoff\fR. +For non-snapshots, the compression ratio achieved for the \fBused\fR +space of this dataset, expressed as a multiplier. The \fBused\fR +property includes descendant datasets, and, for clones, does not include +the space shared with the origin snapshot. For snapshots, the +\fBcompressratio\fR is the same as the \fBrefcompressratio\fR property. +Compression can be turned on by running: \fBzfs set compression=on +\fIdataset\fR\fR. The default value is \fBoff\fR. .RE .sp .ne 2 -.mk .na \fB\fBcreation\fR\fR .ad @@ -412,64 +478,69 @@ The time this dataset was created. .sp .ne 2 -.mk .na \fB\fBdefer_destroy\fR\fR .ad .sp .6 .RS 4n -This property is \fBon\fR if the snapshot has been marked for deferred destroy by using the \fBzfs destroy\fR \fB-d\fR command. Otherwise, the property is \fBoff\fR. +This property is \fBon\fR if the snapshot has been marked for deferred destroy +by using the \fBzfs destroy\fR \fB-d\fR command. Otherwise, the property is +\fBoff\fR. .RE .sp .ne 2 -.mk .na \fB\fBmounted\fR\fR .ad .sp .6 .RS 4n -For file systems, indicates whether the file system is currently mounted. This property can be either \fByes\fR or \fBno\fR. +For file systems, indicates whether the file system is currently mounted. This +property can be either \fByes\fR or \fBno\fR. .RE .sp .ne 2 -.mk .na \fB\fBorigin\fR\fR .ad .sp .6 .RS 4n -For cloned file systems or volumes, the snapshot from which the clone was created. The origin cannot be destroyed (even with the \fB-r\fR or \fB-f\fR options) so long as a clone exists. +For cloned file systems or volumes, the snapshot from which the clone was +created. The origin cannot be destroyed (even with the \fB-r\fR or \fB-f\fR +options) so long as a clone exists. .RE .sp .ne 2 -.mk .na \fB\fBreferenced\fR\fR .ad .sp .6 .RS 4n -The amount of data that is accessible by this dataset, which may or may not be shared with other datasets in the pool. When a snapshot or clone is created, it initially references the same amount of space as the file system or snapshot it was created from, since its contents are identical. +The amount of data that is accessible by this dataset, which may or may not be +shared with other datasets in the pool. When a snapshot or clone is created, it +initially references the same amount of space as the file system or snapshot it +was created from, since its contents are identical. .sp -This property can also be referred to by its shortened column name, \fBrefer\fR. +This property can also be referred to by its shortened column name, +\fBrefer\fR. .RE .sp .ne 2 -.mk .na \fB\fBrefcompressratio\fR\fR .ad .sp .6 .RS 4n -The compression ratio achieved for the \fBreferenced\fR space of this dataset, expressed as a multiplier. See also the \fBcompressratio\fR property. +The compression ratio achieved for the \fBreferenced\fR space of this +dataset, expressed as a multiplier. See also the \fBcompressratio\fR +property. .RE .sp .ne 2 -.mk .na \fB\fBtype\fR\fR .ad @@ -480,87 +551,113 @@ The type of dataset: \fBfilesystem\fR, \ .sp .ne 2 -.mk .na \fB\fBused\fR\fR .ad .sp .6 .RS 4n -The amount of space consumed by this dataset and all its descendents. This is the value that is checked against this dataset's quota and reservation. The space used does not include this dataset's reservation, but does take into account the reservations of any descendent datasets. The amount of space that a dataset consumes from its parent, as well as the amount of space that are freed if this dataset is recursively destroyed, is the greater of its space used and its reservation. -.sp -When snapshots (see the "Snapshots" section) are created, their space is initially shared between the snapshot and the file system, and possibly with previous snapshots. As the file system changes, space that was previously shared becomes unique to the snapshot, and counted in the snapshot's space used. Additionally, deleting snapshots can increase the amount of space unique to (and used by) other snapshots. -.sp -The amount of space used, available, or referenced does not take into account pending changes. Pending changes are generally accounted for within a few seconds. Committing a change to a disk using \fBfsync\fR(3c) or \fBO_SYNC\fR does not necessarily guarantee that the space usage information is updated immediately. +The amount of space consumed by this dataset and all its descendents. This is +the value that is checked against this dataset's quota and reservation. The +space used does not include this dataset's reservation, but does take into +account the reservations of any descendent datasets. The amount of space that a +dataset consumes from its parent, as well as the amount of space that are freed +if this dataset is recursively destroyed, is the greater of its space used and +its reservation. +.sp +When snapshots (see the "Snapshots" section) are created, their space is +initially shared between the snapshot and the file system, and possibly with +previous snapshots. As the file system changes, space that was previously +shared becomes unique to the snapshot, and counted in the snapshot's space +used. Additionally, deleting snapshots can increase the amount of space unique +to (and used by) other snapshots. +.sp +The amount of space used, available, or referenced does not take into account +pending changes. Pending changes are generally accounted for within a few +seconds. Committing a change to a disk using \fBfsync\fR(3c) or \fBO_SYNC\fR +does not necessarily guarantee that the space usage information is updated +immediately. .RE .sp .ne 2 -.mk .na \fB\fBusedby*\fR\fR .ad .sp .6 .RS 4n -The \fBusedby*\fR properties decompose the \fBused\fR properties into the various reasons that space is used. Specifically, \fBused\fR = \fBusedbychildren\fR + \fBusedbydataset\fR + \fBusedbyrefreservation\fR +, \fBusedbysnapshots\fR. These properties are only available for datasets created on \fBzpool\fR "version 13" pools. +The \fBusedby*\fR properties decompose the \fBused\fR properties into the +various reasons that space is used. Specifically, \fBused\fR = +\fBusedbychildren\fR + \fBusedbydataset\fR + \fBusedbyrefreservation\fR +, +\fBusedbysnapshots\fR. These properties are only available for datasets created +on \fBzpool\fR "version 13" pools. .RE .sp .ne 2 -.mk .na \fB\fBusedbychildren\fR\fR .ad .sp .6 .RS 4n -The amount of space used by children of this dataset, which would be freed if all the dataset's children were destroyed. +The amount of space used by children of this dataset, which would be freed if +all the dataset's children were destroyed. .RE .sp .ne 2 -.mk .na \fB\fBusedbydataset\fR\fR .ad .sp .6 .RS 4n -The amount of space used by this dataset itself, which would be freed if the dataset were destroyed (after first removing any \fBrefreservation\fR and destroying any necessary snapshots or descendents). +The amount of space used by this dataset itself, which would be freed if the +dataset were destroyed (after first removing any \fBrefreservation\fR and +destroying any necessary snapshots or descendents). .RE .sp .ne 2 -.mk .na \fB\fBusedbyrefreservation\fR\fR .ad .sp .6 .RS 4n -The amount of space used by a \fBrefreservation\fR set on this dataset, which would be freed if the \fBrefreservation\fR was removed. +The amount of space used by a \fBrefreservation\fR set on this dataset, which +would be freed if the \fBrefreservation\fR was removed. .RE .sp .ne 2 -.mk .na \fB\fBusedbysnapshots\fR\fR .ad .sp .6 .RS 4n -The amount of space consumed by snapshots of this dataset. In particular, it is the amount of space that would be freed if all of this dataset's snapshots were destroyed. Note that this is not simply the sum of the snapshots' \fBused\fR properties because space can be shared by multiple snapshots. +The amount of space consumed by snapshots of this dataset. In particular, it is +the amount of space that would be freed if all of this dataset's snapshots were +destroyed. Note that this is not simply the sum of the snapshots' \fBused\fR +properties because space can be shared by multiple snapshots. .RE .sp .ne 2 -.mk .na \fB\fBuserused@\fR\fIuser\fR\fR .ad .sp .6 .RS 4n -The amount of space consumed by the specified user in this dataset. Space is charged to the owner of each file, as displayed by \fBls\fR \fB-l\fR. The amount of space charged is displayed by \fBdu\fR and \fBls\fR \fB-s\fR. See the \fBzfs userspace\fR subcommand for more information. -.sp -Unprivileged users can access only their own space usage. The root user, or a user who has been granted the \fBuserused\fR privilege with \fBzfs allow\fR, can access everyone's usage. -.sp -The \fBuserused@\fR... properties are not displayed by \fBzfs get all\fR. The user's name must be appended after the \fB@\fR symbol, using one of the following forms: +The amount of space consumed by the specified user in this dataset. Space is +charged to the owner of each file, as displayed by \fBls\fR \fB-l\fR. The +amount of space charged is displayed by \fBdu\fR and \fBls\fR \fB-s\fR. See the +\fBzfs userspace\fR subcommand for more information. +.sp +Unprivileged users can access only their own space usage. The root user, or a +user who has been granted the \fBuserused\fR privilege with \fBzfs allow\fR, +can access everyone's usage. +.sp +The \fBuserused@\fR... properties are not displayed by \fBzfs get all\fR. The +user's name must be appended after the \fB@\fR symbol, using one of the +following forms: .RS +4 .TP .ie t \(bu @@ -589,218 +686,310 @@ The \fBuserused@\fR... properties are no .sp .ne 2 -.mk .na \fB\fBuserrefs\fR\fR .ad .sp .6 .RS 4n -This property is set to the number of user holds on this snapshot. User holds are set by using the \fBzfs hold\fR command. +This property is set to the number of user holds on this snapshot. User holds +are set by using the \fBzfs hold\fR command. .RE .sp .ne 2 -.mk .na \fB\fBgroupused@\fR\fIgroup\fR\fR .ad .sp .6 .RS 4n -The amount of space consumed by the specified group in this dataset. Space is charged to the group of each file, as displayed by \fBls\fR \fB-l\fR. See the \fBuserused@\fR\fIuser\fR property for more information. -.sp -Unprivileged users can only access their own groups' space usage. The root user, or a user who has been granted the \fBgroupused\fR privilege with \fBzfs allow\fR, can access all groups' usage. +The amount of space consumed by the specified group in this dataset. Space is +charged to the group of each file, as displayed by \fBls\fR \fB-l\fR. See the +\fBuserused@\fR\fIuser\fR property for more information. +.sp +Unprivileged users can only access their own groups' space usage. The root +user, or a user who has been granted the \fBgroupused\fR privilege with \fBzfs +allow\fR, can access all groups' usage. .RE .sp .ne 2 -.mk .na \fB\fBvolblocksize\fR=\fIblocksize\fR\fR .ad .sp .6 .RS 4n -For volumes, specifies the block size of the volume. The \fBblocksize\fR cannot be changed once the volume has been written, so it should be set at volume creation time. The default \fBblocksize\fR for volumes is 8 Kbytes. Any power of 2 from 512 bytes to 128 Kbytes is valid. +For volumes, specifies the block size of the volume. The \fBblocksize\fR cannot +be changed once the volume has been written, so it should be set at volume +creation time. The default \fBblocksize\fR for volumes is 8 Kbytes. Any power +of 2 from 512 bytes to 128 Kbytes is valid. .sp -This property can also be referred to by its shortened column name, \fBvolblock\fR. +This property can also be referred to by its shortened column name, +\fBvolblock\fR. .RE .sp .LP -The following native properties can be used to change the behavior of a \fBZFS\fR dataset. +The following native properties can be used to change the behavior of a +\fBZFS\fR dataset. .sp .ne 2 -.mk .na -\fB\fBaclinherit\fR=\fBdiscard\fR | \fBnoallow\fR | \fBrestricted\fR | \fBpassthrough\fR | \fBpassthrough-x\fR\fR +\fB\fBaclinherit\fR=\fBdiscard\fR | \fBnoallow\fR | \fBrestricted\fR | +\fBpassthrough\fR | \fBpassthrough-x\fR\fR .ad .sp .6 .RS 4n -Controls how \fBACL\fR entries are inherited when files and directories are created. A file system with an \fBaclinherit\fR property of \fBdiscard\fR does not inherit any \fBACL\fR entries. A file system with an \fBaclinherit\fR property value of \fBnoallow\fR only inherits inheritable \fBACL\fR entries that specify "deny" permissions. The property value \fBrestricted\fR (the default) removes the \fBwrite_acl\fR and \fBwrite_owner\fR permissions when the \fBACL\fR entry is inherited. A file system with an \fBaclinherit\fR property value of \fBpassthrough\fR inherits all inheritable \fBACL\fR entries without any modifications made to the \fBACL\fR entries when they are inherited. A file system with an \fBaclinherit\fR property value of \fBpassthrough-x\fR has the same meaning as \fBpassthrough\fR, except that the \fBowner@\fR, \fBgroup@\fR, and \fBeveryone@\fR \fBACE\fRs inherit the execute permission only if the file creation mode also requests the execute bit. +Controls how \fBACL\fR entries are inherited when files and directories are +created. A file system with an \fBaclinherit\fR property of \fBdiscard\fR does +not inherit any \fBACL\fR entries. A file system with an \fBaclinherit\fR +property value of \fBnoallow\fR only inherits inheritable \fBACL\fR entries +that specify "deny" permissions. The property value \fBrestricted\fR (the +default) removes the \fBwrite_acl\fR and \fBwrite_owner\fR permissions when the +\fBACL\fR entry is inherited. A file system with an \fBaclinherit\fR property +value of \fBpassthrough\fR inherits all inheritable \fBACL\fR entries without +any modifications made to the \fBACL\fR entries when they are inherited. A file +system with an \fBaclinherit\fR property value of \fBpassthrough-x\fR has the +same meaning as \fBpassthrough\fR, except that the \fBowner@\fR, \fBgroup@\fR, +and \fBeveryone@\fR \fBACE\fRs inherit the execute permission only if the file +creation mode also requests the execute bit. .sp -When the property value is set to \fBpassthrough\fR, files are created with a mode determined by the inheritable \fBACE\fRs. If no inheritable \fBACE\fRs exist that affect the mode, then the mode is set in accordance to the requested mode from the application. +When the property value is set to \fBpassthrough\fR, files are created with a +mode determined by the inheritable \fBACE\fRs. If no inheritable \fBACE\fRs +exist that affect the mode, then the mode is set in accordance to the requested +mode from the application. .RE .sp .ne 2 -.mk .na \fB\fBaclmode\fR=\fBdiscard\fR | \fBgroupmask\fR | \fBpassthrough\fR\fR .ad .sp .6 .RS 4n -Controls how an \fBACL\fR is modified during \fBchmod\fR(2). A file system with an \fBaclmode\fR property of \fBdiscard\fR (the default) deletes all \fBACL\fR entries that do not represent the mode of the file. An \fBaclmode\fR property of \fBgroupmask\fR reduces permissions granted in all \fBALLOW\fR entries found in the \fBACL\fR such that they are no greater than the group permissions specified by \fBchmod\fR. A file system with an \fBaclmode\fR property of \fBpassthrough\fR indicates that no changes are made to the \fBACL\fR other than creating or updating the necessary \fBACL\fR entries to represent the new mode of the file or directory. +Controls how an \fBACL\fR is modified during \fBchmod\fR(2). A file system with +an \fBaclmode\fR property of \fBdiscard\fR (the default) deletes all \fBACL\fR +entries that do not represent the mode of the file. An \fBaclmode\fR property +of \fBgroupmask\fR reduces permissions granted in all \fBALLOW\fR entries found +in the \fBACL\fR such that they are no greater than the group permissions +specified by \fBchmod\fR. A file system with an \fBaclmode\fR property of +\fBpassthrough\fR indicates that no changes are made to the \fBACL\fR other +than creating or updating the necessary \fBACL\fR entries to +represent the new mode of the file or directory. .RE .sp .ne 2 -.mk .na \fB\fBatime\fR=\fBon\fR | \fBoff\fR\fR .ad .sp .6 .RS 4n -Controls whether the access time for files is updated when they are read. Turning this property off avoids producing write traffic when reading files and can result in significant performance gains, though it might confuse mailers and other similar utilities. The default value is \fBon\fR. +Controls whether the access time for files is updated when they are read. +Turning this property off avoids producing write traffic when reading files and +can result in significant performance gains, though it might confuse mailers +and other similar utilities. The default value is \fBon\fR. .RE .sp .ne 2 -.mk .na \fB\fBcanmount\fR=\fBon\fR | \fBoff\fR | \fBnoauto\fR\fR .ad .sp .6 .RS 4n -If this property is set to \fBoff\fR, the file system cannot be mounted, and is ignored by \fBzfs mount -a\fR. Setting this property to \fBoff\fR is similar to setting the \fBmountpoint\fR property to \fBnone\fR, except that the dataset still has a normal \fBmountpoint\fR property, which can be inherited. Setting this property to \fBoff\fR allows datasets to be used solely as a mechanism to inherit properties. One example of setting \fBcanmount=\fR\fBoff\fR is to have two datasets with the same \fBmountpoint\fR, so that the children of both datasets appear in the same directory, but might have different inherited characteristics. -.sp -When the \fBnoauto\fR option is set, a dataset can only be mounted and unmounted explicitly. The dataset is not mounted automatically when the dataset is created or imported, nor is it mounted by the \fBzfs mount -a\fR command or unmounted by the \fBzfs unmount -a\fR command. +If this property is set to \fBoff\fR, the file system cannot be mounted, and is +ignored by \fBzfs mount -a\fR. Setting this property to \fBoff\fR is similar to +setting the \fBmountpoint\fR property to \fBnone\fR, except that the dataset +still has a normal \fBmountpoint\fR property, which can be inherited. Setting +this property to \fBoff\fR allows datasets to be used solely as a mechanism to +inherit properties. One example of setting \fBcanmount=\fR\fBoff\fR is to have +two datasets with the same \fBmountpoint\fR, so that the children of both +datasets appear in the same directory, but might have different inherited +characteristics. +.sp +When the \fBnoauto\fR option is set, a dataset can only be mounted and +unmounted explicitly. The dataset is not mounted automatically when the dataset +is created or imported, nor is it mounted by the \fBzfs mount -a\fR command or +unmounted by the \fBzfs unmount -a\fR command. .sp This property is not inherited. .RE .sp .ne 2 -.mk .na -\fB\fBchecksum\fR=\fBon\fR | \fBoff\fR | \fBfletcher2,\fR| \fBfletcher4\fR | \fBsha256\fR\fR +\fB\fBchecksum\fR=\fBon\fR | \fBoff\fR | \fBfletcher2,\fR| \fBfletcher4\fR | +\fBsha256\fR\fR .ad .sp .6 .RS 4n -Controls the checksum used to verify data integrity. The default value is \fBon\fR, which automatically selects an appropriate algorithm (currently, \fBfletcher4\fR, but this may change in future releases). The value \fBoff\fR disables integrity checking on user data. Disabling checksums is \fBNOT\fR a recommended practice. +Controls the checksum used to verify data integrity. The default value is +\fBon\fR, which automatically selects an appropriate algorithm (currently, +\fBfletcher4\fR, but this may change in future releases). The value \fBoff\fR +disables integrity checking on user data. Disabling checksums is \fBNOT\fR a +recommended practice. .sp Changing this property affects only newly-written data. .RE .sp .ne 2 -.mk .na -\fB\fBcompression\fR=\fBon\fR | \fBoff\fR | \fBlzjb\fR | \fBgzip\fR | \fBgzip-\fR\fIN\fR\fR +\fB\fBcompression\fR=\fBon\fR | \fBoff\fR | \fBlzjb\fR | \fBgzip\fR | +\fBgzip-\fR\fIN\fR\fR .ad .sp .6 .RS 4n -Controls the compression algorithm used for this dataset. The \fBlzjb\fR compression algorithm is optimized for performance while providing decent data compression. Setting compression to \fBon\fR uses the \fBlzjb\fR compression algorithm. The \fBgzip\fR compression algorithm uses the same compression as the \fBgzip\fR(1) command. You can specify the \fBgzip\fR level by using the value \fBgzip-\fR\fIN\fR where \fIN\fR is an integer from 1 (fastest) to 9 (best compression ratio). Currently, \fBgzip\fR is equivalent to \fBgzip-6\fR (which is also the default for \fBgzip\fR(1)). +Controls the compression algorithm used for this dataset. The \fBlzjb\fR +compression algorithm is optimized for performance while providing decent data +compression. Setting compression to \fBon\fR uses the \fBlzjb\fR compression +algorithm. The \fBgzip\fR compression algorithm uses the same compression as +the \fBgzip\fR(1) command. You can specify the \fBgzip\fR level by using the +value \fBgzip-\fR\fIN\fR where \fIN\fR is an integer from 1 (fastest) to 9 +(best compression ratio). Currently, \fBgzip\fR is equivalent to \fBgzip-6\fR +(which is also the default for \fBgzip\fR(1)). .sp -This property can also be referred to by its shortened column name \fBcompress\fR. Changing this property affects only newly-written data. +This property can also be referred to by its shortened column name +\fBcompress\fR. Changing this property affects only newly-written data. .RE .sp .ne 2 -.mk .na \fB\fBcopies\fR=\fB1\fR | \fB2\fR | \fB3\fR\fR .ad .sp .6 .RS 4n -Controls the number of copies of data stored for this dataset. These copies are in addition to any redundancy provided by the pool, for example, mirroring or RAID-Z. The copies are stored on different disks, if possible. The space used by multiple copies is charged to the associated file and dataset, changing the \fBused\fR property and counting against quotas and reservations. -.sp -Changing this property only affects newly-written data. Therefore, set this property at file system creation time by using the \fB-o\fR \fBcopies=\fR\fIN\fR option. +Controls the number of copies of data stored for this dataset. These copies are +in addition to any redundancy provided by the pool, for example, mirroring or +RAID-Z. The copies are stored on different disks, if possible. The space used +by multiple copies is charged to the associated file and dataset, changing the +\fBused\fR property and counting against quotas and reservations. +.sp +Changing this property only affects newly-written data. Therefore, set this +property at file system creation time by using the \fB-o\fR +\fBcopies=\fR\fIN\fR option. .RE .sp .ne 2 -.mk .na \fB\fBdevices\fR=\fBon\fR | \fBoff\fR\fR .ad .sp .6 .RS 4n -Controls whether device nodes can be opened on this file system. The default value is \fBon\fR. +Controls whether device nodes can be opened on this file system. The default +value is \fBon\fR. .RE .sp .ne 2 -.mk .na \fB\fBexec\fR=\fBon\fR | \fBoff\fR\fR .ad .sp .6 .RS 4n -Controls whether processes can be executed from within this file system. The default value is \fBon\fR. +Controls whether processes can be executed from within this file system. The +default value is \fBon\fR. +.RE + +.sp +.ne 2 +.na +\fB\fBjailed\fR=\fBon\fR | \fBoff\fR\fR +.ad +.sp .6 +.RS 4n +Controls whether the dataset is managed from within a jail. See the "Jails" +section for more information. The default value is \fBoff\fR. .RE .sp .ne 2 -.mk .na \fB\fBmountpoint\fR=\fIpath\fR | \fBnone\fR | \fBlegacy\fR\fR .ad .sp .6 .RS 4n -Controls the mount point used for this file system. See the "Mount Points" section for more information on how this property is used. +Controls the mount point used for this file system. See the "Mount Points" +section for more information on how this property is used. .sp -When the \fBmountpoint\fR property is changed for a file system, the file system and any children that inherit the mount point are unmounted. If the new value is \fBlegacy\fR, then they remain unmounted. Otherwise, they are automatically remounted in the new location if the property was previously \fBlegacy\fR or \fBnone\fR, or if they were mounted before the property was changed. In addition, any shared file systems are unshared and shared in the new location. +When the \fBmountpoint\fR property is changed for a file system, the file +system and any children that inherit the mount point are unmounted. If the new +value is \fBlegacy\fR, then they remain unmounted. Otherwise, they are +automatically remounted in the new location if the property was previously +\fBlegacy\fR or \fBnone\fR, or if they were mounted before the property was +changed. In addition, any shared file systems are unshared and shared in the +new location. .RE .sp .ne 2 -.mk .na \fB\fBnbmand\fR=\fBon\fR | \fBoff\fR\fR .ad .sp .6 .RS 4n -Controls whether the file system should be mounted with \fBnbmand\fR (Non Blocking mandatory locks). This is used for \fBCIFS\fR clients. Changes to this property only take effect when the file system is umounted and remounted. See \fBmount\fR(1M) for more information on \fBnbmand\fR mounts. +Controls whether the file system should be mounted with \fBnbmand\fR (Non +Blocking mandatory locks). This is used for \fBCIFS\fR clients. Changes to this +property only take effect when the file system is umounted and remounted. See +\fBmount\fR(8) for more information on \fBnbmand\fR mounts. .RE .sp .ne 2 -.mk .na \fB\fBprimarycache\fR=\fBall\fR | \fBnone\fR | \fBmetadata\fR\fR .ad .sp .6 .RS 4n -Controls what is cached in the primary cache (ARC). If this property is set to \fBall\fR, then both user data and metadata is cached. If this property is set to \fBnone\fR, then neither user data nor metadata is cached. If this property is set to \fBmetadata\fR, then only metadata is cached. The default value is \fBall\fR. +Controls what is cached in the primary cache (ARC). If this property is set to +\fBall\fR, then both user data and metadata is cached. If this property is set +to \fBnone\fR, then neither user data nor metadata is cached. If this property +is set to \fBmetadata\fR, then only metadata is cached. The default value is +\fBall\fR. .RE .sp .ne 2 -.mk .na \fB\fBquota\fR=\fIsize\fR | \fBnone\fR\fR .ad .sp .6 .RS 4n -Limits the amount of space a dataset and its descendents can consume. This property enforces a hard limit on the amount of space used. This includes all space consumed by descendents, including file systems and snapshots. Setting a quota on a descendent of a dataset that already has a quota does not override the ancestor's quota, but rather imposes an additional limit. +Limits the amount of space a dataset and its descendents can consume. This +property enforces a hard limit on the amount of space used. This includes all +space consumed by descendents, including file systems and snapshots. Setting a +quota on a descendent of a dataset that already has a quota does not override +the ancestor's quota, but rather imposes an additional limit. .sp -Quotas cannot be set on volumes, as the \fBvolsize\fR property acts as an implicit quota. +Quotas cannot be set on volumes, as the \fBvolsize\fR property acts as an +implicit quota. .RE .sp .ne 2 -.mk .na \fB\fBuserquota@\fR\fIuser\fR=\fIsize\fR | \fBnone\fR\fR .ad .sp .6 .RS 4n -Limits the amount of space consumed by the specified user. User space consumption is identified by the \fBuserspace@\fR\fIuser\fR property. -.sp -Enforcement of user quotas may be delayed by several seconds. This delay means that a user might exceed their quota before the system notices that they are over quota and begins to refuse additional writes with the \fBEDQUOT\fR error message . See the \fBzfs userspace\fR subcommand for more information. -.sp -Unprivileged users can only access their own groups' space usage. The root user, or a user who has been granted the \fBuserquota\fR privilege with \fBzfs allow\fR, can get and set everyone's quota. +Limits the amount of space consumed by the specified user. User space +consumption is identified by the \fBuserspace@\fR\fIuser\fR property. .sp -This property is not available on volumes, on file systems before version 4, or on pools before version 15. The \fBuserquota@\fR... properties are not displayed by \fBzfs get all\fR. The user's name must be appended after the \fB@\fR symbol, using one of the following forms: +Enforcement of user quotas may be delayed by several seconds. This delay means +that a user might exceed their quota before the system notices that they are +over quota and begins to refuse additional writes with the \fBEDQUOT\fR error +message . See the \fBzfs userspace\fR subcommand for more information. +.sp +Unprivileged users can only access their own groups' space usage. The root +user, or a user who has been granted the \fBuserquota\fR privilege with \fBzfs +allow\fR, can get and set everyone's quota. +.sp +This property is not available on volumes, on file systems before version 4, or +on pools before version 15. The \fBuserquota@\fR... properties are not +displayed by \fBzfs get all\fR. The user's name must be appended after the +\fB@\fR symbol, using one of the following forms: .RS +4 .TP .ie t \(bu @@ -829,20 +1018,21 @@ This property is not available on volume .sp .ne 2 -.mk .na \fB\fBgroupquota@\fR\fIgroup\fR=\fIsize\fR | \fBnone\fR\fR .ad .sp .6 .RS 4n -Limits the amount of space consumed by the specified group. Group space consumption is identified by the \fBuserquota@\fR\fIuser\fR property. +Limits the amount of space consumed by the specified group. Group space +consumption is identified by the \fBuserquota@\fR\fIuser\fR property. .sp -Unprivileged users can access only their own groups' space usage. The root user, or a user who has been granted the \fBgroupquota\fR privilege with \fBzfs allow\fR, can get and set all groups' quotas. +Unprivileged users can access only their own groups' space usage. The root +user, or a user who has been granted the \fBgroupquota\fR privilege with \fBzfs +allow\fR, can get and set all groups' quotas. .RE .sp .ne 2 -.mk .na \fB\fBreadonly\fR=\fBon\fR | \fBoff\fR\fR .ad @@ -850,269 +1040,321 @@ Unprivileged users can access only their .RS 4n Controls whether this dataset can be modified. The default value is \fBoff\fR. .sp -This property can also be referred to by its shortened column name, \fBrdonly\fR. +This property can also be referred to by its shortened column name, +\fBrdonly\fR. .RE .sp .ne 2 -.mk .na \fB\fBrecordsize\fR=\fIsize\fR\fR .ad .sp .6 .RS 4n -Specifies a suggested block size for files in the file system. This property is designed solely for use with database workloads that access files in fixed-size records. \fBZFS\fR automatically tunes block sizes according to internal algorithms optimized for typical access patterns. -.sp -For databases that create very large files but access them in small random chunks, these algorithms may be suboptimal. Specifying a \fBrecordsize\fR greater than or equal to the record size of the database can result in significant performance gains. Use of this property for general purpose file systems is strongly discouraged, and may adversely affect performance. +Specifies a suggested block size for files in the file system. This property is +designed solely for use with database workloads that access files in fixed-size +records. \fBZFS\fR automatically tunes block sizes according to internal +algorithms optimized for typical access patterns. +.sp +For databases that create very large files but access them in small random +chunks, these algorithms may be suboptimal. Specifying a \fBrecordsize\fR +greater than or equal to the record size of the database can result in +significant performance gains. Use of this property for general purpose file +systems is strongly discouraged, and may adversely affect performance. .sp -The size specified must be a power of two greater than or equal to 512 and less than or equal to 128 Kbytes. +The size specified must be a power of two greater than or equal to 512 and less +than or equal to 128 Kbytes. .sp -Changing the file system's \fBrecordsize\fR affects only files created afterward; existing files are unaffected. +Changing the file system's \fBrecordsize\fR affects only files created +afterward; existing files are unaffected. .sp *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Nov 18 02:06:09 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 60151106568C; Fri, 18 Nov 2011 02:06:09 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4F5248FC16; Fri, 18 Nov 2011 02:06:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAI269xV043118; Fri, 18 Nov 2011 02:06:09 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAI269QH043116; Fri, 18 Nov 2011 02:06:09 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201111180206.pAI269QH043116@svn.freebsd.org> From: Martin Matuska Date: Fri, 18 Nov 2011 02:06:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227648 - head/cddl/contrib/opensolaris/cmd/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Nov 2011 02:06:09 -0000 Author: mm Date: Fri Nov 18 02:06:09 2011 New Revision: 227648 URL: http://svn.freebsd.org/changeset/base/227648 Log: Fix reference to fsync(2). Add more references to SEE ALSO section. MFC after: 1 week Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Fri Nov 18 01:30:54 2011 (r227647) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Fri Nov 18 02:06:09 2011 (r227648) @@ -573,7 +573,7 @@ to (and used by) other snapshots. .sp The amount of space used, available, or referenced does not take into account pending changes. Pending changes are generally accounted for within a few -seconds. Committing a change to a disk using \fBfsync\fR(3c) or \fBO_SYNC\fR +seconds. Committing a change to a disk using \fBfsync\fR(2) or \fBO_SYNC\fR does not necessarily guarantee that the space usage information is updated immediately. .RE @@ -3554,7 +3554,7 @@ Invalid command line options were specif .SH SEE ALSO .sp .LP -zpool(8) +chmod(2), fsync(2), exports(5), fstab(5), jail(8), mount(8), zpool(8) .sp .LP For information about using the \fBZFS\fR web-based management tool and other From owner-svn-src-all@FreeBSD.ORG Fri Nov 18 02:25:54 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D1101065672; Fri, 18 Nov 2011 02:25:54 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7303D8FC08; Fri, 18 Nov 2011 02:25:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAI2Ps8C044009; Fri, 18 Nov 2011 02:25:54 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAI2PsZF044007; Fri, 18 Nov 2011 02:25:54 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201111180225.pAI2PsZF044007@svn.freebsd.org> From: Martin Matuska Date: Fri, 18 Nov 2011 02:25:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227649 - head/cddl/contrib/opensolaris/cmd/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Nov 2011 02:25:54 -0000 Author: mm Date: Fri Nov 18 02:25:54 2011 New Revision: 227649 URL: http://svn.freebsd.org/changeset/base/227649 Log: More zfs(8) manpage fixes: - remove shareiscsi property - mark casesensitivity property as unsupported - remove reference to Solaris Administration Guide MFC after: 1 week Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Fri Nov 18 02:06:09 2011 (r227648) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Fri Nov 18 02:25:54 2011 (r227649) @@ -1151,16 +1151,6 @@ default value is \fBon\fR. .sp .ne 2 .na -\fB\fBshareiscsi\fR=\fBon\fR | \fBoff\fR\fR -.ad -.sp .6 -.RS 4n -The \fB\fBshareiscsi\fR property has currently no effect on FreeBSD. -.RE - -.sp -.ne 2 -.na \fB\fBsharesmb\fR=\fBon\fR | \fBoff\fR | \fIopts\fR\fR .ad .sp .6 @@ -1296,18 +1286,7 @@ these properties. .ad .sp .6 .RS 4n -Indicates whether the file name matching algorithm used by the file system -should be case-sensitive, case-insensitive, or allow a combination of both -styles of matching. The default value for the \fBcasesensitivity\fR property is -\fBsensitive\fR. Traditionally, UNIX and POSIX file systems have case-sensitive -file names. -.sp -The \fBmixed\fR value for the \fBcasesensitivity\fR property indicates that the -file system can support requests for both case-sensitive and case-insensitive -matching behavior. Currently, case-insensitive matching behavior on a file -system that supports mixed behavior is limited to the Solaris CIFS server -product. For more information about the \fBmixed\fR value behavior, see the -\fISolaris ZFS Administration Guide\fR. +The \fB\fBcasesensitivity\fR property is currently not supported on FreeBSD. .RE .sp @@ -2818,7 +2797,6 @@ refreservation property reservation property secondarycache property setuid property -shareiscsi property sharenfs property sharesmb property snapdir property @@ -3159,7 +3137,6 @@ pool/home/bob snapdir hid pool/home/bob aclmode discard default pool/home/bob aclinherit restricted default pool/home/bob canmount on default -pool/home/bob shareiscsi off default pool/home/bob xattr on default pool/home/bob copies 1 default pool/home/bob version 4 - @@ -3555,7 +3532,3 @@ Invalid command line options were specif .sp .LP chmod(2), fsync(2), exports(5), fstab(5), jail(8), mount(8), zpool(8) -.sp -.LP -For information about using the \fBZFS\fR web-based management tool and other -\fBZFS\fR features, see the \fISolaris ZFS Administration Guide\fR. From owner-svn-src-all@FreeBSD.ORG Fri Nov 18 03:00:24 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 4629A106566C; Fri, 18 Nov 2011 03:00:19 +0000 (UTC) Date: Fri, 18 Nov 2011 03:00:19 +0000 From: Alexey Dokuchaev To: John Baldwin Message-ID: <20111118030019.GA37436@FreeBSD.org> References: <201111151849.pAFInR3K012609@svn.freebsd.org> <201111171141.22648.jhb@freebsd.org> <1321551793.82271.55.camel@bauer.cse.buffalo.edu> <201111171416.47725.jhb@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <201111171416.47725.jhb@freebsd.org> User-Agent: Mutt/1.4.2.1i Cc: src-committers@freebsd.org, Pawel Jakub Dawidek , Ken Smith , svn-src-all@freebsd.org, David Chisnall , TAKAHASHI Yoshihiro , Nathan Whitehorn , svn-src-head@freebsd.org Subject: Re: svn commit: r227536 - in head: release share/man/man7 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Nov 2011 03:00:24 -0000 On Thu, Nov 17, 2011 at 02:16:47PM -0500, John Baldwin wrote: > On Thursday, November 17, 2011 12:43:12 pm Ken Smith wrote: > > If you're referring to the FTP directory tree layout we wind up with: > > > > .../releases/amd64/9.0-RELEASE > > .../releases/amd64/ISO-IMAGES/9.0 > > > > for an example of uname -m == uname -p. But for our two powerpc related > > architectures we get: > > > > .../releases/powerpc/9.0-RELEASE > > .../releases/powerpc/ISO-IMAGES/9.0 > > .../releases/powerpc/powerpc64/9.0-RELEASE > > .../releases/powerpc/powerpc64/ISO-IMAGES/9.0 > > > > I'm not sure I like the inconsistency. > > Given the available tradeoffs I prefer this to amd64/amd64. We could also > define the rule another way, which is if a given TARGET only has a single > TARGET_ARCH you just use TARGET, otherwise you use TARGET/TARGET_ARCH. If we seem to employ some naming transition rule based on TARGET_ARCH and TARGET, why not simply check just for pc98 as I suggested earlier, and return TARGET in this case, and TARGET_ARCH otherwise? Generalizing, perhaps this rule can be extended to the list of TARGET/TARGET_ARCH combos for which we return TARGET, and TARGET_ARCH for the rest? (This is for ISO file names; for release directory structure John's suggestion looks reasonable.) ./danfe From owner-svn-src-all@FreeBSD.ORG Fri Nov 18 03:05:21 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7EC54106566B; Fri, 18 Nov 2011 03:05:21 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6B0238FC1A; Fri, 18 Nov 2011 03:05:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAI35LY4045962; Fri, 18 Nov 2011 03:05:21 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAI35LtC045952; Fri, 18 Nov 2011 03:05:21 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201111180305.pAI35LtC045952@svn.freebsd.org> From: Kevin Lo Date: Fri, 18 Nov 2011 03:05:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227650 - in head: lib/libkiconv sys/conf sys/fs/msdosfs sys/fs/smbfs sys/kern sys/libkern sys/modules/libiconv sys/modules/libmchain sys/netsmb sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Nov 2011 03:05:21 -0000 Author: kevlo Date: Fri Nov 18 03:05:20 2011 New Revision: 227650 URL: http://svn.freebsd.org/changeset/base/227650 Log: Add unicode support to msdosfs and smbfs; original pathes from imura, bug fixes by Kuan-Chung Chiu . Tested by me in production for several days at work. Added: head/sys/libkern/iconv_ucs.c (contents, props changed) Modified: head/lib/libkiconv/xlat16_iconv.c head/sys/conf/files head/sys/fs/msdosfs/msdosfs_conv.c head/sys/fs/smbfs/smbfs_smb.c head/sys/fs/smbfs/smbfs_subr.c head/sys/kern/subr_mchain.c head/sys/libkern/iconv.c head/sys/modules/libiconv/Makefile head/sys/modules/libmchain/Makefile head/sys/netsmb/smb_conn.c head/sys/netsmb/smb_conn.h head/sys/netsmb/smb_smb.c head/sys/netsmb/smb_subr.c head/sys/sys/iconv.h head/sys/sys/mchain.h Modified: head/lib/libkiconv/xlat16_iconv.c ============================================================================== --- head/lib/libkiconv/xlat16_iconv.c Fri Nov 18 02:25:54 2011 (r227649) +++ head/lib/libkiconv/xlat16_iconv.c Fri Nov 18 03:05:20 2011 (r227650) @@ -74,6 +74,18 @@ kiconv_add_xlat16_cspair(const char *toc struct xlat16_table xt; void *data; char *p; + const char unicode[] = ENCODING_UNICODE; + + if ((flag & KICONV_WCTYPE) == 0 && + strcmp(unicode, tocode) != 0 && + strcmp(unicode, fromcode) != 0 && + kiconv_lookupconv(unicode) == 0) { + error = kiconv_add_xlat16_cspair(unicode, fromcode, flag); + if (error) + return (-1); + error = kiconv_add_xlat16_cspair(tocode, unicode, flag); + return (error); + } if (kiconv_lookupcs(tocode, fromcode) == 0) return (0); Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Nov 18 02:25:54 2011 (r227649) +++ head/sys/conf/files Fri Nov 18 03:05:20 2011 (r227650) @@ -2557,6 +2557,7 @@ libkern/fnmatch.c standard libkern/gets.c standard libkern/iconv.c optional libiconv libkern/iconv_converter_if.m optional libiconv +libkern/iconv_ucs.c optional libiconv libkern/iconv_xlat.c optional libiconv libkern/iconv_xlat16.c optional libiconv libkern/index.c standard Modified: head/sys/fs/msdosfs/msdosfs_conv.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_conv.c Fri Nov 18 02:25:54 2011 (r227649) +++ head/sys/fs/msdosfs/msdosfs_conv.c Fri Nov 18 03:05:20 2011 (r227650) @@ -61,9 +61,9 @@ extern struct iconv_functions *msdosfs_iconv; static int mbsadjpos(const char **, size_t, size_t, int, int, void *handle); -static u_int16_t dos2unixchr(const u_char **, size_t *, int, struct msdosfsmount *); +static u_char * dos2unixchr(const u_char **, size_t *, int, struct msdosfsmount *); static u_int16_t unix2doschr(const u_char **, size_t *, struct msdosfsmount *); -static u_int16_t win2unixchr(u_int16_t, struct msdosfsmount *); +static u_char * win2unixchr(u_int16_t, struct msdosfsmount *); static u_int16_t unix2winchr(const u_char **, size_t *, int, struct msdosfsmount *); /* @@ -242,7 +242,7 @@ dos2unixfn(dn, un, lower, pmp) { size_t i; int thislong = 0; - u_int16_t c; + u_char *c; /* * If first char of the filename is SLOT_E5 (0x05), then the real @@ -259,12 +259,10 @@ dos2unixfn(dn, un, lower, pmp) for (i = 8; i > 0 && *dn != ' ';) { c = dos2unixchr((const u_char **)&dn, &i, lower & LCASE_BASE, pmp); - if (c & 0xff00) { - *un++ = c >> 8; + while (*c != '\0') { + *un++ = *c++; thislong++; } - *un++ = c; - thislong++; } dn += i; @@ -278,12 +276,10 @@ dos2unixfn(dn, un, lower, pmp) for (i = 3; i > 0 && *dn != ' ';) { c = dos2unixchr((const u_char **)&dn, &i, lower & LCASE_EXT, pmp); - if (c & 0xff00) { - *un++ = c >> 8; + while (*c != '\0') { + *un++ = *c++; thislong++; } - *un++ = c; - thislong++; } } *un++ = 0; @@ -652,8 +648,9 @@ win2unixfn(nbp, wep, chksum, pmp) int chksum; struct msdosfsmount *pmp; { + u_char *c; u_int8_t *cp; - u_int8_t *np, name[WIN_CHARS * 2 + 1]; + u_int8_t *np, name[WIN_CHARS * 3 + 1]; u_int16_t code; int i; @@ -686,10 +683,9 @@ win2unixfn(nbp, wep, chksum, pmp) *np = '\0'; return -1; default: - code = win2unixchr(code, pmp); - if (code & 0xff00) - *np++ = code >> 8; - *np++ = code; + c = win2unixchr(code, pmp); + while (*c != '\0') + *np++ = *c++; break; } cp += 2; @@ -705,10 +701,9 @@ win2unixfn(nbp, wep, chksum, pmp) *np = '\0'; return -1; default: - code = win2unixchr(code, pmp); - if (code & 0xff00) - *np++ = code >> 8; - *np++ = code; + c = win2unixchr(code, pmp); + while (*c != '\0') + *np++ = *c++; break; } cp += 2; @@ -724,10 +719,9 @@ win2unixfn(nbp, wep, chksum, pmp) *np = '\0'; return -1; default: - code = win2unixchr(code, pmp); - if (code & 0xff00) - *np++ = code >> 8; - *np++ = code; + c = win2unixchr(code, pmp); + while (*c != '\0') + *np++ = *c++; break; } cp += 2; @@ -817,24 +811,22 @@ mbsadjpos(const char **instr, size_t inl /* * Convert DOS char to Local char */ -static u_int16_t +static u_char * dos2unixchr(const u_char **instr, size_t *ilen, int lower, struct msdosfsmount *pmp) { - u_char c; - char *outp, outbuf[3]; - u_int16_t wc; + u_char c, *outp, outbuf[5]; size_t len, olen; + outp = outbuf; if (pmp->pm_flags & MSDOSFSMNT_KICONV && msdosfs_iconv) { - olen = len = 2; - outp = outbuf; + olen = len = 4; if (lower & (LCASE_BASE | LCASE_EXT)) msdosfs_iconv->convchr_case(pmp->pm_d2u, (const char **)instr, - ilen, &outp, &olen, KICONV_LOWER); + ilen, (char **)&outp, &olen, KICONV_LOWER); else msdosfs_iconv->convchr(pmp->pm_d2u, (const char **)instr, - ilen, &outp, &olen); + ilen, (char **)&outp, &olen); len -= olen; /* @@ -843,21 +835,21 @@ dos2unixchr(const u_char **instr, size_t if (len == 0) { (*ilen)--; (*instr)++; - return ('?'); + *outp++ = '?'; } - - wc = 0; - while(len--) - wc |= (*(outp - len - 1) & 0xff) << (len << 3); - return (wc); + } else { + (*ilen)--; + c = *(*instr)++; + c = dos2unix[c]; + if (lower & (LCASE_BASE | LCASE_EXT)) + c = u2l[c]; + *outp++ = c; + outbuf[1] = '\0'; } - (*ilen)--; - c = *(*instr)++; - c = dos2unix[c]; - if (lower & (LCASE_BASE | LCASE_EXT)) - c = u2l[c]; - return ((u_int16_t)c); + *outp = '\0'; + outp = outbuf; + return (outp); } /* @@ -940,23 +932,21 @@ unix2doschr(const u_char **instr, size_t /* * Convert Windows char to Local char */ -static u_int16_t +static u_char * win2unixchr(u_int16_t wc, struct msdosfsmount *pmp) { - u_char *inp, *outp, inbuf[3], outbuf[3]; + u_char *inp, *outp, inbuf[3], outbuf[5]; size_t ilen, olen, len; - if (wc == 0) - return (0); - + outp = outbuf; if (pmp->pm_flags & MSDOSFSMNT_KICONV && msdosfs_iconv) { inbuf[0] = (u_char)(wc>>8); inbuf[1] = (u_char)wc; inbuf[2] = '\0'; - ilen = olen = len = 2; + ilen = 2; + olen = len = 4; inp = inbuf; - outp = outbuf; msdosfs_iconv->convchr(pmp->pm_w2u, (const char **)&inp, &ilen, (char **)&outp, &olen); len -= olen; @@ -964,21 +954,15 @@ win2unixchr(u_int16_t wc, struct msdosfs /* * return '?' if failed to convert */ - if (len == 0) { - wc = '?'; - return (wc); - } - - wc = 0; - while(len--) - wc |= (*(outp - len - 1) & 0xff) << (len << 3); - return (wc); + if (len == 0) + *outp++ = '?'; + } else { + *outp++ = (wc & 0xff00) ? '?' : (u_char)(wc & 0xff); } - if (wc & 0xff00) - wc = '?'; - - return (wc); + *outp = '\0'; + outp = outbuf; + return (outp); } /* Modified: head/sys/fs/smbfs/smbfs_smb.c ============================================================================== --- head/sys/fs/smbfs/smbfs_smb.c Fri Nov 18 02:25:54 2011 (r227649) +++ head/sys/fs/smbfs/smbfs_smb.c Fri Nov 18 03:05:20 2011 (r227650) @@ -34,6 +34,7 @@ #include #include #include +#include #ifdef USE_MD5_HASH #include @@ -393,6 +394,10 @@ smbfs_smb_setpattr(struct smbnode *np, u if (error) break; mb_put_uint8(mbp, SMB_DT_ASCII); + if (SMB_UNICODE_STRINGS(SSTOVC(ssp))) { + mb_put_padbyte(mbp); + mb_put_uint8(mbp, 0); /* 1st byte of NULL Unicode char */ + } mb_put_uint8(mbp, 0); smb_rq_bend(rqp); error = smb_rq_simple(rqp); @@ -909,6 +914,10 @@ smbfs_smb_search(struct smbfs_fctx *ctx) mb_put_uint16le(mbp, 0); /* context length */ ctx->f_flags &= ~SMBFS_RDD_FINDFIRST; } else { + if (SMB_UNICODE_STRINGS(vcp)) { + mb_put_padbyte(mbp); + mb_put_uint8(mbp, 0); + } mb_put_uint8(mbp, 0); /* file name length */ mb_put_uint8(mbp, SMB_DT_VARIABLE); mb_put_uint16le(mbp, SMB_SKEYLEN); @@ -1069,7 +1078,7 @@ smbfs_smb_trans2find2(struct smbfs_fctx mb_put_uint32le(mbp, 0); /* resume key */ mb_put_uint16le(mbp, flags); if (ctx->f_rname) - mb_put_mem(mbp, ctx->f_rname, strlen(ctx->f_rname) + 1, MB_MSYSTEM); + mb_put_mem(mbp, ctx->f_rname, ctx->f_rnamelen + 1, MB_MSYSTEM); else mb_put_uint8(mbp, 0); /* resume file name */ #if 0 @@ -1152,7 +1161,10 @@ static int smbfs_findopenLM2(struct smbfs_fctx *ctx, struct smbnode *dnp, const char *wildcard, int wclen, int attr, struct smb_cred *scred) { - ctx->f_name = malloc(SMB_MAXFNAMELEN, M_SMBFSDATA, M_WAITOK); + if (SMB_UNICODE_STRINGS(SSTOVC(ctx->f_ssp))) { + ctx->f_name = malloc(SMB_MAXFNAMELEN * 2, M_SMBFSDATA, M_WAITOK); + } else + ctx->f_name = malloc(SMB_MAXFNAMELEN, M_SMBFSDATA, M_WAITOK); if (ctx->f_name == NULL) return ENOMEM; ctx->f_infolevel = SMB_DIALECT(SSTOVC(ctx->f_ssp)) < SMB_DIALECT_NTLM0_12 ? @@ -1231,7 +1243,10 @@ smbfs_findnextLM2(struct smbfs_fctx *ctx SMBERROR("unexpected info level %d\n", ctx->f_infolevel); return EINVAL; } - nmlen = min(size, SMB_MAXFNAMELEN); + if (SMB_UNICODE_STRINGS(SSTOVC(ctx->f_ssp))) { + nmlen = min(size, SMB_MAXFNAMELEN * 2); + } else + nmlen = min(size, SMB_MAXFNAMELEN); cp = ctx->f_name; error = md_get_mem(mbp, cp, nmlen, MB_MSYSTEM); if (error) @@ -1245,8 +1260,12 @@ smbfs_findnextLM2(struct smbfs_fctx *ctx return EBADRPC; } } - if (nmlen && cp[nmlen - 1] == 0) - nmlen--; + if (SMB_UNICODE_STRINGS(SSTOVC(ctx->f_ssp))) { + if (nmlen > 1 && cp[nmlen - 1] == 0 && cp[nmlen - 2] == 0) + nmlen -= 2; + } else + if (nmlen && cp[nmlen - 1] == 0) + nmlen--; if (nmlen == 0) return EBADRPC; @@ -1330,10 +1349,17 @@ smbfs_findnext(struct smbfs_fctx *ctx, i error = smbfs_findnextLM2(ctx, limit); if (error) return error; - if ((ctx->f_nmlen == 1 && ctx->f_name[0] == '.') || - (ctx->f_nmlen == 2 && ctx->f_name[0] == '.' && - ctx->f_name[1] == '.')) - continue; + if (SMB_UNICODE_STRINGS(SSTOVC(ctx->f_ssp))) { + if ((ctx->f_nmlen == 2 && + *(u_int16_t *)ctx->f_name == htole16(0x002e)) || + (ctx->f_nmlen == 4 && + *(u_int32_t *)ctx->f_name == htole32(0x002e002e))) + continue; + } else + if ((ctx->f_nmlen == 1 && ctx->f_name[0] == '.') || + (ctx->f_nmlen == 2 && ctx->f_name[0] == '.' && + ctx->f_name[1] == '.')) + continue; break; } smbfs_fname_tolocal(SSTOVC(ctx->f_ssp), ctx->f_name, &ctx->f_nmlen, Modified: head/sys/fs/smbfs/smbfs_subr.c ============================================================================== --- head/sys/fs/smbfs/smbfs_subr.c Fri Nov 18 02:25:54 2011 (r227649) +++ head/sys/fs/smbfs/smbfs_subr.c Fri Nov 18 03:05:20 2011 (r227650) @@ -130,7 +130,10 @@ smb_fphelp(struct mbchain *mbp, struct s return smb_put_dmem(mbp, vcp, "\\", 2, caseopt);*/ while (i--) { np = *--npp; - error = mb_put_uint8(mbp, '\\'); + if (SMB_UNICODE_STRINGS(vcp)) + error = mb_put_uint16le(mbp, '\\'); + else + error = mb_put_uint8(mbp, '\\'); if (error) break; error = smb_put_dmem(mbp, vcp, np->n_name, np->n_nmlen, caseopt); @@ -148,6 +151,11 @@ smbfs_fullpath(struct mbchain *mbp, stru int caseopt = SMB_CS_NONE; int error; + if (SMB_UNICODE_STRINGS(vcp)) { + error = mb_put_padbyte(mbp); + if (error) + return error; + } if (SMB_DIALECT(vcp) < SMB_DIALECT_LANMAN1_0) caseopt |= SMB_CS_UPPER; if (dnp != NULL) { @@ -156,7 +164,10 @@ smbfs_fullpath(struct mbchain *mbp, stru return error; } if (name) { - error = mb_put_uint8(mbp, '\\'); + if (SMB_UNICODE_STRINGS(vcp)) + error = mb_put_uint16le(mbp, '\\'); + else + error = mb_put_uint8(mbp, '\\'); if (error) return error; error = smb_put_dmem(mbp, vcp, name, nmlen, caseopt); @@ -164,6 +175,8 @@ smbfs_fullpath(struct mbchain *mbp, stru return error; } error = mb_put_uint8(mbp, 0); + if (SMB_UNICODE_STRINGS(vcp) && error == 0) + error = mb_put_uint8(mbp, 0); return error; } @@ -191,6 +204,17 @@ smbfs_fname_tolocal(struct smb_vc *vcp, error = iconv_conv_case (vcp->vc_tolocal, (const char **)&ibuf, &ilen, &obuf, &olen, copt); + if (error && SMB_UNICODE_STRINGS(vcp)) { + /* + * If using unicode, leaving a file name as it was when + * convert fails will cause a problem because the file name + * will contain NULL. + * Here, put '?' and give converted file name. + */ + *obuf = '?'; + olen--; + error = 0; + } if (!error) { *nmlen = sizeof(outbuf) - olen; memcpy(name, outbuf, *nmlen); Modified: head/sys/kern/subr_mchain.c ============================================================================== --- head/sys/kern/subr_mchain.c Fri Nov 18 02:25:54 2011 (r227649) +++ head/sys/kern/subr_mchain.c Fri Nov 18 03:05:20 2011 (r227650) @@ -128,6 +128,21 @@ mb_reserve(struct mbchain *mbp, int size } int +mb_put_padbyte(struct mbchain *mbp) +{ + caddr_t dst; + char x = 0; + + dst = mtod(mbp->mb_cur, caddr_t) + mbp->mb_cur->m_len; + + /* only add padding if address is odd */ + if ((unsigned long)dst & 1) + return mb_put_mem(mbp, (caddr_t)&x, 1, MB_MSYSTEM); + else + return 0; +} + +int mb_put_uint8(struct mbchain *mbp, uint8_t x) { return mb_put_mem(mbp, (caddr_t)&x, sizeof(x), MB_MSYSTEM); Modified: head/sys/libkern/iconv.c ============================================================================== --- head/sys/libkern/iconv.c Fri Nov 18 02:25:54 2011 (r227649) +++ head/sys/libkern/iconv.c Fri Nov 18 03:05:20 2011 (r227650) @@ -377,6 +377,18 @@ iconv_sysctl_cslist(SYSCTL_HANDLER_ARGS) SYSCTL_PROC(_kern_iconv, OID_AUTO, cslist, CTLFLAG_RD | CTLTYPE_OPAQUE, NULL, 0, iconv_sysctl_cslist, "S,xlat", "registered charset pairs"); +int +iconv_add(const char *converter, const char *to, const char *from) +{ + struct iconv_converter_class *dcp; + struct iconv_cspair *csp; + + if (iconv_lookupconv(converter, &dcp) != 0) + return EINVAL; + + return iconv_register_cspair(to, from, dcp, NULL, &csp); +} + /* * Add new charset pair */ Added: head/sys/libkern/iconv_ucs.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/libkern/iconv_ucs.c Fri Nov 18 03:05:20 2011 (r227650) @@ -0,0 +1,540 @@ +/*- + * Copyright (c) 2003, 2005 Ryuichiro Imura + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +#include "iconv_converter_if.h" + +/* + * "UCS" converter + */ + +#define KICONV_UCS_COMBINE 0x1 +#define KICONV_UCS_FROM_UTF8 0x2 +#define KICONV_UCS_TO_UTF8 0x4 +#define KICONV_UCS_FROM_LE 0x8 +#define KICONV_UCS_TO_LE 0x10 +#define KICONV_UCS_FROM_UTF16 0x20 +#define KICONV_UCS_TO_UTF16 0x40 +#define KICONV_UCS_UCS4 0x80 + +#define ENCODING_UTF16 "UTF-16BE" +#define ENCODING_UTF8 "UTF-8" + +static struct { + const char *name; + int from_flag, to_flag; +} unicode_family[] = { + { "UTF-8", KICONV_UCS_FROM_UTF8, KICONV_UCS_TO_UTF8 }, + { "UCS-2LE", KICONV_UCS_FROM_LE, KICONV_UCS_TO_LE }, + { "UTF-16BE", KICONV_UCS_FROM_UTF16, KICONV_UCS_TO_UTF16 }, + { "UTF-16LE", KICONV_UCS_FROM_UTF16|KICONV_UCS_FROM_LE, + KICONV_UCS_TO_UTF16|KICONV_UCS_TO_LE }, + { NULL, 0, 0 } +}; + +static uint32_t utf8_to_ucs4(const char *src, size_t *utf8width, size_t srclen); +static u_char *ucs4_to_utf8(uint32_t ucs4, char * dst, size_t *utf8width, size_t dstlen); +static uint32_t encode_surrogate(uint32_t code); +static uint32_t decode_surrogate(const u_char *ucs); + +#ifdef MODULE_DEPEND +MODULE_DEPEND(iconv_ucs, libiconv, 2, 2, 2); +#endif + +/* + * UCS converter instance + */ +struct iconv_ucs { + KOBJ_FIELDS; + int convtype; + struct iconv_cspair * d_csp; + struct iconv_cspair * d_cspf; + void * f_ctp; + void * t_ctp; + void * ctype; +}; + +static int +iconv_ucs_open(struct iconv_converter_class *dcp, + struct iconv_cspair *csp, struct iconv_cspair *cspf, void **dpp) +{ + struct iconv_ucs *dp; + int i; + const char *from, *to; + + dp = (struct iconv_ucs *)kobj_create((struct kobj_class*)dcp, M_ICONV, M_WAITOK); + to = csp->cp_to; + from = cspf ? cspf->cp_from : csp->cp_from; + + dp->convtype = 0; + + if (cspf) + dp->convtype |= KICONV_UCS_COMBINE; + for (i = 0; unicode_family[i].name; i++) { + if (strcmp(from, unicode_family[i].name) == 0) + dp->convtype |= unicode_family[i].from_flag; + if (strcmp(to, unicode_family[i].name) == 0) + dp->convtype |= unicode_family[i].to_flag; + } + if (strcmp(ENCODING_UNICODE, ENCODING_UTF16) == 0) + dp->convtype |= KICONV_UCS_UCS4; + else + dp->convtype &= ~KICONV_UCS_UCS4; + + dp->f_ctp = dp->t_ctp = NULL; + if (dp->convtype & KICONV_UCS_COMBINE) { + if ((dp->convtype & KICONV_UCS_FROM_UTF8) == 0 && + (dp->convtype & KICONV_UCS_FROM_LE) == 0) { + iconv_open(ENCODING_UNICODE, from, &dp->f_ctp); + } + if ((dp->convtype & KICONV_UCS_TO_UTF8) == 0 && + (dp->convtype & KICONV_UCS_TO_LE) == 0) { + iconv_open(to, ENCODING_UNICODE, &dp->t_ctp); + } + } + + dp->ctype = NULL; + if (dp->convtype & (KICONV_UCS_FROM_UTF8 | KICONV_UCS_TO_UTF8)) + iconv_open(KICONV_WCTYPE_NAME, ENCODING_UTF8, &dp->ctype); + + dp->d_csp = csp; + if (dp->convtype & (KICONV_UCS_FROM_UTF8 | KICONV_UCS_FROM_LE)) { + if (cspf) { + dp->d_cspf = cspf; + cspf->cp_refcount++; + } else + csp->cp_refcount++; + } + if (dp->convtype & (KICONV_UCS_TO_UTF8 | KICONV_UCS_TO_LE)) + csp->cp_refcount++; + *dpp = (void*)dp; + return 0; +} + +static int +iconv_ucs_close(void *data) +{ + struct iconv_ucs *dp = data; + + if (dp->f_ctp) + iconv_close(dp->f_ctp); + if (dp->t_ctp) + iconv_close(dp->t_ctp); + if (dp->ctype) + iconv_close(dp->ctype); + if (dp->d_cspf) + dp->d_cspf->cp_refcount--; + else if (dp->convtype & (KICONV_UCS_FROM_UTF8 | KICONV_UCS_FROM_LE)) + dp->d_csp->cp_refcount--; + if (dp->convtype & (KICONV_UCS_TO_UTF8 | KICONV_UCS_TO_LE)) + dp->d_csp->cp_refcount--; + kobj_delete((struct kobj*)data, M_ICONV); + return 0; +} + +static int +iconv_ucs_conv(void *d2p, const char **inbuf, + size_t *inbytesleft, char **outbuf, size_t *outbytesleft, + int convchar, int casetype) +{ + struct iconv_ucs *dp = (struct iconv_ucs*)d2p; + int ret = 0, i; + size_t in, on, ir, or, inlen, outlen, ucslen; + const char *src, *p; + char *dst; + u_char ucs[4], *q; + uint32_t code; + + if (inbuf == NULL || *inbuf == NULL || outbuf == NULL || *outbuf == NULL) + return 0; + ir = in = *inbytesleft; + or = on = *outbytesleft; + src = *inbuf; + dst = *outbuf; + + while (ir > 0 && or > 0) { + + /* + * The first half of conversion. + * (convert any code into ENCODING_UNICODE) + */ + code = 0; + p = src; + if (dp->convtype & KICONV_UCS_FROM_UTF8) { + /* convert UTF-8 to ENCODING_UNICODE */ + inlen = 0; + code = utf8_to_ucs4(p, &inlen, ir); + if (code == 0) { + ret = -1; + break; + } + + if (casetype == KICONV_FROM_LOWER && dp->ctype) { + code = towlower(code, dp->ctype); + } else if (casetype == KICONV_FROM_UPPER && dp->ctype) { + code = towupper(code, dp->ctype); + } + + if ((code >= 0xd800 && code < 0xe000) || code >= 0x110000 ) { + /* reserved for utf-16 surrogate pair */ + /* invalid unicode */ + ret = -1; + break; + } + + if (inlen == 4) { + if (dp->convtype & KICONV_UCS_UCS4) { + ucslen = 4; + code = encode_surrogate(code); + } else { + /* can't handle with ucs-2 */ + ret = -1; + break; + } + } else { + ucslen = 2; + } + + /* save UCS-4 into ucs[] */ + for (q = ucs, i = ucslen - 1 ; i >= 0 ; i--) + *q++ = (code >> (i << 3)) & 0xff; + + } else if (dp->convtype & KICONV_UCS_COMBINE && dp->f_ctp) { + /* convert local code to ENCODING_UNICODE */ + ucslen = 4; + inlen = ir; + q = ucs; + ret = iconv_convchr_case(dp->f_ctp, &p, &inlen, (char **)&q, + &ucslen, casetype & (KICONV_FROM_LOWER | KICONV_FROM_UPPER)); + if (ret) + break; + inlen = ir - inlen; + ucslen = 4 - ucslen; + + } else { + /* src code is a proper subset of ENCODING_UNICODE */ + q = ucs; + if (dp->convtype & KICONV_UCS_FROM_LE) { + *q = *(p + 1); + *(q + 1) = *p; + p += 2; + } else { + *q = *p++; + *(q + 1) = *p++; + } + if ((*q & 0xfc) == 0xd8) { + if (dp->convtype & KICONV_UCS_UCS4 && + dp->convtype & KICONV_UCS_FROM_UTF16) { + inlen = ucslen = 4; + } else { + /* invalid unicode */ + ret = -1; + break; + } + } else { + inlen = ucslen = 2; + } + if (ir < inlen) { + ret = -1; + break; + } + if (ucslen == 4) { + q += 2; + if (dp->convtype & KICONV_UCS_FROM_LE) { + *q = *(p + 1); + *(q + 1) = *p; + } else { + *q = *p++; + *(q + 1) = *p; + } + if ((*q & 0xfc) != 0xdc) { + /* invalid unicode */ + ret = -1; + break; + } + } + } + + /* + * The second half of conversion. + * (convert ENCODING_UNICODE into any code) + */ + p = ucs; + if (dp->convtype & KICONV_UCS_TO_UTF8) { + q = (u_char *)dst; + if (ucslen == 4 && dp->convtype & KICONV_UCS_UCS4) { + /* decode surrogate pair */ + code = decode_surrogate(p); + } else { + code = (ucs[0] << 8) | ucs[1]; + } + + if (casetype == KICONV_LOWER && dp->ctype) { + code = towlower(code, dp->ctype); + } else if (casetype == KICONV_UPPER && dp->ctype) { + code = towupper(code, dp->ctype); + } + + outlen = 0; + if (ucs4_to_utf8(code, q, &outlen, or) == NULL) { + ret = -1; + break; + } + + src += inlen; + ir -= inlen; + dst += outlen; + or -= outlen; + + } else if (dp->convtype & KICONV_UCS_COMBINE && dp->t_ctp) { + ret = iconv_convchr_case(dp->t_ctp, &p, &ucslen, &dst, + &or, casetype & (KICONV_LOWER | KICONV_UPPER)); + if (ret) + break; + + src += inlen; + ir -= inlen; + + } else { + /* dst code is a proper subset of ENCODING_UNICODE */ + if (or < ucslen) { + ret = -1; + break; + } + src += inlen; + ir -= inlen; + or -= ucslen; + if (dp->convtype & KICONV_UCS_TO_LE) { + *dst++ = *(p + 1); + *dst++ = *p; + p += 2; + } else { + *dst++ = *p++; + *dst++ = *p++; + } + if (ucslen == 4) { + if ((dp->convtype & KICONV_UCS_UCS4) == 0 || + (dp->convtype & KICONV_UCS_TO_UTF16) == 0) { + ret = -1; + break; + } + if (dp->convtype & KICONV_UCS_TO_LE) { + *dst++ = *(p + 1); + *dst++ = *p; + } else { + *dst++ = *p++; + *dst++ = *p; + } + } + } + + if (convchar == 1) + break; + } + + *inbuf += in - ir; + *outbuf += on - or; + *inbytesleft -= in - ir; + *outbytesleft -= on - or; + return (ret); +} + +static int +iconv_ucs_init(struct iconv_converter_class *dcp) +{ + int error; + + error = iconv_add(ENCODING_UNICODE, ENCODING_UNICODE, ENCODING_UTF8); + if (error) + return (error); + error = iconv_add(ENCODING_UNICODE, ENCODING_UTF8, ENCODING_UNICODE); + if (error) + return (error); + return (0); +} + +static int +iconv_ucs_done(struct iconv_converter_class *dcp) +{ + return (0); +} + +static const char * +iconv_ucs_name(struct iconv_converter_class *dcp) +{ + return (ENCODING_UNICODE); +} + +static kobj_method_t iconv_ucs_methods[] = { + KOBJMETHOD(iconv_converter_open, iconv_ucs_open), + KOBJMETHOD(iconv_converter_close, iconv_ucs_close), + KOBJMETHOD(iconv_converter_conv, iconv_ucs_conv), + KOBJMETHOD(iconv_converter_init, iconv_ucs_init), + KOBJMETHOD(iconv_converter_done, iconv_ucs_done), + KOBJMETHOD(iconv_converter_name, iconv_ucs_name), + {0, 0} +}; + +KICONV_CONVERTER(ucs, sizeof(struct iconv_ucs)); + +static uint32_t +utf8_to_ucs4(const char *src, size_t *utf8width, size_t srclen) +{ + size_t i, w = 0; + uint32_t ucs4 = 0; + + /* + * get leading 1 byte from utf-8 + */ + if ((*src & 0x80) == 0) { + /* + * leading 1 bit is "0" + * utf-8: 0xxxxxxx + * ucs-4: 00000000 00000000 00000000 0xxxxxxx + */ + w = 1; + /* get trailing 7 bits */ + ucs4 = *src & 0x7f; + } else if ((*src & 0xe0) == 0xc0) { + /* + * leading 3 bits are "110" + * utf-8: 110xxxxx 10yyyyyy + * ucs-4: 00000000 00000000 00000xxx xxyyyyyy + */ + w = 2; + /* get trailing 5 bits */ + ucs4 = *src & 0x1f; + } else if ((*src & 0xf0) == 0xe0) { + /* + * leading 4 bits are "1110" + * utf-8: 1110xxxx 10yyyyyy 10zzzzzz + * ucs-4: 00000000 00000000 xxxxyyyy yyzzzzzz + */ + w = 3; + /* get trailing 4 bits */ + ucs4 = *src & 0x0f; + } else if ((*src & 0xf8) == 0xf0) { + /* + * leading 5 bits are "11110" + * utf-8: 11110www 10xxxxxx 10yyyyyy 10zzzzzz + * ucs-4: 00000000 000wwwxx xxxxyyyy yyzzzzzz + */ + w = 4; + /* get trailing 3 bits */ + ucs4 = *src & 0x07; + } else { + /* out of utf-16 range or having illegal bits */ + return (0); + } + if (w == 0) + return (0); + + if (srclen < w) + return (0); + + /* + * get left parts from utf-8 + */ + for (i = 1 ; i < w ; i++) { + if ((*(src + i) & 0xc0) != 0x80) { + /* invalid: leading 2 bits are not "10" */ + return (0); + } + /* concatenate trailing 6 bits into ucs4 */ + ucs4 <<= 6; + ucs4 |= *(src + i) & 0x3f; + } + + *utf8width = w; + return (ucs4); +} + +static u_char * +ucs4_to_utf8(uint32_t ucs4, char *dst, size_t *utf8width, size_t dstlen) +{ + u_char lead, *p; + size_t i, w; + + /* + * determine utf-8 width and leading bits + */ + if (ucs4 < 0x80) { + w = 1; + lead = 0; /* "0" */ + } else if (ucs4 < 0x800) { + w = 2; + lead = 0xc0; /* "11" */ + } else if (ucs4 < 0x10000) { + w = 3; + lead = 0xe0; /* "111" */ + } else if (ucs4 < 0x200000) { + w = 4; + lead = 0xf0; /* "1111" */ + } else { + return (NULL); + } + + if (dstlen < w) + return (NULL); + + /* + * construct utf-8 + */ + p = dst; + for (i = w - 1 ; i >= 1 ; i--) { + /* get trailing 6 bits and put it with leading bit as "1" */ + *(p + i) = (ucs4 & 0x3f) | 0x80; + ucs4 >>= 6; + } + *p = ucs4 | lead; + + *utf8width = w; + + return (p); +} *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Nov 18 03:19:21 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 378491065670; Fri, 18 Nov 2011 03:19:21 +0000 (UTC) Date: Fri, 18 Nov 2011 03:19:21 +0000 From: Alexey Dokuchaev To: Kevin Lo Message-ID: <20111118031921.GA43425@FreeBSD.org> References: <201111180305.pAI35LtC045952@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <201111180305.pAI35LtC045952@svn.freebsd.org> User-Agent: Mutt/1.4.2.1i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r227650 - in head: lib/libkiconv sys/conf sys/fs/msdosfs sys/fs/smbfs sys/kern sys/libkern sys/modules/libiconv sys/modules/libmchain sys/netsmb sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Nov 2011 03:19:21 -0000 On Fri, Nov 18, 2011 at 03:05:21AM +0000, Kevin Lo wrote: > Author: kevlo > Date: Fri Nov 18 03:05:20 2011 > New Revision: 227650 > URL: http://svn.freebsd.org/changeset/base/227650 > > Log: > Add unicode support to msdosfs and smbfs; original pathes from imura, > bug fixes by Kuan-Chung Chiu . Wow, long anticipated! Any MFCs planned? I've also posted a message[1] on unicode support for msdosfs/ntfs on -fs@ back in October, perhaps you could take a look on these patches and, ultimately, fix NTFS too? :-) Thanks! ./danfe [1] http://docs.freebsd.org/cgi/mid.cgi?20111013181602.GA35354 From owner-svn-src-all@FreeBSD.ORG Fri Nov 18 04:08:46 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B55FD106566C; Fri, 18 Nov 2011 04:08:46 +0000 (UTC) (envelope-from kensmith@buffalo.edu) Received: from localmailC.acsu.buffalo.edu (localmailc.acsu.buffalo.edu [128.205.5.204]) by mx1.freebsd.org (Postfix) with ESMTP id 709518FC0C; Fri, 18 Nov 2011 04:08:46 +0000 (UTC) Received: from localmailC.acsu.buffalo.edu (localhost [127.0.0.1]) by localhost (Postfix) with SMTP id CA0FB380C2; Thu, 17 Nov 2011 23:08:44 -0500 (EST) Received: from localmailC.acsu.buffalo.edu (localhost [127.0.0.1]) by localmailC.acsu.buffalo.edu (Postfix) with ESMTP id E4FDE38189; Thu, 17 Nov 2011 23:08:43 -0500 (EST) Received: from smtp3.acsu.buffalo.edu (smtp3.acsu.buffalo.edu [128.205.5.226]) by localmailC.acsu.buffalo.edu (Prefixe) with ESMTP id D7E70380C2; Thu, 17 Nov 2011 23:08:43 -0500 (EST) Received: from ken-smiths-macbook-pro.local (cpe-72-231-248-9.buffalo.res.rr.com [72.231.248.9]) (Authenticated sender: kensmith@buffalo.edu) by smtp3.acsu.buffalo.edu (Postfix) with ESMTPSA id 9379949DC8; Thu, 17 Nov 2011 23:08:42 -0500 (EST) Message-ID: <4EC5DA48.6060002@buffalo.edu> Date: Thu, 17 Nov 2011 23:08:40 -0500 From: Ken Smith User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 To: Alexey Dokuchaev References: <201111151849.pAFInR3K012609@svn.freebsd.org> <201111171141.22648.jhb@freebsd.org> <1321551793.82271.55.camel@bauer.cse.buffalo.edu> <201111171416.47725.jhb@freebsd.org> <20111118030019.GA37436@FreeBSD.org> In-Reply-To: <20111118030019.GA37436@FreeBSD.org> X-Enigmail-Version: 1.3.3 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit X-PM-EL-Spam-Prob: XX: 28% Cc: src-committers@freebsd.org, Pawel Jakub Dawidek , John Baldwin , svn-src-all@freebsd.org, David Chisnall , TAKAHASHI Yoshihiro , Nathan Whitehorn , svn-src-head@freebsd.org Subject: Re: svn commit: r227536 - in head: release share/man/man7 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Nov 2011 04:08:46 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 11/17/11 10:00 PM, Alexey Dokuchaev wrote: > On Thu, Nov 17, 2011 at 02:16:47PM -0500, John Baldwin wrote: >> On Thursday, November 17, 2011 12:43:12 pm Ken Smith wrote: >>> If you're referring to the FTP directory tree layout we wind up >>> with: >>> >>> .../releases/amd64/9.0-RELEASE >>> .../releases/amd64/ISO-IMAGES/9.0 >>> >>> for an example of uname -m == uname -p. But for our two >>> powerpc related architectures we get: >>> >>> .../releases/powerpc/9.0-RELEASE >>> .../releases/powerpc/ISO-IMAGES/9.0 >>> .../releases/powerpc/powerpc64/9.0-RELEASE >>> .../releases/powerpc/powerpc64/ISO-IMAGES/9.0 >>> >>> I'm not sure I like the inconsistency. >> >> Given the available tradeoffs I prefer this to amd64/amd64. We >> could also define the rule another way, which is if a given >> TARGET only has a single TARGET_ARCH you just use TARGET, >> otherwise you use TARGET/TARGET_ARCH. > > If we seem to employ some naming transition rule based on > TARGET_ARCH and TARGET, why not simply check just for pc98 as I > suggested earlier, and return TARGET in this case, and TARGET_ARCH > otherwise? > > Generalizing, perhaps this rule can be extended to the list of > TARGET/TARGET_ARCH combos for which we return TARGET, and > TARGET_ARCH for the rest? > > (This is for ISO file names; for release directory structure > John's suggestion looks reasonable.) > > ./danfe > Can you suggest a patch to src/usr.sbin/bsdinstall/scripts/mirrorselect that implements it then? I can picture a patch that just checks to see if uname -p == uname -m but I'm having trouble picturing a patch that implements anything more complicated than that in a way that's not a hack of checks for special cases. - -- Ken Smith - - From there to here, from here to | kensmith@buffalo.edu there, funny things are everywhere. | - Theodor Geisel | -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk7F2kgACgkQ/G14VSmup/YLVACgmB8gCrOjUREzjRJh+34UlU9i Q6wAoJGX0wsCjFpf/PYGGUvq04TYqBGL =s8IE -----END PGP SIGNATURE----- From owner-svn-src-all@FreeBSD.ORG Fri Nov 18 05:06:30 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DEE7A106566C; Fri, 18 Nov 2011 05:06:30 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CCD4D8FC0A; Fri, 18 Nov 2011 05:06:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAI56UIX051426; Fri, 18 Nov 2011 05:06:30 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAI56UYD051422; Fri, 18 Nov 2011 05:06:30 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111180506.pAI56UYD051422@svn.freebsd.org> From: Adrian Chadd Date: Fri, 18 Nov 2011 05:06:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227651 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Nov 2011 05:06:31 -0000 Author: adrian Date: Fri Nov 18 05:06:30 2011 New Revision: 227651 URL: http://svn.freebsd.org/changeset/base/227651 Log: Flesh out some slightly dirty reset/channel change serialisation code for the ath(4) driver. Currently, there's nothing stopping reset, channel change and general TX/RX from overlapping with each other. This wasn't a big deal with pre-11n traffic as it just results in some dropped frames. It's possible this may have also caused some inconsistencies and badly-setup hardware. Since locks can't be held across all of this (the Linux solution) due to LORs with the network stack locks, some state counter variables are used to track what parts of the code the driver is currently in. When the hardware is being reset, it disables the taskqueue and waits for pending interrupts, tx, rx and tx completion before it begins the reset or channel change. TX and RX both abort if called during an active reset or channel change. Finally, the reset path now doesn't flush frames if ATH_RESET_NOLOSS is set. Instead, completed TX and RX frames are passed back up to net80211 before the reset occurs. This is not without problems: * Raw frame xmit are just dropped, rather than placed on a queue. The net80211 stack should be the one which queues these frames rather than the driver. * It's all very messy. It'd be better if these hardware operations were serialised on some kind of work queue, rather than hoping they can be run in parallel. * The taskqueue block/unblock may occur in parallel with the newstate() function - which shuts down the taskqueue and restarts it once the new state is known. It's likely these operations should be refcounted so the taskqueue is restored once no other areas in the code wish to suspend operations. * .. interrupt disable/enable should likely be refcounted as well. With this work, the driver does not drop frames during stuck beacon or fatal errors and thus 11n traffic continues to run correctly. Default and full resets however do still drop frames and it's possible this may occur, causing traffic loss and session stalls. Sponsored by: Hobnob, Inc. Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_tx.c head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Fri Nov 18 03:05:20 2011 (r227650) +++ head/sys/dev/ath/if_ath.c Fri Nov 18 05:06:30 2011 (r227651) @@ -1359,16 +1359,36 @@ ath_intr(void *arg) HAL_INT status = 0; uint32_t txqs; + /* + * If we're inside a reset path, just print a warning and + * clear the ISR. The reset routine will finish it for us. + */ + ATH_PCU_LOCK(sc); + if (sc->sc_inreset_cnt) { + HAL_INT status; + ath_hal_getisr(ah, &status); /* clear ISR */ + ath_hal_intrset(ah, 0); /* disable further intr's */ + DPRINTF(sc, ATH_DEBUG_ANY, + "%s: in reset, ignoring: status=0x%x\n", + __func__, status); + ATH_PCU_UNLOCK(sc); + return; + } + if (sc->sc_invalid) { /* * The hardware is not ready/present, don't touch anything. * Note this can happen early on if the IRQ is shared. */ DPRINTF(sc, ATH_DEBUG_ANY, "%s: invalid; ignored\n", __func__); + ATH_PCU_UNLOCK(sc); return; } - if (!ath_hal_intrpend(ah)) /* shared irq, not for us */ + if (!ath_hal_intrpend(ah)) { /* shared irq, not for us */ + ATH_PCU_UNLOCK(sc); return; + } + if ((ifp->if_flags & IFF_UP) == 0 || (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { HAL_INT status; @@ -1377,8 +1397,10 @@ ath_intr(void *arg) __func__, ifp->if_flags); ath_hal_getisr(ah, &status); /* clear ISR */ ath_hal_intrset(ah, 0); /* disable further intr's */ + ATH_PCU_UNLOCK(sc); return; } + /* * Figure out the reason(s) for the interrupt. Note * that the hal returns a pseudo-ISR that may include @@ -1400,9 +1422,23 @@ ath_intr(void *arg) status &= sc->sc_imask; /* discard unasked for bits */ /* Short-circuit un-handled interrupts */ - if (status == 0x0) + if (status == 0x0) { + ATH_PCU_UNLOCK(sc); return; + } + + /* + * Take a note that we're inside the interrupt handler, so + * the reset routines know to wait. + */ + sc->sc_intr_cnt++; + ATH_PCU_UNLOCK(sc); + /* + * Handle the interrupt. We won't run concurrent with the reset + * or channel change routines as they'll wait for sc_intr_cnt + * to be 0 before continuing. + */ if (status & HAL_INT_FATAL) { sc->sc_stats.ast_hardware++; ath_hal_intrset(ah, 0); /* disable intr's until reset */ @@ -1443,6 +1479,7 @@ ath_intr(void *arg) if (status & HAL_INT_RXEOL) { int imask; CTR0(ATH_KTR_ERR, "ath_intr: RXEOL"); + ATH_PCU_LOCK(sc); /* * NB: the hardware should re-read the link when * RXE bit is written, but it doesn't work at @@ -1458,7 +1495,6 @@ ath_intr(void *arg) * by a call to ath_reset() somehow, the * interrupt mask will be correctly reprogrammed. */ - ATH_LOCK(sc); imask = sc->sc_imask; imask &= ~(HAL_INT_RXEOL | HAL_INT_RXORN); ath_hal_intrset(ah, imask); @@ -1476,13 +1512,13 @@ ath_intr(void *arg) if (! sc->sc_kickpcu) sc->sc_rxlink = NULL; sc->sc_kickpcu = 1; - ATH_UNLOCK(sc); /* * Enqueue an RX proc, to handled whatever * is in the RX queue. * This will then kick the PCU. */ taskqueue_enqueue(sc->sc_tq, &sc->sc_rxtask); + ATH_PCU_UNLOCK(sc); } if (status & HAL_INT_TXURN) { sc->sc_stats.ast_txurn++; @@ -1500,12 +1536,12 @@ ath_intr(void *arg) * and blank them. This is the only place we should be * doing this. */ - ATH_LOCK(sc); + ATH_PCU_LOCK(sc); txqs = 0xffffffff; ath_hal_gettxintrtxqs(sc->sc_ah, &txqs); sc->sc_txq_active |= txqs; - ATH_UNLOCK(sc); taskqueue_enqueue(sc->sc_tq, &sc->sc_txtask); + ATH_PCU_UNLOCK(sc); } if (status & HAL_INT_BMISS) { sc->sc_stats.ast_bmiss++; @@ -1517,6 +1553,7 @@ ath_intr(void *arg) sc->sc_stats.ast_tx_cst++; if (status & HAL_INT_MIB) { sc->sc_stats.ast_mib++; + ATH_PCU_LOCK(sc); /* * Disable interrupts until we service the MIB * interrupt; otherwise it will continue to fire. @@ -1533,10 +1570,9 @@ ath_intr(void *arg) * RXEOL before the rxproc has had a chance * to run. */ - ATH_LOCK(sc); if (sc->sc_kickpcu == 0) ath_hal_intrset(ah, sc->sc_imask); - ATH_UNLOCK(sc); + ATH_PCU_UNLOCK(sc); } if (status & HAL_INT_RXORN) { /* NB: hal marks HAL_INT_FATAL when RXORN is fatal */ @@ -1544,6 +1580,9 @@ ath_intr(void *arg) sc->sc_stats.ast_rxorn++; } } + ATH_PCU_LOCK(sc); + sc->sc_intr_cnt--; + ATH_PCU_UNLOCK(sc); } static void @@ -1818,6 +1857,48 @@ ath_stop_locked(struct ifnet *ifp) } } +#define MAX_TXRX_ITERATIONS 1000 +static void +ath_txrx_stop(struct ath_softc *sc) +{ + int i = MAX_TXRX_ITERATIONS; + + ATH_UNLOCK_ASSERT(sc); + + /* Stop any new TX/RX from occuring */ + taskqueue_block(sc->sc_tq); + + ATH_PCU_LOCK(sc); + + /* + * Sleep until all the pending operations have completed. + * + * The caller must ensure that reset has been incremented + * or the pending operations may continue being queued. + */ + while (sc->sc_rxproc_cnt || sc->sc_txproc_cnt || + sc->sc_txstart_cnt || sc->sc_intr_cnt) { + if (i <= 0) + break; + msleep(sc, &sc->sc_mtx, 0, "ath_txrx_stop", 1); + i--; + } + ATH_PCU_UNLOCK(sc); + + if (i <= 0) + device_printf(sc->sc_dev, + "%s: didn't finish after %d iterations\n", + __func__, MAX_TXRX_ITERATIONS); +} +#undef MAX_TXRX_ITERATIONS + +static void +ath_txrx_start(struct ath_softc *sc) +{ + + taskqueue_unblock(sc->sc_tq); +} + static void ath_stop(struct ifnet *ifp) { @@ -1842,17 +1923,51 @@ ath_reset(struct ifnet *ifp, ATH_RESET_T struct ieee80211com *ic = ifp->if_l2com; struct ath_hal *ah = sc->sc_ah; HAL_STATUS status; + int i; DPRINTF(sc, ATH_DEBUG_RESET, "%s: called\n", __func__); + /* XXX ensure ATH_LOCK isn't held; ath_rx_proc can't be locked */ + ATH_PCU_UNLOCK_ASSERT(sc); + ATH_UNLOCK_ASSERT(sc); + + ATH_PCU_LOCK(sc); + /* XXX if we're already inside a reset, print out a big warning */ + if (sc->sc_inreset_cnt > 0) { + device_printf(sc->sc_dev, + "%s: concurrent ath_reset()! Danger!\n", + __func__); + } + sc->sc_inreset_cnt++; ath_hal_intrset(ah, 0); /* disable interrupts */ + ATH_PCU_UNLOCK(sc); + + /* + * XXX should now wait for pending TX/RX to complete + * and block future ones from occuring. + */ + ath_txrx_stop(sc); + ath_draintxq(sc, reset_type); /* stop xmit side */ + /* - * XXX Don't flush if ATH_RESET_NOLOSS;but we have to first - * XXX need to ensure this doesn't race with an outstanding - * XXX taskqueue call. + * Regardless of whether we're doing a no-loss flush or + * not, stop the PCU and handle what's in the RX queue. + * That way frames aren't dropped which shouldn't be. + */ + ath_hal_stoppcurecv(ah); + ath_hal_setrxfilter(ah, 0); + ath_rx_proc(sc, 0); + + /* + * If we're not doing a noloss reset, now call ath_stoprecv(). + * This fully stops all of the RX machinery and flushes whatever + * frames are in the RX ring buffer. Hopefully all completed + * frames have been handled at this point. */ - ath_stoprecv(sc); /* stop recv side */ + if (reset_type != ATH_RESET_NOLOSS) + ath_stoprecv(sc); /* stop recv side */ + ath_settkipmic(sc); /* configure TKIP MIC handling */ /* NB: indicate channel change so we do a full reset */ if (!ath_hal_reset(ah, sc->sc_opmode, ic->ic_curchan, AH_TRUE, &status)) @@ -1879,8 +1994,59 @@ ath_reset(struct ifnet *ifp, ATH_RESET_T #endif ath_beacon_config(sc, NULL); } + + /* + * Release the reset lock and re-enable interrupts here. + * If an interrupt was being processed in ath_intr(), + * it would disable interrupts at this point. So we have + * to atomically enable interrupts and decrement the + * reset counter - this way ath_intr() doesn't end up + * disabling interrupts without a corresponding enable + * in the rest or channel change path. + */ + ATH_PCU_LOCK(sc); + sc->sc_inreset_cnt--; + /* XXX only do this if sc_inreset_cnt == 0? */ ath_hal_intrset(ah, sc->sc_imask); + ATH_PCU_UNLOCK(sc); + + /* + * TX and RX can be started here. If it were started with + * sc_inreset_cnt > 0, the TX and RX path would abort. + * Thus if this is a nested call through the reset or + * channel change code, TX completion will occur but + * RX completion and ath_start / ath_tx_start will not + * run. + */ + + /* Restart TX/RX as needed */ + ath_txrx_start(sc); + + /* XXX Restart TX completion and pending TX */ + if (reset_type == ATH_RESET_NOLOSS) { + for (i = 0; i < HAL_NUM_TX_QUEUES; i++) { + if (ATH_TXQ_SETUP(sc, i)) { + ATH_TXQ_LOCK(&sc->sc_txq[i]); + ath_txq_restart_dma(sc, &sc->sc_txq[i]); + ath_txq_sched(sc, &sc->sc_txq[i]); + ATH_TXQ_UNLOCK(&sc->sc_txq[i]); + } + } + } + + /* + * This may have been set during an ath_start() call which + * set this once it detected a concurrent TX was going on. + * So, clear it. + */ + /* XXX do this inside of IF_LOCK? */ + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + /* Handle any frames in the TX queue */ + /* + * XXX should this be done by the caller, rather than + * ath_reset() ? + */ ath_start(ifp); /* restart xmit */ return 0; } @@ -2011,6 +2177,7 @@ ath_getbuf(struct ath_softc *sc) DPRINTF(sc, ATH_DEBUG_XMIT, "%s: stop queue\n", __func__); sc->sc_stats.ast_tx_qstop++; + /* XXX do this inside of IF_LOCK? */ ifp->if_drv_flags |= IFF_DRV_OACTIVE; } ATH_TXBUF_UNLOCK(sc); @@ -2028,6 +2195,20 @@ ath_start(struct ifnet *ifp) if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || sc->sc_invalid) return; + + /* XXX is it ok to hold the ATH_LOCK here? */ + ATH_PCU_LOCK(sc); + if (sc->sc_inreset_cnt > 0) { + device_printf(sc->sc_dev, + "%s: sc_inreset_cnt > 0; bailing\n", __func__); + /* XXX do this inside of IF_LOCK? */ + ifp->if_drv_flags |= IFF_DRV_OACTIVE; + ATH_PCU_UNLOCK(sc); + return; + } + sc->sc_txstart_cnt++; + ATH_PCU_UNLOCK(sc); + for (;;) { /* * Grab a TX buffer and associated resources. @@ -2111,6 +2292,10 @@ ath_start(struct ifnet *ifp) sc->sc_wd_timer = 5; } + + ATH_PCU_LOCK(sc); + sc->sc_txstart_cnt--; + ATH_PCU_UNLOCK(sc); } static int @@ -3688,6 +3873,14 @@ ath_rx_tasklet(void *arg, int npending) CTR1(ATH_KTR_INTR, "ath_rx_proc: pending=%d", npending); DPRINTF(sc, ATH_DEBUG_RX_PROC, "%s: pending %u\n", __func__, npending); + ATH_PCU_LOCK(sc); + if (sc->sc_inreset_cnt > 0) { + device_printf(sc->sc_dev, + "%s: sc_inreset_cnt > 0; skipping\n", __func__); + ATH_PCU_UNLOCK(sc); + return; + } + ATH_PCU_UNLOCK(sc); ath_rx_proc(sc, 1); } @@ -3711,6 +3904,14 @@ ath_rx_proc(struct ath_softc *sc, int re u_int64_t tsf; int npkts = 0; + /* XXX we must not hold the ATH_LOCK here */ + ATH_UNLOCK_ASSERT(sc); + ATH_PCU_UNLOCK_ASSERT(sc); + + ATH_PCU_LOCK(sc); + sc->sc_rxproc_cnt++; + ATH_PCU_UNLOCK(sc); + DPRINTF(sc, ATH_DEBUG_RX_PROC, "%s: called\n", __func__); ngood = 0; nf = ath_hal_getchannoise(ah, sc->sc_curchan); @@ -4056,24 +4257,29 @@ rx_next: * need to be handled, kick the PCU if there's * been an RXEOL condition. */ + ATH_PCU_LOCK(sc); if (resched && sc->sc_kickpcu) { CTR0(ATH_KTR_ERR, "ath_rx_proc: kickpcu"); device_printf(sc->sc_dev, "%s: kickpcu; handled %d packets\n", __func__, npkts); /* XXX rxslink? */ + /* + * XXX can we hold the PCU lock here? + * Are there any net80211 buffer calls involved? + */ bf = TAILQ_FIRST(&sc->sc_rxbuf); ath_hal_putrxbuf(ah, bf->bf_daddr); ath_hal_rxena(ah); /* enable recv descriptors */ ath_mode_init(sc); /* set filters, etc. */ ath_hal_startpcurecv(ah); /* re-enable PCU/DMA engine */ - ATH_LOCK(sc); ath_hal_intrset(ah, sc->sc_imask); sc->sc_kickpcu = 0; - ATH_UNLOCK(sc); } + ATH_PCU_UNLOCK(sc); + /* XXX check this inside of IF_LOCK? */ if (resched && (ifp->if_drv_flags & IFF_DRV_OACTIVE) == 0) { #ifdef IEEE80211_SUPPORT_SUPERG ieee80211_ff_age_all(ic, 100); @@ -4082,6 +4288,10 @@ rx_next: ath_start(ifp); } #undef PA2DESC + + ATH_PCU_LOCK(sc); + sc->sc_rxproc_cnt--; + ATH_PCU_UNLOCK(sc); } static void @@ -4588,22 +4798,28 @@ ath_tx_proc_q0(void *arg, int npending) struct ifnet *ifp = sc->sc_ifp; uint32_t txqs; - ATH_LOCK(sc); + ATH_PCU_LOCK(sc); + sc->sc_txproc_cnt++; txqs = sc->sc_txq_active; sc->sc_txq_active &= ~txqs; - ATH_UNLOCK(sc); + ATH_PCU_UNLOCK(sc); if (TXQACTIVE(txqs, 0) && ath_tx_processq(sc, &sc->sc_txq[0], 1)) /* XXX why is lastrx updated in tx code? */ sc->sc_lastrx = ath_hal_gettsf64(sc->sc_ah); if (TXQACTIVE(txqs, sc->sc_cabq->axq_qnum)) ath_tx_processq(sc, sc->sc_cabq, 1); + /* XXX check this inside of IF_LOCK? */ ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; sc->sc_wd_timer = 0; if (sc->sc_softled) ath_led_event(sc, sc->sc_txrix); + ATH_PCU_LOCK(sc); + sc->sc_txproc_cnt--; + ATH_PCU_UNLOCK(sc); + ath_start(ifp); } @@ -4619,10 +4835,11 @@ ath_tx_proc_q0123(void *arg, int npendin int nacked; uint32_t txqs; - ATH_LOCK(sc); + ATH_PCU_LOCK(sc); + sc->sc_txproc_cnt++; txqs = sc->sc_txq_active; sc->sc_txq_active &= ~txqs; - ATH_UNLOCK(sc); + ATH_PCU_UNLOCK(sc); /* * Process each active queue. @@ -4641,12 +4858,17 @@ ath_tx_proc_q0123(void *arg, int npendin if (nacked) sc->sc_lastrx = ath_hal_gettsf64(sc->sc_ah); + /* XXX check this inside of IF_LOCK? */ ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; sc->sc_wd_timer = 0; if (sc->sc_softled) ath_led_event(sc, sc->sc_txrix); + ATH_PCU_LOCK(sc); + sc->sc_txproc_cnt--; + ATH_PCU_UNLOCK(sc); + ath_start(ifp); } @@ -4661,10 +4883,11 @@ ath_tx_proc(void *arg, int npending) int i, nacked; uint32_t txqs; - ATH_LOCK(sc); + ATH_PCU_LOCK(sc); + sc->sc_txproc_cnt++; txqs = sc->sc_txq_active; sc->sc_txq_active &= ~txqs; - ATH_UNLOCK(sc); + ATH_PCU_UNLOCK(sc); /* * Process each active queue. @@ -4676,12 +4899,17 @@ ath_tx_proc(void *arg, int npending) if (nacked) sc->sc_lastrx = ath_hal_gettsf64(sc->sc_ah); + /* XXX check this inside of IF_LOCK? */ ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; sc->sc_wd_timer = 0; if (sc->sc_softled) ath_led_event(sc, sc->sc_txrix); + ATH_PCU_LOCK(sc); + sc->sc_txproc_cnt--; + ATH_PCU_UNLOCK(sc); + ath_start(ifp); } #undef TXQACTIVE @@ -4863,9 +5091,18 @@ ath_draintxq(struct ath_softc *sc, ATH_R (void) ath_stoptxdma(sc); - for (i = 0; i < HAL_NUM_TX_QUEUES; i++) - if (ATH_TXQ_SETUP(sc, i)) - ath_tx_draintxq(sc, &sc->sc_txq[i]); + for (i = 0; i < HAL_NUM_TX_QUEUES; i++) { + /* + * XXX TODO: should we just handle the completed TX frames + * here, whether or not the reset is a full one or not? + */ + if (ATH_TXQ_SETUP(sc, i)) { + if (reset_type == ATH_RESET_NOLOSS) + ath_tx_processq(sc, &sc->sc_txq[i], 0); + else + ath_tx_draintxq(sc, &sc->sc_txq[i]); + } + } #ifdef ATH_DEBUG if (sc->sc_debug & ATH_DEBUG_RESET) { struct ath_buf *bf = TAILQ_FIRST(&sc->sc_bbuf); @@ -4879,6 +5116,7 @@ ath_draintxq(struct ath_softc *sc, ATH_R } } #endif /* ATH_DEBUG */ + /* XXX check this inside of IF_LOCK? */ ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; sc->sc_wd_timer = 0; } @@ -4984,6 +5222,22 @@ ath_chan_set(struct ath_softc *sc, struc struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = ifp->if_l2com; struct ath_hal *ah = sc->sc_ah; + int ret = 0; + int dointr = 0; + + /* Treat this as an interface reset */ + ATH_PCU_LOCK(sc); + if (sc->sc_inreset_cnt > 0) + device_printf(sc->sc_dev, "%s: danger! concurrent reset!\n", + __func__); + sc->sc_inreset_cnt++; + if (chan != sc->sc_curchan) { + dointr = 1; + /* XXX only do this if inreset_cnt is 1? */ + ath_hal_intrset(ah, 0); + } + ATH_PCU_UNLOCK(sc); + ath_txrx_stop(sc); DPRINTF(sc, ATH_DEBUG_RESET, "%s: %u (%u MHz, flags 0x%x)\n", __func__, ieee80211_chan2ieee(ic, chan), @@ -4996,7 +5250,9 @@ ath_chan_set(struct ath_softc *sc, struc * hardware at the new frequency, and then re-enable * the relevant bits of the h/w. */ +#if 0 ath_hal_intrset(ah, 0); /* disable interrupts */ +#endif ath_draintxq(sc, ATH_RESET_FULL); /* clear pending tx frames */ ath_stoprecv(sc); /* turn off frame recv */ if (!ath_hal_reset(ah, sc->sc_opmode, chan, AH_TRUE, &status)) { @@ -5004,7 +5260,8 @@ ath_chan_set(struct ath_softc *sc, struc "channel %u (%u MHz, flags 0x%x), hal status %u\n", __func__, ieee80211_chan2ieee(ic, chan), chan->ic_freq, chan->ic_flags, status); - return EIO; + ret = EIO; + goto finish; } sc->sc_diversity = ath_hal_getdiversity(ah); @@ -5017,7 +5274,8 @@ ath_chan_set(struct ath_softc *sc, struc if (ath_startrecv(sc) != 0) { if_printf(ifp, "%s: unable to restart recv logic\n", __func__); - return EIO; + ret = EIO; + goto finish; } /* @@ -5039,12 +5297,28 @@ ath_chan_set(struct ath_softc *sc, struc ath_beacon_config(sc, NULL); } +#if 0 /* * Re-enable interrupts. */ ath_hal_intrset(ah, sc->sc_imask); +#endif } - return 0; + +finish: + ATH_PCU_LOCK(sc); + sc->sc_inreset_cnt--; + /* XXX only do this if sc_inreset_cnt == 0? */ + if (dointr) + ath_hal_intrset(ah, sc->sc_imask); + ATH_PCU_UNLOCK(sc); + + /* XXX do this inside of IF_LOCK? */ + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + ath_txrx_start(sc); + /* XXX ath_start? */ + + return ret; } /* @@ -5087,7 +5361,18 @@ ath_calibrate(void *arg) DPRINTF(sc, ATH_DEBUG_CALIBRATE, "%s: rfgain change\n", __func__); sc->sc_stats.ast_per_rfgain++; + /* + * Drop lock - we can't hold it across the + * ath_reset() call. Instead, we'll drop + * out here, do a reset, then reschedule + * the callout. + */ + callout_reset(&sc->sc_cal_ch, 1, ath_calibrate, sc); + sc->sc_resetcal = 0; + sc->sc_doresetcal = AH_TRUE; + ATH_UNLOCK(sc); ath_reset(ifp, ATH_RESET_NOLOSS); + return; } /* * If this long cal is after an idle period, then @@ -5742,6 +6027,7 @@ static void ath_watchdog(void *arg) { struct ath_softc *sc = arg; + int do_reset = 0; if (sc->sc_wd_timer != 0 && --sc->sc_wd_timer == 0) { struct ifnet *ifp = sc->sc_ifp; @@ -5753,10 +6039,20 @@ ath_watchdog(void *arg) hangs & 0xff ? "bb" : "mac", hangs); } else if_printf(ifp, "device timeout\n"); - ath_reset(ifp, ATH_RESET_NOLOSS); + do_reset = 1; ifp->if_oerrors++; sc->sc_stats.ast_watchdog++; } + + /* + * We can't hold the lock across the ath_reset() call. + */ + if (do_reset) { + ATH_UNLOCK(sc); + ath_reset(sc->sc_ifp, ATH_RESET_NOLOSS); + ATH_LOCK(sc); + } + callout_schedule(&sc->sc_wd_ch, hz); } Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Fri Nov 18 03:05:20 2011 (r227650) +++ head/sys/dev/ath/if_ath_tx.c Fri Nov 18 05:06:30 2011 (r227651) @@ -477,8 +477,6 @@ ath_tx_handoff_mcast(struct ath_softc *s txq->axq_link = &bf->bf_lastds->ds_link; } - - /* * Hand-off packet to a hardware queue. */ @@ -501,6 +499,36 @@ ath_tx_handoff_hw(struct ath_softc *sc, KASSERT(txq->axq_qnum != ATH_TXQ_SWQ, ("ath_tx_handoff_hw called for mcast queue")); +#if 0 + /* + * This causes a LOR. Find out where the PCU lock is being + * held whilst the TXQ lock is grabbed - that shouldn't + * be occuring. + */ + ATH_PCU_LOCK(sc); + if (sc->sc_inreset_cnt) { + ATH_PCU_UNLOCK(sc); + DPRINTF(sc, ATH_DEBUG_RESET, + "%s: called with sc_in_reset != 0\n", + __func__); + DPRINTF(sc, ATH_DEBUG_XMIT, + "%s: queued: TXDP[%u] = %p (%p) depth %d\n", + __func__, txq->axq_qnum, + (caddr_t)bf->bf_daddr, bf->bf_desc, + txq->axq_depth); + ATH_TXQ_INSERT_TAIL(txq, bf, bf_list); + if (bf->bf_state.bfs_aggr) + txq->axq_aggr_depth++; + /* + * There's no need to update axq_link; the hardware + * is in reset and once the reset is complete, any + * non-empty queues will simply have DMA restarted. + */ + return; + } + ATH_PCU_UNLOCK(sc); +#endif + /* For now, so not to generate whitespace diffs */ if (1) { #ifdef IEEE80211_SUPPORT_TDMA @@ -1688,6 +1716,17 @@ ath_raw_xmit(struct ieee80211_node *ni, struct ath_buf *bf; int error; + ATH_PCU_LOCK(sc); + if (sc->sc_inreset_cnt > 0) { + device_printf(sc->sc_dev, "%s: sc_inreset_cnt > 0; bailing\n", + __func__); + error = EIO; + ATH_PCU_UNLOCK(sc); + goto bad0; + } + sc->sc_txstart_cnt++; + ATH_PCU_UNLOCK(sc); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || sc->sc_invalid) { DPRINTF(sc, ATH_DEBUG_XMIT, "%s: discard frame, %s", __func__, (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 ? @@ -1730,15 +1769,24 @@ ath_raw_xmit(struct ieee80211_node *ni, ifp->if_opackets++; sc->sc_stats.ast_tx_raw++; + ATH_PCU_LOCK(sc); + sc->sc_txstart_cnt--; + ATH_PCU_UNLOCK(sc); + return 0; bad2: ATH_TXBUF_LOCK(sc); TAILQ_INSERT_HEAD(&sc->sc_txbuf, bf, bf_list); ATH_TXBUF_UNLOCK(sc); bad: + ATH_PCU_LOCK(sc); + sc->sc_txstart_cnt--; + ATH_PCU_UNLOCK(sc); +bad0: ifp->if_oerrors++; sc->sc_stats.ast_tx_raw_fail++; ieee80211_free_node(ni); + return error; } Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Fri Nov 18 03:05:20 2011 (r227650) +++ head/sys/dev/ath/if_athvar.h Fri Nov 18 05:06:30 2011 (r227651) @@ -424,6 +424,7 @@ struct ath_softc { u_int sc_txantenna; /* tx antenna (fixed or auto) */ HAL_INT sc_imask; /* interrupt mask copy */ + /* * These are modified in the interrupt handler as well as * the task queues and other contexts. Thus these must be @@ -434,6 +435,12 @@ struct ath_softc { */ uint32_t sc_txq_active; /* bitmap of active TXQs */ uint32_t sc_kickpcu; /* whether to kick the PCU */ + uint32_t sc_rxproc_cnt; /* In RX processing */ + uint32_t sc_txproc_cnt; /* In TX processing */ + uint32_t sc_txstart_cnt; /* In TX output (raw/start) */ + uint32_t sc_inreset_cnt; /* In active reset/chanchange */ + uint32_t sc_txrx_cnt; /* refcount on stop/start'ing TX */ + uint32_t sc_intr_cnt; /* refcount on interrupt handling */ u_int sc_keymax; /* size of key cache */ u_int8_t sc_keymap[ATH_KEYBYTES];/* key use bit map */ @@ -553,6 +560,7 @@ struct ath_softc { #define ATH_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) #define ATH_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) #define ATH_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->sc_mtx, MA_OWNED) +#define ATH_UNLOCK_ASSERT(_sc) mtx_assert(&(_sc)->sc_mtx, MA_NOTOWNED) /* * The PCU lock is non-recursive and should be treated as a spinlock. @@ -584,6 +592,8 @@ struct ath_softc { #define ATH_PCU_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_pcu_mtx) #define ATH_PCU_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->sc_pcu_mtx, \ MA_OWNED) +#define ATH_PCU_UNLOCK_ASSERT(_sc) mtx_assert(&(_sc)->sc_pcu_mtx, \ + MA_NOTOWNED) #define ATH_TXQ_SETUP(sc, i) ((sc)->sc_txqsetup & (1< Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1942A106564A; Fri, 18 Nov 2011 05:43:44 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BDFED8FC14; Fri, 18 Nov 2011 05:43:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAI5hh6W053050; Fri, 18 Nov 2011 05:43:43 GMT (envelope-from grehan@svn.freebsd.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAI5hh0I053042; Fri, 18 Nov 2011 05:43:43 GMT (envelope-from grehan@svn.freebsd.org) Message-Id: <201111180543.pAI5hh0I053042@svn.freebsd.org> From: Peter Grehan Date: Fri, 18 Nov 2011 05:43:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227652 - in head: share/man/man4 sys/dev/virtio sys/dev/virtio/balloon sys/dev/virtio/block sys/dev/virtio/network sys/dev/virtio/pci sys/modules sys/modules/virtio sys/modules/virtio/... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Nov 2011 05:43:44 -0000 Author: grehan Date: Fri Nov 18 05:43:43 2011 New Revision: 227652 URL: http://svn.freebsd.org/changeset/base/227652 Log: Import virtio base, PCI front-end, and net/block/balloon drivers. Tested on Qemu/KVM, VirtualBox, and BHyVe. Currently built as modules-only on i386/amd64. Man pages not yet hooked up, pending review. Submitted by: Bryan Venteicher bryanv at daemoninthecloset dot org Reviewed by: bz MFC after: 4 weeks or so Added: head/share/man/man4/virtio.4 (contents, props changed) head/share/man/man4/virtio_balloon.4 (contents, props changed) head/share/man/man4/virtio_blk.4 (contents, props changed) head/share/man/man4/vtnet.4 (contents, props changed) head/sys/dev/virtio/ head/sys/dev/virtio/balloon/ head/sys/dev/virtio/balloon/virtio_balloon.c (contents, props changed) head/sys/dev/virtio/balloon/virtio_balloon.h (contents, props changed) head/sys/dev/virtio/block/ head/sys/dev/virtio/block/virtio_blk.c (contents, props changed) head/sys/dev/virtio/block/virtio_blk.h (contents, props changed) head/sys/dev/virtio/network/ head/sys/dev/virtio/network/if_vtnet.c (contents, props changed) head/sys/dev/virtio/network/if_vtnetvar.h (contents, props changed) head/sys/dev/virtio/network/virtio_net.h (contents, props changed) head/sys/dev/virtio/pci/ head/sys/dev/virtio/pci/virtio_pci.c (contents, props changed) head/sys/dev/virtio/pci/virtio_pci.h (contents, props changed) head/sys/dev/virtio/virtio.c (contents, props changed) head/sys/dev/virtio/virtio.h (contents, props changed) head/sys/dev/virtio/virtio_bus_if.m (contents, props changed) head/sys/dev/virtio/virtio_if.m (contents, props changed) head/sys/dev/virtio/virtio_ring.h (contents, props changed) head/sys/dev/virtio/virtqueue.c (contents, props changed) head/sys/dev/virtio/virtqueue.h (contents, props changed) head/sys/modules/virtio/ head/sys/modules/virtio/Makefile (contents, props changed) head/sys/modules/virtio/balloon/ head/sys/modules/virtio/balloon/Makefile (contents, props changed) head/sys/modules/virtio/block/ head/sys/modules/virtio/block/Makefile (contents, props changed) head/sys/modules/virtio/network/ head/sys/modules/virtio/network/Makefile (contents, props changed) head/sys/modules/virtio/pci/ head/sys/modules/virtio/pci/Makefile (contents, props changed) head/sys/modules/virtio/virtio/ head/sys/modules/virtio/virtio/Makefile (contents, props changed) Modified: head/sys/modules/Makefile Added: head/share/man/man4/virtio.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/virtio.4 Fri Nov 18 05:43:43 2011 (r227652) @@ -0,0 +1,91 @@ +.\" Copyright (c) 2011 Bryan Venteicher +.\" 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 July 4, 2011 +.Dt VIRTIO 4 +.Os +.Sh NAME +.Nm virtio +.Nd VirtIO Device Support +.Sh SYNOPSIS +To compile VirtIO device support into the kernel, place the following lines +in your kernel configuration file: +.Bd -ragged -offset indent +.Cd "device virtio" +.Cd "device virtio_pci" +.Ed +.Pp +Alternatively, to load VirtIO support as modules at boot time, place the +following lines in +.Xr loader.conf 5 : +.Bd -literal -offset indent +virtio_load="YES" +virtio_pci_load="YES" +.Ed +.Sh DESCRIPTION +VirtIO is a specification for para-virtualized I/O in a virtual machine (VM). +Traditionally, the hypervisor emulated real devices such as an Ethernet +interface or disk controller to provide the VM with I/O. This emulation is +often inefficient. +.Pp +VirtIO defines an interface for efficient I/O between the hypervisor and VM. +The +.Xr virtio 4 +module provides a shared memory transport called a virtqueue. +The +.Xr virtio_pci 4 +device driver represents an emulated PCI device that the hypervisor makes +available to the VM. This device provides the probing, configuration, and +interrupt notifications need to interact with the hypervisor. +.Fx +supports the following VirtIO devices: +.Bl -hang -offset indent -width xxxxxxxx +.It Nm Ethernet +An emulated Ethernet device is provided by the +.Xr if_vtnet 4 +device driver. +.It Nm Block +An emulated disk controller is provided by the +.Xr virtio_blk 4 +device driver. +.It Nm Balloon +A pseudo-device to allow the VM to release memory back to the hypervisor is +provided by the +.Xr virtio_balloon 4 +device driver. +.El +.Sh SEE ALSO +.Xr if_vtnet 4 , +.Xr virtio_blk 4 , +.Xr virtio_balloon 4 +.Sh HISTORY +Support for VirtIO first appeared in +.Fx 9.0 . +.Sh AUTHORS +.An -nosplit +.Fx +support for VirtIO was first added by +.An Bryan Venteicher Aq bryanv@daemoninthecloset.org . Added: head/share/man/man4/virtio_balloon.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/virtio_balloon.4 Fri Nov 18 05:43:43 2011 (r227652) @@ -0,0 +1,64 @@ +.\" Copyright (c) 2011 Bryan Venteicher +.\" 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 July 4, 2011 +.Dt VIRTIO_BALLOON 4 +.Os +.Sh NAME +.Nm virtio_balloon +.Nd VirtIO Memory Balloon driver +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device virtio_balloon" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +virtio_balloon_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +device driver provides support for VirtIO memory balloon devices. +.Pp +The memory balloon allows the guest to, at the request of the +hypervisor, return memory allocated to the hypervisor so it can +be made available to other guests. The hypervisor can later +signal the balloon to return the memory. +.Sh SEE ALSO +.Xr virtio 4 +.Sh HISTORY +The +.Nm +driver was written by +.An Bryan Venteicher Aq bryanv@daemoninthecloset.org . +It first appeared in +.Fx 9.0 . Added: head/share/man/man4/virtio_blk.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/virtio_blk.4 Fri Nov 18 05:43:43 2011 (r227652) @@ -0,0 +1,70 @@ +.\" Copyright (c) 2011 Bryan Venteicher +.\" 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 July 4, 2011 +.Dt VIRTIO_BLK 4 +.Os +.Sh NAME +.Nm virtio_blk +.Nd VirtIO Block driver +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device virtio_blk" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +virtio_blk_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +device driver provides support for VirtIO block devices. +.Pp +.Sh LOADER TUNABLES +Tunables can be set at the +.Xr loader 8 +prompt before booting the kernel or stored in +.Xr loader.conf 5 . +.Bl -tag -width "xxxxxx" +.It Va hw.vtblk.no_ident +This tunable disables retrieving the device identification string +from the hypervisor. The default value is 0. +.El +.Sh SEE ALSO +.Xr virtio 4 +.Sh HISTORY +The +.Nm +driver was written by +.An Bryan Venteicher Aq bryanv@daemoninthecloset.org . +It first appeared in +.Fx 9.0 . Added: head/share/man/man4/vtnet.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/vtnet.4 Fri Nov 18 05:43:43 2011 (r227652) @@ -0,0 +1,98 @@ +.\" Copyright (c) 2011 Bryan Venteicher +.\" 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 July 4, 2011 +.Dt VTNET 4 +.Os +.Sh NAME +.Nm vtnet +.Nd VirtIO Ethernet driver +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device if_vtnet" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +if_vtnet_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +device driver provides support for VirtIO Ethernet devices. +.Pp +If the hypervisor advertises the appreciate features, the +.Nm +driver supports TCP/UDP checksum offload for both transmit and receive, +TCP segmentation offload (TSO), TCP large receive offload (LRO), and +hardware VLAN tag stripping/insertion features, as well as a multicast +hash filter, as well as Jumbo Frames (up to 9216 bytes), which can be +configured via the interface MTU setting. +Selecting an MTU larger than 1500 bytes with the +.Xr ifconfig 8 +utility configures the adapter to receive and transmit Jumbo Frames. +.Pp +For more information on configuring this device, see +.Xr ifconfig 8 . +.El +.Sh LOADER TUNABLES +Tunables can be set at the +.Xr loader 8 +prompt before booting the kernel or stored in +.Xr loader.conf 5 . +.Bl -tag -width "xxxxxx" +.It Va hw.vtnet.csum_disable +This tunable disables receive and send checksum offload. The default +value is 0. +.It Va hw.vtnet.tso_disable +This tunable disables TSO. The default value is 0. +.It Va hw.vtnet.lro_disable +This tunable disables LRO. The default value is 0. +.El +.Sh SEE ALSO +.Xr arp 4 , +.Xr netintro 4 , +.Xr ng_ether 4 , +.Xr vlan 4 , +.Xr virtio 4 , +.Xr ifconfig 8 +.Sh HISTORY +The +.Nm +driver was written by +.An Bryan Venteicher Aq bryanv@daemoninthecloset.org . +It first appeared in +.Fx 9.0 . +.Sh CAVEATS +The +.Nm +driver only supports LRO when the hypervisor advertises the +mergeable buffer feature. Added: head/sys/dev/virtio/balloon/virtio_balloon.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/virtio/balloon/virtio_balloon.c Fri Nov 18 05:43:43 2011 (r227652) @@ -0,0 +1,569 @@ +/*- + * Copyright (c) 2011, Bryan Venteicher + * 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 unmodified, 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. + */ + +/* Driver for VirtIO memory balloon devices. */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include +#include +#include + +#include "virtio_if.h" + +struct vtballoon_softc { + device_t vtballoon_dev; + struct mtx vtballoon_mtx; + uint64_t vtballoon_features; + uint32_t vtballoon_flags; +#define VTBALLOON_FLAG_DETACH 0x01 + + struct virtqueue *vtballoon_inflate_vq; + struct virtqueue *vtballoon_deflate_vq; + + uint32_t vtballoon_desired_npages; + uint32_t vtballoon_current_npages; + TAILQ_HEAD(,vm_page) vtballoon_pages; + + struct proc *vtballoon_kproc; + uint32_t *vtballoon_page_frames; + int vtballoon_timeout; +}; + +static struct virtio_feature_desc vtballoon_feature_desc[] = { + { VIRTIO_BALLOON_F_MUST_TELL_HOST, "MustTellHost" }, + { VIRTIO_BALLOON_F_STATS_VQ, "StatsVq" }, + + { 0, NULL } +}; + +static int vtballoon_probe(device_t); +static int vtballoon_attach(device_t); +static int vtballoon_detach(device_t); +static int vtballoon_config_change(device_t); + +static void vtballoon_negotiate_features(struct vtballoon_softc *); +static int vtballoon_alloc_virtqueues(struct vtballoon_softc *); + +static int vtballoon_vq_intr(void *); + +static void vtballoon_inflate(struct vtballoon_softc *, int); +static void vtballoon_deflate(struct vtballoon_softc *, int); + +static void vtballoon_send_page_frames(struct vtballoon_softc *, + struct virtqueue *, int); + +static void vtballoon_pop(struct vtballoon_softc *); +static void vtballoon_stop(struct vtballoon_softc *); + +static vm_page_t + vtballoon_alloc_page(struct vtballoon_softc *); +static void vtballoon_free_page(struct vtballoon_softc *, vm_page_t); + +static int vtballoon_sleep(struct vtballoon_softc *); +static void vtballoon_thread(void *); +static void vtballoon_add_sysctl(struct vtballoon_softc *); + +/* Features desired/implemented by this driver. */ +#define VTBALLOON_FEATURES 0 + +/* Timeout between retries when the balloon needs inflating. */ +#define VTBALLOON_LOWMEM_TIMEOUT hz + +/* + * Maximum number of pages we'll request to inflate or deflate + * the balloon in one virtqueue request. Both Linux and NetBSD + * have settled on 256, doing up to 1MB at a time. + */ +#define VTBALLOON_PAGES_PER_REQUEST 256 + +#define VTBALLOON_MTX(_sc) &(_sc)->vtballoon_mtx +#define VTBALLOON_LOCK_INIT(_sc, _name) mtx_init(VTBALLOON_MTX((_sc)), _name, \ + "VirtIO Balloon Lock", MTX_SPIN) +#define VTBALLOON_LOCK(_sc) mtx_lock_spin(VTBALLOON_MTX((_sc))) +#define VTBALLOON_UNLOCK(_sc) mtx_unlock_spin(VTBALLOON_MTX((_sc))) +#define VTBALLOON_LOCK_DESTROY(_sc) mtx_destroy(VTBALLOON_MTX((_sc))) + +static device_method_t vtballoon_methods[] = { + /* Device methods. */ + DEVMETHOD(device_probe, vtballoon_probe), + DEVMETHOD(device_attach, vtballoon_attach), + DEVMETHOD(device_detach, vtballoon_detach), + + /* VirtIO methods. */ + DEVMETHOD(virtio_config_change, vtballoon_config_change), + + { 0, 0 } +}; + +static driver_t vtballoon_driver = { + "vtballoon", + vtballoon_methods, + sizeof(struct vtballoon_softc) +}; +static devclass_t vtballoon_devclass; + +DRIVER_MODULE(virtio_balloon, virtio_pci, vtballoon_driver, + vtballoon_devclass, 0, 0); +MODULE_VERSION(virtio_balloon, 1); +MODULE_DEPEND(virtio_balloon, virtio, 1, 1, 1); + +static int +vtballoon_probe(device_t dev) +{ + + if (virtio_get_device_type(dev) != VIRTIO_ID_BALLOON) + return (ENXIO); + + device_set_desc(dev, "VirtIO Balloon Adapter"); + + return (BUS_PROBE_DEFAULT); +} + +static int +vtballoon_attach(device_t dev) +{ + struct vtballoon_softc *sc; + int error; + + sc = device_get_softc(dev); + sc->vtballoon_dev = dev; + + VTBALLOON_LOCK_INIT(sc, device_get_nameunit(dev)); + TAILQ_INIT(&sc->vtballoon_pages); + + vtballoon_add_sysctl(sc); + + virtio_set_feature_desc(dev, vtballoon_feature_desc); + vtballoon_negotiate_features(sc); + + sc->vtballoon_page_frames = malloc(VTBALLOON_PAGES_PER_REQUEST * + sizeof(uint32_t), M_DEVBUF, M_NOWAIT | M_ZERO); + if (sc->vtballoon_page_frames == NULL) { + error = ENOMEM; + device_printf(dev, + "cannot allocate page frame request array\n"); + goto fail; + } + + error = vtballoon_alloc_virtqueues(sc); + if (error) { + device_printf(dev, "cannot allocate virtqueues\n"); + goto fail; + } + + error = virtio_setup_intr(dev, INTR_TYPE_MISC); + if (error) { + device_printf(dev, "cannot setup virtqueue interrupts\n"); + goto fail; + } + + error = kproc_create(vtballoon_thread, sc, &sc->vtballoon_kproc, + 0, 0, "virtio_balloon"); + if (error) { + device_printf(dev, "cannot create balloon kproc\n"); + goto fail; + } + + virtqueue_enable_intr(sc->vtballoon_inflate_vq); + virtqueue_enable_intr(sc->vtballoon_deflate_vq); + +fail: + if (error) + vtballoon_detach(dev); + + return (error); +} + +static int +vtballoon_detach(device_t dev) +{ + struct vtballoon_softc *sc; + + sc = device_get_softc(dev); + + if (sc->vtballoon_kproc != NULL) { + VTBALLOON_LOCK(sc); + sc->vtballoon_flags |= VTBALLOON_FLAG_DETACH; + wakeup_one(sc); + msleep_spin(sc->vtballoon_kproc, VTBALLOON_MTX(sc), + "vtbdth", 0); + VTBALLOON_UNLOCK(sc); + + sc->vtballoon_kproc = NULL; + } + + if (device_is_attached(dev)) { + vtballoon_pop(sc); + vtballoon_stop(sc); + } + + if (sc->vtballoon_page_frames != NULL) { + free(sc->vtballoon_page_frames, M_DEVBUF); + sc->vtballoon_page_frames = NULL; + } + + VTBALLOON_LOCK_DESTROY(sc); + + return (0); +} + +static int +vtballoon_config_change(device_t dev) +{ + struct vtballoon_softc *sc; + + sc = device_get_softc(dev); + + VTBALLOON_LOCK(sc); + wakeup_one(sc); + VTBALLOON_UNLOCK(sc); + + return (1); +} + +static void +vtballoon_negotiate_features(struct vtballoon_softc *sc) +{ + device_t dev; + uint64_t features; + + dev = sc->vtballoon_dev; + features = virtio_negotiate_features(dev, VTBALLOON_FEATURES); + sc->vtballoon_features = features; +} + +static int +vtballoon_alloc_virtqueues(struct vtballoon_softc *sc) +{ + device_t dev; + struct vq_alloc_info vq_info[2]; + int nvqs; + + dev = sc->vtballoon_dev; + nvqs = 2; + + VQ_ALLOC_INFO_INIT(&vq_info[0], 0, vtballoon_vq_intr, sc, + &sc->vtballoon_inflate_vq, "%s inflate", device_get_nameunit(dev)); + + VQ_ALLOC_INFO_INIT(&vq_info[1], 0, vtballoon_vq_intr, sc, + &sc->vtballoon_deflate_vq, "%s deflate", device_get_nameunit(dev)); + + return (virtio_alloc_virtqueues(dev, 0, nvqs, vq_info)); +} + +static int +vtballoon_vq_intr(void *xsc) +{ + struct vtballoon_softc *sc; + + sc = xsc; + + VTBALLOON_LOCK(sc); + wakeup_one(sc); + VTBALLOON_UNLOCK(sc); + + return (1); +} + +static void +vtballoon_inflate(struct vtballoon_softc *sc, int npages) +{ + struct virtqueue *vq; + vm_page_t m; + int i; + + vq = sc->vtballoon_inflate_vq; + m = NULL; + + if (npages > VTBALLOON_PAGES_PER_REQUEST) + npages = VTBALLOON_PAGES_PER_REQUEST; + KASSERT(npages > 0, ("balloon doesn't need inflating?")); + + for (i = 0; i < npages; i++) { + if ((m = vtballoon_alloc_page(sc)) == NULL) + break; + + sc->vtballoon_page_frames[i] = + VM_PAGE_TO_PHYS(m) >> VIRTIO_BALLOON_PFN_SHIFT; + + KASSERT(m->queue == PQ_NONE, ("allocated page on queue")); + TAILQ_INSERT_TAIL(&sc->vtballoon_pages, m, pageq); + } + + if (i > 0) + vtballoon_send_page_frames(sc, vq, i); + + if (m == NULL) + sc->vtballoon_timeout = VTBALLOON_LOWMEM_TIMEOUT; +} + +static void +vtballoon_deflate(struct vtballoon_softc *sc, int npages) +{ + TAILQ_HEAD(, vm_page) free_pages; + struct virtqueue *vq; + vm_page_t m; + int i; + + vq = sc->vtballoon_deflate_vq; + TAILQ_INIT(&free_pages); + + if (npages > VTBALLOON_PAGES_PER_REQUEST) + npages = VTBALLOON_PAGES_PER_REQUEST; + KASSERT(npages > 0, ("balloon doesn't need deflating?")); + + for (i = 0; i < npages; i++) { + m = TAILQ_FIRST(&sc->vtballoon_pages); + KASSERT(m != NULL, ("no more pages to deflate")); + + sc->vtballoon_page_frames[i] = + VM_PAGE_TO_PHYS(m) >> VIRTIO_BALLOON_PFN_SHIFT; + + TAILQ_REMOVE(&sc->vtballoon_pages, m, pageq); + TAILQ_INSERT_TAIL(&free_pages, m, pageq); + } + + if (i > 0) { + /* Always tell host first before freeing the pages. */ + vtballoon_send_page_frames(sc, vq, i); + + while ((m = TAILQ_FIRST(&free_pages)) != NULL) { + TAILQ_REMOVE(&free_pages, m, pageq); + vtballoon_free_page(sc, m); + } + } + + KASSERT((TAILQ_EMPTY(&sc->vtballoon_pages) && + sc->vtballoon_current_npages == 0) || + (!TAILQ_EMPTY(&sc->vtballoon_pages) && + sc->vtballoon_current_npages != 0), ("balloon empty?")); +} + +static void +vtballoon_send_page_frames(struct vtballoon_softc *sc, struct virtqueue *vq, + int npages) +{ + struct sglist sg; + struct sglist_seg segs[1]; + void *c; + int error; + + sglist_init(&sg, 1, segs); + + error = sglist_append(&sg, sc->vtballoon_page_frames, + npages * sizeof(uint32_t)); + KASSERT(error == 0, ("error adding page frames to sglist")); + + error = virtqueue_enqueue(vq, vq, &sg, 1, 0); + KASSERT(error == 0, ("error enqueuing page frames to virtqueue")); + + /* + * Inflate and deflate operations are done synchronously. The + * interrupt handler will wake us up. + */ + VTBALLOON_LOCK(sc); + virtqueue_notify(vq); + + while ((c = virtqueue_dequeue(vq, NULL)) == NULL) + msleep_spin(sc, VTBALLOON_MTX(sc), "vtbspf", 0); + VTBALLOON_UNLOCK(sc); + + KASSERT(c == vq, ("unexpected balloon operation response")); +} + +static void +vtballoon_pop(struct vtballoon_softc *sc) +{ + + while (!TAILQ_EMPTY(&sc->vtballoon_pages)) + vtballoon_deflate(sc, sc->vtballoon_current_npages); +} + +static void +vtballoon_stop(struct vtballoon_softc *sc) +{ + + virtqueue_disable_intr(sc->vtballoon_inflate_vq); + virtqueue_disable_intr(sc->vtballoon_deflate_vq); + + virtio_stop(sc->vtballoon_dev); +} + +static vm_page_t +vtballoon_alloc_page(struct vtballoon_softc *sc) +{ + vm_page_t m; + + m = vm_page_alloc(NULL, 0, VM_ALLOC_NORMAL | VM_ALLOC_WIRED | + VM_ALLOC_NOOBJ); + if (m != NULL) + sc->vtballoon_current_npages++; + + return (m); +} + +static void +vtballoon_free_page(struct vtballoon_softc *sc, vm_page_t m) +{ + + vm_page_unwire(m, 0); + vm_page_free(m); + sc->vtballoon_current_npages--; +} + +static uint32_t +vtballoon_desired_size(struct vtballoon_softc *sc) +{ + uint32_t desired; + + desired = virtio_read_dev_config_4(sc->vtballoon_dev, + offsetof(struct virtio_balloon_config, num_pages)); + + return (le32toh(desired)); +} + +static void +vtballoon_update_size(struct vtballoon_softc *sc) +{ + + virtio_write_dev_config_4(sc->vtballoon_dev, + offsetof(struct virtio_balloon_config, actual), + htole32(sc->vtballoon_current_npages)); + +} + +static int +vtballoon_sleep(struct vtballoon_softc *sc) +{ + int rc, timeout; + uint32_t current, desired; + + rc = 0; + current = sc->vtballoon_current_npages; + + VTBALLOON_LOCK(sc); + for (;;) { + if (sc->vtballoon_flags & VTBALLOON_FLAG_DETACH) { + rc = 1; + break; + } + + desired = vtballoon_desired_size(sc); + sc->vtballoon_desired_npages = desired; + + /* + * If given, use non-zero timeout on the first time through + * the loop. On subsequent times, timeout will be zero so + * we will reevaluate the desired size of the balloon and + * break out to retry if needed. + */ + timeout = sc->vtballoon_timeout; + sc->vtballoon_timeout = 0; + + if (current > desired) + break; + if (current < desired && timeout == 0) + break; + + msleep_spin(sc, VTBALLOON_MTX(sc), "vtbslp", timeout); + } + VTBALLOON_UNLOCK(sc); + + return (rc); +} + +static void +vtballoon_thread(void *xsc) +{ + struct vtballoon_softc *sc; + uint32_t current, desired; + + sc = xsc; + + for (;;) { + if (vtballoon_sleep(sc) != 0) + break; + + current = sc->vtballoon_current_npages; + desired = sc->vtballoon_desired_npages; + + if (desired != current) { + if (desired > current) + vtballoon_inflate(sc, desired - current); + else + vtballoon_deflate(sc, current - desired); + + vtballoon_update_size(sc); + } + } + + kproc_exit(0); +} + +static void +vtballoon_add_sysctl(struct vtballoon_softc *sc) +{ + device_t dev; + struct sysctl_ctx_list *ctx; + struct sysctl_oid *tree; + struct sysctl_oid_list *child; + + dev = sc->vtballoon_dev; + ctx = device_get_sysctl_ctx(dev); + tree = device_get_sysctl_tree(dev); + child = SYSCTL_CHILDREN(tree); + + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "desired", + CTLFLAG_RD, &sc->vtballoon_desired_npages, sizeof(uint32_t), + "Desired balloon size in pages"); + + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "current", + CTLFLAG_RD, &sc->vtballoon_current_npages, sizeof(uint32_t), + "Current balloon size in pages"); +} Added: head/sys/dev/virtio/balloon/virtio_balloon.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/virtio/balloon/virtio_balloon.h Fri Nov 18 05:43:43 2011 (r227652) @@ -0,0 +1,41 @@ +/* + * This header is BSD licensed so anyone can use the definitions to implement + * compatible drivers/servers. + * + * $FreeBSD$ + */ + +#ifndef _VIRTIO_BALLOON_H +#define _VIRTIO_BALLOON_H + +#include + +/* Feature bits. */ +#define VIRTIO_BALLOON_F_MUST_TELL_HOST 0x1 /* Tell before reclaiming pages */ +#define VIRTIO_BALLOON_F_STATS_VQ 0x2 /* Memory stats virtqueue */ + +/* Size of a PFN in the balloon interface. */ +#define VIRTIO_BALLOON_PFN_SHIFT 12 + +struct virtio_balloon_config { + /* Number of pages host wants Guest to give up. */ + uint32_t num_pages; + + /* Number of pages we've actually got in balloon. */ + uint32_t actual; +}; + +#define VIRTIO_BALLOON_S_SWAP_IN 0 /* Amount of memory swapped in */ +#define VIRTIO_BALLOON_S_SWAP_OUT 1 /* Amount of memory swapped out */ +#define VIRTIO_BALLOON_S_MAJFLT 2 /* Number of major faults */ +#define VIRTIO_BALLOON_S_MINFLT 3 /* Number of minor faults */ +#define VIRTIO_BALLOON_S_MEMFREE 4 /* Total amount of free memory */ +#define VIRTIO_BALLOON_S_MEMTOT 5 /* Total amount of memory */ +#define VIRTIO_BALLOON_S_NR 6 + +struct virtio_balloon_stat { + uint16_t tag; + uint64_t val; +} __packed; + +#endif /* _VIRTIO_BALLOON_H */ Added: head/sys/dev/virtio/block/virtio_blk.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/virtio/block/virtio_blk.c Fri Nov 18 05:43:43 2011 (r227652) @@ -0,0 +1,1149 @@ +/*- + * Copyright (c) 2011, Bryan Venteicher + * 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 unmodified, 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. + */ + +/* Driver for VirtIO block devices. */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Nov 18 08:31:24 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9E1A4106566B; Fri, 18 Nov 2011 08:31:24 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 739B08FC0A; Fri, 18 Nov 2011 08:31:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAI8VOa5060757; Fri, 18 Nov 2011 08:31:24 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAI8VOvI060755; Fri, 18 Nov 2011 08:31:24 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201111180831.pAI8VOvI060755@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 18 Nov 2011 08:31:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227654 - head/sys/dev/usb/controller X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Nov 2011 08:31:24 -0000 Author: hselasky Date: Fri Nov 18 08:31:24 2011 New Revision: 227654 URL: http://svn.freebsd.org/changeset/base/227654 Log: Make some XHCI command timeouts less strict. Reported by: Jan Henrik Sylvester MFC after: 1 week Modified: head/sys/dev/usb/controller/xhci.c Modified: head/sys/dev/usb/controller/xhci.c ============================================================================== --- head/sys/dev/usb/controller/xhci.c Fri Nov 18 06:03:11 2011 (r227653) +++ head/sys/dev/usb/controller/xhci.c Fri Nov 18 08:31:24 2011 (r227654) @@ -1110,7 +1110,7 @@ xhci_cmd_nop(struct xhci_softc *sc) trb.dwTrb3 = htole32(temp); - return (xhci_do_command(sc, &trb, 50 /* ms */)); + return (xhci_do_command(sc, &trb, 100 /* ms */)); } #endif @@ -1127,7 +1127,7 @@ xhci_cmd_enable_slot(struct xhci_softc * trb.dwTrb2 = 0; trb.dwTrb3 = htole32(XHCI_TRB_3_TYPE_SET(XHCI_TRB_TYPE_ENABLE_SLOT)); - err = xhci_do_command(sc, &trb, 50 /* ms */); + err = xhci_do_command(sc, &trb, 100 /* ms */); if (err) goto done; @@ -1154,7 +1154,7 @@ xhci_cmd_disable_slot(struct xhci_softc trb.dwTrb3 = htole32(temp); - return (xhci_do_command(sc, &trb, 50 /* ms */)); + return (xhci_do_command(sc, &trb, 100 /* ms */)); } static usb_error_t @@ -1310,7 +1310,7 @@ xhci_cmd_configure_ep(struct xhci_softc trb.dwTrb3 = htole32(temp); - return (xhci_do_command(sc, &trb, 50 /* ms */)); + return (xhci_do_command(sc, &trb, 100 /* ms */)); } static usb_error_t @@ -1328,7 +1328,7 @@ xhci_cmd_evaluate_ctx(struct xhci_softc XHCI_TRB_3_SLOT_SET(slot_id); trb.dwTrb3 = htole32(temp); - return (xhci_do_command(sc, &trb, 50 /* ms */)); + return (xhci_do_command(sc, &trb, 100 /* ms */)); } static usb_error_t @@ -1351,7 +1351,7 @@ xhci_cmd_reset_ep(struct xhci_softc *sc, trb.dwTrb3 = htole32(temp); - return (xhci_do_command(sc, &trb, 50 /* ms */)); + return (xhci_do_command(sc, &trb, 100 /* ms */)); } static usb_error_t @@ -1373,7 +1373,7 @@ xhci_cmd_set_tr_dequeue_ptr(struct xhci_ XHCI_TRB_3_EP_SET(ep_id); trb.dwTrb3 = htole32(temp); - return (xhci_do_command(sc, &trb, 50 /* ms */)); + return (xhci_do_command(sc, &trb, 100 /* ms */)); } static usb_error_t @@ -1396,7 +1396,7 @@ xhci_cmd_stop_ep(struct xhci_softc *sc, trb.dwTrb3 = htole32(temp); - return (xhci_do_command(sc, &trb, 50 /* ms */)); + return (xhci_do_command(sc, &trb, 100 /* ms */)); } static usb_error_t @@ -1414,7 +1414,7 @@ xhci_cmd_reset_dev(struct xhci_softc *sc trb.dwTrb3 = htole32(temp); - return (xhci_do_command(sc, &trb, 50 /* ms */)); + return (xhci_do_command(sc, &trb, 100 /* ms */)); } /*------------------------------------------------------------------------* From owner-svn-src-all@FreeBSD.ORG Fri Nov 18 09:01:08 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DEEFA106564A; Fri, 18 Nov 2011 09:01:08 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CE17D8FC0C; Fri, 18 Nov 2011 09:01:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAI918GX062227; Fri, 18 Nov 2011 09:01:08 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAI918l8062225; Fri, 18 Nov 2011 09:01:08 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201111180901.pAI918l8062225@svn.freebsd.org> From: Michael Tuexen Date: Fri, 18 Nov 2011 09:01:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227655 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Nov 2011 09:01:09 -0000 Author: tuexen Date: Fri Nov 18 09:01:08 2011 New Revision: 227655 URL: http://svn.freebsd.org/changeset/base/227655 Log: Cleanup comparison of interface names. MFC after: 1 month. Modified: head/sys/netinet/sctp_pcb.c Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Fri Nov 18 08:31:24 2011 (r227654) +++ head/sys/netinet/sctp_pcb.c Fri Nov 18 09:01:08 2011 (r227655) @@ -331,19 +331,9 @@ sctp_mark_ifa_addr_down(uint32_t vrf_id, goto out; } if (if_name) { - int len1, len2; - - len1 = strlen(if_name); - len2 = strlen(sctp_ifap->ifn_p->ifn_name); - if (len1 != len2) { - SCTPDBG(SCTP_DEBUG_PCB4, "IFN of ifa names different length %d vs %d - ignored\n", - len1, len2); - goto out; - } - if (strncmp(if_name, sctp_ifap->ifn_p->ifn_name, len1) != 0) { + if (strncmp(if_name, sctp_ifap->ifn_p->ifn_name, SCTP_IFNAMSIZ) != 0) { SCTPDBG(SCTP_DEBUG_PCB4, "IFN %s of IFA not the same as %s\n", - sctp_ifap->ifn_p->ifn_name, - if_name); + sctp_ifap->ifn_p->ifn_name, if_name); goto out; } } else { @@ -384,19 +374,9 @@ sctp_mark_ifa_addr_up(uint32_t vrf_id, s goto out; } if (if_name) { - int len1, len2; - - len1 = strlen(if_name); - len2 = strlen(sctp_ifap->ifn_p->ifn_name); - if (len1 != len2) { - SCTPDBG(SCTP_DEBUG_PCB4, "IFN of ifa names different length %d vs %d - ignored\n", - len1, len2); - goto out; - } - if (strncmp(if_name, sctp_ifap->ifn_p->ifn_name, len1) != 0) { + if (strncmp(if_name, sctp_ifap->ifn_p->ifn_name, SCTP_IFNAMSIZ) != 0) { SCTPDBG(SCTP_DEBUG_PCB4, "IFN %s of IFA not the same as %s\n", - sctp_ifap->ifn_p->ifn_name, - if_name); + sctp_ifap->ifn_p->ifn_name, if_name); goto out; } } else { From owner-svn-src-all@FreeBSD.ORG Fri Nov 18 09:05:26 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 15BBD106564A; Fri, 18 Nov 2011 09:05:26 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 057C58FC15; Fri, 18 Nov 2011 09:05:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAI95PvT062482; Fri, 18 Nov 2011 09:05:25 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAI95PC9062480; Fri, 18 Nov 2011 09:05:25 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201111180905.pAI95PC9062480@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 18 Nov 2011 09:05:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227656 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Nov 2011 09:05:26 -0000 Author: kib Date: Fri Nov 18 09:05:25 2011 New Revision: 227656 URL: http://svn.freebsd.org/changeset/base/227656 Log: Use the alternate form of the gcc extension that works even with -ansi -pedantic without issuing a warning, and which is recommended by gcc manual. MFC after: 1 week Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Fri Nov 18 09:01:08 2011 (r227655) +++ head/sys/sys/param.h Fri Nov 18 09:05:25 2011 (r227656) @@ -324,6 +324,6 @@ __END_DECLS * Access a variable length array that has been declared as a fixed * length array. */ -#define __PAST_END(array, offset) (((typeof(*(array)) *)(array))[offset]) +#define __PAST_END(array, offset) (((__typeof__(*(array)) *)(array))[offset]) #endif /* _SYS_PARAM_H_ */ From owner-svn-src-all@FreeBSD.ORG Fri Nov 18 09:12:27 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 54A48106567C; Fri, 18 Nov 2011 09:12:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DCF1C8FC18; Fri, 18 Nov 2011 09:12:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAI9CQsx062876; Fri, 18 Nov 2011 09:12:26 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAI9CQ8V062873; Fri, 18 Nov 2011 09:12:26 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201111180912.pAI9CQ8V062873@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 18 Nov 2011 09:12:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227657 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Nov 2011 09:12:27 -0000 Author: kib Date: Fri Nov 18 09:12:26 2011 New Revision: 227657 URL: http://svn.freebsd.org/changeset/base/227657 Log: Consistently use process spin lock for protection of the p->p_boundary_count. Race could cause the execve(2) from the threaded process to hung since thread boundary counter was incorrect and single-threading never finished. Reported by: pluknet, pho Tested by: pho MFC after: 1 week Modified: head/sys/kern/kern_thread.c head/sys/sys/proc.h Modified: head/sys/kern/kern_thread.c ============================================================================== --- head/sys/kern/kern_thread.c Fri Nov 18 09:05:25 2011 (r227656) +++ head/sys/kern/kern_thread.c Fri Nov 18 09:12:26 2011 (r227657) @@ -566,6 +566,8 @@ calc_remaining(struct proc *p, int mode) { int remaining; + PROC_LOCK_ASSERT(p, MA_OWNED); + PROC_SLOCK_ASSERT(p, MA_OWNED); if (mode == SINGLE_EXIT) remaining = p->p_numthreads; else if (mode == SINGLE_BOUNDARY) @@ -819,8 +821,11 @@ thread_suspend_check(int return_instead) td->td_flags &= ~TDF_BOUNDARY; thread_unlock(td); PROC_LOCK(p); - if (return_instead == 0) + if (return_instead == 0) { + PROC_SLOCK(p); p->p_boundary_count--; + PROC_SUNLOCK(p); + } } return (0); } Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Fri Nov 18 09:05:25 2011 (r227656) +++ head/sys/sys/proc.h Fri Nov 18 09:12:26 2011 (r227657) @@ -532,7 +532,7 @@ struct proc { struct thread *p_singlethread;/* (c + j) If single threading this is it */ int p_suspcount; /* (j) Num threads in suspended mode. */ struct thread *p_xthread; /* (c) Trap thread */ - int p_boundary_count;/* (c) Num threads at user boundary */ + int p_boundary_count;/* (j) Num threads at user boundary */ int p_pendingcnt; /* how many signals are pending */ struct itimers *p_itimers; /* (c) POSIX interval timers. */ struct procdesc *p_procdesc; /* (e) Process descriptor, if any. */ From owner-svn-src-all@FreeBSD.ORG Fri Nov 18 09:30:25 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 463F51065686; Fri, 18 Nov 2011 09:30:25 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1BFA58FC13; Fri, 18 Nov 2011 09:30:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAI9UPJh063727; Fri, 18 Nov 2011 09:30:25 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAI9UO0K063723; Fri, 18 Nov 2011 09:30:24 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201111180930.pAI9UO0K063723@svn.freebsd.org> From: "Jayachandran C." Date: Fri, 18 Nov 2011 09:30:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227658 - head/sys/mips/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Nov 2011 09:30:25 -0000 Author: jchandra Date: Fri Nov 18 09:30:24 2011 New Revision: 227658 URL: http://svn.freebsd.org/changeset/base/227658 Log: Fix COP0 hazards for XLR and XLP The XLR CPUs do not have any software visible hazards for COP0 operations. On XLP the hazard is a ehb, since it is mips64r2. Modified: head/sys/mips/include/asm.h head/sys/mips/include/cpufunc.h head/sys/mips/include/cpuregs.h Modified: head/sys/mips/include/asm.h ============================================================================== --- head/sys/mips/include/asm.h Fri Nov 18 09:12:26 2011 (r227657) +++ head/sys/mips/include/asm.h Fri Nov 18 09:30:24 2011 (r227658) @@ -855,6 +855,15 @@ _C_LABEL(x): * For more info on CP0 hazards see Chapter 7 (p.99) of "MIPS32 Architecture * For Programmers Volume III: The MIPS32 Privileged Resource Architecture" */ +#if defined(CPU_NLM) +#define HAZARD_DELAY sll $0,3 +#define ITLBNOPFIX sll $0,3 +#elif defined(CPU_RMI) +#define HAZARD_DELAY +#define ITLBNOPFIX +#else #define ITLBNOPFIX nop;nop;nop;nop;nop;nop;nop;nop;nop;nop; #define HAZARD_DELAY nop;nop;nop;nop;nop; +#endif + #endif /* !_MACHINE_ASM_H_ */ Modified: head/sys/mips/include/cpufunc.h ============================================================================== --- head/sys/mips/include/cpufunc.h Fri Nov 18 09:12:26 2011 (r227657) +++ head/sys/mips/include/cpufunc.h Fri Nov 18 09:30:24 2011 (r227658) @@ -69,7 +69,7 @@ static __inline void mips_barrier(void) { -#ifdef CPU_CNMIPS +#if defined(CPU_CNMIPS) || defined(CPU_RMI) || defined(CPU_NLM) __asm __volatile("" : : : "memory"); #else __asm __volatile (".set noreorder\n\t" Modified: head/sys/mips/include/cpuregs.h ============================================================================== --- head/sys/mips/include/cpuregs.h Fri Nov 18 09:12:26 2011 (r227657) +++ head/sys/mips/include/cpuregs.h Fri Nov 18 09:30:24 2011 (r227658) @@ -200,6 +200,8 @@ /* CPU dependent mtc0 hazard hook */ #if defined(CPU_CNMIPS) || defined(CPU_RMI) #define COP0_SYNC +#elif defined(CPU_NLM) +#define COP0_SYNC .word 0xc0 /* ehb */ #elif defined(CPU_SB1) #define COP0_SYNC ssnop; ssnop; ssnop; ssnop; ssnop; ssnop; ssnop; ssnop; ssnop #else From owner-svn-src-all@FreeBSD.ORG Fri Nov 18 09:55:47 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F29E106566C; Fri, 18 Nov 2011 09:55:47 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6EC648FC0A; Fri, 18 Nov 2011 09:55:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAI9tlFe064987; Fri, 18 Nov 2011 09:55:47 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAI9tlTb064985; Fri, 18 Nov 2011 09:55:47 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201111180955.pAI9tlTb064985@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 18 Nov 2011 09:55:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227660 - head/libexec/rtld-elf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Nov 2011 09:55:47 -0000 Author: kib Date: Fri Nov 18 09:55:47 2011 New Revision: 227660 URL: http://svn.freebsd.org/changeset/base/227660 Log: Fix fd leak. Reported by: slonoman2011 yandex ru MFC after: 1 week Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Fri Nov 18 09:54:14 2011 (r227659) +++ head/libexec/rtld-elf/rtld.c Fri Nov 18 09:55:47 2011 (r227660) @@ -1657,6 +1657,7 @@ load_object(const char *name, const Obj_ } if (flags & RTLD_LO_NOLOAD) { free(path); + close(fd); return (NULL); } From owner-svn-src-all@FreeBSD.ORG Fri Nov 18 09:56:40 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C52131065679; Fri, 18 Nov 2011 09:56:40 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 619658FC0A; Fri, 18 Nov 2011 09:56:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAI9uebJ065066; Fri, 18 Nov 2011 09:56:40 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAI9ueUs065064; Fri, 18 Nov 2011 09:56:40 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201111180956.pAI9ueUs065064@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 18 Nov 2011 09:56:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227661 - head/lib/librt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Nov 2011 09:56:40 -0000 Author: kib Date: Fri Nov 18 09:56:40 2011 New Revision: 227661 URL: http://svn.freebsd.org/changeset/base/227661 Log: Free unused allocation on error. Reported by: slonoman2011 yandex ru MFC after: 1 week Modified: head/lib/librt/timer.c Modified: head/lib/librt/timer.c ============================================================================== --- head/lib/librt/timer.c Fri Nov 18 09:55:47 2011 (r227660) +++ head/lib/librt/timer.c Fri Nov 18 09:56:40 2011 (r227661) @@ -102,12 +102,14 @@ __timer_create(clockid_t clockid, struct } if (__sigev_check_init()) { + free(timer); errno = EINVAL; return (-1); } sn = __sigev_alloc(SI_TIMER, evp, NULL, 0); if (sn == NULL) { + free(timer); errno = EAGAIN; return (-1); } From owner-svn-src-all@FreeBSD.ORG Fri Nov 18 11:10:15 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4EB8B1065677; Fri, 18 Nov 2011 11:10:15 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3E5558FC15; Fri, 18 Nov 2011 11:10:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAIBAFVp070399; Fri, 18 Nov 2011 11:10:15 GMT (envelope-from philip@svn.freebsd.org) Received: (from philip@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAIBAFoY070397; Fri, 18 Nov 2011 11:10:15 GMT (envelope-from philip@svn.freebsd.org) Message-Id: <201111181110.pAIBAFoY070397@svn.freebsd.org> From: Philip Paeps Date: Fri, 18 Nov 2011 11:10:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227662 - head/sys/modules X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Nov 2011 11:10:15 -0000 Author: philip Date: Fri Nov 18 11:10:14 2011 New Revision: 227662 URL: http://svn.freebsd.org/changeset/base/227662 Log: Limit building sfxge(4) to amd64 only to unbreak the tinderboxen. The driver should also work on (at least) i386 but hasn't been built/tested for a while. MFC after: 3 weeks Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Fri Nov 18 09:56:40 2011 (r227661) +++ head/sys/modules/Makefile Fri Nov 18 11:10:14 2011 (r227662) @@ -275,7 +275,7 @@ SUBDIR= ${_3dfx} \ sem \ send \ sf \ - sfxge \ + ${_sfxge} \ sge \ siba_bwn \ siftr \ @@ -630,6 +630,7 @@ _rdma= rdma _s3= s3 _safe= safe _scsi_low= scsi_low +_sfxge= sfxge _smbfs= smbfs _sound= sound _speaker= speaker From owner-svn-src-all@FreeBSD.ORG Fri Nov 18 11:19:00 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 21C371065672; Fri, 18 Nov 2011 11:19:00 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 106118FC08; Fri, 18 Nov 2011 11:19:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAIBIxux070848; Fri, 18 Nov 2011 11:18:59 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAIBIxgo070842; Fri, 18 Nov 2011 11:18:59 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201111181118.pAIBIxgo070842@svn.freebsd.org> From: "Jayachandran C." Date: Fri, 18 Nov 2011 11:18:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227663 - in head/sys/mips: conf nlm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Nov 2011 11:19:00 -0000 Author: jchandra Date: Fri Nov 18 11:18:59 2011 New Revision: 227663 URL: http://svn.freebsd.org/changeset/base/227663 Log: Rearrange XLP configuration files. Create std.XLP for configuration options, which is included by the conf files. The files XLP, XLPN32 and XLP64 will have mostly ABI related options. Also move uart and pci to mips/nlm/std.xlp since all XLP configurations needs these devices. Obtained from: prabhath at netlogicmicro com (intial version) Added: head/sys/mips/conf/std.XLP (contents, props changed) Modified: head/sys/mips/conf/XLP head/sys/mips/conf/XLP64 head/sys/mips/conf/XLPN32 head/sys/mips/nlm/std.xlp Modified: head/sys/mips/conf/XLP ============================================================================== --- head/sys/mips/conf/XLP Fri Nov 18 11:10:14 2011 (r227662) +++ head/sys/mips/conf/XLP Fri Nov 18 11:18:59 2011 (r227663) @@ -23,78 +23,7 @@ ident XLP options ISA_MIPS32 makeoptions KERNLOADADDR=0x80100000 -include "../nlm/std.xlp" -makeoptions MODULES_OVERRIDE="" -makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols -#profile 2 +include "std.XLP" + makeoptions TRAMPLOADADDR=0xffffffff85000000 makeoptions TRAMP_ARCH_FLAGS="-mabi=64 -march=mips64" - -options SCHED_ULE # ULE scheduler -#options VERBOSE_SYSINIT -#options SCHED_4BSD # 4BSD scheduler -options SMP -options PREEMPTION # Enable kernel thread preemption -#options FULL_PREEMPTION # Enable kernel thread preemption -#options MAXCPU=128 # XLP can probe 128 CPUs -options INET # InterNETworking -options INET6 # IPv6 communications protocols -options FFS # Berkeley Fast Filesystem -#options SOFTUPDATES # Enable FFS soft updates support -options UFS_ACL # Support for access control lists -options UFS_DIRHASH # Improve performance on big directories -options NFSCL -options NFS_ROOT -options MSDOSFS #MSDOS Filesystem -# -#options BOOTP -#options BOOTP_NFSROOT -#options BOOTP_NFSV3 -#options BOOTP_WIRED_TO=nlge0 -#options BOOTP_COMPAT -#options ROOTDEVNAME=\"nfs:10.1.1.8:/usr/extra/nfsroot\" -# -options MD_ROOT # MD is a potential root device -options MD_ROOT_SIZE=27000 -options ROOTDEVNAME=\"ufs:md0\" -options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions -options HZ=1000 -options NO_SWAPPING - -#Debugging options -options KTRACE # ktrace(1) support -options DDB -options KDB -options GDB -options BREAK_TO_DEBUGGER -options ALT_BREAK_TO_DEBUGGER -#options DEADLKRES #Enable the deadlock resolver -#options INVARIANTS #Enable calls of extra sanity checking -#options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS -#options WITNESS #Enable checks to detect deadlocks and cycles -#options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed -#options KTR # ktr(4) and ktrdump(8) support -#options KTR_COMPILE=(KTR_LOCK|KTR_PROC|KTR_INTR|KTR_CALLOUT|KTR_UMA|KTR_SYSC) -#options KTR_ENTRIES=131072 -#options LOCK_DEBUG -#options LOCK_PROFILING - - -# Pseudo -device loop -device random -device md -device pty -device bpf - -# UART -device uart -device pci - -# Network -device ether -# -# FDT support -#options FDT -#options FDT_DTB_STATIC -#makeoptions FDT_DTS_FILE=xlp-basic.dts Modified: head/sys/mips/conf/XLP64 ============================================================================== --- head/sys/mips/conf/XLP64 Fri Nov 18 11:10:14 2011 (r227662) +++ head/sys/mips/conf/XLP64 Fri Nov 18 11:18:59 2011 (r227663) @@ -24,79 +24,7 @@ options ISA_MIPS64 makeoptions ARCH_FLAGS="-march=mips64r2 -mabi=64" makeoptions KERNLOADADDR=0xffffffff80100000 -include "../nlm/std.xlp" +include "std.XLP" -makeoptions MODULES_OVERRIDE="" -makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols -#profile 2 makeoptions TRAMPLOADADDR=0xffffffff85000000 makeoptions TRAMP_ARCH_FLAGS="-mabi=64 -march=mips64" - -options SCHED_ULE # ULE scheduler -#options VERBOSE_SYSINIT -#options SCHED_4BSD # 4BSD scheduler -options SMP -options PREEMPTION # Enable kernel thread preemption -#options FULL_PREEMPTION # Enable kernel thread preemption -#options MAXCPU=128 # XLP can probe 128 CPUs -options INET # InterNETworking -options INET6 # IPv6 communications protocols -options FFS # Berkeley Fast Filesystem -#options SOFTUPDATES # Enable FFS soft updates support -options UFS_ACL # Support for access control lists -options UFS_DIRHASH # Improve performance on big directories -options NFSCL -options NFS_ROOT -options MSDOSFS #MSDOS Filesystem -# -#options BOOTP -#options BOOTP_NFSROOT -#options BOOTP_NFSV3 -#options BOOTP_WIRED_TO=nlge0 -#options BOOTP_COMPAT -#options ROOTDEVNAME=\"nfs:10.1.1.8:/usr/extra/nfsroot\" -# -options MD_ROOT # MD is a potential root device -options MD_ROOT_SIZE=27000 -options ROOTDEVNAME=\"ufs:md0\" -options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions -options HZ=1000 -options NO_SWAPPING - -#Debugging options -options KTRACE # ktrace(1) support -options DDB -options KDB -options GDB -options BREAK_TO_DEBUGGER -options ALT_BREAK_TO_DEBUGGER -#options DEADLKRES #Enable the deadlock resolver -#options INVARIANTS #Enable calls of extra sanity checking -#options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS -#options WITNESS #Enable checks to detect deadlocks and cycles -#options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed -#options KTR # ktr(4) and ktrdump(8) support -#options KTR_COMPILE=(KTR_LOCK|KTR_PROC|KTR_INTR|KTR_CALLOUT|KTR_UMA|KTR_SYSC) -#options KTR_ENTRIES=131072 -#options LOCK_DEBUG -#options LOCK_PROFILING - - -# Pseudo -device loop -device random -device md -device pty -device bpf - -# UART -device uart -device pci - -# Network -device ether - -# FDT support -#options FDT -#options FDT_DTB_STATIC -#makeoptions FDT_DTS_FILE=xlp-basic.dts Modified: head/sys/mips/conf/XLPN32 ============================================================================== --- head/sys/mips/conf/XLPN32 Fri Nov 18 11:10:14 2011 (r227662) +++ head/sys/mips/conf/XLPN32 Fri Nov 18 11:18:59 2011 (r227663) @@ -24,73 +24,7 @@ options ISA_MIPS64 makeoptions ARCH_FLAGS="-march=mips64 -mabi=n32" makeoptions KERNLOADADDR=0x80100000 -include "../nlm/std.xlp" -makeoptions MODULES_OVERRIDE="" -makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols -#profile 2 +include "std.XLP" + makeoptions TRAMPLOADADDR=0xffffffff85000000 makeoptions TRAMP_ARCH_FLAGS="-mabi=64 -march=mips64" - -options SCHED_ULE # ULE scheduler -#options VERBOSE_SYSINIT -#options SCHED_4BSD # 4BSD scheduler -options SMP -options PREEMPTION # Enable kernel thread preemption -#options FULL_PREEMPTION # Enable kernel thread preemption -#options MAXCPU=128 # XLP can probe 128 CPUs -options INET # InterNETworking -options INET6 # IPv6 communications protocols -options FFS # Berkeley Fast Filesystem -#options SOFTUPDATES # Enable FFS soft updates support -options UFS_ACL # Support for access control lists -options UFS_DIRHASH # Improve performance on big directories -options NFSCL -options NFS_ROOT -options MSDOSFS #MSDOS Filesystem -# -#options BOOTP -#options BOOTP_NFSROOT -#options BOOTP_NFSV3 -#options BOOTP_WIRED_TO=nlge0 -#options BOOTP_COMPAT -#options ROOTDEVNAME=\"nfs:10.1.1.8:/usr/extra/nfsroot\" -# -options MD_ROOT # MD is a potential root device -options MD_ROOT_SIZE=27000 -options ROOTDEVNAME=\"ufs:md0\" -options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions -options HZ=1000 -options NO_SWAPPING - -#Debugging options -options KTRACE # ktrace(1) support -#options DDB -#options KDB -#options GDB -#options BREAK_TO_DEBUGGER -#options ALT_BREAK_TO_DEBUGGER -#options DEADLKRES #Enable the deadlock resolver -#options INVARIANTS #Enable calls of extra sanity checking -#options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS -#options WITNESS #Enable checks to detect deadlocks and cycles -#options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed -#options KTR # ktr(4) and ktrdump(8) support -#options KTR_COMPILE=(KTR_LOCK|KTR_PROC|KTR_INTR|KTR_CALLOUT|KTR_UMA|KTR_SYSC) -#options KTR_ENTRIES=131072 -#options LOCK_DEBUG -#options LOCK_PROFILING - - -# Pseudo -device loop -device random -device md -device pty -device bpf - -# UART -device uart -device pci - -# Network -device ether Added: head/sys/mips/conf/std.XLP ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/std.XLP Fri Nov 18 11:18:59 2011 (r227663) @@ -0,0 +1,81 @@ +# $FreeBSD$ + +include "../nlm/std.xlp" +makeoptions MODULES_OVERRIDE="" +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols +#profile 2 + +options SCHED_ULE # ULE scheduler +#options VERBOSE_SYSINIT +#options SCHED_4BSD # 4BSD scheduler +options SMP +options PREEMPTION # Enable kernel thread preemption +#options FULL_PREEMPTION # Enable kernel thread preemption +options INET # InterNETworking +options INET6 # IPv6 communications protocols +options FFS # Berkeley Fast Filesystem +#options SOFTUPDATES # Enable FFS soft updates support +options UFS_ACL # Support for access control lists +options UFS_DIRHASH # Improve performance on big directories +options NFSCL +options NFS_ROOT +options MSDOSFS #MSDOS Filesystem +# +#options BOOTP +#options BOOTP_NFSROOT +#options BOOTP_NFSV3 +#options BOOTP_WIRED_TO=nlge0 +#options BOOTP_COMPAT +#options ROOTDEVNAME=\"nfs:10.1.1.8:/usr/extra/nfsroot\" + +options MD_ROOT # MD is a potential root device +options MD_ROOT_SIZE=132000 +options ROOTDEVNAME=\"ufs:md0\" +options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions +options HZ=1000 +options NO_SWAPPING + +# Debugging options +options KTRACE # ktrace(1) support +options DDB +options KDB +options GDB +options BREAK_TO_DEBUGGER +options ALT_BREAK_TO_DEBUGGER +#options DEADLKRES # Enable the deadlock resolver +#options INVARIANTS +#options INVARIANT_SUPPORT +#options WITNESS # Detect deadlocks and cycles +#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed +#options KTR # ktr(4) and ktrdump(8) support +#options KTR_COMPILE=(KTR_LOCK|KTR_PROC|KTR_INTR|KTR_CALLOUT|KTR_UMA|KTR_SYSC) +#options KTR_ENTRIES=131072 +#options LOCK_DEBUG +#options LOCK_PROFILING + +options GEOM_UZIP + +# Pseudo +device loop +device random +device md +device pty +device bpf + +# Network +device miibus +device ether +#device re +device msk +device em + +# Disks +device siis +device da +device scbus +#device ata +#device atadisk + +options FDT +options FDT_DTB_STATIC +makeoptions FDT_DTS_FILE=xlp-basic.dts Modified: head/sys/mips/nlm/std.xlp ============================================================================== --- head/sys/mips/nlm/std.xlp Fri Nov 18 11:10:14 2011 (r227662) +++ head/sys/mips/nlm/std.xlp Fri Nov 18 11:18:59 2011 (r227663) @@ -2,3 +2,6 @@ files "../nlm/files.xlp" cpu CPU_NLM +# Devices needed always +device uart +device pci From owner-svn-src-all@FreeBSD.ORG Fri Nov 18 14:41:48 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84DBE106564A; Fri, 18 Nov 2011 14:41:48 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 731248FC15; Fri, 18 Nov 2011 14:41:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAIEfmPV080258; Fri, 18 Nov 2011 14:41:48 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAIEfm7O080256; Fri, 18 Nov 2011 14:41:48 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <201111181441.pAIEfm7O080256@svn.freebsd.org> From: Fabien Thomas Date: Fri, 18 Nov 2011 14:41:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227664 - stable/9/contrib/gcc/config/arm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Nov 2011 14:41:48 -0000 Author: fabient Date: Fri Nov 18 14:41:48 2011 New Revision: 227664 URL: http://svn.freebsd.org/changeset/base/227664 Log: MFC r227391: Import gcc fix for -fstack-protector that produces segfaulting binaries on arm/armel. Related gcc bug: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35965 Author kindly accepted that all of his patches can be use as GPLv2. PR: 161128 Approved by: re (kib) Modified: stable/9/contrib/gcc/config/arm/arm.c Directory Properties: stable/9/contrib/gcc/ (props changed) Modified: stable/9/contrib/gcc/config/arm/arm.c ============================================================================== --- stable/9/contrib/gcc/config/arm/arm.c Fri Nov 18 11:18:59 2011 (r227663) +++ stable/9/contrib/gcc/config/arm/arm.c Fri Nov 18 14:41:48 2011 (r227664) @@ -3217,7 +3217,8 @@ legitimize_pic_address (rtx orig, enum m gcc_assert (!no_new_pseudos); if (arm_pic_register != INVALID_REGNUM) { - cfun->machine->pic_reg = gen_rtx_REG (Pmode, arm_pic_register); + if (!cfun->machine->pic_reg) + cfun->machine->pic_reg = gen_rtx_REG (Pmode, arm_pic_register); /* Play games to avoid marking the function as needing pic if we are being called as part of the cost-estimation @@ -3229,7 +3230,8 @@ legitimize_pic_address (rtx orig, enum m { rtx seq; - cfun->machine->pic_reg = gen_reg_rtx (Pmode); + if (!cfun->machine->pic_reg) + cfun->machine->pic_reg = gen_reg_rtx (Pmode); /* Play games to avoid marking the function as needing pic if we are being called as part of the cost-estimation From owner-svn-src-all@FreeBSD.ORG Fri Nov 18 14:56:07 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 15ED9106567B; Fri, 18 Nov 2011 14:56:07 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 04F1F8FC08; Fri, 18 Nov 2011 14:56:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAIEu6nH080989; Fri, 18 Nov 2011 14:56:06 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAIEu6VW080987; Fri, 18 Nov 2011 14:56:06 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <201111181456.pAIEu6VW080987@svn.freebsd.org> From: Fabien Thomas Date: Fri, 18 Nov 2011 14:56:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227665 - releng/9.0/contrib/gcc/config/arm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Nov 2011 14:56:07 -0000 Author: fabient Date: Fri Nov 18 14:56:06 2011 New Revision: 227665 URL: http://svn.freebsd.org/changeset/base/227665 Log: MFC r227391: Import gcc fix for -fstack-protector that produces segfaulting binaries on arm/armel. Related gcc bug: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35965 Author kindly accepted that all of his patches can be use as GPLv2. PR: 161128 Approved by: re (kib) Modified: releng/9.0/contrib/gcc/config/arm/arm.c Directory Properties: releng/9.0/contrib/gcc/ (props changed) Modified: releng/9.0/contrib/gcc/config/arm/arm.c ============================================================================== --- releng/9.0/contrib/gcc/config/arm/arm.c Fri Nov 18 14:41:48 2011 (r227664) +++ releng/9.0/contrib/gcc/config/arm/arm.c Fri Nov 18 14:56:06 2011 (r227665) @@ -3217,7 +3217,8 @@ legitimize_pic_address (rtx orig, enum m gcc_assert (!no_new_pseudos); if (arm_pic_register != INVALID_REGNUM) { - cfun->machine->pic_reg = gen_rtx_REG (Pmode, arm_pic_register); + if (!cfun->machine->pic_reg) + cfun->machine->pic_reg = gen_rtx_REG (Pmode, arm_pic_register); /* Play games to avoid marking the function as needing pic if we are being called as part of the cost-estimation @@ -3229,7 +3230,8 @@ legitimize_pic_address (rtx orig, enum m { rtx seq; - cfun->machine->pic_reg = gen_reg_rtx (Pmode); + if (!cfun->machine->pic_reg) + cfun->machine->pic_reg = gen_reg_rtx (Pmode); /* Play games to avoid marking the function as needing pic if we are being called as part of the cost-estimation From owner-svn-src-all@FreeBSD.ORG Fri Nov 18 16:54:23 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C3AF1065670; Fri, 18 Nov 2011 16:54:23 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EEFE38FC16; Fri, 18 Nov 2011 16:54:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAIGsMmq086305; Fri, 18 Nov 2011 16:54:22 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAIGsMei086302; Fri, 18 Nov 2011 16:54:22 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201111181654.pAIGsMei086302@svn.freebsd.org> From: Christian Brueffer Date: Fri, 18 Nov 2011 16:54:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227666 - in head/release/doc: en_US.ISO8859-1/hardware share/misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Nov 2011 16:54:23 -0000 Author: brueffer Date: Fri Nov 18 16:54:22 2011 New Revision: 227666 URL: http://svn.freebsd.org/changeset/base/227666 Log: Add sfxge(4) to the hardware notes. Modified: head/release/doc/en_US.ISO8859-1/hardware/article.sgml head/release/doc/share/misc/dev.archlist.txt Modified: head/release/doc/en_US.ISO8859-1/hardware/article.sgml ============================================================================== --- head/release/doc/en_US.ISO8859-1/hardware/article.sgml Fri Nov 18 14:56:06 2011 (r227665) +++ head/release/doc/en_US.ISO8859-1/hardware/article.sgml Fri Nov 18 16:54:22 2011 (r227666) @@ -962,6 +962,8 @@ &hwlist.sf; + &hwlist.sfxge; + &hwlist.sge; &hwlist.sis; Modified: head/release/doc/share/misc/dev.archlist.txt ============================================================================== --- head/release/doc/share/misc/dev.archlist.txt Fri Nov 18 14:56:06 2011 (r227665) +++ head/release/doc/share/misc/dev.archlist.txt Fri Nov 18 16:54:22 2011 (r227666) @@ -108,6 +108,7 @@ rum i386,amd64 run i386,amd64 safe i386,pc98,amd64 sbp i386,sparc64,ia64,amd64 +sfgxe amd64 sn i386,amd64 snc pc98 snd_ad1816 i386,amd64 From owner-svn-src-all@FreeBSD.ORG Fri Nov 18 19:14:43 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F939106564A; Fri, 18 Nov 2011 19:14:43 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0F9B48FC14; Fri, 18 Nov 2011 19:14:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAIJEgZv092921; Fri, 18 Nov 2011 19:14:42 GMT (envelope-from pho@svn.freebsd.org) Received: (from pho@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAIJEgo1092919; Fri, 18 Nov 2011 19:14:42 GMT (envelope-from pho@svn.freebsd.org) Message-Id: <201111181914.pAIJEgo1092919@svn.freebsd.org> From: Peter Holm Date: Fri, 18 Nov 2011 19:14:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227674 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Nov 2011 19:14:43 -0000 Author: pho Date: Fri Nov 18 19:14:42 2011 New Revision: 227674 URL: http://svn.freebsd.org/changeset/base/227674 Log: Added check for negative seconds value. Found by syscall() fuzzing. MFC after: 1 week Modified: head/sys/kern/kern_thr.c Modified: head/sys/kern/kern_thr.c ============================================================================== --- head/sys/kern/kern_thr.c Fri Nov 18 19:12:12 2011 (r227673) +++ head/sys/kern/kern_thr.c Fri Nov 18 19:14:42 2011 (r227674) @@ -474,7 +474,8 @@ kern_thr_suspend(struct thread *td, stru } if (tsp != NULL) { - if (tsp->tv_nsec < 0 || tsp->tv_nsec > 1000000000) + if (tsp->tv_sec < 0 || tsp->tv_nsec < 0 || + tsp->tv_nsec > 1000000000) return (EINVAL); if (tsp->tv_sec == 0 && tsp->tv_nsec == 0) error = EWOULDBLOCK; From owner-svn-src-all@FreeBSD.ORG Fri Nov 18 19:38:20 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 411E4106566C; Fri, 18 Nov 2011 19:38:20 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 30A2A8FC15; Fri, 18 Nov 2011 19:38:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAIJcKwF093951; Fri, 18 Nov 2011 19:38:20 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAIJcKHN093948; Fri, 18 Nov 2011 19:38:20 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201111181938.pAIJcKHN093948@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 18 Nov 2011 19:38:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227675 - head/sys/dev/dc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Nov 2011 19:38:20 -0000 Author: yongari Date: Fri Nov 18 19:38:19 2011 New Revision: 227675 URL: http://svn.freebsd.org/changeset/base/227675 Log: Partially revert r218788. r218788 removed calling dc_setcfg() for !DC_IS_ADMTEK in dc_miibus_statchg(). This change broke link establishment of Intel 21143 with dcphy(4) where it stuck in "ability detect" state without completing auto-negotiation. Also nuke dc_if_media as it's not actually used. Submitted by: marius Modified: head/sys/dev/dc/if_dc.c head/sys/dev/dc/if_dcreg.h Modified: head/sys/dev/dc/if_dc.c ============================================================================== --- head/sys/dev/dc/if_dc.c Fri Nov 18 19:14:42 2011 (r227674) +++ head/sys/dev/dc/if_dc.c Fri Nov 18 19:38:19 2011 (r227675) @@ -860,12 +860,11 @@ dc_miibus_statchg(device_t dev) return; ifm = &mii->mii_media; - if (DC_IS_DAVICOM(sc) && - IFM_SUBTYPE(ifm->ifm_media) == IFM_HPNA_1) { + if (DC_IS_DAVICOM(sc) && IFM_SUBTYPE(ifm->ifm_media) == IFM_HPNA_1) { dc_setcfg(sc, ifm->ifm_media); - sc->dc_if_media = ifm->ifm_media; return; - } + } else if (!DC_IS_ADMTEK(sc)) + dc_setcfg(sc, mii->mii_media_active); sc->dc_link = 0; if ((mii->mii_media_status & (IFM_ACTIVE | IFM_AVALID)) == @@ -875,17 +874,8 @@ dc_miibus_statchg(device_t dev) case IFM_100_TX: sc->dc_link = 1; break; - default: - break; } } - if (sc->dc_link == 0) - return; - - sc->dc_if_media = mii->mii_media_active; - if (DC_IS_ADMTEK(sc)) - return; - dc_setcfg(sc, mii->mii_media_active); } /* Modified: head/sys/dev/dc/if_dcreg.h ============================================================================== --- head/sys/dev/dc/if_dcreg.h Fri Nov 18 19:14:42 2011 (r227674) +++ head/sys/dev/dc/if_dcreg.h Fri Nov 18 19:38:19 2011 (r227675) @@ -760,7 +760,6 @@ struct dc_softc { int dc_pnic_rx_bug_save; unsigned char *dc_pnic_rx_buf; int dc_if_flags; - int dc_if_media; uint32_t dc_flags; uint32_t dc_txthresh; uint32_t dc_eaddr[2]; From owner-svn-src-all@FreeBSD.ORG Fri Nov 18 20:47:14 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6301C106566C; Fri, 18 Nov 2011 20:47:14 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 51DE18FC19; Fri, 18 Nov 2011 20:47:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAIKlEi9097453; Fri, 18 Nov 2011 20:47:14 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAIKlEIN097451; Fri, 18 Nov 2011 20:47:14 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201111182047.pAIKlEIN097451@svn.freebsd.org> From: Doug Barton Date: Fri, 18 Nov 2011 20:47:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227677 - stable/9/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Nov 2011 20:47:14 -0000 Author: dougb Date: Fri Nov 18 20:47:14 2011 New Revision: 227677 URL: http://svn.freebsd.org/changeset/base/227677 Log: MFC r226863: Fix svnversion for svn 1.7.x by not looking for .svn in ${SYSDIR} (since it no longer exists). Instead, run svnversion if we can find the binary and test that the output looks like a version string. Approved by: re (kib) Modified: stable/9/sys/conf/newvers.sh Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/conf/newvers.sh ============================================================================== --- stable/9/sys/conf/newvers.sh Fri Nov 18 19:43:02 2011 (r227676) +++ stable/9/sys/conf/newvers.sh Fri Nov 18 20:47:14 2011 (r227677) @@ -88,7 +88,7 @@ v=`cat version` u=${USER:-root} d=`pwd` i=`${MAKE:-make} -V KERN_IDENT` for dir in /bin /usr/bin /usr/local/bin; do - if [ -d "${SYSDIR}/.svn" -a -x "${dir}/svnversion" ] ; then + if [ -x "${dir}/svnversion" ] ; then svnversion=${dir}/svnversion break fi @@ -99,8 +99,12 @@ for dir in /bin /usr/bin /usr/local/bin; done if [ -n "$svnversion" ] ; then - echo "$svnversion" - svn=" r`cd ${SYSDIR} && $svnversion`" + echo "$svnversion" + svn=`cd ${SYSDIR} && $svnversion` + case "$svn" in + [0-9]*) svn=" r${svn}" ;; + *) unset svn ;; + esac fi if [ -n "$git_cmd" ] ; then From owner-svn-src-all@FreeBSD.ORG Fri Nov 18 20:51:31 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A07BA106566B; Fri, 18 Nov 2011 20:51:31 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8FE338FC08; Fri, 18 Nov 2011 20:51:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAIKpVWJ097715; Fri, 18 Nov 2011 20:51:31 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAIKpVjR097713; Fri, 18 Nov 2011 20:51:31 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201111182051.pAIKpVjR097713@svn.freebsd.org> From: Doug Barton Date: Fri, 18 Nov 2011 20:51:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227678 - releng/9.0/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Nov 2011 20:51:31 -0000 Author: dougb Date: Fri Nov 18 20:51:31 2011 New Revision: 227678 URL: http://svn.freebsd.org/changeset/base/227678 Log: MFC r226863: Fix svnversion for svn 1.7.x by not looking for .svn in ${SYSDIR} (since it no longer exists). Instead, run svnversion if we can find the binary and test that the output looks like a version string. Approved by: re (kib) Modified: releng/9.0/sys/conf/newvers.sh Directory Properties: releng/9.0/sys/ (props changed) releng/9.0/sys/amd64/include/xen/ (props changed) releng/9.0/sys/boot/ (props changed) releng/9.0/sys/boot/i386/efi/ (props changed) releng/9.0/sys/boot/ia64/efi/ (props changed) releng/9.0/sys/boot/ia64/ski/ (props changed) releng/9.0/sys/boot/powerpc/boot1.chrp/ (props changed) releng/9.0/sys/boot/powerpc/ofw/ (props changed) releng/9.0/sys/cddl/contrib/opensolaris/ (props changed) releng/9.0/sys/conf/ (props changed) releng/9.0/sys/contrib/dev/acpica/ (props changed) releng/9.0/sys/contrib/octeon-sdk/ (props changed) releng/9.0/sys/contrib/pf/ (props changed) releng/9.0/sys/contrib/x86emu/ (props changed) Modified: releng/9.0/sys/conf/newvers.sh ============================================================================== --- releng/9.0/sys/conf/newvers.sh Fri Nov 18 20:47:14 2011 (r227677) +++ releng/9.0/sys/conf/newvers.sh Fri Nov 18 20:51:31 2011 (r227678) @@ -88,7 +88,7 @@ v=`cat version` u=${USER:-root} d=`pwd` i=`${MAKE:-make} -V KERN_IDENT` for dir in /bin /usr/bin /usr/local/bin; do - if [ -d "${SYSDIR}/.svn" -a -x "${dir}/svnversion" ] ; then + if [ -x "${dir}/svnversion" ] ; then svnversion=${dir}/svnversion break fi @@ -99,8 +99,12 @@ for dir in /bin /usr/bin /usr/local/bin; done if [ -n "$svnversion" ] ; then - echo "$svnversion" - svn=" r`cd ${SYSDIR} && $svnversion`" + echo "$svnversion" + svn=`cd ${SYSDIR} && $svnversion` + case "$svn" in + [0-9]*) svn=" r${svn}" ;; + *) unset svn ;; + esac fi if [ -n "$git_cmd" ] ; then From owner-svn-src-all@FreeBSD.ORG Fri Nov 18 21:05:00 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 09B05106567B; Fri, 18 Nov 2011 21:05:00 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EC6DC8FC0C; Fri, 18 Nov 2011 21:04:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAIL4xo6098448; Fri, 18 Nov 2011 21:04:59 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAIL4xXY098446; Fri, 18 Nov 2011 21:04:59 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201111182104.pAIL4xXY098446@svn.freebsd.org> From: Doug Barton Date: Fri, 18 Nov 2011 21:04:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227679 - stable/8/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Nov 2011 21:05:00 -0000 Author: dougb Date: Fri Nov 18 21:04:59 2011 New Revision: 227679 URL: http://svn.freebsd.org/changeset/base/227679 Log: MFC r213077: Simplify how we find the kernel source. MFC r222218: expr -> sh arithmetic expansion MFC r226863: Fix svnversion for svn 1.7.x by not looking for .svn in ${SYSDIR} (since it no longer exists). Instead, run svnversion if we can find the binary and test that the output looks like a version string. Modified: stable/8/sys/conf/newvers.sh Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/conf/newvers.sh ============================================================================== --- stable/8/sys/conf/newvers.sh Fri Nov 18 20:51:31 2011 (r227678) +++ stable/8/sys/conf/newvers.sh Fri Nov 18 21:04:59 2011 (r227679) @@ -38,16 +38,16 @@ if [ "X${BRANCH_OVERRIDE}" != "X" ]; the fi RELEASE="${REVISION}-${BRANCH}" VERSION="${TYPE} ${RELEASE}" +SYSDIR=$(dirname $0)/.. if [ "X${PARAMFILE}" != "X" ]; then RELDATE=$(awk '/__FreeBSD_version.*propagated to newvers/ {print $3}' \ ${PARAMFILE}) else RELDATE=$(awk '/__FreeBSD_version.*propagated to newvers/ {print $3}' \ - $(dirname $0)/../sys/param.h) + ${SYSDIR}/sys/param.h) fi - b=share/examples/etc/bsd-style-copyright year=`date '+%Y'` # look for copyright template @@ -87,51 +87,47 @@ touch version v=`cat version` u=${USER:-root} d=`pwd` h=${HOSTNAME:-`hostname`} t=`date` i=`${MAKE:-make} -V KERN_IDENT` -case "$d" in -*/sys/*) - SRCDIR=${d##*obj} - if [ -n "$MACHINE" ]; then - SRCDIR=${SRCDIR##/$MACHINE} +for dir in /bin /usr/bin /usr/local/bin; do + if [ -x "${dir}/svnversion" ] ; then + svnversion=${dir}/svnversion + break + fi + if [ -d "${SYSDIR}/../.git" -a -x "${dir}/git" ] ; then + git_cmd="${dir}/git --git-dir=${SYSDIR}/../.git" + break fi - SRCDIR=${SRCDIR%%/sys/*} +done - for dir in /bin /usr/bin /usr/local/bin; do - if [ -d "${SRCDIR}/sys/.svn" -a -x "${dir}/svnversion" ] ; then - svnversion=${dir}/svnversion - break - fi - if [ -d "${SRCDIR}/.git" -a -x "${dir}/git" ] ; then - git_cmd="${dir}/git --git-dir=${SRCDIR}/.git" - break - fi - done +if [ -n "$svnversion" ] ; then + echo "$svnversion" + svn=`cd ${SYSDIR} && $svnversion` + case "$svn" in + [0-9]*) svn=" r${svn}" ;; + *) unset svn ;; + esac +fi - if [ -n "$svnversion" ] ; then - svn=" r`cd ${SRCDIR}/sys && $svnversion`" - fi - if [ -n "$git_cmd" ] ; then - git=`$git_cmd rev-parse --verify --short HEAD 2>/dev/null` - svn=`$git_cmd svn find-rev $git 2>/dev/null` - if [ -n "$svn" ] ; then +if [ -n "$git_cmd" ] ; then + git=`$git_cmd rev-parse --verify --short HEAD 2>/dev/null` + svn=`$git_cmd svn find-rev $git 2>/dev/null` + if [ -n "$svn" ] ; then + svn=" r${svn}" + git="=${git}" + else + svn=`$git_cmd log | fgrep 'git-svn-id:' | head -1 | \ + sed -n 's/^.*@\([0-9][0-9]*\).*$/\1/p'` + if [ -n $svn ] ; then svn=" r${svn}" - git="=${git}" + git="+${git}" else - svn=`$git_cmd log | fgrep 'git-svn-id:' | head -1 | \ - sed -n 's/^.*@\([0-9][0-9]*\).*$/\1/p'` - if [ -n $svn ] ; then - svn=" r${svn}" - git="+${git}" - else - git=" ${git}" - fi - fi - if $git_cmd --work-tree=${SRCDIR} diff-index \ - --name-only HEAD | read dummy; then - git="${git}-dirty" + git=" ${git}" fi fi - ;; -esac + if $git_cmd --work-tree=${SYSDIR}/.. diff-index \ + --name-only HEAD | read dummy; then + git="${git}-dirty" + fi +fi cat << EOF > vers.c $COPYRIGHT @@ -147,4 +143,4 @@ int osreldate = ${RELDATE}; char kern_ident[] = "${i}"; EOF -echo `expr ${v} + 1` > version +echo $((v + 1)) > version From owner-svn-src-all@FreeBSD.ORG Fri Nov 18 21:09:03 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CCD811065670; Fri, 18 Nov 2011 21:09:03 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B19DF8FC14; Fri, 18 Nov 2011 21:09:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAIL93Bq098705; Fri, 18 Nov 2011 21:09:03 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAIL93LM098703; Fri, 18 Nov 2011 21:09:03 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201111182109.pAIL93LM098703@svn.freebsd.org> From: Doug Barton Date: Fri, 18 Nov 2011 21:09:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227680 - stable/7/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Nov 2011 21:09:04 -0000 Author: dougb Date: Fri Nov 18 21:09:03 2011 New Revision: 227680 URL: http://svn.freebsd.org/changeset/base/227680 Log: MFC r213077: Simplify how we find the kernel source. MFC r222218: expr -> sh arithmetic expansion MFC r226863: Fix svnversion for svn 1.7.x by not looking for .svn in ${SYSDIR} (since it no longer exists). Instead, run svnversion if we can find the binary and test that the output looks like a version string. Modified: stable/7/sys/conf/newvers.sh Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/conf/newvers.sh ============================================================================== --- stable/7/sys/conf/newvers.sh Fri Nov 18 21:04:59 2011 (r227679) +++ stable/7/sys/conf/newvers.sh Fri Nov 18 21:09:03 2011 (r227680) @@ -38,16 +38,16 @@ if [ "X${BRANCH_OVERRIDE}" != "X" ]; the fi RELEASE="${REVISION}-${BRANCH}" VERSION="${TYPE} ${RELEASE}" +SYSDIR=$(dirname $0)/.. if [ "X${PARAMFILE}" != "X" ]; then RELDATE=$(awk '/__FreeBSD_version.*propagated to newvers/ {print $3}' \ ${PARAMFILE}) else RELDATE=$(awk '/__FreeBSD_version.*propagated to newvers/ {print $3}' \ - $(dirname $0)/../sys/param.h) + ${SYSDIR}/sys/param.h) fi - b=share/examples/etc/bsd-style-copyright year=`date '+%Y'` # look for copyright template @@ -87,51 +87,47 @@ touch version v=`cat version` u=${USER:-root} d=`pwd` h=${HOSTNAME:-`hostname`} t=`date` i=`${MAKE:-make} -V KERN_IDENT` -case "$d" in -*/sys/*) - SRCDIR=${d##*obj} - if [ -n "$MACHINE" ]; then - SRCDIR=${SRCDIR##/$MACHINE} +for dir in /bin /usr/bin /usr/local/bin; do + if [ -x "${dir}/svnversion" ] ; then + svnversion=${dir}/svnversion + break + fi + if [ -d "${SYSDIR}/../.git" -a -x "${dir}/git" ] ; then + git_cmd="${dir}/git --git-dir=${SYSDIR}/../.git" + break fi - SRCDIR=${SRCDIR%%/sys/*} +done - for dir in /bin /usr/bin /usr/local/bin; do - if [ -d "${SRCDIR}/sys/.svn" -a -x "${dir}/svnversion" ] ; then - svnversion=${dir}/svnversion - break - fi - if [ -d "${SRCDIR}/.git" -a -x "${dir}/git" ] ; then - git_cmd="${dir}/git --git-dir=${SRCDIR}/.git" - break - fi - done +if [ -n "$svnversion" ] ; then + echo "$svnversion" + svn=`cd ${SYSDIR} && $svnversion` + case "$svn" in + [0-9]*) svn=" r${svn}" ;; + *) unset svn ;; + esac +fi - if [ -n "$svnversion" ] ; then - svn=" r`cd ${SRCDIR}/sys && $svnversion`" - fi - if [ -n "$git_cmd" ] ; then - git=`$git_cmd rev-parse --verify --short HEAD 2>/dev/null` - svn=`$git_cmd svn find-rev $git 2>/dev/null` - if [ -n "$svn" ] ; then +if [ -n "$git_cmd" ] ; then + git=`$git_cmd rev-parse --verify --short HEAD 2>/dev/null` + svn=`$git_cmd svn find-rev $git 2>/dev/null` + if [ -n "$svn" ] ; then + svn=" r${svn}" + git="=${git}" + else + svn=`$git_cmd log | fgrep 'git-svn-id:' | head -1 | \ + sed -n 's/^.*@\([0-9][0-9]*\).*$/\1/p'` + if [ -n $svn ] ; then svn=" r${svn}" - git="=${git}" + git="+${git}" else - svn=`$git_cmd log | fgrep 'git-svn-id:' | head -1 | \ - sed -n 's/^.*@\([0-9][0-9]*\).*$/\1/p'` - if [ -n $svn ] ; then - svn=" r${svn}" - git="+${git}" - else - git=" ${git}" - fi - fi - if $git_cmd --work-tree=${SRCDIR} diff-index \ - --name-only HEAD | read dummy; then - git="${git}-dirty" + git=" ${git}" fi fi - ;; -esac + if $git_cmd --work-tree=${SYSDIR}/.. diff-index \ + --name-only HEAD | read dummy; then + git="${git}-dirty" + fi +fi cat << EOF > vers.c $COPYRIGHT @@ -147,4 +143,4 @@ int osreldate = ${RELDATE}; char kern_ident[] = "${i}"; EOF -echo `expr ${v} + 1` > version +echo $((v + 1)) > version From owner-svn-src-all@FreeBSD.ORG Fri Nov 18 21:10:13 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 74095106567A; Fri, 18 Nov 2011 21:10:13 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 62D668FC16; Fri, 18 Nov 2011 21:10:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAILADaj098807; Fri, 18 Nov 2011 21:10:13 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAILADoc098805; Fri, 18 Nov 2011 21:10:13 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201111182110.pAILADoc098805@svn.freebsd.org> From: Doug Barton Date: Fri, 18 Nov 2011 21:10:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227681 - stable/9/lib/libc/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Nov 2011 21:10:13 -0000 Author: dougb Date: Fri Nov 18 21:10:13 2011 New Revision: 227681 URL: http://svn.freebsd.org/changeset/base/227681 Log: MFC r227416: Document that flock can return ENOLCK Approved by: re (kib) Modified: stable/9/lib/libc/sys/flock.2 Directory Properties: stable/9/lib/libc/ (props changed) stable/9/lib/libc/stdtime/ (props changed) Modified: stable/9/lib/libc/sys/flock.2 ============================================================================== --- stable/9/lib/libc/sys/flock.2 Fri Nov 18 21:09:03 2011 (r227680) +++ stable/9/lib/libc/sys/flock.2 Fri Nov 18 21:10:13 2011 (r227681) @@ -28,7 +28,7 @@ .\" @(#)flock.2 8.2 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd January 22, 2008 +.Dd November 9, 2011 .Dt FLOCK 2 .Os .Sh NAME @@ -154,6 +154,8 @@ refers to an object other than a file. The argument .Fa fd refers to an object that does not support file locking. +.It Bq Er ENOLCK +A lock was requested, but no locks are available. .El .Sh SEE ALSO .Xr close 2 , From owner-svn-src-all@FreeBSD.ORG Fri Nov 18 21:12:06 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F2B551065678; Fri, 18 Nov 2011 21:12:05 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E21538FC08; Fri, 18 Nov 2011 21:12:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAILC5uc098969; Fri, 18 Nov 2011 21:12:05 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAILC5PQ098967; Fri, 18 Nov 2011 21:12:05 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201111182112.pAILC5PQ098967@svn.freebsd.org> From: Doug Barton Date: Fri, 18 Nov 2011 21:12:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227682 - releng/9.0/lib/libc/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Nov 2011 21:12:06 -0000 Author: dougb Date: Fri Nov 18 21:12:05 2011 New Revision: 227682 URL: http://svn.freebsd.org/changeset/base/227682 Log: MFC r227416: Document that flock can return ENOLCK Approved by: re (kib) Modified: releng/9.0/lib/libc/sys/flock.2 Directory Properties: releng/9.0/lib/libc/ (props changed) releng/9.0/lib/libc/stdtime/ (props changed) Modified: releng/9.0/lib/libc/sys/flock.2 ============================================================================== --- releng/9.0/lib/libc/sys/flock.2 Fri Nov 18 21:10:13 2011 (r227681) +++ releng/9.0/lib/libc/sys/flock.2 Fri Nov 18 21:12:05 2011 (r227682) @@ -28,7 +28,7 @@ .\" @(#)flock.2 8.2 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd January 22, 2008 +.Dd November 9, 2011 .Dt FLOCK 2 .Os .Sh NAME @@ -154,6 +154,8 @@ refers to an object other than a file. The argument .Fa fd refers to an object that does not support file locking. +.It Bq Er ENOLCK +A lock was requested, but no locks are available. .El .Sh SEE ALSO .Xr close 2 , From owner-svn-src-all@FreeBSD.ORG Fri Nov 18 21:12:59 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E74D1065675; Fri, 18 Nov 2011 21:12:59 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3D5808FC0A; Fri, 18 Nov 2011 21:12:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAILCxcr099049; Fri, 18 Nov 2011 21:12:59 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAILCxGl099047; Fri, 18 Nov 2011 21:12:59 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201111182112.pAILCxGl099047@svn.freebsd.org> From: Doug Barton Date: Fri, 18 Nov 2011 21:12:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227683 - stable/8/lib/libc/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Nov 2011 21:12:59 -0000 Author: dougb Date: Fri Nov 18 21:12:58 2011 New Revision: 227683 URL: http://svn.freebsd.org/changeset/base/227683 Log: MFC r227416: Document that flock can return ENOLCK Modified: stable/8/lib/libc/sys/flock.2 Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) Modified: stable/8/lib/libc/sys/flock.2 ============================================================================== --- stable/8/lib/libc/sys/flock.2 Fri Nov 18 21:12:05 2011 (r227682) +++ stable/8/lib/libc/sys/flock.2 Fri Nov 18 21:12:58 2011 (r227683) @@ -28,7 +28,7 @@ .\" @(#)flock.2 8.2 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd January 22, 2008 +.Dd November 9, 2011 .Dt FLOCK 2 .Os .Sh NAME @@ -154,6 +154,8 @@ refers to an object other than a file. The argument .Fa fd refers to an object that does not support file locking. +.It Bq Er ENOLCK +A lock was requested, but no locks are available. .El .Sh SEE ALSO .Xr close 2 , From owner-svn-src-all@FreeBSD.ORG Fri Nov 18 21:13:43 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A2031106564A; Fri, 18 Nov 2011 21:13:43 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 90ECC8FC0C; Fri, 18 Nov 2011 21:13:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAILDhCo099127; Fri, 18 Nov 2011 21:13:43 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAILDhLl099125; Fri, 18 Nov 2011 21:13:43 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201111182113.pAILDhLl099125@svn.freebsd.org> From: Doug Barton Date: Fri, 18 Nov 2011 21:13:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227684 - stable/7/lib/libc/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Nov 2011 21:13:43 -0000 Author: dougb Date: Fri Nov 18 21:13:43 2011 New Revision: 227684 URL: http://svn.freebsd.org/changeset/base/227684 Log: MFC r227416: Document that flock can return ENOLCK Modified: stable/7/lib/libc/sys/flock.2 Directory Properties: stable/7/lib/libc/ (props changed) stable/7/lib/libc/stdtime/ (props changed) Modified: stable/7/lib/libc/sys/flock.2 ============================================================================== --- stable/7/lib/libc/sys/flock.2 Fri Nov 18 21:12:58 2011 (r227683) +++ stable/7/lib/libc/sys/flock.2 Fri Nov 18 21:13:43 2011 (r227684) @@ -28,7 +28,7 @@ .\" @(#)flock.2 8.2 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd January 22, 2008 +.Dd November 9, 2011 .Dt FLOCK 2 .Os .Sh NAME @@ -154,6 +154,8 @@ refers to an object other than a file. The argument .Fa fd refers to an object that does not support file locking. +.It Bq Er ENOLCK +A lock was requested, but no locks are available. .El .Sh SEE ALSO .Xr close 2 , From owner-svn-src-all@FreeBSD.ORG Fri Nov 18 21:22:43 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA643106564A; Fri, 18 Nov 2011 21:22:43 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 907878FC0C; Fri, 18 Nov 2011 21:22:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAILMhx3099597; Fri, 18 Nov 2011 21:22:43 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAILMh3G099595; Fri, 18 Nov 2011 21:22:43 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201111182122.pAILMh3G099595@svn.freebsd.org> From: Marius Strobl Date: Fri, 18 Nov 2011 21:22:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227685 - head/sys/dev/dc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Nov 2011 21:22:43 -0000 Author: marius Date: Fri Nov 18 21:22:43 2011 New Revision: 227685 URL: http://svn.freebsd.org/changeset/base/227685 Log: - There's no need to ignore the return value of mii_attach(9) when attaching dcphy(4) (CID 9283). - In dc_detach(), check whether ifp is NULL as dc_attach() may call the former without ifp being allocated (CID 4288). Found with: Coverity Prevent(tm) Modified: head/sys/dev/dc/if_dc.c Modified: head/sys/dev/dc/if_dc.c ============================================================================== --- head/sys/dev/dc/if_dc.c Fri Nov 18 21:13:43 2011 (r227684) +++ head/sys/dev/dc/if_dc.c Fri Nov 18 21:22:43 2011 (r227685) @@ -2456,9 +2456,6 @@ dc_attach(device_t dev) if (sc->dc_pmode != DC_PMODE_SIA) sc->dc_pmode = DC_PMODE_SYM; sc->dc_flags |= DC_21143_NWAY; - mii_attach(dev, &sc->dc_miibus, ifp, dc_ifmedia_upd, - dc_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, - MII_OFFSET_ANY, 0); /* * For non-MII cards, we need to have the 21143 * drive the LEDs. Except there are some systems @@ -2469,7 +2466,9 @@ dc_attach(device_t dev) if (!(pci_get_subvendor(dev) == 0x1033 && pci_get_subdevice(dev) == 0x8028)) sc->dc_flags |= DC_TULIP_LEDS; - error = 0; + error = mii_attach(dev, &sc->dc_miibus, ifp, dc_ifmedia_upd, + dc_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, + MII_OFFSET_ANY, 0); } if (error) { @@ -2538,7 +2537,7 @@ dc_detach(device_t dev) ifp = sc->dc_ifp; #ifdef DEVICE_POLLING - if (ifp->if_capenable & IFCAP_POLLING) + if (ifp != NULL && ifp->if_capenable & IFCAP_POLLING) ether_poll_deregister(ifp); #endif @@ -2562,7 +2561,7 @@ dc_detach(device_t dev) if (sc->dc_res) bus_release_resource(dev, DC_RES, DC_RID, sc->dc_res); - if (ifp) + if (ifp != NULL) if_free(ifp); dc_dma_free(sc); @@ -2612,7 +2611,6 @@ dc_list_tx_init(struct dc_softc *sc) return (0); } - /* * Initialize the RX descriptors and allocate mbufs for them. Note that * we arrange the descriptors in a closed ring, so that the last descriptor From owner-svn-src-all@FreeBSD.ORG Fri Nov 18 21:23:13 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EDAF3106566B; Fri, 18 Nov 2011 21:23:13 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DD7A68FC19; Fri, 18 Nov 2011 21:23:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAILNDaM099667; Fri, 18 Nov 2011 21:23:13 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAILNDsr099665; Fri, 18 Nov 2011 21:23:13 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201111182123.pAILNDsr099665@svn.freebsd.org> From: Marius Strobl Date: Fri, 18 Nov 2011 21:23:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227686 - head/sys/dev/dc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Nov 2011 21:23:14 -0000 Author: marius Date: Fri Nov 18 21:23:13 2011 New Revision: 227686 URL: http://svn.freebsd.org/changeset/base/227686 Log: There's no need to read DC_10BTSTAT twice in dcphy_status(). Modified: head/sys/dev/dc/dcphy.c Modified: head/sys/dev/dc/dcphy.c ============================================================================== --- head/sys/dev/dc/dcphy.c Fri Nov 18 21:22:43 2011 (r227685) +++ head/sys/dev/dc/dcphy.c Fri Nov 18 21:23:13 2011 (r227686) @@ -294,7 +294,7 @@ static void dcphy_status(struct mii_softc *sc) { struct mii_data *mii = sc->mii_pdata; - int reg, anlpar, tstat = 0; + int anlpar, tstat; struct dc_softc *dc_sc; dc_sc = mii->mii_ifp->if_softc; @@ -305,13 +305,12 @@ dcphy_status(struct mii_softc *sc) if ((mii->mii_ifp->if_flags & IFF_UP) == 0) return; - reg = CSR_READ_4(dc_sc, DC_10BTSTAT); - if (!(reg & DC_TSTAT_LS10) || !(reg & DC_TSTAT_LS100)) + tstat = CSR_READ_4(dc_sc, DC_10BTSTAT); + if (!(tstat & DC_TSTAT_LS10) || !(tstat & DC_TSTAT_LS100)) mii->mii_media_status |= IFM_ACTIVE; if (CSR_READ_4(dc_sc, DC_10BTCTRL) & DC_TCTL_AUTONEGENBL) { /* Erg, still trying, I guess... */ - tstat = CSR_READ_4(dc_sc, DC_10BTSTAT); if ((tstat & DC_TSTAT_ANEGSTAT) != DC_ASTAT_AUTONEGCMP) { if ((DC_IS_MACRONIX(dc_sc) || DC_IS_PNICII(dc_sc)) && (tstat & DC_TSTAT_ANEGSTAT) == DC_ASTAT_DISABLE) @@ -351,9 +350,9 @@ dcphy_status(struct mii_softc *sc) * and hope that the user is clever enough to manually * change the media settings if we're wrong. */ - if (!(reg & DC_TSTAT_LS100)) + if (!(tstat & DC_TSTAT_LS100)) mii->mii_media_active |= IFM_100_TX | IFM_HDX; - else if (!(reg & DC_TSTAT_LS10)) + else if (!(tstat & DC_TSTAT_LS10)) mii->mii_media_active |= IFM_10_T | IFM_HDX; else mii->mii_media_active |= IFM_NONE; From owner-svn-src-all@FreeBSD.ORG Fri Nov 18 22:39:46 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 936BF10656E8; Fri, 18 Nov 2011 22:39:46 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 817C68FC18; Fri, 18 Nov 2011 22:39:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAIMdkrf003349; Fri, 18 Nov 2011 22:39:46 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAIMdkCr003347; Fri, 18 Nov 2011 22:39:46 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201111182239.pAIMdkCr003347@svn.freebsd.org> From: Marius Strobl Date: Fri, 18 Nov 2011 22:39:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227687 - head/sys/dev/mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Nov 2011 22:39:46 -0000 Author: marius Date: Fri Nov 18 22:39:46 2011 New Revision: 227687 URL: http://svn.freebsd.org/changeset/base/227687 Log: - Add a hint.miibus.X.phymask hint, allowing do individually exclude PHY addresses from being probed and attaching something including ukphy(4) to it. This is mainly necessarily for PHY switches that create duplicate or fake PHYs on the bus that can corrupt the PHY state when accessed or simply cause problems when ukphy(4) isolates the additional instances. - Change miibus(4) to be a hinted bus, allowing to add child devices via hints and to set their attach arguments (including for automatically probed PHYs). This is mainly needed for PHY switches that violate IEEE 802.3 and don't even implement the basic register set so we can't probe them automatically. However, the ability to alter the attach arguments for automatically probed PHYs is also useful as for example it allows to test (or tell a user to test) new variant of a PHY with a specific driver by letting an existing driver attach to it via manipulating the IDs without the need to touch the source code or to limit a Gigabit Ethernet PHY to only announce up to Fast Ethernet in order to save energy by limiting the capability mask. Generally, a driver has to be hinted via hint.phydrv.X.at="miibusY" and hint.phydrv.X.phyno="Z" (which already is sufficient to add phydrvX at miibusY at PHY address Z). Then optionally the following attach arguments additionally can be configured: hint.phydrv.X.id1 hint.phydrv.X.id2 hint.phydrv.X.capmask - Some minor cleanup. Reviewed by: adrian, ray Modified: head/sys/dev/mii/mii.c Modified: head/sys/dev/mii/mii.c ============================================================================== --- head/sys/dev/mii/mii.c Fri Nov 18 21:23:13 2011 (r227686) +++ head/sys/dev/mii/mii.c Fri Nov 18 22:39:46 2011 (r227687) @@ -48,7 +48,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include @@ -57,18 +56,17 @@ MODULE_VERSION(miibus, 1); #include "miibus_if.h" -static int miibus_print_child(device_t dev, device_t child); -static int miibus_read_ivar(device_t dev, device_t child, int which, - uintptr_t *result); -static int miibus_child_location_str(device_t bus, device_t child, char *buf, - size_t buflen); -static int miibus_child_pnpinfo_str(device_t bus, device_t child, char *buf, - size_t buflen); -static int miibus_readreg(device_t, int, int); -static int miibus_writereg(device_t, int, int, int); -static void miibus_statchg(device_t); -static void miibus_linkchg(device_t); -static void miibus_mediainit(device_t); +static bus_child_location_str_t miibus_child_location_str; +static bus_child_pnpinfo_str_t miibus_child_pnpinfo_str; +static bus_hinted_child_t miibus_hinted_child; +static bus_print_child_t miibus_print_child; +static bus_read_ivar_t miibus_read_ivar; +static miibus_readreg_t miibus_readreg; +static miibus_statchg_t miibus_statchg; +static miibus_writereg_t miibus_writereg; +static miibus_linkchg_t miibus_linkchg; +static miibus_mediainit_t miibus_mediainit; + static unsigned char mii_bitreverse(unsigned char x); static device_method_t miibus_methods[] = { @@ -84,6 +82,7 @@ static device_method_t miibus_methods[] DEVMETHOD(bus_driver_added, bus_generic_driver_added), DEVMETHOD(bus_child_pnpinfo_str, miibus_child_pnpinfo_str), DEVMETHOD(bus_child_location_str, miibus_child_location_str), + DEVMETHOD(bus_hinted_child, miibus_hinted_child), /* MII interface */ DEVMETHOD(miibus_readreg, miibus_readreg), @@ -107,7 +106,8 @@ struct miibus_ivars { struct ifnet *ifp; ifm_change_cb_t ifmedia_upd; ifm_stat_cb_t ifmedia_sts; - int mii_flags; + u_int mii_flags; + u_int mii_offset; }; int @@ -129,7 +129,6 @@ miibus_attach(device_t dev) int i, nchildren; mii = device_get_softc(dev); - nchildren = 0; if (device_get_children(dev, &children, &nchildren) == 0) { for (i = 0; i < nchildren; i++) { ma = device_get_ivars(children[i]); @@ -201,7 +200,7 @@ miibus_read_ivar(device_t dev, device_t } static int -miibus_child_pnpinfo_str(device_t bus __unused, device_t child, char *buf, +miibus_child_pnpinfo_str(device_t dev __unused, device_t child, char *buf, size_t buflen) { struct mii_attach_args *ma; @@ -214,7 +213,7 @@ miibus_child_pnpinfo_str(device_t bus __ } static int -miibus_child_location_str(device_t bus __unused, device_t child, char *buf, +miibus_child_location_str(device_t dev __unused, device_t child, char *buf, size_t buflen) { struct mii_attach_args *ma; @@ -224,6 +223,60 @@ miibus_child_location_str(device_t bus _ return (0); } +static void +miibus_hinted_child(device_t dev, const char *name, int unit) +{ + struct miibus_ivars *ivars; + struct mii_attach_args *args, *ma; + device_t *children, phy; + int i, nchildren; + u_int val; + + if (resource_int_value(name, unit, "phyno", &val) != 0) + return; + if (device_get_children(dev, &children, &nchildren) != 0) + return; + ma = NULL; + for (i = 0; i < nchildren; i++) { + args = device_get_ivars(children[i]); + if (args->mii_phyno == val) { + ma = args; + break; + } + } + free(children, M_TEMP); + + /* + * Don't add a PHY that was automatically identified by having media + * in its BMSR twice, only allow to alter its attach arguments. + */ + if (ma == NULL) { + ma = malloc(sizeof(struct mii_attach_args), M_DEVBUF, + M_NOWAIT); + if (ma == NULL) + return; + phy = device_add_child(dev, name, unit); + if (phy == NULL) { + free(ma, M_DEVBUF); + return; + } + ivars = device_get_ivars(dev); + ma->mii_phyno = val; + ma->mii_offset = ivars->mii_offset++; + ma->mii_id1 = 0; + ma->mii_id2 = 0; + ma->mii_capmask = BMSR_DEFCAPMASK; + device_set_ivars(phy, ma); + } + + if (resource_int_value(name, unit, "id1", &val) == 0) + ma->mii_id1 = val; + if (resource_int_value(name, unit, "id2", &val) == 0) + ma->mii_id2 = val; + if (resource_int_value(name, unit, "capmask", &val) == 0) + ma->mii_capmask = val; +} + static int miibus_readreg(device_t dev, int phy, int reg) { @@ -307,9 +360,10 @@ mii_attach(device_t dev, device_t *miibu int phyloc, int offloc, int flags) { struct miibus_ivars *ivars; - struct mii_attach_args ma, *args; + struct mii_attach_args *args, ma; device_t *children, phy; - int bmsr, first, i, nchildren, offset, phymax, phymin, rv; + int bmsr, first, i, nchildren, phymax, phymin, rv; + uint32_t phymask; if (phyloc != MII_PHY_ANY && offloc != MII_OFFSET_ANY) { printf("%s: phyloc and offloc specified\n", __func__); @@ -366,27 +420,30 @@ mii_attach(device_t dev, device_t *miibu ma.mii_capmask = capmask; - phy = NULL; - offset = 0; + if (resource_int_value(device_get_name(*miibus), + device_get_unit(*miibus), "phymask", &phymask) != 0) + phymask = 0xffffffff; + + if (device_get_children(*miibus, &children, &nchildren) != 0) { + children = NULL; + nchildren = 0; + } + ivars->mii_offset = 0; for (ma.mii_phyno = phymin; ma.mii_phyno <= phymax; ma.mii_phyno++) { /* * Make sure we haven't already configured a PHY at this * address. This allows mii_attach() to be called * multiple times. */ - if (device_get_children(*miibus, &children, &nchildren) == 0) { - for (i = 0; i < nchildren; i++) { - args = device_get_ivars(children[i]); - if (args->mii_phyno == ma.mii_phyno) { - /* - * Yes, there is already something - * configured at this address. - */ - free(children, M_TEMP); - goto skip; - } + for (i = 0; i < nchildren; i++) { + args = device_get_ivars(children[i]); + if (args->mii_phyno == ma.mii_phyno) { + /* + * Yes, there is already something + * configured at this address. + */ + goto skip; } - free(children, M_TEMP); } /* @@ -405,18 +462,24 @@ mii_attach(device_t dev, device_t *miibu * There is a PHY at this address. If we were given an * `offset' locator, skip this PHY if it doesn't match. */ - if (offloc != MII_OFFSET_ANY && offloc != offset) + if (offloc != MII_OFFSET_ANY && offloc != ivars->mii_offset) goto skip; /* - * Extract the IDs. Braindead PHYs will be handled by + * Skip this PHY if it's not included in the phymask hint. + */ + if ((phymask & (1 << ma.mii_phyno)) == 0) + goto skip; + + /* + * Extract the IDs. Braindead PHYs will be handled by * the `ukphy' driver, as we have no ID information to * match on. */ ma.mii_id1 = MIIBUS_READREG(dev, ma.mii_phyno, MII_PHYIDR1); ma.mii_id2 = MIIBUS_READREG(dev, ma.mii_phyno, MII_PHYIDR2); - ma.mii_offset = offset; + ma.mii_offset = ivars->mii_offset; args = malloc(sizeof(struct mii_attach_args), M_DEVBUF, M_NOWAIT); if (args == NULL) @@ -429,15 +492,24 @@ mii_attach(device_t dev, device_t *miibu } device_set_ivars(phy, args); skip: - offset++; + ivars->mii_offset++; } + free(children, M_TEMP); if (first != 0) { - if (phy == NULL) { + rv = device_probe(*miibus); + if (rv != 0) + goto fail; + bus_enumerate_hinted_children(*miibus); + rv = device_get_children(*miibus, &children, &nchildren); + if (rv != 0) + goto fail; + free(children, M_TEMP); + if (nchildren == 0) { rv = ENXIO; goto fail; } - rv = bus_generic_attach(dev); + rv = device_attach(*miibus); if (rv != 0) goto fail; From owner-svn-src-all@FreeBSD.ORG Fri Nov 18 22:58:14 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A23E106566C; Fri, 18 Nov 2011 22:58:14 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 501188FC15; Fri, 18 Nov 2011 22:58:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAIMwE4d004227; Fri, 18 Nov 2011 22:58:14 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAIMwEtP004224; Fri, 18 Nov 2011 22:58:14 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201111182258.pAIMwEtP004224@svn.freebsd.org> From: Marius Strobl Date: Fri, 18 Nov 2011 22:58:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227688 - head/sys/dev/mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Nov 2011 22:58:14 -0000 Author: marius Date: Fri Nov 18 22:58:13 2011 New Revision: 227688 URL: http://svn.freebsd.org/changeset/base/227688 Log: There's no need export the device interface methods of miibus(4). Modified: head/sys/dev/mii/mii.c head/sys/dev/mii/miivar.h Modified: head/sys/dev/mii/mii.c ============================================================================== --- head/sys/dev/mii/mii.c Fri Nov 18 22:39:46 2011 (r227687) +++ head/sys/dev/mii/mii.c Fri Nov 18 22:58:13 2011 (r227688) @@ -56,10 +56,13 @@ MODULE_VERSION(miibus, 1); #include "miibus_if.h" +static device_attach_t miibus_attach; static bus_child_location_str_t miibus_child_location_str; static bus_child_pnpinfo_str_t miibus_child_pnpinfo_str; +static device_detach_t miibus_detach; static bus_hinted_child_t miibus_hinted_child; static bus_print_child_t miibus_print_child; +static device_probe_t miibus_probe; static bus_read_ivar_t miibus_read_ivar; static miibus_readreg_t miibus_readreg; static miibus_statchg_t miibus_statchg; @@ -110,7 +113,7 @@ struct miibus_ivars { u_int mii_offset; }; -int +static int miibus_probe(device_t dev) { @@ -119,7 +122,7 @@ miibus_probe(device_t dev) return (BUS_PROBE_SPECIFIC); } -int +static int miibus_attach(device_t dev) { struct miibus_ivars *ivars; @@ -151,7 +154,7 @@ miibus_attach(device_t dev) return (bus_generic_attach(dev)); } -int +static int miibus_detach(device_t dev) { struct mii_data *mii; Modified: head/sys/dev/mii/miivar.h ============================================================================== --- head/sys/dev/mii/miivar.h Fri Nov 18 22:39:46 2011 (r227687) +++ head/sys/dev/mii/miivar.h Fri Nov 18 22:58:13 2011 (r227688) @@ -246,10 +246,6 @@ MIIBUS_ACCESSOR(flags, FLAGS, u_int) extern devclass_t miibus_devclass; extern driver_t miibus_driver; -int miibus_probe(device_t); -int miibus_attach(device_t); -int miibus_detach(device_t); - int mii_attach(device_t, device_t *, struct ifnet *, ifm_change_cb_t, ifm_stat_cb_t, int, int, int, int); void mii_down(struct mii_data *); From owner-svn-src-all@FreeBSD.ORG Sat Nov 19 00:20:29 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1A9F9106564A; Sat, 19 Nov 2011 00:20:29 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0A4C28FC08; Sat, 19 Nov 2011 00:20:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAJ0KSfJ007980; Sat, 19 Nov 2011 00:20:28 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAJ0KSMF007978; Sat, 19 Nov 2011 00:20:28 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201111190020.pAJ0KSMF007978@svn.freebsd.org> From: Navdeep Parhar Date: Sat, 19 Nov 2011 00:20:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227689 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Nov 2011 00:20:29 -0000 Author: np Date: Sat Nov 19 00:20:28 2011 New Revision: 227689 URL: http://svn.freebsd.org/changeset/base/227689 Log: Do not increment the parent firmware's reference count when any other firmware image in the module is registered. Instead, do it when the other image is itself referenced. This allows a module with multiple firmware images to be automatically unloaded when none of the firmware images are in use. Discussed with: jhb@ (on -hackers) Modified: head/sys/kern/subr_firmware.c Modified: head/sys/kern/subr_firmware.c ============================================================================== --- head/sys/kern/subr_firmware.c Fri Nov 18 22:58:13 2011 (r227688) +++ head/sys/kern/subr_firmware.c Sat Nov 19 00:20:28 2011 (r227689) @@ -198,10 +198,8 @@ firmware_register(const char *imagename, frp->fw.data = data; frp->fw.datasize = datasize; frp->fw.version = version; - if (parent != NULL) { + if (parent != NULL) frp->parent = PRIV_FW(parent); - frp->parent->refcnt++; - } mtx_unlock(&firmware_mtx); if (bootverbose) printf("firmware: '%s' version %u: %zu bytes loaded at %p\n", @@ -235,8 +233,6 @@ firmware_unregister(const char *imagenam } else { linker_file_t x = fp->file; /* save value */ - if (fp->parent != NULL) /* release parent reference */ - fp->parent->refcnt--; /* * Clear the whole entry with bzero to make sure we * do not forget anything. Then restore 'file' which is @@ -341,6 +337,8 @@ firmware_get(const char *imagename) return NULL; } found: /* common exit point on success */ + if (fp->refcnt == 0 && fp->parent != NULL) + fp->parent->refcnt++; fp->refcnt++; mtx_unlock(&firmware_mtx); return &fp->fw; @@ -363,6 +361,8 @@ firmware_put(const struct firmware *p, i mtx_lock(&firmware_mtx); fp->refcnt--; if (fp->refcnt == 0) { + if (fp->parent != NULL) + fp->parent->refcnt--; if (flags & FIRMWARE_UNLOAD) fp->flags |= FW_UNLOAD; if (fp->file) From owner-svn-src-all@FreeBSD.ORG Sat Nov 19 03:20:15 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A168F106564A; Sat, 19 Nov 2011 03:20:15 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 90BDC8FC08; Sat, 19 Nov 2011 03:20:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAJ3KFig017845; Sat, 19 Nov 2011 03:20:15 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAJ3KFE4017843; Sat, 19 Nov 2011 03:20:15 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201111190320.pAJ3KFE4017843@svn.freebsd.org> From: Rick Macklem Date: Sat, 19 Nov 2011 03:20:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227690 - head/sys/nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Nov 2011 03:20:15 -0000 Author: rmacklem Date: Sat Nov 19 03:20:15 2011 New Revision: 227690 URL: http://svn.freebsd.org/changeset/base/227690 Log: The old NFS client will crash due to the reply being m_freem()'d twice if the server bogusly returns an error with the NFSERR_RETERR bit (bit 31) set. No actual NFS error has this bit set, but it seems that amd will sometimes do this. This patch makes sure the NFSERR_RETERR bit is cleared to avoid a crash. PR: kern/153847 MFC after: 2 weeks Modified: head/sys/nfsclient/nfs_krpc.c Modified: head/sys/nfsclient/nfs_krpc.c ============================================================================== --- head/sys/nfsclient/nfs_krpc.c Sat Nov 19 00:20:28 2011 (r227689) +++ head/sys/nfsclient/nfs_krpc.c Sat Nov 19 03:20:15 2011 (r227690) @@ -540,6 +540,11 @@ tryagain: hz); goto tryagain; } + /* + * Make sure NFSERR_RETERR isn't bogusly set by a server + * such as amd. (No actual NFS error has bit 31 set.) + */ + error &= ~NFSERR_RETERR; /* * If the File Handle was stale, invalidate the lookup From owner-svn-src-all@FreeBSD.ORG Sat Nov 19 05:52:46 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 37D5F106566C; Sat, 19 Nov 2011 05:52:46 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail15.syd.optusnet.com.au (mail15.syd.optusnet.com.au [211.29.132.196]) by mx1.freebsd.org (Postfix) with ESMTP id 8F1BB8FC0A; Sat, 19 Nov 2011 05:52:45 +0000 (UTC) Received: from c211-28-227-231.carlnfd1.nsw.optusnet.com.au (c211-28-227-231.carlnfd1.nsw.optusnet.com.au [211.28.227.231]) by mail15.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id pAJ5qVDY027481 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 19 Nov 2011 16:52:32 +1100 Date: Sat, 19 Nov 2011 16:52:31 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Hans Petter Selasky In-Reply-To: <201111152202.24093.hselasky@c2i.net> Message-ID: <20111119153204.K953@besplex.bde.org> References: <201111152048.pAFKmvNC016452@svn.freebsd.org> <201111152202.24093.hselasky@c2i.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: "svn-src-head@freebsd.org" , mdf@freebsd.org, "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Subject: Re: svn commit: r227541 - head/sys/dev/usb/controller X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Nov 2011 05:52:46 -0000 On Tue, 15 Nov 2011, Hans Petter Selasky wrote: > On Tuesday 15 November 2011 21:54:28 mdf@freebsd.org wrote: >> On Tue, Nov 15, 2011 at 12:48 PM, Hans Petter Selasky >> >> wrote: >>> Log: >>> Some brands of XHCI controllers needs more time to reset. >> >> ... and since there's no guarantee that hz is 1000 or has any >> particular value, most of these seem a bit spurious. hz/N is the usual method of converting timeouts in inverse-seconds to ticks -- hz must be used for correct scaling. (N is the timeout in inverse-seconds, 1/N is the timeout in seconds, and hz/N is the timeout in ticks.) However, N must be reasonably small for this to work, since hz may be 100 or even lower, so when N is 1000 hz/N is 0. This bug is common, so callout_reset(9) and its ancestores have always defended against it by silently converting timeouts of 0 to 1 (tick), but not all code that uses times in ticks does this. usb_pause() does do this. > The delays are a bit loosely defined, hence I think there is no clear > definition what the minimum and maximum delay time is in the XHCI spec. The > delay given just defines the minimum. It is not critical if the delay is > larger, just that there is some kind of timeout. > > I use pause() because that doesn't block if the modules are loaded after boot. > > usb_pause_mtx() has an "if (cold)" check inside. > >> Is there some reason these functions aren't asking for a delay in >> terms of milli- or microseconds, and converting to hz internally? I >> would expect a delay while waiting for hardware to have a wall-clock >> time, not a time relative to hz, which has no predefined range. > > I have some macros that convert from hz to ms internally in the USB stack, > though I see your point that if hz is low, then the specified value derivates > from the real delay time. usb_pause() already does internal conversions back to (micro)seconds in the `cold' case, using slow home made code. In the !cold case, it uses pause(9) which uses tsleep(9), for which a timeout of 0 means infinity. usb_pause() handles sloppy callers by adding 1 itself. % /*------------------------------------------------------------------------* % * usb_pause_mtx - factored out code % * % * This function will delay the code by the passed number of system % * ticks. The passed mutex "mtx" will be dropped while waiting, if % * "mtx" is not NULL. % *------------------------------------------------------------------------*/ % void % usb_pause_mtx(struct mtx *mtx, int _ticks) % { Bogus variable name (1). `ticks' would shadow the global variable `ticks', but we mostly don't worry about shadowing and do it elsewhere for `ticks' itself. _ticks looks like it belongs to the implementation even more than does `ticks', and it only avoids shadowing because the implemenation doesn't us _ticks. % if (mtx != NULL) % mtx_unlock(mtx); % % if (cold) { % /* convert to milliseconds */ % _ticks = (_ticks * 1000) / hz; Bogus variable name (2). _ticks now has nothing to do with ticks. It is a time in milliseconds. % /* convert to microseconds, rounded up */ % _ticks = (_ticks + 1) * 1000; Bogus variable name (3). _ticks now has nothing to do with ticks. It is a time in microseconds. The comment misdescribes the adjustment to make _ticks nonzero. There is no rounding up. Instead, 1000 microseconds is added in a slightly obfuscated way, after previous steps rounded down, so if the rounding down gave 0, the result is 1000. This magic number is now inconsistent with the magic number in callers. There is a kernel global `tick = 1000000 / hz;' which is supposed in be used in such conversions. Using it here and removing the obfuscations and other style bugs, and changing the adjustment to 1 tick to be consistent with the !cold case gives: if (cold) DELAY(((_ticks + 1) * tick); See tvtohz(9) for a more careful conversion that worries about overflows corresponding to overflows in the addition and the multiplication in the above, but for the inverse conversion. hz must divide 1000000 exactly for the initial calculation of `tick' to work. `tick' used to be used for adjtime(2) and may have been changed from its initial value when adjtime() is active. Then the conversion would have tracked virtual real time instead of real time. This is not what is wanted for physical devices, but the slew is so slow that it should cause no problem with physical devices. This probably no longer happens, and it never happened for the cold case. `tick' might also be changed from its initial value to compensate for a large error in the value of `hz' (hz must be integral, so the timing hardware might not be able to get close to it and the error might be as much as 0.5% when hz = 100). I've never seen this used. If it were used, then `tick' would give the correct conversion factor for real time where 10000000/hz wouldn't. % DELAY(_ticks); % % } else { % % /* % * Add one to the number of ticks so that we don't return % * too early! % */ % _ticks++; The comment matches the code in this clause. This code used to almost double the timeout in cases that worked as intended (from 0-1 milliseconds to 1-2 milliseconds with old callers when hz = 1000). Now it has a smaller effect. With my simplification above, 1 tick is added in both clauses, so things can be simplified further by moving the adjustment to the top of the function. % % if (pause("USBWAIT", _ticks)) { % /* ignore */ % } % } % if (mtx != NULL) % mtx_lock(mtx); % } % > For USB compliant operation, the USB stack requires hz to be greater or equal > to 250 hz, to put it like that. Mostly a requirement in USB gadget/device > mode. FreeBSD never guaranteed any particular timeout granularity, but 10 msec can be assumed in practice (since hz = 100 was normal). Callers still have to be careful not to expand timeouts from 0-10 msec to 20-30 msec by themself or lower-level code rounding up and adding 1. Probably devices wanting 4 msec (from hz = 250) sort of work, but have much longer timeouts so they work slowly for polled operations. Bruce From owner-svn-src-all@FreeBSD.ORG Sat Nov 19 06:35:16 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7898A106566B; Sat, 19 Nov 2011 06:35:16 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5D8668FC08; Sat, 19 Nov 2011 06:35:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAJ6ZGOn026937; Sat, 19 Nov 2011 06:35:16 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAJ6ZGMf026926; Sat, 19 Nov 2011 06:35:16 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111190635.pAJ6ZGMf026926@svn.freebsd.org> From: Ed Schouten Date: Sat, 19 Nov 2011 06:35:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227691 - in head/sys: amd64/linux32 compat/freebsd32 compat/linux compat/svr4 i386/ibcs2 i386/linux kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Nov 2011 06:35:16 -0000 Author: ed Date: Sat Nov 19 06:35:15 2011 New Revision: 227691 URL: http://svn.freebsd.org/changeset/base/227691 Log: Improve *access*() parameter name consistency. The current code mixes the use of `flags' and `mode'. This is a bit confusing, since the faccessat() function as a `flag' parameter to store the AT_ flag. Make this less confusing by using the same name as used in the POSIX specification -- `amode'. Modified: head/sys/amd64/linux32/syscalls.master head/sys/compat/freebsd32/syscalls.master head/sys/compat/linux/linux_file.c head/sys/compat/svr4/svr4_fcntl.c head/sys/compat/svr4/syscalls.master head/sys/i386/ibcs2/ibcs2_fcntl.c head/sys/i386/ibcs2/syscalls.master head/sys/i386/linux/syscalls.master head/sys/kern/syscalls.master head/sys/kern/vfs_syscalls.c Modified: head/sys/amd64/linux32/syscalls.master ============================================================================== --- head/sys/amd64/linux32/syscalls.master Sat Nov 19 03:20:15 2011 (r227690) +++ head/sys/amd64/linux32/syscalls.master Sat Nov 19 06:35:15 2011 (r227691) @@ -86,7 +86,7 @@ struct l_utimbuf *times); } 31 AUE_NULL UNIMPL stty 32 AUE_NULL UNIMPL gtty -33 AUE_ACCESS STD { int linux_access(char *path, l_int flags); } +33 AUE_ACCESS STD { int linux_access(char *path, l_int amode); } 34 AUE_NICE STD { int linux_nice(l_int inc); } 35 AUE_NULL UNIMPL ftime 36 AUE_SYNC NOPROTO { int sync(void); } @@ -490,7 +490,7 @@ char *buf, l_int bufsiz); } 306 AUE_FCHMODAT STD { int linux_fchmodat(l_int dfd, const char *filename, \ l_mode_t mode); } -307 AUE_FACCESSAT STD { int linux_faccessat(l_int dfd, const char *filename, l_int mode); } +307 AUE_FACCESSAT STD { int linux_faccessat(l_int dfd, const char *filename, l_int amode); } 308 AUE_NULL STD { int linux_pselect6(void); } 309 AUE_NULL STD { int linux_ppoll(void); } 310 AUE_NULL STD { int linux_unshare(void); } Modified: head/sys/compat/freebsd32/syscalls.master ============================================================================== --- head/sys/compat/freebsd32/syscalls.master Sat Nov 19 03:20:15 2011 (r227690) +++ head/sys/compat/freebsd32/syscalls.master Sat Nov 19 06:35:15 2011 (r227691) @@ -113,7 +113,7 @@ int *alen); } 32 AUE_GETSOCKNAME NOPROTO { int getsockname(int fdes, caddr_t asa, \ int *alen); } -33 AUE_ACCESS NOPROTO { int access(char *path, int flags); } +33 AUE_ACCESS NOPROTO { int access(char *path, int amode); } 34 AUE_CHFLAGS NOPROTO { int chflags(char *path, int flags); } 35 AUE_FCHFLAGS NOPROTO { int fchflags(int fd, int flags); } 36 AUE_SYNC NOPROTO { int sync(void); } @@ -671,7 +671,7 @@ const char *attrname); } 374 AUE_NULL NOPROTO { int __setugid(int flag); } 375 AUE_NULL UNIMPL nfsclnt -376 AUE_EACCESS NOPROTO { int eaccess(char *path, int flags); } +376 AUE_EACCESS NOPROTO { int eaccess(char *path, int amode); } 377 AUE_NULL UNIMPL afs_syscall 378 AUE_NMOUNT STD { int freebsd32_nmount(struct iovec32 *iovp, \ unsigned int iovcnt, int flags); } @@ -911,7 +911,7 @@ u_int32_t id1, u_int32_t id2, \ size_t cpusetsize, \ const cpuset_t *mask); } -489 AUE_FACCESSAT NOPROTO { int faccessat(int fd, char *path, int mode, \ +489 AUE_FACCESSAT NOPROTO { int faccessat(int fd, char *path, int amode, \ int flag); } 490 AUE_FCHMODAT NOPROTO { int fchmodat(int fd, const char *path, \ mode_t mode, int flag); } Modified: head/sys/compat/linux/linux_file.c ============================================================================== --- head/sys/compat/linux/linux_file.c Sat Nov 19 03:20:15 2011 (r227690) +++ head/sys/compat/linux/linux_file.c Sat Nov 19 06:35:15 2011 (r227691) @@ -565,16 +565,16 @@ linux_access(struct thread *td, struct l int error; /* linux convention */ - if (args->flags & ~(F_OK | X_OK | W_OK | R_OK)) + if (args->amode & ~(F_OK | X_OK | W_OK | R_OK)) return (EINVAL); LCONVPATHEXIST(td, args->path, &path); #ifdef DEBUG if (ldebug(access)) - printf(ARGS(access, "%s, %d"), path, args->flags); + printf(ARGS(access, "%s, %d"), path, args->amode); #endif - error = kern_access(td, path, UIO_SYSSPACE, args->flags); + error = kern_access(td, path, UIO_SYSSPACE, args->amode); LFREEPATH(path); return (error); @@ -587,7 +587,7 @@ linux_faccessat(struct thread *td, struc int error, dfd; /* linux convention */ - if (args->mode & ~(F_OK | X_OK | W_OK | R_OK)) + if (args->amode & ~(F_OK | X_OK | W_OK | R_OK)) return (EINVAL); dfd = (args->dfd == LINUX_AT_FDCWD) ? AT_FDCWD : args->dfd; @@ -595,11 +595,11 @@ linux_faccessat(struct thread *td, struc #ifdef DEBUG if (ldebug(access)) - printf(ARGS(access, "%s, %d"), path, args->mode); + printf(ARGS(access, "%s, %d"), path, args->amode); #endif error = kern_accessat(td, dfd, path, UIO_SYSSPACE, 0 /* XXX */, - args->mode); + args->amode); LFREEPATH(path); return (error); Modified: head/sys/compat/svr4/svr4_fcntl.c ============================================================================== --- head/sys/compat/svr4/svr4_fcntl.c Sat Nov 19 03:20:15 2011 (r227690) +++ head/sys/compat/svr4/svr4_fcntl.c Sat Nov 19 06:35:15 2011 (r227691) @@ -488,7 +488,7 @@ svr4_sys_access(td, uap) int error; CHECKALTEXIST(td, uap->path, &newpath); - error = kern_access(td, newpath, UIO_SYSSPACE, uap->flags); + error = kern_access(td, newpath, UIO_SYSSPACE, uap->amode); free(newpath, M_TEMP); return (error); } Modified: head/sys/compat/svr4/syscalls.master ============================================================================== --- head/sys/compat/svr4/syscalls.master Sat Nov 19 03:20:15 2011 (r227690) +++ head/sys/compat/svr4/syscalls.master Sat Nov 19 06:35:15 2011 (r227691) @@ -77,7 +77,7 @@ 31 AUE_NULL UNIMPL stty 32 AUE_NULL UNIMPL gtty 33 AUE_NULL STD { int svr4_sys_access(char *path, \ - int flags); } + int amode); } 34 AUE_NULL STD { int svr4_sys_nice(int prio); } 35 AUE_NULL UNIMPL statfs 36 AUE_NULL NOPROTO { int sync(void); } Modified: head/sys/i386/ibcs2/ibcs2_fcntl.c ============================================================================== --- head/sys/i386/ibcs2/ibcs2_fcntl.c Sat Nov 19 03:20:15 2011 (r227690) +++ head/sys/i386/ibcs2/ibcs2_fcntl.c Sat Nov 19 06:35:15 2011 (r227691) @@ -243,7 +243,7 @@ ibcs2_access(td, uap) int error; CHECKALTEXIST(td, uap->path, &path); - error = kern_access(td, path, UIO_SYSSPACE, uap->flags); + error = kern_access(td, path, UIO_SYSSPACE, uap->amode); free(path, M_TEMP); return (error); } Modified: head/sys/i386/ibcs2/syscalls.master ============================================================================== --- head/sys/i386/ibcs2/syscalls.master Sat Nov 19 03:20:15 2011 (r227690) +++ head/sys/i386/ibcs2/syscalls.master Sat Nov 19 06:35:15 2011 (r227691) @@ -80,7 +80,7 @@ struct ibcs2_utimbuf *buf); } 31 AUE_NULL UNIMPL ibcs2_stty 32 AUE_NULL UNIMPL ibcs2_gtty -33 AUE_ACCESS STD { int ibcs2_access(char *path, int flags); } +33 AUE_ACCESS STD { int ibcs2_access(char *path, int amode); } 34 AUE_NICE STD { int ibcs2_nice(int incr); } 35 AUE_STATFS STD { int ibcs2_statfs(char *path, \ struct ibcs2_statfs *buf, int len, \ Modified: head/sys/i386/linux/syscalls.master ============================================================================== --- head/sys/i386/linux/syscalls.master Sat Nov 19 03:20:15 2011 (r227690) +++ head/sys/i386/linux/syscalls.master Sat Nov 19 06:35:15 2011 (r227691) @@ -86,7 +86,7 @@ struct l_utimbuf *times); } 31 AUE_NULL UNIMPL stty 32 AUE_NULL UNIMPL gtty -33 AUE_ACCESS STD { int linux_access(char *path, l_int flags); } +33 AUE_ACCESS STD { int linux_access(char *path, l_int amode); } 34 AUE_NICE STD { int linux_nice(l_int inc); } 35 AUE_NULL UNIMPL ftime 36 AUE_SYNC NOPROTO { int sync(void); } @@ -500,7 +500,7 @@ char *buf, l_int bufsiz); } 306 AUE_FCHMODAT STD { int linux_fchmodat(l_int dfd, const char *filename, \ l_mode_t mode); } -307 AUE_FACCESSAT STD { int linux_faccessat(l_int dfd, const char *filename, l_int mode); } +307 AUE_FACCESSAT STD { int linux_faccessat(l_int dfd, const char *filename, l_int amode); } 308 AUE_NULL STD { int linux_pselect6(void); } 309 AUE_NULL STD { int linux_ppoll(void); } 310 AUE_NULL STD { int linux_unshare(void); } Modified: head/sys/kern/syscalls.master ============================================================================== --- head/sys/kern/syscalls.master Sat Nov 19 03:20:15 2011 (r227690) +++ head/sys/kern/syscalls.master Sat Nov 19 06:35:15 2011 (r227691) @@ -115,7 +115,7 @@ 32 AUE_GETSOCKNAME STD { int getsockname(int fdes, \ struct sockaddr * __restrict asa, \ __socklen_t * __restrict alen); } -33 AUE_ACCESS STD { int access(char *path, int flags); } +33 AUE_ACCESS STD { int access(char *path, int amode); } 34 AUE_CHFLAGS STD { int chflags(char *path, int flags); } 35 AUE_FCHFLAGS STD { int fchflags(int fd, int flags); } 36 AUE_SYNC STD { int sync(void); } @@ -671,7 +671,7 @@ const char *attrname); } 374 AUE_NULL STD { int __setugid(int flag); } 375 AUE_NULL UNIMPL nfsclnt -376 AUE_EACCESS STD { int eaccess(char *path, int flags); } +376 AUE_EACCESS STD { int eaccess(char *path, int amode); } 377 AUE_NULL NOSTD|NOTSTATIC { int afs3_syscall(long syscall, \ long parm1, long parm2, long parm3, \ long parm4, long parm5, long parm6); } @@ -870,7 +870,7 @@ 488 AUE_NULL STD { int cpuset_setaffinity(cpulevel_t level, \ cpuwhich_t which, id_t id, size_t cpusetsize, \ const cpuset_t *mask); } -489 AUE_FACCESSAT STD { int faccessat(int fd, char *path, int mode, \ +489 AUE_FACCESSAT STD { int faccessat(int fd, char *path, int amode, \ int flag); } 490 AUE_FCHMODAT STD { int fchmodat(int fd, char *path, mode_t mode, \ int flag); } Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Sat Nov 19 03:20:15 2011 (r227690) +++ head/sys/kern/vfs_syscalls.c Sat Nov 19 06:35:15 2011 (r227691) @@ -2144,7 +2144,7 @@ vn_access(vp, user_flags, cred, td) #ifndef _SYS_SYSPROTO_H_ struct access_args { char *path; - int flags; + int amode; }; #endif int @@ -2152,18 +2152,18 @@ sys_access(td, uap) struct thread *td; register struct access_args /* { char *path; - int flags; + int amode; } */ *uap; { - return (kern_access(td, uap->path, UIO_USERSPACE, uap->flags)); + return (kern_access(td, uap->path, UIO_USERSPACE, uap->amode)); } #ifndef _SYS_SYSPROTO_H_ struct faccessat_args { int dirfd; char *path; - int mode; + int amode; int flag; } #endif @@ -2174,19 +2174,19 @@ sys_faccessat(struct thread *td, struct if (uap->flag & ~AT_EACCESS) return (EINVAL); return (kern_accessat(td, uap->fd, uap->path, UIO_USERSPACE, uap->flag, - uap->mode)); + uap->amode)); } int -kern_access(struct thread *td, char *path, enum uio_seg pathseg, int mode) +kern_access(struct thread *td, char *path, enum uio_seg pathseg, int amode) { - return (kern_accessat(td, AT_FDCWD, path, pathseg, 0, mode)); + return (kern_accessat(td, AT_FDCWD, path, pathseg, 0, amode)); } int kern_accessat(struct thread *td, int fd, char *path, enum uio_seg pathseg, - int flags, int mode) + int flag, int amode) { struct ucred *cred, *tmpcred; struct vnode *vp; @@ -2198,7 +2198,7 @@ kern_accessat(struct thread *td, int fd, * Create and modify a temporary credential instead of one that * is potentially shared. */ - if (!(flags & AT_EACCESS)) { + if (!(flag & AT_EACCESS)) { cred = td->td_ucred; tmpcred = crdup(cred); tmpcred->cr_uid = cred->cr_ruid; @@ -2206,7 +2206,7 @@ kern_accessat(struct thread *td, int fd, td->td_ucred = tmpcred; } else cred = tmpcred = td->td_ucred; - AUDIT_ARG_VALUE(mode); + AUDIT_ARG_VALUE(amode); NDINIT_ATRIGHTS(&nd, LOOKUP, FOLLOW | LOCKSHARED | LOCKLEAF | MPSAFE | AUDITVNODE1, pathseg, path, fd, CAP_FSTAT, td); if ((error = namei(&nd)) != 0) @@ -2214,12 +2214,12 @@ kern_accessat(struct thread *td, int fd, vfslocked = NDHASGIANT(&nd); vp = nd.ni_vp; - error = vn_access(vp, mode, tmpcred, td); + error = vn_access(vp, amode, tmpcred, td); NDFREE(&nd, NDF_ONLY_PNBUF); vput(vp); VFS_UNLOCK_GIANT(vfslocked); out1: - if (!(flags & AT_EACCESS)) { + if (!(flag & AT_EACCESS)) { td->td_ucred = cred; crfree(tmpcred); } @@ -2232,7 +2232,7 @@ out1: #ifndef _SYS_SYSPROTO_H_ struct eaccess_args { char *path; - int flags; + int amode; }; #endif int @@ -2240,18 +2240,18 @@ sys_eaccess(td, uap) struct thread *td; register struct eaccess_args /* { char *path; - int flags; + int amode; } */ *uap; { - return (kern_eaccess(td, uap->path, UIO_USERSPACE, uap->flags)); + return (kern_eaccess(td, uap->path, UIO_USERSPACE, uap->amode)); } int -kern_eaccess(struct thread *td, char *path, enum uio_seg pathseg, int flags) +kern_eaccess(struct thread *td, char *path, enum uio_seg pathseg, int amode) { - return (kern_accessat(td, AT_FDCWD, path, pathseg, AT_EACCESS, flags)); + return (kern_accessat(td, AT_FDCWD, path, pathseg, AT_EACCESS, amode)); } #if defined(COMPAT_43) From owner-svn-src-all@FreeBSD.ORG Sat Nov 19 06:36:11 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B4FBE106564A; Sat, 19 Nov 2011 06:36:11 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A248B8FC1B; Sat, 19 Nov 2011 06:36:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAJ6aBAE027061; Sat, 19 Nov 2011 06:36:11 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAJ6aBCx027032; Sat, 19 Nov 2011 06:36:11 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111190636.pAJ6aBCx027032@svn.freebsd.org> From: Ed Schouten Date: Sat, 19 Nov 2011 06:36:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227692 - in head/sys: amd64/linux32 compat/freebsd32 compat/svr4 i386/ibcs2 i386/linux kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Nov 2011 06:36:11 -0000 Author: ed Date: Sat Nov 19 06:36:11 2011 New Revision: 227692 URL: http://svn.freebsd.org/changeset/base/227692 Log: Regenerate system call tables. Modified: head/sys/amd64/linux32/linux32_proto.h head/sys/amd64/linux32/linux32_syscall.h head/sys/amd64/linux32/linux32_syscalls.c head/sys/amd64/linux32/linux32_sysent.c head/sys/amd64/linux32/linux32_systrace_args.c head/sys/compat/freebsd32/freebsd32_proto.h head/sys/compat/freebsd32/freebsd32_syscall.h head/sys/compat/freebsd32/freebsd32_syscalls.c head/sys/compat/freebsd32/freebsd32_sysent.c head/sys/compat/freebsd32/freebsd32_systrace_args.c head/sys/compat/svr4/svr4_proto.h head/sys/compat/svr4/svr4_syscall.h head/sys/compat/svr4/svr4_syscallnames.c head/sys/compat/svr4/svr4_sysent.c head/sys/i386/ibcs2/ibcs2_proto.h head/sys/i386/ibcs2/ibcs2_syscall.h head/sys/i386/ibcs2/ibcs2_sysent.c head/sys/i386/linux/linux_proto.h head/sys/i386/linux/linux_syscall.h head/sys/i386/linux/linux_syscalls.c head/sys/i386/linux/linux_sysent.c head/sys/i386/linux/linux_systrace_args.c 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/amd64/linux32/linux32_proto.h ============================================================================== --- head/sys/amd64/linux32/linux32_proto.h Sat Nov 19 06:35:15 2011 (r227691) +++ head/sys/amd64/linux32/linux32_proto.h Sat Nov 19 06:36:11 2011 (r227692) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 220028 2011-03-26 10:51:56Z avg + * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 227691 2011-11-19 06:35:15Z ed */ #ifndef _LINUX_SYSPROTO_H_ @@ -131,7 +131,7 @@ struct linux_utime_args { }; struct linux_access_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; - char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; + char amode_l_[PADL_(l_int)]; l_int amode; char amode_r_[PADR_(l_int)]; }; struct linux_nice_args { char inc_l_[PADL_(l_int)]; l_int inc; char inc_r_[PADR_(l_int)]; @@ -963,7 +963,7 @@ struct linux_fchmodat_args { struct linux_faccessat_args { char dfd_l_[PADL_(l_int)]; l_int dfd; char dfd_r_[PADR_(l_int)]; char filename_l_[PADL_(const char *)]; const char * filename; char filename_r_[PADR_(const char *)]; - char mode_l_[PADL_(l_int)]; l_int mode; char mode_r_[PADR_(l_int)]; + char amode_l_[PADL_(l_int)]; l_int amode; char amode_r_[PADR_(l_int)]; }; struct linux_pselect6_args { register_t dummy; Modified: head/sys/amd64/linux32/linux32_syscall.h ============================================================================== --- head/sys/amd64/linux32/linux32_syscall.h Sat Nov 19 06:35:15 2011 (r227691) +++ head/sys/amd64/linux32/linux32_syscall.h Sat Nov 19 06:36:11 2011 (r227692) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 220028 2011-03-26 10:51:56Z avg + * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 227691 2011-11-19 06:35:15Z ed */ #define LINUX_SYS_exit 1 Modified: head/sys/amd64/linux32/linux32_syscalls.c ============================================================================== --- head/sys/amd64/linux32/linux32_syscalls.c Sat Nov 19 06:35:15 2011 (r227691) +++ head/sys/amd64/linux32/linux32_syscalls.c Sat Nov 19 06:36:11 2011 (r227692) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 220028 2011-03-26 10:51:56Z avg + * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 227691 2011-11-19 06:35:15Z ed */ const char *linux_syscallnames[] = { Modified: head/sys/amd64/linux32/linux32_sysent.c ============================================================================== --- head/sys/amd64/linux32/linux32_sysent.c Sat Nov 19 06:35:15 2011 (r227691) +++ head/sys/amd64/linux32/linux32_sysent.c Sat Nov 19 06:36:11 2011 (r227692) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 220028 2011-03-26 10:51:56Z avg + * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 227691 2011-11-19 06:35:15Z ed */ #include "opt_compat.h" Modified: head/sys/amd64/linux32/linux32_systrace_args.c ============================================================================== --- head/sys/amd64/linux32/linux32_systrace_args.c Sat Nov 19 06:35:15 2011 (r227691) +++ head/sys/amd64/linux32/linux32_systrace_args.c Sat Nov 19 06:36:11 2011 (r227692) @@ -230,7 +230,7 @@ systrace_args(int sysnum, void *params, case 33: { struct linux_access_args *p = params; uarg[0] = (intptr_t) p->path; /* char * */ - iarg[1] = p->flags; /* l_int */ + iarg[1] = p->amode; /* l_int */ *n_args = 2; break; } @@ -2033,7 +2033,7 @@ systrace_args(int sysnum, void *params, struct linux_faccessat_args *p = params; iarg[0] = p->dfd; /* l_int */ uarg[1] = (intptr_t) p->filename; /* const char * */ - iarg[2] = p->mode; /* l_int */ + iarg[2] = p->amode; /* l_int */ *n_args = 3; break; } Modified: head/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_proto.h Sat Nov 19 06:35:15 2011 (r227691) +++ head/sys/compat/freebsd32/freebsd32_proto.h Sat Nov 19 06:36:11 2011 (r227692) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 227070 2011-11-04 04:02:50Z jhb + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 227691 2011-11-19 06:35:15Z ed */ #ifndef _FREEBSD32_SYSPROTO_H_ Modified: head/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscall.h Sat Nov 19 06:35:15 2011 (r227691) +++ head/sys/compat/freebsd32/freebsd32_syscall.h Sat Nov 19 06:36:11 2011 (r227692) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 227070 2011-11-04 04:02:50Z jhb + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 227691 2011-11-19 06:35:15Z ed */ #define FREEBSD32_SYS_syscall 0 Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscalls.c Sat Nov 19 06:35:15 2011 (r227691) +++ head/sys/compat/freebsd32/freebsd32_syscalls.c Sat Nov 19 06:36:11 2011 (r227692) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 227070 2011-11-04 04:02:50Z jhb + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 227691 2011-11-19 06:35:15Z ed */ const char *freebsd32_syscallnames[] = { Modified: head/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_sysent.c Sat Nov 19 06:35:15 2011 (r227691) +++ head/sys/compat/freebsd32/freebsd32_sysent.c Sat Nov 19 06:36:11 2011 (r227692) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 227070 2011-11-04 04:02:50Z jhb + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 227691 2011-11-19 06:35:15Z ed */ #include "opt_compat.h" Modified: head/sys/compat/freebsd32/freebsd32_systrace_args.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_systrace_args.c Sat Nov 19 06:35:15 2011 (r227691) +++ head/sys/compat/freebsd32/freebsd32_systrace_args.c Sat Nov 19 06:36:11 2011 (r227692) @@ -248,7 +248,7 @@ systrace_args(int sysnum, void *params, case 33: { struct access_args *p = params; uarg[0] = (intptr_t) p->path; /* char * */ - iarg[1] = p->flags; /* int */ + iarg[1] = p->amode; /* int */ *n_args = 2; break; } @@ -1868,7 +1868,7 @@ systrace_args(int sysnum, void *params, case 376: { struct eaccess_args *p = params; uarg[0] = (intptr_t) p->path; /* char * */ - iarg[1] = p->flags; /* int */ + iarg[1] = p->amode; /* int */ *n_args = 2; break; } @@ -2702,7 +2702,7 @@ systrace_args(int sysnum, void *params, struct faccessat_args *p = params; iarg[0] = p->fd; /* int */ uarg[1] = (intptr_t) p->path; /* char * */ - iarg[2] = p->mode; /* int */ + iarg[2] = p->amode; /* int */ iarg[3] = p->flag; /* int */ *n_args = 4; break; Modified: head/sys/compat/svr4/svr4_proto.h ============================================================================== --- head/sys/compat/svr4/svr4_proto.h Sat Nov 19 06:35:15 2011 (r227691) +++ head/sys/compat/svr4/svr4_proto.h Sat Nov 19 06:36:11 2011 (r227692) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/svr4/syscalls.master 203660 2010-02-08 10:02:01Z ed + * created from FreeBSD: head/sys/compat/svr4/syscalls.master 227691 2011-11-19 06:35:15Z ed */ #ifndef _SVR4_SYSPROTO_H_ @@ -79,7 +79,7 @@ struct svr4_sys_utime_args { }; struct svr4_sys_access_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; - char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; + char amode_l_[PADL_(int)]; int amode; char amode_r_[PADR_(int)]; }; struct svr4_sys_nice_args { char prio_l_[PADL_(int)]; int prio; char prio_r_[PADR_(int)]; Modified: head/sys/compat/svr4/svr4_syscall.h ============================================================================== --- head/sys/compat/svr4/svr4_syscall.h Sat Nov 19 06:35:15 2011 (r227691) +++ head/sys/compat/svr4/svr4_syscall.h Sat Nov 19 06:36:11 2011 (r227692) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/svr4/syscalls.master 203660 2010-02-08 10:02:01Z ed + * created from FreeBSD: head/sys/compat/svr4/syscalls.master 227691 2011-11-19 06:35:15Z ed */ #define SVR4_SYS_exit 1 Modified: head/sys/compat/svr4/svr4_syscallnames.c ============================================================================== --- head/sys/compat/svr4/svr4_syscallnames.c Sat Nov 19 06:35:15 2011 (r227691) +++ head/sys/compat/svr4/svr4_syscallnames.c Sat Nov 19 06:36:11 2011 (r227692) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/svr4/syscalls.master 203660 2010-02-08 10:02:01Z ed + * created from FreeBSD: head/sys/compat/svr4/syscalls.master 227691 2011-11-19 06:35:15Z ed */ const char *svr4_syscallnames[] = { Modified: head/sys/compat/svr4/svr4_sysent.c ============================================================================== --- head/sys/compat/svr4/svr4_sysent.c Sat Nov 19 06:35:15 2011 (r227691) +++ head/sys/compat/svr4/svr4_sysent.c Sat Nov 19 06:36:11 2011 (r227692) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/svr4/syscalls.master 203660 2010-02-08 10:02:01Z ed + * created from FreeBSD: head/sys/compat/svr4/syscalls.master 227691 2011-11-19 06:35:15Z ed */ #include Modified: head/sys/i386/ibcs2/ibcs2_proto.h ============================================================================== --- head/sys/i386/ibcs2/ibcs2_proto.h Sat Nov 19 06:35:15 2011 (r227691) +++ head/sys/i386/ibcs2/ibcs2_proto.h Sat Nov 19 06:36:11 2011 (r227692) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/i386/ibcs2/syscalls.master 203660 2010-02-08 10:02:01Z ed + * created from FreeBSD: head/sys/i386/ibcs2/syscalls.master 227691 2011-11-19 06:35:15Z ed */ #ifndef _IBCS2_SYSPROTO_H_ @@ -120,7 +120,7 @@ struct ibcs2_utime_args { }; struct ibcs2_access_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; - char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; + char amode_l_[PADL_(int)]; int amode; char amode_r_[PADR_(int)]; }; struct ibcs2_nice_args { char incr_l_[PADL_(int)]; int incr; char incr_r_[PADR_(int)]; Modified: head/sys/i386/ibcs2/ibcs2_syscall.h ============================================================================== --- head/sys/i386/ibcs2/ibcs2_syscall.h Sat Nov 19 06:35:15 2011 (r227691) +++ head/sys/i386/ibcs2/ibcs2_syscall.h Sat Nov 19 06:36:11 2011 (r227692) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/i386/ibcs2/syscalls.master 203660 2010-02-08 10:02:01Z ed + * created from FreeBSD: head/sys/i386/ibcs2/syscalls.master 227691 2011-11-19 06:35:15Z ed */ #define IBCS2_SYS_syscall 0 Modified: head/sys/i386/ibcs2/ibcs2_sysent.c ============================================================================== --- head/sys/i386/ibcs2/ibcs2_sysent.c Sat Nov 19 06:35:15 2011 (r227691) +++ head/sys/i386/ibcs2/ibcs2_sysent.c Sat Nov 19 06:36:11 2011 (r227692) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/i386/ibcs2/syscalls.master 203660 2010-02-08 10:02:01Z ed + * created from FreeBSD: head/sys/i386/ibcs2/syscalls.master 227691 2011-11-19 06:35:15Z ed */ #include Modified: head/sys/i386/linux/linux_proto.h ============================================================================== --- head/sys/i386/linux/linux_proto.h Sat Nov 19 06:35:15 2011 (r227691) +++ head/sys/i386/linux/linux_proto.h Sat Nov 19 06:36:11 2011 (r227692) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/i386/linux/syscalls.master 220028 2011-03-26 10:51:56Z avg + * created from FreeBSD: head/sys/i386/linux/syscalls.master 227691 2011-11-19 06:35:15Z ed */ #ifndef _LINUX_SYSPROTO_H_ @@ -135,7 +135,7 @@ struct linux_utime_args { }; struct linux_access_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; - char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; + char amode_l_[PADL_(l_int)]; l_int amode; char amode_r_[PADR_(l_int)]; }; struct linux_nice_args { char inc_l_[PADL_(l_int)]; l_int inc; char inc_r_[PADR_(l_int)]; @@ -982,7 +982,7 @@ struct linux_fchmodat_args { struct linux_faccessat_args { char dfd_l_[PADL_(l_int)]; l_int dfd; char dfd_r_[PADR_(l_int)]; char filename_l_[PADL_(const char *)]; const char * filename; char filename_r_[PADR_(const char *)]; - char mode_l_[PADL_(l_int)]; l_int mode; char mode_r_[PADR_(l_int)]; + char amode_l_[PADL_(l_int)]; l_int amode; char amode_r_[PADR_(l_int)]; }; struct linux_pselect6_args { register_t dummy; Modified: head/sys/i386/linux/linux_syscall.h ============================================================================== --- head/sys/i386/linux/linux_syscall.h Sat Nov 19 06:35:15 2011 (r227691) +++ head/sys/i386/linux/linux_syscall.h Sat Nov 19 06:36:11 2011 (r227692) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/i386/linux/syscalls.master 220028 2011-03-26 10:51:56Z avg + * created from FreeBSD: head/sys/i386/linux/syscalls.master 227691 2011-11-19 06:35:15Z ed */ #define LINUX_SYS_exit 1 Modified: head/sys/i386/linux/linux_syscalls.c ============================================================================== --- head/sys/i386/linux/linux_syscalls.c Sat Nov 19 06:35:15 2011 (r227691) +++ head/sys/i386/linux/linux_syscalls.c Sat Nov 19 06:36:11 2011 (r227692) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/i386/linux/syscalls.master 220028 2011-03-26 10:51:56Z avg + * created from FreeBSD: head/sys/i386/linux/syscalls.master 227691 2011-11-19 06:35:15Z ed */ const char *linux_syscallnames[] = { Modified: head/sys/i386/linux/linux_sysent.c ============================================================================== --- head/sys/i386/linux/linux_sysent.c Sat Nov 19 06:35:15 2011 (r227691) +++ head/sys/i386/linux/linux_sysent.c Sat Nov 19 06:36:11 2011 (r227692) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/i386/linux/syscalls.master 220028 2011-03-26 10:51:56Z avg + * created from FreeBSD: head/sys/i386/linux/syscalls.master 227691 2011-11-19 06:35:15Z ed */ #include Modified: head/sys/i386/linux/linux_systrace_args.c ============================================================================== --- head/sys/i386/linux/linux_systrace_args.c Sat Nov 19 06:35:15 2011 (r227691) +++ head/sys/i386/linux/linux_systrace_args.c Sat Nov 19 06:36:11 2011 (r227692) @@ -238,7 +238,7 @@ systrace_args(int sysnum, void *params, case 33: { struct linux_access_args *p = params; uarg[0] = (intptr_t) p->path; /* char * */ - iarg[1] = p->flags; /* l_int */ + iarg[1] = p->amode; /* l_int */ *n_args = 2; break; } @@ -2124,7 +2124,7 @@ systrace_args(int sysnum, void *params, struct linux_faccessat_args *p = params; iarg[0] = p->dfd; /* l_int */ uarg[1] = (intptr_t) p->filename; /* const char * */ - iarg[2] = p->mode; /* l_int */ + iarg[2] = p->amode; /* l_int */ *n_args = 3; break; } Modified: head/sys/kern/init_sysent.c ============================================================================== --- head/sys/kern/init_sysent.c Sat Nov 19 06:35:15 2011 (r227691) +++ head/sys/kern/init_sysent.c Sat Nov 19 06:36:11 2011 (r227692) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 227070 2011-11-04 04:02:50Z jhb + * created from FreeBSD: head/sys/kern/syscalls.master 227691 2011-11-19 06:35:15Z ed */ #include "opt_compat.h" Modified: head/sys/kern/syscalls.c ============================================================================== --- head/sys/kern/syscalls.c Sat Nov 19 06:35:15 2011 (r227691) +++ head/sys/kern/syscalls.c Sat Nov 19 06:36:11 2011 (r227692) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 227070 2011-11-04 04:02:50Z jhb + * created from FreeBSD: head/sys/kern/syscalls.master 227691 2011-11-19 06:35:15Z ed */ const char *syscallnames[] = { Modified: head/sys/kern/systrace_args.c ============================================================================== --- head/sys/kern/systrace_args.c Sat Nov 19 06:35:15 2011 (r227691) +++ head/sys/kern/systrace_args.c Sat Nov 19 06:36:11 2011 (r227692) @@ -245,7 +245,7 @@ systrace_args(int sysnum, void *params, case 33: { struct access_args *p = params; uarg[0] = (intptr_t) p->path; /* char * */ - iarg[1] = p->flags; /* int */ + iarg[1] = p->amode; /* int */ *n_args = 2; break; } @@ -2018,7 +2018,7 @@ systrace_args(int sysnum, void *params, case 376: { struct eaccess_args *p = params; uarg[0] = (intptr_t) p->path; /* char * */ - iarg[1] = p->flags; /* int */ + iarg[1] = p->amode; /* int */ *n_args = 2; break; } @@ -2873,7 +2873,7 @@ systrace_args(int sysnum, void *params, struct faccessat_args *p = params; iarg[0] = p->fd; /* int */ uarg[1] = (intptr_t) p->path; /* char * */ - iarg[2] = p->mode; /* int */ + iarg[2] = p->amode; /* int */ iarg[3] = p->flag; /* int */ *n_args = 4; break; Modified: head/sys/sys/syscall.h ============================================================================== --- head/sys/sys/syscall.h Sat Nov 19 06:35:15 2011 (r227691) +++ head/sys/sys/syscall.h Sat Nov 19 06:36:11 2011 (r227692) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 227070 2011-11-04 04:02:50Z jhb + * created from FreeBSD: head/sys/kern/syscalls.master 227691 2011-11-19 06:35:15Z ed */ #define SYS_syscall 0 Modified: head/sys/sys/syscall.mk ============================================================================== --- head/sys/sys/syscall.mk Sat Nov 19 06:35:15 2011 (r227691) +++ head/sys/sys/syscall.mk Sat Nov 19 06:36:11 2011 (r227692) @@ -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 227070 2011-11-04 04:02:50Z jhb +# created from FreeBSD: head/sys/kern/syscalls.master 227691 2011-11-19 06:35:15Z ed MIASM = \ syscall.o \ exit.o \ Modified: head/sys/sys/sysproto.h ============================================================================== --- head/sys/sys/sysproto.h Sat Nov 19 06:35:15 2011 (r227691) +++ head/sys/sys/sysproto.h Sat Nov 19 06:36:11 2011 (r227692) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 227070 2011-11-04 04:02:50Z jhb + * created from FreeBSD: head/sys/kern/syscalls.master 227691 2011-11-19 06:35:15Z ed */ #ifndef _SYS_SYSPROTO_H_ @@ -158,7 +158,7 @@ struct getsockname_args { }; struct access_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; - char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; + char amode_l_[PADL_(int)]; int amode; char amode_r_[PADR_(int)]; }; struct chflags_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; @@ -1073,7 +1073,7 @@ struct __setugid_args { }; struct eaccess_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; - char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; + char amode_l_[PADL_(int)]; int amode; char amode_r_[PADR_(int)]; }; struct afs3_syscall_args { char syscall_l_[PADL_(long)]; long syscall; char syscall_r_[PADR_(long)]; @@ -1532,7 +1532,7 @@ struct cpuset_setaffinity_args { struct faccessat_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; - char mode_l_[PADL_(int)]; int mode; char mode_r_[PADR_(int)]; + char amode_l_[PADL_(int)]; int amode; char amode_r_[PADR_(int)]; char flag_l_[PADL_(int)]; int flag; char flag_r_[PADR_(int)]; }; struct fchmodat_args { From owner-svn-src-all@FreeBSD.ORG Sat Nov 19 07:19:37 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BB943106564A; Sat, 19 Nov 2011 07:19:37 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6F9208FC0A; Sat, 19 Nov 2011 07:19:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAJ7Jb2E028964; Sat, 19 Nov 2011 07:19:37 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAJ7Jbm4028959; Sat, 19 Nov 2011 07:19:37 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111190719.pAJ7Jbm4028959@svn.freebsd.org> From: Ed Schouten Date: Sat, 19 Nov 2011 07:19:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227693 - in head/sys: amd64/linux32 compat/linux i386/linux X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Nov 2011 07:19:37 -0000 Author: ed Date: Sat Nov 19 07:19:37 2011 New Revision: 227693 URL: http://svn.freebsd.org/changeset/base/227693 Log: Make the Linux *at() calls a bit more complete. Properly support: - AT_EACCESS for faccessat(), - AT_SYMLINK_FOLLOW for linkat(). Modified: head/sys/amd64/linux32/syscalls.master head/sys/compat/linux/linux_file.c head/sys/compat/linux/linux_file.h head/sys/i386/linux/syscalls.master Modified: head/sys/amd64/linux32/syscalls.master ============================================================================== --- head/sys/amd64/linux32/syscalls.master Sat Nov 19 06:36:11 2011 (r227692) +++ head/sys/amd64/linux32/syscalls.master Sat Nov 19 07:19:37 2011 (r227693) @@ -483,14 +483,14 @@ 302 AUE_RENAMEAT STD { int linux_renameat(l_int olddfd, const char *oldname, \ l_int newdfd, const char *newname); } 303 AUE_LINKAT STD { int linux_linkat(l_int olddfd, const char *oldname, \ - l_int newdfd, const char *newname, l_int flags); } + l_int newdfd, const char *newname, l_int flag); } 304 AUE_SYMLINKAT STD { int linux_symlinkat(const char *oldname, l_int newdfd, \ const char *newname); } 305 AUE_READLINKAT STD { int linux_readlinkat(l_int dfd, const char *path, \ char *buf, l_int bufsiz); } 306 AUE_FCHMODAT STD { int linux_fchmodat(l_int dfd, const char *filename, \ l_mode_t mode); } -307 AUE_FACCESSAT STD { int linux_faccessat(l_int dfd, const char *filename, l_int amode); } +307 AUE_FACCESSAT STD { int linux_faccessat(l_int dfd, const char *filename, l_int amode, int flag); } 308 AUE_NULL STD { int linux_pselect6(void); } 309 AUE_NULL STD { int linux_ppoll(void); } 310 AUE_NULL STD { int linux_unshare(void); } Modified: head/sys/compat/linux/linux_file.c ============================================================================== --- head/sys/compat/linux/linux_file.c Sat Nov 19 06:36:11 2011 (r227692) +++ head/sys/compat/linux/linux_file.c Sat Nov 19 07:19:37 2011 (r227693) @@ -584,8 +584,10 @@ int linux_faccessat(struct thread *td, struct linux_faccessat_args *args) { char *path; - int error, dfd; + int error, dfd, flag; + if (args->flag & ~LINUX_AT_EACCESS) + return (EINVAL); /* linux convention */ if (args->amode & ~(F_OK | X_OK | W_OK | R_OK)) return (EINVAL); @@ -598,8 +600,8 @@ linux_faccessat(struct thread *td, struc printf(ARGS(access, "%s, %d"), path, args->amode); #endif - error = kern_accessat(td, dfd, path, UIO_SYSSPACE, 0 /* XXX */, - args->amode); + flag = (args->flag & LINUX_AT_EACCESS) == 0 ? 0 : AT_EACCESS; + error = kern_accessat(td, dfd, path, UIO_SYSSPACE, flag, args->amode); LFREEPATH(path); return (error); @@ -982,13 +984,9 @@ int linux_linkat(struct thread *td, struct linux_linkat_args *args) { char *path, *to; - int error, olddfd, newdfd; + int error, olddfd, newdfd, follow; - /* - * They really introduced flags argument which is forbidden to - * use. - */ - if (args->flags != 0) + if (args->flag & ~LINUX_AT_SYMLINK_FOLLOW) return (EINVAL); olddfd = (args->olddfd == LINUX_AT_FDCWD) ? AT_FDCWD : args->olddfd; @@ -1004,10 +1002,12 @@ linux_linkat(struct thread *td, struct l #ifdef DEBUG if (ldebug(linkat)) printf(ARGS(linkat, "%i, %s, %i, %s, %i"), args->olddfd, path, - args->newdfd, to, args->flags); + args->newdfd, to, args->flag); #endif - error = kern_linkat(td, olddfd, newdfd, path, to, UIO_SYSSPACE, FOLLOW); + follow = (args->flag & LINUX_AT_SYMLINK_FOLLOW) == 0 ? NOFOLLOW : + FOLLOW; + error = kern_linkat(td, olddfd, newdfd, path, to, UIO_SYSSPACE, follow); LFREEPATH(path); LFREEPATH(to); return (error); @@ -1493,7 +1493,7 @@ int linux_fchownat(struct thread *td, struct linux_fchownat_args *args) { char *path; - int error, dfd, follow; + int error, dfd, flag; if (args->flag & ~LINUX_AT_SYMLINK_NOFOLLOW) return (EINVAL); @@ -1506,10 +1506,10 @@ linux_fchownat(struct thread *td, struct printf(ARGS(fchownat, "%s, %d, %d"), path, args->uid, args->gid); #endif - follow = (args->flag & LINUX_AT_SYMLINK_NOFOLLOW) == 0 ? 0 : + flag = (args->flag & LINUX_AT_SYMLINK_NOFOLLOW) == 0 ? 0 : AT_SYMLINK_NOFOLLOW; error = kern_fchownat(td, dfd, path, UIO_SYSSPACE, args->uid, args->gid, - follow); + flag); LFREEPATH(path); return (error); } Modified: head/sys/compat/linux/linux_file.h ============================================================================== --- head/sys/compat/linux/linux_file.h Sat Nov 19 06:36:11 2011 (r227692) +++ head/sys/compat/linux/linux_file.h Sat Nov 19 07:19:37 2011 (r227693) @@ -31,6 +31,8 @@ #define LINUX_AT_FDCWD -100 #define LINUX_AT_SYMLINK_NOFOLLOW 0x100 +#define LINUX_AT_EACCESS 0x200 #define LINUX_AT_REMOVEDIR 0x200 +#define LINUX_AT_SYMLINK_FOLLOW 0x400 #endif /* !_LINUX_FILE_H_ */ Modified: head/sys/i386/linux/syscalls.master ============================================================================== --- head/sys/i386/linux/syscalls.master Sat Nov 19 06:36:11 2011 (r227692) +++ head/sys/i386/linux/syscalls.master Sat Nov 19 07:19:37 2011 (r227693) @@ -493,14 +493,14 @@ 302 AUE_RENAMEAT STD { int linux_renameat(l_int olddfd, const char *oldname, \ l_int newdfd, const char *newname); } 303 AUE_LINKAT STD { int linux_linkat(l_int olddfd, const char *oldname, \ - l_int newdfd, const char *newname, l_int flags); } + l_int newdfd, const char *newname, l_int flag); } 304 AUE_SYMLINKAT STD { int linux_symlinkat(const char *oldname, l_int newdfd, \ const char *newname); } 305 AUE_READLINKAT STD { int linux_readlinkat(l_int dfd, const char *path, \ char *buf, l_int bufsiz); } 306 AUE_FCHMODAT STD { int linux_fchmodat(l_int dfd, const char *filename, \ l_mode_t mode); } -307 AUE_FACCESSAT STD { int linux_faccessat(l_int dfd, const char *filename, l_int amode); } +307 AUE_FACCESSAT STD { int linux_faccessat(l_int dfd, const char *filename, l_int amode, l_int flag); } 308 AUE_NULL STD { int linux_pselect6(void); } 309 AUE_NULL STD { int linux_ppoll(void); } 310 AUE_NULL STD { int linux_unshare(void); } From owner-svn-src-all@FreeBSD.ORG Sat Nov 19 07:20:20 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 82106106564A; Sat, 19 Nov 2011 07:20:20 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 709508FC1C; Sat, 19 Nov 2011 07:20:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAJ7KKDf029041; Sat, 19 Nov 2011 07:20:20 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAJ7KKSE029030; Sat, 19 Nov 2011 07:20:20 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111190720.pAJ7KKSE029030@svn.freebsd.org> From: Ed Schouten Date: Sat, 19 Nov 2011 07:20:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227694 - in head/sys: amd64/linux32 i386/linux X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Nov 2011 07:20:20 -0000 Author: ed Date: Sat Nov 19 07:20:20 2011 New Revision: 227694 URL: http://svn.freebsd.org/changeset/base/227694 Log: Regenerate system call tables. Modified: head/sys/amd64/linux32/linux32_proto.h head/sys/amd64/linux32/linux32_syscall.h head/sys/amd64/linux32/linux32_syscalls.c head/sys/amd64/linux32/linux32_sysent.c head/sys/amd64/linux32/linux32_systrace_args.c head/sys/i386/linux/linux_proto.h head/sys/i386/linux/linux_syscall.h head/sys/i386/linux/linux_syscalls.c head/sys/i386/linux/linux_sysent.c head/sys/i386/linux/linux_systrace_args.c Modified: head/sys/amd64/linux32/linux32_proto.h ============================================================================== --- head/sys/amd64/linux32/linux32_proto.h Sat Nov 19 07:19:37 2011 (r227693) +++ head/sys/amd64/linux32/linux32_proto.h Sat Nov 19 07:20:20 2011 (r227694) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 227691 2011-11-19 06:35:15Z ed + * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 227693 2011-11-19 07:19:37Z ed */ #ifndef _LINUX_SYSPROTO_H_ @@ -942,7 +942,7 @@ struct linux_linkat_args { char oldname_l_[PADL_(const char *)]; const char * oldname; char oldname_r_[PADR_(const char *)]; char newdfd_l_[PADL_(l_int)]; l_int newdfd; char newdfd_r_[PADR_(l_int)]; char newname_l_[PADL_(const char *)]; const char * newname; char newname_r_[PADR_(const char *)]; - char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; + char flag_l_[PADL_(l_int)]; l_int flag; char flag_r_[PADR_(l_int)]; }; struct linux_symlinkat_args { char oldname_l_[PADL_(const char *)]; const char * oldname; char oldname_r_[PADR_(const char *)]; @@ -964,6 +964,7 @@ struct linux_faccessat_args { char dfd_l_[PADL_(l_int)]; l_int dfd; char dfd_r_[PADR_(l_int)]; char filename_l_[PADL_(const char *)]; const char * filename; char filename_r_[PADR_(const char *)]; char amode_l_[PADL_(l_int)]; l_int amode; char amode_r_[PADR_(l_int)]; + char flag_l_[PADL_(int)]; int flag; char flag_r_[PADR_(int)]; }; struct linux_pselect6_args { register_t dummy; Modified: head/sys/amd64/linux32/linux32_syscall.h ============================================================================== --- head/sys/amd64/linux32/linux32_syscall.h Sat Nov 19 07:19:37 2011 (r227693) +++ head/sys/amd64/linux32/linux32_syscall.h Sat Nov 19 07:20:20 2011 (r227694) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 227691 2011-11-19 06:35:15Z ed + * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 227693 2011-11-19 07:19:37Z ed */ #define LINUX_SYS_exit 1 Modified: head/sys/amd64/linux32/linux32_syscalls.c ============================================================================== --- head/sys/amd64/linux32/linux32_syscalls.c Sat Nov 19 07:19:37 2011 (r227693) +++ head/sys/amd64/linux32/linux32_syscalls.c Sat Nov 19 07:20:20 2011 (r227694) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 227691 2011-11-19 06:35:15Z ed + * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 227693 2011-11-19 07:19:37Z ed */ const char *linux_syscallnames[] = { Modified: head/sys/amd64/linux32/linux32_sysent.c ============================================================================== --- head/sys/amd64/linux32/linux32_sysent.c Sat Nov 19 07:19:37 2011 (r227693) +++ head/sys/amd64/linux32/linux32_sysent.c Sat Nov 19 07:20:20 2011 (r227694) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 227691 2011-11-19 06:35:15Z ed + * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 227693 2011-11-19 07:19:37Z ed */ #include "opt_compat.h" Modified: head/sys/amd64/linux32/linux32_systrace_args.c ============================================================================== --- head/sys/amd64/linux32/linux32_systrace_args.c Sat Nov 19 07:19:37 2011 (r227693) +++ head/sys/amd64/linux32/linux32_systrace_args.c Sat Nov 19 07:20:20 2011 (r227694) @@ -1996,7 +1996,7 @@ systrace_args(int sysnum, void *params, uarg[1] = (intptr_t) p->oldname; /* const char * */ iarg[2] = p->newdfd; /* l_int */ uarg[3] = (intptr_t) p->newname; /* const char * */ - iarg[4] = p->flags; /* l_int */ + iarg[4] = p->flag; /* l_int */ *n_args = 5; break; } @@ -2034,7 +2034,8 @@ systrace_args(int sysnum, void *params, iarg[0] = p->dfd; /* l_int */ uarg[1] = (intptr_t) p->filename; /* const char * */ iarg[2] = p->amode; /* l_int */ - *n_args = 3; + iarg[3] = p->flag; /* int */ + *n_args = 4; break; } /* linux_pselect6 */ @@ -5064,6 +5065,9 @@ systrace_entry_setargdesc(int sysnum, in case 2: p = "l_int"; break; + case 3: + p = "int"; + break; default: break; }; Modified: head/sys/i386/linux/linux_proto.h ============================================================================== --- head/sys/i386/linux/linux_proto.h Sat Nov 19 07:19:37 2011 (r227693) +++ head/sys/i386/linux/linux_proto.h Sat Nov 19 07:20:20 2011 (r227694) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/i386/linux/syscalls.master 227691 2011-11-19 06:35:15Z ed + * created from FreeBSD: head/sys/i386/linux/syscalls.master 227693 2011-11-19 07:19:37Z ed */ #ifndef _LINUX_SYSPROTO_H_ @@ -961,7 +961,7 @@ struct linux_linkat_args { char oldname_l_[PADL_(const char *)]; const char * oldname; char oldname_r_[PADR_(const char *)]; char newdfd_l_[PADL_(l_int)]; l_int newdfd; char newdfd_r_[PADR_(l_int)]; char newname_l_[PADL_(const char *)]; const char * newname; char newname_r_[PADR_(const char *)]; - char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; + char flag_l_[PADL_(l_int)]; l_int flag; char flag_r_[PADR_(l_int)]; }; struct linux_symlinkat_args { char oldname_l_[PADL_(const char *)]; const char * oldname; char oldname_r_[PADR_(const char *)]; @@ -983,6 +983,7 @@ struct linux_faccessat_args { char dfd_l_[PADL_(l_int)]; l_int dfd; char dfd_r_[PADR_(l_int)]; char filename_l_[PADL_(const char *)]; const char * filename; char filename_r_[PADR_(const char *)]; char amode_l_[PADL_(l_int)]; l_int amode; char amode_r_[PADR_(l_int)]; + char flag_l_[PADL_(l_int)]; l_int flag; char flag_r_[PADR_(l_int)]; }; struct linux_pselect6_args { register_t dummy; Modified: head/sys/i386/linux/linux_syscall.h ============================================================================== --- head/sys/i386/linux/linux_syscall.h Sat Nov 19 07:19:37 2011 (r227693) +++ head/sys/i386/linux/linux_syscall.h Sat Nov 19 07:20:20 2011 (r227694) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/i386/linux/syscalls.master 227691 2011-11-19 06:35:15Z ed + * created from FreeBSD: head/sys/i386/linux/syscalls.master 227693 2011-11-19 07:19:37Z ed */ #define LINUX_SYS_exit 1 Modified: head/sys/i386/linux/linux_syscalls.c ============================================================================== --- head/sys/i386/linux/linux_syscalls.c Sat Nov 19 07:19:37 2011 (r227693) +++ head/sys/i386/linux/linux_syscalls.c Sat Nov 19 07:20:20 2011 (r227694) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/i386/linux/syscalls.master 227691 2011-11-19 06:35:15Z ed + * created from FreeBSD: head/sys/i386/linux/syscalls.master 227693 2011-11-19 07:19:37Z ed */ const char *linux_syscallnames[] = { Modified: head/sys/i386/linux/linux_sysent.c ============================================================================== --- head/sys/i386/linux/linux_sysent.c Sat Nov 19 07:19:37 2011 (r227693) +++ head/sys/i386/linux/linux_sysent.c Sat Nov 19 07:20:20 2011 (r227694) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/i386/linux/syscalls.master 227691 2011-11-19 06:35:15Z ed + * created from FreeBSD: head/sys/i386/linux/syscalls.master 227693 2011-11-19 07:19:37Z ed */ #include Modified: head/sys/i386/linux/linux_systrace_args.c ============================================================================== --- head/sys/i386/linux/linux_systrace_args.c Sat Nov 19 07:19:37 2011 (r227693) +++ head/sys/i386/linux/linux_systrace_args.c Sat Nov 19 07:20:20 2011 (r227694) @@ -2087,7 +2087,7 @@ systrace_args(int sysnum, void *params, uarg[1] = (intptr_t) p->oldname; /* const char * */ iarg[2] = p->newdfd; /* l_int */ uarg[3] = (intptr_t) p->newname; /* const char * */ - iarg[4] = p->flags; /* l_int */ + iarg[4] = p->flag; /* l_int */ *n_args = 5; break; } @@ -2125,7 +2125,8 @@ systrace_args(int sysnum, void *params, iarg[0] = p->dfd; /* l_int */ uarg[1] = (intptr_t) p->filename; /* const char * */ iarg[2] = p->amode; /* l_int */ - *n_args = 3; + iarg[3] = p->flag; /* l_int */ + *n_args = 4; break; } /* linux_pselect6 */ @@ -5360,6 +5361,9 @@ systrace_entry_setargdesc(int sysnum, in case 2: p = "l_int"; break; + case 3: + p = "l_int"; + break; default: break; }; From owner-svn-src-all@FreeBSD.ORG Sat Nov 19 07:40:14 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D9811065670; Sat, 19 Nov 2011 07:40:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3CFC98FC08; Sat, 19 Nov 2011 07:40:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAJ7eEBD029683; Sat, 19 Nov 2011 07:40:14 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAJ7eEpb029681; Sat, 19 Nov 2011 07:40:14 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201111190740.pAJ7eEpb029681@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 19 Nov 2011 07:40:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227695 - head/sys/fs/nullfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Nov 2011 07:40:14 -0000 Author: kib Date: Sat Nov 19 07:40:13 2011 New Revision: 227695 URL: http://svn.freebsd.org/changeset/base/227695 Log: Use the plain panic calls, without additional printing around them. The debugger and dumping support is adequate. Tested by: pho MFC after: 1 week Modified: head/sys/fs/nullfs/null_subr.c Modified: head/sys/fs/nullfs/null_subr.c ============================================================================== --- head/sys/fs/nullfs/null_subr.c Sat Nov 19 07:20:20 2011 (r227694) +++ head/sys/fs/nullfs/null_subr.c Sat Nov 19 07:40:13 2011 (r227695) @@ -289,22 +289,12 @@ null_checkvp(vp, fil, lno) #endif if (a->null_lowervp == NULLVP) { /* Should never happen */ - int i; u_long *p; - printf("vp = %p, ZERO ptr\n", (void *)vp); - for (p = (u_long *) a, i = 0; i < 8; i++) - printf(" %lx", p[i]); - printf("\n"); - panic("null_checkvp"); + panic("null_checkvp %p", vp); } VI_LOCK_FLAGS(a->null_lowervp, MTX_DUPOK); - if (a->null_lowervp->v_usecount < 1) { - int i; u_long *p; - printf("vp = %p, unref'ed lowervp\n", (void *)vp); - for (p = (u_long *) a, i = 0; i < 8; i++) - printf(" %lx", p[i]); - printf("\n"); - panic ("null with unref'ed lowervp"); - } + if (a->null_lowervp->v_usecount < 1) + panic ("null with unref'ed lowervp, vp %p lvp %p", + vp, a->null_lowervp); VI_UNLOCK(a->null_lowervp); #ifdef notyet printf("null %x/%d -> %x/%d [%s, %d]\n", From owner-svn-src-all@FreeBSD.ORG Sat Nov 19 07:41:38 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1C1F9106566B; Sat, 19 Nov 2011 07:41:38 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0BF768FC0C; Sat, 19 Nov 2011 07:41:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAJ7fb5X029758; Sat, 19 Nov 2011 07:41:37 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAJ7fbQ4029756; Sat, 19 Nov 2011 07:41:37 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201111190741.pAJ7fbQ4029756@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 19 Nov 2011 07:41:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227696 - head/sys/fs/nullfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Nov 2011 07:41:38 -0000 Author: kib Date: Sat Nov 19 07:41:37 2011 New Revision: 227696 URL: http://svn.freebsd.org/changeset/base/227696 Log: Do not use NULLVPTOLOWERVP() in the null_print(). If diagnostic is compiled in, and show vnode is used from ddb on the faulty nullfs vnode, we get panic instead of vnode dump. MFC after: 1 week Modified: head/sys/fs/nullfs/null_vnops.c Modified: head/sys/fs/nullfs/null_vnops.c ============================================================================== --- head/sys/fs/nullfs/null_vnops.c Sat Nov 19 07:40:13 2011 (r227695) +++ head/sys/fs/nullfs/null_vnops.c Sat Nov 19 07:41:37 2011 (r227696) @@ -729,7 +729,7 @@ null_print(struct vop_print_args *ap) { struct vnode *vp = ap->a_vp; - printf("\tvp=%p, lowervp=%p\n", vp, NULLVPTOLOWERVP(vp)); + printf("\tvp=%p, lowervp=%p\n", vp, VTONULL(vp)->null_lowervp); return (0); } From owner-svn-src-all@FreeBSD.ORG Sat Nov 19 07:50:49 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B46C41065673; Sat, 19 Nov 2011 07:50:49 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A1C358FC14; Sat, 19 Nov 2011 07:50:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAJ7onN0030094; Sat, 19 Nov 2011 07:50:49 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAJ7onQ2030087; Sat, 19 Nov 2011 07:50:49 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201111190750.pAJ7onQ2030087@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 19 Nov 2011 07:50:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227697 - in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs fs/devfs fs/nullfs fs/pseudofs kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Nov 2011 07:50:49 -0000 Author: kib Date: Sat Nov 19 07:50:49 2011 New Revision: 227697 URL: http://svn.freebsd.org/changeset/base/227697 Log: Existing VOP_VPTOCNP() interface has a fatal flow that is critical for nullfs. The problem is that resulting vnode is only required to be held on return from the successfull call to vop, instead of being referenced. Nullfs VOP_INACTIVE() method reclaims the vnode, which in combination with the VOP_VPTOCNP() interface means that the directory vnode returned from VOP_VPTOCNP() is reclaimed in advance, causing vn_fullpath() to error with EBADF or like. Change the interface for VOP_VPTOCNP(), now the dvp must be referenced. Convert all in-tree implementations of VOP_VPTOCNP(), which is trivial, because vhold(9) and vref(9) are similar in the locking prerequisites. Out-of-tree fs implementation of VOP_VPTOCNP(), if any, should have no trouble with the fix. Tested by: pho Reviewed by: mckusick MFC after: 3 weeks (subject of re approval) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c head/sys/fs/devfs/devfs_vnops.c head/sys/fs/nullfs/null_vnops.c head/sys/fs/pseudofs/pseudofs_vnops.c head/sys/kern/vfs_cache.c head/sys/kern/vfs_default.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Sat Nov 19 07:41:37 2011 (r227696) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Sat Nov 19 07:50:49 2011 (r227697) @@ -1594,7 +1594,7 @@ zfsctl_snapshot_vptocnp(struct vop_vptoc *ap->a_buflen -= len; bcopy(sep->se_name, ap->a_buf + *ap->a_buflen, len); mutex_exit(&sdp->sd_lock); - vhold(dvp); + vref(dvp); *ap->a_vpp = dvp; } VN_RELE(dvp); Modified: head/sys/fs/devfs/devfs_vnops.c ============================================================================== --- head/sys/fs/devfs/devfs_vnops.c Sat Nov 19 07:41:37 2011 (r227696) +++ head/sys/fs/devfs/devfs_vnops.c Sat Nov 19 07:50:49 2011 (r227697) @@ -261,7 +261,7 @@ devfs_vptocnp(struct vop_vptocnp_args *a } else if (vp->v_type == VDIR) { if (dd == dmp->dm_rootdir) { *dvp = vp; - vhold(*dvp); + vref(*dvp); goto finished; } i -= dd->de_dirent->d_namlen; @@ -289,6 +289,8 @@ devfs_vptocnp(struct vop_vptocnp_args *a mtx_unlock(&devfs_de_interlock); vholdl(*dvp); VI_UNLOCK(*dvp); + vref(*dvp); + vdrop(*dvp); } else { mtx_unlock(&devfs_de_interlock); error = ENOENT; Modified: head/sys/fs/nullfs/null_vnops.c ============================================================================== --- head/sys/fs/nullfs/null_vnops.c Sat Nov 19 07:41:37 2011 (r227696) +++ head/sys/fs/nullfs/null_vnops.c Sat Nov 19 07:50:49 2011 (r227697) @@ -784,6 +784,7 @@ null_vptocnp(struct vop_vptocnp_args *ap vhold(lvp); VOP_UNLOCK(vp, 0); /* vp is held by vn_vptocnp_locked that called us */ ldvp = lvp; + vref(lvp); error = vn_vptocnp(&ldvp, cred, ap->a_buf, ap->a_buflen); vdrop(lvp); if (error != 0) { @@ -797,19 +798,17 @@ null_vptocnp(struct vop_vptocnp_args *ap */ error = vn_lock(ldvp, LK_EXCLUSIVE); if (error != 0) { + vrele(ldvp); vn_lock(vp, locked | LK_RETRY); - vdrop(ldvp); return (ENOENT); } vref(ldvp); - vdrop(ldvp); error = null_nodeget(vp->v_mount, ldvp, dvp); if (error == 0) { #ifdef DIAGNOSTIC NULLVPTOLOWERVP(*dvp); #endif - vhold(*dvp); - vput(*dvp); + VOP_UNLOCK(*dvp, 0); /* keep reference on *dvp */ } else vput(ldvp); Modified: head/sys/fs/pseudofs/pseudofs_vnops.c ============================================================================== --- head/sys/fs/pseudofs/pseudofs_vnops.c Sat Nov 19 07:41:37 2011 (r227696) +++ head/sys/fs/pseudofs/pseudofs_vnops.c Sat Nov 19 07:50:49 2011 (r227697) @@ -410,8 +410,7 @@ pfs_vptocnp(struct vop_vptocnp_args *ap) } *buflen = i; - vhold(*dvp); - vput(*dvp); + VOP_UNLOCK(*dvp, 0); vn_lock(vp, locked | LK_RETRY); vfs_unbusy(mp); Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Sat Nov 19 07:41:37 2011 (r227696) +++ head/sys/kern/vfs_cache.c Sat Nov 19 07:50:49 2011 (r227697) @@ -1068,16 +1068,8 @@ vn_vptocnp(struct vnode **vp, struct ucr CACHE_RLOCK(); error = vn_vptocnp_locked(vp, cred, buf, buflen); - if (error == 0) { - /* - * vn_vptocnp_locked() dropped hold acquired by - * VOP_VPTOCNP immediately after locking the - * cache. Since we are going to drop the cache rlock, - * re-hold the result. - */ - vhold(*vp); + if (error == 0) CACHE_RUNLOCK(); - } return (error); } @@ -1096,6 +1088,9 @@ vn_vptocnp_locked(struct vnode **vp, str if (ncp != NULL) { if (*buflen < ncp->nc_nlen) { CACHE_RUNLOCK(); + vfslocked = VFS_LOCK_GIANT((*vp)->v_mount); + vrele(*vp); + VFS_UNLOCK_GIANT(vfslocked); numfullpathfail4++; error = ENOMEM; SDT_PROBE(vfs, namecache, fullpath, return, error, @@ -1106,18 +1101,23 @@ vn_vptocnp_locked(struct vnode **vp, str memcpy(buf + *buflen, ncp->nc_name, ncp->nc_nlen); SDT_PROBE(vfs, namecache, fullpath, hit, ncp->nc_dvp, ncp->nc_name, vp, 0, 0); + dvp = *vp; *vp = ncp->nc_dvp; + vref(*vp); + CACHE_RUNLOCK(); + vfslocked = VFS_LOCK_GIANT(dvp->v_mount); + vrele(dvp); + VFS_UNLOCK_GIANT(vfslocked); + CACHE_RLOCK(); return (0); } SDT_PROBE(vfs, namecache, fullpath, miss, vp, 0, 0, 0, 0); - vhold(*vp); CACHE_RUNLOCK(); vfslocked = VFS_LOCK_GIANT((*vp)->v_mount); vn_lock(*vp, LK_SHARED | LK_RETRY); error = VOP_VPTOCNP(*vp, &dvp, cred, buf, buflen); - VOP_UNLOCK(*vp, 0); - vdrop(*vp); + vput(*vp); VFS_UNLOCK_GIANT(vfslocked); if (error) { numfullpathfail2++; @@ -1128,16 +1128,20 @@ vn_vptocnp_locked(struct vnode **vp, str *vp = dvp; CACHE_RLOCK(); - if ((*vp)->v_iflag & VI_DOOMED) { + if (dvp->v_iflag & VI_DOOMED) { /* forced unmount */ CACHE_RUNLOCK(); - vdrop(*vp); + vfslocked = VFS_LOCK_GIANT(dvp->v_mount); + vrele(dvp); + VFS_UNLOCK_GIANT(vfslocked); error = ENOENT; SDT_PROBE(vfs, namecache, fullpath, return, error, vp, NULL, 0, 0); return (error); } - vdrop(*vp); + /* + * *vp has its use count incremented still. + */ return (0); } @@ -1149,10 +1153,11 @@ static int vn_fullpath1(struct thread *td, struct vnode *vp, struct vnode *rdir, char *buf, char **retbuf, u_int buflen) { - int error, slash_prefixed; + int error, slash_prefixed, vfslocked; #ifdef KDTRACE_HOOKS struct vnode *startvp = vp; #endif + struct vnode *vp1; buflen--; buf[buflen] = '\0'; @@ -1161,6 +1166,7 @@ vn_fullpath1(struct thread *td, struct v SDT_PROBE(vfs, namecache, fullpath, entry, vp, 0, 0, 0, 0); numfullpathcalls++; + vref(vp); CACHE_RLOCK(); if (vp->v_type != VDIR) { error = vn_vptocnp_locked(&vp, td->td_ucred, buf, &buflen); @@ -1168,6 +1174,9 @@ vn_fullpath1(struct thread *td, struct v return (error); if (buflen == 0) { CACHE_RUNLOCK(); + vfslocked = VFS_LOCK_GIANT(vp->v_mount); + vrele(vp); + VFS_UNLOCK_GIANT(vfslocked); return (ENOMEM); } buf[--buflen] = '/'; @@ -1177,16 +1186,29 @@ vn_fullpath1(struct thread *td, struct v if (vp->v_vflag & VV_ROOT) { if (vp->v_iflag & VI_DOOMED) { /* forced unmount */ CACHE_RUNLOCK(); + vfslocked = VFS_LOCK_GIANT(vp->v_mount); + vrele(vp); + VFS_UNLOCK_GIANT(vfslocked); error = ENOENT; SDT_PROBE(vfs, namecache, fullpath, return, error, vp, NULL, 0, 0); break; } - vp = vp->v_mount->mnt_vnodecovered; + vp1 = vp->v_mount->mnt_vnodecovered; + vref(vp1); + CACHE_RUNLOCK(); + vfslocked = VFS_LOCK_GIANT(vp->v_mount); + vrele(vp); + VFS_UNLOCK_GIANT(vfslocked); + vp = vp1; + CACHE_RLOCK(); continue; } if (vp->v_type != VDIR) { CACHE_RUNLOCK(); + vfslocked = VFS_LOCK_GIANT(vp->v_mount); + vrele(vp); + VFS_UNLOCK_GIANT(vfslocked); numfullpathfail1++; error = ENOTDIR; SDT_PROBE(vfs, namecache, fullpath, return, @@ -1198,6 +1220,9 @@ vn_fullpath1(struct thread *td, struct v break; if (buflen == 0) { CACHE_RUNLOCK(); + vfslocked = VFS_LOCK_GIANT(vp->v_mount); + vrele(vp); + VFS_UNLOCK_GIANT(vfslocked); error = ENOMEM; SDT_PROBE(vfs, namecache, fullpath, return, error, startvp, NULL, 0, 0); @@ -1211,6 +1236,9 @@ vn_fullpath1(struct thread *td, struct v if (!slash_prefixed) { if (buflen == 0) { CACHE_RUNLOCK(); + vfslocked = VFS_LOCK_GIANT(vp->v_mount); + vrele(vp); + VFS_UNLOCK_GIANT(vfslocked); numfullpathfail4++; SDT_PROBE(vfs, namecache, fullpath, return, ENOMEM, startvp, NULL, 0, 0); @@ -1220,6 +1248,9 @@ vn_fullpath1(struct thread *td, struct v } numfullpathfound++; CACHE_RUNLOCK(); + vfslocked = VFS_LOCK_GIANT(vp->v_mount); + vrele(vp); + VFS_UNLOCK_GIANT(vfslocked); SDT_PROBE(vfs, namecache, fullpath, return, 0, startvp, buf + buflen, 0, 0); Modified: head/sys/kern/vfs_default.c ============================================================================== --- head/sys/kern/vfs_default.c Sat Nov 19 07:41:37 2011 (r227696) +++ head/sys/kern/vfs_default.c Sat Nov 19 07:50:49 2011 (r227697) @@ -844,7 +844,7 @@ out: free(dirbuf, M_TEMP); if (!error) { *buflen = i; - vhold(*dvp); + vref(*dvp); } if (covered) { vput(*dvp); From owner-svn-src-all@FreeBSD.ORG Sat Nov 19 07:52:39 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84567106566C; Sat, 19 Nov 2011 07:52:39 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 73DA38FC15; Sat, 19 Nov 2011 07:52:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAJ7qdYs030193; Sat, 19 Nov 2011 07:52:39 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAJ7qdCU030191; Sat, 19 Nov 2011 07:52:39 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201111190752.pAJ7qdCU030191@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 19 Nov 2011 07:52:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227698 - head/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Nov 2011 07:52:39 -0000 Author: kib Date: Sat Nov 19 07:52:39 2011 New Revision: 227698 URL: http://svn.freebsd.org/changeset/base/227698 Log: Update the manpage for r227697. MFC after: 3 weeks Modified: head/share/man/man9/VOP_VPTOCNP.9 Modified: head/share/man/man9/VOP_VPTOCNP.9 ============================================================================== --- head/share/man/man9/VOP_VPTOCNP.9 Sat Nov 19 07:50:49 2011 (r227697) +++ head/share/man/man9/VOP_VPTOCNP.9 Sat Nov 19 07:52:39 2011 (r227698) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 7, 2008 +.Dd November 19, 2011 .Dt VOP_VPTOCNP 9 .Os .Sh NAME @@ -65,9 +65,9 @@ is not a directory, then .Nm returns ENOENT. .Sh LOCKS -The vnode should be locked on entry and will still be locked on exit. The -parent directory vnode will be unlocked on a successful exit. However, it -will have its hold count incremented. +The vnode should be locked on entry and will still be locked on exit. +The parent directory vnode will be unlocked on a successful exit. +However, it will have its use count incremented. .Sh RETURN VALUES Zero is returned on success, otherwise an error code is returned. .Sh ERRORS From owner-svn-src-all@FreeBSD.ORG Sat Nov 19 09:13:59 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 28052106564A; Sat, 19 Nov 2011 09:13:59 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F237B8FC0A; Sat, 19 Nov 2011 09:13:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAJ9Dw9N032886; Sat, 19 Nov 2011 09:13:58 GMT (envelope-from philip@svn.freebsd.org) Received: (from philip@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAJ9Dwhh032884; Sat, 19 Nov 2011 09:13:58 GMT (envelope-from philip@svn.freebsd.org) Message-Id: <201111190913.pAJ9Dwhh032884@svn.freebsd.org> From: Philip Paeps Date: Sat, 19 Nov 2011 09:13:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227699 - head/sys/dev/sfxge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Nov 2011 09:13:59 -0000 Author: philip Date: Sat Nov 19 09:13:58 2011 New Revision: 227699 URL: http://svn.freebsd.org/changeset/base/227699 Log: sfxge: Fix if_baudrate reports This field is supposed to be set to the interface bit rate, but for some reason I thought it was denominated in kilobits. Multiply the values up accordingly, taking care to saturate rather than overflow on 32-bit architectures. Submitted by: Ben Hutchings MFC after: 3 weeks Modified: head/sys/dev/sfxge/sfxge_port.c Modified: head/sys/dev/sfxge/sfxge_port.c ============================================================================== --- head/sys/dev/sfxge/sfxge_port.c Sat Nov 19 07:52:39 2011 (r227698) +++ head/sys/dev/sfxge/sfxge_port.c Sat Nov 19 09:13:58 2011 (r227699) @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include @@ -219,14 +220,14 @@ sfxge_port_link_fc_handler(SYSCTL_HANDLE #endif /* SFXGE_HAVE_PAUSE_MEDIAOPTS */ -static const int sfxge_link_speed_kbit[EFX_LINK_NMODES] = { - [EFX_LINK_10HDX] = 10000, - [EFX_LINK_10FDX] = 10000, - [EFX_LINK_100HDX] = 100000, - [EFX_LINK_100FDX] = 100000, - [EFX_LINK_1000HDX] = 1000000, - [EFX_LINK_1000FDX] = 1000000, - [EFX_LINK_10000FDX] = 10000000, +static const u_long sfxge_link_baudrate[EFX_LINK_NMODES] = { + [EFX_LINK_10HDX] = IF_Mbps(10), + [EFX_LINK_10FDX] = IF_Mbps(10), + [EFX_LINK_100HDX] = IF_Mbps(100), + [EFX_LINK_100FDX] = IF_Mbps(100), + [EFX_LINK_1000HDX] = IF_Gbps(1), + [EFX_LINK_1000FDX] = IF_Gbps(1), + [EFX_LINK_10000FDX] = MIN(IF_Gbps(10ULL), ULONG_MAX), }; void @@ -245,7 +246,7 @@ sfxge_mac_link_update(struct sfxge_softc /* Push link state update to the OS */ link_state = (port->link_mode != EFX_LINK_DOWN ? LINK_STATE_UP : LINK_STATE_DOWN); - sc->ifnet->if_baudrate = sfxge_link_speed_kbit[port->link_mode]; + sc->ifnet->if_baudrate = sfxge_link_baudrate[port->link_mode]; if_link_state_change(sc->ifnet, link_state); } From owner-svn-src-all@FreeBSD.ORG Sat Nov 19 09:16:53 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7EEF41065672; Sat, 19 Nov 2011 09:16:53 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 552918FC0A; Sat, 19 Nov 2011 09:16:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAJ9GrPh033020; Sat, 19 Nov 2011 09:16:53 GMT (envelope-from philip@svn.freebsd.org) Received: (from philip@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAJ9Grra033017; Sat, 19 Nov 2011 09:16:53 GMT (envelope-from philip@svn.freebsd.org) Message-Id: <201111190916.pAJ9Grra033017@svn.freebsd.org> From: Philip Paeps Date: Sat, 19 Nov 2011 09:16:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227700 - head/sys/dev/sfxge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Nov 2011 09:16:53 -0000 Author: philip Date: Sat Nov 19 09:16:52 2011 New Revision: 227700 URL: http://svn.freebsd.org/changeset/base/227700 Log: sfxge: Remove interrupt self-test code It's not currently used; it didn't build on 32-bit and the previous build fix is incorrect. If we really implement self-tests we can do this again properly. Submitted by: Ben Hutchings MFC after: 3 weeks Modified: head/sys/dev/sfxge/sfxge.h head/sys/dev/sfxge/sfxge_intr.c Modified: head/sys/dev/sfxge/sfxge.h ============================================================================== --- head/sys/dev/sfxge/sfxge.h Sat Nov 19 09:13:58 2011 (r227699) +++ head/sys/dev/sfxge/sfxge.h Sat Nov 19 09:16:52 2011 (r227700) @@ -144,7 +144,6 @@ struct sfxge_intr { int n_alloc; int type; efsys_mem_t status; - uint64_t mask; uint32_t zero_count; }; Modified: head/sys/dev/sfxge/sfxge_intr.c ============================================================================== --- head/sys/dev/sfxge/sfxge_intr.c Sat Nov 19 09:13:58 2011 (r227699) +++ head/sys/dev/sfxge/sfxge_intr.c Sat Nov 19 09:16:52 2011 (r227700) @@ -65,15 +65,9 @@ sfxge_intr_line_filter(void *arg) KASSERT(intr->type == EFX_INTR_LINE, ("intr->type != EFX_INTR_LINE")); - if (intr->state != SFXGE_INTR_STARTED && - intr->state != SFXGE_INTR_TESTING) + if (intr->state != SFXGE_INTR_STARTED) return FILTER_STRAY; - if (intr->state == SFXGE_INTR_TESTING) { - intr->mask |= 1; /* only one interrupt */ - return FILTER_HANDLED; - } - (void)efx_intr_status_line(enp, &fatal, &qmask); if (fatal) { @@ -137,21 +131,9 @@ sfxge_intr_message(void *arg) KASSERT(intr->type == EFX_INTR_MESSAGE, ("intr->type != EFX_INTR_MESSAGE")); - if (intr->state != SFXGE_INTR_STARTED && - intr->state != SFXGE_INTR_TESTING) + if (intr->state != SFXGE_INTR_STARTED) return; - if (intr->state == SFXGE_INTR_TESTING) { - uint64_t mask; - - do { - mask = intr->mask; - } while (atomic_cmpset_ptr(&intr->mask, mask, - mask | (1 << index)) == 0); - - return; - } - (void)efx_intr_status_message(enp, index, &fatal); if (fatal) { @@ -447,7 +429,6 @@ sfxge_intr_stop(struct sfxge_softc *sc) intr->state = SFXGE_INTR_INITIALIZED; /* Disable interrupts at the NIC */ - intr->mask = 0; efx_intr_disable(sc->enp); /* Disable interrupts at the bus */ @@ -480,13 +461,11 @@ sfxge_intr_start(struct sfxge_softc *sc) if ((rc = sfxge_intr_bus_enable(sc)) != 0) goto fail; - intr->state = SFXGE_INTR_TESTING; + intr->state = SFXGE_INTR_STARTED; /* Enable interrupts at the NIC */ efx_intr_enable(sc->enp); - intr->state = SFXGE_INTR_STARTED; - return (0); fail: From owner-svn-src-all@FreeBSD.ORG Sat Nov 19 10:11:51 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 89038106564A; Sat, 19 Nov 2011 10:11:51 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6EAB48FC14; Sat, 19 Nov 2011 10:11:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAJABpCT034828; Sat, 19 Nov 2011 10:11:51 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAJABp0N034812; Sat, 19 Nov 2011 10:11:51 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201111191011.pAJABp0N034812@svn.freebsd.org> From: Hans Petter Selasky Date: Sat, 19 Nov 2011 10:11:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227701 - in head/sys: arm/xscale/ixp425 dev/ahci dev/ata dev/gpio dev/mvs dev/ppbus dev/ppc dev/siba dev/siis dev/usb kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Nov 2011 10:11:51 -0000 Author: hselasky Date: Sat Nov 19 10:11:50 2011 New Revision: 227701 URL: http://svn.freebsd.org/changeset/base/227701 Log: Move the device_delete_all_children() function from usb_util.c to kern/subr_bus.c. Simplify this function so that it no longer depends on malloc() to execute. Identify a few other places where it makes sense to use device_delete_all_children(). MFC after: 1 week Modified: head/sys/arm/xscale/ixp425/avila_ata.c head/sys/dev/ahci/ahci.c head/sys/dev/ata/ata-disk.c head/sys/dev/ata/ata-pci.c head/sys/dev/gpio/gpiobus.c head/sys/dev/mvs/mvs_pci.c head/sys/dev/mvs/mvs_soc.c head/sys/dev/ppbus/ppbconf.c head/sys/dev/ppc/ppc.c head/sys/dev/siba/siba_core.c head/sys/dev/siis/siis.c head/sys/dev/usb/usb_util.c head/sys/dev/usb/usb_util.h head/sys/kern/subr_bus.c head/sys/sys/bus.h Modified: head/sys/arm/xscale/ixp425/avila_ata.c ============================================================================== --- head/sys/arm/xscale/ixp425/avila_ata.c Sat Nov 19 09:16:52 2011 (r227700) +++ head/sys/arm/xscale/ixp425/avila_ata.c Sat Nov 19 10:11:50 2011 (r227701) @@ -259,17 +259,11 @@ static int ata_avila_detach(device_t dev) { struct ata_avila_softc *sc = device_get_softc(dev); - device_t *children; - int nc; /* XXX quiesce gpio? */ /* detach & delete all children */ - if (device_get_children(dev, &children, &nc) == 0) { - if (nc > 0) - device_delete_child(dev, children[0]); - free(children, M_TEMP); - } + device_delete_all_children(dev); bus_teardown_intr(dev, sc->sc_irq, sc->sc_ih); bus_release_resource(dev, SYS_RES_IRQ, sc->sc_rid, sc->sc_irq); Modified: head/sys/dev/ahci/ahci.c ============================================================================== --- head/sys/dev/ahci/ahci.c Sat Nov 19 09:16:52 2011 (r227700) +++ head/sys/dev/ahci/ahci.c Sat Nov 19 10:11:50 2011 (r227701) @@ -515,15 +515,11 @@ static int ahci_detach(device_t dev) { struct ahci_controller *ctlr = device_get_softc(dev); - device_t *children; - int nchildren, i; + int i; /* Detach & delete all children */ - if (!device_get_children(dev, &children, &nchildren)) { - for (i = 0; i < nchildren; i++) - device_delete_child(dev, children[i]); - free(children, M_TEMP); - } + device_delete_all_children(dev); + /* Free interrupts. */ for (i = 0; i < ctlr->numirqs; i++) { if (ctlr->irqs[i].r_irq) { Modified: head/sys/dev/ata/ata-disk.c ============================================================================== --- head/sys/dev/ata/ata-disk.c Sat Nov 19 09:16:52 2011 (r227700) +++ head/sys/dev/ata/ata-disk.c Sat Nov 19 10:11:50 2011 (r227701) @@ -172,8 +172,6 @@ ad_detach(device_t dev) { struct ad_softc *adp = device_get_ivars(dev); struct ata_device *atadev = device_get_softc(dev); - device_t *children; - int nchildren, i; /* check that we have a valid disk to detach */ if (!device_get_ivars(dev)) @@ -183,12 +181,7 @@ ad_detach(device_t dev) callout_drain(&atadev->spindown_timer); /* detach & delete all children */ - if (!device_get_children(dev, &children, &nchildren)) { - for (i = 0; i < nchildren; i++) - if (children[i]) - device_delete_child(dev, children[i]); - free(children, M_TEMP); - } + device_delete_all_children(dev); /* destroy disk from the system so we don't get any further requests */ disk_destroy(adp->disk); Modified: head/sys/dev/ata/ata-pci.c ============================================================================== --- head/sys/dev/ata/ata-pci.c Sat Nov 19 09:16:52 2011 (r227700) +++ head/sys/dev/ata/ata-pci.c Sat Nov 19 10:11:50 2011 (r227701) @@ -136,15 +136,10 @@ int ata_pci_detach(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); - device_t *children; - int nchildren, i; /* detach & delete all children */ - if (!device_get_children(dev, &children, &nchildren)) { - for (i = 0; i < nchildren; i++) - device_delete_child(dev, children[i]); - free(children, M_TEMP); - } + device_delete_all_children(dev); + if (ctlr->r_irq) { bus_teardown_intr(dev, ctlr->r_irq, ctlr->handle); bus_release_resource(dev, SYS_RES_IRQ, ctlr->r_irq_rid, ctlr->r_irq); Modified: head/sys/dev/gpio/gpiobus.c ============================================================================== --- head/sys/dev/gpio/gpiobus.c Sat Nov 19 09:16:52 2011 (r227700) +++ head/sys/dev/gpio/gpiobus.c Sat Nov 19 10:11:50 2011 (r227701) @@ -219,8 +219,7 @@ static int gpiobus_detach(device_t dev) { struct gpiobus_softc *sc = GPIOBUS_SOFTC(dev); - int err, ndevs, i; - device_t *devlist; + int err; KASSERT(mtx_initialized(&sc->sc_mtx), ("gpiobus mutex not initialized")); @@ -228,16 +227,14 @@ gpiobus_detach(device_t dev) if ((err = bus_generic_detach(dev)) != 0) return (err); - if ((err = device_get_children(dev, &devlist, &ndevs)) != 0) - return (err); - for (i = 0; i < ndevs; i++) - device_delete_child(dev, devlist[i]); + + /* detach and delete all children */ + device_delete_all_children(dev); if (sc->sc_pins_mapped) { free(sc->sc_pins_mapped, M_DEVBUF); sc->sc_pins_mapped = NULL; } - free(devlist, M_TEMP); return (0); } Modified: head/sys/dev/mvs/mvs_pci.c ============================================================================== --- head/sys/dev/mvs/mvs_pci.c Sat Nov 19 09:16:52 2011 (r227700) +++ head/sys/dev/mvs/mvs_pci.c Sat Nov 19 10:11:50 2011 (r227701) @@ -177,15 +177,10 @@ static int mvs_detach(device_t dev) { struct mvs_controller *ctlr = device_get_softc(dev); - device_t *children; - int nchildren, i; /* Detach & delete all children */ - if (!device_get_children(dev, &children, &nchildren)) { - for (i = 0; i < nchildren; i++) - device_delete_child(dev, children[i]); - free(children, M_TEMP); - } + device_delete_all_children(dev); + /* Free interrupt. */ if (ctlr->irq.r_irq) { bus_teardown_intr(dev, ctlr->irq.r_irq, Modified: head/sys/dev/mvs/mvs_soc.c ============================================================================== --- head/sys/dev/mvs/mvs_soc.c Sat Nov 19 09:16:52 2011 (r227700) +++ head/sys/dev/mvs/mvs_soc.c Sat Nov 19 10:11:50 2011 (r227701) @@ -173,15 +173,10 @@ static int mvs_detach(device_t dev) { struct mvs_controller *ctlr = device_get_softc(dev); - device_t *children; - int nchildren, i; /* Detach & delete all children */ - if (!device_get_children(dev, &children, &nchildren)) { - for (i = 0; i < nchildren; i++) - device_delete_child(dev, children[i]); - free(children, M_TEMP); - } + device_delete_all_children(dev); + /* Free interrupt. */ if (ctlr->irq.r_irq) { bus_teardown_intr(dev, ctlr->irq.r_irq, Modified: head/sys/dev/ppbus/ppbconf.c ============================================================================== --- head/sys/dev/ppbus/ppbconf.c Sat Nov 19 09:16:52 2011 (r227700) +++ head/sys/dev/ppbus/ppbconf.c Sat Nov 19 10:11:50 2011 (r227701) @@ -422,20 +422,14 @@ ppbus_attach(device_t dev) static int ppbus_detach(device_t dev) { - device_t *children; - int error, nchildren, i; + int error; error = bus_generic_detach(dev); if (error) return (error); /* detach & delete all children */ - if (!device_get_children(dev, &children, &nchildren)) { - for (i = 0; i < nchildren; i++) - if (children[i]) - device_delete_child(dev, children[i]); - free(children, M_TEMP); - } + device_delete_all_children(dev); return (0); } Modified: head/sys/dev/ppc/ppc.c ============================================================================== --- head/sys/dev/ppc/ppc.c Sat Nov 19 09:16:52 2011 (r227700) +++ head/sys/dev/ppc/ppc.c Sat Nov 19 10:11:50 2011 (r227701) @@ -1851,20 +1851,13 @@ int ppc_detach(device_t dev) { struct ppc_data *ppc = DEVTOSOFTC(dev); - device_t *children; - int nchildren, i; if (ppc->res_irq == 0) { return (ENXIO); } /* detach & delete all children */ - if (!device_get_children(dev, &children, &nchildren)) { - for (i = 0; i < nchildren; i++) - if (children[i]) - device_delete_child(dev, children[i]); - free(children, M_TEMP); - } + device_delete_all_children(dev); if (ppc->res_irq != 0) { bus_teardown_intr(dev, ppc->res_irq, ppc->intr_cookie); Modified: head/sys/dev/siba/siba_core.c ============================================================================== --- head/sys/dev/siba/siba_core.c Sat Nov 19 09:16:52 2011 (r227700) +++ head/sys/dev/siba/siba_core.c Sat Nov 19 10:11:50 2011 (r227701) @@ -214,16 +214,8 @@ siba_core_attach(struct siba_softc *siba int siba_core_detach(struct siba_softc *siba) { - device_t *devlistp; - int devcnt, error = 0, i; - - error = device_get_children(siba->siba_dev, &devlistp, &devcnt); - if (error != 0) - return (0); - - for ( i = 0 ; i < devcnt ; i++) - device_delete_child(siba->siba_dev, devlistp[i]); - free(devlistp, M_TEMP); + /* detach & delete all children */ + device_delete_all_children(siba->siba_dev); return (0); } Modified: head/sys/dev/siis/siis.c ============================================================================== --- head/sys/dev/siis/siis.c Sat Nov 19 09:16:52 2011 (r227700) +++ head/sys/dev/siis/siis.c Sat Nov 19 10:11:50 2011 (r227701) @@ -205,15 +205,10 @@ static int siis_detach(device_t dev) { struct siis_controller *ctlr = device_get_softc(dev); - device_t *children; - int nchildren, i; /* Detach & delete all children */ - if (!device_get_children(dev, &children, &nchildren)) { - for (i = 0; i < nchildren; i++) - device_delete_child(dev, children[i]); - free(children, M_TEMP); - } + device_delete_all_children(dev); + /* Free interrupts. */ if (ctlr->irq.r_irq) { bus_teardown_intr(dev, ctlr->irq.r_irq, Modified: head/sys/dev/usb/usb_util.c ============================================================================== --- head/sys/dev/usb/usb_util.c Sat Nov 19 09:16:52 2011 (r227700) +++ head/sys/dev/usb/usb_util.c Sat Nov 19 10:11:50 2011 (r227701) @@ -58,31 +58,6 @@ #include /*------------------------------------------------------------------------* - * device_delete_all_children - delete all children of a device - *------------------------------------------------------------------------*/ -#ifndef device_delete_all_children -int -device_delete_all_children(device_t dev) -{ - device_t *devlist; - int devcount; - int error; - - error = device_get_children(dev, &devlist, &devcount); - if (error == 0) { - while (devcount-- > 0) { - error = device_delete_child(dev, devlist[devcount]); - if (error) { - break; - } - } - free(devlist, M_TEMP); - } - return (error); -} -#endif - -/*------------------------------------------------------------------------* * device_set_usb_desc * * This function can be called at probe or attach to set the USB Modified: head/sys/dev/usb/usb_util.h ============================================================================== --- head/sys/dev/usb/usb_util.h Sat Nov 19 09:16:52 2011 (r227700) +++ head/sys/dev/usb/usb_util.h Sat Nov 19 10:11:50 2011 (r227701) @@ -27,7 +27,6 @@ #ifndef _USB_UTIL_H_ #define _USB_UTIL_H_ -int device_delete_all_children(device_t dev); uint8_t usb_make_str_desc(void *ptr, uint16_t max_len, const char *s); void usb_printbcd(char *p, uint16_t p_len, uint16_t bcd); void usb_trim_spaces(char *p); Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Sat Nov 19 09:16:52 2011 (r227700) +++ head/sys/kern/subr_bus.c Sat Nov 19 10:11:50 2011 (r227701) @@ -1881,6 +1881,39 @@ device_delete_child(device_t dev, device } /** + * @brief Delete all children devices of the given device, if any. + * + * This function deletes all children devices of the given device, if + * any, using the device_delete_child() function for each device it + * finds. If a child device cannot be deleted, this function will + * return an error code. + * + * @param dev the parent device + * + * @retval 0 success + * @retval non-zero a device would not detach + */ +int +device_delete_all_children(device_t dev) +{ + device_t child; + int error; + + PDEBUG(("Deleting all children of %s", DEVICENAME(dev))); + + error = 0; + + while ( (child = TAILQ_FIRST(&dev->children)) ) { + error = device_delete_child(dev, child); + if (error) { + PDEBUG(("Failed deleting %s", DEVICENAME(child))); + break; + } + } + return (error); +} + +/** * @brief Find a device given a unit number * * This is similar to devclass_get_devices() but only searches for Modified: head/sys/sys/bus.h ============================================================================== --- head/sys/sys/bus.h Sat Nov 19 09:16:52 2011 (r227700) +++ head/sys/sys/bus.h Sat Nov 19 10:11:50 2011 (r227701) @@ -424,6 +424,7 @@ device_t device_add_child_ordered(device const char *name, int unit); void device_busy(device_t dev); int device_delete_child(device_t dev, device_t child); +int device_delete_all_children(device_t dev); int device_attach(device_t dev); int device_detach(device_t dev); void device_disable(device_t dev); From owner-svn-src-all@FreeBSD.ORG Sat Nov 19 10:24:47 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C79B106566B; Sat, 19 Nov 2011 10:24:47 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3138D8FC15; Sat, 19 Nov 2011 10:24:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAJAOlNw038088; Sat, 19 Nov 2011 10:24:47 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAJAOlOE038085; Sat, 19 Nov 2011 10:24:47 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201111191024.pAJAOlOE038085@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 19 Nov 2011 10:24:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227702 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Nov 2011 10:24:47 -0000 Author: pjd Date: Sat Nov 19 10:24:46 2011 New Revision: 227702 URL: http://svn.freebsd.org/changeset/base/227702 Log: MFC r226620: Update per-thread I/O statistics collection in ZFS. This allows to see processes I/O activity in 'top -m io' output. PR kern/156218 Reported by: Marcus Reid Patch by: avg Approved by: re (kib) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Sat Nov 19 10:11:50 2011 (r227701) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Sat Nov 19 10:24:46 2011 (r227702) @@ -627,6 +627,10 @@ dbuf_read(dmu_buf_impl_t *db, zio_t *zio } else if (db->db_state == DB_UNCACHED) { spa_t *spa = dn->dn_objset->os_spa; +#ifdef _KERNEL + curthread->td_ru.ru_inblock++; +#endif + if (zio == NULL) zio = zio_root(spa, NULL, NULL, ZIO_FLAG_CANFAIL); dbuf_read_impl(db, zio, &flags); Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Sat Nov 19 10:11:50 2011 (r227701) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Sat Nov 19 10:24:46 2011 (r227702) @@ -397,9 +397,12 @@ dmu_buf_hold_array_by_dnode(dnode_t *dn, return (EIO); } /* initiate async i/o */ - if (read) { + if (read) (void) dbuf_read(db, zio, dbuf_flags); - } +#ifdef _KERNEL + else + curthread->td_ru.ru_oublock++; +#endif dbp[i] = &db->db; } rw_exit(&dn->dn_struct_rwlock); From owner-svn-src-all@FreeBSD.ORG Sat Nov 19 10:26:35 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 69533106564A; Sat, 19 Nov 2011 10:26:35 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4F32F8FC15; Sat, 19 Nov 2011 10:26:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAJAQZna038204; Sat, 19 Nov 2011 10:26:35 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAJAQZIP038200; Sat, 19 Nov 2011 10:26:35 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201111191026.pAJAQZIP038200@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 19 Nov 2011 10:26:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227703 - in stable/9/cddl/contrib/opensolaris: cmd/zdb head lib/libzpool/common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Nov 2011 10:26:35 -0000 Author: pjd Date: Sat Nov 19 10:26:34 2011 New Revision: 227703 URL: http://svn.freebsd.org/changeset/base/227703 Log: MFC r226613,r226615,r226616: r226613: libzpool task_alloc: pass only valid flags to kmem_alloc tqflags may contain other flags besided those that are suitable for kmem_alloc == umem_alloc Submitted by: avg r226615: thr_create: new_thread_ID may be NULL Submitted by: avg r226616: zdb: access dp_free_bpobj only if pool version is >= SPA_VERSION_DEADLISTS Submitted by: avg Approved by: re (kib) Modified: stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c stable/9/cddl/contrib/opensolaris/head/thread.h stable/9/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c Directory Properties: stable/9/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c Sat Nov 19 10:24:46 2011 (r227702) +++ stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c Sat Nov 19 10:26:34 2011 (r227703) @@ -2190,8 +2190,10 @@ dump_block_stats(spa_t *spa) */ (void) bpobj_iterate_nofree(&spa->spa_deferred_bpobj, count_block_cb, &zcb, NULL); - (void) bpobj_iterate_nofree(&spa->spa_dsl_pool->dp_free_bpobj, - count_block_cb, &zcb, NULL); + if (spa_version(spa) >= SPA_VERSION_DEADLISTS) { + (void) bpobj_iterate_nofree(&spa->spa_dsl_pool->dp_free_bpobj, + count_block_cb, &zcb, NULL); + } if (dump_opt['c'] > 1) flags |= TRAVERSE_PREFETCH_DATA; Modified: stable/9/cddl/contrib/opensolaris/head/thread.h ============================================================================== --- stable/9/cddl/contrib/opensolaris/head/thread.h Sat Nov 19 10:24:46 2011 (r227702) +++ stable/9/cddl/contrib/opensolaris/head/thread.h Sat Nov 19 10:26:34 2011 (r227703) @@ -76,6 +76,7 @@ static __inline int thr_create(void *stack_base, size_t stack_size, void *(*start_func) (void*), void *arg, long flags, thread_t *new_thread_ID) { + pthread_t dummy; int ret; assert(stack_base == NULL); @@ -85,9 +86,12 @@ thr_create(void *stack_base, size_t stac pthread_attr_t attr; pthread_attr_init(&attr); - if(flags & THR_DETACHED) + if (flags & THR_DETACHED) pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); + if (new_thread_ID == NULL) + new_thread_ID = &dummy; + /* This function ignores the THR_BOUND flag, since NPTL doesn't seem to support PTHREAD_SCOPE_PROCESS */ ret = pthread_create(new_thread_ID, &attr, start_func, arg); Modified: stable/9/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c Sat Nov 19 10:24:46 2011 (r227702) +++ stable/9/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c Sat Nov 19 10:26:34 2011 (r227703) @@ -87,7 +87,7 @@ again: if ((t = tq->tq_freelist) != NULL } mutex_exit(&tq->tq_lock); - t = kmem_alloc(sizeof (task_t), tqflags); + t = kmem_alloc(sizeof (task_t), tqflags & KM_SLEEP); mutex_enter(&tq->tq_lock); if (t != NULL) From owner-svn-src-all@FreeBSD.ORG Sat Nov 19 10:28:07 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF52C1065673; Sat, 19 Nov 2011 10:28:07 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6E3AF8FC0C; Sat, 19 Nov 2011 10:28:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAJAS71E038298; Sat, 19 Nov 2011 10:28:07 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAJAS7qx038296; Sat, 19 Nov 2011 10:28:07 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201111191028.pAJAS7qx038296@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 19 Nov 2011 10:28:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227704 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Nov 2011 10:28:08 -0000 Author: pjd Date: Sat Nov 19 10:28:06 2011 New Revision: 227704 URL: http://svn.freebsd.org/changeset/base/227704 Log: MFC r226617: zfs vdev_file_io_start: validate vdev before using vdev_tsd vdev_tsd can be NULL for certain vdev states. At least in userland testing with ztest. Submitted by: avg Approved by: re (kib) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c Sat Nov 19 10:26:34 2011 (r227703) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c Sat Nov 19 10:28:06 2011 (r227704) @@ -153,17 +153,19 @@ static int vdev_file_io_start(zio_t *zio) { vdev_t *vd = zio->io_vd; - vdev_file_t *vf = vd->vdev_tsd; - vnode_t *vp = vf->vf_vnode; + vdev_file_t *vf; + vnode_t *vp; ssize_t resid; - if (zio->io_type == ZIO_TYPE_IOCTL) { - /* XXPOLICY */ - if (!vdev_readable(vd)) { - zio->io_error = ENXIO; - return (ZIO_PIPELINE_CONTINUE); - } + if (!vdev_readable(vd)) { + zio->io_error = ENXIO; + return (ZIO_PIPELINE_CONTINUE); + } + + vf = vd->vdev_tsd; + vp = vf->vf_vnode; + if (zio->io_type == ZIO_TYPE_IOCTL) { switch (zio->io_cmd) { case DKIOCFLUSHWRITECACHE: zio->io_error = VOP_FSYNC(vp, FSYNC | FDSYNC, From owner-svn-src-all@FreeBSD.ORG Sat Nov 19 10:49:04 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 344F81065670; Sat, 19 Nov 2011 10:49:04 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 20CEC8FC13; Sat, 19 Nov 2011 10:49:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAJAn4gA039011; Sat, 19 Nov 2011 10:49:04 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAJAn3Nu039004; Sat, 19 Nov 2011 10:49:03 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201111191049.pAJAn3Nu039004@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 19 Nov 2011 10:49:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227705 - in stable/9: sys/boot/common sys/boot/zfs sys/cddl/boot/zfs tools/tools/zfsboottest X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Nov 2011 10:49:04 -0000 Author: pjd Date: Sat Nov 19 10:49:03 2011 New Revision: 227705 URL: http://svn.freebsd.org/changeset/base/227705 Log: MFC r226549,r226550,r226551,r226552,r226553,r226554,r226568,r226569,r226611, r226612: r226549: Remove redundant size calculation. r226550: Initialize 'rc' properly before using it. This error could lead to infinite loop when data reconstruction was needed. r226551: Don't mark vdev as healthy too soon, so we won't try to use invalid vdevs. r226552: Never pass NULL block pointer when reading. This is neither expected nor handled by lower layers like vdev_raidz, which uses bp for checksum verification. This bug could lead to NULL pointer reference and resets during boot. r226553: Always pass data size for checksum verification function, as using physical block size declared in bp may not always be what we want. For example in case of gang block header physical block size declared in bp is much larger than SPA_GANGBLOCKSIZE (512 bytes) and checksum calculation failed. This bug could lead to accessing unallocated memory and resets/failures during boot. r226554: Fix missing return when LOADER_GPT_SUPPORT is defined, but LOADER_MBR_SUPPORT is not. r226568: - Correctly read gang header from raidz. - Decompress assembled gang block data if compressed. - Verify checksum of a gang header. - Verify checksum of assembled gang block data. - Verify checksum of uber block. Submitted by: avg r226569: With LOADER_MBR_SUPPORT defined and LOADER_GPT_SUPPORT undefined we would never call disk_openmbr(). Submitted by: avg r226611: - Allow to specify multiple files to check, eg. zfsboottest gpt/system0 gpt/system1 - /boot/kernel/kernel /boot/zfsloader - Instead of printing file's content calculate MD5 hash of the file, so it can be easly compared to the hash calculated via file system. - Some other minor improvements. r226612: Because ZFS boot code was very fragile in the past and real PITA to debug, introduce zfsboottest.sh script that will verify if it will be possible to boot from the given pool. # zfsboottest.sh system Where "system" is pool name of the pool we want to boot from. What is being verified by the script: - Does the pool exist? - Does it have bootfs property configured? - Is mountpoint property of the boot dataset set to 'legacy'? Dataset configured in bootfs property has to be mounted to perform more checks: - Does the /boot directory in boot dataset exist? - Is this dataset configured as root file system in /etc/fstab or set in vfs.root.mountfrom variable in /boot/loader.conf? By using zfsboottest tool the script will read all the files in /boot directory using ZFS boot code and calculate their checksums. Then, it will walk /boot directory using find(1) though regular file sytem and also read all the files in /boot directory and calculate their checksums. If any of the files cannot be looked up, read or checksum is invalid it will be reported and booting off of this pool is probably not possible. Some additional checks may be interesting as well. For example if the disks contain proper pmbr and gptzfsboot code or if all expected files in /boot/ are present. When upgrading FreeBSD, one should snapshot datasets that contain operating system, upgrade (install new world and kernel) and use zfsboottest.sh to verify if it will be possible to boot from new configuration. If all is good one should upgrade boot blocks, by eg.: # gpart -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada1 If something is wrong, one should rollback datasets and report the problems. Approved by: re (kib) Added: stable/9/tools/tools/zfsboottest/zfsboottest.sh - copied unchanged from r226612, head/tools/tools/zfsboottest/zfsboottest.sh Modified: stable/9/sys/boot/common/disk.c stable/9/sys/boot/zfs/zfsimpl.c stable/9/sys/cddl/boot/zfs/zfssubr.c stable/9/tools/tools/zfsboottest/Makefile stable/9/tools/tools/zfsboottest/zfsboottest.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/tools/tools/zfsboottest/ (props changed) Modified: stable/9/sys/boot/common/disk.c ============================================================================== --- stable/9/sys/boot/common/disk.c Sat Nov 19 10:28:06 2011 (r227704) +++ stable/9/sys/boot/common/disk.c Sat Nov 19 10:49:03 2011 (r227705) @@ -776,10 +776,11 @@ disk_open(struct disk_devdesc *dev) #ifdef LOADER_GPT_SUPPORT rc = disk_opengpt(dev); - if (rc) + if (rc == 0) + return (0); #endif #ifdef LOADER_MBR_SUPPORT - rc = disk_openmbr(dev); + rc = disk_openmbr(dev); #endif return (rc); Modified: stable/9/sys/boot/zfs/zfsimpl.c ============================================================================== --- stable/9/sys/boot/zfs/zfsimpl.c Sat Nov 19 10:28:06 2011 (r227704) +++ stable/9/sys/boot/zfs/zfsimpl.c Sat Nov 19 10:49:03 2011 (r227705) @@ -347,7 +347,7 @@ vdev_read_phys(vdev_t *vdev, const blkpt rc = vdev->v_phys_read(vdev, vdev->v_read_priv, offset, buf, psize); if (rc) return (rc); - if (bp && zio_checksum_error(bp, buf, offset)) + if (bp && zio_checksum_verify(bp, buf)) return (EIO); return (0); @@ -543,8 +543,6 @@ vdev_init_from_nvlist(const unsigned cha vdev->v_state = VDEV_STATE_DEGRADED; else if (isnt_present) vdev->v_state = VDEV_STATE_CANT_OPEN; - else - vdev->v_state = VDEV_STATE_HEALTHY; } rc = nvlist_find(nvlist, ZPOOL_CONFIG_CHILDREN, @@ -800,6 +798,7 @@ vdev_probe(vdev_phys_read_t *read, void BP_SET_PSIZE(&bp, sizeof(vdev_phys_t)); BP_SET_CHECKSUM(&bp, ZIO_CHECKSUM_LABEL); BP_SET_COMPRESS(&bp, ZIO_COMPRESS_OFF); + DVA_SET_OFFSET(BP_IDENTITY(&bp), off); ZIO_SET_CHECKSUM(&bp.blk_cksum, off, 0, 0, 0); if (vdev_read_phys(&vtmp, &bp, vdev_label, off, 0)) return (EIO); @@ -912,6 +911,7 @@ vdev_probe(vdev_phys_read_t *read, void if (vdev) { vdev->v_phys_read = read; vdev->v_read_priv = read_priv; + vdev->v_state = VDEV_STATE_HEALTHY; } else { printf("ZFS: inconsistent nvlist contents\n"); return (EIO); @@ -941,7 +941,7 @@ vdev_probe(vdev_phys_read_t *read, void BP_SET_COMPRESS(&bp, ZIO_COMPRESS_OFF); ZIO_SET_CHECKSUM(&bp.blk_cksum, off, 0, 0, 0); - if (vdev_read_phys(vdev, NULL, upbuf, off, VDEV_UBERBLOCK_SIZE(vdev))) + if (vdev_read_phys(vdev, &bp, upbuf, off, 0)) continue; if (up->ub_magic != UBERBLOCK_MAGIC) @@ -974,34 +974,39 @@ ilog2(int n) } static int -zio_read_gang(spa_t *spa, const blkptr_t *bp, const dva_t *dva, void *buf) +zio_read_gang(spa_t *spa, const blkptr_t *bp, void *buf) { + blkptr_t gbh_bp; zio_gbh_phys_t zio_gb; - vdev_t *vdev; - int vdevid; - off_t offset; + char *pbuf; int i; - vdevid = DVA_GET_VDEV(dva); - offset = DVA_GET_OFFSET(dva); - STAILQ_FOREACH(vdev, &spa->spa_vdevs, v_childlink) - if (vdev->v_id == vdevid) - break; - if (!vdev || !vdev->v_read) - return (EIO); - if (vdev->v_read(vdev, NULL, &zio_gb, offset, SPA_GANGBLOCKSIZE)) + /* Artificial BP for gang block header. */ + gbh_bp = *bp; + BP_SET_PSIZE(&gbh_bp, SPA_GANGBLOCKSIZE); + BP_SET_LSIZE(&gbh_bp, SPA_GANGBLOCKSIZE); + BP_SET_CHECKSUM(&gbh_bp, ZIO_CHECKSUM_GANG_HEADER); + BP_SET_COMPRESS(&gbh_bp, ZIO_COMPRESS_OFF); + for (i = 0; i < SPA_DVAS_PER_BP; i++) + DVA_SET_GANG(&gbh_bp.blk_dva[i], 0); + + /* Read gang header block using the artificial BP. */ + if (zio_read(spa, &gbh_bp, &zio_gb)) return (EIO); + pbuf = buf; for (i = 0; i < SPA_GBH_NBLKPTRS; i++) { blkptr_t *gbp = &zio_gb.zg_blkptr[i]; if (BP_IS_HOLE(gbp)) continue; - if (zio_read(spa, gbp, buf)) + if (zio_read(spa, gbp, pbuf)) return (EIO); - buf = (char*)buf + BP_GET_PSIZE(gbp); + pbuf += BP_GET_PSIZE(gbp); } - + + if (zio_checksum_verify(bp, buf)) + return (EIO); return (0); } @@ -1024,46 +1029,41 @@ zio_read(spa_t *spa, const blkptr_t *bp, if (!dva->dva_word[0] && !dva->dva_word[1]) continue; - if (DVA_GET_GANG(dva)) { - error = zio_read_gang(spa, bp, dva, buf); - if (error != 0) - continue; - } else { - vdevid = DVA_GET_VDEV(dva); - offset = DVA_GET_OFFSET(dva); - STAILQ_FOREACH(vdev, &spa->spa_vdevs, v_childlink) { - if (vdev->v_id == vdevid) - break; - } - if (!vdev || !vdev->v_read) - continue; + vdevid = DVA_GET_VDEV(dva); + offset = DVA_GET_OFFSET(dva); + STAILQ_FOREACH(vdev, &spa->spa_vdevs, v_childlink) { + if (vdev->v_id == vdevid) + break; + } + if (!vdev || !vdev->v_read) + continue; - size = BP_GET_PSIZE(bp); + size = BP_GET_PSIZE(bp); + if (vdev->v_read == vdev_raidz_read) { align = 1ULL << vdev->v_top->v_ashift; if (P2PHASE(size, align) != 0) size = P2ROUNDUP(size, align); - if (size != BP_GET_PSIZE(bp) || cpfunc != ZIO_COMPRESS_OFF) - pbuf = zfs_alloc(size); - else - pbuf = buf; + } + if (size != BP_GET_PSIZE(bp) || cpfunc != ZIO_COMPRESS_OFF) + pbuf = zfs_alloc(size); + else + pbuf = buf; + if (DVA_GET_GANG(dva)) + error = zio_read_gang(spa, bp, pbuf); + else error = vdev->v_read(vdev, bp, pbuf, offset, size); - if (error == 0) { - if (cpfunc != ZIO_COMPRESS_OFF) { - error = zio_decompress_data(cpfunc, - pbuf, BP_GET_PSIZE(bp), buf, - BP_GET_LSIZE(bp)); - } else if (size != BP_GET_PSIZE(bp)) { - bcopy(pbuf, buf, BP_GET_PSIZE(bp)); - } - } - if (buf != pbuf) - zfs_free(pbuf, size); - if (error != 0) - continue; + if (error == 0) { + if (cpfunc != ZIO_COMPRESS_OFF) + error = zio_decompress_data(cpfunc, pbuf, + BP_GET_PSIZE(bp), buf, BP_GET_LSIZE(bp)); + else if (size != BP_GET_PSIZE(bp)) + bcopy(pbuf, buf, BP_GET_PSIZE(bp)); } - error = 0; - break; + if (buf != pbuf) + zfs_free(pbuf, size); + if (error == 0) + break; } if (error != 0) printf("ZFS: i/o error - all block copies unavailable\n"); Modified: stable/9/sys/cddl/boot/zfs/zfssubr.c ============================================================================== --- stable/9/sys/cddl/boot/zfs/zfssubr.c Sat Nov 19 10:28:06 2011 (r227704) +++ stable/9/sys/cddl/boot/zfs/zfssubr.c Sat Nov 19 10:49:03 2011 (r227705) @@ -181,14 +181,17 @@ zio_checksum_label_verifier(zio_cksum_t } static int -zio_checksum_error(const blkptr_t *bp, void *data, uint64_t offset) +zio_checksum_verify(const blkptr_t *bp, void *data) { - unsigned int checksum = BP_IS_GANG(bp) ? ZIO_CHECKSUM_GANG_HEADER : BP_GET_CHECKSUM(bp); - uint64_t size = BP_GET_PSIZE(bp); + uint64_t size; + unsigned int checksum; zio_checksum_info_t *ci; zio_cksum_t actual_cksum, expected_cksum, verifier; int byteswap; + checksum = BP_GET_CHECKSUM(bp); + size = BP_GET_PSIZE(bp); + if (checksum >= ZIO_CHECKSUM_FUNCTIONS) return (EINVAL); ci = &zio_checksum_table[checksum]; @@ -206,7 +209,8 @@ zio_checksum_error(const blkptr_t *bp, v if (checksum == ZIO_CHECKSUM_GANG_HEADER) zio_checksum_gang_verifier(&verifier, bp); else if (checksum == ZIO_CHECKSUM_LABEL) - zio_checksum_label_verifier(&verifier, offset); + zio_checksum_label_verifier(&verifier, + DVA_GET_OFFSET(BP_IDENTITY(bp))); else verifier = bp->blk_cksum; @@ -224,7 +228,6 @@ zio_checksum_error(const blkptr_t *bp, v byteswap_uint64_array(&expected_cksum, sizeof (zio_cksum_t)); } else { - ASSERT(!BP_IS_GANG(bp)); expected_cksum = bp->blk_cksum; ci->ci_func[0](data, size, &actual_cksum); } @@ -1215,15 +1218,10 @@ static void vdev_raidz_map_free(raidz_map_t *rm) { int c; - size_t size; for (c = rm->rm_firstdatacol - 1; c >= 0; c--) zfs_free(rm->rm_col[c].rc_data, rm->rm_col[c].rc_size); - size = 0; - for (c = rm->rm_firstdatacol; c < rm->rm_cols; c++) - size += rm->rm_col[c].rc_size; - zfs_free(rm, offsetof(raidz_map_t, rm_col[rm->rm_scols])); } @@ -1245,10 +1243,10 @@ vdev_child(vdev_t *pvd, uint64_t devidx) * any ereports we generate can note it. */ static int -raidz_checksum_verify(const blkptr_t *bp, void *data) +raidz_checksum_verify(const blkptr_t *bp, void *data, uint64_t size) { - return (zio_checksum_error(bp, data, 0)); + return (zio_checksum_verify(bp, data)); } /* @@ -1298,7 +1296,7 @@ raidz_parity_verify(raidz_map_t *rm) */ static int vdev_raidz_combrec(raidz_map_t *rm, const blkptr_t *bp, void *data, - off_t offset, int total_errors, int data_errors) + off_t offset, uint64_t bytes, int total_errors, int data_errors) { raidz_col_t *rc; void *orig[VDEV_RAIDZ_MAXPARITY]; @@ -1377,7 +1375,7 @@ vdev_raidz_combrec(raidz_map_t *rm, cons * success. */ code = vdev_raidz_reconstruct(rm, tgts, n); - if (raidz_checksum_verify(bp, data) == 0) { + if (raidz_checksum_verify(bp, data, bytes) == 0) { for (i = 0; i < n; i++) { c = tgts[i]; rc = &rm->rm_col[c]; @@ -1548,7 +1546,7 @@ reconstruct: */ if (total_errors <= rm->rm_firstdatacol - parity_untried) { if (data_errors == 0) { - if (raidz_checksum_verify(bp, data) == 0) { + if (raidz_checksum_verify(bp, data, bytes) == 0) { /* * If we read parity information (unnecessarily * as it happens since no reconstruction was @@ -1593,7 +1591,7 @@ reconstruct: code = vdev_raidz_reconstruct(rm, tgts, n); - if (raidz_checksum_verify(bp, data) == 0) { + if (raidz_checksum_verify(bp, data, bytes) == 0) { /* * If we read more parity disks than were used * for reconstruction, confirm that the other @@ -1633,7 +1631,9 @@ reconstruct: n = 0; for (c = 0; c < rm->rm_cols; c++) { - if (rm->rm_col[c].rc_tried) + rc = &rm->rm_col[c]; + + if (rc->rc_tried) continue; cvd = vdev_child(vd, rc->rc_devidx); @@ -1665,8 +1665,8 @@ reconstruct: if (total_errors > rm->rm_firstdatacol) { error = EIO; } else if (total_errors < rm->rm_firstdatacol && - (code = vdev_raidz_combrec(rm, bp, data, offset, total_errors, - data_errors)) != 0) { + (code = vdev_raidz_combrec(rm, bp, data, offset, bytes, + total_errors, data_errors)) != 0) { /* * If we didn't use all the available parity for the * combinatorial reconstruction, verify that the remaining Modified: stable/9/tools/tools/zfsboottest/Makefile ============================================================================== --- stable/9/tools/tools/zfsboottest/Makefile Sat Nov 19 10:28:06 2011 (r227704) +++ stable/9/tools/tools/zfsboottest/Makefile Sat Nov 19 10:49:03 2011 (r227705) @@ -2,7 +2,12 @@ .PATH: ${.CURDIR}/../../../sys/boot/zfs ${.CURDIR}/../../../sys/cddl/boot/zfs +BINDIR?= /usr/bin +SCRIPTSDIR?= /usr/bin + PROG= zfsboottest +SCRIPTS= zfsboottest.sh +SCRIPTSNAME= zfsboottest.sh NO_MAN= CFLAGS= -O1 \ @@ -12,6 +17,7 @@ CFLAGS= -O1 \ -fdiagnostics-show-option \ -W -Wextra -Wno-sign-compare -Wno-unused-parameter \ -Werror +LDFLAGS+=-lmd .if ${MACHINE_CPUARCH} == "amd64" beforedepend zfsboottest.o: machine Modified: stable/9/tools/tools/zfsboottest/zfsboottest.c ============================================================================== --- stable/9/tools/tools/zfsboottest/zfsboottest.c Sat Nov 19 10:28:06 2011 (r227704) +++ stable/9/tools/tools/zfsboottest/zfsboottest.c Sat Nov 19 10:49:03 2011 (r227705) @@ -1,6 +1,7 @@ /*- * Copyright (c) 2010 Doug Rabson * Copyright (c) 2011 Andriy Gapon + * Copyright (c) 2011 Pawel Jakub Dawidek * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -28,8 +29,10 @@ #include #include +#include #include #include +#include #include #include #include @@ -43,6 +46,7 @@ void pager_output(const char *line) { + fprintf(stderr, "%s", line); } @@ -54,7 +58,7 @@ pager_output(const char *line) static int vdev_read(vdev_t *vdev, void *priv, off_t off, void *buf, size_t bytes) { - int fd = *(int *) priv; + int fd = *(int *)priv; if (pread(fd, buf, bytes, off) != bytes) return (-1); @@ -73,7 +77,7 @@ zfs_read(spa_t *spa, dnode_phys_t *dn, v n = zp->zp_size - off; rc = dnode_read(spa, dn, off, buf, n); - if (rc) + if (rc != 0) return (-rc); return (n); @@ -82,31 +86,49 @@ zfs_read(spa_t *spa, dnode_phys_t *dn, v int main(int argc, char** argv) { - char buf[512]; - int fd[100]; + char buf[512], hash[33]; + MD5_CTX ctx; struct stat sb; dnode_phys_t dn; spa_t *spa; off_t off; ssize_t n; - int i; + int i, failures, *fd; zfs_init(); if (argc == 1) { static char *av[] = { - "zfstest", "COPYRIGHT", - "/dev/da0p2", "/dev/da1p2", "/dev/da2p2", + "zfsboottest", + "/dev/gpt/system0", + "/dev/gpt/system1", + "-", + "/boot/zfsloader", + "/boot/support.4th", + "/boot/kernel/kernel", NULL, }; - argc = 5; + argc = sizeof(av) / sizeof(av[0]) - 1; argv = av; } - for (i = 2; i < argc; i++) { - fd[i] = open(argv[i], O_RDONLY); - if (fd[i] < 0) + for (i = 1; i < argc; i++) { + if (strcmp(argv[i], "-") == 0) + break; + } + fd = malloc(sizeof(fd[0]) * (i - 1)); + if (fd == NULL) + errx(1, "Unable to allocate memory."); + for (i = 1; i < argc; i++) { + if (strcmp(argv[i], "-") == 0) + break; + fd[i - 1] = open(argv[i], O_RDONLY); + if (fd[i - 1] == -1) { + warn("open(%s) failed", argv[i]); continue; - if (vdev_probe(vdev_read, &fd[i], NULL) != 0) - close(fd[i]); + } + if (vdev_probe(vdev_read, &fd[i - 1], NULL) != 0) { + warnx("vdev_probe(%s) failed", argv[i]); + close(fd[i - 1]); + } } spa_all_status(); @@ -121,29 +143,40 @@ main(int argc, char** argv) exit(1); } - if (zfs_lookup(spa, argv[1], &dn)) { - fprintf(stderr, "can't lookup\n"); - exit(1); - } - - if (zfs_dnode_stat(spa, &dn, &sb)) { - fprintf(stderr, "can't stat\n"); - exit(1); - } - + printf("\n"); + for (++i, failures = 0; i < argc; i++) { + if (zfs_lookup(spa, argv[i], &dn)) { + fprintf(stderr, "%s: can't lookup\n", argv[i]); + failures++; + continue; + } - off = 0; - do { - n = sb.st_size - off; - n = n > sizeof(buf) ? sizeof(buf) : n; - n = zfs_read(spa, &dn, buf, n, off); - if (n < 0) { - fprintf(stderr, "zfs_read failed\n"); - exit(1); + if (zfs_dnode_stat(spa, &dn, &sb)) { + fprintf(stderr, "%s: can't stat\n", argv[i]); + failures++; + continue; } - write(1, buf, n); - off += n; - } while (off < sb.st_size); - return (0); + off = 0; + MD5Init(&ctx); + do { + n = sb.st_size - off; + n = n > sizeof(buf) ? sizeof(buf) : n; + n = zfs_read(spa, &dn, buf, n, off); + if (n < 0) { + fprintf(stderr, "%s: zfs_read failed\n", + argv[i]); + failures++; + break; + } + MD5Update(&ctx, buf, n); + off += n; + } while (off < sb.st_size); + if (off < sb.st_size) + continue; + MD5End(&ctx, hash); + printf("%s %s\n", hash, argv[i]); + } + + return (failures == 0 ? 0 : 1); } Copied: stable/9/tools/tools/zfsboottest/zfsboottest.sh (from r226612, head/tools/tools/zfsboottest/zfsboottest.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/tools/tools/zfsboottest/zfsboottest.sh Sat Nov 19 10:49:03 2011 (r227705, copy of r226612, head/tools/tools/zfsboottest/zfsboottest.sh) @@ -0,0 +1,130 @@ +#!/bin/sh +# +# Copyright (c) 2011 Pawel Jakub Dawidek +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ + +if [ $# -ne 1 ]; then + echo "usage: zfsboottest.sh " >&2 + exit 1 +fi + +which -s zfsboottest +if [ $? -eq 0 ]; then + zfsboottest="zfsboottest" +else + if [ ! -x "/usr/src/tools/tools/zfsboottest/zfsboottest" ]; then + echo "Unable to find \"zfsboottest\" utility." >&2 + exit 1 + fi + zfsboottest="/usr/src/tools/tools/zfsboottest/zfsboottest" +fi + +startdir="/boot" + +pool="${1}" +zpool list "${pool}" >/dev/null 2>&1 +if [ $? -ne 0 ]; then + echo "No such pool \"${pool}\"." >&2 + exit 1 +fi +bootfs=`zpool get bootfs "${pool}" | tail -1 | awk '{print $3}'` +if [ "${bootfs}" = "-" ]; then + echo "The \"bootfs\" property is not configured for pool \"${pool}\"." >&2 + exit 1 +fi +# Dataset's mountpoint property should be set to 'legacy'. +if [ "`zfs get -H -o value mountpoint ${bootfs}`" != "legacy" ]; then + echo "The \"mountpoint\" property of dataset \"${bootfs}\" should be set to \"legacy\"." >&2 + exit 1 +fi +mountpoint=`df -t zfs "${bootfs}" 2>/dev/null | tail -1 | awk '{print $6}'` +if [ -z "${mountpoint}" ]; then + echo "The \"${bootfs}\" dataset is not mounted." >&2 + exit 1 +fi +if [ ! -d "${mountpoint}${startdir}" ]; then + echo "The \"${mountpoint}${startdir}\" directory doesn't exist." >&2 + exit 1 +fi +# To be able to mount root ZFS file system we need either /etc/fstab entry +# or vfs.root.mountfrom variable set in /boot/loader.conf. +egrep -q '^'"${bootfs}"'[[:space:]]+/[[:space:]]+zfs[[:space:]]+' "${mountpoint}/etc/fstab" 2>/dev/null +if [ $? -ne 0 ]; then + egrep -q 'vfs.root.mountfrom="?'"${bootfs}"'"?[[:space:]]*$' "${mountpoint}/boot/loader.conf" 2>/dev/null + if [ $? -ne 0 ]; then + echo "To be able to boot from \"${bootfs}\", you need to declare" >&2 + echo "\"${bootfs}\" as being root file system in ${mountpoint}/etc/fstab" >&2 + echo "or add \"vfs.root.mountfrom\" variable set to \"${bootfs}\" to" >&2 + echo "${mountpoint}/boot/loader.conf." >&2 + exit 1 + fi +fi +vdevs="" +for vdev in `zpool status "${pool}" | grep ONLINE | awk '{print $1}'`; do + vdev="/dev/${vdev#/dev/}" + if [ -c "${vdev}" ]; then + if [ -z "${vdevs}" ]; then + vdevs="${vdev}" + else + vdevs="${vdevs} ${vdev}" + fi + fi +done + +list0=`mktemp /tmp/zfsboottest.XXXXXXXXXX` +if [ $? -ne 0 ]; then + echo "Unable to create temporary file." >&2 + exit 1 +fi +list1=`mktemp /tmp/zfsboottest.XXXXXXXXXX` +if [ $? -ne 0 ]; then + echo "Unable to create temporary file." >&2 + rm -f "${list0}" + exit 1 +fi + +echo "zfsboottest.sh is reading all the files in ${mountpoint}${startdir} using" +echo "boot code and using file system code." +echo "It calculates MD5 checksums for all the files and will compare them." +echo "If all files can be properly read using boot code, it is very likely you" +echo "will be able to boot from \"${pool}\" pool>:> Good luck!" +echo + +"${zfsboottest}" ${vdevs} - `find "${mountpoint}${startdir}" -type f | sed "s@^${mountpoint}@@"` | egrep '^[0-9a-z]{32} /' | sort -k 2 >"${list0}" +find "${mountpoint}${startdir}" -type f | xargs md5 -r | sed "s@ ${mountpoint}@ @" | egrep '^[0-9a-z]{32} /' | sort -k 2 >"${list1}" + +diff -u "${list0}" "${list1}" +ec=$? + +rm -f "${list0}" "${list1}" + +if [ $? -ne 0 ]; then + echo >&2 + echo "You may not be able to boot." >&2 + exit 1 +fi + +echo "OK" From owner-svn-src-all@FreeBSD.ORG Sat Nov 19 11:17:28 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 79DE91065673; Sat, 19 Nov 2011 11:17:28 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5FDE58FC08; Sat, 19 Nov 2011 11:17:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAJBHSPY039926; Sat, 19 Nov 2011 11:17:28 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAJBHSXC039923; Sat, 19 Nov 2011 11:17:28 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201111191117.pAJBHSXC039923@svn.freebsd.org> From: Hans Petter Selasky Date: Sat, 19 Nov 2011 11:17:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227706 - in head/sys: dev/usb kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Nov 2011 11:17:28 -0000 Author: hselasky Date: Sat Nov 19 11:17:27 2011 New Revision: 227706 URL: http://svn.freebsd.org/changeset/base/227706 Log: Simplify the usb_pause_mtx() function by factoring out the generic parts to the kernel's pause() function. The pause() function can now be used when cold != 0. Also assert that the timeout in system ticks must be positive. Suggested by: Bruce Evans MFC after: 1 week Modified: head/sys/dev/usb/usb_util.c head/sys/kern/kern_synch.c Modified: head/sys/dev/usb/usb_util.c ============================================================================== --- head/sys/dev/usb/usb_util.c Sat Nov 19 10:49:03 2011 (r227705) +++ head/sys/dev/usb/usb_util.c Sat Nov 19 11:17:27 2011 (r227706) @@ -115,33 +115,21 @@ device_set_usb_desc(device_t dev) * * This function will delay the code by the passed number of system * ticks. The passed mutex "mtx" will be dropped while waiting, if - * "mtx" is not NULL. + * "mtx" is different from NULL. *------------------------------------------------------------------------*/ void -usb_pause_mtx(struct mtx *mtx, int _ticks) +usb_pause_mtx(struct mtx *mtx, int timo) { if (mtx != NULL) mtx_unlock(mtx); - if (cold) { - /* convert to milliseconds */ - _ticks = (_ticks * 1000) / hz; - /* convert to microseconds, rounded up */ - _ticks = (_ticks + 1) * 1000; - DELAY(_ticks); - - } else { - - /* - * Add one to the number of ticks so that we don't return - * too early! - */ - _ticks++; - - if (pause("USBWAIT", _ticks)) { - /* ignore */ - } - } + /* + * Add one tick to the timeout so that we don't return too + * early! Note that pause() will assert that the passed + * timeout is positive and non-zero! + */ + pause("USBWAIT", timo + 1); + if (mtx != NULL) mtx_lock(mtx); } Modified: head/sys/kern/kern_synch.c ============================================================================== --- head/sys/kern/kern_synch.c Sat Nov 19 10:49:03 2011 (r227705) +++ head/sys/kern/kern_synch.c Sat Nov 19 11:17:27 2011 (r227706) @@ -325,16 +325,34 @@ msleep_spin(void *ident, struct mtx *mtx } /* - * pause() is like tsleep() except that the intention is to not be - * explicitly woken up by another thread. Instead, the current thread - * simply wishes to sleep until the timeout expires. It is - * implemented using a dummy wait channel. + * pause() is almost like tsleep() except that the intention is to not + * be explicitly woken up by another thread. Instead, the current + * thread simply wishes to sleep until the timeout expires. It is + * implemented using a dummy wait channel. During cold bootup pause() + * will use the DELAY() function instead of tsleep() to wait the given + * number of system ticks. The passed "timo" argument must not be + * negative and also greater than zero. */ int pause(const char *wmesg, int timo) { - KASSERT(timo != 0, ("pause: timeout required")); + KASSERT(timo > 0, ("pause: a positive and non-zero " + "timeout is required")); + + if (cold) { + /* + * We delay one HZ at a time to avoid overflowing the + * DELAY() argument: + */ + while (timo >= hz) { + DELAY(1000000); + timo -= hz; + } + if (timo > 0) + DELAY(timo * tick); + return (0); + } return (tsleep(&pause_wchan, 0, wmesg, timo)); } From owner-svn-src-all@FreeBSD.ORG Sat Nov 19 11:42:20 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 01798106564A; Sat, 19 Nov 2011 11:42:20 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CB0708FC08; Sat, 19 Nov 2011 11:42:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAJBgJD6040742; Sat, 19 Nov 2011 11:42:19 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAJBgJfk040739; Sat, 19 Nov 2011 11:42:19 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201111191142.pAJBgJfk040739@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 19 Nov 2011 11:42:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227707 - releng/9.0/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Nov 2011 11:42:20 -0000 Author: pjd Date: Sat Nov 19 11:42:19 2011 New Revision: 227707 URL: http://svn.freebsd.org/changeset/base/227707 Log: MFC r226620: Update per-thread I/O statistics collection in ZFS. This allows to see processes I/O activity in 'top -m io' output. PR kern/156218 Reported by: Marcus Reid Patch by: avg Approved by: re (kib) Modified: releng/9.0/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c releng/9.0/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Directory Properties: releng/9.0/sys/ (props changed) releng/9.0/sys/amd64/include/xen/ (props changed) releng/9.0/sys/boot/ (props changed) releng/9.0/sys/boot/i386/efi/ (props changed) releng/9.0/sys/boot/ia64/efi/ (props changed) releng/9.0/sys/boot/ia64/ski/ (props changed) releng/9.0/sys/boot/powerpc/boot1.chrp/ (props changed) releng/9.0/sys/boot/powerpc/ofw/ (props changed) releng/9.0/sys/cddl/contrib/opensolaris/ (props changed) releng/9.0/sys/conf/ (props changed) releng/9.0/sys/contrib/dev/acpica/ (props changed) releng/9.0/sys/contrib/octeon-sdk/ (props changed) releng/9.0/sys/contrib/pf/ (props changed) releng/9.0/sys/contrib/x86emu/ (props changed) Modified: releng/9.0/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c ============================================================================== --- releng/9.0/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Sat Nov 19 11:17:27 2011 (r227706) +++ releng/9.0/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Sat Nov 19 11:42:19 2011 (r227707) @@ -627,6 +627,10 @@ dbuf_read(dmu_buf_impl_t *db, zio_t *zio } else if (db->db_state == DB_UNCACHED) { spa_t *spa = dn->dn_objset->os_spa; +#ifdef _KERNEL + curthread->td_ru.ru_inblock++; +#endif + if (zio == NULL) zio = zio_root(spa, NULL, NULL, ZIO_FLAG_CANFAIL); dbuf_read_impl(db, zio, &flags); Modified: releng/9.0/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c ============================================================================== --- releng/9.0/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Sat Nov 19 11:17:27 2011 (r227706) +++ releng/9.0/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Sat Nov 19 11:42:19 2011 (r227707) @@ -397,9 +397,12 @@ dmu_buf_hold_array_by_dnode(dnode_t *dn, return (EIO); } /* initiate async i/o */ - if (read) { + if (read) (void) dbuf_read(db, zio, dbuf_flags); - } +#ifdef _KERNEL + else + curthread->td_ru.ru_oublock++; +#endif dbp[i] = &db->db; } rw_exit(&dn->dn_struct_rwlock); From owner-svn-src-all@FreeBSD.ORG Sat Nov 19 11:43:19 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7BC27106566C; Sat, 19 Nov 2011 11:43:19 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5170F8FC08; Sat, 19 Nov 2011 11:43:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAJBhJIt040818; Sat, 19 Nov 2011 11:43:19 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAJBhJ4j040816; Sat, 19 Nov 2011 11:43:19 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201111191143.pAJBhJ4j040816@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 19 Nov 2011 11:43:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227708 - releng/9.0/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Nov 2011 11:43:19 -0000 Author: pjd Date: Sat Nov 19 11:43:18 2011 New Revision: 227708 URL: http://svn.freebsd.org/changeset/base/227708 Log: MFC r226617: zfs vdev_file_io_start: validate vdev before using vdev_tsd vdev_tsd can be NULL for certain vdev states. At least in userland testing with ztest. Submitted by: avg Approved by: re (kib) Modified: releng/9.0/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c Directory Properties: releng/9.0/sys/ (props changed) releng/9.0/sys/amd64/include/xen/ (props changed) releng/9.0/sys/boot/ (props changed) releng/9.0/sys/boot/i386/efi/ (props changed) releng/9.0/sys/boot/ia64/efi/ (props changed) releng/9.0/sys/boot/ia64/ski/ (props changed) releng/9.0/sys/boot/powerpc/boot1.chrp/ (props changed) releng/9.0/sys/boot/powerpc/ofw/ (props changed) releng/9.0/sys/cddl/contrib/opensolaris/ (props changed) releng/9.0/sys/conf/ (props changed) releng/9.0/sys/contrib/dev/acpica/ (props changed) releng/9.0/sys/contrib/octeon-sdk/ (props changed) releng/9.0/sys/contrib/pf/ (props changed) releng/9.0/sys/contrib/x86emu/ (props changed) Modified: releng/9.0/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c ============================================================================== --- releng/9.0/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c Sat Nov 19 11:42:19 2011 (r227707) +++ releng/9.0/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c Sat Nov 19 11:43:18 2011 (r227708) @@ -153,17 +153,19 @@ static int vdev_file_io_start(zio_t *zio) { vdev_t *vd = zio->io_vd; - vdev_file_t *vf = vd->vdev_tsd; - vnode_t *vp = vf->vf_vnode; + vdev_file_t *vf; + vnode_t *vp; ssize_t resid; - if (zio->io_type == ZIO_TYPE_IOCTL) { - /* XXPOLICY */ - if (!vdev_readable(vd)) { - zio->io_error = ENXIO; - return (ZIO_PIPELINE_CONTINUE); - } + if (!vdev_readable(vd)) { + zio->io_error = ENXIO; + return (ZIO_PIPELINE_CONTINUE); + } + + vf = vd->vdev_tsd; + vp = vf->vf_vnode; + if (zio->io_type == ZIO_TYPE_IOCTL) { switch (zio->io_cmd) { case DKIOCFLUSHWRITECACHE: zio->io_error = VOP_FSYNC(vp, FSYNC | FDSYNC, From owner-svn-src-all@FreeBSD.ORG Sat Nov 19 11:44:21 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 45E21106564A; Sat, 19 Nov 2011 11:44:21 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2B3818FC0C; Sat, 19 Nov 2011 11:44:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAJBiLMC040910; Sat, 19 Nov 2011 11:44:21 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAJBiKQI040906; Sat, 19 Nov 2011 11:44:20 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201111191144.pAJBiKQI040906@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 19 Nov 2011 11:44:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227709 - in releng/9.0/cddl/contrib/opensolaris: cmd/zdb head lib/libzpool/common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Nov 2011 11:44:21 -0000 Author: pjd Date: Sat Nov 19 11:44:20 2011 New Revision: 227709 URL: http://svn.freebsd.org/changeset/base/227709 Log: MFC r226613,r226615,r226616: r226613: libzpool task_alloc: pass only valid flags to kmem_alloc tqflags may contain other flags besided those that are suitable for kmem_alloc == umem_alloc Submitted by: avg r226615: thr_create: new_thread_ID may be NULL Submitted by: avg r226616: zdb: access dp_free_bpobj only if pool version is >= SPA_VERSION_DEADLISTS Submitted by: avg Approved by: re (kib) Modified: releng/9.0/cddl/contrib/opensolaris/cmd/zdb/zdb.c releng/9.0/cddl/contrib/opensolaris/head/thread.h releng/9.0/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c Directory Properties: releng/9.0/cddl/contrib/opensolaris/ (props changed) Modified: releng/9.0/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- releng/9.0/cddl/contrib/opensolaris/cmd/zdb/zdb.c Sat Nov 19 11:43:18 2011 (r227708) +++ releng/9.0/cddl/contrib/opensolaris/cmd/zdb/zdb.c Sat Nov 19 11:44:20 2011 (r227709) @@ -2190,8 +2190,10 @@ dump_block_stats(spa_t *spa) */ (void) bpobj_iterate_nofree(&spa->spa_deferred_bpobj, count_block_cb, &zcb, NULL); - (void) bpobj_iterate_nofree(&spa->spa_dsl_pool->dp_free_bpobj, - count_block_cb, &zcb, NULL); + if (spa_version(spa) >= SPA_VERSION_DEADLISTS) { + (void) bpobj_iterate_nofree(&spa->spa_dsl_pool->dp_free_bpobj, + count_block_cb, &zcb, NULL); + } if (dump_opt['c'] > 1) flags |= TRAVERSE_PREFETCH_DATA; Modified: releng/9.0/cddl/contrib/opensolaris/head/thread.h ============================================================================== --- releng/9.0/cddl/contrib/opensolaris/head/thread.h Sat Nov 19 11:43:18 2011 (r227708) +++ releng/9.0/cddl/contrib/opensolaris/head/thread.h Sat Nov 19 11:44:20 2011 (r227709) @@ -76,6 +76,7 @@ static __inline int thr_create(void *stack_base, size_t stack_size, void *(*start_func) (void*), void *arg, long flags, thread_t *new_thread_ID) { + pthread_t dummy; int ret; assert(stack_base == NULL); @@ -85,9 +86,12 @@ thr_create(void *stack_base, size_t stac pthread_attr_t attr; pthread_attr_init(&attr); - if(flags & THR_DETACHED) + if (flags & THR_DETACHED) pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); + if (new_thread_ID == NULL) + new_thread_ID = &dummy; + /* This function ignores the THR_BOUND flag, since NPTL doesn't seem to support PTHREAD_SCOPE_PROCESS */ ret = pthread_create(new_thread_ID, &attr, start_func, arg); Modified: releng/9.0/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c ============================================================================== --- releng/9.0/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c Sat Nov 19 11:43:18 2011 (r227708) +++ releng/9.0/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c Sat Nov 19 11:44:20 2011 (r227709) @@ -87,7 +87,7 @@ again: if ((t = tq->tq_freelist) != NULL } mutex_exit(&tq->tq_lock); - t = kmem_alloc(sizeof (task_t), tqflags); + t = kmem_alloc(sizeof (task_t), tqflags & KM_SLEEP); mutex_enter(&tq->tq_lock); if (t != NULL) From owner-svn-src-all@FreeBSD.ORG Sat Nov 19 11:47:15 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7DAF4106568F; Sat, 19 Nov 2011 11:47:15 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6AC088FC15; Sat, 19 Nov 2011 11:47:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAJBlFbp041066; Sat, 19 Nov 2011 11:47:15 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAJBlFcn041057; Sat, 19 Nov 2011 11:47:15 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201111191147.pAJBlFcn041057@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 19 Nov 2011 11:47:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227710 - in releng/9.0: sys/boot/common sys/boot/zfs sys/cddl/boot/zfs tools/tools/zfsboottest X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Nov 2011 11:47:15 -0000 Author: pjd Date: Sat Nov 19 11:47:15 2011 New Revision: 227710 URL: http://svn.freebsd.org/changeset/base/227710 Log: MFC r226549,r226550,r226551,r226552,r226553,r226554,r226568,r226569,r226611, r226612: r226549: Remove redundant size calculation. r226550: Initialize 'rc' properly before using it. This error could lead to infinite loop when data reconstruction was needed. r226551: Don't mark vdev as healthy too soon, so we won't try to use invalid vdevs. r226552: Never pass NULL block pointer when reading. This is neither expected nor handled by lower layers like vdev_raidz, which uses bp for checksum verification. This bug could lead to NULL pointer reference and resets during boot. r226553: Always pass data size for checksum verification function, as using physical block size declared in bp may not always be what we want. For example in case of gang block header physical block size declared in bp is much larger than SPA_GANGBLOCKSIZE (512 bytes) and checksum calculation failed. This bug could lead to accessing unallocated memory and resets/failures during boot. r226554: Fix missing return when LOADER_GPT_SUPPORT is defined, but LOADER_MBR_SUPPORT is not. r226568: - Correctly read gang header from raidz. - Decompress assembled gang block data if compressed. - Verify checksum of a gang header. - Verify checksum of assembled gang block data. - Verify checksum of uber block. Submitted by: avg r226569: With LOADER_MBR_SUPPORT defined and LOADER_GPT_SUPPORT undefined we would never call disk_openmbr(). Submitted by: avg r226611: - Allow to specify multiple files to check, eg. zfsboottest gpt/system0 gpt/system1 - /boot/kernel/kernel /boot/zfsloader - Instead of printing file's content calculate MD5 hash of the file, so it can be easly compared to the hash calculated via file system. - Some other minor improvements. r226612: Because ZFS boot code was very fragile in the past and real PITA to debug, introduce zfsboottest.sh script that will verify if it will be possible to boot from the given pool. # zfsboottest.sh system Where "system" is pool name of the pool we want to boot from. What is being verified by the script: - Does the pool exist? - Does it have bootfs property configured? - Is mountpoint property of the boot dataset set to 'legacy'? Dataset configured in bootfs property has to be mounted to perform more checks: - Does the /boot directory in boot dataset exist? - Is this dataset configured as root file system in /etc/fstab or set in vfs.root.mountfrom variable in /boot/loader.conf? By using zfsboottest tool the script will read all the files in /boot directory using ZFS boot code and calculate their checksums. Then, it will walk /boot directory using find(1) though regular file sytem and also read all the files in /boot directory and calculate their checksums. If any of the files cannot be looked up, read or checksum is invalid it will be reported and booting off of this pool is probably not possible. Some additional checks may be interesting as well. For example if the disks contain proper pmbr and gptzfsboot code or if all expected files in /boot/ are present. When upgrading FreeBSD, one should snapshot datasets that contain operating system, upgrade (install new world and kernel) and use zfsboottest.sh to verify if it will be possible to boot from new configuration. If all is good one should upgrade boot blocks, by eg.: # gpart -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada1 If something is wrong, one should rollback datasets and report the problems. Approved by: re (kib) Added: releng/9.0/tools/tools/zfsboottest/zfsboottest.sh - copied unchanged from r226612, head/tools/tools/zfsboottest/zfsboottest.sh Modified: releng/9.0/sys/boot/common/disk.c releng/9.0/sys/boot/zfs/zfsimpl.c releng/9.0/sys/cddl/boot/zfs/zfssubr.c releng/9.0/tools/tools/zfsboottest/Makefile releng/9.0/tools/tools/zfsboottest/zfsboottest.c Directory Properties: releng/9.0/sys/ (props changed) releng/9.0/sys/amd64/include/xen/ (props changed) releng/9.0/sys/boot/ (props changed) releng/9.0/sys/boot/i386/efi/ (props changed) releng/9.0/sys/boot/ia64/efi/ (props changed) releng/9.0/sys/boot/ia64/ski/ (props changed) releng/9.0/sys/boot/powerpc/boot1.chrp/ (props changed) releng/9.0/sys/boot/powerpc/ofw/ (props changed) releng/9.0/sys/cddl/contrib/opensolaris/ (props changed) releng/9.0/sys/conf/ (props changed) releng/9.0/sys/contrib/dev/acpica/ (props changed) releng/9.0/sys/contrib/octeon-sdk/ (props changed) releng/9.0/sys/contrib/pf/ (props changed) releng/9.0/sys/contrib/x86emu/ (props changed) releng/9.0/tools/tools/zfsboottest/ (props changed) Modified: releng/9.0/sys/boot/common/disk.c ============================================================================== --- releng/9.0/sys/boot/common/disk.c Sat Nov 19 11:44:20 2011 (r227709) +++ releng/9.0/sys/boot/common/disk.c Sat Nov 19 11:47:15 2011 (r227710) @@ -776,10 +776,11 @@ disk_open(struct disk_devdesc *dev) #ifdef LOADER_GPT_SUPPORT rc = disk_opengpt(dev); - if (rc) + if (rc == 0) + return (0); #endif #ifdef LOADER_MBR_SUPPORT - rc = disk_openmbr(dev); + rc = disk_openmbr(dev); #endif return (rc); Modified: releng/9.0/sys/boot/zfs/zfsimpl.c ============================================================================== --- releng/9.0/sys/boot/zfs/zfsimpl.c Sat Nov 19 11:44:20 2011 (r227709) +++ releng/9.0/sys/boot/zfs/zfsimpl.c Sat Nov 19 11:47:15 2011 (r227710) @@ -347,7 +347,7 @@ vdev_read_phys(vdev_t *vdev, const blkpt rc = vdev->v_phys_read(vdev, vdev->v_read_priv, offset, buf, psize); if (rc) return (rc); - if (bp && zio_checksum_error(bp, buf, offset)) + if (bp && zio_checksum_verify(bp, buf)) return (EIO); return (0); @@ -543,8 +543,6 @@ vdev_init_from_nvlist(const unsigned cha vdev->v_state = VDEV_STATE_DEGRADED; else if (isnt_present) vdev->v_state = VDEV_STATE_CANT_OPEN; - else - vdev->v_state = VDEV_STATE_HEALTHY; } rc = nvlist_find(nvlist, ZPOOL_CONFIG_CHILDREN, @@ -800,6 +798,7 @@ vdev_probe(vdev_phys_read_t *read, void BP_SET_PSIZE(&bp, sizeof(vdev_phys_t)); BP_SET_CHECKSUM(&bp, ZIO_CHECKSUM_LABEL); BP_SET_COMPRESS(&bp, ZIO_COMPRESS_OFF); + DVA_SET_OFFSET(BP_IDENTITY(&bp), off); ZIO_SET_CHECKSUM(&bp.blk_cksum, off, 0, 0, 0); if (vdev_read_phys(&vtmp, &bp, vdev_label, off, 0)) return (EIO); @@ -912,6 +911,7 @@ vdev_probe(vdev_phys_read_t *read, void if (vdev) { vdev->v_phys_read = read; vdev->v_read_priv = read_priv; + vdev->v_state = VDEV_STATE_HEALTHY; } else { printf("ZFS: inconsistent nvlist contents\n"); return (EIO); @@ -941,7 +941,7 @@ vdev_probe(vdev_phys_read_t *read, void BP_SET_COMPRESS(&bp, ZIO_COMPRESS_OFF); ZIO_SET_CHECKSUM(&bp.blk_cksum, off, 0, 0, 0); - if (vdev_read_phys(vdev, NULL, upbuf, off, VDEV_UBERBLOCK_SIZE(vdev))) + if (vdev_read_phys(vdev, &bp, upbuf, off, 0)) continue; if (up->ub_magic != UBERBLOCK_MAGIC) @@ -974,34 +974,39 @@ ilog2(int n) } static int -zio_read_gang(spa_t *spa, const blkptr_t *bp, const dva_t *dva, void *buf) +zio_read_gang(spa_t *spa, const blkptr_t *bp, void *buf) { + blkptr_t gbh_bp; zio_gbh_phys_t zio_gb; - vdev_t *vdev; - int vdevid; - off_t offset; + char *pbuf; int i; - vdevid = DVA_GET_VDEV(dva); - offset = DVA_GET_OFFSET(dva); - STAILQ_FOREACH(vdev, &spa->spa_vdevs, v_childlink) - if (vdev->v_id == vdevid) - break; - if (!vdev || !vdev->v_read) - return (EIO); - if (vdev->v_read(vdev, NULL, &zio_gb, offset, SPA_GANGBLOCKSIZE)) + /* Artificial BP for gang block header. */ + gbh_bp = *bp; + BP_SET_PSIZE(&gbh_bp, SPA_GANGBLOCKSIZE); + BP_SET_LSIZE(&gbh_bp, SPA_GANGBLOCKSIZE); + BP_SET_CHECKSUM(&gbh_bp, ZIO_CHECKSUM_GANG_HEADER); + BP_SET_COMPRESS(&gbh_bp, ZIO_COMPRESS_OFF); + for (i = 0; i < SPA_DVAS_PER_BP; i++) + DVA_SET_GANG(&gbh_bp.blk_dva[i], 0); + + /* Read gang header block using the artificial BP. */ + if (zio_read(spa, &gbh_bp, &zio_gb)) return (EIO); + pbuf = buf; for (i = 0; i < SPA_GBH_NBLKPTRS; i++) { blkptr_t *gbp = &zio_gb.zg_blkptr[i]; if (BP_IS_HOLE(gbp)) continue; - if (zio_read(spa, gbp, buf)) + if (zio_read(spa, gbp, pbuf)) return (EIO); - buf = (char*)buf + BP_GET_PSIZE(gbp); + pbuf += BP_GET_PSIZE(gbp); } - + + if (zio_checksum_verify(bp, buf)) + return (EIO); return (0); } @@ -1024,46 +1029,41 @@ zio_read(spa_t *spa, const blkptr_t *bp, if (!dva->dva_word[0] && !dva->dva_word[1]) continue; - if (DVA_GET_GANG(dva)) { - error = zio_read_gang(spa, bp, dva, buf); - if (error != 0) - continue; - } else { - vdevid = DVA_GET_VDEV(dva); - offset = DVA_GET_OFFSET(dva); - STAILQ_FOREACH(vdev, &spa->spa_vdevs, v_childlink) { - if (vdev->v_id == vdevid) - break; - } - if (!vdev || !vdev->v_read) - continue; + vdevid = DVA_GET_VDEV(dva); + offset = DVA_GET_OFFSET(dva); + STAILQ_FOREACH(vdev, &spa->spa_vdevs, v_childlink) { + if (vdev->v_id == vdevid) + break; + } + if (!vdev || !vdev->v_read) + continue; - size = BP_GET_PSIZE(bp); + size = BP_GET_PSIZE(bp); + if (vdev->v_read == vdev_raidz_read) { align = 1ULL << vdev->v_top->v_ashift; if (P2PHASE(size, align) != 0) size = P2ROUNDUP(size, align); - if (size != BP_GET_PSIZE(bp) || cpfunc != ZIO_COMPRESS_OFF) - pbuf = zfs_alloc(size); - else - pbuf = buf; + } + if (size != BP_GET_PSIZE(bp) || cpfunc != ZIO_COMPRESS_OFF) + pbuf = zfs_alloc(size); + else + pbuf = buf; + if (DVA_GET_GANG(dva)) + error = zio_read_gang(spa, bp, pbuf); + else error = vdev->v_read(vdev, bp, pbuf, offset, size); - if (error == 0) { - if (cpfunc != ZIO_COMPRESS_OFF) { - error = zio_decompress_data(cpfunc, - pbuf, BP_GET_PSIZE(bp), buf, - BP_GET_LSIZE(bp)); - } else if (size != BP_GET_PSIZE(bp)) { - bcopy(pbuf, buf, BP_GET_PSIZE(bp)); - } - } - if (buf != pbuf) - zfs_free(pbuf, size); - if (error != 0) - continue; + if (error == 0) { + if (cpfunc != ZIO_COMPRESS_OFF) + error = zio_decompress_data(cpfunc, pbuf, + BP_GET_PSIZE(bp), buf, BP_GET_LSIZE(bp)); + else if (size != BP_GET_PSIZE(bp)) + bcopy(pbuf, buf, BP_GET_PSIZE(bp)); } - error = 0; - break; + if (buf != pbuf) + zfs_free(pbuf, size); + if (error == 0) + break; } if (error != 0) printf("ZFS: i/o error - all block copies unavailable\n"); Modified: releng/9.0/sys/cddl/boot/zfs/zfssubr.c ============================================================================== --- releng/9.0/sys/cddl/boot/zfs/zfssubr.c Sat Nov 19 11:44:20 2011 (r227709) +++ releng/9.0/sys/cddl/boot/zfs/zfssubr.c Sat Nov 19 11:47:15 2011 (r227710) @@ -181,14 +181,17 @@ zio_checksum_label_verifier(zio_cksum_t } static int -zio_checksum_error(const blkptr_t *bp, void *data, uint64_t offset) +zio_checksum_verify(const blkptr_t *bp, void *data) { - unsigned int checksum = BP_IS_GANG(bp) ? ZIO_CHECKSUM_GANG_HEADER : BP_GET_CHECKSUM(bp); - uint64_t size = BP_GET_PSIZE(bp); + uint64_t size; + unsigned int checksum; zio_checksum_info_t *ci; zio_cksum_t actual_cksum, expected_cksum, verifier; int byteswap; + checksum = BP_GET_CHECKSUM(bp); + size = BP_GET_PSIZE(bp); + if (checksum >= ZIO_CHECKSUM_FUNCTIONS) return (EINVAL); ci = &zio_checksum_table[checksum]; @@ -206,7 +209,8 @@ zio_checksum_error(const blkptr_t *bp, v if (checksum == ZIO_CHECKSUM_GANG_HEADER) zio_checksum_gang_verifier(&verifier, bp); else if (checksum == ZIO_CHECKSUM_LABEL) - zio_checksum_label_verifier(&verifier, offset); + zio_checksum_label_verifier(&verifier, + DVA_GET_OFFSET(BP_IDENTITY(bp))); else verifier = bp->blk_cksum; @@ -224,7 +228,6 @@ zio_checksum_error(const blkptr_t *bp, v byteswap_uint64_array(&expected_cksum, sizeof (zio_cksum_t)); } else { - ASSERT(!BP_IS_GANG(bp)); expected_cksum = bp->blk_cksum; ci->ci_func[0](data, size, &actual_cksum); } @@ -1215,15 +1218,10 @@ static void vdev_raidz_map_free(raidz_map_t *rm) { int c; - size_t size; for (c = rm->rm_firstdatacol - 1; c >= 0; c--) zfs_free(rm->rm_col[c].rc_data, rm->rm_col[c].rc_size); - size = 0; - for (c = rm->rm_firstdatacol; c < rm->rm_cols; c++) - size += rm->rm_col[c].rc_size; - zfs_free(rm, offsetof(raidz_map_t, rm_col[rm->rm_scols])); } @@ -1245,10 +1243,10 @@ vdev_child(vdev_t *pvd, uint64_t devidx) * any ereports we generate can note it. */ static int -raidz_checksum_verify(const blkptr_t *bp, void *data) +raidz_checksum_verify(const blkptr_t *bp, void *data, uint64_t size) { - return (zio_checksum_error(bp, data, 0)); + return (zio_checksum_verify(bp, data)); } /* @@ -1298,7 +1296,7 @@ raidz_parity_verify(raidz_map_t *rm) */ static int vdev_raidz_combrec(raidz_map_t *rm, const blkptr_t *bp, void *data, - off_t offset, int total_errors, int data_errors) + off_t offset, uint64_t bytes, int total_errors, int data_errors) { raidz_col_t *rc; void *orig[VDEV_RAIDZ_MAXPARITY]; @@ -1377,7 +1375,7 @@ vdev_raidz_combrec(raidz_map_t *rm, cons * success. */ code = vdev_raidz_reconstruct(rm, tgts, n); - if (raidz_checksum_verify(bp, data) == 0) { + if (raidz_checksum_verify(bp, data, bytes) == 0) { for (i = 0; i < n; i++) { c = tgts[i]; rc = &rm->rm_col[c]; @@ -1548,7 +1546,7 @@ reconstruct: */ if (total_errors <= rm->rm_firstdatacol - parity_untried) { if (data_errors == 0) { - if (raidz_checksum_verify(bp, data) == 0) { + if (raidz_checksum_verify(bp, data, bytes) == 0) { /* * If we read parity information (unnecessarily * as it happens since no reconstruction was @@ -1593,7 +1591,7 @@ reconstruct: code = vdev_raidz_reconstruct(rm, tgts, n); - if (raidz_checksum_verify(bp, data) == 0) { + if (raidz_checksum_verify(bp, data, bytes) == 0) { /* * If we read more parity disks than were used * for reconstruction, confirm that the other @@ -1633,7 +1631,9 @@ reconstruct: n = 0; for (c = 0; c < rm->rm_cols; c++) { - if (rm->rm_col[c].rc_tried) + rc = &rm->rm_col[c]; + + if (rc->rc_tried) continue; cvd = vdev_child(vd, rc->rc_devidx); @@ -1665,8 +1665,8 @@ reconstruct: if (total_errors > rm->rm_firstdatacol) { error = EIO; } else if (total_errors < rm->rm_firstdatacol && - (code = vdev_raidz_combrec(rm, bp, data, offset, total_errors, - data_errors)) != 0) { + (code = vdev_raidz_combrec(rm, bp, data, offset, bytes, + total_errors, data_errors)) != 0) { /* * If we didn't use all the available parity for the * combinatorial reconstruction, verify that the remaining Modified: releng/9.0/tools/tools/zfsboottest/Makefile ============================================================================== --- releng/9.0/tools/tools/zfsboottest/Makefile Sat Nov 19 11:44:20 2011 (r227709) +++ releng/9.0/tools/tools/zfsboottest/Makefile Sat Nov 19 11:47:15 2011 (r227710) @@ -2,7 +2,12 @@ .PATH: ${.CURDIR}/../../../sys/boot/zfs ${.CURDIR}/../../../sys/cddl/boot/zfs +BINDIR?= /usr/bin +SCRIPTSDIR?= /usr/bin + PROG= zfsboottest +SCRIPTS= zfsboottest.sh +SCRIPTSNAME= zfsboottest.sh NO_MAN= CFLAGS= -O1 \ @@ -12,6 +17,7 @@ CFLAGS= -O1 \ -fdiagnostics-show-option \ -W -Wextra -Wno-sign-compare -Wno-unused-parameter \ -Werror +LDFLAGS+=-lmd .if ${MACHINE_CPUARCH} == "amd64" beforedepend zfsboottest.o: machine Modified: releng/9.0/tools/tools/zfsboottest/zfsboottest.c ============================================================================== --- releng/9.0/tools/tools/zfsboottest/zfsboottest.c Sat Nov 19 11:44:20 2011 (r227709) +++ releng/9.0/tools/tools/zfsboottest/zfsboottest.c Sat Nov 19 11:47:15 2011 (r227710) @@ -1,6 +1,7 @@ /*- * Copyright (c) 2010 Doug Rabson * Copyright (c) 2011 Andriy Gapon + * Copyright (c) 2011 Pawel Jakub Dawidek * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -28,8 +29,10 @@ #include #include +#include #include #include +#include #include #include #include @@ -43,6 +46,7 @@ void pager_output(const char *line) { + fprintf(stderr, "%s", line); } @@ -54,7 +58,7 @@ pager_output(const char *line) static int vdev_read(vdev_t *vdev, void *priv, off_t off, void *buf, size_t bytes) { - int fd = *(int *) priv; + int fd = *(int *)priv; if (pread(fd, buf, bytes, off) != bytes) return (-1); @@ -73,7 +77,7 @@ zfs_read(spa_t *spa, dnode_phys_t *dn, v n = zp->zp_size - off; rc = dnode_read(spa, dn, off, buf, n); - if (rc) + if (rc != 0) return (-rc); return (n); @@ -82,31 +86,49 @@ zfs_read(spa_t *spa, dnode_phys_t *dn, v int main(int argc, char** argv) { - char buf[512]; - int fd[100]; + char buf[512], hash[33]; + MD5_CTX ctx; struct stat sb; dnode_phys_t dn; spa_t *spa; off_t off; ssize_t n; - int i; + int i, failures, *fd; zfs_init(); if (argc == 1) { static char *av[] = { - "zfstest", "COPYRIGHT", - "/dev/da0p2", "/dev/da1p2", "/dev/da2p2", + "zfsboottest", + "/dev/gpt/system0", + "/dev/gpt/system1", + "-", + "/boot/zfsloader", + "/boot/support.4th", + "/boot/kernel/kernel", NULL, }; - argc = 5; + argc = sizeof(av) / sizeof(av[0]) - 1; argv = av; } - for (i = 2; i < argc; i++) { - fd[i] = open(argv[i], O_RDONLY); - if (fd[i] < 0) + for (i = 1; i < argc; i++) { + if (strcmp(argv[i], "-") == 0) + break; + } + fd = malloc(sizeof(fd[0]) * (i - 1)); + if (fd == NULL) + errx(1, "Unable to allocate memory."); + for (i = 1; i < argc; i++) { + if (strcmp(argv[i], "-") == 0) + break; + fd[i - 1] = open(argv[i], O_RDONLY); + if (fd[i - 1] == -1) { + warn("open(%s) failed", argv[i]); continue; - if (vdev_probe(vdev_read, &fd[i], NULL) != 0) - close(fd[i]); + } + if (vdev_probe(vdev_read, &fd[i - 1], NULL) != 0) { + warnx("vdev_probe(%s) failed", argv[i]); + close(fd[i - 1]); + } } spa_all_status(); @@ -121,29 +143,40 @@ main(int argc, char** argv) exit(1); } - if (zfs_lookup(spa, argv[1], &dn)) { - fprintf(stderr, "can't lookup\n"); - exit(1); - } - - if (zfs_dnode_stat(spa, &dn, &sb)) { - fprintf(stderr, "can't stat\n"); - exit(1); - } - + printf("\n"); + for (++i, failures = 0; i < argc; i++) { + if (zfs_lookup(spa, argv[i], &dn)) { + fprintf(stderr, "%s: can't lookup\n", argv[i]); + failures++; + continue; + } - off = 0; - do { - n = sb.st_size - off; - n = n > sizeof(buf) ? sizeof(buf) : n; - n = zfs_read(spa, &dn, buf, n, off); - if (n < 0) { - fprintf(stderr, "zfs_read failed\n"); - exit(1); + if (zfs_dnode_stat(spa, &dn, &sb)) { + fprintf(stderr, "%s: can't stat\n", argv[i]); + failures++; + continue; } - write(1, buf, n); - off += n; - } while (off < sb.st_size); - return (0); + off = 0; + MD5Init(&ctx); + do { + n = sb.st_size - off; + n = n > sizeof(buf) ? sizeof(buf) : n; + n = zfs_read(spa, &dn, buf, n, off); + if (n < 0) { + fprintf(stderr, "%s: zfs_read failed\n", + argv[i]); + failures++; + break; + } + MD5Update(&ctx, buf, n); + off += n; + } while (off < sb.st_size); + if (off < sb.st_size) + continue; + MD5End(&ctx, hash); + printf("%s %s\n", hash, argv[i]); + } + + return (failures == 0 ? 0 : 1); } Copied: releng/9.0/tools/tools/zfsboottest/zfsboottest.sh (from r226612, head/tools/tools/zfsboottest/zfsboottest.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ releng/9.0/tools/tools/zfsboottest/zfsboottest.sh Sat Nov 19 11:47:15 2011 (r227710, copy of r226612, head/tools/tools/zfsboottest/zfsboottest.sh) @@ -0,0 +1,130 @@ +#!/bin/sh +# +# Copyright (c) 2011 Pawel Jakub Dawidek +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ + +if [ $# -ne 1 ]; then + echo "usage: zfsboottest.sh " >&2 + exit 1 +fi + +which -s zfsboottest +if [ $? -eq 0 ]; then + zfsboottest="zfsboottest" +else + if [ ! -x "/usr/src/tools/tools/zfsboottest/zfsboottest" ]; then + echo "Unable to find \"zfsboottest\" utility." >&2 + exit 1 + fi + zfsboottest="/usr/src/tools/tools/zfsboottest/zfsboottest" +fi + +startdir="/boot" + +pool="${1}" +zpool list "${pool}" >/dev/null 2>&1 +if [ $? -ne 0 ]; then + echo "No such pool \"${pool}\"." >&2 + exit 1 +fi +bootfs=`zpool get bootfs "${pool}" | tail -1 | awk '{print $3}'` +if [ "${bootfs}" = "-" ]; then + echo "The \"bootfs\" property is not configured for pool \"${pool}\"." >&2 + exit 1 +fi +# Dataset's mountpoint property should be set to 'legacy'. +if [ "`zfs get -H -o value mountpoint ${bootfs}`" != "legacy" ]; then + echo "The \"mountpoint\" property of dataset \"${bootfs}\" should be set to \"legacy\"." >&2 + exit 1 +fi +mountpoint=`df -t zfs "${bootfs}" 2>/dev/null | tail -1 | awk '{print $6}'` +if [ -z "${mountpoint}" ]; then + echo "The \"${bootfs}\" dataset is not mounted." >&2 + exit 1 +fi +if [ ! -d "${mountpoint}${startdir}" ]; then + echo "The \"${mountpoint}${startdir}\" directory doesn't exist." >&2 + exit 1 +fi +# To be able to mount root ZFS file system we need either /etc/fstab entry +# or vfs.root.mountfrom variable set in /boot/loader.conf. +egrep -q '^'"${bootfs}"'[[:space:]]+/[[:space:]]+zfs[[:space:]]+' "${mountpoint}/etc/fstab" 2>/dev/null +if [ $? -ne 0 ]; then + egrep -q 'vfs.root.mountfrom="?'"${bootfs}"'"?[[:space:]]*$' "${mountpoint}/boot/loader.conf" 2>/dev/null + if [ $? -ne 0 ]; then + echo "To be able to boot from \"${bootfs}\", you need to declare" >&2 + echo "\"${bootfs}\" as being root file system in ${mountpoint}/etc/fstab" >&2 + echo "or add \"vfs.root.mountfrom\" variable set to \"${bootfs}\" to" >&2 + echo "${mountpoint}/boot/loader.conf." >&2 + exit 1 + fi +fi +vdevs="" +for vdev in `zpool status "${pool}" | grep ONLINE | awk '{print $1}'`; do + vdev="/dev/${vdev#/dev/}" + if [ -c "${vdev}" ]; then + if [ -z "${vdevs}" ]; then + vdevs="${vdev}" + else + vdevs="${vdevs} ${vdev}" + fi + fi +done + +list0=`mktemp /tmp/zfsboottest.XXXXXXXXXX` +if [ $? -ne 0 ]; then + echo "Unable to create temporary file." >&2 + exit 1 +fi +list1=`mktemp /tmp/zfsboottest.XXXXXXXXXX` +if [ $? -ne 0 ]; then + echo "Unable to create temporary file." >&2 + rm -f "${list0}" + exit 1 +fi + +echo "zfsboottest.sh is reading all the files in ${mountpoint}${startdir} using" +echo "boot code and using file system code." +echo "It calculates MD5 checksums for all the files and will compare them." +echo "If all files can be properly read using boot code, it is very likely you" +echo "will be able to boot from \"${pool}\" pool>:> Good luck!" +echo + +"${zfsboottest}" ${vdevs} - `find "${mountpoint}${startdir}" -type f | sed "s@^${mountpoint}@@"` | egrep '^[0-9a-z]{32} /' | sort -k 2 >"${list0}" +find "${mountpoint}${startdir}" -type f | xargs md5 -r | sed "s@ ${mountpoint}@ @" | egrep '^[0-9a-z]{32} /' | sort -k 2 >"${list1}" + +diff -u "${list0}" "${list1}" +ec=$? + +rm -f "${list0}" "${list1}" + +if [ $? -ne 0 ]; then + echo >&2 + echo "You may not be able to boot." >&2 + exit 1 +fi + +echo "OK" From owner-svn-src-all@FreeBSD.ORG Sat Nov 19 12:55:33 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 80208106566B; Sat, 19 Nov 2011 12:55:33 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 656818FC13; Sat, 19 Nov 2011 12:55:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAJCtXHb043718; Sat, 19 Nov 2011 12:55:33 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAJCtX6E043710; Sat, 19 Nov 2011 12:55:33 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201111191255.pAJCtX6E043710@svn.freebsd.org> From: Marius Strobl Date: Sat, 19 Nov 2011 12:55:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227711 - in stable/9: share/man/man9 sys/dev/ofw sys/kern sys/powerpc/powerpc sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Nov 2011 12:55:33 -0000 Author: marius Date: Sat Nov 19 12:55:32 2011 New Revision: 227711 URL: http://svn.freebsd.org/changeset/base/227711 Log: MFC: r227537 As it turns out, r186347 actually is insufficient to avoid the use of the curthread-accessing part of mtx_{,un}lock(9) when using a r210623-style curthread implementation on sparc64, crashing the kernel in its early cycles as PCPU isn't set up, yet (and can't be set up as OFW is one of the things we need for that, which leads to a chicken-and-egg problem). What happens is that due to the fact that the idea of r210623 actually is to allow the compiler to cache invocations of curthread, it factors out obtaining curthread needed for both mtx_lock(9) and mtx_unlock(9) to before the branch based on kobj_mutex_inited when compiling the kernel without the debugging options. So change kobj_class_compile_static(9) to just never acquire kobj_mtx, effectively restricting it to its documented use, and add a kobj_init_static(9) for initializing objects using a class compiled with the former and that also avoids using mutex(9) (and malloc(9)). Also assert in both of these functions that they are used in their intended way only. While at it, inline kobj_register_method() and kobj_unregister_method() as there wasn't much point for factoring them out in the first place and so that a reader of the code has to figure out the locking for fewer functions missing a KOBJ_ASSERT. Tested on powerpc{,64} by andreast. Reviewed by: nwhitehorn (earlier version), jhb Approved by: re (kib) Modified: stable/9/share/man/man9/Makefile stable/9/share/man/man9/kobj.9 stable/9/sys/dev/ofw/openfirm.c stable/9/sys/kern/subr_kobj.c stable/9/sys/powerpc/powerpc/platform.c stable/9/sys/powerpc/powerpc/pmap_dispatch.c stable/9/sys/sys/kobj.h Directory Properties: stable/9/share/man/man9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/share/man/man9/Makefile ============================================================================== --- stable/9/share/man/man9/Makefile Sat Nov 19 11:47:15 2011 (r227710) +++ stable/9/share/man/man9/Makefile Sat Nov 19 12:55:32 2011 (r227711) @@ -724,7 +724,8 @@ MLINKS+=kobj.9 DEFINE_CLASS.9 \ kobj.9 kobj_class_free.9 \ kobj.9 kobj_create.9 \ kobj.9 kobj_delete.9 \ - kobj.9 kobj_init.9 + kobj.9 kobj_init.9 \ + kobj.9 kobj_init_static.9 MLINKS+=kproc.9 kproc_create.9 \ kproc.9 kproc_exit.9 \ kproc.9 kproc_resume.9 \ Modified: stable/9/share/man/man9/kobj.9 ============================================================================== --- stable/9/share/man/man9/kobj.9 Sat Nov 19 11:47:15 2011 (r227710) +++ stable/9/share/man/man9/kobj.9 Sat Nov 19 12:55:32 2011 (r227711) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 4, 2000 +.Dd November 14, 2011 .Dt KOBJ 9 .Os .Sh NAME @@ -48,6 +48,8 @@ .Ft void .Fn kobj_init "kobj_t obj" "kobj_class_t cls" .Ft void +.Fn kobj_init_static "kobj_t obj" "kobj_class_t cls" +.Ft void .Fn kobj_delete "kobj_t obj" "struct malloc_type *mtype" .Fn DEFINE_CLASS name "kobj_method_t *methods" "size_t size" .Sh DESCRIPTION @@ -88,10 +90,14 @@ Objects created in this way should be fr Clients which would like to manage the allocation of memory themselves should call .Fn kobj_init +or +.Fn kobj_init_static with a pointer to the memory for the object and the class which implements it. It is also possible to use .Fn kobj_init +and +.Fn kobj_init_static to change the class for an object. This should be done with care as the classes must agree on the layout of the object. @@ -109,13 +115,19 @@ A client should not normally need to cal will automatically be compiled the first time it is used. If a class is to be used before .Xr malloc 9 -is initialised, +and +.Xr mutex 9 +are initialised, then .Fn kobj_class_compile_static should be called with the class and a pointer to a statically allocated .Vt kobj_ops structure before the class is used to initialise any objects. +In that case, also +.Fn kobj_init_static +should be used instead of +.Fn kobj_init . .Pp To define a class, first define a simple array of .Vt kobj_method_t . Modified: stable/9/sys/dev/ofw/openfirm.c ============================================================================== --- stable/9/sys/dev/ofw/openfirm.c Sat Nov 19 11:47:15 2011 (r227710) +++ stable/9/sys/dev/ofw/openfirm.c Sat Nov 19 12:55:32 2011 (r227711) @@ -127,7 +127,7 @@ OF_init(void *cookie) * then statically initialize the OFW object. */ kobj_class_compile_static(ofw_def_impl, &ofw_kernel_kops); - kobj_init((kobj_t)ofw_obj, ofw_def_impl); + kobj_init_static((kobj_t)ofw_obj, ofw_def_impl); rv = OFW_INIT(ofw_obj, cookie); Modified: stable/9/sys/kern/subr_kobj.c ============================================================================== --- stable/9/sys/kern/subr_kobj.c Sat Nov 19 11:47:15 2011 (r227710) +++ stable/9/sys/kern/subr_kobj.c Sat Nov 19 12:55:32 2011 (r227711) @@ -60,18 +60,9 @@ static struct mtx kobj_mtx; static int kobj_mutex_inited; static int kobj_next_id = 1; -/* - * In the event that kobj_mtx has not been initialized yet, - * we will ignore it, and run without locks in order to support - * use of KOBJ before mutexes are available. This early in the boot - * process, everything is single threaded and so races should not - * happen. This is used to provide the PMAP layer on PowerPC, as well - * as board support. - */ - -#define KOBJ_LOCK() if (kobj_mutex_inited) mtx_lock(&kobj_mtx); -#define KOBJ_UNLOCK() if (kobj_mutex_inited) mtx_unlock(&kobj_mtx); -#define KOBJ_ASSERT(what) if (kobj_mutex_inited) mtx_assert(&kobj_mtx,what); +#define KOBJ_LOCK() mtx_lock(&kobj_mtx) +#define KOBJ_UNLOCK() mtx_unlock(&kobj_mtx) +#define KOBJ_ASSERT(what) mtx_assert(&kobj_mtx, what); SYSCTL_INT(_kern, OID_AUTO, kobj_methodcount, CTLFLAG_RD, &kobj_next_id, 0, ""); @@ -104,28 +95,11 @@ kobj_error_method(void) } static void -kobj_register_method(struct kobjop_desc *desc) -{ - KOBJ_ASSERT(MA_OWNED); - - if (desc->id == 0) { - desc->id = kobj_next_id++; - } -} - -static void -kobj_unregister_method(struct kobjop_desc *desc) -{ -} - -static void kobj_class_compile_common(kobj_class_t cls, kobj_ops_t ops) { kobj_method_t *m; int i; - KOBJ_ASSERT(MA_OWNED); - /* * Don't do anything if we are already compiled. */ @@ -135,8 +109,10 @@ kobj_class_compile_common(kobj_class_t c /* * First register any methods which need it. */ - for (i = 0, m = cls->methods; m->desc; i++, m++) - kobj_register_method(m->desc); + for (i = 0, m = cls->methods; m->desc; i++, m++) { + if (m->desc->id == 0) + m->desc->id = kobj_next_id++; + } /* * Then initialise the ops table. @@ -159,7 +135,7 @@ kobj_class_compile(kobj_class_t cls) */ ops = malloc(sizeof(struct kobj_ops), M_KOBJ, M_NOWAIT); if (!ops) - panic("kobj_compile_methods: out of memory"); + panic("%s: out of memory", __func__); KOBJ_LOCK(); @@ -182,17 +158,14 @@ void kobj_class_compile_static(kobj_class_t cls, kobj_ops_t ops) { - KOBJ_ASSERT(MA_NOTOWNED); + KASSERT(kobj_mutex_inited == 0, + ("%s: only supported during early cycles", __func__)); /* * Increment refs to make sure that the ops table is not freed. */ - KOBJ_LOCK(); - cls->refs++; kobj_class_compile_common(cls, ops); - - KOBJ_UNLOCK(); } static kobj_method_t* @@ -259,8 +232,6 @@ kobj_lookup_method(kobj_class_t cls, void kobj_class_free(kobj_class_t cls) { - int i; - kobj_method_t *m; void* ops = NULL; KOBJ_ASSERT(MA_NOTOWNED); @@ -272,10 +243,9 @@ kobj_class_free(kobj_class_t cls) */ if (cls->refs == 0) { /* - * Unregister any methods which are no longer used. + * For now we don't do anything to unregister any methods + * which are no longer used. */ - for (i = 0, m = cls->methods; m->desc; i++, m++) - kobj_unregister_method(m->desc); /* * Free memory and clean up. @@ -308,6 +278,14 @@ kobj_create(kobj_class_t cls, return obj; } +static void +kobj_init_common(kobj_t obj, kobj_class_t cls) +{ + + obj->ops = cls->ops; + cls->refs++; +} + void kobj_init(kobj_t obj, kobj_class_t cls) { @@ -329,13 +307,22 @@ kobj_init(kobj_t obj, kobj_class_t cls) goto retry; } - obj->ops = cls->ops; - cls->refs++; + kobj_init_common(obj, cls); KOBJ_UNLOCK(); } void +kobj_init_static(kobj_t obj, kobj_class_t cls) +{ + + KASSERT(kobj_mutex_inited == 0, + ("%s: only supported during early cycles", __func__)); + + kobj_init_common(obj, cls); +} + +void kobj_delete(kobj_t obj, struct malloc_type *mtype) { kobj_class_t cls = obj->ops->cls; Modified: stable/9/sys/powerpc/powerpc/platform.c ============================================================================== --- stable/9/sys/powerpc/powerpc/platform.c Sat Nov 19 11:47:15 2011 (r227710) +++ stable/9/sys/powerpc/powerpc/platform.c Sat Nov 19 12:55:32 2011 (r227711) @@ -184,7 +184,7 @@ platform_probe_and_attach() * then statically initialise the MMU object */ kobj_class_compile_static(platp, &plat_kernel_kops); - kobj_init((kobj_t)plat_obj, platp); + kobj_init_static((kobj_t)plat_obj, platp); prio = PLATFORM_PROBE(plat_obj); @@ -223,7 +223,7 @@ platform_probe_and_attach() */ kobj_class_compile_static(plat_def_impl, &plat_kernel_kops); - kobj_init((kobj_t)plat_obj, plat_def_impl); + kobj_init_static((kobj_t)plat_obj, plat_def_impl); strlcpy(plat_name,plat_def_impl->name,sizeof(plat_name)); Modified: stable/9/sys/powerpc/powerpc/pmap_dispatch.c ============================================================================== --- stable/9/sys/powerpc/powerpc/pmap_dispatch.c Sat Nov 19 11:47:15 2011 (r227710) +++ stable/9/sys/powerpc/powerpc/pmap_dispatch.c Sat Nov 19 12:55:32 2011 (r227711) @@ -410,7 +410,7 @@ pmap_bootstrap(vm_offset_t start, vm_off * then statically initialise the MMU object */ kobj_class_compile_static(mmu_def_impl, &mmu_kernel_kops); - kobj_init((kobj_t)mmu_obj, mmu_def_impl); + kobj_init_static((kobj_t)mmu_obj, mmu_def_impl); MMU_BOOTSTRAP(mmu_obj, start, end); } Modified: stable/9/sys/sys/kobj.h ============================================================================== --- stable/9/sys/sys/kobj.h Sat Nov 19 11:47:15 2011 (r227710) +++ stable/9/sys/sys/kobj.h Sat Nov 19 12:55:32 2011 (r227711) @@ -201,6 +201,7 @@ kobj_t kobj_create(kobj_class_t cls, * Initialise a pre-allocated object. */ void kobj_init(kobj_t obj, kobj_class_t cls); +void kobj_init_static(kobj_t obj, kobj_class_t cls); /* * Delete an object. If mtype is non-zero, free the memory. From owner-svn-src-all@FreeBSD.ORG Sat Nov 19 12:55:34 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E4173106566C; Sat, 19 Nov 2011 12:55:34 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D15F48FC15; Sat, 19 Nov 2011 12:55:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAJCtYLG043755; Sat, 19 Nov 2011 12:55:34 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAJCtYaH043747; Sat, 19 Nov 2011 12:55:34 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201111191255.pAJCtYaH043747@svn.freebsd.org> From: Marius Strobl Date: Sat, 19 Nov 2011 12:55:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227712 - in releng/9.0: share/man/man9 sys/dev/ofw sys/kern sys/powerpc/powerpc sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Nov 2011 12:55:35 -0000 Author: marius Date: Sat Nov 19 12:55:34 2011 New Revision: 227712 URL: http://svn.freebsd.org/changeset/base/227712 Log: MFC: r227537 As it turns out, r186347 actually is insufficient to avoid the use of the curthread-accessing part of mtx_{,un}lock(9) when using a r210623-style curthread implementation on sparc64, crashing the kernel in its early cycles as PCPU isn't set up, yet (and can't be set up as OFW is one of the things we need for that, which leads to a chicken-and-egg problem). What happens is that due to the fact that the idea of r210623 actually is to allow the compiler to cache invocations of curthread, it factors out obtaining curthread needed for both mtx_lock(9) and mtx_unlock(9) to before the branch based on kobj_mutex_inited when compiling the kernel without the debugging options. So change kobj_class_compile_static(9) to just never acquire kobj_mtx, effectively restricting it to its documented use, and add a kobj_init_static(9) for initializing objects using a class compiled with the former and that also avoids using mutex(9) (and malloc(9)). Also assert in both of these functions that they are used in their intended way only. While at it, inline kobj_register_method() and kobj_unregister_method() as there wasn't much point for factoring them out in the first place and so that a reader of the code has to figure out the locking for fewer functions missing a KOBJ_ASSERT. Tested on powerpc{,64} by andreast. Reviewed by: nwhitehorn (earlier version), jhb Approved by: re (kib) Modified: releng/9.0/share/man/man9/Makefile releng/9.0/share/man/man9/kobj.9 releng/9.0/sys/dev/ofw/openfirm.c releng/9.0/sys/kern/subr_kobj.c releng/9.0/sys/powerpc/powerpc/platform.c releng/9.0/sys/powerpc/powerpc/pmap_dispatch.c releng/9.0/sys/sys/kobj.h Directory Properties: releng/9.0/share/man/man9/ (props changed) releng/9.0/sys/ (props changed) releng/9.0/sys/amd64/include/xen/ (props changed) releng/9.0/sys/boot/ (props changed) releng/9.0/sys/boot/i386/efi/ (props changed) releng/9.0/sys/boot/ia64/efi/ (props changed) releng/9.0/sys/boot/ia64/ski/ (props changed) releng/9.0/sys/boot/powerpc/boot1.chrp/ (props changed) releng/9.0/sys/boot/powerpc/ofw/ (props changed) releng/9.0/sys/cddl/contrib/opensolaris/ (props changed) releng/9.0/sys/conf/ (props changed) releng/9.0/sys/contrib/dev/acpica/ (props changed) releng/9.0/sys/contrib/octeon-sdk/ (props changed) releng/9.0/sys/contrib/pf/ (props changed) releng/9.0/sys/contrib/x86emu/ (props changed) Modified: releng/9.0/share/man/man9/Makefile ============================================================================== --- releng/9.0/share/man/man9/Makefile Sat Nov 19 12:55:32 2011 (r227711) +++ releng/9.0/share/man/man9/Makefile Sat Nov 19 12:55:34 2011 (r227712) @@ -724,7 +724,8 @@ MLINKS+=kobj.9 DEFINE_CLASS.9 \ kobj.9 kobj_class_free.9 \ kobj.9 kobj_create.9 \ kobj.9 kobj_delete.9 \ - kobj.9 kobj_init.9 + kobj.9 kobj_init.9 \ + kobj.9 kobj_init_static.9 MLINKS+=kproc.9 kproc_create.9 \ kproc.9 kproc_exit.9 \ kproc.9 kproc_resume.9 \ Modified: releng/9.0/share/man/man9/kobj.9 ============================================================================== --- releng/9.0/share/man/man9/kobj.9 Sat Nov 19 12:55:32 2011 (r227711) +++ releng/9.0/share/man/man9/kobj.9 Sat Nov 19 12:55:34 2011 (r227712) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 4, 2000 +.Dd November 14, 2011 .Dt KOBJ 9 .Os .Sh NAME @@ -48,6 +48,8 @@ .Ft void .Fn kobj_init "kobj_t obj" "kobj_class_t cls" .Ft void +.Fn kobj_init_static "kobj_t obj" "kobj_class_t cls" +.Ft void .Fn kobj_delete "kobj_t obj" "struct malloc_type *mtype" .Fn DEFINE_CLASS name "kobj_method_t *methods" "size_t size" .Sh DESCRIPTION @@ -88,10 +90,14 @@ Objects created in this way should be fr Clients which would like to manage the allocation of memory themselves should call .Fn kobj_init +or +.Fn kobj_init_static with a pointer to the memory for the object and the class which implements it. It is also possible to use .Fn kobj_init +and +.Fn kobj_init_static to change the class for an object. This should be done with care as the classes must agree on the layout of the object. @@ -109,13 +115,19 @@ A client should not normally need to cal will automatically be compiled the first time it is used. If a class is to be used before .Xr malloc 9 -is initialised, +and +.Xr mutex 9 +are initialised, then .Fn kobj_class_compile_static should be called with the class and a pointer to a statically allocated .Vt kobj_ops structure before the class is used to initialise any objects. +In that case, also +.Fn kobj_init_static +should be used instead of +.Fn kobj_init . .Pp To define a class, first define a simple array of .Vt kobj_method_t . Modified: releng/9.0/sys/dev/ofw/openfirm.c ============================================================================== --- releng/9.0/sys/dev/ofw/openfirm.c Sat Nov 19 12:55:32 2011 (r227711) +++ releng/9.0/sys/dev/ofw/openfirm.c Sat Nov 19 12:55:34 2011 (r227712) @@ -127,7 +127,7 @@ OF_init(void *cookie) * then statically initialize the OFW object. */ kobj_class_compile_static(ofw_def_impl, &ofw_kernel_kops); - kobj_init((kobj_t)ofw_obj, ofw_def_impl); + kobj_init_static((kobj_t)ofw_obj, ofw_def_impl); rv = OFW_INIT(ofw_obj, cookie); Modified: releng/9.0/sys/kern/subr_kobj.c ============================================================================== --- releng/9.0/sys/kern/subr_kobj.c Sat Nov 19 12:55:32 2011 (r227711) +++ releng/9.0/sys/kern/subr_kobj.c Sat Nov 19 12:55:34 2011 (r227712) @@ -60,18 +60,9 @@ static struct mtx kobj_mtx; static int kobj_mutex_inited; static int kobj_next_id = 1; -/* - * In the event that kobj_mtx has not been initialized yet, - * we will ignore it, and run without locks in order to support - * use of KOBJ before mutexes are available. This early in the boot - * process, everything is single threaded and so races should not - * happen. This is used to provide the PMAP layer on PowerPC, as well - * as board support. - */ - -#define KOBJ_LOCK() if (kobj_mutex_inited) mtx_lock(&kobj_mtx); -#define KOBJ_UNLOCK() if (kobj_mutex_inited) mtx_unlock(&kobj_mtx); -#define KOBJ_ASSERT(what) if (kobj_mutex_inited) mtx_assert(&kobj_mtx,what); +#define KOBJ_LOCK() mtx_lock(&kobj_mtx) +#define KOBJ_UNLOCK() mtx_unlock(&kobj_mtx) +#define KOBJ_ASSERT(what) mtx_assert(&kobj_mtx, what); SYSCTL_INT(_kern, OID_AUTO, kobj_methodcount, CTLFLAG_RD, &kobj_next_id, 0, ""); @@ -104,28 +95,11 @@ kobj_error_method(void) } static void -kobj_register_method(struct kobjop_desc *desc) -{ - KOBJ_ASSERT(MA_OWNED); - - if (desc->id == 0) { - desc->id = kobj_next_id++; - } -} - -static void -kobj_unregister_method(struct kobjop_desc *desc) -{ -} - -static void kobj_class_compile_common(kobj_class_t cls, kobj_ops_t ops) { kobj_method_t *m; int i; - KOBJ_ASSERT(MA_OWNED); - /* * Don't do anything if we are already compiled. */ @@ -135,8 +109,10 @@ kobj_class_compile_common(kobj_class_t c /* * First register any methods which need it. */ - for (i = 0, m = cls->methods; m->desc; i++, m++) - kobj_register_method(m->desc); + for (i = 0, m = cls->methods; m->desc; i++, m++) { + if (m->desc->id == 0) + m->desc->id = kobj_next_id++; + } /* * Then initialise the ops table. @@ -159,7 +135,7 @@ kobj_class_compile(kobj_class_t cls) */ ops = malloc(sizeof(struct kobj_ops), M_KOBJ, M_NOWAIT); if (!ops) - panic("kobj_compile_methods: out of memory"); + panic("%s: out of memory", __func__); KOBJ_LOCK(); @@ -182,17 +158,14 @@ void kobj_class_compile_static(kobj_class_t cls, kobj_ops_t ops) { - KOBJ_ASSERT(MA_NOTOWNED); + KASSERT(kobj_mutex_inited == 0, + ("%s: only supported during early cycles", __func__)); /* * Increment refs to make sure that the ops table is not freed. */ - KOBJ_LOCK(); - cls->refs++; kobj_class_compile_common(cls, ops); - - KOBJ_UNLOCK(); } static kobj_method_t* @@ -259,8 +232,6 @@ kobj_lookup_method(kobj_class_t cls, void kobj_class_free(kobj_class_t cls) { - int i; - kobj_method_t *m; void* ops = NULL; KOBJ_ASSERT(MA_NOTOWNED); @@ -272,10 +243,9 @@ kobj_class_free(kobj_class_t cls) */ if (cls->refs == 0) { /* - * Unregister any methods which are no longer used. + * For now we don't do anything to unregister any methods + * which are no longer used. */ - for (i = 0, m = cls->methods; m->desc; i++, m++) - kobj_unregister_method(m->desc); /* * Free memory and clean up. @@ -308,6 +278,14 @@ kobj_create(kobj_class_t cls, return obj; } +static void +kobj_init_common(kobj_t obj, kobj_class_t cls) +{ + + obj->ops = cls->ops; + cls->refs++; +} + void kobj_init(kobj_t obj, kobj_class_t cls) { @@ -329,13 +307,22 @@ kobj_init(kobj_t obj, kobj_class_t cls) goto retry; } - obj->ops = cls->ops; - cls->refs++; + kobj_init_common(obj, cls); KOBJ_UNLOCK(); } void +kobj_init_static(kobj_t obj, kobj_class_t cls) +{ + + KASSERT(kobj_mutex_inited == 0, + ("%s: only supported during early cycles", __func__)); + + kobj_init_common(obj, cls); +} + +void kobj_delete(kobj_t obj, struct malloc_type *mtype) { kobj_class_t cls = obj->ops->cls; Modified: releng/9.0/sys/powerpc/powerpc/platform.c ============================================================================== --- releng/9.0/sys/powerpc/powerpc/platform.c Sat Nov 19 12:55:32 2011 (r227711) +++ releng/9.0/sys/powerpc/powerpc/platform.c Sat Nov 19 12:55:34 2011 (r227712) @@ -184,7 +184,7 @@ platform_probe_and_attach() * then statically initialise the MMU object */ kobj_class_compile_static(platp, &plat_kernel_kops); - kobj_init((kobj_t)plat_obj, platp); + kobj_init_static((kobj_t)plat_obj, platp); prio = PLATFORM_PROBE(plat_obj); @@ -223,7 +223,7 @@ platform_probe_and_attach() */ kobj_class_compile_static(plat_def_impl, &plat_kernel_kops); - kobj_init((kobj_t)plat_obj, plat_def_impl); + kobj_init_static((kobj_t)plat_obj, plat_def_impl); strlcpy(plat_name,plat_def_impl->name,sizeof(plat_name)); Modified: releng/9.0/sys/powerpc/powerpc/pmap_dispatch.c ============================================================================== --- releng/9.0/sys/powerpc/powerpc/pmap_dispatch.c Sat Nov 19 12:55:32 2011 (r227711) +++ releng/9.0/sys/powerpc/powerpc/pmap_dispatch.c Sat Nov 19 12:55:34 2011 (r227712) @@ -410,7 +410,7 @@ pmap_bootstrap(vm_offset_t start, vm_off * then statically initialise the MMU object */ kobj_class_compile_static(mmu_def_impl, &mmu_kernel_kops); - kobj_init((kobj_t)mmu_obj, mmu_def_impl); + kobj_init_static((kobj_t)mmu_obj, mmu_def_impl); MMU_BOOTSTRAP(mmu_obj, start, end); } Modified: releng/9.0/sys/sys/kobj.h ============================================================================== --- releng/9.0/sys/sys/kobj.h Sat Nov 19 12:55:32 2011 (r227711) +++ releng/9.0/sys/sys/kobj.h Sat Nov 19 12:55:34 2011 (r227712) @@ -201,6 +201,7 @@ kobj_t kobj_create(kobj_class_t cls, * Initialise a pre-allocated object. */ void kobj_init(kobj_t obj, kobj_class_t cls); +void kobj_init_static(kobj_t obj, kobj_class_t cls); /* * Delete an object. If mtype is non-zero, free the memory. From owner-svn-src-all@FreeBSD.ORG Sat Nov 19 13:03:15 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B3C2E1065747; Sat, 19 Nov 2011 13:03:15 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 992D18FC1B; Sat, 19 Nov 2011 13:03:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAJD3F05044084; Sat, 19 Nov 2011 13:03:15 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAJD3FZZ044075; Sat, 19 Nov 2011 13:03:15 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201111191303.pAJD3FZZ044075@svn.freebsd.org> From: Marius Strobl Date: Sat, 19 Nov 2011 13:03:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227713 - in stable/8: share/man/man9 sys/dev/ofw sys/kern sys/powerpc/powerpc sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Nov 2011 13:03:15 -0000 Author: marius Date: Sat Nov 19 13:03:14 2011 New Revision: 227713 URL: http://svn.freebsd.org/changeset/base/227713 Log: MFC: r227537 As it turns out, r186347 actually is insufficient to avoid the use of the curthread-accessing part of mtx_{,un}lock(9) when using a r210623-style curthread implementation on sparc64, crashing the kernel in its early cycles as PCPU isn't set up, yet (and can't be set up as OFW is one of the things we need for that, which leads to a chicken-and-egg problem). What happens is that due to the fact that the idea of r210623 actually is to allow the compiler to cache invocations of curthread, it factors out obtaining curthread needed for both mtx_lock(9) and mtx_unlock(9) to before the branch based on kobj_mutex_inited when compiling the kernel without the debugging options. So change kobj_class_compile_static(9) to just never acquire kobj_mtx, effectively restricting it to its documented use, and add a kobj_init_static(9) for initializing objects using a class compiled with the former and that also avoids using mutex(9) (and malloc(9)). Also assert in both of these functions that they are used in their intended way only. While at it, inline kobj_register_method() and kobj_unregister_method() as there wasn't much point for factoring them out in the first place and so that a reader of the code has to figure out the locking for fewer functions missing a KOBJ_ASSERT. Tested on powerpc{,64} by andreast. Reviewed by: nwhitehorn (earlier version), jhb Modified: stable/8/share/man/man9/Makefile stable/8/share/man/man9/kobj.9 stable/8/sys/dev/ofw/openfirm.c stable/8/sys/kern/subr_kobj.c stable/8/sys/powerpc/powerpc/platform.c stable/8/sys/powerpc/powerpc/pmap_dispatch.c stable/8/sys/sys/kobj.h Directory Properties: stable/8/share/man/man9/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/share/man/man9/Makefile ============================================================================== --- stable/8/share/man/man9/Makefile Sat Nov 19 12:55:34 2011 (r227712) +++ stable/8/share/man/man9/Makefile Sat Nov 19 13:03:14 2011 (r227713) @@ -724,7 +724,8 @@ MLINKS+=kobj.9 DEFINE_CLASS.9 \ kobj.9 kobj_class_free.9 \ kobj.9 kobj_create.9 \ kobj.9 kobj_delete.9 \ - kobj.9 kobj_init.9 + kobj.9 kobj_init.9 \ + kobj.9 kobj_init_static.9 MLINKS+=kproc.9 kproc_create.9 \ kproc.9 kthread_create.9 \ kproc.9 kproc_exit.9 \ Modified: stable/8/share/man/man9/kobj.9 ============================================================================== --- stable/8/share/man/man9/kobj.9 Sat Nov 19 12:55:34 2011 (r227712) +++ stable/8/share/man/man9/kobj.9 Sat Nov 19 13:03:14 2011 (r227713) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 4, 2000 +.Dd November 14, 2011 .Dt KOBJ 9 .Os .Sh NAME @@ -48,6 +48,8 @@ .Ft void .Fn kobj_init "kobj_t obj" "kobj_class_t cls" .Ft void +.Fn kobj_init_static "kobj_t obj" "kobj_class_t cls" +.Ft void .Fn kobj_delete "kobj_t obj" "struct malloc_type *mtype" .Fn DEFINE_CLASS name "kobj_method_t *methods" "size_t size" .Sh DESCRIPTION @@ -88,10 +90,14 @@ Objects created in this way should be fr Clients which would like to manage the allocation of memory themselves should call .Fn kobj_init +or +.Fn kobj_init_static with a pointer to the memory for the object and the class which implements it. It is also possible to use .Fn kobj_init +and +.Fn kobj_init_static to change the class for an object. This should be done with care as the classes must agree on the layout of the object. @@ -109,13 +115,19 @@ A client should not normally need to cal will automatically be compiled the first time it is used. If a class is to be used before .Xr malloc 9 -is initialised, +and +.Xr mutex 9 +are initialised, then .Fn kobj_class_compile_static should be called with the class and a pointer to a statically allocated .Vt kobj_ops structure before the class is used to initialise any objects. +In that case, also +.Fn kobj_init_static +should be used instead of +.Fn kobj_init . .Pp To define a class, first define a simple array of .Vt kobj_method_t . Modified: stable/8/sys/dev/ofw/openfirm.c ============================================================================== --- stable/8/sys/dev/ofw/openfirm.c Sat Nov 19 12:55:34 2011 (r227712) +++ stable/8/sys/dev/ofw/openfirm.c Sat Nov 19 13:03:14 2011 (r227713) @@ -121,7 +121,7 @@ OF_init(void *cookie) * then statically initialize the OFW object. */ kobj_class_compile_static(ofw_def_impl, &ofw_kernel_kops); - kobj_init((kobj_t)ofw_obj, ofw_def_impl); + kobj_init_static((kobj_t)ofw_obj, ofw_def_impl); OFW_INIT(ofw_obj, cookie); Modified: stable/8/sys/kern/subr_kobj.c ============================================================================== --- stable/8/sys/kern/subr_kobj.c Sat Nov 19 12:55:34 2011 (r227712) +++ stable/8/sys/kern/subr_kobj.c Sat Nov 19 13:03:14 2011 (r227713) @@ -60,18 +60,9 @@ static struct mtx kobj_mtx; static int kobj_mutex_inited; static int kobj_next_id = 1; -/* - * In the event that kobj_mtx has not been initialized yet, - * we will ignore it, and run without locks in order to support - * use of KOBJ before mutexes are available. This early in the boot - * process, everything is single threaded and so races should not - * happen. This is used to provide the PMAP layer on PowerPC, as well - * as board support. - */ - -#define KOBJ_LOCK() if (kobj_mutex_inited) mtx_lock(&kobj_mtx); -#define KOBJ_UNLOCK() if (kobj_mutex_inited) mtx_unlock(&kobj_mtx); -#define KOBJ_ASSERT(what) if (kobj_mutex_inited) mtx_assert(&kobj_mtx,what); +#define KOBJ_LOCK() mtx_lock(&kobj_mtx) +#define KOBJ_UNLOCK() mtx_unlock(&kobj_mtx) +#define KOBJ_ASSERT(what) mtx_assert(&kobj_mtx, what); SYSCTL_UINT(_kern, OID_AUTO, kobj_methodcount, CTLFLAG_RD, &kobj_next_id, 0, ""); @@ -104,28 +95,11 @@ kobj_error_method(void) } static void -kobj_register_method(struct kobjop_desc *desc) -{ - KOBJ_ASSERT(MA_OWNED); - - if (desc->id == 0) { - desc->id = kobj_next_id++; - } -} - -static void -kobj_unregister_method(struct kobjop_desc *desc) -{ -} - -static void kobj_class_compile_common(kobj_class_t cls, kobj_ops_t ops) { kobj_method_t *m; int i; - KOBJ_ASSERT(MA_OWNED); - /* * Don't do anything if we are already compiled. */ @@ -135,8 +109,10 @@ kobj_class_compile_common(kobj_class_t c /* * First register any methods which need it. */ - for (i = 0, m = cls->methods; m->desc; i++, m++) - kobj_register_method(m->desc); + for (i = 0, m = cls->methods; m->desc; i++, m++) { + if (m->desc->id == 0) + m->desc->id = kobj_next_id++; + } /* * Then initialise the ops table. @@ -159,7 +135,7 @@ kobj_class_compile(kobj_class_t cls) */ ops = malloc(sizeof(struct kobj_ops), M_KOBJ, M_NOWAIT); if (!ops) - panic("kobj_compile_methods: out of memory"); + panic("%s: out of memory", __func__); KOBJ_LOCK(); @@ -182,17 +158,14 @@ void kobj_class_compile_static(kobj_class_t cls, kobj_ops_t ops) { - KOBJ_ASSERT(MA_NOTOWNED); + KASSERT(kobj_mutex_inited == 0, + ("%s: only supported during early cycles", __func__)); /* * Increment refs to make sure that the ops table is not freed. */ - KOBJ_LOCK(); - cls->refs++; kobj_class_compile_common(cls, ops); - - KOBJ_UNLOCK(); } static kobj_method_t* @@ -259,8 +232,6 @@ kobj_lookup_method(kobj_class_t cls, void kobj_class_free(kobj_class_t cls) { - int i; - kobj_method_t *m; void* ops = NULL; KOBJ_ASSERT(MA_NOTOWNED); @@ -272,10 +243,9 @@ kobj_class_free(kobj_class_t cls) */ if (cls->refs == 0) { /* - * Unregister any methods which are no longer used. + * For now we don't do anything to unregister any methods + * which are no longer used. */ - for (i = 0, m = cls->methods; m->desc; i++, m++) - kobj_unregister_method(m->desc); /* * Free memory and clean up. @@ -308,6 +278,14 @@ kobj_create(kobj_class_t cls, return obj; } +static void +kobj_init_common(kobj_t obj, kobj_class_t cls) +{ + + obj->ops = cls->ops; + cls->refs++; +} + void kobj_init(kobj_t obj, kobj_class_t cls) { @@ -329,13 +307,22 @@ kobj_init(kobj_t obj, kobj_class_t cls) goto retry; } - obj->ops = cls->ops; - cls->refs++; + kobj_init_common(obj, cls); KOBJ_UNLOCK(); } void +kobj_init_static(kobj_t obj, kobj_class_t cls) +{ + + KASSERT(kobj_mutex_inited == 0, + ("%s: only supported during early cycles", __func__)); + + kobj_init_common(obj, cls); +} + +void kobj_delete(kobj_t obj, struct malloc_type *mtype) { kobj_class_t cls = obj->ops->cls; Modified: stable/8/sys/powerpc/powerpc/platform.c ============================================================================== --- stable/8/sys/powerpc/powerpc/platform.c Sat Nov 19 12:55:34 2011 (r227712) +++ stable/8/sys/powerpc/powerpc/platform.c Sat Nov 19 13:03:14 2011 (r227713) @@ -140,7 +140,7 @@ platform_probe_and_attach() * then statically initialise the MMU object */ kobj_class_compile_static(platp, &plat_kernel_kops); - kobj_init((kobj_t)plat_obj, platp); + kobj_init_static((kobj_t)plat_obj, platp); prio = PLATFORM_PROBE(plat_obj); @@ -178,7 +178,7 @@ platform_probe_and_attach() */ kobj_class_compile_static(plat_def_impl, &plat_kernel_kops); - kobj_init((kobj_t)plat_obj, plat_def_impl); + kobj_init_static((kobj_t)plat_obj, plat_def_impl); strlcpy(plat_name,plat_def_impl->name,sizeof(plat_name)); Modified: stable/8/sys/powerpc/powerpc/pmap_dispatch.c ============================================================================== --- stable/8/sys/powerpc/powerpc/pmap_dispatch.c Sat Nov 19 12:55:34 2011 (r227712) +++ stable/8/sys/powerpc/powerpc/pmap_dispatch.c Sat Nov 19 13:03:14 2011 (r227713) @@ -402,7 +402,7 @@ pmap_bootstrap(vm_offset_t start, vm_off * then statically initialise the MMU object */ kobj_class_compile_static(mmu_def_impl, &mmu_kernel_kops); - kobj_init((kobj_t)mmu_obj, mmu_def_impl); + kobj_init_static((kobj_t)mmu_obj, mmu_def_impl); MMU_BOOTSTRAP(mmu_obj, start, end); } Modified: stable/8/sys/sys/kobj.h ============================================================================== --- stable/8/sys/sys/kobj.h Sat Nov 19 12:55:34 2011 (r227712) +++ stable/8/sys/sys/kobj.h Sat Nov 19 13:03:14 2011 (r227713) @@ -201,6 +201,7 @@ kobj_t kobj_create(kobj_class_t cls, * Initialise a pre-allocated object. */ void kobj_init(kobj_t obj, kobj_class_t cls); +void kobj_init_static(kobj_t obj, kobj_class_t cls); /* * Delete an object. If mtype is non-zero, free the memory. From owner-svn-src-all@FreeBSD.ORG Sat Nov 19 13:03:59 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A78B1106564A; Sat, 19 Nov 2011 13:03:59 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 965748FC13; Sat, 19 Nov 2011 13:03:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAJD3xBI044140; Sat, 19 Nov 2011 13:03:59 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAJD3xtR044138; Sat, 19 Nov 2011 13:03:59 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201111191303.pAJD3xtR044138@svn.freebsd.org> From: Marius Strobl Date: Sat, 19 Nov 2011 13:03:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227714 - stable/9/sys/sparc64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Nov 2011 13:03:59 -0000 Author: marius Date: Sat Nov 19 13:03:59 2011 New Revision: 227714 URL: http://svn.freebsd.org/changeset/base/227714 Log: MFC: r227539 Define curthread as an inline function that loads the thread pointer directly from g7, the pcpu pointer. This guarantees correct behavior when the thread migrates to a different CPU. Commit message stolen from r205431. Additional testing by Peter Jeremy. Approved by: re (kib) Modified: stable/9/sys/sparc64/include/pcpu.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/sparc64/include/pcpu.h ============================================================================== --- stable/9/sys/sparc64/include/pcpu.h Sat Nov 19 13:03:14 2011 (r227713) +++ stable/9/sys/sparc64/include/pcpu.h Sat Nov 19 13:03:59 2011 (r227714) @@ -74,6 +74,16 @@ register struct pcpu *pcpup __asm__(__XS #define PCPU_GET(member) (pcpup->pc_ ## member) +static __inline __pure2 struct thread * +__curthread(void) +{ + struct thread *td; + + __asm("ldx [%" __XSTRING(PCPU_REG) "], %0" : "=r" (td)); + return (td); +} +#define curthread (__curthread()) + /* * XXX The implementation of this operation should be made atomic * with respect to preemption. From owner-svn-src-all@FreeBSD.ORG Sat Nov 19 13:04:18 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 736E21065675; Sat, 19 Nov 2011 13:04:18 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 62F2B8FC26; Sat, 19 Nov 2011 13:04:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAJD4IPt044197; Sat, 19 Nov 2011 13:04:18 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAJD4IbJ044195; Sat, 19 Nov 2011 13:04:18 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201111191304.pAJD4IbJ044195@svn.freebsd.org> From: Marius Strobl Date: Sat, 19 Nov 2011 13:04:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227715 - releng/9.0/sys/sparc64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Nov 2011 13:04:18 -0000 Author: marius Date: Sat Nov 19 13:04:17 2011 New Revision: 227715 URL: http://svn.freebsd.org/changeset/base/227715 Log: MFC: r227539 Define curthread as an inline function that loads the thread pointer directly from g7, the pcpu pointer. This guarantees correct behavior when the thread migrates to a different CPU. Commit message stolen from r205431. Additional testing by Peter Jeremy. Approved by: re (kib) Modified: releng/9.0/sys/sparc64/include/pcpu.h Directory Properties: releng/9.0/sys/ (props changed) releng/9.0/sys/amd64/include/xen/ (props changed) releng/9.0/sys/boot/ (props changed) releng/9.0/sys/boot/i386/efi/ (props changed) releng/9.0/sys/boot/ia64/efi/ (props changed) releng/9.0/sys/boot/ia64/ski/ (props changed) releng/9.0/sys/boot/powerpc/boot1.chrp/ (props changed) releng/9.0/sys/boot/powerpc/ofw/ (props changed) releng/9.0/sys/cddl/contrib/opensolaris/ (props changed) releng/9.0/sys/conf/ (props changed) releng/9.0/sys/contrib/dev/acpica/ (props changed) releng/9.0/sys/contrib/octeon-sdk/ (props changed) releng/9.0/sys/contrib/pf/ (props changed) releng/9.0/sys/contrib/x86emu/ (props changed) Modified: releng/9.0/sys/sparc64/include/pcpu.h ============================================================================== --- releng/9.0/sys/sparc64/include/pcpu.h Sat Nov 19 13:03:59 2011 (r227714) +++ releng/9.0/sys/sparc64/include/pcpu.h Sat Nov 19 13:04:17 2011 (r227715) @@ -74,6 +74,16 @@ register struct pcpu *pcpup __asm__(__XS #define PCPU_GET(member) (pcpup->pc_ ## member) +static __inline __pure2 struct thread * +__curthread(void) +{ + struct thread *td; + + __asm("ldx [%" __XSTRING(PCPU_REG) "], %0" : "=r" (td)); + return (td); +} +#define curthread (__curthread()) + /* * XXX The implementation of this operation should be made atomic * with respect to preemption. From owner-svn-src-all@FreeBSD.ORG Sat Nov 19 13:29:55 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 928EC106566B; Sat, 19 Nov 2011 13:29:55 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 818728FC08; Sat, 19 Nov 2011 13:29:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAJDTtRH045023; Sat, 19 Nov 2011 13:29:55 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAJDTtj0045021; Sat, 19 Nov 2011 13:29:55 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201111191329.pAJDTtj0045021@svn.freebsd.org> From: Marius Strobl Date: Sat, 19 Nov 2011 13:29:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227716 - stable/8/sys/sparc64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Nov 2011 13:29:55 -0000 Author: marius Date: Sat Nov 19 13:29:55 2011 New Revision: 227716 URL: http://svn.freebsd.org/changeset/base/227716 Log: MFC: r227539 Define curthread as an inline function that loads the thread pointer directly from g7, the pcpu pointer. This guarantees correct behavior when the thread migrates to a different CPU. Commit message stolen from r205431. Additional testing by Peter Jeremy. Modified: stable/8/sys/sparc64/include/pcpu.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/sparc64/include/pcpu.h ============================================================================== --- stable/8/sys/sparc64/include/pcpu.h Sat Nov 19 13:04:17 2011 (r227715) +++ stable/8/sys/sparc64/include/pcpu.h Sat Nov 19 13:29:55 2011 (r227716) @@ -73,6 +73,16 @@ register struct pcpu *pcpup __asm__(__XS #define PCPU_GET(member) (pcpup->pc_ ## member) +static __inline __pure2 struct thread * +__curthread(void) +{ + struct thread *td; + + __asm("ldx [%" __XSTRING(PCPU_REG) "], %0" : "=r" (td)); + return (td); +} +#define curthread (__curthread()) + /* * XXX The implementation of this operation should be made atomic * with respect to preemption. From owner-svn-src-all@FreeBSD.ORG Sat Nov 19 13:30:15 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 81F3710657CD; Sat, 19 Nov 2011 13:30:15 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 15FE88FC19; Sat, 19 Nov 2011 13:30:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAJDUCqO045080; Sat, 19 Nov 2011 13:30:12 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAJDUCQr045078; Sat, 19 Nov 2011 13:30:12 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201111191330.pAJDUCQr045078@svn.freebsd.org> From: Marius Strobl Date: Sat, 19 Nov 2011 13:30:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227717 - stable/7/sys/sparc64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Nov 2011 13:30:15 -0000 Author: marius Date: Sat Nov 19 13:30:12 2011 New Revision: 227717 URL: http://svn.freebsd.org/changeset/base/227717 Log: MFC: r227539 Define curthread as an inline function that loads the thread pointer directly from g7, the pcpu pointer. This guarantees correct behavior when the thread migrates to a different CPU. Commit message stolen from r205431. Additional testing by Peter Jeremy. Modified: stable/7/sys/sparc64/include/pcpu.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/include/pcpu.h ============================================================================== --- stable/7/sys/sparc64/include/pcpu.h Sat Nov 19 13:29:55 2011 (r227716) +++ stable/7/sys/sparc64/include/pcpu.h Sat Nov 19 13:30:12 2011 (r227717) @@ -71,6 +71,16 @@ register struct pcpu *pcpup __asm__(__XS #define PCPU_GET(member) (pcpup->pc_ ## member) +static __inline __pure2 struct thread * +__curthread(void) +{ + struct thread *td; + + __asm("ldx [%" __XSTRING(PCPU_REG) "], %0" : "=r" (td)); + return (td); +} +#define curthread (__curthread()) + /* * XXX The implementation of this operation should be made atomic * with respect to preemption. From owner-svn-src-all@FreeBSD.ORG Sat Nov 19 13:33:22 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 507191065670; Sat, 19 Nov 2011 13:33:22 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3F3408FC0A; Sat, 19 Nov 2011 13:33:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAJDXMrj045300; Sat, 19 Nov 2011 13:33:22 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAJDXM7N045297; Sat, 19 Nov 2011 13:33:22 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201111191333.pAJDXM7N045297@svn.freebsd.org> From: Marius Strobl Date: Sat, 19 Nov 2011 13:33:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227718 - stable/9/sys/sparc64/sbus X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Nov 2011 13:33:22 -0000 Author: marius Date: Sat Nov 19 13:33:21 2011 New Revision: 227718 URL: http://svn.freebsd.org/changeset/base/227718 Log: MFC: r227578 Fix compilation with DEBUG defined. Approved by: re (kib) Modified: stable/9/sys/sparc64/sbus/lsi64854.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/sparc64/sbus/lsi64854.c ============================================================================== --- stable/9/sys/sparc64/sbus/lsi64854.c Sat Nov 19 13:30:12 2011 (r227717) +++ stable/9/sys/sparc64/sbus/lsi64854.c Sat Nov 19 13:33:21 2011 (r227718) @@ -561,7 +561,7 @@ lsi64854_scsi_intr(void *arg) DPRINTF(LDB_SCSI, ("%s: tcl=%d, tcm=%d, tch=%d; trans=%d, resid=%d\n", __func__, NCR_READ_REG(nsc, NCR_TCL), NCR_READ_REG(nsc, NCR_TCM), - (nsc->sc_sc_features & NCR_F_LARGEXFER) != 0 ? + (nsc->sc_features & NCR_F_LARGEXFER) != 0 ? NCR_READ_REG(nsc, NCR_TCH) : 0, trans, resid)); if (dmasize != 0) { From owner-svn-src-all@FreeBSD.ORG Sat Nov 19 13:33:22 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C42B1065673; Sat, 19 Nov 2011 13:33:22 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7BBCD8FC17; Sat, 19 Nov 2011 13:33:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAJDXMBx045315; Sat, 19 Nov 2011 13:33:22 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAJDXMOw045313; Sat, 19 Nov 2011 13:33:22 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201111191333.pAJDXMOw045313@svn.freebsd.org> From: Marius Strobl Date: Sat, 19 Nov 2011 13:33:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227719 - releng/9.0/sys/sparc64/sbus X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Nov 2011 13:33:22 -0000 Author: marius Date: Sat Nov 19 13:33:22 2011 New Revision: 227719 URL: http://svn.freebsd.org/changeset/base/227719 Log: MFC: r227578 Fix compilation with DEBUG defined. Approved by: re (kib) Modified: releng/9.0/sys/sparc64/sbus/lsi64854.c Directory Properties: releng/9.0/sys/ (props changed) releng/9.0/sys/amd64/include/xen/ (props changed) releng/9.0/sys/boot/ (props changed) releng/9.0/sys/boot/i386/efi/ (props changed) releng/9.0/sys/boot/ia64/efi/ (props changed) releng/9.0/sys/boot/ia64/ski/ (props changed) releng/9.0/sys/boot/powerpc/boot1.chrp/ (props changed) releng/9.0/sys/boot/powerpc/ofw/ (props changed) releng/9.0/sys/cddl/contrib/opensolaris/ (props changed) releng/9.0/sys/conf/ (props changed) releng/9.0/sys/contrib/dev/acpica/ (props changed) releng/9.0/sys/contrib/octeon-sdk/ (props changed) releng/9.0/sys/contrib/pf/ (props changed) releng/9.0/sys/contrib/x86emu/ (props changed) Modified: releng/9.0/sys/sparc64/sbus/lsi64854.c ============================================================================== --- releng/9.0/sys/sparc64/sbus/lsi64854.c Sat Nov 19 13:33:21 2011 (r227718) +++ releng/9.0/sys/sparc64/sbus/lsi64854.c Sat Nov 19 13:33:22 2011 (r227719) @@ -561,7 +561,7 @@ lsi64854_scsi_intr(void *arg) DPRINTF(LDB_SCSI, ("%s: tcl=%d, tcm=%d, tch=%d; trans=%d, resid=%d\n", __func__, NCR_READ_REG(nsc, NCR_TCL), NCR_READ_REG(nsc, NCR_TCM), - (nsc->sc_sc_features & NCR_F_LARGEXFER) != 0 ? + (nsc->sc_features & NCR_F_LARGEXFER) != 0 ? NCR_READ_REG(nsc, NCR_TCH) : 0, trans, resid)); if (dmasize != 0) { From owner-svn-src-all@FreeBSD.ORG Sat Nov 19 13:33:25 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1A716106564A; Sat, 19 Nov 2011 13:33:25 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 094D88FC0C; Sat, 19 Nov 2011 13:33:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAJDXOJT045350; Sat, 19 Nov 2011 13:33:24 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAJDXODg045348; Sat, 19 Nov 2011 13:33:24 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201111191333.pAJDXODg045348@svn.freebsd.org> From: Marius Strobl Date: Sat, 19 Nov 2011 13:33:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227720 - stable/8/sys/sparc64/sbus X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Nov 2011 13:33:25 -0000 Author: marius Date: Sat Nov 19 13:33:24 2011 New Revision: 227720 URL: http://svn.freebsd.org/changeset/base/227720 Log: MFC: r227578 Fix compilation with DEBUG defined. Modified: stable/8/sys/sparc64/sbus/lsi64854.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/sparc64/sbus/lsi64854.c ============================================================================== --- stable/8/sys/sparc64/sbus/lsi64854.c Sat Nov 19 13:33:22 2011 (r227719) +++ stable/8/sys/sparc64/sbus/lsi64854.c Sat Nov 19 13:33:24 2011 (r227720) @@ -561,7 +561,7 @@ lsi64854_scsi_intr(void *arg) DPRINTF(LDB_SCSI, ("%s: tcl=%d, tcm=%d, tch=%d; trans=%d, resid=%d\n", __func__, NCR_READ_REG(nsc, NCR_TCL), NCR_READ_REG(nsc, NCR_TCM), - (nsc->sc_sc_features & NCR_F_LARGEXFER) != 0 ? + (nsc->sc_features & NCR_F_LARGEXFER) != 0 ? NCR_READ_REG(nsc, NCR_TCH) : 0, trans, resid)); if (dmasize != 0) { From owner-svn-src-all@FreeBSD.ORG Sat Nov 19 13:33:31 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 45B9F1065674; Sat, 19 Nov 2011 13:33:31 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 33D048FC18; Sat, 19 Nov 2011 13:33:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAJDXVIY045385; Sat, 19 Nov 2011 13:33:31 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAJDXVBk045383; Sat, 19 Nov 2011 13:33:31 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201111191333.pAJDXVBk045383@svn.freebsd.org> From: Marius Strobl Date: Sat, 19 Nov 2011 13:33:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227721 - stable/7/sys/sparc64/sbus X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Nov 2011 13:33:31 -0000 Author: marius Date: Sat Nov 19 13:33:30 2011 New Revision: 227721 URL: http://svn.freebsd.org/changeset/base/227721 Log: MFC: r227578 Fix compilation with DEBUG defined. Modified: stable/7/sys/sparc64/sbus/lsi64854.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/sbus/lsi64854.c ============================================================================== --- stable/7/sys/sparc64/sbus/lsi64854.c Sat Nov 19 13:33:24 2011 (r227720) +++ stable/7/sys/sparc64/sbus/lsi64854.c Sat Nov 19 13:33:30 2011 (r227721) @@ -568,7 +568,7 @@ lsi64854_scsi_intr(void *arg) DPRINTF(LDB_SCSI, ("%s: tcl=%d, tcm=%d, tch=%d; trans=%d, resid=%d\n", __func__, NCR_READ_REG(nsc, NCR_TCL), NCR_READ_REG(nsc, NCR_TCM), - (nsc->sc_sc_features & NCR_F_LARGEXFER) != 0 ? + (nsc->sc_features & NCR_F_LARGEXFER) != 0 ? NCR_READ_REG(nsc, NCR_TCH) : 0, trans, resid)); if (dmasize != 0) { From owner-svn-src-all@FreeBSD.ORG Sat Nov 19 14:06:15 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C218A106564A; Sat, 19 Nov 2011 14:06:15 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B0C618FC12; Sat, 19 Nov 2011 14:06:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAJE6F85046447; Sat, 19 Nov 2011 14:06:15 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAJE6F45046437; Sat, 19 Nov 2011 14:06:15 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201111191406.pAJE6F45046437@svn.freebsd.org> From: "Jayachandran C." Date: Sat, 19 Nov 2011 14:06:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227722 - head/sys/mips/nlm/hal X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Nov 2011 14:06:15 -0000 Author: jchandra Date: Sat Nov 19 14:06:15 2011 New Revision: 227722 URL: http://svn.freebsd.org/changeset/base/227722 Log: Whitespace fixes in XLP HAL files. Also fixup a macro in iomap.h Modified: head/sys/mips/nlm/hal/bridge.h head/sys/mips/nlm/hal/cop2.h head/sys/mips/nlm/hal/cpucontrol.h head/sys/mips/nlm/hal/haldefs.h head/sys/mips/nlm/hal/iomap.h head/sys/mips/nlm/hal/mips-extns.h head/sys/mips/nlm/hal/mmu.h head/sys/mips/nlm/hal/pcibus.h head/sys/mips/nlm/hal/uart.h Modified: head/sys/mips/nlm/hal/bridge.h ============================================================================== --- head/sys/mips/nlm/hal/bridge.h Sat Nov 19 13:33:30 2011 (r227721) +++ head/sys/mips/nlm/hal/bridge.h Sat Nov 19 14:06:15 2011 (r227722) @@ -30,7 +30,7 @@ */ #ifndef __NLM_HAL_BRIDGE_H__ -#define __NLM_HAL_BRIDGE_H__ +#define __NLM_HAL_BRIDGE_H__ /** * @file_name mio.h @@ -44,141 +44,141 @@ * These registers start after the PCIe header, which has 0x40 * standard entries */ -#define BRIDGE_MODE 0x00 -#define BRIDGE_PCI_CFG_BASE 0x01 -#define BRIDGE_PCI_CFG_LIMIT 0x02 -#define BRIDGE_PCIE_CFG_BASE 0x03 -#define BRIDGE_PCIE_CFG_LIMIT 0x04 -#define BRIDGE_BUSNUM_BAR0 0x05 -#define BRIDGE_BUSNUM_BAR1 0x06 -#define BRIDGE_BUSNUM_BAR2 0x07 -#define BRIDGE_BUSNUM_BAR3 0x08 -#define BRIDGE_BUSNUM_BAR4 0x09 -#define BRIDGE_BUSNUM_BAR5 0x0a -#define BRIDGE_BUSNUM_BAR6 0x0b -#define BRIDGE_FLASH_BAR0 0x0c -#define BRIDGE_FLASH_BAR1 0x0d -#define BRIDGE_FLASH_BAR2 0x0e -#define BRIDGE_FLASH_BAR3 0x0f -#define BRIDGE_FLASH_LIMIT0 0x10 -#define BRIDGE_FLASH_LIMIT1 0x11 -#define BRIDGE_FLASH_LIMIT2 0x12 -#define BRIDGE_FLASH_LIMIT3 0x13 - -#define BRIDGE_DRAM_BAR(i) (0x14 + (i)) -#define BRIDGE_DRAM_BAR0 0x14 -#define BRIDGE_DRAM_BAR1 0x15 -#define BRIDGE_DRAM_BAR2 0x16 -#define BRIDGE_DRAM_BAR3 0x17 -#define BRIDGE_DRAM_BAR4 0x18 -#define BRIDGE_DRAM_BAR5 0x19 -#define BRIDGE_DRAM_BAR6 0x1a -#define BRIDGE_DRAM_BAR7 0x1b - -#define BRIDGE_DRAM_LIMIT(i) (0x1c + (i)) -#define BRIDGE_DRAM_LIMIT0 0x1c -#define BRIDGE_DRAM_LIMIT1 0x1d -#define BRIDGE_DRAM_LIMIT2 0x1e -#define BRIDGE_DRAM_LIMIT3 0x1f -#define BRIDGE_DRAM_LIMIT4 0x20 -#define BRIDGE_DRAM_LIMIT5 0x21 -#define BRIDGE_DRAM_LIMIT6 0x22 -#define BRIDGE_DRAM_LIMIT7 0x23 - -#define BRIDGE_DRAM_NODE_TRANSLN0 0x24 -#define BRIDGE_DRAM_NODE_TRANSLN1 0x25 -#define BRIDGE_DRAM_NODE_TRANSLN2 0x26 -#define BRIDGE_DRAM_NODE_TRANSLN3 0x27 -#define BRIDGE_DRAM_NODE_TRANSLN4 0x28 -#define BRIDGE_DRAM_NODE_TRANSLN5 0x29 -#define BRIDGE_DRAM_NODE_TRANSLN6 0x2a -#define BRIDGE_DRAM_NODE_TRANSLN7 0x2b -#define BRIDGE_DRAM_CHNL_TRANSLN0 0x2c -#define BRIDGE_DRAM_CHNL_TRANSLN1 0x2d -#define BRIDGE_DRAM_CHNL_TRANSLN2 0x2e -#define BRIDGE_DRAM_CHNL_TRANSLN3 0x2f -#define BRIDGE_DRAM_CHNL_TRANSLN4 0x30 -#define BRIDGE_DRAM_CHNL_TRANSLN5 0x31 -#define BRIDGE_DRAM_CHNL_TRANSLN6 0x32 -#define BRIDGE_DRAM_CHNL_TRANSLN7 0x33 -#define BRIDGE_PCIEMEM_BASE0 0x34 -#define BRIDGE_PCIEMEM_BASE1 0x35 -#define BRIDGE_PCIEMEM_BASE2 0x36 -#define BRIDGE_PCIEMEM_BASE3 0x37 -#define BRIDGE_PCIEMEM_LIMIT0 0x38 -#define BRIDGE_PCIEMEM_LIMIT1 0x39 -#define BRIDGE_PCIEMEM_LIMIT2 0x3a -#define BRIDGE_PCIEMEM_LIMIT3 0x3b -#define BRIDGE_PCIEIO_BASE0 0x3c -#define BRIDGE_PCIEIO_BASE1 0x3d -#define BRIDGE_PCIEIO_BASE2 0x3e -#define BRIDGE_PCIEIO_BASE3 0x3f -#define BRIDGE_PCIEIO_LIMIT0 0x40 -#define BRIDGE_PCIEIO_LIMIT1 0x41 -#define BRIDGE_PCIEIO_LIMIT2 0x42 -#define BRIDGE_PCIEIO_LIMIT3 0x43 -#define BRIDGE_PCIEMEM_BASE4 0x44 -#define BRIDGE_PCIEMEM_BASE5 0x45 -#define BRIDGE_PCIEMEM_BASE6 0x46 -#define BRIDGE_PCIEMEM_LIMIT4 0x47 -#define BRIDGE_PCIEMEM_LIMIT5 0x48 -#define BRIDGE_PCIEMEM_LIMIT6 0x49 -#define BRIDGE_PCIEIO_BASE4 0x4a -#define BRIDGE_PCIEIO_BASE5 0x4b -#define BRIDGE_PCIEIO_BASE6 0x4c -#define BRIDGE_PCIEIO_LIMIT4 0x4d -#define BRIDGE_PCIEIO_LIMIT5 0x4e -#define BRIDGE_PCIEIO_LIMIT6 0x4f -#define BRIDGE_NBU_EVENT_CNT_CTL 0x50 -#define BRIDGE_EVNTCTR1_LOW 0x51 -#define BRIDGE_EVNTCTR1_HI 0x52 -#define BRIDGE_EVNT_CNT_CTL2 0x53 -#define BRIDGE_EVNTCTR2_LOW 0x54 -#define BRIDGE_EVNTCTR2_HI 0x55 -#define BRIDGE_TRACEBUF_MATCH0 0x56 -#define BRIDGE_TRACEBUF_MATCH1 0x57 -#define BRIDGE_TRACEBUF_MATCH_LOW 0x58 -#define BRIDGE_TRACEBUF_MATCH_HI 0x59 -#define BRIDGE_TRACEBUF_CTRL 0x5a -#define BRIDGE_TRACEBUF_INIT 0x5b -#define BRIDGE_TRACEBUF_ACCESS 0x5c -#define BRIDGE_TRACEBUF_READ_DATA0 0x5d -#define BRIDGE_TRACEBUF_READ_DATA1 0x5d -#define BRIDGE_TRACEBUF_READ_DATA2 0x5f -#define BRIDGE_TRACEBUF_READ_DATA3 0x60 -#define BRIDGE_TRACEBUF_STATUS 0x61 -#define BRIDGE_ADDRESS_ERROR0 0x62 -#define BRIDGE_ADDRESS_ERROR1 0x63 -#define BRIDGE_ADDRESS_ERROR2 0x64 -#define BRIDGE_TAG_ECC_ADDR_ERROR0 0x65 -#define BRIDGE_TAG_ECC_ADDR_ERROR1 0x66 -#define BRIDGE_TAG_ECC_ADDR_ERROR2 0x67 -#define BRIDGE_LINE_FLUSH0 0x68 -#define BRIDGE_LINE_FLUSH1 0x69 -#define BRIDGE_NODE_ID 0x6a -#define BRIDGE_ERROR_INTERRUPT_EN 0x6b -#define BRIDGE_PCIE0_WEIGHT 0x2c0 -#define BRIDGE_PCIE1_WEIGHT 0x2c1 -#define BRIDGE_PCIE2_WEIGHT 0x2c2 -#define BRIDGE_PCIE3_WEIGHT 0x2c3 -#define BRIDGE_USB_WEIGHT 0x2c4 -#define BRIDGE_NET_WEIGHT 0x2c5 -#define BRIDGE_POE_WEIGHT 0x2c6 -#define BRIDGE_CMS_WEIGHT 0x2c7 -#define BRIDGE_DMAENG_WEIGHT 0x2c8 -#define BRIDGE_SEC_WEIGHT 0x2c9 -#define BRIDGE_COMP_WEIGHT 0x2ca -#define BRIDGE_GIO_WEIGHT 0x2cb -#define BRIDGE_FLASH_WEIGHT 0x2cc +#define BRIDGE_MODE 0x00 +#define BRIDGE_PCI_CFG_BASE 0x01 +#define BRIDGE_PCI_CFG_LIMIT 0x02 +#define BRIDGE_PCIE_CFG_BASE 0x03 +#define BRIDGE_PCIE_CFG_LIMIT 0x04 +#define BRIDGE_BUSNUM_BAR0 0x05 +#define BRIDGE_BUSNUM_BAR1 0x06 +#define BRIDGE_BUSNUM_BAR2 0x07 +#define BRIDGE_BUSNUM_BAR3 0x08 +#define BRIDGE_BUSNUM_BAR4 0x09 +#define BRIDGE_BUSNUM_BAR5 0x0a +#define BRIDGE_BUSNUM_BAR6 0x0b +#define BRIDGE_FLASH_BAR0 0x0c +#define BRIDGE_FLASH_BAR1 0x0d +#define BRIDGE_FLASH_BAR2 0x0e +#define BRIDGE_FLASH_BAR3 0x0f +#define BRIDGE_FLASH_LIMIT0 0x10 +#define BRIDGE_FLASH_LIMIT1 0x11 +#define BRIDGE_FLASH_LIMIT2 0x12 +#define BRIDGE_FLASH_LIMIT3 0x13 + +#define BRIDGE_DRAM_BAR(i) (0x14 + (i)) +#define BRIDGE_DRAM_BAR0 0x14 +#define BRIDGE_DRAM_BAR1 0x15 +#define BRIDGE_DRAM_BAR2 0x16 +#define BRIDGE_DRAM_BAR3 0x17 +#define BRIDGE_DRAM_BAR4 0x18 +#define BRIDGE_DRAM_BAR5 0x19 +#define BRIDGE_DRAM_BAR6 0x1a +#define BRIDGE_DRAM_BAR7 0x1b + +#define BRIDGE_DRAM_LIMIT(i) (0x1c + (i)) +#define BRIDGE_DRAM_LIMIT0 0x1c +#define BRIDGE_DRAM_LIMIT1 0x1d +#define BRIDGE_DRAM_LIMIT2 0x1e +#define BRIDGE_DRAM_LIMIT3 0x1f +#define BRIDGE_DRAM_LIMIT4 0x20 +#define BRIDGE_DRAM_LIMIT5 0x21 +#define BRIDGE_DRAM_LIMIT6 0x22 +#define BRIDGE_DRAM_LIMIT7 0x23 + +#define BRIDGE_DRAM_NODE_TRANSLN0 0x24 +#define BRIDGE_DRAM_NODE_TRANSLN1 0x25 +#define BRIDGE_DRAM_NODE_TRANSLN2 0x26 +#define BRIDGE_DRAM_NODE_TRANSLN3 0x27 +#define BRIDGE_DRAM_NODE_TRANSLN4 0x28 +#define BRIDGE_DRAM_NODE_TRANSLN5 0x29 +#define BRIDGE_DRAM_NODE_TRANSLN6 0x2a +#define BRIDGE_DRAM_NODE_TRANSLN7 0x2b +#define BRIDGE_DRAM_CHNL_TRANSLN0 0x2c +#define BRIDGE_DRAM_CHNL_TRANSLN1 0x2d +#define BRIDGE_DRAM_CHNL_TRANSLN2 0x2e +#define BRIDGE_DRAM_CHNL_TRANSLN3 0x2f +#define BRIDGE_DRAM_CHNL_TRANSLN4 0x30 +#define BRIDGE_DRAM_CHNL_TRANSLN5 0x31 +#define BRIDGE_DRAM_CHNL_TRANSLN6 0x32 +#define BRIDGE_DRAM_CHNL_TRANSLN7 0x33 +#define BRIDGE_PCIEMEM_BASE0 0x34 +#define BRIDGE_PCIEMEM_BASE1 0x35 +#define BRIDGE_PCIEMEM_BASE2 0x36 +#define BRIDGE_PCIEMEM_BASE3 0x37 +#define BRIDGE_PCIEMEM_LIMIT0 0x38 +#define BRIDGE_PCIEMEM_LIMIT1 0x39 +#define BRIDGE_PCIEMEM_LIMIT2 0x3a +#define BRIDGE_PCIEMEM_LIMIT3 0x3b +#define BRIDGE_PCIEIO_BASE0 0x3c +#define BRIDGE_PCIEIO_BASE1 0x3d +#define BRIDGE_PCIEIO_BASE2 0x3e +#define BRIDGE_PCIEIO_BASE3 0x3f +#define BRIDGE_PCIEIO_LIMIT0 0x40 +#define BRIDGE_PCIEIO_LIMIT1 0x41 +#define BRIDGE_PCIEIO_LIMIT2 0x42 +#define BRIDGE_PCIEIO_LIMIT3 0x43 +#define BRIDGE_PCIEMEM_BASE4 0x44 +#define BRIDGE_PCIEMEM_BASE5 0x45 +#define BRIDGE_PCIEMEM_BASE6 0x46 +#define BRIDGE_PCIEMEM_LIMIT4 0x47 +#define BRIDGE_PCIEMEM_LIMIT5 0x48 +#define BRIDGE_PCIEMEM_LIMIT6 0x49 +#define BRIDGE_PCIEIO_BASE4 0x4a +#define BRIDGE_PCIEIO_BASE5 0x4b +#define BRIDGE_PCIEIO_BASE6 0x4c +#define BRIDGE_PCIEIO_LIMIT4 0x4d +#define BRIDGE_PCIEIO_LIMIT5 0x4e +#define BRIDGE_PCIEIO_LIMIT6 0x4f +#define BRIDGE_NBU_EVENT_CNT_CTL 0x50 +#define BRIDGE_EVNTCTR1_LOW 0x51 +#define BRIDGE_EVNTCTR1_HI 0x52 +#define BRIDGE_EVNT_CNT_CTL2 0x53 +#define BRIDGE_EVNTCTR2_LOW 0x54 +#define BRIDGE_EVNTCTR2_HI 0x55 +#define BRIDGE_TRACEBUF_MATCH0 0x56 +#define BRIDGE_TRACEBUF_MATCH1 0x57 +#define BRIDGE_TRACEBUF_MATCH_LOW 0x58 +#define BRIDGE_TRACEBUF_MATCH_HI 0x59 +#define BRIDGE_TRACEBUF_CTRL 0x5a +#define BRIDGE_TRACEBUF_INIT 0x5b +#define BRIDGE_TRACEBUF_ACCESS 0x5c +#define BRIDGE_TRACEBUF_READ_DATA0 0x5d +#define BRIDGE_TRACEBUF_READ_DATA1 0x5d +#define BRIDGE_TRACEBUF_READ_DATA2 0x5f +#define BRIDGE_TRACEBUF_READ_DATA3 0x60 +#define BRIDGE_TRACEBUF_STATUS 0x61 +#define BRIDGE_ADDRESS_ERROR0 0x62 +#define BRIDGE_ADDRESS_ERROR1 0x63 +#define BRIDGE_ADDRESS_ERROR2 0x64 +#define BRIDGE_TAG_ECC_ADDR_ERROR0 0x65 +#define BRIDGE_TAG_ECC_ADDR_ERROR1 0x66 +#define BRIDGE_TAG_ECC_ADDR_ERROR2 0x67 +#define BRIDGE_LINE_FLUSH0 0x68 +#define BRIDGE_LINE_FLUSH1 0x69 +#define BRIDGE_NODE_ID 0x6a +#define BRIDGE_ERROR_INTERRUPT_EN 0x6b +#define BRIDGE_PCIE0_WEIGHT 0x2c0 +#define BRIDGE_PCIE1_WEIGHT 0x2c1 +#define BRIDGE_PCIE2_WEIGHT 0x2c2 +#define BRIDGE_PCIE3_WEIGHT 0x2c3 +#define BRIDGE_USB_WEIGHT 0x2c4 +#define BRIDGE_NET_WEIGHT 0x2c5 +#define BRIDGE_POE_WEIGHT 0x2c6 +#define BRIDGE_CMS_WEIGHT 0x2c7 +#define BRIDGE_DMAENG_WEIGHT 0x2c8 +#define BRIDGE_SEC_WEIGHT 0x2c9 +#define BRIDGE_COMP_WEIGHT 0x2ca +#define BRIDGE_GIO_WEIGHT 0x2cb +#define BRIDGE_FLASH_WEIGHT 0x2cc #if !defined(LOCORE) && !defined(__ASSEMBLY__) -#define nlm_read_bridge_reg(b, r) nlm_read_reg(b, r) -#define nlm_write_bridge_reg(b, r, v) nlm_write_reg(b, r, v) +#define nlm_read_bridge_reg(b, r) nlm_read_reg(b, r) +#define nlm_write_bridge_reg(b, r, v) nlm_write_reg(b, r, v) #define nlm_get_bridge_pcibase(node) \ - nlm_pcicfg_base(XLP_IO_BRIDGE_OFFSET(node)) + nlm_pcicfg_base(XLP_IO_BRIDGE_OFFSET(node)) #define nlm_get_bridge_regbase(node) \ - (nlm_get_bridge_pcibase(node) + XLP_IO_PCI_HDRSZ) + (nlm_get_bridge_pcibase(node) + XLP_IO_PCI_HDRSZ) #endif #endif Modified: head/sys/mips/nlm/hal/cop2.h ============================================================================== --- head/sys/mips/nlm/hal/cop2.h Sat Nov 19 13:33:30 2011 (r227721) +++ head/sys/mips/nlm/hal/cop2.h Sat Nov 19 14:06:15 2011 (r227722) @@ -30,29 +30,29 @@ */ #ifndef __NLM_HAL_COP2_H__ -#define __NLM_HAL_COP2_H__ +#define __NLM_HAL_COP2_H__ -#define COP2_TX_BUF 0 -#define COP2_RX_BUF 1 -#define COP2_TXMSGSTATUS 2 -#define COP2_RXMSGSTATUS 3 -#define COP2_MSGSTATUS1 4 -#define COP2_MSGCONFIG 5 -#define COP2_MSGCONFIG1 6 - -#define CROSSTHR_POPQ_EN 0x01 -#define VC0_POPQ_EN 0x02 -#define VC1_POPQ_EN 0x04 -#define VC2_POPQ_EN 0x08 -#define VC3_POPQ_EN 0x10 -#define ALL_VC_POPQ_EN 0x1E -#define ALL_VC_CT_POPQ_EN 0x1F +#define COP2_TX_BUF 0 +#define COP2_RX_BUF 1 +#define COP2_TXMSGSTATUS 2 +#define COP2_RXMSGSTATUS 3 +#define COP2_MSGSTATUS1 4 +#define COP2_MSGCONFIG 5 +#define COP2_MSGCONFIG1 6 + +#define CROSSTHR_POPQ_EN 0x01 +#define VC0_POPQ_EN 0x02 +#define VC1_POPQ_EN 0x04 +#define VC2_POPQ_EN 0x08 +#define VC3_POPQ_EN 0x10 +#define ALL_VC_POPQ_EN 0x1E +#define ALL_VC_CT_POPQ_EN 0x1F struct nlm_fmn_msg { uint64_t msg[4]; }; -#define NLM_DEFINE_COP2_ACCESSORS32(name, reg, sel) \ +#define NLM_DEFINE_COP2_ACCESSORS32(name, reg, sel) \ static inline uint32_t nlm_read_c2_##name(void) \ { \ uint32_t __rv; \ @@ -79,7 +79,7 @@ static inline void nlm_write_c2_##name(u } struct __hack #if (__mips == 64) -#define NLM_DEFINE_COP2_ACCESSORS64(name, reg, sel) \ +#define NLM_DEFINE_COP2_ACCESSORS64(name, reg, sel) \ static inline uint64_t nlm_read_c2_##name(void) \ { \ uint64_t __rv; \ @@ -107,7 +107,7 @@ static inline void nlm_write_c2_##name(u #else -#define NLM_DEFINE_COP2_ACCESSORS64(name, reg, sel) \ +#define NLM_DEFINE_COP2_ACCESSORS64(name, reg, sel) \ static inline uint64_t nlm_read_c2_##name(void) \ { \ uint32_t __high, __low; \ Modified: head/sys/mips/nlm/hal/cpucontrol.h ============================================================================== --- head/sys/mips/nlm/hal/cpucontrol.h Sat Nov 19 13:33:30 2011 (r227721) +++ head/sys/mips/nlm/hal/cpucontrol.h Sat Nov 19 14:06:15 2011 (r227722) @@ -30,52 +30,52 @@ */ #ifndef __NLM_HAL_CPUCONTROL_H__ -#define __NLM_HAL_CPUCONTROL_H__ +#define __NLM_HAL_CPUCONTROL_H__ -#define CPU_BLOCKID_IFU 0 -#define CPU_BLOCKID_ICU 1 -#define CPU_BLOCKID_IEU 2 -#define CPU_BLOCKID_LSU 3 -#define CPU_BLOCKID_MMU 4 -#define CPU_BLOCKID_PRF 5 -#define CPU_BLOCKID_SCH 7 -#define CPU_BLOCKID_SCU 8 -#define CPU_BLOCKID_FPU 9 -#define CPU_BLOCKID_MAP 10 - -#define LSU_DEFEATURE 0x304 -#define LSU_CERRLOG_REGID 0x09 -#define SCHED_DEFEATURE 0x700 +#define CPU_BLOCKID_IFU 0 +#define CPU_BLOCKID_ICU 1 +#define CPU_BLOCKID_IEU 2 +#define CPU_BLOCKID_LSU 3 +#define CPU_BLOCKID_MMU 4 +#define CPU_BLOCKID_PRF 5 +#define CPU_BLOCKID_SCH 7 +#define CPU_BLOCKID_SCU 8 +#define CPU_BLOCKID_FPU 9 +#define CPU_BLOCKID_MAP 10 + +#define LSU_DEFEATURE 0x304 +#define LSU_CERRLOG_REGID 0x09 +#define SCHED_DEFEATURE 0x700 /* Offsets of interest from the 'MAP' Block */ -#define MAP_THREADMODE 0x00 -#define MAP_EXT_EBASE_ENABLE 0x04 -#define MAP_CCDI_CONFIG 0x08 -#define MAP_THRD0_CCDI_STATUS 0x0c -#define MAP_THRD1_CCDI_STATUS 0x10 -#define MAP_THRD2_CCDI_STATUS 0x14 -#define MAP_THRD3_CCDI_STATUS 0x18 -#define MAP_THRD0_DEBUG_MODE 0x1c -#define MAP_THRD1_DEBUG_MODE 0x20 -#define MAP_THRD2_DEBUG_MODE 0x24 -#define MAP_THRD3_DEBUG_MODE 0x28 -#define MAP_MISC_STATE 0x60 -#define MAP_DEBUG_READ_CTL 0x64 -#define MAP_DEBUG_READ_REG0 0x68 -#define MAP_DEBUG_READ_REG1 0x6c - -#define MMU_SETUP 0x400 -#define MMU_LFSRSEED 0x401 -#define MMU_HPW_NUM_PAGE_LVL 0x410 -#define MMU_PGWKR_PGDBASE 0x411 -#define MMU_PGWKR_PGDSHFT 0x412 -#define MMU_PGWKR_PGDMASK 0x413 -#define MMU_PGWKR_PUDSHFT 0x414 -#define MMU_PGWKR_PUDMASK 0x415 -#define MMU_PGWKR_PMDSHFT 0x416 -#define MMU_PGWKR_PMDMASK 0x417 -#define MMU_PGWKR_PTESHFT 0x418 -#define MMU_PGWKR_PTEMASK 0x419 +#define MAP_THREADMODE 0x00 +#define MAP_EXT_EBASE_ENABLE 0x04 +#define MAP_CCDI_CONFIG 0x08 +#define MAP_THRD0_CCDI_STATUS 0x0c +#define MAP_THRD1_CCDI_STATUS 0x10 +#define MAP_THRD2_CCDI_STATUS 0x14 +#define MAP_THRD3_CCDI_STATUS 0x18 +#define MAP_THRD0_DEBUG_MODE 0x1c +#define MAP_THRD1_DEBUG_MODE 0x20 +#define MAP_THRD2_DEBUG_MODE 0x24 +#define MAP_THRD3_DEBUG_MODE 0x28 +#define MAP_MISC_STATE 0x60 +#define MAP_DEBUG_READ_CTL 0x64 +#define MAP_DEBUG_READ_REG0 0x68 +#define MAP_DEBUG_READ_REG1 0x6c + +#define MMU_SETUP 0x400 +#define MMU_LFSRSEED 0x401 +#define MMU_HPW_NUM_PAGE_LVL 0x410 +#define MMU_PGWKR_PGDBASE 0x411 +#define MMU_PGWKR_PGDSHFT 0x412 +#define MMU_PGWKR_PGDMASK 0x413 +#define MMU_PGWKR_PUDSHFT 0x414 +#define MMU_PGWKR_PUDMASK 0x415 +#define MMU_PGWKR_PMDSHFT 0x416 +#define MMU_PGWKR_PMDMASK 0x417 +#define MMU_PGWKR_PTESHFT 0x418 +#define MMU_PGWKR_PTEMASK 0x419 #if !defined(LOCORE) && !defined(__ASSEMBLY__) Modified: head/sys/mips/nlm/hal/haldefs.h ============================================================================== --- head/sys/mips/nlm/hal/haldefs.h Sat Nov 19 13:33:30 2011 (r227721) +++ head/sys/mips/nlm/hal/haldefs.h Sat Nov 19 14:06:15 2011 (r227722) @@ -30,7 +30,7 @@ */ #ifndef __NLM_HAL_MMIO_H__ -#define __NLM_HAL_MMIO_H__ +#define __NLM_HAL_MMIO_H__ /* * This file contains platform specific memory mapped IO implementation Modified: head/sys/mips/nlm/hal/iomap.h ============================================================================== --- head/sys/mips/nlm/hal/iomap.h Sat Nov 19 13:33:30 2011 (r227721) +++ head/sys/mips/nlm/hal/iomap.h Sat Nov 19 14:06:15 2011 (r227722) @@ -32,91 +32,91 @@ #ifndef __NLM_HAL_IOMAP_H__ #define __NLM_HAL_IOMAP_H__ -#define XLP_DEFAULT_IO_BASE 0x18000000 -#define NMI_BASE 0xbfc00000 +#define XLP_DEFAULT_IO_BASE 0x18000000 +#define NMI_BASE 0xbfc00000 #define XLP_IO_CLK 133333333 -#define XLP_PCIE_CFG_SIZE 0x1000 /* 4K */ -#define XLP_PCIE_DEV_BLK_SIZE (8 * XLP_PCIE_CFG_SIZE) -#define XLP_PCIE_BUS_BLK_SIZE (256 * XLP_PCIE_DEV_BLK_SIZE) -#define XLP_IO_SIZE (64 << 20) /* ECFG space size */ -#define XLP_IO_PCI_HDRSZ 0x100 -#define XLP_IO_DEV(node, dev) ((dev) + (node) * 8) -#define XLP_HDR_OFFSET(node, bus, dev, fn) (((bus) << 20) | \ +#define XLP_PCIE_CFG_SIZE 0x1000 /* 4K */ +#define XLP_PCIE_DEV_BLK_SIZE (8 * XLP_PCIE_CFG_SIZE) +#define XLP_PCIE_BUS_BLK_SIZE (256 * XLP_PCIE_DEV_BLK_SIZE) +#define XLP_IO_SIZE (64 << 20) /* ECFG space size */ +#define XLP_IO_PCI_HDRSZ 0x100 +#define XLP_IO_DEV(node, dev) ((dev) + (node) * 8) +#define XLP_HDR_OFFSET(node, bus, dev, fn) (((bus) << 20) | \ ((XLP_IO_DEV(node, dev)) << 15) | ((fn) << 12)) -#define XLP_IO_BRIDGE_OFFSET(node) XLP_HDR_OFFSET(node, 0, 0, 0) +#define XLP_IO_BRIDGE_OFFSET(node) XLP_HDR_OFFSET(node, 0, 0, 0) /* coherent inter chip */ -#define XLP_IO_CIC0_OFFSET(node) XLP_HDR_OFFSET(node, 0, 0, 1) -#define XLP_IO_CIC1_OFFSET(node) XLP_HDR_OFFSET(node, 0, 0, 2) -#define XLP_IO_CIC2_OFFSET(node) XLP_HDR_OFFSET(node, 0, 0, 3) -#define XLP_IO_PIC_OFFSET(node) XLP_HDR_OFFSET(node, 0, 0, 4) - -#define XLP_IO_PCIE_OFFSET(node, i) XLP_HDR_OFFSET(node, 0, 1, i) -#define XLP_IO_PCIE0_OFFSET(node) XLP_HDR_OFFSET(node, 0, 1, 0) -#define XLP_IO_PCIE1_OFFSET(node) XLP_HDR_OFFSET(node, 0, 1, 1) -#define XLP_IO_PCIE2_OFFSET(node) XLP_HDR_OFFSET(node, 0, 1, 2) -#define XLP_IO_PCIE3_OFFSET(node) XLP_HDR_OFFSET(node, 0, 1, 3) - -#define XLP_IO_USB_OFFSET(node, i) XLP_HDR_OFFSET(node, 0, 2, i) -#define XLP_IO_USB_EHCI0_OFFSET(node) XLP_HDR_OFFSET(node, 0, 2, 0) -#define XLP_IO_USB_OHCI0_OFFSET(node) XLP_HDR_OFFSET(node, 0, 2, 1) -#define XLP_IO_USB_OHCI1_OFFSET(node) XLP_HDR_OFFSET(node, 0, 2, 2) -#define XLP_IO_USB_EHCI1_OFFSET(node) XLP_HDR_OFFSET(node, 0, 2, 3) -#define XLP_IO_USB_OHCI2_OFFSET(node) XLP_HDR_OFFSET(node, 0, 2, 4) -#define XLP_IO_USB_OHCI3_OFFSET(node) XLP_HDR_OFFSET(node, 0, 2, 5) - -#define XLP_IO_NAE_OFFSET(node) XLP_HDR_OFFSET(node, 0, 3, 0) -#define XLP_IO_POE_OFFSET(node) XLP_HDR_OFFSET(node, 0, 3, 1) - -#define XLP_IO_CMS_OFFSET(node) XLP_HDR_OFFSET(node, 0, 4, 0) - -#define XLP_IO_DMA_OFFSET(node) XLP_HDR_OFFSET(node, 0, 5, 1) -#define XLP_IO_SEC_OFFSET(node) XLP_HDR_OFFSET(node, 0, 5, 2) -#define XLP_IO_CMP_OFFSET(node) XLP_HDR_OFFSET(node, 0, 5, 3) - -#define XLP_IO_UART_OFFSET(node, i) XLP_HDR_OFFSET(node, 0, 6, i) -#define XLP_IO_UART0_OFFSET(node) XLP_HDR_OFFSET(node, 0, 6, 0) -#define XLP_IO_UART1_OFFSET(node) XLP_HDR_OFFSET(node, 0, 6, 1) -#define XLP_IO_I2C_OFFSET(node, i) XLP_HDR_OFFSET(node, 0, 6, 2 + i) -#define XLP_IO_I2C0_OFFSET(node) XLP_HDR_OFFSET(node, 0, 6, 2) -#define XLP_IO_I2C1_OFFSET(node) XLP_HDR_OFFSET(node, 0, 6, 3) -#define XLP_IO_GPIO_OFFSET(node) XLP_HDR_OFFSET(node, 0, 6, 4) +#define XLP_IO_CIC0_OFFSET(node) XLP_HDR_OFFSET(node, 0, 0, 1) +#define XLP_IO_CIC1_OFFSET(node) XLP_HDR_OFFSET(node, 0, 0, 2) +#define XLP_IO_CIC2_OFFSET(node) XLP_HDR_OFFSET(node, 0, 0, 3) +#define XLP_IO_PIC_OFFSET(node) XLP_HDR_OFFSET(node, 0, 0, 4) + +#define XLP_IO_PCIE_OFFSET(node, i) XLP_HDR_OFFSET(node, 0, 1, i) +#define XLP_IO_PCIE0_OFFSET(node) XLP_HDR_OFFSET(node, 0, 1, 0) +#define XLP_IO_PCIE1_OFFSET(node) XLP_HDR_OFFSET(node, 0, 1, 1) +#define XLP_IO_PCIE2_OFFSET(node) XLP_HDR_OFFSET(node, 0, 1, 2) +#define XLP_IO_PCIE3_OFFSET(node) XLP_HDR_OFFSET(node, 0, 1, 3) + +#define XLP_IO_USB_OFFSET(node, i) XLP_HDR_OFFSET(node, 0, 2, i) +#define XLP_IO_USB_EHCI0_OFFSET(node) XLP_HDR_OFFSET(node, 0, 2, 0) +#define XLP_IO_USB_OHCI0_OFFSET(node) XLP_HDR_OFFSET(node, 0, 2, 1) +#define XLP_IO_USB_OHCI1_OFFSET(node) XLP_HDR_OFFSET(node, 0, 2, 2) +#define XLP_IO_USB_EHCI1_OFFSET(node) XLP_HDR_OFFSET(node, 0, 2, 3) +#define XLP_IO_USB_OHCI2_OFFSET(node) XLP_HDR_OFFSET(node, 0, 2, 4) +#define XLP_IO_USB_OHCI3_OFFSET(node) XLP_HDR_OFFSET(node, 0, 2, 5) + +#define XLP_IO_NAE_OFFSET(node) XLP_HDR_OFFSET(node, 0, 3, 0) +#define XLP_IO_POE_OFFSET(node) XLP_HDR_OFFSET(node, 0, 3, 1) + +#define XLP_IO_CMS_OFFSET(node) XLP_HDR_OFFSET(node, 0, 4, 0) + +#define XLP_IO_DMA_OFFSET(node) XLP_HDR_OFFSET(node, 0, 5, 1) +#define XLP_IO_SEC_OFFSET(node) XLP_HDR_OFFSET(node, 0, 5, 2) +#define XLP_IO_CMP_OFFSET(node) XLP_HDR_OFFSET(node, 0, 5, 3) + +#define XLP_IO_UART_OFFSET(node, i) XLP_HDR_OFFSET(node, 0, 6, i) +#define XLP_IO_UART0_OFFSET(node) XLP_HDR_OFFSET(node, 0, 6, 0) +#define XLP_IO_UART1_OFFSET(node) XLP_HDR_OFFSET(node, 0, 6, 1) +#define XLP_IO_I2C_OFFSET(node, i) XLP_HDR_OFFSET(node, 0, 6, 2 + (i)) +#define XLP_IO_I2C0_OFFSET(node) XLP_HDR_OFFSET(node, 0, 6, 2) +#define XLP_IO_I2C1_OFFSET(node) XLP_HDR_OFFSET(node, 0, 6, 3) +#define XLP_IO_GPIO_OFFSET(node) XLP_HDR_OFFSET(node, 0, 6, 4) /* system management */ -#define XLP_IO_SYS_OFFSET(node) XLP_HDR_OFFSET(node, 0, 6, 5) -#define XLP_IO_JTAG_OFFSET(node) XLP_HDR_OFFSET(node, 0, 6, 6) +#define XLP_IO_SYS_OFFSET(node) XLP_HDR_OFFSET(node, 0, 6, 5) +#define XLP_IO_JTAG_OFFSET(node) XLP_HDR_OFFSET(node, 0, 6, 6) -#define XLP_IO_NOR_OFFSET(node) XLP_HDR_OFFSET(node, 0, 7, 0) -#define XLP_IO_NAND_OFFSET(node) XLP_HDR_OFFSET(node, 0, 7, 1) -#define XLP_IO_SPI_OFFSET(node) XLP_HDR_OFFSET(node, 0, 7, 2) +#define XLP_IO_NOR_OFFSET(node) XLP_HDR_OFFSET(node, 0, 7, 0) +#define XLP_IO_NAND_OFFSET(node) XLP_HDR_OFFSET(node, 0, 7, 1) +#define XLP_IO_SPI_OFFSET(node) XLP_HDR_OFFSET(node, 0, 7, 2) /* SD flash */ -#define XLP_IO_SD_OFFSET(node) XLP_HDR_OFFSET(node, 0, 7, 3) -#define XLP_IO_MMC_OFFSET(node, slot) \ - ((XLP_IO_SD_OFFSET(node))+(slot*0x100)+XLP_IO_PCI_HDRSZ) +#define XLP_IO_SD_OFFSET(node) XLP_HDR_OFFSET(node, 0, 7, 3) +#define XLP_IO_MMC_OFFSET(node, slot) \ + ((XLP_IO_SD_OFFSET(node)) + (slot * 0x100) + XLP_IO_PCI_HDRSZ) /* PCI config header register id's */ -#define XLP_PCI_CFGREG0 0x00 -#define XLP_PCI_CFGREG1 0x01 -#define XLP_PCI_CFGREG2 0x02 -#define XLP_PCI_CFGREG3 0x03 -#define XLP_PCI_CFGREG4 0x04 -#define XLP_PCI_CFGREG5 0x05 -#define XLP_PCI_DEVINFO_REG0 0x30 -#define XLP_PCI_DEVINFO_REG1 0x31 -#define XLP_PCI_DEVINFO_REG2 0x32 -#define XLP_PCI_DEVINFO_REG3 0x33 -#define XLP_PCI_DEVINFO_REG4 0x34 -#define XLP_PCI_DEVINFO_REG5 0x35 -#define XLP_PCI_DEVINFO_REG6 0x36 -#define XLP_PCI_DEVINFO_REG7 0x37 -#define XLP_PCI_DEVSCRATCH_REG0 0x38 -#define XLP_PCI_DEVSCRATCH_REG1 0x39 -#define XLP_PCI_DEVSCRATCH_REG2 0x3a -#define XLP_PCI_DEVSCRATCH_REG3 0x3b -#define XLP_PCI_MSGSTN_REG 0x3c -#define XLP_PCI_IRTINFO_REG 0x3d -#define XLP_PCI_UCODEINFO_REG 0x3e -#define XLP_PCI_SBB_WT_REG 0x3f +#define XLP_PCI_CFGREG0 0x00 +#define XLP_PCI_CFGREG1 0x01 +#define XLP_PCI_CFGREG2 0x02 +#define XLP_PCI_CFGREG3 0x03 +#define XLP_PCI_CFGREG4 0x04 +#define XLP_PCI_CFGREG5 0x05 +#define XLP_PCI_DEVINFO_REG0 0x30 +#define XLP_PCI_DEVINFO_REG1 0x31 +#define XLP_PCI_DEVINFO_REG2 0x32 +#define XLP_PCI_DEVINFO_REG3 0x33 +#define XLP_PCI_DEVINFO_REG4 0x34 +#define XLP_PCI_DEVINFO_REG5 0x35 +#define XLP_PCI_DEVINFO_REG6 0x36 +#define XLP_PCI_DEVINFO_REG7 0x37 +#define XLP_PCI_DEVSCRATCH_REG0 0x38 +#define XLP_PCI_DEVSCRATCH_REG1 0x39 +#define XLP_PCI_DEVSCRATCH_REG2 0x3a +#define XLP_PCI_DEVSCRATCH_REG3 0x3b +#define XLP_PCI_MSGSTN_REG 0x3c +#define XLP_PCI_IRTINFO_REG 0x3d +#define XLP_PCI_UCODEINFO_REG 0x3e +#define XLP_PCI_SBB_WT_REG 0x3f /* PCI IDs for SoC device */ #define PCI_VENDOR_NETLOGIC 0x184e @@ -142,8 +142,8 @@ #if !defined(LOCORE) && !defined(__ASSEMBLY__) -#define nlm_read_pci_reg(b, r) nlm_read_reg(b, r) -#define nlm_write_pci_reg(b, r, v) nlm_write_reg(b, r, v) +#define nlm_read_pci_reg(b, r) nlm_read_reg(b, r) +#define nlm_write_pci_reg(b, r, v) nlm_write_reg(b, r, v) extern uint64_t xlp_sys_base; extern uint64_t xlp_pic_base; Modified: head/sys/mips/nlm/hal/mips-extns.h ============================================================================== --- head/sys/mips/nlm/hal/mips-extns.h Sat Nov 19 13:33:30 2011 (r227721) +++ head/sys/mips/nlm/hal/mips-extns.h Sat Nov 19 14:06:15 2011 (r227722) @@ -30,7 +30,7 @@ */ #ifndef __NLM_MIPS_EXTNS_H__ -#define __NLM_MIPS_EXTNS_H__ +#define __NLM_MIPS_EXTNS_H__ #if !defined(LOCORE) && !defined(__ASSEMBLY__) static __inline__ int32_t nlm_swapw(int32_t *loc, int32_t val) @@ -115,7 +115,7 @@ nlm_ldaddwu(unsigned int value, unsigned /* * 32 bit read write for c0 */ -#define read_c0_register32(reg, sel) \ +#define read_c0_register32(reg, sel) \ ({ \ uint32_t __rv; \ __asm__ __volatile__( \ @@ -127,7 +127,7 @@ nlm_ldaddwu(unsigned int value, unsigned __rv; \ }) -#define write_c0_register32(reg, sel, value) \ +#define write_c0_register32(reg, sel, value) \ __asm__ __volatile__( \ ".set push\n\t" \ ".set mips32\n\t" \ @@ -139,7 +139,7 @@ nlm_ldaddwu(unsigned int value, unsigned /* * On 64 bit compilation, the operations are simple */ -#define read_c0_register64(reg, sel) \ +#define read_c0_register64(reg, sel) \ ({ \ uint64_t __rv; \ __asm__ __volatile__( \ @@ -151,7 +151,7 @@ nlm_ldaddwu(unsigned int value, unsigned __rv; \ }) -#define write_c0_register64(reg, sel, value) \ +#define write_c0_register64(reg, sel, value) \ __asm__ __volatile__( \ ".set push\n\t" \ ".set mips64\n\t" \ @@ -163,7 +163,7 @@ nlm_ldaddwu(unsigned int value, unsigned /* * 32 bit compilation, 64 bit values has to split */ -#define read_c0_register64(reg, sel) \ +#define read_c0_register64(reg, sel) \ ({ \ uint32_t __high, __low; \ __asm__ __volatile__( \ @@ -179,7 +179,7 @@ nlm_ldaddwu(unsigned int value, unsigned ((uint64_t)__high << 32) | __low; \ }) -#define write_c0_register64(reg, sel, value) \ +#define write_c0_register64(reg, sel, value) \ do { \ uint32_t __high = value >> 32; \ uint32_t __low = value & 0xffffffff; \ @@ -267,8 +267,8 @@ nlm_coreid(void) } #endif -#define XLP_MAX_NODES 4 -#define XLP_MAX_CORES 8 -#define XLP_MAX_THREADS 4 +#define XLP_MAX_NODES 4 +#define XLP_MAX_CORES 8 +#define XLP_MAX_THREADS 4 #endif Modified: head/sys/mips/nlm/hal/mmu.h ============================================================================== --- head/sys/mips/nlm/hal/mmu.h Sat Nov 19 13:33:30 2011 (r227721) +++ head/sys/mips/nlm/hal/mmu.h Sat Nov 19 14:06:15 2011 (r227722) @@ -30,7 +30,7 @@ */ #ifndef __XLP_MMU_H__ -#define __XLP_MMU_H__ +#define __XLP_MMU_H__ #include Modified: head/sys/mips/nlm/hal/pcibus.h ============================================================================== --- head/sys/mips/nlm/hal/pcibus.h Sat Nov 19 13:33:30 2011 (r227721) +++ head/sys/mips/nlm/hal/pcibus.h Sat Nov 19 14:06:15 2011 (r227722) @@ -30,60 +30,60 @@ */ #ifndef __XLP_PCIBUS_H__ -#define __XLP_PCIBUS_H__ +#define __XLP_PCIBUS_H__ -#define MSI_MIPS_ADDR_BASE 0xfee00000 +#define MSI_MIPS_ADDR_BASE 0xfee00000 /* MSI support */ -#define MSI_MIPS_ADDR_DEST 0x000ff000 -#define MSI_MIPS_ADDR_RH 0x00000008 -#define MSI_MIPS_ADDR_RH_OFF 0x00000000 -#define MSI_MIPS_ADDR_RH_ON 0x00000008 -#define MSI_MIPS_ADDR_DM 0x00000004 -#define MSI_MIPS_ADDR_DM_PHYSICAL 0x00000000 -#define MSI_MIPS_ADDR_DM_LOGICAL 0x00000004 +#define MSI_MIPS_ADDR_DEST 0x000ff000 +#define MSI_MIPS_ADDR_RH 0x00000008 +#define MSI_MIPS_ADDR_RH_OFF 0x00000000 +#define MSI_MIPS_ADDR_RH_ON 0x00000008 +#define MSI_MIPS_ADDR_DM 0x00000004 +#define MSI_MIPS_ADDR_DM_PHYSICAL 0x00000000 +#define MSI_MIPS_ADDR_DM_LOGICAL 0x00000004 /* Fields in data for Intel MSI messages. */ -#define MSI_MIPS_DATA_TRGRMOD 0x00008000 /* Trigger mode */ -#define MSI_MIPS_DATA_TRGREDG 0x00000000 /* edge */ -#define MSI_MIPS_DATA_TRGRLVL 0x00008000 /* level */ - -#define MSI_MIPS_DATA_LEVEL 0x00004000 /* Polarity. */ -#define MSI_MIPS_DATA_DEASSERT 0x00000000 -#define MSI_MIPS_DATA_ASSERT 0x00004000 - -#define MSI_MIPS_DATA_DELMOD 0x00000700 /* Delivery Mode */ -#define MSI_MIPS_DATA_DELFIXED 0x00000000 /* fixed */ -#define MSI_MIPS_DATA_DELLOPRI 0x00000100 /* lowest priority */ +#define MSI_MIPS_DATA_TRGRMOD 0x00008000 /* Trigger mode */ +#define MSI_MIPS_DATA_TRGREDG 0x00000000 /* edge */ +#define MSI_MIPS_DATA_TRGRLVL 0x00008000 /* level */ + +#define MSI_MIPS_DATA_LEVEL 0x00004000 /* Polarity. */ +#define MSI_MIPS_DATA_DEASSERT 0x00000000 +#define MSI_MIPS_DATA_ASSERT 0x00004000 + +#define MSI_MIPS_DATA_DELMOD 0x00000700 /* Delivery Mode */ +#define MSI_MIPS_DATA_DELFIXED 0x00000000 /* fixed */ +#define MSI_MIPS_DATA_DELLOPRI 0x00000100 /* lowest priority */ -#define MSI_MIPS_DATA_INTVEC 0x000000ff +#define MSI_MIPS_DATA_INTVEC 0x000000ff /* * Build Intel MSI message and data values from a source. AMD64 systems * seem to be compatible, so we use the same function for both. */ -#define MIPS_MSI_ADDR(cpu) \ - (MSI_MIPS_ADDR_BASE | (cpu) << 12 | \ - MSI_MIPS_ADDR_RH_OFF | MSI_MIPS_ADDR_DM_PHYSICAL) - -#define MIPS_MSI_DATA(irq) \ - (MSI_MIPS_DATA_TRGRLVL | MSI_MIPS_DATA_DELFIXED | \ - MSI_MIPS_DATA_ASSERT | (irq)) - -#define PCIE_BRIDGE_CMD 0x1 -#define PCIE_BRIDGE_MSI_CAP 0x14 -#define PCIE_BRIDGE_MSI_ADDRL 0x15 -#define PCIE_BRIDGE_MSI_ADDRH 0x16 -#define PCIE_BRIDGE_MSI_DATA 0x17 +#define MIPS_MSI_ADDR(cpu) \ + (MSI_MIPS_ADDR_BASE | (cpu) << 12 | \ + MSI_MIPS_ADDR_RH_OFF | MSI_MIPS_ADDR_DM_PHYSICAL) + +#define MIPS_MSI_DATA(irq) \ + (MSI_MIPS_DATA_TRGRLVL | MSI_MIPS_DATA_DELFIXED | \ + MSI_MIPS_DATA_ASSERT | (irq)) + +#define PCIE_BRIDGE_CMD 0x1 +#define PCIE_BRIDGE_MSI_CAP 0x14 +#define PCIE_BRIDGE_MSI_ADDRL 0x15 +#define PCIE_BRIDGE_MSI_ADDRH 0x16 +#define PCIE_BRIDGE_MSI_DATA 0x17 /* XLP Global PCIE configuration space registers */ -#define PCIE_MSI_STATUS 0x25A -#define PCIE_MSI_EN 0x25B -#define PCIE_INT_EN0 0x261 +#define PCIE_MSI_STATUS 0x25A +#define PCIE_MSI_EN 0x25B +#define PCIE_INT_EN0 0x261 /* PCIE_MSI_EN */ -#define PCIE_MSI_VECTOR_INT_EN 0xFFFFFFFF +#define PCIE_MSI_VECTOR_INT_EN 0xFFFFFFFF /* PCIE_INT_EN0 */ -#define PCIE_MSI_INT_EN (1 << 9) +#define PCIE_MSI_INT_EN (1 << 9) #endif /* __XLP_PCIBUS_H__ */ Modified: head/sys/mips/nlm/hal/uart.h ============================================================================== --- head/sys/mips/nlm/hal/uart.h Sat Nov 19 13:33:30 2011 (r227721) +++ head/sys/mips/nlm/hal/uart.h Sat Nov 19 14:06:15 2011 (r227722) @@ -30,69 +30,69 @@ */ #ifndef __XLP_HAL_UART_H__ -#define __XLP_HAL_UART_H__ +#define __XLP_HAL_UART_H__ /* UART Specific registers */ -#define UART_RX_DATA 0x00 -#define UART_TX_DATA 0x00 +#define UART_RX_DATA 0x00 +#define UART_TX_DATA 0x00 -#define UART_INT_EN 0x01 -#define UART_INT_ID 0x02 -#define UART_FIFO_CTL 0x02 -#define UART_LINE_CTL 0x03 -#define UART_MODEM_CTL 0x04 -#define UART_LINE_STS 0x05 -#define UART_MODEM_STS 0x06 +#define UART_INT_EN 0x01 +#define UART_INT_ID 0x02 +#define UART_FIFO_CTL 0x02 +#define UART_LINE_CTL 0x03 +#define UART_MODEM_CTL 0x04 +#define UART_LINE_STS 0x05 +#define UART_MODEM_STS 0x06 -#define UART_DIVISOR0 0x00 -#define UART_DIVISOR1 0x01 +#define UART_DIVISOR0 0x00 +#define UART_DIVISOR1 0x01 -#define BASE_BAUD (XLP_IO_CLK/16) -#define BAUD_DIVISOR(baud) (BASE_BAUD / baud) +#define BASE_BAUD (XLP_IO_CLK/16) +#define BAUD_DIVISOR(baud) (BASE_BAUD / baud) /* LCR mask values */ -#define LCR_5BITS 0x00 -#define LCR_6BITS 0x01 -#define LCR_7BITS 0x02 -#define LCR_8BITS 0x03 -#define LCR_STOPB 0x04 -#define LCR_PENAB 0x08 -#define LCR_PODD 0x00 -#define LCR_PEVEN 0x10 -#define LCR_PONE 0x20 -#define LCR_PZERO 0x30 -#define LCR_SBREAK 0x40 -#define LCR_EFR_ENABLE 0xbf -#define LCR_DLAB 0x80 +#define LCR_5BITS 0x00 +#define LCR_6BITS 0x01 +#define LCR_7BITS 0x02 +#define LCR_8BITS 0x03 +#define LCR_STOPB 0x04 +#define LCR_PENAB 0x08 +#define LCR_PODD 0x00 +#define LCR_PEVEN 0x10 +#define LCR_PONE 0x20 +#define LCR_PZERO 0x30 +#define LCR_SBREAK 0x40 +#define LCR_EFR_ENABLE 0xbf +#define LCR_DLAB 0x80 /* MCR mask values */ -#define MCR_DTR 0x01 -#define MCR_RTS 0x02 -#define MCR_DRS 0x04 -#define MCR_IE 0x08 -#define MCR_LOOPBACK 0x10 +#define MCR_DTR 0x01 +#define MCR_RTS 0x02 +#define MCR_DRS 0x04 +#define MCR_IE 0x08 +#define MCR_LOOPBACK 0x10 /* FCR mask values */ -#define FCR_RCV_RST 0x02 -#define FCR_XMT_RST 0x04 -#define FCR_RX_LOW 0x00 -#define FCR_RX_MEDL 0x40 -#define FCR_RX_MEDH 0x80 -#define FCR_RX_HIGH 0xc0 +#define FCR_RCV_RST 0x02 +#define FCR_XMT_RST 0x04 +#define FCR_RX_LOW 0x00 +#define FCR_RX_MEDL 0x40 +#define FCR_RX_MEDH 0x80 +#define FCR_RX_HIGH 0xc0 /* IER mask values */ -#define IER_ERXRDY 0x1 -#define IER_ETXRDY 0x2 -#define IER_ERLS 0x4 -#define IER_EMSC 0x8 +#define IER_ERXRDY 0x1 +#define IER_ETXRDY 0x2 +#define IER_ERLS 0x4 +#define IER_EMSC 0x8 #if !defined(LOCORE) && !defined(__ASSEMBLY__) #define nlm_read_uart_reg(b, r) nlm_read_reg(b, r) #define nlm_write_uart_reg(b, r, v) nlm_write_reg(b, r, v) -#define nlm_get_uart_pcibase(node, inst) \ +#define nlm_get_uart_pcibase(node, inst) \ nlm_pcicfg_base(XLP_IO_UART_OFFSET(node, inst)) -#define nlm_get_uart_regbase(node, inst) \ +#define nlm_get_uart_regbase(node, inst) \ (nlm_get_uart_pcibase(node, inst) + XLP_IO_PCI_HDRSZ) static inline void From owner-svn-src-all@FreeBSD.ORG Sat Nov 19 14:10:16 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ADE301065673; Sat, 19 Nov 2011 14:10:16 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9B77C8FC12; Sat, 19 Nov 2011 14:10:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAJEAGLh046598; Sat, 19 Nov 2011 14:10:16 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAJEAGUJ046591; Sat, 19 Nov 2011 14:10:16 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201111191410.pAJEAGUJ046591@svn.freebsd.org> From: Lawrence Stewart Date: Sat, 19 Nov 2011 14:10:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227723 - in head/sys: conf kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Nov 2011 14:10:16 -0000 Author: lstewart Date: Sat Nov 19 14:10:16 2011 New Revision: 227723 URL: http://svn.freebsd.org/changeset/base/227723 Log: Core structure and functions to support a feed-forward clock within the kernel. Implement ffcounter, a monotonically increasing cumulative counter on top of the active timecounter. Provide low-level functions to read the ffcounter and convert it to absolute time or a time interval in seconds using the current ffclock estimates, which track the drift of the oscillator. Add a ring of fftimehands to track passing of time on each kernel tick and pick up updates of ffclock estimates. Committed on behalf of Julien Ridoux and Darryl Veitch from the University of Melbourne, Australia, as part of the FreeBSD Foundation funded "Feed-Forward Clock Synchronization Algorithms" project. For more information, see http://www.synclab.org/radclock/ Submitted by: Julien Ridoux (jridoux at unimelb edu au) Added: head/sys/sys/_ffcounter.h (contents, props changed) head/sys/sys/timeffc.h (contents, props changed) Modified: head/sys/conf/NOTES head/sys/conf/options head/sys/kern/kern_tc.c head/sys/kern/subr_rtc.c Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Sat Nov 19 14:06:15 2011 (r227722) +++ head/sys/conf/NOTES Sat Nov 19 14:10:16 2011 (r227723) @@ -1186,6 +1186,14 @@ options HZ=100 options PPS_SYNC +# Enable support for generic feed-forward clocks in the kernel. +# The feed-forward clock support is an alternative to the feedback oriented +# ntpd/system clock approach, and is to be used with a feed-forward +# synchronization algorithm such as the RADclock: +# More info here: http://www.synclab.org/radclock + +options FFCLOCK + ##################################################################### # SCSI DEVICES Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Sat Nov 19 14:06:15 2011 (r227722) +++ head/sys/conf/options Sat Nov 19 14:10:16 2011 (r227723) @@ -80,6 +80,7 @@ COMPRESS_USER_CORES opt_core.h CY_PCI_FASTINTR DEADLKRES opt_watchdog.h DIRECTIO +FFCLOCK FULL_PREEMPTION opt_sched.h IPI_PREEMPTION opt_sched.h GEOM_AES opt_geom.h Modified: head/sys/kern/kern_tc.c ============================================================================== --- head/sys/kern/kern_tc.c Sat Nov 19 14:06:15 2011 (r227722) +++ head/sys/kern/kern_tc.c Sat Nov 19 14:10:16 2011 (r227723) @@ -5,18 +5,32 @@ * can do whatever you want with this stuff. If we meet some day, and you think * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp * ---------------------------------------------------------------------------- + * + * Copyright (c) 2011 The FreeBSD Foundation + * All rights reserved. + * + * Portions of this software were developed by Julien Ridoux at the University + * of Melbourne under sponsorship from the FreeBSD Foundation. */ #include __FBSDID("$FreeBSD$"); #include "opt_ntp.h" +#include "opt_ffclock.h" #include #include +#ifdef FFCLOCK +#include +#include +#endif #include #include #include +#ifdef FFCLOCK +#include +#endif #include #include #include @@ -300,6 +314,425 @@ getmicrotime(struct timeval *tvp) } while (gen == 0 || gen != th->th_generation); } +#ifdef FFCLOCK +/* + * Support for feed-forward synchronization algorithms. This is heavily inspired + * by the timehands mechanism but kept independent from it. *_windup() functions + * have some connection to avoid accessing the timecounter hardware more than + * necessary. + */ + +/* Feed-forward clock estimates kept updated by the synchronization daemon. */ +struct ffclock_estimate ffclock_estimate; +struct bintime ffclock_boottime; /* Feed-forward boot time estimate. */ +uint32_t ffclock_status; /* Feed-forward clock status. */ +int8_t ffclock_updated; /* New estimates are available. */ +struct mtx ffclock_mtx; /* Mutex on ffclock_estimate. */ + +struct fftimehands { + struct ffclock_estimate cest; + struct bintime tick_time; + struct bintime tick_time_lerp; + ffcounter tick_ffcount; + uint64_t period_lerp; + volatile uint8_t gen; + struct fftimehands *next; +}; + +#define NUM_ELEMENTS(x) (sizeof(x) / sizeof(*x)) + +static struct fftimehands ffth[10]; +static struct fftimehands *volatile fftimehands = ffth; + +static void +ffclock_init(void) +{ + struct fftimehands *cur; + struct fftimehands *last; + + memset(ffth, 0, sizeof(ffth)); + + last = ffth + NUM_ELEMENTS(ffth) - 1; + for (cur = ffth; cur < last; cur++) + cur->next = cur + 1; + last->next = ffth; + + ffclock_updated = 0; + ffclock_status = FFCLOCK_STA_UNSYNC; + mtx_init(&ffclock_mtx, "ffclock lock", NULL, MTX_DEF); +} + +/* + * Reset the feed-forward clock estimates. Called from inittodr() to get things + * kick started and uses the timecounter nominal frequency as a first period + * estimate. Note: this function may be called several time just after boot. + * Note: this is the only function that sets the value of boot time for the + * monotonic (i.e. uptime) version of the feed-forward clock. + */ +void +ffclock_reset_clock(struct timespec *ts) +{ + struct timecounter *tc; + struct ffclock_estimate cest; + + tc = timehands->th_counter; + memset(&cest, 0, sizeof(struct ffclock_estimate)); + + timespec2bintime(ts, &ffclock_boottime); + timespec2bintime(ts, &(cest.update_time)); + ffclock_read_counter(&cest.update_ffcount); + cest.leapsec_next = 0; + cest.period = ((1ULL << 63) / tc->tc_frequency) << 1; + cest.errb_abs = 0; + cest.errb_rate = 0; + cest.status = FFCLOCK_STA_UNSYNC; + cest.leapsec_total = 0; + cest.leapsec = 0; + + mtx_lock(&ffclock_mtx); + bcopy(&cest, &ffclock_estimate, sizeof(struct ffclock_estimate)); + ffclock_updated = INT8_MAX; + mtx_unlock(&ffclock_mtx); + + printf("ffclock reset: %s (%llu Hz), time = %ld.%09lu\n", tc->tc_name, + (unsigned long long)tc->tc_frequency, (long)ts->tv_sec, + (unsigned long)ts->tv_nsec); +} + +/* + * Sub-routine to convert a time interval measured in RAW counter units to time + * in seconds stored in bintime format. + * NOTE: bintime_mul requires u_int, but the value of the ffcounter may be + * larger than the max value of u_int (on 32 bit architecture). Loop to consume + * extra cycles. + */ +static void +ffclock_convert_delta(ffcounter ffdelta, uint64_t period, struct bintime *bt) +{ + struct bintime bt2; + ffcounter delta, delta_max; + + delta_max = (1ULL << (8 * sizeof(unsigned int))) - 1; + bintime_clear(bt); + do { + if (ffdelta > delta_max) + delta = delta_max; + else + delta = ffdelta; + bt2.sec = 0; + bt2.frac = period; + bintime_mul(&bt2, (unsigned int)delta); + bintime_add(bt, &bt2); + ffdelta -= delta; + } while (ffdelta > 0); +} + +/* + * Update the fftimehands. + * Push the tick ffcount and time(s) forward based on current clock estimate. + * The conversion from ffcounter to bintime relies on the difference clock + * principle, whose accuracy relies on computing small time intervals. If a new + * clock estimate has been passed by the synchronisation daemon, make it + * current, and compute the linear interpolation for monotonic time if needed. + */ +static void +ffclock_windup(unsigned int delta) +{ + struct ffclock_estimate *cest; + struct fftimehands *ffth; + struct bintime bt, gap_lerp; + ffcounter ffdelta; + uint64_t frac; + unsigned int polling; + uint8_t forward_jump, ogen; + + /* + * Pick the next timehand, copy current ffclock estimates and move tick + * times and counter forward. + */ + forward_jump = 0; + ffth = fftimehands->next; + ogen = ffth->gen; + ffth->gen = 0; + cest = &ffth->cest; + bcopy(&fftimehands->cest, cest, sizeof(struct ffclock_estimate)); + ffdelta = (ffcounter)delta; + ffth->period_lerp = fftimehands->period_lerp; + + ffth->tick_time = fftimehands->tick_time; + ffclock_convert_delta(ffdelta, cest->period, &bt); + bintime_add(&ffth->tick_time, &bt); + + ffth->tick_time_lerp = fftimehands->tick_time_lerp; + ffclock_convert_delta(ffdelta, ffth->period_lerp, &bt); + bintime_add(&ffth->tick_time_lerp, &bt); + + ffth->tick_ffcount = fftimehands->tick_ffcount + ffdelta; + + /* + * Assess the status of the clock, if the last update is too old, it is + * likely the synchronisation daemon is dead and the clock is free + * running. + */ + if (ffclock_updated == 0) { + ffdelta = ffth->tick_ffcount - cest->update_ffcount; + ffclock_convert_delta(ffdelta, cest->period, &bt); + if (bt.sec > 2 * FFCLOCK_SKM_SCALE) + ffclock_status |= FFCLOCK_STA_UNSYNC; + } + + /* + * If available, grab updated clock estimates and make them current. + * Recompute time at this tick using the updated estimates. The clock + * estimates passed the feed-forward synchronisation daemon may result + * in time conversion that is not monotonically increasing (just after + * the update). time_lerp is a particular linear interpolation over the + * synchronisation algo polling period that ensures monotonicity for the + * clock ids requesting it. + */ + if (ffclock_updated > 0) { + bcopy(&ffclock_estimate, cest, sizeof(struct ffclock_estimate)); + ffdelta = ffth->tick_ffcount - cest->update_ffcount; + ffth->tick_time = cest->update_time; + ffclock_convert_delta(ffdelta, cest->period, &bt); + bintime_add(&ffth->tick_time, &bt); + + /* ffclock_reset sets ffclock_updated to INT8_MAX */ + if (ffclock_updated == INT8_MAX) + ffth->tick_time_lerp = ffth->tick_time; + + if (bintime_cmp(&ffth->tick_time, &ffth->tick_time_lerp, >)) + forward_jump = 1; + else + forward_jump = 0; + + bintime_clear(&gap_lerp); + if (forward_jump) { + gap_lerp = ffth->tick_time; + bintime_sub(&gap_lerp, &ffth->tick_time_lerp); + } else { + gap_lerp = ffth->tick_time_lerp; + bintime_sub(&gap_lerp, &ffth->tick_time); + } + + /* + * The reset from the RTC clock may be far from accurate, and + * reducing the gap between real time and interpolated time + * could take a very long time if the interpolated clock insists + * on strict monotonicity. The clock is reset under very strict + * conditions (kernel time is known to be wrong and + * synchronization daemon has been restarted recently. + * ffclock_boottime absorbs the jump to ensure boot time is + * correct and uptime functions stay consistent. + */ + if (((ffclock_status & FFCLOCK_STA_UNSYNC) == FFCLOCK_STA_UNSYNC) && + ((cest->status & FFCLOCK_STA_UNSYNC) == 0) && + ((cest->status & FFCLOCK_STA_WARMUP) == FFCLOCK_STA_WARMUP)) { + if (forward_jump) + bintime_add(&ffclock_boottime, &gap_lerp); + else + bintime_sub(&ffclock_boottime, &gap_lerp); + ffth->tick_time_lerp = ffth->tick_time; + bintime_clear(&gap_lerp); + } + + ffclock_status = cest->status; + ffth->period_lerp = cest->period; + + /* + * Compute corrected period used for the linear interpolation of + * time. The rate of linear interpolation is capped to 5000PPM + * (5ms/s). + */ + if (bintime_isset(&gap_lerp)) { + ffdelta = cest->update_ffcount; + ffdelta -= fftimehands->cest.update_ffcount; + ffclock_convert_delta(ffdelta, cest->period, &bt); + polling = bt.sec; + bt.sec = 0; + bt.frac = 5000000 * (uint64_t)18446744073LL; + bintime_mul(&bt, polling); + if (bintime_cmp(&gap_lerp, &bt, >)) + gap_lerp = bt; + + /* Approximate 1 sec by 1-(1/2^64) to ease arithmetic */ + frac = 0; + if (gap_lerp.sec > 0) { + frac -= 1; + frac /= ffdelta / gap_lerp.sec; + } + frac += gap_lerp.frac / ffdelta; + + if (forward_jump) + ffth->period_lerp += frac; + else + ffth->period_lerp -= frac; + } + + ffclock_updated = 0; + } + if (++ogen == 0) + ogen = 1; + ffth->gen = ogen; + fftimehands = ffth; +} + +/* + * Adjust the fftimehands when the timecounter is changed. Stating the obvious, + * the old and new hardware counter cannot be read simultaneously. tc_windup() + * does read the two counters 'back to back', but a few cycles are effectively + * lost, and not accumulated in tick_ffcount. This is a fairly radical + * operation for a feed-forward synchronization daemon, and it is its job to not + * pushing irrelevant data to the kernel. Because there is no locking here, + * simply force to ignore pending or next update to give daemon a chance to + * realize the counter has changed. + */ +static void +ffclock_change_tc(struct timehands *th) +{ + struct fftimehands *ffth; + struct ffclock_estimate *cest; + struct timecounter *tc; + uint8_t ogen; + + tc = th->th_counter; + ffth = fftimehands->next; + ogen = ffth->gen; + ffth->gen = 0; + + cest = &ffth->cest; + bcopy(&(fftimehands->cest), cest, sizeof(struct ffclock_estimate)); + cest->period = ((1ULL << 63) / tc->tc_frequency ) << 1; + cest->errb_abs = 0; + cest->errb_rate = 0; + cest->status |= FFCLOCK_STA_UNSYNC; + + ffth->tick_ffcount = fftimehands->tick_ffcount; + ffth->tick_time_lerp = fftimehands->tick_time_lerp; + ffth->tick_time = fftimehands->tick_time; + ffth->period_lerp = cest->period; + + /* Do not lock but ignore next update from synchronization daemon. */ + ffclock_updated--; + + if (++ogen == 0) + ogen = 1; + ffth->gen = ogen; + fftimehands = ffth; +} + +/* + * Retrieve feed-forward counter and time of last kernel tick. + */ +void +ffclock_last_tick(ffcounter *ffcount, struct bintime *bt, uint32_t flags) +{ + struct fftimehands *ffth; + uint8_t gen; + + /* + * No locking but check generation has not changed. Also need to make + * sure ffdelta is positive, i.e. ffcount > tick_ffcount. + */ + do { + ffth = fftimehands; + gen = ffth->gen; + if ((flags & FFCLOCK_LERP) == FFCLOCK_LERP) + *bt = ffth->tick_time_lerp; + else + *bt = ffth->tick_time; + *ffcount = ffth->tick_ffcount; + } while (gen == 0 || gen != ffth->gen); +} + +/* + * Absolute clock conversion. Low level function to convert ffcounter to + * bintime. The ffcounter is converted using the current ffclock period estimate + * or the "interpolated period" to ensure monotonicity. + * NOTE: this conversion may have been deferred, and the clock updated since the + * hardware counter has been read. + */ +void +ffclock_convert_abs(ffcounter ffcount, struct bintime *bt, uint32_t flags) +{ + struct fftimehands *ffth; + struct bintime bt2; + ffcounter ffdelta; + uint8_t gen; + + /* + * No locking but check generation has not changed. Also need to make + * sure ffdelta is positive, i.e. ffcount > tick_ffcount. + */ + do { + ffth = fftimehands; + gen = ffth->gen; + if (ffcount > ffth->tick_ffcount) + ffdelta = ffcount - ffth->tick_ffcount; + else + ffdelta = ffth->tick_ffcount - ffcount; + + if ((flags & FFCLOCK_LERP) == FFCLOCK_LERP) { + *bt = ffth->tick_time_lerp; + ffclock_convert_delta(ffdelta, ffth->period_lerp, &bt2); + } else { + *bt = ffth->tick_time; + ffclock_convert_delta(ffdelta, ffth->cest.period, &bt2); + } + + if (ffcount > ffth->tick_ffcount) + bintime_add(bt, &bt2); + else + bintime_sub(bt, &bt2); + } while (gen == 0 || gen != ffth->gen); +} + +/* + * Difference clock conversion. + * Low level function to Convert a time interval measured in RAW counter units + * into bintime. The difference clock allows measuring small intervals much more + * reliably than the absolute clock. + */ +void +ffclock_convert_diff(ffcounter ffdelta, struct bintime *bt) +{ + struct fftimehands *ffth; + uint8_t gen; + + /* No locking but check generation has not changed. */ + do { + ffth = fftimehands; + gen = ffth->gen; + ffclock_convert_delta(ffdelta, ffth->cest.period, bt); + } while (gen == 0 || gen != ffth->gen); +} + +/* + * Access to current ffcounter value. + */ +void +ffclock_read_counter(ffcounter *ffcount) +{ + struct timehands *th; + struct fftimehands *ffth; + unsigned int gen, delta; + + /* + * ffclock_windup() called from tc_windup(), safe to rely on + * th->th_generation only, for correct delta and ffcounter. + */ + do { + th = timehands; + gen = th->th_generation; + ffth = fftimehands; + delta = tc_delta(th); + *ffcount = ffth->tick_ffcount; + } while (gen == 0 || gen != th->th_generation); + + *ffcount += delta; +} +#endif /* FFCLOCK */ + /* * Initialize a new timecounter and possibly use it. */ @@ -440,6 +873,9 @@ tc_windup(void) ncount = timecounter->tc_get_timecount(timecounter); else ncount = 0; +#ifdef FFCLOCK + ffclock_windup(delta); +#endif th->th_offset_count += delta; th->th_offset_count &= th->th_counter->tc_counter_mask; while (delta > th->th_counter->tc_frequency) { @@ -502,6 +938,9 @@ tc_windup(void) th->th_offset_count = ncount; tc_min_ticktock_freq = max(1, timecounter->tc_frequency / (((uint64_t)timecounter->tc_counter_mask + 1) / 3)); +#ifdef FFCLOCK + ffclock_change_tc(th); +#endif } /*- @@ -820,6 +1259,9 @@ inittimecounter(void *dummy) p = (tc_tick * 1000000) / hz; printf("Timecounters tick every %d.%03u msec\n", p / 1000, p % 1000); +#ifdef FFCLOCK + ffclock_init(); +#endif /* warm up new timecounter (again) and get rolling. */ (void)timecounter->tc_get_timecount(timecounter); (void)timecounter->tc_get_timecount(timecounter); Modified: head/sys/kern/subr_rtc.c ============================================================================== --- head/sys/kern/subr_rtc.c Sat Nov 19 14:06:15 2011 (r227722) +++ head/sys/kern/subr_rtc.c Sat Nov 19 14:10:16 2011 (r227723) @@ -1,12 +1,17 @@ /*- * Copyright (c) 1988 University of Utah. * Copyright (c) 1982, 1990, 1993 - * The Regents of the University of California. All rights reserved. + * The Regents of the University of California. + * Copyright (c) 2011 The FreeBSD Foundation + * All rights reserved. * * This code is derived from software contributed to Berkeley by * the Systems Programming Group of the University of Utah Computer * Science Department. * + * Portions of this software were developed by Julien Ridoux at the University + * of Melbourne 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: @@ -50,12 +55,17 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_ffclock.h" + #include #include #include #include #include #include +#ifdef FFCLOCK +#include +#endif #include #include "clock_if.h" @@ -133,6 +143,9 @@ inittodr(time_t base) ts.tv_sec += utc_offset(); timespecadd(&ts, &clock_adj); tc_setclock(&ts); +#ifdef FFCLOCK + ffclock_reset_clock(&ts); +#endif return; wrong_time: Added: head/sys/sys/_ffcounter.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/sys/_ffcounter.h Sat Nov 19 14:10:16 2011 (r227723) @@ -0,0 +1,42 @@ +/*- + * Copyright (c) 2011 The University of Melbourne + * All rights reserved. + * + * This software was developed by Julien Ridoux at the University of Melbourne + * 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$ + */ + +#ifndef _SYS__FFCOUNTER_H_ +#define _SYS__FFCOUNTER_H_ + +/* + * The feed-forward clock counter. The fundamental element of a feed-forward + * clock is a wide monotonically increasing counter that accumulates at the same + * rate as the selected timecounter. + */ +typedef uint64_t ffcounter; + +#endif /* _SYS__FFCOUNTER_H_ */ Added: head/sys/sys/timeffc.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/sys/timeffc.h Sat Nov 19 14:10:16 2011 (r227723) @@ -0,0 +1,110 @@ +/*- + * Copyright (c) 2011 The University of Melbourne + * All rights reserved. + * + * This software was developed by Julien Ridoux at the University of Melbourne + * 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$ + */ + +#ifndef _SYS_TIMEFF_H_ +#define _SYS_TIMEFF_H_ + +#include + +/* + * Feed-forward clock estimate + * Holds time mark as a ffcounter and conversion to bintime based on current + * timecounter period and offset estimate passed by the synchronization daemon. + * Provides time of last daemon update, clock status and bound on error. + */ +struct ffclock_estimate { + struct bintime update_time; /* Time of last estimates update. */ + ffcounter update_ffcount; /* Counter value at last update. */ + ffcounter leapsec_next; /* Counter value of next leap second. */ + uint64_t period; /* Estimate of counter period. */ + uint32_t errb_abs; /* Bound on absolute clock error [ns]. */ + uint32_t errb_rate; /* Bound on counter rate error [ps/s]. */ + uint32_t status; /* Clock status. */ + int16_t leapsec_total; /* All leap seconds seen so far. */ + int8_t leapsec; /* Next leap second (in {-1,0,1}). */ +}; + +#if __BSD_VISIBLE +#ifdef _KERNEL + +/* + * Parameters of counter characterisation required by feed-forward algorithms. + */ +#define FFCLOCK_SKM_SCALE 1024 + +/* + * Feed-forward clock status + */ +#define FFCLOCK_STA_UNSYNC 1 +#define FFCLOCK_STA_WARMUP 2 + +/* + * Clock flags to select how the feed-forward counter is converted to absolute + * time by ffclock_convert_abs(). + * FAST: do not read the hardware counter, return feed-forward clock time + * at last tick. The time returned has the resolution of the kernel + * tick (1/hz [s]). + * LERP: linear interpolation of ffclock time to guarantee monotonic time. + * LEAPSEC: include leap seconds. + * UPTIME: removes time of boot. + */ +#define FFCLOCK_FAST 1 +#define FFCLOCK_LERP 2 +#define FFCLOCK_LEAPSEC 4 +#define FFCLOCK_UPTIME 8 + +/* Resets feed-forward clock from RTC */ +void ffclock_reset_clock(struct timespec *ts); + +/* + * Return the current value of the feed-forward clock counter. Essential to + * measure time interval in counter units. If a fast timecounter is used by the + * system, may also allow fast but accurate timestamping. + */ +void ffclock_read_counter(ffcounter *ffcount); + +/* + * Retrieve feed-forward counter value and time of last kernel tick. This + * accepts the FFCLOCK_LERP flag. + */ +void ffclock_last_tick(ffcounter *ffcount, struct bintime *bt, uint32_t flags); + +/* + * Low level routines to convert a counter timestamp into absolute time and a + * counter timestamp interval into an interval in seconds. The absolute time + * conversion accepts the FFCLOCK_LERP flag. + */ +void ffclock_convert_abs(ffcounter ffcount, struct bintime *bt, uint32_t flags); +void ffclock_convert_diff(ffcounter ffdelta, struct bintime *bt); + +#endif /* _KERNEL */ +#endif /* __BSD_VISIBLE */ +#endif /* _SYS_TIMEFF_H_ */ From owner-svn-src-all@FreeBSD.ORG Sat Nov 19 14:14:35 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C8DC4106566C; Sat, 19 Nov 2011 14:14:35 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9EBED8FC08; Sat, 19 Nov 2011 14:14:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAJEEZI8046745; Sat, 19 Nov 2011 14:14:35 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAJEEZGR046743; Sat, 19 Nov 2011 14:14:35 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201111191414.pAJEEZGR046743@svn.freebsd.org> From: "Jayachandran C." Date: Sat, 19 Nov 2011 14:14:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227724 - head/sys/mips/mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Nov 2011 14:14:35 -0000 Author: jchandra Date: Sat Nov 19 14:14:35 2011 New Revision: 227724 URL: http://svn.freebsd.org/changeset/base/227724 Log: Fixup cache flush definitions for XLP mco_icache_sync_range was earlier set to mipsNN_icache_sync_range_index_32 which is not necessary, revert this. Also, the data cache is coherent so write back is not really needed. This change is experimental. Modified: head/sys/mips/mips/cache.c Modified: head/sys/mips/mips/cache.c ============================================================================== --- head/sys/mips/mips/cache.c Sat Nov 19 14:10:16 2011 (r227723) +++ head/sys/mips/mips/cache.c Sat Nov 19 14:14:35 2011 (r227724) @@ -101,13 +101,8 @@ mips_config_cache(struct mips_cpuinfo * break; case 32: mips_cache_ops.mco_icache_sync_all = mipsNN_icache_sync_all_32; -#ifdef CPU_NLM - mips_cache_ops.mco_icache_sync_range = - mipsNN_icache_sync_range_index_32; -#else mips_cache_ops.mco_icache_sync_range = mipsNN_icache_sync_range_32; -#endif mips_cache_ops.mco_icache_sync_range_index = mipsNN_icache_sync_range_index_32; break; @@ -155,18 +150,23 @@ mips_config_cache(struct mips_cpuinfo * mips_cache_ops.mco_pdcache_wbinv_all = mips_cache_ops.mco_intern_pdcache_wbinv_all = mipsNN_pdcache_wbinv_all_32; -#ifdef CPU_NLM - mips_cache_ops.mco_pdcache_wbinv_range = - mipsNN_pdcache_wbinv_range_index_32; +#if defined(CPU_RMI) || defined(CPU_NLM) + mips_cache_ops.mco_pdcache_wbinv_range = cache_noop; #else mips_cache_ops.mco_pdcache_wbinv_range = mipsNN_pdcache_wbinv_range_32; #endif +#if defined(CPU_RMI) || defined(CPU_NLM) + mips_cache_ops.mco_pdcache_wbinv_range_index = + mips_cache_ops.mco_intern_pdcache_wbinv_range_index = cache_noop; + mips_cache_ops.mco_pdcache_inv_range = cache_noop; +#else mips_cache_ops.mco_pdcache_wbinv_range_index = mips_cache_ops.mco_intern_pdcache_wbinv_range_index = mipsNN_pdcache_wbinv_range_index_32; mips_cache_ops.mco_pdcache_inv_range = mipsNN_pdcache_inv_range_32; +#endif #if defined(CPU_RMI) || defined(CPU_NLM) mips_cache_ops.mco_pdcache_wb_range = mips_cache_ops.mco_intern_pdcache_wb_range = cache_noop; From owner-svn-src-all@FreeBSD.ORG Sat Nov 19 14:33:15 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 29B541065672; Sat, 19 Nov 2011 14:33:15 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 18D0A8FC14; Sat, 19 Nov 2011 14:33:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAJEXE5A047416; Sat, 19 Nov 2011 14:33:14 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAJEXEgt047413; Sat, 19 Nov 2011 14:33:14 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201111191433.pAJEXEgt047413@svn.freebsd.org> From: "Jayachandran C." Date: Sat, 19 Nov 2011 14:33:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227725 - in head/sys/mips: conf nlm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Nov 2011 14:33:15 -0000 Author: jchandra Date: Sat Nov 19 14:33:14 2011 New Revision: 227725 URL: http://svn.freebsd.org/changeset/base/227725 Log: Fix USB compilation, and add USB options to XLP conf Remove obsolete header file included in usb_init.c Modified: head/sys/mips/conf/std.XLP head/sys/mips/nlm/usb_init.c Modified: head/sys/mips/conf/std.XLP ============================================================================== --- head/sys/mips/conf/std.XLP Sat Nov 19 14:14:35 2011 (r227724) +++ head/sys/mips/conf/std.XLP Sat Nov 19 14:33:14 2011 (r227725) @@ -76,6 +76,14 @@ device scbus #device ata #device atadisk +# USB +device usb # USB Bus (required) +device ehci # EHCI PCI->USB interface (USB 2.0) +#options USB_DEBUG # enable debug msgs +#device ugen # Generic +#device uhid # "Human Interface Devices" +device umass # Requires scbus and da + options FDT options FDT_DTB_STATIC makeoptions FDT_DTS_FILE=xlp-basic.dts Modified: head/sys/mips/nlm/usb_init.c ============================================================================== --- head/sys/mips/nlm/usb_init.c Sat Nov 19 14:14:35 2011 (r227724) +++ head/sys/mips/nlm/usb_init.c Sat Nov 19 14:33:14 2011 (r227725) @@ -36,7 +36,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include From owner-svn-src-all@FreeBSD.ORG Sat Nov 19 14:42:06 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 88B83106564A; Sat, 19 Nov 2011 14:42:06 +0000 (UTC) (envelope-from miwi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 781208FC0C; Sat, 19 Nov 2011 14:42:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAJEg6D8047709; Sat, 19 Nov 2011 14:42:06 GMT (envelope-from miwi@svn.freebsd.org) Received: (from miwi@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAJEg6fx047707; Sat, 19 Nov 2011 14:42:06 GMT (envelope-from miwi@svn.freebsd.org) Message-Id: <201111191442.pAJEg6fx047707@svn.freebsd.org> From: Martin Wilke Date: Sat, 19 Nov 2011 14:42:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227726 - head/sys/boot/i386/loader X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Nov 2011 14:42:06 -0000 Author: miwi Date: Sat Nov 19 14:42:06 2011 New Revision: 227726 URL: http://svn.freebsd.org/changeset/base/227726 Log: - Whitespaces fixed only Approved by: rwatson (mentor) Modified: head/sys/boot/i386/loader/Makefile Modified: head/sys/boot/i386/loader/Makefile ============================================================================== --- head/sys/boot/i386/loader/Makefile Sat Nov 19 14:33:14 2011 (r227725) +++ head/sys/boot/i386/loader/Makefile Sat Nov 19 14:42:06 2011 (r227726) @@ -56,7 +56,7 @@ CFLAGS+= -DLOADER_GZIP_SUPPORT CFLAGS+= -DLOADER_GPT_SUPPORT .endif -# Always add MI sources +# Always add MI sources .PATH: ${.CURDIR}/../../common .include "${.CURDIR}/../../common/Makefile.inc" CFLAGS+= -I${.CURDIR}/../../common @@ -101,7 +101,7 @@ FILES= ${LOADER} FILESMODE_${LOADER}= ${BINMODE} -b .if !defined(LOADER_ONLY) -.PATH: ${.CURDIR}/../../forth +.PATH: ${.CURDIR}/../../forth FILES+= loader.help loader.4th support.4th loader.conf FILES+= screen.4th frames.4th beastie.4th FILES+= brand.4th check-password.4th color.4th delay.4th @@ -117,7 +117,7 @@ FILES+= menu.rc .endif # XXX crt0.o needs to be first for pxeboot(8) to work -OBJS= ${BTXCRT} +OBJS= ${BTXCRT} DPADD= ${LIBFICL} ${LIBFIREWIRE} ${LIBZFS} ${LIBI386} ${LIBSTAND} LDADD= ${LIBFICL} ${LIBFIREWIRE} ${LIBZFS} ${LIBI386} ${LIBSTAND} From owner-svn-src-all@FreeBSD.ORG Sat Nov 19 14:44:29 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EADC0106564A; Sat, 19 Nov 2011 14:44:29 +0000 (UTC) (envelope-from miwi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DA6368FC0A; Sat, 19 Nov 2011 14:44:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAJEiTf8047828; Sat, 19 Nov 2011 14:44:29 GMT (envelope-from miwi@svn.freebsd.org) Received: (from miwi@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAJEiT5q047826; Sat, 19 Nov 2011 14:44:29 GMT (envelope-from miwi@svn.freebsd.org) Message-Id: <201111191444.pAJEiT5q047826@svn.freebsd.org> From: Martin Wilke Date: Sat, 19 Nov 2011 14:44:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227727 - head/sys/boot/forth X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Nov 2011 14:44:30 -0000 Author: miwi Date: Sat Nov 19 14:44:29 2011 New Revision: 227727 URL: http://svn.freebsd.org/changeset/base/227727 Log: - Add new loader_logo orbbw to default.conf PR: 162608 Submitted by: manolis Approved by: rwatson (mentor) MFC after: 3 Days Modified: head/sys/boot/forth/loader.conf Modified: head/sys/boot/forth/loader.conf ============================================================================== --- head/sys/boot/forth/loader.conf Sat Nov 19 14:42:06 2011 (r227726) +++ head/sys/boot/forth/loader.conf Sat Nov 19 14:44:29 2011 (r227727) @@ -47,7 +47,7 @@ bitmap_type="splash_image_data" # and pl # escape to the loader prompt, set to # "NO" to disable autobooting #beastie_disable="NO" # Turn the beastie boot menu on and off -#loader_logo="fbsdbw" # Desired logo: fbsdbw, beastiebw, beastie, none +#loader_logo="orbbw" # Desired logo: orbbw, orb, fbsdbw, beastiebw, beastie, none #comconsole_speed="9600" # Set the current serial console speed #console="vidconsole" # A comma separated list of console(s) #currdev="disk1s1a" # Set the current device From owner-svn-src-all@FreeBSD.ORG Sat Nov 19 15:01:10 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2198B106566C; Sat, 19 Nov 2011 15:01:10 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EBAEC8FC08; Sat, 19 Nov 2011 15:01:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAJF19e4048422; Sat, 19 Nov 2011 15:01:09 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAJF19Mb048421; Sat, 19 Nov 2011 15:01:09 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201111191501.pAJF19Mb048421@svn.freebsd.org> From: "Jayachandran C." Date: Sat, 19 Nov 2011 15:01:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227728 - head/sys/mips/nlm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Nov 2011 15:01:10 -0000 Author: jchandra Date: Sat Nov 19 15:01:09 2011 New Revision: 227728 URL: http://svn.freebsd.org/changeset/base/227728 Log: Remvoe unused file mips/nlm/uart_cpu_xlp.c has replaced uart_bus_xlp_iodi.c Deleted: head/sys/mips/nlm/uart_bus_xlp_iodi.c From owner-svn-src-all@FreeBSD.ORG Sat Nov 19 15:08:49 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8884B1065672; Sat, 19 Nov 2011 15:08:49 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 77A5F8FC08; Sat, 19 Nov 2011 15:08:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAJF8n8N048676; Sat, 19 Nov 2011 15:08:49 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAJF8nXt048674; Sat, 19 Nov 2011 15:08:49 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201111191508.pAJF8nXt048674@svn.freebsd.org> From: "Jayachandran C." Date: Sat, 19 Nov 2011 15:08:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227729 - head/sys/mips/nlm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Nov 2011 15:08:49 -0000 Author: jchandra Date: Sat Nov 19 15:08:49 2011 New Revision: 227729 URL: http://svn.freebsd.org/changeset/base/227729 Log: Remove unused variable ubase. This vaiable is initialized but not used. Modified: head/sys/mips/nlm/uart_pci_xlp.c Modified: head/sys/mips/nlm/uart_pci_xlp.c ============================================================================== --- head/sys/mips/nlm/uart_pci_xlp.c Sat Nov 19 15:01:09 2011 (r227728) +++ head/sys/mips/nlm/uart_pci_xlp.c Sat Nov 19 15:08:49 2011 (r227729) @@ -69,13 +69,11 @@ static int uart_soc_probe(device_t dev) { struct uart_softc *sc; - uint64_t ubase; if (pci_get_vendor(dev) != PCI_VENDOR_NETLOGIC || pci_get_device(dev) != PCI_DEVICE_ID_NLM_UART) return (ENXIO); - ubase = nlm_get_uart_regbase(0, 0); sc = device_get_softc(dev); sc->sc_class = &uart_ns8250_class; device_set_desc(dev, "Netlogic SoC UART"); From owner-svn-src-all@FreeBSD.ORG Sat Nov 19 16:30:07 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 49006106566B; Sat, 19 Nov 2011 16:30:07 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 305B58FC08; Sat, 19 Nov 2011 16:30:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAJGU76q051280; Sat, 19 Nov 2011 16:30:07 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAJGU7E0051272; Sat, 19 Nov 2011 16:30:07 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201111191630.pAJGU7E0051272@svn.freebsd.org> From: Rafal Jaworowski Date: Sat, 19 Nov 2011 16:30:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227730 - in head/sys: arm/conf arm/mv boot/fdt/dts dev/cesa X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Nov 2011 16:30:07 -0000 Author: raj Date: Sat Nov 19 16:30:06 2011 New Revision: 227730 URL: http://svn.freebsd.org/changeset/base/227730 Log: Initial version of cesa(4) driver for Marvell crypto engine and security accelerator. The following algorithms and schemes are supported: - 3DES, AES, DES - MD5, SHA1 Obtained from: Semihalf Written by: Piotr Ziecik Added: head/sys/dev/cesa/ head/sys/dev/cesa/cesa.c (contents, props changed) head/sys/dev/cesa/cesa.h (contents, props changed) Modified: head/sys/arm/conf/DB-88F6XXX head/sys/arm/conf/SHEEVAPLUG head/sys/arm/mv/files.mv head/sys/boot/fdt/dts/db88f6281.dts head/sys/boot/fdt/dts/sheevaplug.dts Modified: head/sys/arm/conf/DB-88F6XXX ============================================================================== --- head/sys/arm/conf/DB-88F6XXX Sat Nov 19 15:08:49 2011 (r227729) +++ head/sys/arm/conf/DB-88F6XXX Sat Nov 19 16:30:06 2011 (r227730) @@ -66,6 +66,10 @@ device mii device e1000phy device bpf +device cesa # Marvell security engine +device crypto +device cryptodev + # USB options USB_DEBUG # enable debug msgs device usb Modified: head/sys/arm/conf/SHEEVAPLUG ============================================================================== --- head/sys/arm/conf/SHEEVAPLUG Sat Nov 19 15:08:49 2011 (r227729) +++ head/sys/arm/conf/SHEEVAPLUG Sat Nov 19 16:30:06 2011 (r227730) @@ -60,6 +60,10 @@ options HZ=1000 options DEVICE_POLLING device vlan +device cesa # Marvell security engine +device crypto +device cryptodev + # USB options USB_DEBUG # enable debug msgs device usb Modified: head/sys/arm/mv/files.mv ============================================================================== --- head/sys/arm/mv/files.mv Sat Nov 19 15:08:49 2011 (r227729) +++ head/sys/arm/mv/files.mv Sat Nov 19 16:30:06 2011 (r227730) @@ -28,6 +28,7 @@ arm/mv/mv_sata.c optional ata | atamvsa arm/mv/timer.c standard arm/mv/twsi.c optional iicbus +dev/cesa/cesa.c optional cesa dev/mge/if_mge.c optional mge dev/mvs/mvs_soc.c optional mvs dev/uart/uart_dev_ns8250.c optional uart Modified: head/sys/boot/fdt/dts/db88f6281.dts ============================================================================== --- head/sys/boot/fdt/dts/db88f6281.dts Sat Nov 19 15:08:49 2011 (r227729) +++ head/sys/boot/fdt/dts/db88f6281.dts Sat Nov 19 16:30:06 2011 (r227730) @@ -239,6 +239,8 @@ reg = <0x30000 0x10000>; interrupts = <22>; interrupt-parent = <&PIC>; + + sram-handle = <&SRAM>; }; usb@50000 { Modified: head/sys/boot/fdt/dts/sheevaplug.dts ============================================================================== --- head/sys/boot/fdt/dts/sheevaplug.dts Sat Nov 19 15:08:49 2011 (r227729) +++ head/sys/boot/fdt/dts/sheevaplug.dts Sat Nov 19 16:30:06 2011 (r227730) @@ -236,6 +236,8 @@ reg = <0x30000 0x10000>; interrupts = <22>; interrupt-parent = <&PIC>; + + sram-handle = <&SRAM>; }; usb@50000 { Added: head/sys/dev/cesa/cesa.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/cesa/cesa.c Sat Nov 19 16:30:06 2011 (r227730) @@ -0,0 +1,1614 @@ +/*- + * Copyright (C) 2009-2011 Semihalf. + * 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. + */ + +/* + * CESA SRAM Memory Map: + * + * +------------------------+ <= sc->sc_sram_base + CESA_SRAM_SIZE + * | | + * | DATA | + * | | + * +------------------------+ <= sc->sc_sram_base + CESA_DATA(0) + * | struct cesa_sa_data | + * +------------------------+ + * | struct cesa_sa_hdesc | + * +------------------------+ <= sc->sc_sram_base + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include "cryptodev_if.h" + +#include +#include +#include +#include "cesa.h" + +#undef DEBUG + +static int cesa_probe(device_t); +static int cesa_attach(device_t); +static int cesa_detach(device_t); +static void cesa_intr(void *); +static int cesa_newsession(device_t, u_int32_t *, struct cryptoini *); +static int cesa_freesession(device_t, u_int64_t); +static int cesa_process(device_t, struct cryptop *, int); + +static struct resource_spec cesa_res_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { SYS_RES_IRQ, 0, RF_ACTIVE | RF_SHAREABLE }, + { -1, 0 } +}; + +static device_method_t cesa_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, cesa_probe), + DEVMETHOD(device_attach, cesa_attach), + DEVMETHOD(device_detach, cesa_detach), + + /* Bus interface */ + DEVMETHOD(bus_print_child, bus_generic_print_child), + DEVMETHOD(bus_driver_added, bus_generic_driver_added), + + /* Crypto device methods */ + DEVMETHOD(cryptodev_newsession, cesa_newsession), + DEVMETHOD(cryptodev_freesession,cesa_freesession), + DEVMETHOD(cryptodev_process, cesa_process), + + { 0, 0 } +}; + +static driver_t cesa_driver = { + "cesa", + cesa_methods, + sizeof (struct cesa_softc) +}; +static devclass_t cesa_devclass; + +DRIVER_MODULE(cesa, simplebus, cesa_driver, cesa_devclass, 0, 0); +MODULE_DEPEND(cesa, crypto, 1, 1, 1); + +static void +cesa_dump_cshd(struct cesa_softc *sc, struct cesa_sa_hdesc *cshd) +{ +#ifdef DEBUG + device_t dev; + + dev = sc->sc_dev; + device_printf(dev, "CESA SA Hardware Descriptor:\n"); + device_printf(dev, "\t\tconfig: 0x%08X\n", cshd->cshd_config); + device_printf(dev, "\t\te_src: 0x%08X\n", cshd->cshd_enc_src); + device_printf(dev, "\t\te_dst: 0x%08X\n", cshd->cshd_enc_dst); + device_printf(dev, "\t\te_dlen: 0x%08X\n", cshd->cshd_enc_dlen); + device_printf(dev, "\t\te_key: 0x%08X\n", cshd->cshd_enc_key); + device_printf(dev, "\t\te_iv_1: 0x%08X\n", cshd->cshd_enc_iv); + device_printf(dev, "\t\te_iv_2: 0x%08X\n", cshd->cshd_enc_iv_buf); + device_printf(dev, "\t\tm_src: 0x%08X\n", cshd->cshd_mac_src); + device_printf(dev, "\t\tm_dst: 0x%08X\n", cshd->cshd_mac_dst); + device_printf(dev, "\t\tm_dlen: 0x%08X\n", cshd->cshd_mac_dlen); + device_printf(dev, "\t\tm_tlen: 0x%08X\n", cshd->cshd_mac_total_dlen); + device_printf(dev, "\t\tm_iv_i: 0x%08X\n", cshd->cshd_mac_iv_in); + device_printf(dev, "\t\tm_iv_o: 0x%08X\n", cshd->cshd_mac_iv_out); +#endif +} + +static void +cesa_alloc_dma_mem_cb(void *arg, bus_dma_segment_t *segs, int nseg, int error) +{ + struct cesa_dma_mem *cdm; + + if (error) + return; + + KASSERT(nseg == 1, ("Got wrong number of DMA segments, should be 1.")); + cdm = arg; + cdm->cdm_paddr = segs->ds_addr; +} + +static int +cesa_alloc_dma_mem(struct cesa_softc *sc, struct cesa_dma_mem *cdm, + bus_size_t size) +{ + int error; + + KASSERT(cdm->cdm_vaddr == NULL, + ("%s(): DMA memory descriptor in use.", __func__)); + + error = bus_dma_tag_create(NULL, /* parent */ + PAGE_SIZE, 0, /* alignment, boundary */ + BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filtfunc, filtfuncarg */ + size, 1, /* maxsize, nsegments */ + size, 0, /* maxsegsz, flags */ + NULL, NULL, /* lockfunc, lockfuncarg */ + &cdm->cdm_tag); /* dmat */ + if (error) { + device_printf(sc->sc_dev, "failed to allocate busdma tag, error" + " %i!\n", error); + + goto err1; + } + + error = bus_dmamem_alloc(cdm->cdm_tag, &cdm->cdm_vaddr, + BUS_DMA_NOWAIT | BUS_DMA_ZERO, &cdm->cdm_map); + if (error) { + device_printf(sc->sc_dev, "failed to allocate DMA safe" + " memory, error %i!\n", error); + + goto err2; + } + + error = bus_dmamap_load(cdm->cdm_tag, cdm->cdm_map, cdm->cdm_vaddr, + size, cesa_alloc_dma_mem_cb, cdm, BUS_DMA_NOWAIT); + if (error) { + device_printf(sc->sc_dev, "cannot get address of the DMA" + " memory, error %i\n", error); + + goto err3; + } + + return (0); +err3: + bus_dmamem_free(cdm->cdm_tag, cdm->cdm_vaddr, cdm->cdm_map); +err2: + bus_dma_tag_destroy(cdm->cdm_tag); +err1: + cdm->cdm_vaddr = NULL; + return (error); +} + +static void +cesa_free_dma_mem(struct cesa_dma_mem *cdm) +{ + + bus_dmamap_unload(cdm->cdm_tag, cdm->cdm_map); + bus_dmamem_free(cdm->cdm_tag, cdm->cdm_vaddr, cdm->cdm_map); + bus_dma_tag_destroy(cdm->cdm_tag); + cdm->cdm_vaddr = NULL; +} + +static void +cesa_sync_dma_mem(struct cesa_dma_mem *cdm, bus_dmasync_op_t op) +{ + + /* Sync only if dma memory is valid */ + if (cdm->cdm_vaddr != NULL) + bus_dmamap_sync(cdm->cdm_tag, cdm->cdm_map, op); +} + +static void +cesa_sync_desc(struct cesa_softc *sc, bus_dmasync_op_t op) +{ + + cesa_sync_dma_mem(&sc->sc_tdesc_cdm, op); + cesa_sync_dma_mem(&sc->sc_sdesc_cdm, op); + cesa_sync_dma_mem(&sc->sc_requests_cdm, op); +} + +static struct cesa_session * +cesa_alloc_session(struct cesa_softc *sc) +{ + struct cesa_session *cs; + + CESA_GENERIC_ALLOC_LOCKED(sc, cs, sessions); + + return (cs); +} + +static struct cesa_session * +cesa_get_session(struct cesa_softc *sc, uint32_t sid) +{ + + if (sid >= CESA_SESSIONS) + return (NULL); + + return (&sc->sc_sessions[sid]); +} + +static void +cesa_free_session(struct cesa_softc *sc, struct cesa_session *cs) +{ + + CESA_GENERIC_FREE_LOCKED(sc, cs, sessions); +} + +static struct cesa_request * +cesa_alloc_request(struct cesa_softc *sc) +{ + struct cesa_request *cr; + + CESA_GENERIC_ALLOC_LOCKED(sc, cr, requests); + if (!cr) + return (NULL); + + STAILQ_INIT(&cr->cr_tdesc); + STAILQ_INIT(&cr->cr_sdesc); + + return (cr); +} + +static void +cesa_free_request(struct cesa_softc *sc, struct cesa_request *cr) +{ + + /* Free TDMA descriptors assigned to this request */ + CESA_LOCK(sc, tdesc); + STAILQ_CONCAT(&sc->sc_free_tdesc, &cr->cr_tdesc); + CESA_UNLOCK(sc, tdesc); + + /* Free SA descriptors assigned to this request */ + CESA_LOCK(sc, sdesc); + STAILQ_CONCAT(&sc->sc_free_sdesc, &cr->cr_sdesc); + CESA_UNLOCK(sc, sdesc); + + /* Unload DMA memory asociated with request */ + if (cr->cr_dmap_loaded) { + bus_dmamap_unload(sc->sc_data_dtag, cr->cr_dmap); + cr->cr_dmap_loaded = 0; + } + + CESA_GENERIC_FREE_LOCKED(sc, cr, requests); +} + +static void +cesa_enqueue_request(struct cesa_softc *sc, struct cesa_request *cr) +{ + + CESA_LOCK(sc, requests); + STAILQ_INSERT_TAIL(&sc->sc_ready_requests, cr, cr_stq); + CESA_UNLOCK(sc, requests); +} + +static struct cesa_tdma_desc * +cesa_alloc_tdesc(struct cesa_softc *sc) +{ + struct cesa_tdma_desc *ctd; + + CESA_GENERIC_ALLOC_LOCKED(sc, ctd, tdesc); + + if (!ctd) + device_printf(sc->sc_dev, "TDMA descriptors pool exhaused. " + "Consider increasing CESA_TDMA_DESCRIPTORS.\n"); + + return (ctd); +} + +static struct cesa_sa_desc * +cesa_alloc_sdesc(struct cesa_softc *sc, struct cesa_request *cr) +{ + struct cesa_sa_desc *csd; + + CESA_GENERIC_ALLOC_LOCKED(sc, csd, sdesc); + if (!csd) { + device_printf(sc->sc_dev, "SA descriptors pool exhaused. " + "Consider increasing CESA_SA_DESCRIPTORS.\n"); + return (NULL); + } + + STAILQ_INSERT_TAIL(&cr->cr_sdesc, csd, csd_stq); + + /* Fill-in SA descriptor with default values */ + csd->csd_cshd->cshd_enc_key = CESA_SA_DATA(csd_key); + csd->csd_cshd->cshd_enc_iv = CESA_SA_DATA(csd_iv); + csd->csd_cshd->cshd_enc_iv_buf = CESA_SA_DATA(csd_iv); + csd->csd_cshd->cshd_enc_src = 0; + csd->csd_cshd->cshd_enc_dst = 0; + csd->csd_cshd->cshd_enc_dlen = 0; + csd->csd_cshd->cshd_mac_dst = CESA_SA_DATA(csd_hash); + csd->csd_cshd->cshd_mac_iv_in = CESA_SA_DATA(csd_hiv_in); + csd->csd_cshd->cshd_mac_iv_out = CESA_SA_DATA(csd_hiv_out); + csd->csd_cshd->cshd_mac_src = 0; + csd->csd_cshd->cshd_mac_dlen = 0; + + return (csd); +} + +static struct cesa_tdma_desc * +cesa_tdma_copy(struct cesa_softc *sc, bus_addr_t dst, bus_addr_t src, + bus_size_t size) +{ + struct cesa_tdma_desc *ctd; + + ctd = cesa_alloc_tdesc(sc); + if (!ctd) + return (NULL); + + ctd->ctd_cthd->cthd_dst = dst; + ctd->ctd_cthd->cthd_src = src; + ctd->ctd_cthd->cthd_byte_count = size; + + /* Handle special control packet */ + if (size != 0) + ctd->ctd_cthd->cthd_flags = CESA_CTHD_OWNED; + else + ctd->ctd_cthd->cthd_flags = 0; + + return (ctd); +} + +static struct cesa_tdma_desc * +cesa_tdma_copyin_sa_data(struct cesa_softc *sc, struct cesa_request *cr) +{ + + return (cesa_tdma_copy(sc, sc->sc_sram_base + + sizeof(struct cesa_sa_hdesc), cr->cr_csd_paddr, + sizeof(struct cesa_sa_data))); +} + +static struct cesa_tdma_desc * +cesa_tdma_copyout_sa_data(struct cesa_softc *sc, struct cesa_request *cr) +{ + + return (cesa_tdma_copy(sc, cr->cr_csd_paddr, sc->sc_sram_base + + sizeof(struct cesa_sa_hdesc), sizeof(struct cesa_sa_data))); +} + +static struct cesa_tdma_desc * +cesa_tdma_copy_sdesc(struct cesa_softc *sc, struct cesa_sa_desc *csd) +{ + + return (cesa_tdma_copy(sc, sc->sc_sram_base, csd->csd_cshd_paddr, + sizeof(struct cesa_sa_hdesc))); +} + +static void +cesa_append_tdesc(struct cesa_request *cr, struct cesa_tdma_desc *ctd) +{ + struct cesa_tdma_desc *ctd_prev; + + if (!STAILQ_EMPTY(&cr->cr_tdesc)) { + ctd_prev = STAILQ_LAST(&cr->cr_tdesc, cesa_tdma_desc, ctd_stq); + ctd_prev->ctd_cthd->cthd_next = ctd->ctd_cthd_paddr; + } + + ctd->ctd_cthd->cthd_next = 0; + STAILQ_INSERT_TAIL(&cr->cr_tdesc, ctd, ctd_stq); +} + +static int +cesa_append_packet(struct cesa_softc *sc, struct cesa_request *cr, + struct cesa_packet *cp, struct cesa_sa_desc *csd) +{ + struct cesa_tdma_desc *ctd, *tmp; + + /* Copy SA descriptor for this packet */ + ctd = cesa_tdma_copy_sdesc(sc, csd); + if (!ctd) + return (ENOMEM); + + cesa_append_tdesc(cr, ctd); + + /* Copy data to be processed */ + STAILQ_FOREACH_SAFE(ctd, &cp->cp_copyin, ctd_stq, tmp) + cesa_append_tdesc(cr, ctd); + STAILQ_INIT(&cp->cp_copyin); + + /* Insert control descriptor */ + ctd = cesa_tdma_copy(sc, 0, 0, 0); + if (!ctd) + return (ENOMEM); + + cesa_append_tdesc(cr, ctd); + + /* Copy back results */ + STAILQ_FOREACH_SAFE(ctd, &cp->cp_copyout, ctd_stq, tmp) + cesa_append_tdesc(cr, ctd); + STAILQ_INIT(&cp->cp_copyout); + + return (0); +} + +static int +cesa_set_mkey(struct cesa_session *cs, int alg, const uint8_t *mkey, int mklen) +{ + uint8_t ipad[CESA_MAX_HMAC_BLOCK_LEN]; + uint8_t opad[CESA_MAX_HMAC_BLOCK_LEN]; + SHA1_CTX sha1ctx; + MD5_CTX md5ctx; + uint32_t *hout; + uint32_t *hin; + int i; + + memset(ipad, HMAC_IPAD_VAL, CESA_MAX_HMAC_BLOCK_LEN); + memset(opad, HMAC_OPAD_VAL, CESA_MAX_HMAC_BLOCK_LEN); + for (i = 0; i < mklen; i++) { + ipad[i] ^= mkey[i]; + opad[i] ^= mkey[i]; + } + + hin = (uint32_t *)cs->cs_hiv_in; + hout = (uint32_t *)cs->cs_hiv_out; + + switch (alg) { + case CRYPTO_MD5_HMAC: + MD5Init(&md5ctx); + MD5Update(&md5ctx, ipad, MD5_HMAC_BLOCK_LEN); + memcpy(hin, md5ctx.state, sizeof(md5ctx.state)); + MD5Init(&md5ctx); + MD5Update(&md5ctx, opad, MD5_HMAC_BLOCK_LEN); + memcpy(hout, md5ctx.state, sizeof(md5ctx.state)); + break; + case CRYPTO_SHA1_HMAC: + SHA1Init(&sha1ctx); + SHA1Update(&sha1ctx, ipad, SHA1_HMAC_BLOCK_LEN); + memcpy(hin, sha1ctx.h.b32, sizeof(sha1ctx.h.b32)); + SHA1Init(&sha1ctx); + SHA1Update(&sha1ctx, opad, SHA1_HMAC_BLOCK_LEN); + memcpy(hout, sha1ctx.h.b32, sizeof(sha1ctx.h.b32)); + break; + default: + return (EINVAL); + } + + for (i = 0; i < CESA_MAX_HASH_LEN / sizeof(uint32_t); i++) { + hin[i] = htobe32(hin[i]); + hout[i] = htobe32(hout[i]); + } + + return (0); +} + +static int +cesa_prep_aes_key(struct cesa_session *cs) +{ + uint32_t ek[4 * (RIJNDAEL_MAXNR + 1)]; + uint32_t *dkey; + int i; + + rijndaelKeySetupEnc(ek, cs->cs_key, cs->cs_klen * 8); + + cs->cs_config &= ~CESA_CSH_AES_KLEN_MASK; + dkey = (uint32_t *)cs->cs_aes_dkey; + + switch (cs->cs_klen) { + case 16: + cs->cs_config |= CESA_CSH_AES_KLEN_128; + for (i = 0; i < 4; i++) + *dkey++ = htobe32(ek[4 * 10 + i]); + break; + case 24: + cs->cs_config |= CESA_CSH_AES_KLEN_192; + for (i = 0; i < 4; i++) + *dkey++ = htobe32(ek[4 * 12 + i]); + for (i = 0; i < 2; i++) + *dkey++ = htobe32(ek[4 * 11 + 2 + i]); + break; + case 32: + cs->cs_config |= CESA_CSH_AES_KLEN_256; + for (i = 0; i < 4; i++) + *dkey++ = htobe32(ek[4 * 14 + i]); + for (i = 0; i < 4; i++) + *dkey++ = htobe32(ek[4 * 13 + i]); + break; + default: + return (EINVAL); + } + + return (0); +} + +static int +cesa_is_hash(int alg) +{ + + switch (alg) { + case CRYPTO_MD5: + case CRYPTO_MD5_HMAC: + case CRYPTO_SHA1: + case CRYPTO_SHA1_HMAC: + return (1); + default: + return (0); + } +} + +static void +cesa_start_packet(struct cesa_packet *cp, unsigned int size) +{ + + cp->cp_size = size; + cp->cp_offset = 0; + STAILQ_INIT(&cp->cp_copyin); + STAILQ_INIT(&cp->cp_copyout); +} + +static int +cesa_fill_packet(struct cesa_softc *sc, struct cesa_packet *cp, + bus_dma_segment_t *seg) +{ + struct cesa_tdma_desc *ctd; + unsigned int bsize; + + /* Calculate size of block copy */ + bsize = MIN(seg->ds_len, cp->cp_size - cp->cp_offset); + + if (bsize > 0) { + ctd = cesa_tdma_copy(sc, sc->sc_sram_base + + CESA_DATA(cp->cp_offset), seg->ds_addr, bsize); + if (!ctd) + return (-ENOMEM); + + STAILQ_INSERT_TAIL(&cp->cp_copyin, ctd, ctd_stq); + + ctd = cesa_tdma_copy(sc, seg->ds_addr, sc->sc_sram_base + + CESA_DATA(cp->cp_offset), bsize); + if (!ctd) + return (-ENOMEM); + + STAILQ_INSERT_TAIL(&cp->cp_copyout, ctd, ctd_stq); + + seg->ds_len -= bsize; + seg->ds_addr += bsize; + cp->cp_offset += bsize; + } + + return (bsize); +} + +static void +cesa_create_chain_cb(void *arg, bus_dma_segment_t *segs, int nseg, int error) +{ + unsigned int mpsize, fragmented; + unsigned int mlen, mskip, tmlen; + struct cesa_chain_info *cci; + unsigned int elen, eskip; + unsigned int skip, len; + struct cesa_sa_desc *csd; + struct cesa_request *cr; + struct cesa_softc *sc; + struct cesa_packet cp; + bus_dma_segment_t seg; + uint32_t config; + int size; + + cci = arg; + sc = cci->cci_sc; + cr = cci->cci_cr; + + if (error) { + cci->cci_error = error; + return; + } + + elen = cci->cci_enc ? cci->cci_enc->crd_len : 0; + eskip = cci->cci_enc ? cci->cci_enc->crd_skip : 0; + mlen = cci->cci_mac ? cci->cci_mac->crd_len : 0; + mskip = cci->cci_mac ? cci->cci_mac->crd_skip : 0; + + if (elen && mlen && + ((eskip > mskip && ((eskip - mskip) & (cr->cr_cs->cs_ivlen - 1))) || + (mskip > eskip && ((mskip - eskip) & (cr->cr_cs->cs_mblen - 1))) || + (eskip > (mskip + mlen)) || (mskip > (eskip + elen)))) { + /* + * Data alignment in the request does not meet CESA requiremnts + * for combined encryption/decryption and hashing. We have to + * split the request to separate operations and process them + * one by one. + */ + config = cci->cci_config; + if ((config & CESA_CSHD_OP_MASK) == CESA_CSHD_MAC_AND_ENC) { + config &= ~CESA_CSHD_OP_MASK; + + cci->cci_config = config | CESA_CSHD_MAC; + cci->cci_enc = NULL; + cci->cci_mac = cr->cr_mac; + cesa_create_chain_cb(cci, segs, nseg, cci->cci_error); + + cci->cci_config = config | CESA_CSHD_ENC; + cci->cci_enc = cr->cr_enc; + cci->cci_mac = NULL; + cesa_create_chain_cb(cci, segs, nseg, cci->cci_error); + } else { + config &= ~CESA_CSHD_OP_MASK; + + cci->cci_config = config | CESA_CSHD_ENC; + cci->cci_enc = cr->cr_enc; + cci->cci_mac = NULL; + cesa_create_chain_cb(cci, segs, nseg, cci->cci_error); + + cci->cci_config = config | CESA_CSHD_MAC; + cci->cci_enc = NULL; + cci->cci_mac = cr->cr_mac; + cesa_create_chain_cb(cci, segs, nseg, cci->cci_error); + } + + return; + } + + tmlen = mlen; + fragmented = 0; + mpsize = CESA_MAX_PACKET_SIZE; + mpsize &= ~((cr->cr_cs->cs_ivlen - 1) | (cr->cr_cs->cs_mblen - 1)); + + if (elen && mlen) { + skip = MIN(eskip, mskip); + len = MAX(elen + eskip, mlen + mskip) - skip; + } else if (elen) { + skip = eskip; + len = elen; + } else { + skip = mskip; + len = mlen; + } + + /* Start first packet in chain */ + cesa_start_packet(&cp, MIN(mpsize, len)); + + while (nseg-- && len > 0) { + seg = *(segs++); + + /* + * Skip data in buffer on which neither ENC nor MAC operation + * is requested. + */ + if (skip > 0) { + size = MIN(skip, seg.ds_len); + skip -= size; + + seg.ds_addr += size; + seg.ds_len -= size; + + if (eskip > 0) + eskip -= size; + + if (mskip > 0) + mskip -= size; + + if (seg.ds_len == 0) + continue; + } + + while (1) { + /* + * Fill in current packet with data. Break if there is + * no more data in current DMA segment or an error + * occured. + */ + size = cesa_fill_packet(sc, &cp, &seg); + if (size <= 0) { + error = -size; + break; + } + + len -= size; + + /* If packet is full, append it to the chain */ + if (cp.cp_size == cp.cp_offset) { + csd = cesa_alloc_sdesc(sc, cr); + if (!csd) { + error = ENOMEM; + break; + } + + /* Create SA descriptor for this packet */ + csd->csd_cshd->cshd_config = cci->cci_config; + csd->csd_cshd->cshd_mac_total_dlen = tmlen; + + /* + * Enable fragmentation if request will not fit + * into one packet. + */ + if (len > 0) { + if (!fragmented) { + fragmented = 1; + csd->csd_cshd->cshd_config |= + CESA_CSHD_FRAG_FIRST; + } else + csd->csd_cshd->cshd_config |= + CESA_CSHD_FRAG_MIDDLE; + } else if (fragmented) + csd->csd_cshd->cshd_config |= + CESA_CSHD_FRAG_LAST; + + if (eskip < cp.cp_size && elen > 0) { + csd->csd_cshd->cshd_enc_src = + CESA_DATA(eskip); + csd->csd_cshd->cshd_enc_dst = + CESA_DATA(eskip); + csd->csd_cshd->cshd_enc_dlen = + MIN(elen, cp.cp_size - eskip); + } + + if (mskip < cp.cp_size && mlen > 0) { + csd->csd_cshd->cshd_mac_src = + CESA_DATA(mskip); + csd->csd_cshd->cshd_mac_dlen = + MIN(mlen, cp.cp_size - mskip); + } + + elen -= csd->csd_cshd->cshd_enc_dlen; + eskip -= MIN(eskip, cp.cp_size); + mlen -= csd->csd_cshd->cshd_mac_dlen; + mskip -= MIN(mskip, cp.cp_size); + + cesa_dump_cshd(sc, csd->csd_cshd); + + /* Append packet to the request */ + error = cesa_append_packet(sc, cr, &cp, csd); + if (error) + break; + + /* Start a new packet, as current is full */ + cesa_start_packet(&cp, MIN(mpsize, len)); + } + } + + if (error) + break; + } + + if (error) { + /* + * Move all allocated resources to the request. They will be + * freed later. + */ + STAILQ_CONCAT(&cr->cr_tdesc, &cp.cp_copyin); + STAILQ_CONCAT(&cr->cr_tdesc, &cp.cp_copyout); + cci->cci_error = error; + } +} + +static void +cesa_create_chain_cb2(void *arg, bus_dma_segment_t *segs, int nseg, + bus_size_t size, int error) +{ + + cesa_create_chain_cb(arg, segs, nseg, error); +} + +static int +cesa_create_chain(struct cesa_softc *sc, struct cesa_request *cr) +{ + struct cesa_chain_info cci; + struct cesa_tdma_desc *ctd; + uint32_t config; + int error; + + error = 0; + CESA_LOCK_ASSERT(sc, sessions); + + /* Create request metadata */ + if (cr->cr_enc) { + if (cr->cr_enc->crd_alg == CRYPTO_AES_CBC && + (cr->cr_enc->crd_flags & CRD_F_ENCRYPT) == 0) + memcpy(cr->cr_csd->csd_key, cr->cr_cs->cs_aes_dkey, + cr->cr_cs->cs_klen); + else + memcpy(cr->cr_csd->csd_key, cr->cr_cs->cs_key, + cr->cr_cs->cs_klen); + } + + if (cr->cr_mac) { + memcpy(cr->cr_csd->csd_hiv_in, cr->cr_cs->cs_hiv_in, + CESA_MAX_HASH_LEN); + memcpy(cr->cr_csd->csd_hiv_out, cr->cr_cs->cs_hiv_out, + CESA_MAX_HASH_LEN); + } + + ctd = cesa_tdma_copyin_sa_data(sc, cr); + if (!ctd) + return (ENOMEM); + + cesa_append_tdesc(cr, ctd); + + /* Prepare SA configuration */ + config = cr->cr_cs->cs_config; + + if (cr->cr_enc && (cr->cr_enc->crd_flags & CRD_F_ENCRYPT) == 0) + config |= CESA_CSHD_DECRYPT; + if (cr->cr_enc && !cr->cr_mac) + config |= CESA_CSHD_ENC; + if (!cr->cr_enc && cr->cr_mac) + config |= CESA_CSHD_MAC; + if (cr->cr_enc && cr->cr_mac) + config |= (config & CESA_CSHD_DECRYPT) ? CESA_CSHD_MAC_AND_ENC : + CESA_CSHD_ENC_AND_MAC; + + /* Create data packets */ + cci.cci_sc = sc; + cci.cci_cr = cr; + cci.cci_enc = cr->cr_enc; + cci.cci_mac = cr->cr_mac; + cci.cci_config = config; + cci.cci_error = 0; + + if (cr->cr_crp->crp_flags & CRYPTO_F_IOV) + error = bus_dmamap_load_uio(sc->sc_data_dtag, + cr->cr_dmap, (struct uio *)cr->cr_crp->crp_buf, + cesa_create_chain_cb2, &cci, BUS_DMA_NOWAIT); + else if (cr->cr_crp->crp_flags & CRYPTO_F_IMBUF) + error = bus_dmamap_load_mbuf(sc->sc_data_dtag, + cr->cr_dmap, (struct mbuf *)cr->cr_crp->crp_buf, + cesa_create_chain_cb2, &cci, BUS_DMA_NOWAIT); + else + error = bus_dmamap_load(sc->sc_data_dtag, + cr->cr_dmap, cr->cr_crp->crp_buf, + cr->cr_crp->crp_ilen, cesa_create_chain_cb, &cci, + BUS_DMA_NOWAIT); + + if (!error) + cr->cr_dmap_loaded = 1; + + if (cci.cci_error) + error = cci.cci_error; + + if (error) + return (error); + + /* Read back request metadata */ + ctd = cesa_tdma_copyout_sa_data(sc, cr); + if (!ctd) + return (ENOMEM); + + cesa_append_tdesc(cr, ctd); + + return (0); +} + +static void +cesa_execute(struct cesa_softc *sc) +{ + struct cesa_tdma_desc *prev_ctd, *ctd; + struct cesa_request *prev_cr, *cr; + + CESA_LOCK(sc, requests); + + /* + * If ready list is empty, there is nothing to execute. If queued list + * is not empty, the hardware is busy and we cannot start another + * execution. + */ + if (STAILQ_EMPTY(&sc->sc_ready_requests) || + !STAILQ_EMPTY(&sc->sc_queued_requests)) { + CESA_UNLOCK(sc, requests); + return; + } + + /* Move all ready requests to queued list */ + STAILQ_CONCAT(&sc->sc_queued_requests, &sc->sc_ready_requests); + STAILQ_INIT(&sc->sc_ready_requests); + + /* Create one execution chain from all requests on the list */ + if (STAILQ_FIRST(&sc->sc_queued_requests) != + STAILQ_LAST(&sc->sc_queued_requests, cesa_request, cr_stq)) { + prev_cr = NULL; + cesa_sync_dma_mem(&sc->sc_tdesc_cdm, BUS_DMASYNC_POSTREAD | + BUS_DMASYNC_POSTWRITE); + + STAILQ_FOREACH(cr, &sc->sc_queued_requests, cr_stq) { + if (prev_cr) { + ctd = STAILQ_FIRST(&cr->cr_tdesc); + prev_ctd = STAILQ_LAST(&prev_cr->cr_tdesc, + cesa_tdma_desc, ctd_stq); + + prev_ctd->ctd_cthd->cthd_next = + ctd->ctd_cthd_paddr; + } + + prev_cr = cr; + } + + cesa_sync_dma_mem(&sc->sc_tdesc_cdm, BUS_DMASYNC_PREREAD | *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Nov 19 16:47:26 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EEB2C1065672; Sat, 19 Nov 2011 16:47:26 +0000 (UTC) (envelope-from scheidell@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DDAE68FC19; Sat, 19 Nov 2011 16:47:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAJGlQcQ051848; Sat, 19 Nov 2011 16:47:26 GMT (envelope-from scheidell@svn.freebsd.org) Received: (from scheidell@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAJGlQ14051846; Sat, 19 Nov 2011 16:47:26 GMT (envelope-from scheidell@svn.freebsd.org) Message-Id: <201111191647.pAJGlQ14051846@svn.freebsd.org> From: Michael Scheidell Date: Sat, 19 Nov 2011 16:47:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227731 - head/share/misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Nov 2011 16:47:27 -0000 Author: scheidell (ports committer) Date: Sat Nov 19 16:47:26 2011 New Revision: 227731 URL: http://svn.freebsd.org/changeset/base/227731 Log: - Add myself Approved by: gabor(mentor) Modified: head/share/misc/committers-ports.dot Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Sat Nov 19 16:30:06 2011 (r227730) +++ head/share/misc/committers-ports.dot Sat Nov 19 16:47:26 2011 (r227731) @@ -162,6 +162,7 @@ romain [label="Romain Tartiere\nromain@F sahil [label="Sahil Tandon\nsahil@FreeBSD.org\n2010/04/11"] sat [label="Andrew Pantyukhin\nsat@FreeBSD.org\n2006/05/06"] sbz [label="Sofian Brabez\nsbz@FreeBSD.org\n2011/03/14"] +scheidell [label="Michael Scheidell\nscheidell@FreeBSD.org\n2011/11/06"] sem [label="Sergey Matveychuk\nsem@FreeBSD.org\n2004/07/07"] sergei [label="Sergei Kolobov\nsergei@FreeBSD.org\n2003/10/21"] shaun [label="Shaun Amott\nshaun@FreeBSD.org\n2006/06/19"] @@ -269,6 +270,7 @@ flz -> romain gabor -> lippe gabor -> pgj gabor -> stephen +gabor -> scheidell garga -> acm garga -> alepulver From owner-svn-src-all@FreeBSD.ORG Sat Nov 19 16:54:58 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9538C106566C; Sat, 19 Nov 2011 16:54:58 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 69A828FC1A; Sat, 19 Nov 2011 16:54:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAJGswda052114; Sat, 19 Nov 2011 16:54:58 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAJGswSY052112; Sat, 19 Nov 2011 16:54:58 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201111191654.pAJGswSY052112@svn.freebsd.org> From: Christian Brueffer Date: Sat, 19 Nov 2011 16:54:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227732 - stable/9/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Nov 2011 16:54:58 -0000 Author: brueffer Date: Sat Nov 19 16:54:58 2011 New Revision: 227732 URL: http://svn.freebsd.org/changeset/base/227732 Log: MFC: r227465, r227515 - Grammar and mdoc cleanup. - Remove list nesting in the hardware notes section, thus making it compatible with the hardware notes generation script. Approved by: re (kib) Modified: stable/9/share/man/man4/mvs.4 Directory Properties: stable/9/share/man/man4/ (props changed) Modified: stable/9/share/man/man4/mvs.4 ============================================================================== --- stable/9/share/man/man4/mvs.4 Sat Nov 19 16:47:26 2011 (r227731) +++ stable/9/share/man/man4/mvs.4 Sat Nov 19 16:54:58 2011 (r227732) @@ -109,7 +109,8 @@ hardware command queues (up to 31 comman Native Command Queuing, SATA interface Power Management, device hot-plug and Message Signaled Interrupts. .Pp -Same hardware is also supported by atamarvell and ataadaptec drivers from +The same hardware is also supported by the atamarvell and ataadaptec +drivers from the .Xr ata 4 subsystem. If both drivers are loaded at the same time, this one will be @@ -118,9 +119,9 @@ given precedence as the more functional The .Nm driver supports the following controllers: -.Bl -tag -compact -.It Gen-I (SATA 1.5Gbps): -.Bl -bullet -compact +.Pp +Gen-I (SATA 1.5Gbps): +.Bl -bullet -compact -offset "xxxxxx" .It 88SX5040 .It @@ -130,8 +131,9 @@ driver supports the following controller .It 88SX5081 .El -.It Gen-II (SATA 3Gbps, NCQ, PMP): -.Bl -bullet -compact +.Pp +Gen-II (SATA 3Gbps, NCQ, PMP): +.Bl -bullet -compact -offset "xxxxxx" .It 88SX6040 .It @@ -141,8 +143,9 @@ driver supports the following controller .It 88SX6081 .El -.It Gen-IIe (SATA 3Gbps, NCQ, PMP with FBS): -.Bl -bullet -compact +.Pp +Gen-IIe (SATA 3Gbps, NCQ, PMP with FBS): +.Bl -bullet -compact -offset "xxxxxx" .It 88SX6042 .It @@ -154,11 +157,10 @@ driver supports the following controller .It MV78100 SoC .El -.El -Note, that this hardware supports command queueing and FIS-based switching -only for ATA DMA commands. ATAPI and non-DMA ATA commands executed one by one -for each port. .Pp +Note, that this hardware supports command queueing and FIS-based switching +only for ATA DMA commands. +ATAPI and non-DMA ATA commands executed one by one for each port. .Sh SEE ALSO .Xr ada 4 , .Xr ata 4 , @@ -172,4 +174,4 @@ The driver first appeared in .Fx 8.1 . .Sh AUTHORS -.An Alexander Motin Aq mav@FreeBSD.org . +.An Alexander Motin Aq mav@FreeBSD.org From owner-svn-src-all@FreeBSD.ORG Sat Nov 19 16:59:24 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 098BD106566B; Sat, 19 Nov 2011 16:59:24 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D2AAA8FC16; Sat, 19 Nov 2011 16:59:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAJGxNGg052303; Sat, 19 Nov 2011 16:59:23 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAJGxNK2052301; Sat, 19 Nov 2011 16:59:23 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201111191659.pAJGxNK2052301@svn.freebsd.org> From: Christian Brueffer Date: Sat, 19 Nov 2011 16:59:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227733 - releng/9.0/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Nov 2011 16:59:24 -0000 Author: brueffer Date: Sat Nov 19 16:59:23 2011 New Revision: 227733 URL: http://svn.freebsd.org/changeset/base/227733 Log: MFC: r227465, r227515 - Grammar and mdoc cleanup. - Remove list nesting in the hardware notes section, thus making it compatible with the hardware notes generation script. Approved by: re (kib) Modified: releng/9.0/share/man/man4/mvs.4 Directory Properties: releng/9.0/share/man/man4/ (props changed) Modified: releng/9.0/share/man/man4/mvs.4 ============================================================================== --- releng/9.0/share/man/man4/mvs.4 Sat Nov 19 16:54:58 2011 (r227732) +++ releng/9.0/share/man/man4/mvs.4 Sat Nov 19 16:59:23 2011 (r227733) @@ -109,7 +109,8 @@ hardware command queues (up to 31 comman Native Command Queuing, SATA interface Power Management, device hot-plug and Message Signaled Interrupts. .Pp -Same hardware is also supported by atamarvell and ataadaptec drivers from +The same hardware is also supported by the atamarvell and ataadaptec +drivers from the .Xr ata 4 subsystem. If both drivers are loaded at the same time, this one will be @@ -118,9 +119,9 @@ given precedence as the more functional The .Nm driver supports the following controllers: -.Bl -tag -compact -.It Gen-I (SATA 1.5Gbps): -.Bl -bullet -compact +.Pp +Gen-I (SATA 1.5Gbps): +.Bl -bullet -compact -offset "xxxxxx" .It 88SX5040 .It @@ -130,8 +131,9 @@ driver supports the following controller .It 88SX5081 .El -.It Gen-II (SATA 3Gbps, NCQ, PMP): -.Bl -bullet -compact +.Pp +Gen-II (SATA 3Gbps, NCQ, PMP): +.Bl -bullet -compact -offset "xxxxxx" .It 88SX6040 .It @@ -141,8 +143,9 @@ driver supports the following controller .It 88SX6081 .El -.It Gen-IIe (SATA 3Gbps, NCQ, PMP with FBS): -.Bl -bullet -compact +.Pp +Gen-IIe (SATA 3Gbps, NCQ, PMP with FBS): +.Bl -bullet -compact -offset "xxxxxx" .It 88SX6042 .It @@ -154,11 +157,10 @@ driver supports the following controller .It MV78100 SoC .El -.El -Note, that this hardware supports command queueing and FIS-based switching -only for ATA DMA commands. ATAPI and non-DMA ATA commands executed one by one -for each port. .Pp +Note, that this hardware supports command queueing and FIS-based switching +only for ATA DMA commands. +ATAPI and non-DMA ATA commands executed one by one for each port. .Sh SEE ALSO .Xr ada 4 , .Xr ata 4 , @@ -172,4 +174,4 @@ The driver first appeared in .Fx 8.1 . .Sh AUTHORS -.An Alexander Motin Aq mav@FreeBSD.org . +.An Alexander Motin Aq mav@FreeBSD.org From owner-svn-src-all@FreeBSD.ORG Sat Nov 19 17:01:12 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6DAB5106568B; Sat, 19 Nov 2011 17:01:12 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 41F0C8FC18; Sat, 19 Nov 2011 17:01:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAJH1CS2052443; Sat, 19 Nov 2011 17:01:12 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAJH1Cek052441; Sat, 19 Nov 2011 17:01:12 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201111191701.pAJH1Cek052441@svn.freebsd.org> From: Christian Brueffer Date: Sat, 19 Nov 2011 17:01:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227734 - stable/8/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Nov 2011 17:01:12 -0000 Author: brueffer Date: Sat Nov 19 17:01:11 2011 New Revision: 227734 URL: http://svn.freebsd.org/changeset/base/227734 Log: MFC: r227465, r227515 - Grammar and mdoc cleanup. - Remove list nesting in the hardware notes section, thus making it compatible with the hardware notes generation script. Modified: stable/8/share/man/man4/mvs.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/mvs.4 ============================================================================== --- stable/8/share/man/man4/mvs.4 Sat Nov 19 16:59:23 2011 (r227733) +++ stable/8/share/man/man4/mvs.4 Sat Nov 19 17:01:11 2011 (r227734) @@ -110,7 +110,8 @@ hardware command queues (up to 31 comman Native Command Queuing, SATA interface Power Management, device hot-plug and Message Signaled Interrupts. .Pp -Same hardware is also supported by atamarvell and ataadaptec drivers from +The same hardware is also supported by the atamarvell and ataadaptec +drivers from the .Xr ata 4 subsystem. If both drivers are loaded at the same time, this one will be @@ -119,9 +120,9 @@ given precedence as the more functional The .Nm driver supports the following controllers: -.Bl -tag -compact -.It Gen-I (SATA 1.5Gbps): -.Bl -bullet -compact +.Pp +Gen-I (SATA 1.5Gbps): +.Bl -bullet -compact -offset "xxxxxx" .It 88SX5040 .It @@ -131,8 +132,9 @@ driver supports the following controller .It 88SX5081 .El -.It Gen-II (SATA 3Gbps, NCQ, PMP): -.Bl -bullet -compact +.Pp +Gen-II (SATA 3Gbps, NCQ, PMP): +.Bl -bullet -compact -offset "xxxxxx" .It 88SX6040 .It @@ -142,8 +144,9 @@ driver supports the following controller .It 88SX6081 .El -.It Gen-IIe (SATA 3Gbps, NCQ, PMP with FBS): -.Bl -bullet -compact +.Pp +Gen-IIe (SATA 3Gbps, NCQ, PMP with FBS): +.Bl -bullet -compact -offset "xxxxxx" .It 88SX6042 .It @@ -155,11 +158,10 @@ driver supports the following controller .It MV78100 SoC .El -.El -Note, that this hardware supports command queueing and FIS-based switching -only for ATA DMA commands. ATAPI and non-DMA ATA commands executed one by one -for each port. .Pp +Note, that this hardware supports command queueing and FIS-based switching +only for ATA DMA commands. +ATAPI and non-DMA ATA commands executed one by one for each port. .Sh SEE ALSO .Xr ada 4 , .Xr ata 4 , @@ -173,4 +175,4 @@ The driver first appeared in .Fx 8.1 . .Sh AUTHORS -.An Alexander Motin Aq mav@FreeBSD.org . +.An Alexander Motin Aq mav@FreeBSD.org From owner-svn-src-all@FreeBSD.ORG Sat Nov 19 17:09:36 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 98EDB1065674; Sat, 19 Nov 2011 17:09:36 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7CEF38FC0A; Sat, 19 Nov 2011 17:09:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAJH9aeo052725; Sat, 19 Nov 2011 17:09:36 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAJH9aXs052722; Sat, 19 Nov 2011 17:09:36 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201111191709.pAJH9aXs052722@svn.freebsd.org> From: Dimitry Andric Date: Sat, 19 Nov 2011 17:09:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227735 - in head/contrib/llvm/tools/clang: include/clang/Basic lib/Sema X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Nov 2011 17:09:36 -0000 Author: dim Date: Sat Nov 19 17:09:36 2011 New Revision: 227735 URL: http://svn.freebsd.org/changeset/base/227735 Log: Pull in r144110 from upstream clang trunk: Mark the overloaded atomic builtins as having custom type checking, which they do. This avoids all of the default argument promotions that we (1) don't want, and (2) undo during that custom type checking, and makes sure that we don't run into trouble during template instantiation. Fixes llvm/clang PR11320. MFC after: 1 week Modified: head/contrib/llvm/tools/clang/include/clang/Basic/Builtins.def head/contrib/llvm/tools/clang/lib/Sema/SemaChecking.cpp Modified: head/contrib/llvm/tools/clang/include/clang/Basic/Builtins.def ============================================================================== --- head/contrib/llvm/tools/clang/include/clang/Basic/Builtins.def Sat Nov 19 17:01:11 2011 (r227734) +++ head/contrib/llvm/tools/clang/include/clang/Basic/Builtins.def Sat Nov 19 17:09:36 2011 (r227735) @@ -480,111 +480,111 @@ BUILTIN(__builtin_alloca, "v*z" , "n") // FIXME: These assume that char -> i8, short -> i16, int -> i32, // long long -> i64. -BUILTIN(__sync_fetch_and_add, "v.", "") -BUILTIN(__sync_fetch_and_add_1, "ccD*c.", "n") -BUILTIN(__sync_fetch_and_add_2, "ssD*s.", "n") -BUILTIN(__sync_fetch_and_add_4, "iiD*i.", "n") -BUILTIN(__sync_fetch_and_add_8, "LLiLLiD*LLi.", "n") -BUILTIN(__sync_fetch_and_add_16, "LLLiLLLiD*LLLi.", "n") - -BUILTIN(__sync_fetch_and_sub, "v.", "") -BUILTIN(__sync_fetch_and_sub_1, "ccD*c.", "n") -BUILTIN(__sync_fetch_and_sub_2, "ssD*s.", "n") -BUILTIN(__sync_fetch_and_sub_4, "iiD*i.", "n") -BUILTIN(__sync_fetch_and_sub_8, "LLiLLiD*LLi.", "n") -BUILTIN(__sync_fetch_and_sub_16, "LLLiLLLiD*LLLi.", "n") - -BUILTIN(__sync_fetch_and_or, "v.", "") -BUILTIN(__sync_fetch_and_or_1, "ccD*c.", "n") -BUILTIN(__sync_fetch_and_or_2, "ssD*s.", "n") -BUILTIN(__sync_fetch_and_or_4, "iiD*i.", "n") -BUILTIN(__sync_fetch_and_or_8, "LLiLLiD*LLi.", "n") -BUILTIN(__sync_fetch_and_or_16, "LLLiLLLiD*LLLi.", "n") - -BUILTIN(__sync_fetch_and_and, "v.", "") -BUILTIN(__sync_fetch_and_and_1, "ccD*c.", "n") -BUILTIN(__sync_fetch_and_and_2, "ssD*s.", "n") -BUILTIN(__sync_fetch_and_and_4, "iiD*i.", "n") -BUILTIN(__sync_fetch_and_and_8, "LLiLLiD*LLi.", "n") -BUILTIN(__sync_fetch_and_and_16, "LLLiLLLiD*LLLi.", "n") - -BUILTIN(__sync_fetch_and_xor, "v.", "") -BUILTIN(__sync_fetch_and_xor_1, "ccD*c.", "n") -BUILTIN(__sync_fetch_and_xor_2, "ssD*s.", "n") -BUILTIN(__sync_fetch_and_xor_4, "iiD*i.", "n") -BUILTIN(__sync_fetch_and_xor_8, "LLiLLiD*LLi.", "n") -BUILTIN(__sync_fetch_and_xor_16, "LLLiLLLiD*LLLi.", "n") - - -BUILTIN(__sync_add_and_fetch, "v.", "") -BUILTIN(__sync_add_and_fetch_1, "ccD*c.", "n") -BUILTIN(__sync_add_and_fetch_2, "ssD*s.", "n") -BUILTIN(__sync_add_and_fetch_4, "iiD*i.", "n") -BUILTIN(__sync_add_and_fetch_8, "LLiLLiD*LLi.", "n") -BUILTIN(__sync_add_and_fetch_16, "LLLiLLLiD*LLLi.", "n") - -BUILTIN(__sync_sub_and_fetch, "v.", "") -BUILTIN(__sync_sub_and_fetch_1, "ccD*c.", "n") -BUILTIN(__sync_sub_and_fetch_2, "ssD*s.", "n") -BUILTIN(__sync_sub_and_fetch_4, "iiD*i.", "n") -BUILTIN(__sync_sub_and_fetch_8, "LLiLLiD*LLi.", "n") -BUILTIN(__sync_sub_and_fetch_16, "LLLiLLLiD*LLLi.", "n") - -BUILTIN(__sync_or_and_fetch, "v.", "") -BUILTIN(__sync_or_and_fetch_1, "ccD*c.", "n") -BUILTIN(__sync_or_and_fetch_2, "ssD*s.", "n") -BUILTIN(__sync_or_and_fetch_4, "iiD*i.", "n") -BUILTIN(__sync_or_and_fetch_8, "LLiLLiD*LLi.", "n") -BUILTIN(__sync_or_and_fetch_16, "LLLiLLLiD*LLLi.", "n") - -BUILTIN(__sync_and_and_fetch, "v.", "") -BUILTIN(__sync_and_and_fetch_1, "ccD*c.", "n") -BUILTIN(__sync_and_and_fetch_2, "ssD*s.", "n") -BUILTIN(__sync_and_and_fetch_4, "iiD*i.", "n") -BUILTIN(__sync_and_and_fetch_8, "LLiLLiD*LLi.", "n") -BUILTIN(__sync_and_and_fetch_16, "LLLiLLLiD*LLLi.", "n") - -BUILTIN(__sync_xor_and_fetch, "v.", "") -BUILTIN(__sync_xor_and_fetch_1, "ccD*c.", "n") -BUILTIN(__sync_xor_and_fetch_2, "ssD*s.", "n") -BUILTIN(__sync_xor_and_fetch_4, "iiD*i.", "n") -BUILTIN(__sync_xor_and_fetch_8, "LLiLLiD*LLi.", "n") -BUILTIN(__sync_xor_and_fetch_16, "LLLiLLLiD*LLLi.", "n") - -BUILTIN(__sync_bool_compare_and_swap, "v.", "") -BUILTIN(__sync_bool_compare_and_swap_1, "bcD*cc.", "n") -BUILTIN(__sync_bool_compare_and_swap_2, "bsD*ss.", "n") -BUILTIN(__sync_bool_compare_and_swap_4, "biD*ii.", "n") -BUILTIN(__sync_bool_compare_and_swap_8, "bLLiD*LLiLLi.", "n") -BUILTIN(__sync_bool_compare_and_swap_16, "bLLLiD*LLLiLLLi.", "n") - -BUILTIN(__sync_val_compare_and_swap, "v.", "") -BUILTIN(__sync_val_compare_and_swap_1, "ccD*cc.", "n") -BUILTIN(__sync_val_compare_and_swap_2, "ssD*ss.", "n") -BUILTIN(__sync_val_compare_and_swap_4, "iiD*ii.", "n") -BUILTIN(__sync_val_compare_and_swap_8, "LLiLLiD*LLiLLi.", "n") -BUILTIN(__sync_val_compare_and_swap_16, "LLLiLLLiD*LLLiLLLi.", "n") - -BUILTIN(__sync_lock_test_and_set, "v.", "") -BUILTIN(__sync_lock_test_and_set_1, "ccD*c.", "n") -BUILTIN(__sync_lock_test_and_set_2, "ssD*s.", "n") -BUILTIN(__sync_lock_test_and_set_4, "iiD*i.", "n") -BUILTIN(__sync_lock_test_and_set_8, "LLiLLiD*LLi.", "n") -BUILTIN(__sync_lock_test_and_set_16, "LLLiLLLiD*LLLi.", "n") - -BUILTIN(__sync_lock_release, "v.", "") -BUILTIN(__sync_lock_release_1, "vcD*.", "n") -BUILTIN(__sync_lock_release_2, "vsD*.", "n") -BUILTIN(__sync_lock_release_4, "viD*.", "n") -BUILTIN(__sync_lock_release_8, "vLLiD*.", "n") -BUILTIN(__sync_lock_release_16, "vLLLiD*.", "n") - -BUILTIN(__sync_swap, "v.", "") -BUILTIN(__sync_swap_1, "ccD*c.", "n") -BUILTIN(__sync_swap_2, "ssD*s.", "n") -BUILTIN(__sync_swap_4, "iiD*i.", "n") -BUILTIN(__sync_swap_8, "LLiLLiD*LLi.", "n") -BUILTIN(__sync_swap_16, "LLLiLLLiD*LLLi.", "n") +BUILTIN(__sync_fetch_and_add, "v.", "t") +BUILTIN(__sync_fetch_and_add_1, "ccD*c.", "nt") +BUILTIN(__sync_fetch_and_add_2, "ssD*s.", "nt") +BUILTIN(__sync_fetch_and_add_4, "iiD*i.", "nt") +BUILTIN(__sync_fetch_and_add_8, "LLiLLiD*LLi.", "nt") +BUILTIN(__sync_fetch_and_add_16, "LLLiLLLiD*LLLi.", "nt") + +BUILTIN(__sync_fetch_and_sub, "v.", "t") +BUILTIN(__sync_fetch_and_sub_1, "ccD*c.", "nt") +BUILTIN(__sync_fetch_and_sub_2, "ssD*s.", "nt") +BUILTIN(__sync_fetch_and_sub_4, "iiD*i.", "nt") +BUILTIN(__sync_fetch_and_sub_8, "LLiLLiD*LLi.", "nt") +BUILTIN(__sync_fetch_and_sub_16, "LLLiLLLiD*LLLi.", "nt") + +BUILTIN(__sync_fetch_and_or, "v.", "t") +BUILTIN(__sync_fetch_and_or_1, "ccD*c.", "nt") +BUILTIN(__sync_fetch_and_or_2, "ssD*s.", "nt") +BUILTIN(__sync_fetch_and_or_4, "iiD*i.", "nt") +BUILTIN(__sync_fetch_and_or_8, "LLiLLiD*LLi.", "nt") +BUILTIN(__sync_fetch_and_or_16, "LLLiLLLiD*LLLi.", "nt") + +BUILTIN(__sync_fetch_and_and, "v.", "t") +BUILTIN(__sync_fetch_and_and_1, "ccD*c.", "tn") +BUILTIN(__sync_fetch_and_and_2, "ssD*s.", "tn") +BUILTIN(__sync_fetch_and_and_4, "iiD*i.", "tn") +BUILTIN(__sync_fetch_and_and_8, "LLiLLiD*LLi.", "tn") +BUILTIN(__sync_fetch_and_and_16, "LLLiLLLiD*LLLi.", "tn") + +BUILTIN(__sync_fetch_and_xor, "v.", "t") +BUILTIN(__sync_fetch_and_xor_1, "ccD*c.", "tn") +BUILTIN(__sync_fetch_and_xor_2, "ssD*s.", "tn") +BUILTIN(__sync_fetch_and_xor_4, "iiD*i.", "tn") +BUILTIN(__sync_fetch_and_xor_8, "LLiLLiD*LLi.", "tn") +BUILTIN(__sync_fetch_and_xor_16, "LLLiLLLiD*LLLi.", "tn") + + +BUILTIN(__sync_add_and_fetch, "v.", "t") +BUILTIN(__sync_add_and_fetch_1, "ccD*c.", "tn") +BUILTIN(__sync_add_and_fetch_2, "ssD*s.", "tn") +BUILTIN(__sync_add_and_fetch_4, "iiD*i.", "tn") +BUILTIN(__sync_add_and_fetch_8, "LLiLLiD*LLi.", "tn") +BUILTIN(__sync_add_and_fetch_16, "LLLiLLLiD*LLLi.", "tn") + +BUILTIN(__sync_sub_and_fetch, "v.", "t") +BUILTIN(__sync_sub_and_fetch_1, "ccD*c.", "tn") +BUILTIN(__sync_sub_and_fetch_2, "ssD*s.", "tn") +BUILTIN(__sync_sub_and_fetch_4, "iiD*i.", "tn") +BUILTIN(__sync_sub_and_fetch_8, "LLiLLiD*LLi.", "tn") +BUILTIN(__sync_sub_and_fetch_16, "LLLiLLLiD*LLLi.", "tn") + +BUILTIN(__sync_or_and_fetch, "v.", "t") +BUILTIN(__sync_or_and_fetch_1, "ccD*c.", "tn") +BUILTIN(__sync_or_and_fetch_2, "ssD*s.", "tn") +BUILTIN(__sync_or_and_fetch_4, "iiD*i.", "tn") +BUILTIN(__sync_or_and_fetch_8, "LLiLLiD*LLi.", "tn") +BUILTIN(__sync_or_and_fetch_16, "LLLiLLLiD*LLLi.", "tn") + +BUILTIN(__sync_and_and_fetch, "v.", "t") +BUILTIN(__sync_and_and_fetch_1, "ccD*c.", "tn") +BUILTIN(__sync_and_and_fetch_2, "ssD*s.", "tn") +BUILTIN(__sync_and_and_fetch_4, "iiD*i.", "tn") +BUILTIN(__sync_and_and_fetch_8, "LLiLLiD*LLi.", "tn") +BUILTIN(__sync_and_and_fetch_16, "LLLiLLLiD*LLLi.", "tn") + +BUILTIN(__sync_xor_and_fetch, "v.", "t") +BUILTIN(__sync_xor_and_fetch_1, "ccD*c.", "tn") +BUILTIN(__sync_xor_and_fetch_2, "ssD*s.", "tn") +BUILTIN(__sync_xor_and_fetch_4, "iiD*i.", "tn") +BUILTIN(__sync_xor_and_fetch_8, "LLiLLiD*LLi.", "tn") +BUILTIN(__sync_xor_and_fetch_16, "LLLiLLLiD*LLLi.", "tn") + +BUILTIN(__sync_bool_compare_and_swap, "v.", "t") +BUILTIN(__sync_bool_compare_and_swap_1, "bcD*cc.", "tn") +BUILTIN(__sync_bool_compare_and_swap_2, "bsD*ss.", "tn") +BUILTIN(__sync_bool_compare_and_swap_4, "biD*ii.", "tn") +BUILTIN(__sync_bool_compare_and_swap_8, "bLLiD*LLiLLi.", "tn") +BUILTIN(__sync_bool_compare_and_swap_16, "bLLLiD*LLLiLLLi.", "tn") + +BUILTIN(__sync_val_compare_and_swap, "v.", "t") +BUILTIN(__sync_val_compare_and_swap_1, "ccD*cc.", "tn") +BUILTIN(__sync_val_compare_and_swap_2, "ssD*ss.", "tn") +BUILTIN(__sync_val_compare_and_swap_4, "iiD*ii.", "tn") +BUILTIN(__sync_val_compare_and_swap_8, "LLiLLiD*LLiLLi.", "tn") +BUILTIN(__sync_val_compare_and_swap_16, "LLLiLLLiD*LLLiLLLi.", "tn") + +BUILTIN(__sync_lock_test_and_set, "v.", "t") +BUILTIN(__sync_lock_test_and_set_1, "ccD*c.", "tn") +BUILTIN(__sync_lock_test_and_set_2, "ssD*s.", "tn") +BUILTIN(__sync_lock_test_and_set_4, "iiD*i.", "tn") +BUILTIN(__sync_lock_test_and_set_8, "LLiLLiD*LLi.", "tn") +BUILTIN(__sync_lock_test_and_set_16, "LLLiLLLiD*LLLi.", "tn") + +BUILTIN(__sync_lock_release, "v.", "t") +BUILTIN(__sync_lock_release_1, "vcD*.", "tn") +BUILTIN(__sync_lock_release_2, "vsD*.", "tn") +BUILTIN(__sync_lock_release_4, "viD*.", "tn") +BUILTIN(__sync_lock_release_8, "vLLiD*.", "tn") +BUILTIN(__sync_lock_release_16, "vLLLiD*.", "tn") + +BUILTIN(__sync_swap, "v.", "t") +BUILTIN(__sync_swap_1, "ccD*c.", "tn") +BUILTIN(__sync_swap_2, "ssD*s.", "tn") +BUILTIN(__sync_swap_4, "iiD*i.", "tn") +BUILTIN(__sync_swap_8, "LLiLLiD*LLi.", "tn") +BUILTIN(__sync_swap_16, "LLLiLLLiD*LLLi.", "tn") BUILTIN(__atomic_load, "v.", "t") BUILTIN(__atomic_store, "v.", "t") Modified: head/contrib/llvm/tools/clang/lib/Sema/SemaChecking.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Sema/SemaChecking.cpp Sat Nov 19 17:01:11 2011 (r227734) +++ head/contrib/llvm/tools/clang/lib/Sema/SemaChecking.cpp Sat Nov 19 17:09:36 2011 (r227735) @@ -803,14 +803,6 @@ Sema::SemaBuiltinAtomicOverloaded(ExprRe for (unsigned i = 0; i != NumFixed; ++i) { ExprResult Arg = TheCall->getArg(i+1); - // If the argument is an implicit cast, then there was a promotion due to - // "...", just remove it now. - if (ImplicitCastExpr *ICE = dyn_cast(Arg.get())) { - Arg = ICE->getSubExpr(); - ICE->setSubExpr(0); - TheCall->setArg(i+1, Arg.get()); - } - // GCC does an implicit conversion to the pointer or integer ValType. This // can fail in some cases (1i -> int**), check for this error case now. // Initialize the argument. From owner-svn-src-all@FreeBSD.ORG Sat Nov 19 17:15:20 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C42B81065744; Sat, 19 Nov 2011 17:15:20 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B2BAF8FC17; Sat, 19 Nov 2011 17:15:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAJHFKwq052952; Sat, 19 Nov 2011 17:15:20 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAJHFKtE052950; Sat, 19 Nov 2011 17:15:20 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201111191715.pAJHFKtE052950@svn.freebsd.org> From: Dimitry Andric Date: Sat, 19 Nov 2011 17:15:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227736 - head/contrib/llvm/tools/clang/include/clang/Basic X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Nov 2011 17:15:20 -0000 Author: dim Date: Sat Nov 19 17:15:20 2011 New Revision: 227736 URL: http://svn.freebsd.org/changeset/base/227736 Log: Pull in r144237 from upstream clang trunk: Fix the signature of __sigsetjmp and sigsetjmp. This eliminates incorrect warnings about the prototypes of these functions. MFC after: 1 week Modified: head/contrib/llvm/tools/clang/include/clang/Basic/Builtins.def Modified: head/contrib/llvm/tools/clang/include/clang/Basic/Builtins.def ============================================================================== --- head/contrib/llvm/tools/clang/include/clang/Basic/Builtins.def Sat Nov 19 17:09:36 2011 (r227735) +++ head/contrib/llvm/tools/clang/include/clang/Basic/Builtins.def Sat Nov 19 17:15:20 2011 (r227736) @@ -679,9 +679,9 @@ LIBBUILTIN(vfork, "i", "fj", // it here to avoid having two identical LIBBUILTIN entries. #undef setjmp LIBBUILTIN(_setjmp, "iJ", "fj", "setjmp.h", ALL_LANGUAGES) -LIBBUILTIN(__sigsetjmp, "iJi", "fj", "setjmp.h", ALL_LANGUAGES) +LIBBUILTIN(__sigsetjmp, "iSJi", "fj", "setjmp.h", ALL_LANGUAGES) LIBBUILTIN(setjmp, "iJ", "fj", "setjmp.h", ALL_LANGUAGES) -LIBBUILTIN(sigsetjmp, "iJi", "fj", "setjmp.h", ALL_LANGUAGES) +LIBBUILTIN(sigsetjmp, "iSJi", "fj", "setjmp.h", ALL_LANGUAGES) LIBBUILTIN(setjmp_syscall, "iJ", "fj", "setjmp.h", ALL_LANGUAGES) LIBBUILTIN(savectx, "iJ", "fj", "setjmp.h", ALL_LANGUAGES) LIBBUILTIN(qsetjmp, "iJ", "fj", "setjmp.h", ALL_LANGUAGES) From owner-svn-src-all@FreeBSD.ORG Sat Nov 19 18:01:14 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F21F3106566C; Sat, 19 Nov 2011 18:01:14 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DE1198FC12; Sat, 19 Nov 2011 18:01:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAJI1EdT054445; Sat, 19 Nov 2011 18:01:14 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAJI1Eve054435; Sat, 19 Nov 2011 18:01:14 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201111191801.pAJI1Eve054435@svn.freebsd.org> From: Dimitry Andric Date: Sat, 19 Nov 2011 18:01:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227737 - in head/contrib/llvm/tools/clang: include/clang/AST include/clang/Basic include/clang/Serialization lib/AST lib/Sema lib/Serialization X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Nov 2011 18:01:15 -0000 Author: dim Date: Sat Nov 19 18:01:14 2011 New Revision: 227737 URL: http://svn.freebsd.org/changeset/base/227737 Log: Pull in r144505 from upstream clang trunk: Fix the signature of the getcontext builtin, eliminating incorrect warnings about its prototype. This also adds a -W(no-)builtin-requires-header option, which can be used to enable or disable warnings of this kind. MFC after: 1 week Modified: head/contrib/llvm/tools/clang/include/clang/AST/ASTContext.h head/contrib/llvm/tools/clang/include/clang/Basic/Builtins.def head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticGroups.td head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticSemaKinds.td head/contrib/llvm/tools/clang/include/clang/Serialization/ASTBitCodes.h head/contrib/llvm/tools/clang/lib/AST/ASTContext.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaDecl.cpp head/contrib/llvm/tools/clang/lib/Serialization/ASTReader.cpp head/contrib/llvm/tools/clang/lib/Serialization/ASTWriter.cpp Modified: head/contrib/llvm/tools/clang/include/clang/AST/ASTContext.h ============================================================================== --- head/contrib/llvm/tools/clang/include/clang/AST/ASTContext.h Sat Nov 19 17:15:20 2011 (r227736) +++ head/contrib/llvm/tools/clang/include/clang/AST/ASTContext.h Sat Nov 19 18:01:14 2011 (r227737) @@ -229,6 +229,9 @@ class ASTContext : public llvm::RefCount /// \brief The type for the C sigjmp_buf type. TypeDecl *sigjmp_bufDecl; + /// \brief The type for the C ucontext_t type. + TypeDecl *ucontext_tDecl; + /// \brief Type for the Block descriptor for Blocks CodeGen. /// /// Since this is only used for generation of debug info, it is not @@ -955,6 +958,18 @@ public: return QualType(); } + /// \brief Set the type for the C ucontext_t type. + void setucontext_tDecl(TypeDecl *ucontext_tDecl) { + this->ucontext_tDecl = ucontext_tDecl; + } + + /// \brief Retrieve the C ucontext_t type. + QualType getucontext_tType() const { + if (ucontext_tDecl) + return getTypeDeclType(ucontext_tDecl); + return QualType(); + } + /// \brief The result type of logical operations, '<', '>', '!=', etc. QualType getLogicalOperationType() const { return getLangOptions().CPlusPlus ? BoolTy : IntTy; @@ -1099,7 +1114,8 @@ public: enum GetBuiltinTypeError { GE_None, //< No error GE_Missing_stdio, //< Missing a type from - GE_Missing_setjmp //< Missing a type from + GE_Missing_setjmp, //< Missing a type from + GE_Missing_ucontext //< Missing a type from }; /// GetBuiltinType - Return the type for the specified builtin. If Modified: head/contrib/llvm/tools/clang/include/clang/Basic/Builtins.def ============================================================================== --- head/contrib/llvm/tools/clang/include/clang/Basic/Builtins.def Sat Nov 19 17:15:20 2011 (r227736) +++ head/contrib/llvm/tools/clang/include/clang/Basic/Builtins.def Sat Nov 19 18:01:14 2011 (r227737) @@ -39,6 +39,7 @@ // P -> FILE // J -> jmp_buf // SJ -> sigjmp_buf +// K -> ucontext_t // . -> "...". This may only occur at the end of the function list. // // Types may be prefixed with the following modifiers: @@ -685,7 +686,7 @@ LIBBUILTIN(sigsetjmp, "iSJi", "fj", LIBBUILTIN(setjmp_syscall, "iJ", "fj", "setjmp.h", ALL_LANGUAGES) LIBBUILTIN(savectx, "iJ", "fj", "setjmp.h", ALL_LANGUAGES) LIBBUILTIN(qsetjmp, "iJ", "fj", "setjmp.h", ALL_LANGUAGES) -LIBBUILTIN(getcontext, "iJ", "fj", "setjmp.h", ALL_LANGUAGES) +LIBBUILTIN(getcontext, "iK*", "fj", "setjmp.h", ALL_LANGUAGES) LIBBUILTIN(_longjmp, "vJi", "fr", "setjmp.h", ALL_LANGUAGES) LIBBUILTIN(siglongjmp, "vSJi", "fr", "setjmp.h", ALL_LANGUAGES) Modified: head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticGroups.td ============================================================================== --- head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticGroups.td Sat Nov 19 17:15:20 2011 (r227736) +++ head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticGroups.td Sat Nov 19 18:01:14 2011 (r227737) @@ -26,6 +26,7 @@ def : DiagGroup<"attributes">; def : DiagGroup<"bad-function-cast">; def Availability : DiagGroup<"availability">; def BoolConversions : DiagGroup<"bool-conversions">; +def BuiltinRequiresHeader : DiagGroup<"builtin-requires-header">; def CXXCompat: DiagGroup<"c++-compat">; def CastAlign : DiagGroup<"cast-align">; def : DiagGroup<"cast-qual">; Modified: head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticSemaKinds.td ============================================================================== --- head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticSemaKinds.td Sat Nov 19 17:15:20 2011 (r227736) +++ head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticSemaKinds.td Sat Nov 19 18:01:14 2011 (r227737) @@ -254,10 +254,16 @@ def note_please_include_header : Note< def note_previous_builtin_declaration : Note<"%0 is a builtin with type %1">; def warn_implicit_decl_requires_stdio : Warning< "declaration of built-in function '%0' requires inclusion of the header " - "">; + "">, + InGroup; def warn_implicit_decl_requires_setjmp : Warning< "declaration of built-in function '%0' requires inclusion of the header " - "">; + "">, + InGroup; +def warn_implicit_decl_requires_ucontext : Warning< + "declaration of built-in function '%0' requires inclusion of the header " + "">, + InGroup; def warn_redecl_library_builtin : Warning< "incompatible redeclaration of library function %0">; def err_builtin_definition : Error<"definition of builtin function %0">; Modified: head/contrib/llvm/tools/clang/include/clang/Serialization/ASTBitCodes.h ============================================================================== --- head/contrib/llvm/tools/clang/include/clang/Serialization/ASTBitCodes.h Sat Nov 19 17:15:20 2011 (r227736) +++ head/contrib/llvm/tools/clang/include/clang/Serialization/ASTBitCodes.h Sat Nov 19 18:01:14 2011 (r227737) @@ -677,7 +677,9 @@ namespace clang { /// \brief Objective-C "Class" redefinition type SPECIAL_TYPE_OBJC_CLASS_REDEFINITION = 7, /// \brief Objective-C "SEL" redefinition type - SPECIAL_TYPE_OBJC_SEL_REDEFINITION = 8 + SPECIAL_TYPE_OBJC_SEL_REDEFINITION = 8, + /// \brief C ucontext_t typedef type + SPECIAL_TYPE_UCONTEXT_T = 9 }; /// \brief The number of special type IDs. Modified: head/contrib/llvm/tools/clang/lib/AST/ASTContext.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/AST/ASTContext.cpp Sat Nov 19 17:15:20 2011 (r227736) +++ head/contrib/llvm/tools/clang/lib/AST/ASTContext.cpp Sat Nov 19 18:01:14 2011 (r227737) @@ -227,8 +227,9 @@ ASTContext::ASTContext(LangOptions& LOpt ObjCIdDecl(0), ObjCSelDecl(0), ObjCClassDecl(0), CFConstantStringTypeDecl(0), ObjCInstanceTypeDecl(0), FILEDecl(0), - jmp_bufDecl(0), sigjmp_bufDecl(0), BlockDescriptorType(0), - BlockDescriptorExtendedType(0), cudaConfigureCallDecl(0), + jmp_bufDecl(0), sigjmp_bufDecl(0), ucontext_tDecl(0), + BlockDescriptorType(0), BlockDescriptorExtendedType(0), + cudaConfigureCallDecl(0), NullTypeSourceInfo(QualType()), SourceMgr(SM), LangOpts(LOpts), AddrSpaceMap(0), Target(t), PrintingPolicy(LOpts), @@ -6293,6 +6294,15 @@ static QualType DecodeTypeFromStr(const return QualType(); } break; + case 'K': + assert(HowLong == 0 && !Signed && !Unsigned && "Bad modifiers for 'K'!"); + Type = Context.getucontext_tType(); + + if (Type.isNull()) { + Error = ASTContext::GE_Missing_ucontext; + return QualType(); + } + break; } // If there are modifiers and if we're allowed to parse them, go for it. Modified: head/contrib/llvm/tools/clang/lib/Sema/SemaDecl.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Sema/SemaDecl.cpp Sat Nov 19 17:15:20 2011 (r227736) +++ head/contrib/llvm/tools/clang/lib/Sema/SemaDecl.cpp Sat Nov 19 18:01:14 2011 (r227737) @@ -1305,6 +1305,12 @@ NamedDecl *Sema::LazilyCreateBuiltin(Ide Diag(Loc, diag::warn_implicit_decl_requires_setjmp) << Context.BuiltinInfo.GetName(BID); return 0; + + case ASTContext::GE_Missing_ucontext: + if (ForRedeclaration) + Diag(Loc, diag::warn_implicit_decl_requires_ucontext) + << Context.BuiltinInfo.GetName(BID); + return 0; } if (!ForRedeclaration && Context.BuiltinInfo.isPredefinedLibFunction(BID)) { @@ -3635,6 +3641,8 @@ Sema::ActOnTypedefNameDecl(Scope *S, Dec Context.setjmp_bufDecl(NewTD); else if (II->isStr("sigjmp_buf")) Context.setsigjmp_bufDecl(NewTD); + else if (II->isStr("ucontext_t")) + Context.setucontext_tDecl(NewTD); else if (II->isStr("__builtin_va_list")) Context.setBuiltinVaListType(Context.getTypedefType(NewTD)); } Modified: head/contrib/llvm/tools/clang/lib/Serialization/ASTReader.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Serialization/ASTReader.cpp Sat Nov 19 17:15:20 2011 (r227736) +++ head/contrib/llvm/tools/clang/lib/Serialization/ASTReader.cpp Sat Nov 19 18:01:14 2011 (r227737) @@ -2659,6 +2659,24 @@ void ASTReader::InitializeContext() { if (Context.ObjCSelRedefinitionType.isNull()) Context.ObjCSelRedefinitionType = GetType(ObjCSelRedef); } + + if (unsigned Ucontext_t = SpecialTypes[SPECIAL_TYPE_UCONTEXT_T]) { + QualType Ucontext_tType = GetType(Ucontext_t); + if (Ucontext_tType.isNull()) { + Error("ucontext_t type is NULL"); + return; + } + + if (!Context.ucontext_tDecl) { + if (const TypedefType *Typedef = Ucontext_tType->getAs()) + Context.setucontext_tDecl(Typedef->getDecl()); + else { + const TagType *Tag = Ucontext_tType->getAs(); + assert(Tag && "Invalid ucontext_t type in AST file"); + Context.setucontext_tDecl(Tag->getDecl()); + } + } + } } ReadPragmaDiagnosticMappings(Context.getDiagnostics()); Modified: head/contrib/llvm/tools/clang/lib/Serialization/ASTWriter.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Serialization/ASTWriter.cpp Sat Nov 19 17:15:20 2011 (r227736) +++ head/contrib/llvm/tools/clang/lib/Serialization/ASTWriter.cpp Sat Nov 19 18:01:14 2011 (r227737) @@ -2994,6 +2994,7 @@ void ASTWriter::WriteASTCore(Sema &SemaR AddTypeRef(Context.ObjCIdRedefinitionType, SpecialTypes); AddTypeRef(Context.ObjCClassRedefinitionType, SpecialTypes); AddTypeRef(Context.ObjCSelRedefinitionType, SpecialTypes); + AddTypeRef(Context.getucontext_tType(), SpecialTypes); // Keep writing types and declarations until all types and // declarations have been written. From owner-svn-src-all@FreeBSD.ORG Sat Nov 19 19:06:08 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CB6D3106588C; Sat, 19 Nov 2011 19:06:08 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BAA5E8FC08; Sat, 19 Nov 2011 19:06:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAJJ68dm056567; Sat, 19 Nov 2011 19:06:08 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAJJ68es056565; Sat, 19 Nov 2011 19:06:08 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201111191906.pAJJ68es056565@svn.freebsd.org> From: Gleb Smirnoff Date: Sat, 19 Nov 2011 19:06:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227738 - head/sbin/ifconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Nov 2011 19:06:08 -0000 Author: glebius Date: Sat Nov 19 19:06:08 2011 New Revision: 227738 URL: http://svn.freebsd.org/changeset/base/227738 Log: For unknown reason, since rev 1.1 of ifconfig.c, sin_family isn't set properly for the mask argument. Since I'd like to improve argument sanity checking in kernel side, in in_control(), fix this. Modified: head/sbin/ifconfig/af_inet.c Modified: head/sbin/ifconfig/af_inet.c ============================================================================== --- head/sbin/ifconfig/af_inet.c Sat Nov 19 18:01:14 2011 (r227737) +++ head/sbin/ifconfig/af_inet.c Sat Nov 19 19:06:08 2011 (r227738) @@ -104,8 +104,7 @@ in_getaddr(const char *s, int which) struct netent *np; sin->sin_len = sizeof(*sin); - if (which != MASK) - sin->sin_family = AF_INET; + sin->sin_family = AF_INET; if (which == ADDR) { char *p = NULL; From owner-svn-src-all@FreeBSD.ORG Sat Nov 19 19:25:57 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C2CA51065672; Sat, 19 Nov 2011 19:25:57 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AEF058FC08; Sat, 19 Nov 2011 19:25:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAJJPv3d057211; Sat, 19 Nov 2011 19:25:57 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAJJPvFf057201; Sat, 19 Nov 2011 19:25:57 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201111191925.pAJJPvFf057201@svn.freebsd.org> From: Andreas Tobler Date: Sat, 19 Nov 2011 19:25:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227739 - in head: . contrib/binutils/ld/emulparams contrib/gcc/config/rs6000 contrib/llvm/tools/clang/lib/Driver gnu/usr.bin/binutils/ld sys/boot/ofw sys/boot/powerpc sys/boot/uboot X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Nov 2011 19:25:57 -0000 Author: andreast Date: Sat Nov 19 19:25:57 2011 New Revision: 227739 URL: http://svn.freebsd.org/changeset/base/227739 Log: Rename the linker emulation name for powerpc and powerc64. This is needed that we can also use the upstream binutils linker where we have to have a unique name for the FreeBSD emulation. Added: head/contrib/binutils/ld/emulparams/elf64ppc_fbsd.sh (contents, props changed) Modified: head/Makefile.inc1 head/contrib/gcc/config/rs6000/freebsd.h head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp head/gnu/usr.bin/binutils/ld/Makefile.powerpc head/gnu/usr.bin/binutils/ld/Makefile.powerpc64 head/sys/boot/ofw/Makefile.inc head/sys/boot/powerpc/Makefile.inc head/sys/boot/uboot/Makefile.inc Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sat Nov 19 19:06:08 2011 (r227738) +++ head/Makefile.inc1 Sat Nov 19 19:25:57 2011 (r227739) @@ -291,7 +291,7 @@ LIB32CPUFLAGS= -mcpu=powerpc LIB32CPUFLAGS= -mcpu=${TARGET_CPUTYPE} .endif LIB32WMAKEENV= MACHINE=powerpc MACHINE_ARCH=powerpc \ - LD="${LD} -m elf32ppc" + LD="${LD} -m elf32ppc_fbsd" .endif Added: head/contrib/binutils/ld/emulparams/elf64ppc_fbsd.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/binutils/ld/emulparams/elf64ppc_fbsd.sh Sat Nov 19 19:25:57 2011 (r227739) @@ -0,0 +1,3 @@ +. ${srcdir}/emulparams/elf64ppc.sh +. ${srcdir}/emulparams/elf_fbsd.sh + Modified: head/contrib/gcc/config/rs6000/freebsd.h ============================================================================== --- head/contrib/gcc/config/rs6000/freebsd.h Sat Nov 19 19:06:08 2011 (r227738) +++ head/contrib/gcc/config/rs6000/freebsd.h Sat Nov 19 19:25:57 2011 (r227739) @@ -193,7 +193,7 @@ extern int dot_symbols; #undef LINK_OS_FREEBSD_SPEC #define ASM_DEFAULT_SPEC "-mppc%{!m32:64}" #define ASM_SPEC "%{m32:-a32}%{!m32:-a64} " SVR4_ASM_SPEC -#define LINK_OS_FREEBSD_SPEC "%{m32:-melf32ppc}%{!m32:-melf64ppc} " LINK_OS_FREEBSD_SPEC_DEF +#define LINK_OS_FREEBSD_SPEC "%{m32:-melf32ppc_fbsd}%{!m32:-melf64ppc_fbsd} " LINK_OS_FREEBSD_SPEC_DEF #endif /* _init and _fini functions are built from bits spread across many Modified: head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp Sat Nov 19 19:06:08 2011 (r227738) +++ head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp Sat Nov 19 19:25:57 2011 (r227739) @@ -3926,7 +3926,7 @@ void freebsd::Link::ConstructJob(Compila if (getToolChain().getArchName() == "powerpc") { CmdArgs.push_back("-m"); - CmdArgs.push_back("elf32ppc"); + CmdArgs.push_back("elf32ppc_fbsd"); } if (Output.isFilename()) { Modified: head/gnu/usr.bin/binutils/ld/Makefile.powerpc ============================================================================== --- head/gnu/usr.bin/binutils/ld/Makefile.powerpc Sat Nov 19 19:06:08 2011 (r227738) +++ head/gnu/usr.bin/binutils/ld/Makefile.powerpc Sat Nov 19 19:25:57 2011 (r227739) @@ -1,6 +1,6 @@ # $FreeBSD$ -NATIVE_EMULATION= elf32ppc +NATIVE_EMULATION= elf32ppc_fbsd SRCS+= e${NATIVE_EMULATION}.c CLEANFILES+= e${NATIVE_EMULATION}.c Modified: head/gnu/usr.bin/binutils/ld/Makefile.powerpc64 ============================================================================== --- head/gnu/usr.bin/binutils/ld/Makefile.powerpc64 Sat Nov 19 19:06:08 2011 (r227738) +++ head/gnu/usr.bin/binutils/ld/Makefile.powerpc64 Sat Nov 19 19:25:57 2011 (r227739) @@ -1,6 +1,6 @@ # $FreeBSD$ -NATIVE_EMULATION= elf64ppc +NATIVE_EMULATION= elf64ppc_fbsd SRCS+= e${NATIVE_EMULATION}.c CLEANFILES+= e${NATIVE_EMULATION}.c @@ -11,7 +11,7 @@ e${NATIVE_EMULATION}.c: emulparams/${NAT ${HOST} ${TARGET_TUPLE} ${TARGET_TUPLE} \ ${NATIVE_EMULATION} "" no ${NATIVE_EMULATION} ${TARGET_TUPLE} -PPC32_EMULATION= elf32ppc +PPC32_EMULATION= elf32ppc_fbsd _ppc32_path= \"${TOOLS_PREFIX}/usr/lib32\" EMS+= ${PPC32_EMULATION} .for ext in ${ELF_SCR_EXT} Modified: head/sys/boot/ofw/Makefile.inc ============================================================================== --- head/sys/boot/ofw/Makefile.inc Sat Nov 19 19:06:08 2011 (r227738) +++ head/sys/boot/ofw/Makefile.inc Sat Nov 19 19:25:57 2011 (r227739) @@ -2,7 +2,7 @@ .if ${MACHINE_ARCH} == "powerpc64" CFLAGS+= -m32 -mcpu=powerpc -LDFLAGS+= -m elf32ppc +LDFLAGS+= -m elf32ppc_fbsd .endif .include "../Makefile.inc" Modified: head/sys/boot/powerpc/Makefile.inc ============================================================================== --- head/sys/boot/powerpc/Makefile.inc Sat Nov 19 19:06:08 2011 (r227738) +++ head/sys/boot/powerpc/Makefile.inc Sat Nov 19 19:25:57 2011 (r227739) @@ -2,7 +2,7 @@ .if ${MACHINE_ARCH} == "powerpc64" CFLAGS+= -m32 -mcpu=powerpc -LDFLAGS+= -m elf32ppc +LDFLAGS+= -m elf32ppc_fbsd .endif .include "../Makefile.inc" Modified: head/sys/boot/uboot/Makefile.inc ============================================================================== --- head/sys/boot/uboot/Makefile.inc Sat Nov 19 19:06:08 2011 (r227738) +++ head/sys/boot/uboot/Makefile.inc Sat Nov 19 19:25:57 2011 (r227739) @@ -2,7 +2,7 @@ .if ${MACHINE_ARCH} == "powerpc64" CFLAGS+= -m32 -mcpu=powerpc -LDFLAGS+= -m elf32ppc +LDFLAGS+= -m elf32ppc_fbsd .endif .include "../Makefile.inc" From owner-svn-src-all@FreeBSD.ORG Sat Nov 19 21:05:31 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0C20106564A; Sat, 19 Nov 2011 21:05:31 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BFACA8FC08; Sat, 19 Nov 2011 21:05:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAJL5V1f060347; Sat, 19 Nov 2011 21:05:31 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAJL5V9C060345; Sat, 19 Nov 2011 21:05:31 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111192105.pAJL5V9C060345@svn.freebsd.org> From: Adrian Chadd Date: Sat, 19 Nov 2011 21:05:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227740 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Nov 2011 21:05:31 -0000 Author: adrian Date: Sat Nov 19 21:05:31 2011 New Revision: 227740 URL: http://svn.freebsd.org/changeset/base/227740 Log: Begin breaking apart the receive setup/stop path in preparation for more "correct" handling of frames in the RX pending queue during interface transitions. * ath_stoprecv() doesn't blank out the descriptor list - that's what ath_startrecv() does. So, change a comment to reflect that. * ath_stoprecv() does include a large (3ms) delay to let pending DMA complete. However, I'm under the impression that the stopdma hal method does check for a bit in the PCU to indicate DMA has stopped. So, to help with fast abort and restart, modify ath_stoprecv() to take a flag which indicates whether this is needed. * Modify the uses of ath_stoprecv() to pass in a flag to support the existing behaviour (ie, do the delay.) * Remove some duplicate PCU teardown code (which wasn't shutting down DMA, so it wasn't entirely correct..) and replace it with a call to ath_stoprecv(sc, 0) - which disables the DELAY call. The upshoot of this is now channel change doesn't simply drop completed frames on the floor, but instead it cleanly handles those frames. It still discards pending TX frames in the software and hardware queues as there's no (current) logic which forcibly recalculates the rate control information (or whether they're appropriate to be on the TX queue after a channel change), that'll come later. This still doesn't stop all the sources of queue stalls but it does tidy up some of the code duplication. To be complete, queue stalls now occur during normal behaviour - they only occur after some kind of broken behaviour causes an interface or node flush, upsetting the TX/RX BAW. Subsequent commits will incrementally fix these and other related issues. Sponsored by: Hobnob, Inc. Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Sat Nov 19 19:25:57 2011 (r227739) +++ head/sys/dev/ath/if_ath.c Sat Nov 19 21:05:31 2011 (r227740) @@ -188,7 +188,7 @@ static void ath_tx_proc_q0123(void *, in static void ath_tx_proc(void *, int); static int ath_chan_set(struct ath_softc *, struct ieee80211_channel *); static void ath_draintxq(struct ath_softc *, ATH_RESET_TYPE reset_type); -static void ath_stoprecv(struct ath_softc *); +static void ath_stoprecv(struct ath_softc *, int); static int ath_startrecv(struct ath_softc *); static void ath_chan_change(struct ath_softc *, struct ieee80211_channel *); static void ath_scan_start(struct ieee80211com *); @@ -1153,7 +1153,7 @@ ath_vap_delete(struct ieee80211vap *vap) ath_hal_intrset(ah, 0); /* disable interrupts */ ath_draintxq(sc, ATH_RESET_DEFAULT); /* stop hw xmit side */ /* XXX Do all frames from all vaps/nodes need draining here? */ - ath_stoprecv(sc); /* stop recv side */ + ath_stoprecv(sc, 1); /* stop recv side */ } ieee80211_vap_detach(vap); @@ -1849,7 +1849,7 @@ ath_stop_locked(struct ifnet *ifp) } ath_draintxq(sc, ATH_RESET_DEFAULT); if (!sc->sc_invalid) { - ath_stoprecv(sc); + ath_stoprecv(sc, 1); ath_hal_phydisable(ah); } else sc->sc_rxlink = NULL; @@ -1943,11 +1943,11 @@ ath_reset(struct ifnet *ifp, ATH_RESET_T ATH_PCU_UNLOCK(sc); /* - * XXX should now wait for pending TX/RX to complete - * and block future ones from occuring. + * Should now wait for pending TX/RX to complete + * and block future ones from occuring. This needs to be + * done before the TX queue is drained. */ ath_txrx_stop(sc); - ath_draintxq(sc, reset_type); /* stop xmit side */ /* @@ -1955,19 +1955,9 @@ ath_reset(struct ifnet *ifp, ATH_RESET_T * not, stop the PCU and handle what's in the RX queue. * That way frames aren't dropped which shouldn't be. */ - ath_hal_stoppcurecv(ah); - ath_hal_setrxfilter(ah, 0); + ath_stoprecv(sc, (reset_type != ATH_RESET_NOLOSS)); ath_rx_proc(sc, 0); - /* - * If we're not doing a noloss reset, now call ath_stoprecv(). - * This fully stops all of the RX machinery and flushes whatever - * frames are in the RX ring buffer. Hopefully all completed - * frames have been handled at this point. - */ - if (reset_type != ATH_RESET_NOLOSS) - ath_stoprecv(sc); /* stop recv side */ - ath_settkipmic(sc); /* configure TKIP MIC handling */ /* NB: indicate channel change so we do a full reset */ if (!ath_hal_reset(ah, sc->sc_opmode, ic->ic_curchan, AH_TRUE, &status)) @@ -5125,7 +5115,7 @@ ath_draintxq(struct ath_softc *sc, ATH_R * Disable the receive h/w in preparation for a reset. */ static void -ath_stoprecv(struct ath_softc *sc) +ath_stoprecv(struct ath_softc *sc, int dodelay) { #define PA2DESC(_sc, _pa) \ ((struct ath_desc *)((caddr_t)(_sc)->sc_rxdma.dd_desc + \ @@ -5135,7 +5125,8 @@ ath_stoprecv(struct ath_softc *sc) ath_hal_stoppcurecv(ah); /* disable PCU */ ath_hal_setrxfilter(ah, 0); /* clear recv filter */ ath_hal_stopdmarecv(ah); /* disable DMA engine */ - DELAY(3000); /* 3ms is long enough for 1 frame */ + if (dodelay) + DELAY(3000); /* 3ms is long enough for 1 frame */ #ifdef ATH_DEBUG if (sc->sc_debug & (ATH_DEBUG_RESET | ATH_DEBUG_FATAL)) { struct ath_buf *bf; @@ -5253,8 +5244,17 @@ ath_chan_set(struct ath_softc *sc, struc #if 0 ath_hal_intrset(ah, 0); /* disable interrupts */ #endif + ath_stoprecv(sc, 1); /* turn off frame recv */ + /* + * First, handle completed TX/RX frames. + */ + ath_rx_proc(sc, 0); + ath_draintxq(sc, ATH_RESET_NOLOSS); + /* + * Next, flush the non-scheduled frames. + */ ath_draintxq(sc, ATH_RESET_FULL); /* clear pending tx frames */ - ath_stoprecv(sc); /* turn off frame recv */ + if (!ath_hal_reset(ah, sc->sc_opmode, chan, AH_TRUE, &status)) { if_printf(ifp, "%s: unable to reset " "channel %u (%u MHz, flags 0x%x), hal status %u\n", From owner-svn-src-all@FreeBSD.ORG Sat Nov 19 21:12:35 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B61B61065676; Sat, 19 Nov 2011 21:12:35 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A5B608FC15; Sat, 19 Nov 2011 21:12:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAJLCZ3V060603; Sat, 19 Nov 2011 21:12:35 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAJLCZv3060601; Sat, 19 Nov 2011 21:12:35 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111192112.pAJLCZv3060601@svn.freebsd.org> From: Adrian Chadd Date: Sat, 19 Nov 2011 21:12:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227741 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Nov 2011 21:12:35 -0000 Author: adrian Date: Sat Nov 19 21:12:35 2011 New Revision: 227741 URL: http://svn.freebsd.org/changeset/base/227741 Log: Add some (totally untested!) code to correctly set the RF half/quarter mode configuration registers. This is apparently required for correct behaviour, but also requires the chip to actually officially support it. Sponsored by: Hobnob, Inc. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Sat Nov 19 21:05:31 2011 (r227740) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Sat Nov 19 21:12:35 2011 (r227741) @@ -724,6 +724,20 @@ ar5416SetRfMode(struct ath_hal *ah, cons rfMode |= IEEE80211_IS_CHAN_5GHZ(chan) ? AR_PHY_MODE_RF5GHZ : AR_PHY_MODE_RF2GHZ; } + + /* + * Set half/quarter mode flags if required. + * + * This doesn't change the IFS timings at all; that needs to + * be done as part of the MAC setup. Similarly, the PLL + * configuration also needs some changes for the half/quarter + * rate clock. + */ + if (IEEE80211_IS_CHAN_HALF(chan)) + rfMode |= AR_PHY_MODE_HALF; + else if (IEEE80211_IS_CHAN_QUARTER(chan)) + rfMode |= AR_PHY_MODE_QUARTER; + OS_REG_WRITE(ah, AR_PHY_MODE, rfMode); } From owner-svn-src-all@FreeBSD.ORG Sat Nov 19 22:14:08 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CCB6F106566C; Sat, 19 Nov 2011 22:14:08 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BC12E8FC13; Sat, 19 Nov 2011 22:14:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAJME8LG062575; Sat, 19 Nov 2011 22:14:08 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAJME8Gl062573; Sat, 19 Nov 2011 22:14:08 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201111192214.pAJME8Gl062573@svn.freebsd.org> From: Christian Brueffer Date: Sat, 19 Nov 2011 22:14:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227742 - head/release/doc/en_US.ISO8859-1/hardware X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Nov 2011 22:14:08 -0000 Author: brueffer Date: Sat Nov 19 22:14:08 2011 New Revision: 227742 URL: http://svn.freebsd.org/changeset/base/227742 Log: Add 2010 and 2011 copyrights. Modified: head/release/doc/en_US.ISO8859-1/hardware/article.sgml Modified: head/release/doc/en_US.ISO8859-1/hardware/article.sgml ============================================================================== --- head/release/doc/en_US.ISO8859-1/hardware/article.sgml Sat Nov 19 21:12:35 2011 (r227741) +++ head/release/doc/en_US.ISO8859-1/hardware/article.sgml Sat Nov 19 22:14:08 2011 (r227742) @@ -30,6 +30,8 @@ 2007 2008 2009 + 2010 + 2011 The &os; Documentation Project