From owner-svn-src-all@FreeBSD.ORG Sun Apr 14 00:20:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D1F108BA; Sun, 14 Apr 2013 00:20:33 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BF0EC1899; Sun, 14 Apr 2013 00:20:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3E0KXkF049608; Sun, 14 Apr 2013 00:20:33 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3E0KXaU049607; Sun, 14 Apr 2013 00:20:33 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201304140020.r3E0KXaU049607@svn.freebsd.org> From: Sean Bruno Date: Sun, 14 Apr 2013 00:20:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249455 - stable/9/sys/dev/ciss X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Apr 2013 00:20:33 -0000 Author: sbruno Date: Sun Apr 14 00:20:32 2013 New Revision: 249455 URL: http://svnweb.freebsd.org/changeset/base/249455 Log: MFC r248824 & r248826 Fix compile with CISS_DEBUG defined Fix DDB hook to actually work again Modified: stable/9/sys/dev/ciss/ciss.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/ciss/ciss.c ============================================================================== --- stable/9/sys/dev/ciss/ciss.c Sat Apr 13 22:45:41 2013 (r249454) +++ stable/9/sys/dev/ciss/ciss.c Sun Apr 14 00:20:32 2013 (r249455) @@ -1868,7 +1868,7 @@ ciss_accept_media(struct ciss_softc *sc, ldrive = CISS_LUN_TO_TARGET(ld->cl_address.logical.lun); - debug(0, "bringing logical drive %d back online"); + debug(0, "bringing logical drive %d back online", ldrive); /* * Build a CISS BMIC command to bring the drive back online. @@ -4307,6 +4307,9 @@ ciss_print_ldrive(struct ciss_softc *sc, } #ifdef CISS_DEBUG +#include "opt_ddb.h" +#ifdef DDB +#include /************************************************************************ * Print information about the controller/driver. */ @@ -4341,8 +4344,7 @@ ciss_print_adapter(struct ciss_softc *sc } /* DDB hook */ -static void -ciss_print0(void) +DB_COMMAND(ciss_prt, db_ciss_prt) { struct ciss_softc *sc; @@ -4354,6 +4356,7 @@ ciss_print0(void) } } #endif +#endif /************************************************************************ * Return a name for a logical drive status value. From owner-svn-src-all@FreeBSD.ORG Sun Apr 14 00:49:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D6D2CE94; Sun, 14 Apr 2013 00:49:08 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C92451ABC; Sun, 14 Apr 2013 00:49:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3E0n8ua058445; Sun, 14 Apr 2013 00:49:08 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3E0n8br058444; Sun, 14 Apr 2013 00:49:08 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201304140049.r3E0n8br058444@svn.freebsd.org> From: Eitan Adler Date: Sun, 14 Apr 2013 00:49:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249456 - stable/9/usr.bin/fstat X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Apr 2013 00:49:08 -0000 Author: eadler Date: Sun Apr 14 00:49:08 2013 New Revision: 249456 URL: http://svnweb.freebsd.org/changeset/base/249456 Log: MFC r249359: fuser(1) requires a filename. Approved by: cperciva (mentor, implicit) Modified: stable/9/usr.bin/fstat/fuser.1 Directory Properties: stable/9/usr.bin/fstat/ (props changed) Modified: stable/9/usr.bin/fstat/fuser.1 ============================================================================== --- stable/9/usr.bin/fstat/fuser.1 Sun Apr 14 00:20:32 2013 (r249455) +++ stable/9/usr.bin/fstat/fuser.1 Sun Apr 14 00:49:08 2013 (r249456) @@ -36,7 +36,7 @@ .Op Fl M Ar core .Op Fl N Ar system .Op Fl s Ar signal -.Op Ar +.Ar .Sh DESCRIPTION The .Nm From owner-svn-src-all@FreeBSD.ORG Sun Apr 14 00:59:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 649142C6; Sun, 14 Apr 2013 00:59:57 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 56CE01B15; Sun, 14 Apr 2013 00:59:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3E0xvWm061495; Sun, 14 Apr 2013 00:59:57 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3E0xvMr061494; Sun, 14 Apr 2013 00:59:57 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201304140059.r3E0xvMr061494@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Sun, 14 Apr 2013 00:59:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249457 - head/lib/libldns X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Apr 2013 00:59:57 -0000 Author: des Date: Sun Apr 14 00:59:56 2013 New Revision: 249457 URL: http://svnweb.freebsd.org/changeset/base/249457 Log: Clean up. Modified: head/lib/libldns/Makefile Modified: head/lib/libldns/Makefile ============================================================================== --- head/lib/libldns/Makefile Sun Apr 14 00:49:08 2013 (r249456) +++ head/lib/libldns/Makefile Sun Apr 14 00:59:56 2013 (r249457) @@ -5,45 +5,18 @@ LDNSDIR = ${.CURDIR}/../../contrib/ldns .PATH: ${LDNSDIR} ${LDNSDIR}/compat -LIB = ldns -INTERNALLIB = true +LIB= ldns +INTERNALLIB= true -CFLAGS += -I${LDNSDIR} +CFLAGS+= -I${LDNSDIR} -SRCS += buffer.c -SRCS += dane.c -SRCS += dname.c -SRCS += dnssec.c -SRCS += dnssec_sign.c -SRCS += dnssec_verify.c -SRCS += dnssec_zone.c -SRCS += duration.c -SRCS += error.c -SRCS += higher.c -SRCS += host2str.c -SRCS += host2wire.c -SRCS += keys.c -SRCS += net.c -SRCS += packet.c -SRCS += parse.c -SRCS += rbtree.c -SRCS += rdata.c -SRCS += resolver.c -SRCS += rr.c -SRCS += rr_functions.c -SRCS += sha1.c -SRCS += sha2.c -SRCS += str2host.c -SRCS += tsig.c -SRCS += update.c -SRCS += util.c -SRCS += wire2host.c -SRCS += zone.c - -SRCS += b32_ntop.c -SRCS += b32_pton.c -SRCS += b64_ntop.c -SRCS += b64_pton.c +SRCS= buffer.c dane.c dname.c dnssec.c dnssec_sign.c dnssec_verify.c \ + dnssec_zone.c duration.c error.c higher.c host2str.c host2wire.c \ + keys.c net.c packet.c parse.c rbtree.c rdata.c resolver.c rr.c \ + rr_functions.c sha1.c sha2.c str2host.c tsig.c update.c util.c \ + wire2host.c zone.c + +SRCS+= b32_ntop.c b32_pton.c b64_ntop.c b64_pton.c WARNS ?= 3 From owner-svn-src-all@FreeBSD.ORG Sun Apr 14 02:26:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CD915C51; Sun, 14 Apr 2013 02:26:12 +0000 (UTC) (envelope-from hiren@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BF33D1CFD; Sun, 14 Apr 2013 02:26:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3E2QCRQ089043; Sun, 14 Apr 2013 02:26:12 GMT (envelope-from hiren@svn.freebsd.org) Received: (from hiren@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3E2QC1w089041; Sun, 14 Apr 2013 02:26:12 GMT (envelope-from hiren@svn.freebsd.org) Message-Id: <201304140226.r3E2QC1w089041@svn.freebsd.org> From: Hiren Panchasara Date: Sun, 14 Apr 2013 02:26:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249460 - head/sys/dev/hwpmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Apr 2013 02:26:12 -0000 Author: hiren Date: Sun Apr 14 02:26:12 2013 New Revision: 249460 URL: http://svnweb.freebsd.org/changeset/base/249460 Log: Improve/correct a comment. We now support a lot more cpu types. PR: kern/177496 Approved by: sbruno (mentor) Modified: head/sys/dev/hwpmc/hwpmc_core.c Modified: head/sys/dev/hwpmc/hwpmc_core.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_core.c Sun Apr 14 01:22:39 2013 (r249459) +++ head/sys/dev/hwpmc/hwpmc_core.c Sun Apr 14 02:26:12 2013 (r249460) @@ -25,7 +25,7 @@ */ /* - * Intel Core, Core 2 and Atom PMCs. + * Intel Core PMCs. */ #include From owner-svn-src-all@FreeBSD.ORG Sun Apr 14 02:42:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0ABFEF16; Sun, 14 Apr 2013 02:42:41 +0000 (UTC) (envelope-from hiren@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EFD211D50; Sun, 14 Apr 2013 02:42:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3E2gexq094404; Sun, 14 Apr 2013 02:42:40 GMT (envelope-from hiren@svn.freebsd.org) Received: (from hiren@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3E2geSq094403; Sun, 14 Apr 2013 02:42:40 GMT (envelope-from hiren@svn.freebsd.org) Message-Id: <201304140242.r3E2geSq094403@svn.freebsd.org> From: Hiren Panchasara Date: Sun, 14 Apr 2013 02:42:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249461 - head/sys/dev/ips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Apr 2013 02:42:41 -0000 Author: hiren Date: Sun Apr 14 02:42:40 2013 New Revision: 249461 URL: http://svnweb.freebsd.org/changeset/base/249461 Log: Fixing a clang warning indicating uninitialized variable usage. PR: kern/177164 Approved by: sbruno (mentor) Modified: head/sys/dev/ips/ips.c Modified: head/sys/dev/ips/ips.c ============================================================================== --- head/sys/dev/ips/ips.c Sun Apr 14 02:26:12 2013 (r249460) +++ head/sys/dev/ips/ips.c Sun Apr 14 02:42:40 2013 (r249461) @@ -578,7 +578,7 @@ static int ips_copperhead_queue_init(ips { int error; bus_dma_tag_t dmatag; - bus_dmamap_t dmamap; + bus_dmamap_t dmamap = NULL; if (bus_dma_tag_create( /* parent */ sc->adapter_dmatag, /* alignemnt */ 1, /* boundary */ 0, From owner-svn-src-all@FreeBSD.ORG Sun Apr 14 08:40:25 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1576FC55; Sun, 14 Apr 2013 08:40:25 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 089316ED; Sun, 14 Apr 2013 08:40:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3E8eOFP003624; Sun, 14 Apr 2013 08:40:24 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3E8eO4n003623; Sun, 14 Apr 2013 08:40:24 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201304140840.r3E8eO4n003623@svn.freebsd.org> From: Joel Dahl Date: Sun, 14 Apr 2013 08:40:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249462 - head/usr.bin/calendar/calendars X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Apr 2013 08:40:25 -0000 Author: joel (doc committer) Date: Sun Apr 14 08:40:24 2013 New Revision: 249462 URL: http://svnweb.freebsd.org/changeset/base/249462 Log: Correct spelling is "Christiaan Huygens". Submitted by: James J. Lippard Obtained from: OpenBSD Modified: head/usr.bin/calendar/calendars/calendar.birthday Modified: head/usr.bin/calendar/calendars/calendar.birthday ============================================================================== --- head/usr.bin/calendar/calendars/calendar.birthday Sun Apr 14 02:42:40 2013 (r249461) +++ head/usr.bin/calendar/calendars/calendar.birthday Sun Apr 14 08:40:24 2013 (r249462) @@ -120,7 +120,7 @@ 04/10 William Booth born, 1829, founder of the Salvation Army 04/13 Thomas Jefferson, 3rd President of the United States, born Shadwell Plantation, Albemarle County, Virginia, 1743 -04/14 Christian Huygen born, 1629, physicist & astronomer; +04/14 Christiaan Huygen born, 1629, physicist & astronomer; discovered Saturn's rings 04/15 Leonardo da Vinci born, 1452 04/16 Charles (Charlie) Chaplin (Sir) born in London, 1889 From owner-svn-src-all@FreeBSD.ORG Sun Apr 14 08:44:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DD9797A; Sun, 14 Apr 2013 08:44:12 +0000 (UTC) (envelope-from ronald-freebsd8@klop.yi.org) Received: from smarthost1.greenhost.nl (smarthost1.greenhost.nl [195.190.28.78]) by mx1.freebsd.org (Postfix) with ESMTP id A0C8678C; Sun, 14 Apr 2013 08:44:12 +0000 (UTC) Received: from smtp.greenhost.nl ([213.108.104.138]) by smarthost1.greenhost.nl with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1URIXh-0001zc-Ev; Sun, 14 Apr 2013 10:44:10 +0200 Received: from dhcp-077-251-158-153.chello.nl ([77.251.158.153] helo=pinky) by smtp.greenhost.nl with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from ) id 1URIXg-00022m-Tm; Sun, 14 Apr 2013 10:44:09 +0200 Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, "Joel Dahl" Subject: Re: svn commit: r249462 - head/usr.bin/calendar/calendars References: <201304140840.r3E8eO4n003623@svn.freebsd.org> Date: Sun, 14 Apr 2013 10:44:07 +0200 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: "Ronald Klop" Message-ID: In-Reply-To: <201304140840.r3E8eO4n003623@svn.freebsd.org> User-Agent: Opera Mail/12.15 (Win32) X-Virus-Scanned: by clamav at smarthost1.samage.net X-Spam-Level: / X-Spam-Score: 0.8 X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.1 X-Scan-Signature: 76f3589a93270604ea078d468a2051b3 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Apr 2013 08:44:12 -0000 Than you still miss a 's' at the end. Ronald. On Sun, 14 Apr 2013 10:40:24 +0200, Joel Dahl wrote: > Author: joel (doc committer) > Date: Sun Apr 14 08:40:24 2013 > New Revision: 249462 > URL: http://svnweb.freebsd.org/changeset/base/249462 > > Log: > Correct spelling is "Christiaan Huygens". > Submitted by: James J. Lippard > Obtained from: OpenBSD > > Modified: > head/usr.bin/calendar/calendars/calendar.birthday > > Modified: head/usr.bin/calendar/calendars/calendar.birthday > ============================================================================== > --- head/usr.bin/calendar/calendars/calendar.birthday Sun Apr 14 > 02:42:40 2013 (r249461) > +++ head/usr.bin/calendar/calendars/calendar.birthday Sun Apr 14 > 08:40:24 2013 (r249462) > @@ -120,7 +120,7 @@ > 04/10 William Booth born, 1829, founder of the Salvation Army > 04/13 Thomas Jefferson, 3rd President of the United States, born > Shadwell > Plantation, Albemarle County, Virginia, 1743 > -04/14 Christian Huygen born, 1629, physicist & astronomer; > +04/14 Christiaan Huygen born, 1629, physicist & astronomer; > discovered Saturn's rings > 04/15 Leonardo da Vinci born, 1452 > 04/16 Charles (Charlie) Chaplin (Sir) born in London, 1889 > _______________________________________________ > svn-src-all@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" From owner-svn-src-all@FreeBSD.ORG Sun Apr 14 08:47:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 77F8D224; Sun, 14 Apr 2013 08:47:02 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6B0B279E; Sun, 14 Apr 2013 08:47:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3E8l2QW004691; Sun, 14 Apr 2013 08:47:02 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3E8l2UM004690; Sun, 14 Apr 2013 08:47:02 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201304140847.r3E8l2UM004690@svn.freebsd.org> From: Joel Dahl Date: Sun, 14 Apr 2013 08:47:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249463 - head/usr.bin/calendar/calendars X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Apr 2013 08:47:02 -0000 Author: joel (doc committer) Date: Sun Apr 14 08:47:01 2013 New Revision: 249463 URL: http://svnweb.freebsd.org/changeset/base/249463 Log: LSD first synthesised 16/11/38, not 7/4/43. Submitted by: James J. Lippard Obtained from: OpenBSD Modified: head/usr.bin/calendar/calendars/calendar.history Modified: head/usr.bin/calendar/calendars/calendar.history ============================================================================== --- head/usr.bin/calendar/calendars/calendar.history Sun Apr 14 08:40:24 2013 (r249462) +++ head/usr.bin/calendar/calendars/calendar.history Sun Apr 14 08:47:01 2013 (r249463) @@ -99,7 +99,6 @@ 04/04 Martin Luther King assassinated in Memphis, Tennessee, 1968 04/04 NATO Established, 1949 04/06 Joseph Smith founds Mormon Church, 1830 -04/07 Albert Hofmann synthesizes LSD in Switzerland, 1943 04/07 Alewives run, Cape Cod 04/08 Matthew Flinders and Nicolas Baudin meet in Encounter Bay, 1802 04/09 Lee surrenders to Grant at Appomattox Courthouse, 1865 @@ -420,6 +419,7 @@ from McDonald's), 1971 11/15 Niagara Falls power plant startup, 1896 11/16 Opening of the Suez Canal, 1869 +11/16 Albert Hofmann synthesizes LSD in Switzerland, 1938 11/17 46,000 meteoroids fall over AZ in 20 minutes, 1966 11/17 Richard Nixon says "I am not a crook.", 1973 11/18 First hydrogen bomb blasts Enewetok, 1952 From owner-svn-src-all@FreeBSD.ORG Sun Apr 14 08:49:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B078C3B8; Sun, 14 Apr 2013 08:49:35 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A36987B8; Sun, 14 Apr 2013 08:49:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3E8nZZa005053; Sun, 14 Apr 2013 08:49:35 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3E8nZZF005052; Sun, 14 Apr 2013 08:49:35 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201304140849.r3E8nZZF005052@svn.freebsd.org> From: Joel Dahl Date: Sun, 14 Apr 2013 08:49:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249464 - head/usr.bin/calendar/calendars X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Apr 2013 08:49:35 -0000 Author: joel (doc committer) Date: Sun Apr 14 08:49:35 2013 New Revision: 249464 URL: http://svnweb.freebsd.org/changeset/base/249464 Log: Fix typo from previous commit. Submitted by: Ronald Klop Modified: head/usr.bin/calendar/calendars/calendar.birthday Modified: head/usr.bin/calendar/calendars/calendar.birthday ============================================================================== --- head/usr.bin/calendar/calendars/calendar.birthday Sun Apr 14 08:47:01 2013 (r249463) +++ head/usr.bin/calendar/calendars/calendar.birthday Sun Apr 14 08:49:35 2013 (r249464) @@ -120,7 +120,7 @@ 04/10 William Booth born, 1829, founder of the Salvation Army 04/13 Thomas Jefferson, 3rd President of the United States, born Shadwell Plantation, Albemarle County, Virginia, 1743 -04/14 Christiaan Huygen born, 1629, physicist & astronomer; +04/14 Christiaan Huygens born, 1629, physicist & astronomer; discovered Saturn's rings 04/15 Leonardo da Vinci born, 1452 04/16 Charles (Charlie) Chaplin (Sir) born in London, 1889 From owner-svn-src-all@FreeBSD.ORG Sun Apr 14 09:28:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 943767FA; Sun, 14 Apr 2013 09:28:16 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 842DF84C; Sun, 14 Apr 2013 09:28:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3E9SG8t017194; Sun, 14 Apr 2013 09:28:16 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3E9SE1G017182; Sun, 14 Apr 2013 09:28:14 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201304140928.r3E9SE1G017182@svn.freebsd.org> From: Alexander Motin Date: Sun, 14 Apr 2013 09:28:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249466 - in head/sys/cam: . ata ctl scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Apr 2013 09:28:16 -0000 Author: mav Date: Sun Apr 14 09:28:14 2013 New Revision: 249466 URL: http://svnweb.freebsd.org/changeset/base/249466 Log: MFprojects/camlock r248890, r248897, r248898, r248900, r248903, r248905, r248917, r248918, r248978, r249001, r249014, r249030: Remove multilevel freezing mechanism, implemented to handle specifics of the ATA/SATA error recovery, when post-reset recovery commands should be allocated when queues are already full of payload requests. Instead of removing frozen CCBs with specified range of priorities from the queue to provide free openings, use simple hack, allowing explicit CCBs over- allocation for requests with priority higher (numerically lower) then CAM_PRIORITY_OOB threshold. Simplify CCB allocation logic by removing SIM-level allocation queue. After that SIM-level queue manages only CCBs execution, while allocation logic is localized within each single device. Suggested by: gibbs Modified: head/sys/cam/ata/ata_da.c head/sys/cam/ata/ata_xpt.c head/sys/cam/cam.h head/sys/cam/cam_ccb.h head/sys/cam/cam_periph.c head/sys/cam/cam_periph.h head/sys/cam/cam_queue.c head/sys/cam/cam_queue.h head/sys/cam/cam_xpt.c head/sys/cam/cam_xpt_internal.h head/sys/cam/cam_xpt_sim.h head/sys/cam/ctl/scsi_ctl.c head/sys/cam/scsi/scsi_cd.c head/sys/cam/scsi/scsi_pass.c head/sys/cam/scsi/scsi_xpt.c Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Sun Apr 14 09:05:40 2013 (r249465) +++ head/sys/cam/ata/ata_da.c Sun Apr 14 09:28:14 2013 (r249466) @@ -972,8 +972,6 @@ adaasync(void *callback_arg, u_int32_t c else break; cam_periph_acquire(periph); - cam_freeze_devq_arg(periph->path, - RELSIM_RELEASE_RUNLEVEL, CAM_RL_DEV + 1); xpt_schedule(periph, CAM_PRIORITY_DEV); } default: @@ -1297,15 +1295,11 @@ adaregister(struct cam_periph *periph, v cgd->ident_data.support.command1 & ATA_SUPPORT_LOOKAHEAD) { softc->state = ADA_STATE_RAHEAD; cam_periph_acquire(periph); - cam_freeze_devq_arg(periph->path, - RELSIM_RELEASE_RUNLEVEL, CAM_RL_DEV + 1); xpt_schedule(periph, CAM_PRIORITY_DEV); } else if (ADA_WC >= 0 && cgd->ident_data.support.command1 & ATA_SUPPORT_WRITECACHE) { softc->state = ADA_STATE_WCACHE; cam_periph_acquire(periph); - cam_freeze_devq_arg(periph->path, - RELSIM_RELEASE_RUNLEVEL, CAM_RL_DEV + 1); xpt_schedule(periph, CAM_PRIORITY_DEV); } else softc->state = ADA_STATE_NORMAL; @@ -1587,8 +1581,6 @@ out: if (softc->flags & ADA_FLAG_PACK_INVALID) { softc->state = ADA_STATE_NORMAL; xpt_release_ccb(start_ccb); - cam_release_devq(periph->path, - RELSIM_RELEASE_RUNLEVEL, 0, CAM_RL_DEV + 1, FALSE); adaschedule(periph); cam_periph_release_locked(periph); return; @@ -1612,6 +1604,7 @@ out: ATA_SF_ENAB_WCACHE : ATA_SF_DIS_WCACHE, 0, 0); start_ccb->ccb_h.ccb_state = ADA_CCB_WCACHE; } + start_ccb->ccb_h.flags |= CAM_DEV_QFREEZE; xpt_action(start_ccb); break; } @@ -1624,11 +1617,13 @@ adadone(struct cam_periph *periph, union struct ada_softc *softc; struct ccb_ataio *ataio; struct ccb_getdev *cgd; + struct cam_path *path; softc = (struct ada_softc *)periph->softc; ataio = &done_ccb->ataio; + path = done_ccb->ccb_h.path; - CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("adadone\n")); + CAM_DEBUG(path, CAM_DEBUG_TRACE, ("adadone\n")); switch (ataio->ccb_h.ccb_state & ADA_CCB_TYPE_MASK) { case ADA_CCB_BUFFER_IO: @@ -1656,8 +1651,7 @@ adadone(struct cam_periph *periph, union * XXX See if this is really a media * XXX change first? */ - xpt_print(periph->path, - "Invalidating pack\n"); + xpt_print(path, "Invalidating pack\n"); softc->flags |= ADA_FLAG_PACK_INVALID; } bp->bio_error = error; @@ -1670,7 +1664,7 @@ adadone(struct cam_periph *periph, union bp->bio_flags |= BIO_ERROR; } if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) - cam_release_devq(done_ccb->ccb_h.path, + cam_release_devq(path, /*relsim_flags*/0, /*reduction*/0, /*timeout*/0, @@ -1711,9 +1705,12 @@ adadone(struct cam_periph *periph, union { if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { if (adaerror(done_ccb, 0, 0) == ERESTART) { +out: + /* Drop freeze taken due to CAM_DEV_QFREEZE */ + cam_release_devq(path, 0, 0, 0, FALSE); return; } else if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) { - cam_release_devq(done_ccb->ccb_h.path, + cam_release_devq(path, /*relsim_flags*/0, /*reduction*/0, /*timeout*/0, @@ -1730,7 +1727,7 @@ adadone(struct cam_periph *periph, union * operation. */ cgd = (struct ccb_getdev *)done_ccb; - xpt_setup_ccb(&cgd->ccb_h, periph->path, CAM_PRIORITY_NORMAL); + xpt_setup_ccb(&cgd->ccb_h, path, CAM_PRIORITY_NORMAL); cgd->ccb_h.func_code = XPT_GDEV_TYPE; xpt_action((union ccb *)cgd); if (ADA_WC >= 0 && @@ -1738,12 +1735,12 @@ adadone(struct cam_periph *periph, union softc->state = ADA_STATE_WCACHE; xpt_release_ccb(done_ccb); xpt_schedule(periph, CAM_PRIORITY_DEV); - return; + goto out; } softc->state = ADA_STATE_NORMAL; xpt_release_ccb(done_ccb); - cam_release_devq(periph->path, - RELSIM_RELEASE_RUNLEVEL, 0, CAM_RL_DEV + 1, FALSE); + /* Drop freeze taken due to CAM_DEV_QFREEZE */ + cam_release_devq(path, 0, 0, 0, FALSE); adaschedule(periph); cam_periph_release_locked(periph); return; @@ -1752,9 +1749,9 @@ adadone(struct cam_periph *periph, union { if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { if (adaerror(done_ccb, 0, 0) == ERESTART) { - return; + goto out; } else if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) { - cam_release_devq(done_ccb->ccb_h.path, + cam_release_devq(path, /*relsim_flags*/0, /*reduction*/0, /*timeout*/0, @@ -1772,8 +1769,8 @@ adadone(struct cam_periph *periph, union * operation. */ xpt_release_ccb(done_ccb); - cam_release_devq(periph->path, - RELSIM_RELEASE_RUNLEVEL, 0, CAM_RL_DEV + 1, FALSE); + /* Drop freeze taken due to CAM_DEV_QFREEZE */ + cam_release_devq(path, 0, 0, 0, FALSE); adaschedule(periph); cam_periph_release_locked(periph); return; Modified: head/sys/cam/ata/ata_xpt.c ============================================================================== --- head/sys/cam/ata/ata_xpt.c Sun Apr 14 09:05:40 2013 (r249465) +++ head/sys/cam/ata/ata_xpt.c Sun Apr 14 09:28:14 2013 (r249466) @@ -249,12 +249,6 @@ proberegister(struct cam_periph *periph, return (status); } CAM_DEBUG(periph->path, CAM_DEBUG_PROBE, ("Probe started\n")); - - /* - * Ensure nobody slip in until probe finish. - */ - cam_freeze_devq_arg(periph->path, - RELSIM_RELEASE_RUNLEVEL, CAM_RL_XPT + 1); probeschedule(periph); return(CAM_REQ_CMP); } @@ -661,6 +655,7 @@ negotiate: default: panic("probestart: invalid action state 0x%x\n", softc->action); } + start_ccb->ccb_h.flags |= CAM_DEV_QFREEZE; xpt_action(start_ccb); } @@ -708,12 +703,15 @@ probedone(struct cam_periph *periph, uni if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { if (cam_periph_error(done_ccb, 0, softc->restart ? (SF_NO_RECOVERY | SF_NO_RETRY) : 0, - NULL) == ERESTART) + NULL) == ERESTART) { +out: + /* Drop freeze taken due to CAM_DEV_QFREEZE flag set. */ + cam_release_devq(path, 0, 0, 0, FALSE); return; + } if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) { /* Don't wedge the queue */ - xpt_release_devq(done_ccb->ccb_h.path, /*count*/1, - /*run_queue*/TRUE); + xpt_release_devq(path, /*count*/1, /*run_queue*/TRUE); } status = done_ccb->ccb_h.status & CAM_STATUS_MASK; if (softc->restart) { @@ -768,7 +766,7 @@ probedone(struct cam_periph *periph, uni PROBE_SET_ACTION(softc, PROBE_IDENTIFY_SAFTE); xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); - return; + goto out; } /* @@ -830,7 +828,7 @@ noerror: } xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); - return; + goto out; } case PROBE_IDENTIFY: { @@ -864,7 +862,7 @@ noerror: PROBE_SET_ACTION(softc, PROBE_SPINUP); xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); - return; + goto out; } ident_buf = &path->device->ident_data; if ((periph->path->device->flags & CAM_DEV_UNCONFIGURED) == 0) { @@ -954,7 +952,7 @@ noerror: PROBE_SET_ACTION(softc, PROBE_SETMODE); xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); - return; + goto out; } case PROBE_SPINUP: if (bootverbose) @@ -963,7 +961,7 @@ noerror: PROBE_SET_ACTION(softc, PROBE_IDENTIFY); xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); - return; + goto out; case PROBE_SETMODE: /* Set supported bits. */ bzero(&cts, sizeof(cts)); @@ -1034,7 +1032,7 @@ noerror: PROBE_SET_ACTION(softc, PROBE_SETPM); xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); - return; + goto out; } /* FALLTHROUGH */ case PROBE_SETPM: @@ -1045,7 +1043,7 @@ noerror: PROBE_SET_ACTION(softc, PROBE_SETAPST); xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); - return; + goto out; } /* FALLTHROUGH */ case PROBE_SETAPST: @@ -1055,7 +1053,7 @@ noerror: PROBE_SET_ACTION(softc, PROBE_SETDMAAA); xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); - return; + goto out; } /* FALLTHROUGH */ case PROBE_SETDMAAA: @@ -1065,7 +1063,7 @@ noerror: PROBE_SET_ACTION(softc, PROBE_SETAN); xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); - return; + goto out; } /* FALLTHROUGH */ case PROBE_SETAN: @@ -1077,15 +1075,14 @@ notsata: } xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); - return; + goto out; case PROBE_SET_MULTI: if (periph->path->device->flags & CAM_DEV_UNCONFIGURED) { path->device->flags &= ~CAM_DEV_UNCONFIGURED; xpt_acquire_device(path->device); done_ccb->ccb_h.func_code = XPT_GDEV_TYPE; xpt_action(done_ccb); - xpt_async(AC_FOUND_DEVICE, done_ccb->ccb_h.path, - done_ccb); + xpt_async(AC_FOUND_DEVICE, path, done_ccb); } PROBE_SET_ACTION(softc, PROBE_DONE); break; @@ -1118,7 +1115,7 @@ notsata: PROBE_SET_ACTION(softc, PROBE_FULL_INQUIRY); xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); - return; + goto out; } ata_device_transport(path); @@ -1127,7 +1124,7 @@ notsata: xpt_acquire_device(path->device); done_ccb->ccb_h.func_code = XPT_GDEV_TYPE; xpt_action(done_ccb); - xpt_async(AC_FOUND_DEVICE, done_ccb->ccb_h.path, done_ccb); + xpt_async(AC_FOUND_DEVICE, path, done_ccb); } PROBE_SET_ACTION(softc, PROBE_DONE); break; @@ -1145,7 +1142,7 @@ notsata: PROBE_SET_ACTION(softc, PROBE_PM_PRV); xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); - return; + goto out; case PROBE_PM_PRV: softc->pm_prv = (done_ccb->ataio.res.lba_high << 24) + (done_ccb->ataio.res.lba_mid << 16) + @@ -1200,12 +1197,11 @@ notsata: xpt_acquire_device(path->device); done_ccb->ccb_h.func_code = XPT_GDEV_TYPE; xpt_action(done_ccb); - xpt_async(AC_FOUND_DEVICE, done_ccb->ccb_h.path, - done_ccb); + xpt_async(AC_FOUND_DEVICE, path, done_ccb); } else { done_ccb->ccb_h.func_code = XPT_GDEV_TYPE; xpt_action(done_ccb); - xpt_async(AC_SCSI_AEN, done_ccb->ccb_h.path, done_ccb); + xpt_async(AC_SCSI_AEN, path, done_ccb); } PROBE_SET_ACTION(softc, PROBE_DONE); break; @@ -1250,8 +1246,7 @@ notsata: xpt_acquire_device(path->device); done_ccb->ccb_h.func_code = XPT_GDEV_TYPE; xpt_action(done_ccb); - xpt_async(AC_FOUND_DEVICE, done_ccb->ccb_h.path, - done_ccb); + xpt_async(AC_FOUND_DEVICE, path, done_ccb); } PROBE_SET_ACTION(softc, PROBE_DONE); break; @@ -1263,7 +1258,7 @@ done: softc->restart = 0; xpt_release_ccb(done_ccb); probeschedule(periph); - return; + goto out; } xpt_release_ccb(done_ccb); CAM_DEBUG(periph->path, CAM_DEBUG_PROBE, ("Probe completed\n")); @@ -1273,9 +1268,9 @@ done: done_ccb->ccb_h.status = found ? CAM_REQ_CMP : CAM_REQ_CMP_ERR; xpt_done(done_ccb); } + /* Drop freeze taken due to CAM_DEV_QFREEZE flag set. */ + cam_release_devq(path, 0, 0, 0, FALSE); cam_periph_invalidate(periph); - cam_release_devq(periph->path, - RELSIM_RELEASE_RUNLEVEL, 0, CAM_RL_XPT + 1, FALSE); cam_periph_release_locked(periph); } Modified: head/sys/cam/cam.h ============================================================================== --- head/sys/cam/cam.h Sun Apr 14 09:05:40 2013 (r249465) +++ head/sys/cam/cam.h Sun Apr 14 09:28:14 2013 (r249466) @@ -80,10 +80,9 @@ typedef struct { #define CAM_PRIORITY_BUS ((CAM_RL_BUS << 8) + 0x80) #define CAM_PRIORITY_XPT ((CAM_RL_XPT << 8) + 0x80) #define CAM_PRIORITY_DEV ((CAM_RL_DEV << 8) + 0x80) +#define CAM_PRIORITY_OOB (CAM_RL_DEV << 8) #define CAM_PRIORITY_NORMAL ((CAM_RL_NORMAL << 8) + 0x80) #define CAM_PRIORITY_NONE (u_int32_t)-1 -#define CAM_PRIORITY_TO_RL(x) ((x) >> 8) -#define CAM_RL_TO_PRIORITY(x) ((x) << 8) u_int32_t generation; int index; #define CAM_UNQUEUED_INDEX -1 Modified: head/sys/cam/cam_ccb.h ============================================================================== --- head/sys/cam/cam_ccb.h Sun Apr 14 09:05:40 2013 (r249465) +++ head/sys/cam/cam_ccb.h Sun Apr 14 09:28:14 2013 (r249466) @@ -145,8 +145,6 @@ typedef enum { /* Path statistics (error counts, etc.) */ XPT_GDEV_STATS = 0x0c, /* Device statistics (error counts, etc.) */ - XPT_FREEZE_QUEUE = 0x0d, - /* Freeze device queue */ XPT_DEV_ADVINFO = 0x0e, /* Get/Set Device advanced information */ /* SCSI Control Functions: 0x10->0x1F */ @@ -749,7 +747,6 @@ struct ccb_relsim { #define RELSIM_RELEASE_AFTER_TIMEOUT 0x02 #define RELSIM_RELEASE_AFTER_CMDCMPLT 0x04 #define RELSIM_RELEASE_AFTER_QEMPTY 0x08 -#define RELSIM_RELEASE_RUNLEVEL 0x10 u_int32_t openings; u_int32_t release_timeout; /* Abstract argument. */ u_int32_t qfrozen_cnt; Modified: head/sys/cam/cam_periph.c ============================================================================== --- head/sys/cam/cam_periph.c Sun Apr 14 09:05:40 2013 (r249465) +++ head/sys/cam/cam_periph.c Sun Apr 14 09:28:14 2013 (r249466) @@ -1117,21 +1117,12 @@ cam_periph_runccb(union ccb *ccb, void cam_freeze_devq(struct cam_path *path) { + struct ccb_hdr ccb_h; - cam_freeze_devq_arg(path, 0, 0); -} - -void -cam_freeze_devq_arg(struct cam_path *path, uint32_t flags, uint32_t arg) -{ - struct ccb_relsim crs; - - xpt_setup_ccb(&crs.ccb_h, path, CAM_PRIORITY_NONE); - crs.ccb_h.func_code = XPT_FREEZE_QUEUE; - crs.release_flags = flags; - crs.openings = arg; - crs.release_timeout = arg; - xpt_action((union ccb *)&crs); + xpt_setup_ccb(&ccb_h, path, /*priority*/1); + ccb_h.func_code = XPT_NOOP; + ccb_h.flags = CAM_DEV_QFREEZE; + xpt_action((union ccb *)&ccb_h); } u_int32_t Modified: head/sys/cam/cam_periph.h ============================================================================== --- head/sys/cam/cam_periph.h Sun Apr 14 09:05:40 2013 (r249465) +++ head/sys/cam/cam_periph.h Sun Apr 14 09:28:14 2013 (r249466) @@ -171,8 +171,6 @@ int cam_periph_ioctl(struct cam_periph cam_flags camflags, u_int32_t sense_flags)); void cam_freeze_devq(struct cam_path *path); -void cam_freeze_devq_arg(struct cam_path *path, u_int32_t flags, - uint32_t arg); u_int32_t cam_release_devq(struct cam_path *path, u_int32_t relsim_flags, u_int32_t opening_reduction, u_int32_t arg, int getcount_only); Modified: head/sys/cam/cam_queue.c ============================================================================== --- head/sys/cam/cam_queue.c Sun Apr 14 09:05:40 2013 (r249465) +++ head/sys/cam/cam_queue.c Sun Apr 14 09:28:14 2013 (r249466) @@ -230,15 +230,8 @@ int cam_devq_init(struct cam_devq *devq, int devices, int openings) { bzero(devq, sizeof(*devq)); - if (camq_init(&devq->alloc_queue, devices) != 0) { + if (camq_init(&devq->send_queue, devices) != 0) return (1); - } - if (camq_init(&devq->send_queue, devices) != 0) { - camq_fini(&devq->alloc_queue); - return (1); - } - devq->alloc_openings = openings; - devq->alloc_active = 0; devq->send_openings = openings; devq->send_active = 0; return (0); @@ -247,7 +240,6 @@ cam_devq_init(struct cam_devq *devq, int void cam_devq_free(struct cam_devq *devq) { - camq_fini(&devq->alloc_queue); camq_fini(&devq->send_queue); free(devq, M_CAMDEVQ); } @@ -257,11 +249,7 @@ cam_devq_resize(struct cam_devq *camq, i { u_int32_t retval; - retval = camq_resize(&camq->alloc_queue, devices); - - if (retval == CAM_REQ_CMP) - retval = camq_resize(&camq->send_queue, devices); - + retval = camq_resize(&camq->send_queue, devices); return (retval); } @@ -328,11 +316,10 @@ int cam_ccbq_init(struct cam_ccbq *ccbq, int openings) { bzero(ccbq, sizeof(*ccbq)); - if (camq_init(&ccbq->queue, openings + (CAM_RL_VALUES - 1)) != 0) { + if (camq_init(&ccbq->queue, openings + (CAM_RL_VALUES - 1)) != 0) return (1); - } ccbq->devq_openings = openings; - ccbq->dev_openings = openings; + ccbq->dev_openings = openings; return (0); } Modified: head/sys/cam/cam_queue.h ============================================================================== --- head/sys/cam/cam_queue.h Sun Apr 14 09:05:40 2013 (r249465) +++ head/sys/cam/cam_queue.h Sun Apr 14 09:28:14 2013 (r249466) @@ -48,7 +48,7 @@ struct camq { int array_size; int entries; u_int32_t generation; - u_int32_t qfrozen_cnt[CAM_RL_VALUES]; + u_int32_t qfrozen_cnt; }; TAILQ_HEAD(ccb_hdr_tailq, ccb_hdr); @@ -58,7 +58,8 @@ SLIST_HEAD(ccb_hdr_slist, ccb_hdr); struct cam_ccbq { struct camq queue; int devq_openings; - int dev_openings; + int devq_allocating; + int dev_openings; int dev_active; int held; }; @@ -66,11 +67,7 @@ struct cam_ccbq { struct cam_ed; struct cam_devq { - struct camq alloc_queue; struct camq send_queue; - struct cam_ed *active_dev; - int alloc_openings; - int alloc_active; int send_openings; int send_active; }; @@ -195,8 +192,7 @@ cam_ccbq_insert_ccb(struct cam_ccbq *ccb { ccbq->held--; camq_insert(&ccbq->queue, &new_ccb->ccb_h.pinfo); - if (ccbq->queue.qfrozen_cnt[CAM_PRIORITY_TO_RL( - new_ccb->ccb_h.pinfo.priority)] > 0) { + if (ccbq->queue.qfrozen_cnt > 0) { ccbq->devq_openings++; ccbq->held++; return (1); @@ -208,8 +204,7 @@ static __inline int cam_ccbq_remove_ccb(struct cam_ccbq *ccbq, union ccb *ccb) { camq_remove(&ccbq->queue, ccb->ccb_h.pinfo.index); - if (ccbq->queue.qfrozen_cnt[CAM_PRIORITY_TO_RL( - ccb->ccb_h.pinfo.priority)] > 0) { + if (ccbq->queue.qfrozen_cnt > 0) { ccbq->devq_openings--; ccbq->held--; return (1); @@ -248,81 +243,5 @@ cam_ccbq_release_opening(struct cam_ccbq ccbq->devq_openings++; } -static __inline int -cam_ccbq_freeze(struct cam_ccbq *ccbq, cam_rl rl, u_int32_t cnt) -{ - int i, frozen = 0; - cam_rl p, n; - - /* Find pevious run level. */ - for (p = 0; p < CAM_RL_VALUES && ccbq->queue.qfrozen_cnt[p] == 0; p++); - /* Find new run level. */ - n = min(rl, p); - /* Apply new run level. */ - for (i = rl; i < CAM_RL_VALUES; i++) - ccbq->queue.qfrozen_cnt[i] += cnt; - /* Update ccbq statistics. */ - if (n == p) - return (0); - for (i = CAMQ_HEAD; i <= ccbq->queue.entries; i++) { - cam_rl rrl = - CAM_PRIORITY_TO_RL(ccbq->queue.queue_array[i]->priority); - if (rrl < n) - continue; - if (rrl >= p) - break; - ccbq->devq_openings++; - ccbq->held++; - frozen++; - } - return (frozen); -} - -static __inline int -cam_ccbq_release(struct cam_ccbq *ccbq, cam_rl rl, u_int32_t cnt) -{ - int i, released = 0; - cam_rl p, n; - - /* Apply new run level. */ - for (i = rl; i < CAM_RL_VALUES; i++) - ccbq->queue.qfrozen_cnt[i] -= cnt; - /* Find new run level. */ - for (n = 0; n < CAM_RL_VALUES && ccbq->queue.qfrozen_cnt[n] == 0; n++); - /* Find previous run level. */ - p = min(rl, n); - /* Update ccbq statistics. */ - if (n == p) - return (0); - for (i = CAMQ_HEAD; i <= ccbq->queue.entries; i++) { - cam_rl rrl = - CAM_PRIORITY_TO_RL(ccbq->queue.queue_array[i]->priority); - if (rrl < p) - continue; - if (rrl >= n) - break; - ccbq->devq_openings--; - ccbq->held--; - released++; - } - return (released); -} - -static __inline u_int32_t -cam_ccbq_frozen(struct cam_ccbq *ccbq, cam_rl rl) -{ - - return (ccbq->queue.qfrozen_cnt[rl]); -} - -static __inline u_int32_t -cam_ccbq_frozen_top(struct cam_ccbq *ccbq) -{ - cam_rl rl; - - rl = CAM_PRIORITY_TO_RL(CAMQ_GET_PRIO(&ccbq->queue)); - return (ccbq->queue.qfrozen_cnt[rl]); -} - #endif /* _KERNEL */ #endif /* _CAM_CAM_QUEUE_H */ Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Sun Apr 14 09:05:40 2013 (r249465) +++ head/sys/cam/cam_xpt.c Sun Apr 14 09:28:14 2013 (r249466) @@ -223,13 +223,13 @@ static void xpt_async_bcast(struct asyn static path_id_t xptnextfreepathid(void); static path_id_t xptpathid(const char *sim_name, int sim_unit, int sim_bus); static union ccb *xpt_get_ccb(struct cam_ed *device); -static void xpt_run_dev_allocq(struct cam_eb *bus); -static void xpt_run_dev_sendq(struct cam_eb *bus); +static void xpt_run_dev_allocq(struct cam_ed *device); +static void xpt_run_devq(struct cam_devq *devq); static timeout_t xpt_release_devq_timeout; static void xpt_release_simq_timeout(void *arg) __unused; static void xpt_release_bus(struct cam_eb *bus); -static void xpt_release_devq_device(struct cam_ed *dev, cam_rl rl, - u_int count, int run_queue); +static void xpt_release_devq_device(struct cam_ed *dev, u_int count, + int run_queue); static struct cam_et* xpt_alloc_target(struct cam_eb *bus, target_id_t target_id); static void xpt_release_target(struct cam_et *target); @@ -296,49 +296,24 @@ static xpt_busfunc_t xptsetasyncbusfunc; static cam_status xptregister(struct cam_periph *periph, void *arg); static __inline int periph_is_queued(struct cam_periph *periph); -static __inline int device_is_alloc_queued(struct cam_ed *device); -static __inline int device_is_send_queued(struct cam_ed *device); +static __inline int device_is_queued(struct cam_ed *device); static __inline int -xpt_schedule_dev_allocq(struct cam_eb *bus, struct cam_ed *dev) -{ - int retval; - - if ((dev->drvq.entries > 0) && - (dev->ccbq.devq_openings > 0) && - (cam_ccbq_frozen(&dev->ccbq, CAM_PRIORITY_TO_RL( - CAMQ_GET_PRIO(&dev->drvq))) == 0)) { - /* - * The priority of a device waiting for CCB resources - * is that of the highest priority peripheral driver - * enqueued. - */ - retval = xpt_schedule_dev(&bus->sim->devq->alloc_queue, - &dev->alloc_ccb_entry.pinfo, - CAMQ_GET_PRIO(&dev->drvq)); - } else { - retval = 0; - } - - return (retval); -} - -static __inline int -xpt_schedule_dev_sendq(struct cam_eb *bus, struct cam_ed *dev) +xpt_schedule_devq(struct cam_devq *devq, struct cam_ed *dev) { int retval; if ((dev->ccbq.queue.entries > 0) && (dev->ccbq.dev_openings > 0) && - (cam_ccbq_frozen_top(&dev->ccbq) == 0)) { + (dev->ccbq.queue.qfrozen_cnt == 0)) { /* * The priority of a device waiting for controller * resources is that of the highest priority CCB * enqueued. */ retval = - xpt_schedule_dev(&bus->sim->devq->send_queue, - &dev->send_ccb_entry.pinfo, + xpt_schedule_dev(&devq->send_queue, + &dev->devq_entry.pinfo, CAMQ_GET_PRIO(&dev->ccbq.queue)); } else { retval = 0; @@ -353,15 +328,9 @@ periph_is_queued(struct cam_periph *peri } static __inline int -device_is_alloc_queued(struct cam_ed *device) -{ - return (device->alloc_ccb_entry.pinfo.index != CAM_UNQUEUED_INDEX); -} - -static __inline int -device_is_send_queued(struct cam_ed *device) +device_is_queued(struct cam_ed *device) { - return (device->send_ccb_entry.pinfo.index != CAM_UNQUEUED_INDEX); + return (device->devq_entry.pinfo.index != CAM_UNQUEUED_INDEX); } static void @@ -2487,17 +2456,10 @@ xpt_action_default(union ccb *start_ccb) case XPT_RESET_DEV: case XPT_ENG_EXEC: case XPT_SMP_IO: - { - int frozen; - - frozen = cam_ccbq_insert_ccb(&path->device->ccbq, start_ccb); - path->device->sim->devq->alloc_openings += frozen; - if (frozen > 0) - xpt_run_dev_allocq(path->bus); - if (xpt_schedule_dev_sendq(path->bus, path->device)) - xpt_run_dev_sendq(path->bus); + cam_ccbq_insert_ccb(&path->device->ccbq, start_ccb); + if (xpt_schedule_devq(path->bus->sim->devq, path->device)) + xpt_run_devq(path->bus->sim->devq); break; - } case XPT_CALC_GEOMETRY: { struct cam_sim *sim; @@ -2546,8 +2508,7 @@ xpt_action_default(union ccb *start_ccb) device = abort_ccb->ccb_h.path->device; ccbq = &device->ccbq; - device->sim->devq->alloc_openings -= - cam_ccbq_remove_ccb(ccbq, abort_ccb); + cam_ccbq_remove_ccb(ccbq, abort_ccb); abort_ccb->ccb_h.status = CAM_REQ_ABORTED|CAM_DEV_QFRZN; xpt_freeze_devq(abort_ccb->ccb_h.path, 1); @@ -2928,13 +2889,9 @@ xpt_action_default(union ccb *start_ccb) } } - if ((start_ccb->ccb_h.flags & CAM_DEV_QFREEZE) == 0) { - xpt_release_devq_rl(path, /*runlevel*/ - (crs->release_flags & RELSIM_RELEASE_RUNLEVEL) ? - crs->release_timeout : 0, - /*count*/1, /*run_queue*/TRUE); - } - start_ccb->crs.qfrozen_cnt = dev->ccbq.queue.qfrozen_cnt[0]; + if ((start_ccb->ccb_h.flags & CAM_DEV_QFREEZE) == 0) + xpt_release_devq(path, /*count*/1, /*run_queue*/TRUE); + start_ccb->crs.qfrozen_cnt = dev->ccbq.queue.qfrozen_cnt; start_ccb->ccb_h.status = CAM_REQ_CMP; break; } @@ -2977,16 +2934,6 @@ xpt_action_default(union ccb *start_ccb) start_ccb->ccb_h.status = CAM_REQ_CMP; break; } - case XPT_FREEZE_QUEUE: - { - struct ccb_relsim *crs = &start_ccb->crs; - - xpt_freeze_devq_rl(path, /*runlevel*/ - (crs->release_flags & RELSIM_RELEASE_RUNLEVEL) ? - crs->release_timeout : 0, /*count*/1); - start_ccb->ccb_h.status = CAM_REQ_CMP; - break; - } case XPT_NOOP: if ((start_ccb->ccb_h.flags & CAM_DEV_QFREEZE) != 0) xpt_freeze_devq(path, 1); @@ -3092,7 +3039,7 @@ xpt_schedule(struct cam_periph *perph, u camq_change_priority(&device->drvq, perph->pinfo.index, new_priority); - runq = xpt_schedule_dev_allocq(perph->path->bus, device); + runq = 1; } } else { /* New entry on the queue */ @@ -3101,12 +3048,12 @@ xpt_schedule(struct cam_periph *perph, u perph->pinfo.priority = new_priority; perph->pinfo.generation = ++device->drvq.generation; camq_insert(&device->drvq, &perph->pinfo); - runq = xpt_schedule_dev_allocq(perph->path->bus, device); + runq = 1; } if (runq != 0) { CAM_DEBUG(perph->path, CAM_DEBUG_SUBTRACE, - (" calling xpt_run_devq\n")); - xpt_run_dev_allocq(perph->path->bus); + (" calling xpt_run_dev_allocq\n")); + xpt_run_dev_allocq(device); } } @@ -3159,43 +3106,25 @@ xpt_schedule_dev(struct camq *queue, cam } static void -xpt_run_dev_allocq(struct cam_eb *bus) +xpt_run_dev_allocq(struct cam_ed *device) { - struct cam_devq *devq; - - CAM_DEBUG_PRINT(CAM_DEBUG_XPT, ("xpt_run_dev_allocq\n")); - devq = bus->sim->devq; + struct camq *drvq; - CAM_DEBUG_PRINT(CAM_DEBUG_XPT, - (" qfrozen_cnt == 0x%x, entries == %d, " - "openings == %d, active == %d\n", - devq->alloc_queue.qfrozen_cnt[0], - devq->alloc_queue.entries, - devq->alloc_openings, - devq->alloc_active)); - - devq->alloc_queue.qfrozen_cnt[0]++; - while ((devq->alloc_queue.entries > 0) - && (devq->alloc_openings > 0) - && (devq->alloc_queue.qfrozen_cnt[0] <= 1)) { - struct cam_ed_qinfo *qinfo; - struct cam_ed *device; + if (device->ccbq.devq_allocating) + return; + device->ccbq.devq_allocating = 1; + CAM_DEBUG_PRINT(CAM_DEBUG_XPT, ("xpt_run_dev_allocq(%p)\n", device)); + drvq = &device->drvq; + while ((drvq->entries > 0) && + (device->ccbq.devq_openings > 0 || + CAMQ_GET_PRIO(drvq) <= CAM_PRIORITY_OOB) && + (device->ccbq.queue.qfrozen_cnt == 0)) { union ccb *work_ccb; struct cam_periph *drv; - struct camq *drvq; - qinfo = (struct cam_ed_qinfo *)camq_remove(&devq->alloc_queue, - CAMQ_HEAD); - device = qinfo->device; - CAM_DEBUG_PRINT(CAM_DEBUG_XPT, - ("running device %p\n", device)); - - drvq = &device->drvq; KASSERT(drvq->entries > 0, ("xpt_run_dev_allocq: " "Device on queue without any work to do")); if ((work_ccb = xpt_get_ccb(device)) != NULL) { - devq->alloc_openings--; - devq->alloc_active++; drv = (struct cam_periph*)camq_remove(drvq, CAMQ_HEAD); xpt_setup_ccb(&work_ccb->ccb_h, drv->path, drv->pinfo.priority); @@ -3214,27 +3143,21 @@ xpt_run_dev_allocq(struct cam_eb *bus) */ break; } - - /* We may have more work. Attempt to reschedule. */ - xpt_schedule_dev_allocq(bus, device); } - devq->alloc_queue.qfrozen_cnt[0]--; + device->ccbq.devq_allocating = 0; } static void -xpt_run_dev_sendq(struct cam_eb *bus) +xpt_run_devq(struct cam_devq *devq) { - struct cam_devq *devq; char cdb_str[(SCSI_MAX_CDBLEN * 3) + 1]; - CAM_DEBUG_PRINT(CAM_DEBUG_XPT, ("xpt_run_dev_sendq\n")); - - devq = bus->sim->devq; + CAM_DEBUG_PRINT(CAM_DEBUG_XPT, ("xpt_run_devq\n")); - devq->send_queue.qfrozen_cnt[0]++; + devq->send_queue.qfrozen_cnt++; while ((devq->send_queue.entries > 0) && (devq->send_openings > 0) - && (devq->send_queue.qfrozen_cnt[0] <= 1)) { + && (devq->send_queue.qfrozen_cnt <= 1)) { struct cam_ed_qinfo *qinfo; struct cam_ed *device; union ccb *work_ccb; @@ -3284,9 +3207,9 @@ xpt_run_dev_sendq(struct cam_eb *bus) devq->send_openings--; devq->send_active++; - xpt_schedule_dev_sendq(bus, device); + xpt_schedule_devq(devq, device); - if (work_ccb && (work_ccb->ccb_h.flags & CAM_DEV_QFREEZE) != 0){ + if ((work_ccb->ccb_h.flags & CAM_DEV_QFREEZE) != 0) { /* * The client wants to freeze the queue * after this CCB is sent. @@ -3336,7 +3259,7 @@ xpt_run_dev_sendq(struct cam_eb *bus) sim = work_ccb->ccb_h.path->bus->sim; (*(sim->sim_action))(sim, work_ccb); } - devq->send_queue.qfrozen_cnt[0]--; + devq->send_queue.qfrozen_cnt--; } /* @@ -3799,14 +3722,7 @@ xpt_release_ccb(union ccb *free_ccb) SLIST_INSERT_HEAD(&sim->ccb_freeq, &free_ccb->ccb_h, xpt_links.sle); } - if (sim->devq == NULL) { - return; - } - sim->devq->alloc_openings++; - sim->devq->alloc_active--; - if (device_is_alloc_queued(device) == 0) - xpt_schedule_dev_allocq(bus, device); - xpt_run_dev_allocq(bus); + xpt_run_dev_allocq(device); } /* Functions accessed by SIM drivers */ @@ -4153,34 +4069,18 @@ xpt_dev_async_default(u_int32_t async_co } u_int32_t -xpt_freeze_devq_rl(struct cam_path *path, cam_rl rl, u_int count) +xpt_freeze_devq(struct cam_path *path, u_int count) { struct cam_ed *dev = path->device; mtx_assert(path->bus->sim->mtx, MA_OWNED); - dev->sim->devq->alloc_openings += - cam_ccbq_freeze(&dev->ccbq, rl, count); - /* Remove frozen device from allocq. */ - if (device_is_alloc_queued(dev) && - cam_ccbq_frozen(&dev->ccbq, CAM_PRIORITY_TO_RL( - CAMQ_GET_PRIO(&dev->drvq)))) { - camq_remove(&dev->sim->devq->alloc_queue, - dev->alloc_ccb_entry.pinfo.index); - } + dev->ccbq.queue.qfrozen_cnt += count; /* Remove frozen device from sendq. */ - if (device_is_send_queued(dev) && - cam_ccbq_frozen_top(&dev->ccbq)) { + if (device_is_queued(dev)) { camq_remove(&dev->sim->devq->send_queue, - dev->send_ccb_entry.pinfo.index); + dev->devq_entry.pinfo.index); } - return (dev->ccbq.queue.qfrozen_cnt[rl]); -} - -u_int32_t -xpt_freeze_devq(struct cam_path *path, u_int count) -{ - - return (xpt_freeze_devq_rl(path, 0, count)); + return (dev->ccbq.queue.qfrozen_cnt); } u_int32_t @@ -4188,8 +4088,8 @@ xpt_freeze_simq(struct cam_sim *sim, u_i { mtx_assert(sim->mtx, MA_OWNED); - sim->devq->send_queue.qfrozen_cnt[0] += count; - return (sim->devq->send_queue.qfrozen_cnt[0]); + sim->devq->send_queue.qfrozen_cnt += count; + return (sim->devq->send_queue.qfrozen_cnt); } static void @@ -4198,45 +4098,30 @@ xpt_release_devq_timeout(void *arg) struct cam_ed *device; device = (struct cam_ed *)arg; - - xpt_release_devq_device(device, /*rl*/0, /*count*/1, /*run_queue*/TRUE); + xpt_release_devq_device(device, /*count*/1, /*run_queue*/TRUE); } void xpt_release_devq(struct cam_path *path, u_int count, int run_queue) { - mtx_assert(path->bus->sim->mtx, MA_OWNED); - xpt_release_devq_device(path->device, /*rl*/0, count, run_queue); -} - -void -xpt_release_devq_rl(struct cam_path *path, cam_rl rl, u_int count, int run_queue) -{ mtx_assert(path->bus->sim->mtx, MA_OWNED); - - xpt_release_devq_device(path->device, rl, count, run_queue); + xpt_release_devq_device(path->device, count, run_queue); } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Apr 14 09:55:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id DADB5DA3; Sun, 14 Apr 2013 09:55:53 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BDFD18FB; Sun, 14 Apr 2013 09:55:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3E9trVe025781; Sun, 14 Apr 2013 09:55:53 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3E9tmv4025746; Sun, 14 Apr 2013 09:55:48 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201304140955.r3E9tmv4025746@svn.freebsd.org> From: Alexander Motin Date: Sun, 14 Apr 2013 09:55:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249468 - in head/sys: cam cam/ata cam/ctl cam/scsi dev/aac dev/arcmsr dev/ciss dev/firewire dev/hpt27xx dev/hptiop dev/hptrr dev/isci dev/iscsi/initiator dev/isp dev/mfi dev/mly dev/mp... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Apr 2013 09:55:53 -0000 Author: mav Date: Sun Apr 14 09:55:48 2013 New Revision: 249468 URL: http://svnweb.freebsd.org/changeset/base/249468 Log: MFprojects/camlock r248982: Stop abusing xpt_periph in random plases that really have no periph related to CCB, for example, bus scanning. NULL value is fine in such cases and it is correctly logged in debug messages as "noperiph". If at some point we need some real XPT periphs (alike to pmpX now), quite likely they will be per-bus, and not a single global instance as xpt_periph now. Modified: head/sys/cam/ata/ata_xpt.c head/sys/cam/cam_xpt.c head/sys/cam/ctl/ctl_frontend_cam_sim.c head/sys/cam/scsi/scsi_xpt.c head/sys/dev/aac/aac_cam.c head/sys/dev/arcmsr/arcmsr.c head/sys/dev/ciss/ciss.c head/sys/dev/firewire/sbp.c head/sys/dev/hpt27xx/osm_bsd.c head/sys/dev/hptiop/hptiop.c head/sys/dev/hptrr/hptrr_osm_bsd.c head/sys/dev/isci/isci_controller.c head/sys/dev/isci/isci_domain.c head/sys/dev/isci/isci_remote_device.c head/sys/dev/iscsi/initiator/isc_cam.c head/sys/dev/isp/isp_freebsd.c head/sys/dev/mfi/mfi_cam.c head/sys/dev/mly/mly.c head/sys/dev/mps/mps_sas.c head/sys/dev/mpt/mpt_cam.c head/sys/dev/mpt/mpt_raid.c head/sys/dev/twa/tw_osl_cam.c head/sys/dev/tws/tws_cam.c head/sys/dev/virtio/scsi/virtio_scsi.c Modified: head/sys/cam/ata/ata_xpt.c ============================================================================== --- head/sys/cam/ata/ata_xpt.c Sun Apr 14 09:38:28 2013 (r249467) +++ head/sys/cam/ata/ata_xpt.c Sun Apr 14 09:55:48 2013 (r249468) @@ -1439,7 +1439,7 @@ done: scan_info->counter = (scan_info->counter + 1 ) % (scan_info->cpi->max_target + 1); scan_next: - status = xpt_create_path(&path, xpt_periph, + status = xpt_create_path(&path, NULL, scan_info->request_ccb->ccb_h.path_id, scan_info->counter, 0); if (status != CAM_REQ_CMP) { @@ -1497,7 +1497,7 @@ ata_scan_lun(struct cam_periph *periph, "can't continue\n"); return; } - status = xpt_create_path(&new_path, xpt_periph, + status = xpt_create_path(&new_path, NULL, path->bus->path_id, path->target->target_id, path->device->lun_id); Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Sun Apr 14 09:38:28 2013 (r249467) +++ head/sys/cam/cam_xpt.c Sun Apr 14 09:55:48 2013 (r249468) @@ -451,7 +451,7 @@ xptioctl(struct cdev *dev, u_long cmd, c * Create a path using the bus, target, and lun the * user passed in. */ - if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, + if (xpt_create_path(&ccb->ccb_h.path, NULL, inccb->ccb_h.path_id, inccb->ccb_h.target_id, inccb->ccb_h.target_lun) != @@ -487,7 +487,7 @@ xptioctl(struct cdev *dev, u_long cmd, c * Create a path using the bus, target, and lun the * user passed in. */ - if (xpt_create_path(&ccb.ccb_h.path, xpt_periph, + if (xpt_create_path(&ccb.ccb_h.path, NULL, inccb->ccb_h.path_id, inccb->ccb_h.target_id, inccb->ccb_h.target_lun) != @@ -2918,7 +2918,7 @@ xpt_action_default(union ccb *start_ccb) CAM_SIM_LOCK(xpt_path_sim(start_ccb->ccb_h.path)); } if (start_ccb->cdbg.flags != CAM_DEBUG_NONE) { - if (xpt_create_path(&cam_dpath, xpt_periph, + if (xpt_create_path(&cam_dpath, NULL, start_ccb->ccb_h.path_id, start_ccb->ccb_h.target_id, start_ccb->ccb_h.target_lun) != @@ -4640,7 +4640,7 @@ xpt_config(void *arg) /* Setup debugging path */ if (cam_dflags != CAM_DEBUG_NONE) { - if (xpt_create_path_unlocked(&cam_dpath, xpt_periph, + if (xpt_create_path_unlocked(&cam_dpath, NULL, CAM_DEBUG_BUS, CAM_DEBUG_TARGET, CAM_DEBUG_LUN) != CAM_REQ_CMP) { printf("xpt_config: xpt_create_path() failed for debug" Modified: head/sys/cam/ctl/ctl_frontend_cam_sim.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_cam_sim.c Sun Apr 14 09:38:28 2013 (r249467) +++ head/sys/cam/ctl/ctl_frontend_cam_sim.c Sun Apr 14 09:55:48 2013 (r249468) @@ -311,7 +311,7 @@ cfcs_onoffline(void *arg, int online) goto bailout; } - if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, + if (xpt_create_path(&ccb->ccb_h.path, NULL, cam_sim_path(softc->sim), CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { printf("%s: can't allocate path for rescan\n", __func__); Modified: head/sys/cam/scsi/scsi_xpt.c ============================================================================== --- head/sys/cam/scsi/scsi_xpt.c Sun Apr 14 09:38:28 2013 (r249467) +++ head/sys/cam/scsi/scsi_xpt.c Sun Apr 14 09:55:48 2013 (r249468) @@ -1953,7 +1953,7 @@ scsi_scan_bus(struct cam_periph *periph, if (i == initiator_id) continue; - status = xpt_create_path(&path, xpt_periph, + status = xpt_create_path(&path, NULL, request_ccb->ccb_h.path_id, i, 0); if (status != CAM_REQ_CMP) { @@ -2154,7 +2154,7 @@ scsi_scan_bus(struct cam_periph *periph, xpt_free_ccb(request_ccb); break; } - status = xpt_create_path(&path, xpt_periph, + status = xpt_create_path(&path, NULL, scan_info->request_ccb->ccb_h.path_id, scan_info->counter, 0); if (status != CAM_REQ_CMP) { @@ -2177,7 +2177,7 @@ scsi_scan_bus(struct cam_periph *periph, request_ccb->crcn.flags = scan_info->request_ccb->crcn.flags; } else { - status = xpt_create_path(&path, xpt_periph, + status = xpt_create_path(&path, NULL, path_id, target_id, lun_id); /* * Free the old request path- we're done with it. We @@ -2250,7 +2250,7 @@ scsi_scan_lun(struct cam_periph *periph, "can't continue\n"); return; } - status = xpt_create_path(&new_path, xpt_periph, + status = xpt_create_path(&new_path, NULL, path->bus->path_id, path->target->target_id, path->device->lun_id); Modified: head/sys/dev/aac/aac_cam.c ============================================================================== --- head/sys/dev/aac/aac_cam.c Sun Apr 14 09:38:28 2013 (r249467) +++ head/sys/dev/aac/aac_cam.c Sun Apr 14 09:55:48 2013 (r249468) @@ -129,7 +129,7 @@ aac_cam_rescan(struct aac_softc *sc, uin return; } - if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, + if (xpt_create_path(&ccb->ccb_h.path, NULL, cam_sim_path(camsc->sim), target_id, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { xpt_free_ccb(ccb); Modified: head/sys/dev/arcmsr/arcmsr.c ============================================================================== --- head/sys/dev/arcmsr/arcmsr.c Sun Apr 14 09:38:28 2013 (r249467) +++ head/sys/dev/arcmsr/arcmsr.c Sun Apr 14 09:55:48 2013 (r249468) @@ -1599,7 +1599,8 @@ static void arcmsr_rescan_lun(struct Ada if ((ccb = (union ccb *)xpt_alloc_ccb_nowait()) == NULL) return; - if (xpt_create_path(&path, xpt_periph, cam_sim_path(acb->psim), target, lun) != CAM_REQ_CMP) + if (xpt_create_path(&path, NULL, cam_sim_path(acb->psim), target, lun) + != CAM_REQ_CMP) { xpt_free_ccb(ccb); return; Modified: head/sys/dev/ciss/ciss.c ============================================================================== --- head/sys/dev/ciss/ciss.c Sun Apr 14 09:38:28 2013 (r249467) +++ head/sys/dev/ciss/ciss.c Sun Apr 14 09:55:48 2013 (r249468) @@ -2913,7 +2913,7 @@ ciss_cam_rescan_target(struct ciss_softc return; } - if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, + if (xpt_create_path(&ccb->ccb_h.path, NULL, cam_sim_path(sc->ciss_cam_sim[bus]), target, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { ciss_printf(sc, "rescan failed (can't create path)\n"); Modified: head/sys/dev/firewire/sbp.c ============================================================================== --- head/sys/dev/firewire/sbp.c Sun Apr 14 09:38:28 2013 (r249467) +++ head/sys/dev/firewire/sbp.c Sun Apr 14 09:55:48 2013 (r249468) @@ -1086,7 +1086,7 @@ END_DEBUG sbp_xfer_free(xfer); if (sdev->path == NULL) - xpt_create_path(&sdev->path, xpt_periph, + xpt_create_path(&sdev->path, NULL, cam_sim_path(target->sbp->sim), target->target_id, sdev->lun_id); @@ -2039,7 +2039,7 @@ END_DEBUG if (xpt_bus_register(sbp->sim, dev, /*bus*/0) != CAM_SUCCESS) goto fail; - if (xpt_create_path(&sbp->path, xpt_periph, cam_sim_path(sbp->sim), + if (xpt_create_path(&sbp->path, NULL, cam_sim_path(sbp->sim), CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { xpt_bus_deregister(cam_sim_path(sbp->sim)); goto fail; Modified: head/sys/dev/hpt27xx/osm_bsd.c ============================================================================== --- head/sys/dev/hpt27xx/osm_bsd.c Sun Apr 14 09:38:28 2013 (r249467) +++ head/sys/dev/hpt27xx/osm_bsd.c Sun Apr 14 09:55:48 2013 (r249468) @@ -1347,7 +1347,7 @@ static int hpt_rescan_bus(void) #endif ldm_for_each_vbus(vbus, vbus_ext) { - if (xpt_create_path(&path, xpt_periph, cam_sim_path(vbus_ext->sim), + if (xpt_create_path(&path, NULL, cam_sim_path(vbus_ext->sim), CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) return(EIO); if ((ccb = malloc(sizeof(union ccb), M_TEMP, M_WAITOK)) == NULL) Modified: head/sys/dev/hptiop/hptiop.c ============================================================================== --- head/sys/dev/hptiop/hptiop.c Sun Apr 14 09:38:28 2013 (r249467) +++ head/sys/dev/hptiop/hptiop.c Sun Apr 14 09:55:48 2013 (r249468) @@ -1437,7 +1437,7 @@ static int hptiop_rescan_bus(struct hpt if ((ccb = xpt_alloc_ccb()) == NULL) return(ENOMEM); - if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, cam_sim_path(hba->sim), + if (xpt_create_path(&ccb->ccb_h.path, NULL, cam_sim_path(hba->sim), CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { xpt_free_ccb(ccb); return(EIO); Modified: head/sys/dev/hptrr/hptrr_osm_bsd.c ============================================================================== --- head/sys/dev/hptrr/hptrr_osm_bsd.c Sun Apr 14 09:38:28 2013 (r249467) +++ head/sys/dev/hptrr/hptrr_osm_bsd.c Sun Apr 14 09:55:48 2013 (r249468) @@ -1355,7 +1355,7 @@ static int hpt_rescan_bus(void) ldm_for_each_vbus(vbus, vbus_ext) { if ((ccb = xpt_alloc_ccb()) == NULL) return(ENOMEM); - if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, + if (xpt_create_path(&ccb->ccb_h.path, NULL, cam_sim_path(vbus_ext->sim), CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { xpt_free_ccb(ccb); Modified: head/sys/dev/isci/isci_controller.c ============================================================================== --- head/sys/dev/isci/isci_controller.c Sun Apr 14 09:38:28 2013 (r249467) +++ head/sys/dev/isci/isci_controller.c Sun Apr 14 09:55:48 2013 (r249468) @@ -580,7 +580,7 @@ void isci_controller_domain_discovery_co */ union ccb *ccb = xpt_alloc_ccb_nowait(); - xpt_create_path(&ccb->ccb_h.path, xpt_periph, + xpt_create_path(&ccb->ccb_h.path, NULL, cam_sim_path(isci_controller->sim), CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD); Modified: head/sys/dev/isci/isci_domain.c ============================================================================== --- head/sys/dev/isci/isci_domain.c Sun Apr 14 09:38:28 2013 (r249467) +++ head/sys/dev/isci/isci_domain.c Sun Apr 14 09:55:48 2013 (r249468) @@ -300,7 +300,7 @@ scif_cb_domain_device_removed(SCI_CONTRO isci_controller->remote_device[isci_remote_device->index] = NULL; - xpt_create_path(&ccb->ccb_h.path, xpt_periph, path, + xpt_create_path(&ccb->ccb_h.path, NULL, path, isci_remote_device->index, CAM_LUN_WILDCARD); xpt_rescan(ccb); Modified: head/sys/dev/isci/isci_remote_device.c ============================================================================== --- head/sys/dev/isci/isci_remote_device.c Sun Apr 14 09:38:28 2013 (r249467) +++ head/sys/dev/isci/isci_remote_device.c Sun Apr 14 09:55:48 2013 (r249468) @@ -83,7 +83,7 @@ scif_cb_remote_device_ready(SCI_CONTROLL */ union ccb *ccb = xpt_alloc_ccb_nowait(); - xpt_create_path(&ccb->ccb_h.path, xpt_periph, + xpt_create_path(&ccb->ccb_h.path, NULL, cam_sim_path(isci_controller->sim), isci_remote_device->index, CAM_LUN_WILDCARD); @@ -262,7 +262,7 @@ isci_remote_device_freeze_lun_queue(stru if (!(remote_device->frozen_lun_mask & (1 << lun))) { struct cam_path *path; - xpt_create_path(&path, xpt_periph, + xpt_create_path(&path, NULL, cam_sim_path(remote_device->domain->controller->sim), remote_device->index, lun); xpt_freeze_devq(path, 1); @@ -279,7 +279,7 @@ isci_remote_device_release_lun_queue(str struct cam_path *path; remote_device->frozen_lun_mask &= ~(1 << lun); - xpt_create_path(&path, xpt_periph, + xpt_create_path(&path, NULL, cam_sim_path(remote_device->domain->controller->sim), remote_device->index, lun); xpt_release_devq(path, 1, TRUE); Modified: head/sys/dev/iscsi/initiator/isc_cam.c ============================================================================== --- head/sys/dev/iscsi/initiator/isc_cam.c Sun Apr 14 09:38:28 2013 (r249467) +++ head/sys/dev/iscsi/initiator/isc_cam.c Sun Apr 14 09:55:48 2013 (r249468) @@ -150,7 +150,7 @@ ic_scan(isc_session_t *sp) sp->flags |= ISC_SCANWAIT; CAM_LOCK(sp); - if(xpt_create_path(&sp->cam_path, xpt_periph, cam_sim_path(sp->cam_sim), + if(xpt_create_path(&sp->cam_path, NULL, cam_sim_path(sp->cam_sim), 0, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { xdebug("can't create cam path"); CAM_UNLOCK(sp); Modified: head/sys/dev/isp/isp_freebsd.c ============================================================================== --- head/sys/dev/isp/isp_freebsd.c Sun Apr 14 09:38:28 2013 (r249467) +++ head/sys/dev/isp/isp_freebsd.c Sun Apr 14 09:55:48 2013 (r249468) @@ -4554,7 +4554,8 @@ isp_make_here(ispsoftc_t *isp, int chan, isp_prt(isp, ISP_LOGWARN, "Chan %d unable to alloc CCB for rescan", chan); return; } - if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, cam_sim_path(fc->sim), tgt, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { + if (xpt_create_path(&ccb->ccb_h.path, NULL, cam_sim_path(fc->sim), + tgt, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { isp_prt(isp, ISP_LOGWARN, "unable to create path for rescan"); xpt_free_ccb(ccb); return; Modified: head/sys/dev/mfi/mfi_cam.c ============================================================================== --- head/sys/dev/mfi/mfi_cam.c Sun Apr 14 09:38:28 2013 (r249467) +++ head/sys/dev/mfi/mfi_cam.c Sun Apr 14 09:55:48 2013 (r249468) @@ -318,7 +318,7 @@ mfip_cam_rescan(struct mfi_softc *sc, ui } sim = camsc->sim; - if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, cam_sim_path(sim), + if (xpt_create_path(&ccb->ccb_h.path, NULL, cam_sim_path(sim), tid, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { xpt_free_ccb(ccb); device_printf(sc->mfi_dev, Modified: head/sys/dev/mly/mly.c ============================================================================== --- head/sys/dev/mly/mly.c Sun Apr 14 09:38:28 2013 (r249467) +++ head/sys/dev/mly/mly.c Sun Apr 14 09:55:48 2013 (r249468) @@ -2025,7 +2025,7 @@ mly_cam_rescan_btl(struct mly_softc *sc, mly_printf(sc, "rescan failed (can't allocate CCB)\n"); return; } - if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, + if (xpt_create_path(&ccb->ccb_h.path, NULL, cam_sim_path(sc->mly_cam_sim[bus]), target, 0) != CAM_REQ_CMP) { mly_printf(sc, "rescan failed (can't create path)\n"); xpt_free_ccb(ccb); Modified: head/sys/dev/mps/mps_sas.c ============================================================================== --- head/sys/dev/mps/mps_sas.c Sun Apr 14 09:38:28 2013 (r249467) +++ head/sys/dev/mps/mps_sas.c Sun Apr 14 09:55:48 2013 (r249468) @@ -271,7 +271,7 @@ mpssas_rescan_target(struct mps_softc *s return; } - if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, pathid, + if (xpt_create_path(&ccb->ccb_h.path, NULL, pathid, targetid, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { mps_dprint(sc, MPS_FAULT, "unable to create path for rescan\n"); xpt_free_ccb(ccb); @@ -3318,7 +3318,7 @@ mpssas_check_eedp(struct mpssas_softc *s return; } - if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, + if (xpt_create_path(&ccb->ccb_h.path, NULL, pathid, targetid, lunid) != CAM_REQ_CMP) { mps_dprint(sc, MPS_FAULT, "Unable to create " "path for EEDP support\n"); Modified: head/sys/dev/mpt/mpt_cam.c ============================================================================== --- head/sys/dev/mpt/mpt_cam.c Sun Apr 14 09:38:28 2013 (r249467) +++ head/sys/dev/mpt/mpt_cam.c Sun Apr 14 09:55:48 2013 (r249468) @@ -2364,7 +2364,7 @@ mpt_cam_event(struct mpt_softc *mpt, req break; } - if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, pathid, + if (xpt_create_path(&ccb->ccb_h.path, NULL, pathid, CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { mpt_prt(mpt, "unable to create path for rescan\n"); xpt_free_ccb(ccb); @@ -2512,7 +2512,7 @@ mpt_cam_event(struct mpt_softc *mpt, req "unable to alloc CCB for rescan\n"); break; } - if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, + if (xpt_create_path(&ccb->ccb_h.path, NULL, cam_sim_path(sim), psdsc->TargetID, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { mpt_prt(mpt, Modified: head/sys/dev/mpt/mpt_raid.c ============================================================================== --- head/sys/dev/mpt/mpt_raid.c Sun Apr 14 09:38:28 2013 (r249467) +++ head/sys/dev/mpt/mpt_raid.c Sun Apr 14 09:55:48 2013 (r249468) @@ -705,7 +705,7 @@ mpt_raid_thread(void *arg) ccb = xpt_alloc_ccb(); MPT_LOCK(mpt); - error = xpt_create_path(&ccb->ccb_h.path, xpt_periph, + error = xpt_create_path(&ccb->ccb_h.path, NULL, cam_sim_path(mpt->phydisk_sim), CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD); if (error != CAM_REQ_CMP) { @@ -1662,7 +1662,7 @@ mpt_raid_set_vol_queue_depth(struct mpt_ mpt->raid_rescan = 0; - error = xpt_create_path(&path, xpt_periph, + error = xpt_create_path(&path, NULL, cam_sim_path(mpt->sim), mpt_vol->config_page->VolumeID, /*lun*/0); Modified: head/sys/dev/twa/tw_osl_cam.c ============================================================================== --- head/sys/dev/twa/tw_osl_cam.c Sun Apr 14 09:38:28 2013 (r249467) +++ head/sys/dev/twa/tw_osl_cam.c Sun Apr 14 09:55:48 2013 (r249468) @@ -488,7 +488,7 @@ tw_osli_request_bus_scan(struct twa_soft if ((ccb = xpt_alloc_ccb()) == NULL) return(ENOMEM); mtx_lock(sc->sim_lock); - if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, cam_sim_path(sc->sim), + if (xpt_create_path(&ccb->ccb_h.path, NULL, cam_sim_path(sc->sim), CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { xpt_free_ccb(ccb); mtx_unlock(sc->sim_lock); Modified: head/sys/dev/tws/tws_cam.c ============================================================================== --- head/sys/dev/tws/tws_cam.c Sun Apr 14 09:38:28 2013 (r249467) +++ head/sys/dev/tws/tws_cam.c Sun Apr 14 09:55:48 2013 (r249468) @@ -219,7 +219,7 @@ tws_bus_scan(struct tws_softc *sc) return(ENXIO); ccb = xpt_alloc_ccb(); mtx_lock(&sc->sim_lock); - if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, cam_sim_path(sc->sim), + if (xpt_create_path(&ccb->ccb_h.path, NULL, cam_sim_path(sc->sim), CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { mtx_unlock(&sc->sim_lock); xpt_free_ccb(ccb); Modified: head/sys/dev/virtio/scsi/virtio_scsi.c ============================================================================== --- head/sys/dev/virtio/scsi/virtio_scsi.c Sun Apr 14 09:38:28 2013 (r249467) +++ head/sys/dev/virtio/scsi/virtio_scsi.c Sun Apr 14 09:55:48 2013 (r249468) @@ -1702,7 +1702,7 @@ vtscsi_execute_rescan(struct vtscsi_soft return; } - status = xpt_create_path(&ccb->ccb_h.path, xpt_periph, + status = xpt_create_path(&ccb->ccb_h.path, NULL, cam_sim_path(sc->vtscsi_sim), target_id, lun_id); if (status != CAM_REQ_CMP) { xpt_free_ccb(ccb); From owner-svn-src-all@FreeBSD.ORG Sun Apr 14 10:14:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6F07C280; Sun, 14 Apr 2013 10:14:27 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 620DA965; Sun, 14 Apr 2013 10:14:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3EAERDv032102; Sun, 14 Apr 2013 10:14:27 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3EAERjD032100; Sun, 14 Apr 2013 10:14:27 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201304141014.r3EAERjD032100@svn.freebsd.org> From: Alexander Motin Date: Sun, 14 Apr 2013 10:14:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249470 - head/sys/cam X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Apr 2013 10:14:27 -0000 Author: mav Date: Sun Apr 14 10:14:26 2013 New Revision: 249470 URL: http://svnweb.freebsd.org/changeset/base/249470 Log: Remove owner field from struct cam_ed, unused at least since FreeBSD 7. Modified: head/sys/cam/cam_xpt.c head/sys/cam/cam_xpt_internal.h Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Sun Apr 14 09:59:41 2013 (r249469) +++ head/sys/cam/cam_xpt.c Sun Apr 14 10:14:26 2013 (r249470) @@ -4428,7 +4428,6 @@ xpt_alloc_device(struct cam_eb *bus, str SLIST_INIT(&device->asyncs); SLIST_INIT(&device->periphs); device->generation = 0; - device->owner = NULL; device->flags = CAM_DEV_UNCONFIGURED; device->tag_delay_count = 0; device->tag_saved_openings = 0; Modified: head/sys/cam/cam_xpt_internal.h ============================================================================== --- head/sys/cam/cam_xpt_internal.h Sun Apr 14 09:59:41 2013 (r249469) +++ head/sys/cam/cam_xpt_internal.h Sun Apr 14 10:14:26 2013 (r249470) @@ -83,7 +83,6 @@ struct cam_ed { struct async_list asyncs; /* Async callback info for this B/T/L */ struct periph_list periphs; /* All attached devices */ u_int generation; /* Generation number */ - struct cam_periph *owner; /* Peripheral driver's ownership tag */ void *quirk; /* Oddities about this device */ u_int maxtags; u_int mintags; From owner-svn-src-all@FreeBSD.ORG Sun Apr 14 11:44:48 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 541E9CD6; Sun, 14 Apr 2013 11:44:48 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 45240BE4; Sun, 14 Apr 2013 11:44:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3EBimDW058907; Sun, 14 Apr 2013 11:44:48 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3EBimN4058906; Sun, 14 Apr 2013 11:44:48 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201304141144.r3EBimN4058906@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 14 Apr 2013 11:44:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249471 - head/lib/libc/nls X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Apr 2013 11:44:48 -0000 Author: jilles Date: Sun Apr 14 11:44:47 2013 New Revision: 249471 URL: http://svnweb.freebsd.org/changeset/base/249471 Log: libc: Fix typo in French translation. PR: kern/177704 Submitted by: martymac MFC after: 1 week Modified: head/lib/libc/nls/fr_FR.ISO8859-1.msg Modified: head/lib/libc/nls/fr_FR.ISO8859-1.msg ============================================================================== --- head/lib/libc/nls/fr_FR.ISO8859-1.msg Sun Apr 14 10:14:26 2013 (r249470) +++ head/lib/libc/nls/fr_FR.ISO8859-1.msg Sun Apr 14 11:44:47 2013 (r249471) @@ -94,7 +94,7 @@ $ EPROTONOSUPPORT $ ESOCKTNOSUPPORT 44 Type de socket non supporté $ EOPNOTSUPP -45 Opération non supporté +45 Opération non supportée $ EPFNOSUPPORT 46 Famille de protocole non supportée $ EAFNOSUPPORT From owner-svn-src-all@FreeBSD.ORG Sun Apr 14 11:51:25 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9E09CFCB; Sun, 14 Apr 2013 11:51:25 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 905C8C32; Sun, 14 Apr 2013 11:51:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3EBpPjo061425; Sun, 14 Apr 2013 11:51:25 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3EBpPAu061424; Sun, 14 Apr 2013 11:51:25 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201304141151.r3EBpPAu061424@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Sun, 14 Apr 2013 11:51:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r249472 - stable/8 X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Apr 2013 11:51:25 -0000 Author: des Date: Sun Apr 14 11:51:25 2013 New Revision: 249472 URL: http://svnweb.freebsd.org/changeset/base/249472 Log: MFH (r247285): always bootstrap liby along with yacc. Modified: stable/8/Makefile.inc1 (contents, props changed) Directory Properties: stable/8/ (props changed) Modified: stable/8/Makefile.inc1 ============================================================================== --- stable/8/Makefile.inc1 Sun Apr 14 11:44:47 2013 (r249471) +++ stable/8/Makefile.inc1 Sun Apr 14 11:51:25 2013 (r249472) @@ -953,7 +953,8 @@ _lex= usr.bin/lex .endif .if ${BOOTSTRAPPING} >= 1000013 -_yacc= usr.bin/yacc +_yacc= lib/liby \ + usr.bin/yacc .endif .if ${BOOTSTRAPPING} < 800013 From owner-svn-src-all@FreeBSD.ORG Sun Apr 14 12:20:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 56AB0728; Sun, 14 Apr 2013 12:20:14 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 48253DB2; Sun, 14 Apr 2013 12:20:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3ECKDMR069034; Sun, 14 Apr 2013 12:20:13 GMT (envelope-from antoine@svn.freebsd.org) Received: (from antoine@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3ECKDW5069033; Sun, 14 Apr 2013 12:20:13 GMT (envelope-from antoine@svn.freebsd.org) Message-Id: <201304141220.r3ECKDW5069033@svn.freebsd.org> From: Antoine Brodin Date: Sun, 14 Apr 2013 12:20:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249473 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Apr 2013 12:20:14 -0000 Author: antoine Date: Sun Apr 14 12:20:13 2013 New Revision: 249473 URL: http://svnweb.freebsd.org/changeset/base/249473 Log: Add one more obsolete file. Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sun Apr 14 11:51:25 2013 (r249472) +++ head/ObsoleteFiles.inc Sun Apr 14 12:20:13 2013 (r249473) @@ -70,6 +70,7 @@ OLD_FILES+=usr/include/clang/3.2/xmmintr OLD_FILES+=usr/include/clang/3.2/xopintrin.h OLD_DIRS+=usr/include/clang/3.2 # 20130404: legacy ATA stack removed +OLD_FILES+=rescue/atacontrol OLD_FILES+=sbin/atacontrol OLD_FILES+=usr/share/man/man8/atacontrol.8.gz OLD_FILES+=usr/share/man/man4/atapicam.4.gz From owner-svn-src-all@FreeBSD.ORG Sun Apr 14 12:55:40 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 46857B7E; Sun, 14 Apr 2013 12:55:40 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 37371E80; Sun, 14 Apr 2013 12:55:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3ECtd2j080105; Sun, 14 Apr 2013 12:55:39 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3ECtdgg080104; Sun, 14 Apr 2013 12:55:39 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201304141255.r3ECtdgg080104@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Sun, 14 Apr 2013 12:55:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r249474 - vendor-crypto/openssh/dist X-SVN-Group: vendor-crypto MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Apr 2013 12:55:40 -0000 Author: des Date: Sun Apr 14 12:55:39 2013 New Revision: 249474 URL: http://svnweb.freebsd.org/changeset/base/249474 Log: Apply a patch from OpenSSH bugzilla #2057 to silence "received disconnect" errors in the common case (i.e. client intentionally disconnected). Modified: vendor-crypto/openssh/dist/packet.c Modified: vendor-crypto/openssh/dist/packet.c ============================================================================== --- vendor-crypto/openssh/dist/packet.c Sun Apr 14 12:20:13 2013 (r249473) +++ vendor-crypto/openssh/dist/packet.c Sun Apr 14 12:55:39 2013 (r249474) @@ -1460,7 +1460,11 @@ packet_read_poll_seqnr(u_int32_t *seqnr_ case SSH2_MSG_DISCONNECT: reason = packet_get_int(); msg = packet_get_string(NULL); - error("Received disconnect from %s: %u: %.400s", + /* Ignore normal client exit notifications */ + do_log2(active_state->server_side && + reason == SSH2_DISCONNECT_BY_APPLICATION ? + SYSLOG_LEVEL_DEBUG1 : SYSLOG_LEVEL_ERROR, + "Received disconnect from %s: %u: %.400s", get_remote_ipaddr(), reason, msg); xfree(msg); cleanup_exit(255); From owner-svn-src-all@FreeBSD.ORG Sun Apr 14 13:06:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 19991E8B; Sun, 14 Apr 2013 13:06:08 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0AF02ECB; Sun, 14 Apr 2013 13:06:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3ED67YX083539; Sun, 14 Apr 2013 13:06:07 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3ED67Tn083538; Sun, 14 Apr 2013 13:06:07 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201304141306.r3ED67Tn083538@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Sun, 14 Apr 2013 13:06:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249475 - head/crypto/openssh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Apr 2013 13:06:08 -0000 Author: des Date: Sun Apr 14 13:06:07 2013 New Revision: 249475 URL: http://svnweb.freebsd.org/changeset/base/249475 Log: Silence "received disconnect" in the common case. Modified: head/crypto/openssh/packet.c Directory Properties: head/crypto/openssh/ (props changed) Modified: head/crypto/openssh/packet.c ============================================================================== --- head/crypto/openssh/packet.c Sun Apr 14 12:55:39 2013 (r249474) +++ head/crypto/openssh/packet.c Sun Apr 14 13:06:07 2013 (r249475) @@ -1465,7 +1465,11 @@ packet_read_poll_seqnr(u_int32_t *seqnr_ case SSH2_MSG_DISCONNECT: reason = packet_get_int(); msg = packet_get_string(NULL); - error("Received disconnect from %s: %u: %.400s", + /* Ignore normal client exit notifications */ + do_log2(active_state->server_side && + reason == SSH2_DISCONNECT_BY_APPLICATION ? + SYSLOG_LEVEL_DEBUG1 : SYSLOG_LEVEL_ERROR, + "Received disconnect from %s: %u: %.400s", get_remote_ipaddr(), reason, msg); xfree(msg); cleanup_exit(255); @@ -1490,7 +1494,7 @@ packet_read_poll_seqnr(u_int32_t *seqnr_ break; case SSH_MSG_DISCONNECT: msg = packet_get_string(NULL); - error("Received disconnect from %s: %.400s", + logit("Received disconnect from %s: %.400s", get_remote_ipaddr(), msg); cleanup_exit(255); break; From owner-svn-src-all@FreeBSD.ORG Sun Apr 14 14:02:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5C4E6869; Sun, 14 Apr 2013 14:02:35 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3475B95; Sun, 14 Apr 2013 14:02:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3EE2Zl0001361; Sun, 14 Apr 2013 14:02:35 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3EE2YIi001357; Sun, 14 Apr 2013 14:02:34 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201304141402.r3EE2YIi001357@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 14 Apr 2013 14:02:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249476 - in head/sys/dev: ata pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Apr 2013 14:02:35 -0000 Author: kib Date: Sun Apr 14 14:02:34 2013 New Revision: 249476 URL: http://svnweb.freebsd.org/changeset/base/249476 Log: Usnure that PCI bus BIS_GET_DMA_TAG() method sees the actual PCI device which makes the request for dma tag, instead of some descendant of the PCI device, by creating a pass-through trampoline for vga_pci and ata_pci buses. Sponsored by: The FreeBSD Foundation Suggested by: jhb Discussed with: jhb, mav MFC after: 1 week Modified: head/sys/dev/ata/ata-pci.c head/sys/dev/pci/vga_pci.c Modified: head/sys/dev/ata/ata-pci.c ============================================================================== --- head/sys/dev/ata/ata-pci.c Sun Apr 14 13:06:07 2013 (r249475) +++ head/sys/dev/ata/ata-pci.c Sun Apr 14 14:02:34 2013 (r249476) @@ -571,6 +571,13 @@ ata_pci_child_location_str(device_t dev, return (0); } +static bus_dma_tag_t +ata_pci_get_dma_tag(device_t bus, device_t child) +{ + + return (bus_get_dma_tag(bus)); +} + static device_method_t ata_pci_methods[] = { /* device interface */ DEVMETHOD(device_probe, ata_pci_probe), @@ -593,6 +600,7 @@ static device_method_t ata_pci_methods[] DEVMETHOD(pci_write_config, ata_pci_write_config), DEVMETHOD(bus_print_child, ata_pci_print_child), DEVMETHOD(bus_child_location_str, ata_pci_child_location_str), + DEVMETHOD(bus_get_dma_tag, ata_pci_get_dma_tag), DEVMETHOD_END }; Modified: head/sys/dev/pci/vga_pci.c ============================================================================== --- head/sys/dev/pci/vga_pci.c Sun Apr 14 13:06:07 2013 (r249475) +++ head/sys/dev/pci/vga_pci.c Sun Apr 14 14:02:34 2013 (r249476) @@ -419,6 +419,13 @@ vga_pci_msix_count(device_t dev, device_ return (pci_msix_count(dev)); } +static bus_dma_tag_t +vga_pci_get_dma_tag(device_t bus, device_t child) +{ + + return (bus_get_dma_tag(bus)); +} + static device_method_t vga_pci_methods[] = { /* Device interface */ DEVMETHOD(device_probe, vga_pci_probe), @@ -436,6 +443,7 @@ static device_method_t vga_pci_methods[] DEVMETHOD(bus_release_resource, vga_pci_release_resource), DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), + DEVMETHOD(bus_get_dma_tag, vga_pci_get_dma_tag), /* PCI interface */ DEVMETHOD(pci_read_config, vga_pci_read_config), From owner-svn-src-all@FreeBSD.ORG Sun Apr 14 15:05:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id AE3631FB; Sun, 14 Apr 2013 15:05:14 +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 4A39623D; Sun, 14 Apr 2013 15:05:13 +0000 (UTC) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.14.6/8.14.6/ALCHEMY.FRANKEN.DE) with ESMTP id r3EF57XW068065; Sun, 14 Apr 2013 17:05:07 +0200 (CEST) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.14.6/8.14.6/Submit) id r3EF57NM068064; Sun, 14 Apr 2013 17:05:07 +0200 (CEST) (envelope-from marius) Date: Sun, 14 Apr 2013 17:05:07 +0200 From: Marius Strobl To: Konstantin Belousov Subject: Re: svn commit: r249476 - in head/sys/dev: ata pci Message-ID: <20130414150507.GA62578@alchemy.franken.de> References: <201304141402.r3EE2YIi001357@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201304141402.r3EE2YIi001357@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Apr 2013 15:05:14 -0000 On Sun, Apr 14, 2013 at 02:02:34PM +0000, Konstantin Belousov wrote: > Author: kib > Date: Sun Apr 14 14:02:34 2013 > New Revision: 249476 > URL: http://svnweb.freebsd.org/changeset/base/249476 > > Log: > Usnure that PCI bus BIS_GET_DMA_TAG() method sees the actual PCI > device which makes the request for dma tag, instead of some descendant > of the PCI device, by creating a pass-through trampoline for vga_pci > and ata_pci buses. If you need to know the last PCI device requesting the DMA tag, wouldn't it make more sense to let the consumer of this walk up the tree as necessary instead of hacking N drivers? I.e.: foo_get_dma_tag(device_t bus, device_t child) { device_t device, parent; devclass_t pci_devclass; pci_devclass = devclass_find("pci"); for (device = child; child != bus; device = parent) { parent = device_get_parent(device); if (device_get_devclass(parent) != pci_devclass) continue; break; } /* use device */ } I suspect the problem you are hitting is also true for ISA devices behind a PCI-ISA-bridge, PCI device drivers attaching non-PCI sub- devices requesting DMA tags like sk(4) etc. Marius From owner-svn-src-all@FreeBSD.ORG Sun Apr 14 16:20:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 53761895; Sun, 14 Apr 2013 16:20:26 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 45076788; Sun, 14 Apr 2013 16:20:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3EGKPqa042289; Sun, 14 Apr 2013 16:20:25 GMT (envelope-from jmg@svn.freebsd.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3EGKPHn042288; Sun, 14 Apr 2013 16:20:25 GMT (envelope-from jmg@svn.freebsd.org) Message-Id: <201304141620.r3EGKPHn042288@svn.freebsd.org> From: John-Mark Gurney Date: Sun, 14 Apr 2013 16:20:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249477 - head/sbin/geom/class/nop X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Apr 2013 16:20:26 -0000 Author: jmg Date: Sun Apr 14 16:20:25 2013 New Revision: 249477 URL: http://svnweb.freebsd.org/changeset/base/249477 Log: update information about debugging sysctl... MFC after: 1 week Modified: head/sbin/geom/class/nop/gnop.8 Modified: head/sbin/geom/class/nop/gnop.8 ============================================================================== --- head/sbin/geom/class/nop/gnop.8 Sun Apr 14 14:02:34 2013 (r249476) +++ head/sbin/geom/class/nop/gnop.8 Sun Apr 14 16:20:25 2013 (r249477) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 17, 2009 +.Dd April 14, 2013 .Dt GNOP 8 .Os .Sh NAME @@ -139,8 +139,11 @@ Debug level of the .Nm NOP GEOM class. This can be set to a number between 0 and 2 inclusive. -If set to 0 minimal debug information is printed, and if set to 2 the -maximum amount of debug information is printed. +If set to 0, minimal debug information is printed. +If set to 1, basic debug information is logged along with the I/O requests +that were returned as errors. +If set to 2, the maximum amount of debug information is printed including +all I/O requests. .El .Sh EXIT STATUS Exit status is 0 on success, and 1 if the command fails. From owner-svn-src-all@FreeBSD.ORG Sun Apr 14 16:25:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6DEE3B59; Sun, 14 Apr 2013 16:25:38 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5FC417C4; Sun, 14 Apr 2013 16:25:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3EGPcG8044459; Sun, 14 Apr 2013 16:25:38 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3EGPcxK044455; Sun, 14 Apr 2013 16:25:38 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201304141625.r3EGPcxK044455@svn.freebsd.org> From: Robert Watson Date: Sun, 14 Apr 2013 16:25:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r249478 - in stable/8/sys: netinet netinet6 X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Apr 2013 16:25:38 -0000 Author: rwatson Date: Sun Apr 14 16:25:37 2013 New Revision: 249478 URL: http://svnweb.freebsd.org/changeset/base/249478 Log: FreeBSD 8.0 introduced inpcb reference counting, and FreeBSD 8.1 began using that reference count to protect inpcb stability in udp_pcblist() and other monitoring functions, preventing the inpcb from being garbage collected across potentially sleeping copyout() operations despite the inpcb zone becoming shrinkable. However, this introduced a race condition in which inp->inp_socket() might become NULL as a result of the socket being freed, but before the inpcb we removed from the global list of connections, allowing it to be exposed to a third thread invoking udp_input() or udp6_input() which would try to indirect through inp_socket without testing it for NULL. This might occur with particular regularity on systems that frequently run netstat, or which use SNMP for connection monitoring. Later FreeBSD releases use a different reference/destruction model, but stable/8 remained affected in FreeBSD 8.2 and 8.3; the problem could be spotted on very high-load UDP services, such as top-level name servers. An Errata Note for 8.x branches under continuing support might be appropriate. Regardless, this fix should be merged to releng/8.4 prior to 8.4-RELEASE. PR: 172963 Submitted by: Vincent Miller Submitted by: Julien Charbon Submitted by: Marc De La Gueronniere Modified: stable/8/sys/netinet/udp_usrreq.c stable/8/sys/netinet6/udp6_usrreq.c Modified: stable/8/sys/netinet/udp_usrreq.c ============================================================================== --- stable/8/sys/netinet/udp_usrreq.c Sun Apr 14 16:20:25 2013 (r249477) +++ stable/8/sys/netinet/udp_usrreq.c Sun Apr 14 16:25:37 2013 (r249478) @@ -495,6 +495,15 @@ udp_input(struct mbuf *m, int off) INP_RLOCK(inp); /* + * Detached PCBs can linger in the list if someone + * holds a reference. (e.g. udp_pcblist) + */ + if (inp->inp_socket == NULL) { + INP_RUNLOCK(inp); + continue; + } + + /* * Handle socket delivery policy for any-source * and source-specific multicast. [RFC3678] */ @@ -620,6 +629,15 @@ udp_input(struct mbuf *m, int off) */ INP_RLOCK(inp); INP_INFO_RUNLOCK(&V_udbinfo); + + /* + * Detached PCBs can linger in the hash table if someone holds a + * reference. (e.g. udp_pcblist) + */ + if (inp->inp_socket == NULL) { + INP_RUNLOCK(inp); + goto badunlocked; + } if (inp->inp_ip_minttl && inp->inp_ip_minttl > ip->ip_ttl) { INP_RUNLOCK(inp); goto badunlocked; Modified: stable/8/sys/netinet6/udp6_usrreq.c ============================================================================== --- stable/8/sys/netinet6/udp6_usrreq.c Sun Apr 14 16:20:25 2013 (r249477) +++ stable/8/sys/netinet6/udp6_usrreq.c Sun Apr 14 16:25:37 2013 (r249478) @@ -273,6 +273,13 @@ udp6_input(struct mbuf **mp, int *offp, } /* + * Detached PCBs can linger in the list if someone + * holds a reference. (e.g. udp_pcblist) + */ + if (inp->inp_socket == NULL) + continue; + + /* * Handle socket delivery policy for any-source * and source-specific multicast. [RFC3678] */ @@ -396,6 +403,15 @@ udp6_input(struct mbuf **mp, int *offp, } INP_RLOCK(inp); INP_INFO_RUNLOCK(&V_udbinfo); + + /* + * Detached PCBs can linger in the hash table if someone holds a + * reference. (e.g. udp_pcblist) + */ + if (inp->inp_socket == NULL) { + INP_RUNLOCK(inp); + goto badunlocked; + } up = intoudpcb(inp); if (up->u_tun_func == NULL) { udp6_append(inp, m, off, &fromsa); From owner-svn-src-all@FreeBSD.ORG Sun Apr 14 16:49:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3AE1E3FA; Sun, 14 Apr 2013 16:49:28 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2D73E8EA; Sun, 14 Apr 2013 16:49:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3EGnS4G050808; Sun, 14 Apr 2013 16:49:28 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3EGnR24050805; Sun, 14 Apr 2013 16:49:27 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201304141649.r3EGnR24050805@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Sun, 14 Apr 2013 16:49:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249479 - in head: contrib/openpam/lib lib/libpam X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Apr 2013 16:49:28 -0000 Author: des Date: Sun Apr 14 16:49:27 2013 New Revision: 249479 URL: http://svnweb.freebsd.org/changeset/base/249479 Log: Backport upstream r684 (OPENPAM_DEBUG enables debugging macros but does not turn debugging on by default) and add OPENPAM_DEBUG to CFLAGS. Modified: head/contrib/openpam/lib/openpam_log.c head/lib/libpam/Makefile.inc Modified: head/contrib/openpam/lib/openpam_log.c ============================================================================== --- head/contrib/openpam/lib/openpam_log.c Sun Apr 14 16:25:37 2013 (r249478) +++ head/contrib/openpam/lib/openpam_log.c Sun Apr 14 16:49:27 2013 (r249479) @@ -49,11 +49,7 @@ #include "openpam_impl.h" -#ifdef OPENPAM_DEBUG -int openpam_debug = 1; -#else int openpam_debug = 0; -#endif #if !defined(openpam_log) Modified: head/lib/libpam/Makefile.inc ============================================================================== --- head/lib/libpam/Makefile.inc Sun Apr 14 16:25:37 2013 (r249478) +++ head/lib/libpam/Makefile.inc Sun Apr 14 16:49:27 2013 (r249479) @@ -24,9 +24,7 @@ # # $FreeBSD$ -.ifdef PAM_DEBUG -DEBUG_FLAGS+= -DDEBUG -.endif +CFLAGS+= -DOPENPAM_DEBUG SHLIB_MAJOR= 5 PAM_MOD_DIR= ${LIBDIR} From owner-svn-src-all@FreeBSD.ORG Sun Apr 14 17:08:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 802C2973; Sun, 14 Apr 2013 17:08:35 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 72FD0982; Sun, 14 Apr 2013 17:08:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3EH8Zp4057051; Sun, 14 Apr 2013 17:08:35 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3EH8Y4A057048; Sun, 14 Apr 2013 17:08:34 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201304141708.r3EH8Y4A057048@svn.freebsd.org> From: Mateusz Guzik Date: Sun, 14 Apr 2013 17:08:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249480 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Apr 2013 17:08:35 -0000 Author: mjg Date: Sun Apr 14 17:08:34 2013 New Revision: 249480 URL: http://svnweb.freebsd.org/changeset/base/249480 Log: Add fdallocn function and use it when passing fds over unix socket. This gets rid of "unp_externalize fdalloc failed" panic. Reviewed by: pjd MFC after: 1 week Modified: head/sys/kern/kern_descrip.c head/sys/kern/uipc_usrreq.c head/sys/sys/filedesc.h Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Sun Apr 14 16:49:27 2013 (r249479) +++ head/sys/kern/kern_descrip.c Sun Apr 14 17:08:34 2013 (r249480) @@ -1582,6 +1582,34 @@ fdalloc(struct thread *td, int minfd, in } /* + * Allocate n file descriptors for the process. + */ +int +fdallocn(struct thread *td, int minfd, int *fds, int n) +{ + struct proc *p = td->td_proc; + struct filedesc *fdp = p->p_fd; + int i; + + FILEDESC_XLOCK_ASSERT(fdp); + + if (!fdavail(td, n)) + return (EMFILE); + + for (i = 0; i < n; i++) + if (fdalloc(td, 0, &fds[i]) != 0) + break; + + if (i < n) { + for (i--; i >= 0; i--) + fdunused(fdp, fds[i]); + return (EMFILE); + } + + return (0); +} + +/* * Check to see whether n user file descriptors are available to the process * p. */ Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Sun Apr 14 16:49:27 2013 (r249479) +++ head/sys/kern/uipc_usrreq.c Sun Apr 14 17:08:34 2013 (r249480) @@ -1706,7 +1706,6 @@ unp_externalize(struct mbuf *control, st void *data; socklen_t clen = control->m_len, datalen; int error, newfds; - int f; u_int newlen; UNP_LINK_UNLOCK_ASSERT(); @@ -1732,13 +1731,6 @@ unp_externalize(struct mbuf *control, st goto next; } FILEDESC_XLOCK(fdesc); - /* if the new FD's will not fit free them. */ - if (!fdavail(td, newfds)) { - FILEDESC_XUNLOCK(fdesc); - error = EMSGSIZE; - unp_freerights(fdep, newfds); - goto next; - } /* * Now change each pointer to an fd in the global @@ -1758,17 +1750,22 @@ unp_externalize(struct mbuf *control, st fdp = (int *) CMSG_DATA(mtod(*controlp, struct cmsghdr *)); + if (fdallocn(td, 0, fdp, newfds) != 0) { + FILEDESC_XUNLOCK(td->td_proc->p_fd); + error = EMSGSIZE; + unp_freerights(fdep, newfds); + m_freem(*controlp); + *controlp = NULL; + goto next; + } for (i = 0; i < newfds; i++, fdp++) { - if (fdalloc(td, 0, &f)) - panic("unp_externalize fdalloc failed"); - fde = &fdesc->fd_ofiles[f]; + fde = &fdesc->fd_ofiles[*fdp]; fde->fde_file = fdep[0]->fde_file; filecaps_move(&fdep[0]->fde_caps, &fde->fde_caps); if ((flags & MSG_CMSG_CLOEXEC) != 0) fde->fde_flags |= UF_EXCLOSE; unp_externalize_fp(fde->fde_file); - *fdp = f; } FILEDESC_XUNLOCK(fdesc); free(fdep[0], M_FILECAPS); Modified: head/sys/sys/filedesc.h ============================================================================== --- head/sys/sys/filedesc.h Sun Apr 14 16:49:27 2013 (r249479) +++ head/sys/sys/filedesc.h Sun Apr 14 17:08:34 2013 (r249480) @@ -150,6 +150,7 @@ int falloc_noinstall(struct thread *td, int finstall(struct thread *td, struct file *fp, int *resultfp, int flags, struct filecaps *fcaps); int fdalloc(struct thread *td, int minfd, int *result); +int fdallocn(struct thread *td, int minfd, int *fds, int n); int fdavail(struct thread *td, int n); int fdcheckstd(struct thread *td); void fdclose(struct filedesc *fdp, struct file *fp, int idx, struct thread *td); From owner-svn-src-all@FreeBSD.ORG Sun Apr 14 18:09:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 49D03496; Sun, 14 Apr 2013 18:09:09 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3CD05B35; Sun, 14 Apr 2013 18:09:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3EI98Lw075404; Sun, 14 Apr 2013 18:09:08 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3EI986E075403; Sun, 14 Apr 2013 18:09:08 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201304141809.r3EI986E075403@svn.freebsd.org> From: Alexander Motin Date: Sun, 14 Apr 2013 18:09:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249481 - head/sys/cam X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Apr 2013 18:09:09 -0000 Author: mav Date: Sun Apr 14 18:09:08 2013 New Revision: 249481 URL: http://svnweb.freebsd.org/changeset/base/249481 Log: Remove some more pieces of multilevel freeze mechanism, missed in r249466. Modified: head/sys/cam/cam_queue.h Modified: head/sys/cam/cam_queue.h ============================================================================== --- head/sys/cam/cam_queue.h Sun Apr 14 17:08:34 2013 (r249480) +++ head/sys/cam/cam_queue.h Sun Apr 14 18:09:08 2013 (r249481) @@ -155,10 +155,10 @@ cam_ccbq_pending_ccb_count(struct cam_cc static __inline void cam_ccbq_take_opening(struct cam_ccbq *ccbq); -static __inline int +static __inline void cam_ccbq_insert_ccb(struct cam_ccbq *ccbq, union ccb *new_ccb); -static __inline int +static __inline void cam_ccbq_remove_ccb(struct cam_ccbq *ccbq, union ccb *ccb); static __inline union ccb * @@ -187,29 +187,17 @@ cam_ccbq_take_opening(struct cam_ccbq *c ccbq->held++; } -static __inline int +static __inline void cam_ccbq_insert_ccb(struct cam_ccbq *ccbq, union ccb *new_ccb) { ccbq->held--; camq_insert(&ccbq->queue, &new_ccb->ccb_h.pinfo); - if (ccbq->queue.qfrozen_cnt > 0) { - ccbq->devq_openings++; - ccbq->held++; - return (1); - } else - return (0); } -static __inline int +static __inline void cam_ccbq_remove_ccb(struct cam_ccbq *ccbq, union ccb *ccb) { camq_remove(&ccbq->queue, ccb->ccb_h.pinfo.index); - if (ccbq->queue.qfrozen_cnt > 0) { - ccbq->devq_openings--; - ccbq->held--; - return (1); - } else - return (0); } static __inline union ccb * From owner-svn-src-all@FreeBSD.ORG Sun Apr 14 19:13:52 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C0AD34E0; Sun, 14 Apr 2013 19:13:52 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B1C91E41; Sun, 14 Apr 2013 19:13:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3EJDqIY095966; Sun, 14 Apr 2013 19:13:52 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3EJDqPI095965; Sun, 14 Apr 2013 19:13:52 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201304141913.r3EJDqPI095965@svn.freebsd.org> From: Tim Kientzle Date: Sun, 14 Apr 2013 19:13:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249484 - head/lib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Apr 2013 19:13:52 -0000 Author: kientzle Date: Sun Apr 14 19:13:51 2013 New Revision: 249484 URL: http://svnweb.freebsd.org/changeset/base/249484 Log: Install a symlink /usr/lib/include ==> /usr/include This fixes -print-file-name=include in clang (and is arguably a better way to fix the same issue in GCC than the change I made in r231336). MFC after: 1 week Modified: head/lib/Makefile Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Sun Apr 14 18:36:30 2013 (r249483) +++ head/lib/Makefile Sun Apr 14 19:13:51 2013 (r249484) @@ -252,4 +252,7 @@ _libusbhid= libusbhid _libusb= libusb .endif +afterinstall: + ln -fs ../include ${DESTDIR}/usr/lib/include + .include From owner-svn-src-all@FreeBSD.ORG Sun Apr 14 19:21:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 399DE747; Sun, 14 Apr 2013 19:21:44 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1BDF3E7C; Sun, 14 Apr 2013 19:21:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3EJLhot098643; Sun, 14 Apr 2013 19:21:43 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3EJLhRD098642; Sun, 14 Apr 2013 19:21:43 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201304141921.r3EJLhRD098642@svn.freebsd.org> From: Warner Losh Date: Sun, 14 Apr 2013 19:21:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249485 - head/sys/dev/mmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Apr 2013 19:21:44 -0000 Author: imp Date: Sun Apr 14 19:21:43 2013 New Revision: 249485 URL: http://svnweb.freebsd.org/changeset/base/249485 Log: Print MB and GB instead of MiB and GiB mislabeled as MB and GB. SD cards are sold in GB not GiB, this will result in less confusion. Also, cache parent device pointer to save a few cycles for loops. Modified: head/sys/dev/mmc/mmcsd.c Modified: head/sys/dev/mmc/mmcsd.c ============================================================================== --- head/sys/dev/mmc/mmcsd.c Sun Apr 14 19:13:51 2013 (r249484) +++ head/sys/dev/mmc/mmcsd.c Sun Apr 14 19:21:43 2013 (r249485) @@ -163,19 +163,20 @@ mmcsd_attach(device_t dev) d->d_unit = device_get_unit(dev); d->d_flags = DISKFLAG_CANDELETE; /* - * Display in most natural units. There's no cards < 1MB. - * The SD standard goes to 2GiB, but the data format supports - * up to 4GiB and some card makers push it up to this limit. - * The SDHC standard only goes to 32GiB (the data format in - * SDHC is good to 2TiB however, which isn't too ugly at - * 2048GiBm, so we note it in passing here and don't add the - * code to print TiB). + * Display in most natural units. There's no cards < 1MB. The SD + * standard goes to 2GiB due to its reliance on FAT, but the data + * format supports up to 4GiB and some card makers push it up to this + * limit. The SDHC standard only goes to 32GiB due to FAT32, but the + * data format supports up to 2TiB however. 2048GB isn't too ugly, so + * we note it in passing here and don't add the code to print + * TB). Since these cards are sold in terms of MB and GB not MiB and + * GiB, report them like that. */ - mb = d->d_mediasize >> 20; /* 1MiB == 1 << 20 */ + mb = d->d_mediasize / 1000000; unit = 'M'; - if (mb >= 10240) { /* 1GiB = 1024 MiB */ + if (mb >= 1000) { unit = 'G'; - mb /= 1024; + mb /= 1000; } /* * Report the clock speed of the underlying hardware, which might be @@ -312,6 +313,7 @@ mmcsd_rw(struct mmcsd_softc *sc, struct struct mmc_data data; device_t dev = sc->dev; int sz = sc->disk->d_sectorsize; + device_t mmcbr = device_get_parent(dev); block = bp->bio_pblkno; end = bp->bio_pblkno + (bp->bio_bcount / sz); @@ -355,8 +357,7 @@ mmcsd_rw(struct mmcsd_softc *sc, struct stop.mrq = &req; req.stop = &stop; } - MMCBUS_WAIT_FOR_REQUEST(device_get_parent(dev), dev, - &req); + MMCBUS_WAIT_FOR_REQUEST(mmcbr, dev, &req); if (req.cmd->error != MMC_ERR_NONE) { device_printf(dev, "Error indicated: %d %s\n", req.cmd->error, mmcsd_errmsg(req.cmd->error)); @@ -376,6 +377,7 @@ mmcsd_delete(struct mmcsd_softc *sc, str device_t dev = sc->dev; int sz = sc->disk->d_sectorsize; int erase_sector; + device_t mmcbr = device_get_parent(dev); block = bp->bio_pblkno; end = bp->bio_pblkno + (bp->bio_bcount / sz); @@ -410,8 +412,7 @@ mmcsd_delete(struct mmcsd_softc *sc, str if (!mmc_get_high_cap(dev)) cmd.arg <<= 9; cmd.flags = MMC_RSP_R1 | MMC_CMD_AC; - MMCBUS_WAIT_FOR_REQUEST(device_get_parent(dev), dev, - &req); + MMCBUS_WAIT_FOR_REQUEST(mmcbr, dev, &req); if (req.cmd->error != MMC_ERR_NONE) { printf("erase err1: %d\n", req.cmd->error); return (block); @@ -429,8 +430,7 @@ mmcsd_delete(struct mmcsd_softc *sc, str cmd.arg <<= 9; cmd.arg--; cmd.flags = MMC_RSP_R1 | MMC_CMD_AC; - MMCBUS_WAIT_FOR_REQUEST(device_get_parent(dev), dev, - &req); + MMCBUS_WAIT_FOR_REQUEST(mmcbr, dev, &req); if (req.cmd->error != MMC_ERR_NONE) { printf("erase err2: %d\n", req.cmd->error); return (block); @@ -442,8 +442,7 @@ mmcsd_delete(struct mmcsd_softc *sc, str cmd.opcode = MMC_ERASE; cmd.arg = 0; cmd.flags = MMC_RSP_R1B | MMC_CMD_AC; - MMCBUS_WAIT_FOR_REQUEST(device_get_parent(dev), dev, - &req); + MMCBUS_WAIT_FOR_REQUEST(mmcbr, dev, &req); if (req.cmd->error != MMC_ERR_NONE) { printf("erase err3 %d\n", req.cmd->error); return (block); @@ -468,6 +467,7 @@ mmcsd_dump(void *arg, void *virtual, vm_ device_t dev = sc->dev; struct bio bp; daddr_t block, end; + device_t mmcbr = device_get_parent(dev); /* length zero is special and really means flush buffers to media */ if (!length) @@ -480,9 +480,9 @@ mmcsd_dump(void *arg, void *virtual, vm_ bp.bio_data = virtual; bp.bio_cmd = BIO_WRITE; end = bp.bio_pblkno + bp.bio_bcount / sc->disk->d_sectorsize; - MMCBUS_ACQUIRE_BUS(device_get_parent(dev), dev); + MMCBUS_ACQUIRE_BUS(mmcbr, dev); block = mmcsd_rw(sc, &bp); - MMCBUS_RELEASE_BUS(device_get_parent(dev), dev); + MMCBUS_RELEASE_BUS(mmcbr, dev); return ((end < block) ? EIO : 0); } @@ -493,9 +493,9 @@ mmcsd_task(void *arg) struct bio *bp; int sz; daddr_t block, end; - device_t dev; + device_t dev = sc->dev; + device_t mmcbr = device_get_parent(sc->dev); - dev = sc->dev; while (1) { MMCSD_LOCK(sc); do { @@ -513,7 +513,7 @@ mmcsd_task(void *arg) biodone(bp); continue; } - MMCBUS_ACQUIRE_BUS(device_get_parent(dev), dev); + MMCBUS_ACQUIRE_BUS(mmcbr, dev); sz = sc->disk->d_sectorsize; block = bp->bio_pblkno; end = bp->bio_pblkno + (bp->bio_bcount / sz); @@ -525,7 +525,7 @@ mmcsd_task(void *arg) } else if (bp->bio_cmd == BIO_DELETE) { block = mmcsd_delete(sc, bp); } - MMCBUS_RELEASE_BUS(device_get_parent(dev), dev); + MMCBUS_RELEASE_BUS(mmcbr, dev); if (block < end) { bp->bio_error = EIO; bp->bio_resid = (end - block) * sz; From owner-svn-src-all@FreeBSD.ORG Sun Apr 14 19:59:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id DB026DFF; Sun, 14 Apr 2013 19:59:38 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CCA73F9A; Sun, 14 Apr 2013 19:59:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3EJxcrZ008563; Sun, 14 Apr 2013 19:59:38 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3EJxcZ3008562; Sun, 14 Apr 2013 19:59:38 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201304141959.r3EJxcZ3008562@svn.freebsd.org> From: Mikolaj Golub Date: Sun, 14 Apr 2013 19:59:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249486 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Apr 2013 19:59:38 -0000 Author: trociny Date: Sun Apr 14 19:59:38 2013 New Revision: 249486 URL: http://svnweb.freebsd.org/changeset/base/249486 Log: Re-factor coredump routines. For each type of notes an output function is provided, which is used either to calculate the note size or output it to sbuf. On the first pass the notes are registered in a list and the resulting size is found, on the second pass the list is traversed outputing notes to sbuf. For the sbuf a drain routine is provided that writes data to a core file. The main goal of the change is to make coredump to write notes directly to the core file, without preliminary preparing them all in a memory buffer. Storing notes in memory is not a problem for the current, rather small, set of notes we write to the core, but it may becomes an issue when we start to store procstat notes. Reviewed by: jhb (initial version), kib Discussed with: jhb, kib MFC after: 3 weeks Modified: head/sys/kern/imgact_elf.c Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Sun Apr 14 19:21:43 2013 (r249485) +++ head/sys/kern/imgact_elf.c Sun Apr 14 19:59:38 2013 (r249486) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -104,8 +105,8 @@ SYSCTL_NODE(_kern, OID_AUTO, __CONCAT(el #ifdef COMPRESS_USER_CORES static int compress_core(gzFile, char *, char *, unsigned int, struct thread * td); -#define CORE_BUF_SIZE (16 * 1024) #endif +#define CORE_BUF_SIZE (16 * 1024) int __elfN(fallback_brand) = -1; SYSCTL_INT(__CONCAT(_kern_elf, __ELF_WORD_SIZE), OID_AUTO, @@ -1038,14 +1039,35 @@ struct sseg_closure { size_t size; /* Total size of all writable segments. */ }; +typedef void (*outfunc_t)(void *, struct sbuf *, size_t *); + +struct note_info { + int type; /* Note type. */ + outfunc_t outfunc; /* Output function. */ + void *outarg; /* Argument for the output function. */ + size_t outsize; /* Output size. */ + TAILQ_ENTRY(note_info) link; /* Link to the next note info. */ +}; + +TAILQ_HEAD(note_info_list, note_info); + static void cb_put_phdr(vm_map_entry_t, void *); static void cb_size_segment(vm_map_entry_t, void *); static void each_writable_segment(struct thread *, segment_callback, void *); static int __elfN(corehdr)(struct thread *, struct vnode *, struct ucred *, - int, void *, size_t, gzFile); -static void __elfN(puthdr)(struct thread *, void *, size_t *, int); -static void __elfN(putnote)(void *, size_t *, const char *, int, - const void *, size_t); + int, void *, size_t, struct note_info_list *, size_t, gzFile); +static void __elfN(prepare_notes)(struct thread *, struct note_info_list *, + size_t *); +static void __elfN(puthdr)(struct thread *, void *, size_t, int, size_t); +static void __elfN(putnote)(struct note_info *, struct sbuf *); +static size_t register_note(struct note_info_list *, int, outfunc_t, void *); +static int sbuf_drain_core_output(void *, const char *, int); + +static void __elfN(note_fpregset)(void *, struct sbuf *, size_t *); +static void __elfN(note_prpsinfo)(void *, struct sbuf *, size_t *); +static void __elfN(note_prstatus)(void *, struct sbuf *, size_t *); +static void __elfN(note_threadmd)(void *, struct sbuf *, size_t *); +static void __elfN(note_thrmisc)(void *, struct sbuf *, size_t *); #ifdef COMPRESS_USER_CORES extern int compress_user_cores; @@ -1072,14 +1094,54 @@ core_output(struct vnode *vp, void *base return (error); } +/* Coredump output parameters for sbuf drain routine. */ +struct sbuf_drain_core_params { + off_t offset; + struct ucred *active_cred; + struct ucred *file_cred; + struct thread *td; + struct vnode *vp; +#ifdef COMPRESS_USER_CORES + gzFile gzfile; +#endif +}; + +/* + * Drain into a core file. + */ +static int +sbuf_drain_core_output(void *arg, const char *data, int len) +{ + struct sbuf_drain_core_params *p; + int error; + + p = (struct sbuf_drain_core_params *)arg; +#ifdef COMPRESS_USER_CORES + if (p->gzfile != Z_NULL) + error = compress_core(p->gzfile, NULL, __DECONST(char *, data), + len, p->td); + else +#endif + error = vn_rdwr_inchunks(UIO_WRITE, p->vp, + __DECONST(void *, data), len, p->offset, UIO_SYSSPACE, + IO_UNIT | IO_DIRECT, p->active_cred, p->file_cred, NULL, + p->td); + if (error != 0) + return (-error); + p->offset += len; + return (len); +} + int __elfN(coredump)(struct thread *td, struct vnode *vp, off_t limit, int flags) { struct ucred *cred = td->td_ucred; int error = 0; struct sseg_closure seginfo; + struct note_info_list notelst; + struct note_info *ninfo; void *hdr; - size_t hdrsize; + size_t hdrsize, notesz, coresize; gzFile gzfile = Z_NULL; char *core_buf = NULL; @@ -1090,6 +1152,7 @@ __elfN(coredump)(struct thread *td, stru #endif hdr = NULL; + TAILQ_INIT(¬elst); #ifdef COMPRESS_USER_CORES if (doing_compress) { @@ -1118,30 +1181,29 @@ __elfN(coredump)(struct thread *td, stru each_writable_segment(td, cb_size_segment, &seginfo); /* - * Calculate the size of the core file header area by making - * a dry run of generating it. Nothing is written, but the - * size is calculated. + * Collect info about the core file header area. */ - hdrsize = 0; - __elfN(puthdr)(td, (void *)NULL, &hdrsize, seginfo.count); + hdrsize = sizeof(Elf_Ehdr) + sizeof(Elf_Phdr) * (1 + seginfo.count); + __elfN(prepare_notes)(td, ¬elst, ¬esz); + coresize = round_page(hdrsize + notesz) + seginfo.size; #ifdef RACCT PROC_LOCK(td->td_proc); - error = racct_add(td->td_proc, RACCT_CORE, hdrsize + seginfo.size); + error = racct_add(td->td_proc, RACCT_CORE, coresize); PROC_UNLOCK(td->td_proc); if (error != 0) { error = EFAULT; goto done; } #endif - if (hdrsize + seginfo.size >= limit) { + if (coresize >= limit) { error = EFAULT; goto done; } /* * Allocate memory for building the header, fill it up, - * and write it out. + * and write it out following the notes. */ hdr = malloc(hdrsize, M_TEMP, M_WAITOK); if (hdr == NULL) { @@ -1149,7 +1211,7 @@ __elfN(coredump)(struct thread *td, stru goto done; } error = __elfN(corehdr)(td, vp, cred, seginfo.count, hdr, hdrsize, - gzfile); + ¬elst, notesz, gzfile); /* Write the contents of all of the writable segments. */ if (error == 0) { @@ -1158,7 +1220,7 @@ __elfN(coredump)(struct thread *td, stru int i; php = (Elf_Phdr *)((char *)hdr + sizeof(Elf_Ehdr)) + 1; - offset = hdrsize; + offset = round_page(hdrsize + notesz); for (i = 0; i < seginfo.count; i++) { error = core_output(vp, (caddr_t)(uintptr_t)php->p_vaddr, php->p_filesz, offset, cred, NOCRED, curthread, core_buf, gzfile); @@ -1181,8 +1243,12 @@ done: if (gzfile) gzclose(gzfile); #endif - - free(hdr, M_TEMP); + while ((ninfo = TAILQ_FIRST(¬elst)) != NULL) { + TAILQ_REMOVE(¬elst, ninfo, link); + free(ninfo, M_TEMP); + } + if (hdr != NULL) + free(hdr, M_TEMP); return (error); } @@ -1299,44 +1365,194 @@ each_writable_segment(td, func, closure) * the page boundary. */ static int -__elfN(corehdr)(td, vp, cred, numsegs, hdr, hdrsize, gzfile) - struct thread *td; - struct vnode *vp; - struct ucred *cred; - int numsegs; - size_t hdrsize; - void *hdr; - gzFile gzfile; -{ - size_t off; +__elfN(corehdr)(struct thread *td, struct vnode *vp, struct ucred *cred, + int numsegs, void *hdr, size_t hdrsize, struct note_info_list *notelst, + size_t notesz, gzFile gzfile) +{ + struct sbuf_drain_core_params params; + struct note_info *ninfo; + struct sbuf *sb; + int error; /* Fill in the header. */ bzero(hdr, hdrsize); - off = 0; - __elfN(puthdr)(td, hdr, &off, numsegs); + __elfN(puthdr)(td, hdr, hdrsize, numsegs, notesz); - if (!gzfile) { - /* Write it to the core file. */ - return (vn_rdwr_inchunks(UIO_WRITE, vp, hdr, hdrsize, (off_t)0, - UIO_SYSSPACE, IO_UNIT | IO_DIRECT, cred, NOCRED, NULL, - td)); - } else { + params.offset = 0; + params.active_cred = cred; + params.file_cred = NOCRED; + params.td = td; + params.vp = vp; #ifdef COMPRESS_USER_CORES - if (gzwrite(gzfile, hdr, hdrsize) != hdrsize) { - log(LOG_WARNING, - "Failed to compress core file header for process" - " %s.\n", curproc->p_comm); - return (EFAULT); - } - else { - return (0); - } -#else - panic("shouldn't be here"); + params.gzfile = gzfile; #endif + sb = sbuf_new(NULL, NULL, CORE_BUF_SIZE, SBUF_FIXEDLEN); + sbuf_set_drain(sb, sbuf_drain_core_output, ¶ms); + sbuf_start_section(sb, NULL); + sbuf_bcat(sb, hdr, hdrsize); + TAILQ_FOREACH(ninfo, notelst, link) + __elfN(putnote)(ninfo, sb); + /* Align up to a page boundary for the program segments. */ + sbuf_end_section(sb, -1, PAGE_SIZE, 0); + error = sbuf_finish(sb); + sbuf_delete(sb); + + return (error); +} + +static void +__elfN(prepare_notes)(struct thread *td, struct note_info_list *list, + size_t *sizep) +{ + struct proc *p; + struct thread *thr; + size_t size; + + p = td->td_proc; + size = 0; + + size += register_note(list, NT_PRPSINFO, __elfN(note_prpsinfo), p); + + /* + * To have the debugger select the right thread (LWP) as the initial + * thread, we dump the state of the thread passed to us in td first. + * This is the thread that causes the core dump and thus likely to + * be the right thread one wants to have selected in the debugger. + */ + thr = td; + while (thr != NULL) { + size += register_note(list, NT_PRSTATUS, + __elfN(note_prstatus), thr); + size += register_note(list, NT_FPREGSET, + __elfN(note_fpregset), thr); + size += register_note(list, NT_THRMISC, + __elfN(note_thrmisc), thr); + size += register_note(list, -1, + __elfN(note_threadmd), thr); + + thr = (thr == td) ? TAILQ_FIRST(&p->p_threads) : + TAILQ_NEXT(thr, td_plist); + if (thr == td) + thr = TAILQ_NEXT(thr, td_plist); } + + *sizep = size; +} + +static void +__elfN(puthdr)(struct thread *td, void *hdr, size_t hdrsize, int numsegs, + size_t notesz) +{ + Elf_Ehdr *ehdr; + Elf_Phdr *phdr; + struct phdr_closure phc; + + ehdr = (Elf_Ehdr *)hdr; + phdr = (Elf_Phdr *)((char *)hdr + sizeof(Elf_Ehdr)); + + ehdr->e_ident[EI_MAG0] = ELFMAG0; + ehdr->e_ident[EI_MAG1] = ELFMAG1; + ehdr->e_ident[EI_MAG2] = ELFMAG2; + ehdr->e_ident[EI_MAG3] = ELFMAG3; + ehdr->e_ident[EI_CLASS] = ELF_CLASS; + ehdr->e_ident[EI_DATA] = ELF_DATA; + ehdr->e_ident[EI_VERSION] = EV_CURRENT; + ehdr->e_ident[EI_OSABI] = ELFOSABI_FREEBSD; + ehdr->e_ident[EI_ABIVERSION] = 0; + ehdr->e_ident[EI_PAD] = 0; + ehdr->e_type = ET_CORE; +#if defined(COMPAT_FREEBSD32) && __ELF_WORD_SIZE == 32 + ehdr->e_machine = ELF_ARCH32; +#else + ehdr->e_machine = ELF_ARCH; +#endif + ehdr->e_version = EV_CURRENT; + ehdr->e_entry = 0; + ehdr->e_phoff = sizeof(Elf_Ehdr); + ehdr->e_flags = 0; + ehdr->e_ehsize = sizeof(Elf_Ehdr); + ehdr->e_phentsize = sizeof(Elf_Phdr); + ehdr->e_phnum = numsegs + 1; + ehdr->e_shentsize = sizeof(Elf_Shdr); + ehdr->e_shnum = 0; + ehdr->e_shstrndx = SHN_UNDEF; + + /* + * Fill in the program header entries. + */ + + /* The note segement. */ + phdr->p_type = PT_NOTE; + phdr->p_offset = hdrsize; + phdr->p_vaddr = 0; + phdr->p_paddr = 0; + phdr->p_filesz = notesz; + phdr->p_memsz = 0; + phdr->p_flags = PF_R; + phdr->p_align = sizeof(Elf32_Size); + phdr++; + + /* All the writable segments from the program. */ + phc.phdr = phdr; + phc.offset = round_page(hdrsize + notesz); + each_writable_segment(td, cb_put_phdr, &phc); +} + +static size_t +register_note(struct note_info_list *list, int type, outfunc_t out, void *arg) +{ + struct note_info *ninfo; + size_t size, notesize; + + size = 0; + out(arg, NULL, &size); + ninfo = malloc(sizeof(*ninfo), M_TEMP, M_ZERO | M_WAITOK); + ninfo->type = type; + ninfo->outfunc = out; + ninfo->outarg = arg; + ninfo->outsize = size; + TAILQ_INSERT_TAIL(list, ninfo, link); + + if (type == -1) + return (size); + + notesize = sizeof(Elf_Note) + /* note header */ + roundup2(8, sizeof(Elf32_Size)) + /* note name ("FreeBSD") */ + roundup2(size, sizeof(Elf32_Size)); /* note description */ + + return (notesize); +} + +static void +__elfN(putnote)(struct note_info *ninfo, struct sbuf *sb) +{ + Elf_Note note; + ssize_t old_len; + + if (ninfo->type == -1) { + ninfo->outfunc(ninfo->outarg, sb, &ninfo->outsize); + return; + } + + note.n_namesz = 8; /* strlen("FreeBSD") + 1 */ + note.n_descsz = ninfo->outsize; + note.n_type = ninfo->type; + + sbuf_bcat(sb, ¬e, sizeof(note)); + sbuf_start_section(sb, &old_len); + sbuf_bcat(sb, "FreeBSD", note.n_namesz); + sbuf_end_section(sb, old_len, sizeof(Elf32_Size), 0); + if (note.n_descsz == 0) + return; + sbuf_start_section(sb, &old_len); + ninfo->outfunc(ninfo->outarg, sb, &ninfo->outsize); + sbuf_end_section(sb, old_len, sizeof(Elf32_Size), 0); } +/* + * Miscellaneous note out functions. + */ + #if defined(COMPAT_FREEBSD32) && __ELF_WORD_SIZE == 32 #include @@ -1356,50 +1572,15 @@ typedef thrmisc_t elf_thrmisc_t; #endif static void -__elfN(puthdr)(struct thread *td, void *dst, size_t *off, int numsegs) +__elfN(note_prpsinfo)(void *arg, struct sbuf *sb, size_t *sizep) { - struct { - elf_prstatus_t status; - elf_prfpregset_t fpregset; - elf_prpsinfo_t psinfo; - elf_thrmisc_t thrmisc; - } *tempdata; - elf_prstatus_t *status; - elf_prfpregset_t *fpregset; - elf_prpsinfo_t *psinfo; - elf_thrmisc_t *thrmisc; struct proc *p; - struct thread *thr; - size_t ehoff, noteoff, notesz, phoff; - - p = td->td_proc; - - ehoff = *off; - *off += sizeof(Elf_Ehdr); - - phoff = *off; - *off += (numsegs + 1) * sizeof(Elf_Phdr); - - noteoff = *off; - /* - * Don't allocate space for the notes if we're just calculating - * the size of the header. We also don't collect the data. - */ - if (dst != NULL) { - tempdata = malloc(sizeof(*tempdata), M_TEMP, M_ZERO|M_WAITOK); - status = &tempdata->status; - fpregset = &tempdata->fpregset; - psinfo = &tempdata->psinfo; - thrmisc = &tempdata->thrmisc; - } else { - tempdata = NULL; - status = NULL; - fpregset = NULL; - psinfo = NULL; - thrmisc = NULL; - } + elf_prpsinfo_t *psinfo; - if (dst != NULL) { + p = (struct proc *)arg; + if (sb != NULL) { + KASSERT(*sizep == sizeof(*psinfo), ("invalid size")); + psinfo = malloc(sizeof(*psinfo), M_TEMP, M_ZERO | M_WAITOK); psinfo->pr_version = PRPSINFO_VERSION; psinfo->pr_psinfosz = sizeof(elf_prpsinfo_t); strlcpy(psinfo->pr_fname, p->p_comm, sizeof(psinfo->pr_fname)); @@ -1409,139 +1590,100 @@ __elfN(puthdr)(struct thread *td, void * */ strlcpy(psinfo->pr_psargs, p->p_comm, sizeof(psinfo->pr_psargs)); + + sbuf_bcat(sb, psinfo, sizeof(*psinfo)); + free(psinfo, M_TEMP); } - __elfN(putnote)(dst, off, "FreeBSD", NT_PRPSINFO, psinfo, - sizeof *psinfo); + *sizep = sizeof(*psinfo); +} - /* - * To have the debugger select the right thread (LWP) as the initial - * thread, we dump the state of the thread passed to us in td first. - * This is the thread that causes the core dump and thus likely to - * be the right thread one wants to have selected in the debugger. - */ - thr = td; - while (thr != NULL) { - if (dst != NULL) { - status->pr_version = PRSTATUS_VERSION; - status->pr_statussz = sizeof(elf_prstatus_t); - status->pr_gregsetsz = sizeof(elf_gregset_t); - status->pr_fpregsetsz = sizeof(elf_fpregset_t); - status->pr_osreldate = osreldate; - status->pr_cursig = p->p_sig; - status->pr_pid = thr->td_tid; +static void +__elfN(note_prstatus)(void *arg, struct sbuf *sb, size_t *sizep) +{ + struct thread *td; + elf_prstatus_t *status; + + td = (struct thread *)arg; + if (sb != NULL) { + KASSERT(*sizep == sizeof(*status), ("invalid size")); + status = malloc(sizeof(*status), M_TEMP, M_ZERO | M_WAITOK); + status->pr_version = PRSTATUS_VERSION; + status->pr_statussz = sizeof(elf_prstatus_t); + status->pr_gregsetsz = sizeof(elf_gregset_t); + status->pr_fpregsetsz = sizeof(elf_fpregset_t); + status->pr_osreldate = osreldate; + status->pr_cursig = td->td_proc->p_sig; + status->pr_pid = td->td_tid; #if defined(COMPAT_FREEBSD32) && __ELF_WORD_SIZE == 32 - fill_regs32(thr, &status->pr_reg); - fill_fpregs32(thr, fpregset); + fill_regs32(td, &status->pr_reg); #else - fill_regs(thr, &status->pr_reg); - fill_fpregs(thr, fpregset); + fill_regs(td, &status->pr_reg); #endif - memset(&thrmisc->_pad, 0, sizeof (thrmisc->_pad)); - strcpy(thrmisc->pr_tname, thr->td_name); - } - __elfN(putnote)(dst, off, "FreeBSD", NT_PRSTATUS, status, - sizeof *status); - __elfN(putnote)(dst, off, "FreeBSD", NT_FPREGSET, fpregset, - sizeof *fpregset); - __elfN(putnote)(dst, off, "FreeBSD", NT_THRMISC, thrmisc, - sizeof *thrmisc); - /* - * Allow for MD specific notes, as well as any MD - * specific preparations for writing MI notes. - */ - __elfN(dump_thread)(thr, dst, off); - - thr = (thr == td) ? TAILQ_FIRST(&p->p_threads) : - TAILQ_NEXT(thr, td_plist); - if (thr == td) - thr = TAILQ_NEXT(thr, td_plist); + sbuf_bcat(sb, status, sizeof(*status)); + free(status, M_TEMP); } + *sizep = sizeof(*status); +} - notesz = *off - noteoff; - - if (dst != NULL) - free(tempdata, M_TEMP); - - /* Align up to a page boundary for the program segments. */ - *off = round_page(*off); - - if (dst != NULL) { - Elf_Ehdr *ehdr; - Elf_Phdr *phdr; - struct phdr_closure phc; +static void +__elfN(note_fpregset)(void *arg, struct sbuf *sb, size_t *sizep) +{ + struct thread *td; + elf_prfpregset_t *fpregset; - /* - * Fill in the ELF header. - */ - ehdr = (Elf_Ehdr *)((char *)dst + ehoff); - ehdr->e_ident[EI_MAG0] = ELFMAG0; - ehdr->e_ident[EI_MAG1] = ELFMAG1; - ehdr->e_ident[EI_MAG2] = ELFMAG2; - ehdr->e_ident[EI_MAG3] = ELFMAG3; - ehdr->e_ident[EI_CLASS] = ELF_CLASS; - ehdr->e_ident[EI_DATA] = ELF_DATA; - ehdr->e_ident[EI_VERSION] = EV_CURRENT; - ehdr->e_ident[EI_OSABI] = ELFOSABI_FREEBSD; - ehdr->e_ident[EI_ABIVERSION] = 0; - ehdr->e_ident[EI_PAD] = 0; - ehdr->e_type = ET_CORE; + td = (struct thread *)arg; + if (sb != NULL) { + KASSERT(*sizep == sizeof(*fpregset), ("invalid size")); + fpregset = malloc(sizeof(*fpregset), M_TEMP, M_ZERO | M_WAITOK); #if defined(COMPAT_FREEBSD32) && __ELF_WORD_SIZE == 32 - ehdr->e_machine = ELF_ARCH32; + fill_fpregs32(td, fpregset); #else - ehdr->e_machine = ELF_ARCH; + fill_fpregs(td, fpregset); #endif - ehdr->e_version = EV_CURRENT; - ehdr->e_entry = 0; - ehdr->e_phoff = phoff; - ehdr->e_flags = 0; - ehdr->e_ehsize = sizeof(Elf_Ehdr); - ehdr->e_phentsize = sizeof(Elf_Phdr); - ehdr->e_phnum = numsegs + 1; - ehdr->e_shentsize = sizeof(Elf_Shdr); - ehdr->e_shnum = 0; - ehdr->e_shstrndx = SHN_UNDEF; + sbuf_bcat(sb, fpregset, sizeof(*fpregset)); + free(fpregset, M_TEMP); + } + *sizep = sizeof(*fpregset); +} - /* - * Fill in the program header entries. - */ - phdr = (Elf_Phdr *)((char *)dst + phoff); +static void +__elfN(note_thrmisc)(void *arg, struct sbuf *sb, size_t *sizep) +{ + struct thread *td; + elf_thrmisc_t thrmisc; - /* The note segement. */ - phdr->p_type = PT_NOTE; - phdr->p_offset = noteoff; - phdr->p_vaddr = 0; - phdr->p_paddr = 0; - phdr->p_filesz = notesz; - phdr->p_memsz = 0; - phdr->p_flags = PF_R; - phdr->p_align = sizeof(Elf32_Size); - phdr++; - - /* All the writable segments from the program. */ - phc.phdr = phdr; - phc.offset = *off; - each_writable_segment(td, cb_put_phdr, &phc); + td = (struct thread *)arg; + if (sb != NULL) { + KASSERT(*sizep == sizeof(thrmisc), ("invalid size")); + bzero(&thrmisc._pad, sizeof(thrmisc._pad)); + strcpy(thrmisc.pr_tname, td->td_name); + sbuf_bcat(sb, &thrmisc, sizeof(thrmisc)); } + *sizep = sizeof(thrmisc); } +/* + * Allow for MD specific notes, as well as any MD + * specific preparations for writing MI notes. + */ static void -__elfN(putnote)(void *dst, size_t *off, const char *name, int type, - const void *desc, size_t descsz) +__elfN(note_threadmd)(void *arg, struct sbuf *sb, size_t *sizep) { - Elf_Note note; + struct thread *td; + void *buf; + size_t size; - note.n_namesz = strlen(name) + 1; - note.n_descsz = descsz; - note.n_type = type; - if (dst != NULL) - bcopy(¬e, (char *)dst + *off, sizeof note); - *off += sizeof note; - if (dst != NULL) - bcopy(name, (char *)dst + *off, note.n_namesz); - *off += roundup2(note.n_namesz, sizeof(Elf32_Size)); - if (dst != NULL) - bcopy(desc, (char *)dst + *off, note.n_descsz); - *off += roundup2(note.n_descsz, sizeof(Elf32_Size)); + td = (struct thread *)arg; + size = *sizep; + buf = NULL; + if (size != 0 && sb != NULL) + buf = malloc(size, M_TEMP, M_ZERO | M_WAITOK); + size = 0; + __elfN(dump_thread)(td, buf, &size); + KASSERT(*sizep == size, ("invalid size")); + if (size != 0 && sb != NULL) + sbuf_bcat(sb, buf, size); + *sizep = size; } static boolean_t @@ -1636,6 +1778,8 @@ EXEC_SET(__CONCAT(elf, __ELF_WORD_SIZE), * routine gzwrite(). This copying is necessary because the content of the VM * segment may change between the compression pass and the crc-computation pass * in gzwrite(). This is because realtime threads may preempt the UNIX kernel. + * + * If inbuf is NULL it is assumed that data is already copied to 'dest_buf'. */ static int compress_core (gzFile file, char *inbuf, char *dest_buf, unsigned int len, @@ -1646,8 +1790,13 @@ compress_core (gzFile file, char *inbuf, unsigned int chunk_len; while (len) { - chunk_len = (len > CORE_BUF_SIZE) ? CORE_BUF_SIZE : len; - copyin(inbuf, dest_buf, chunk_len); + if (inbuf != NULL) { + chunk_len = (len > CORE_BUF_SIZE) ? CORE_BUF_SIZE : len; + copyin(inbuf, dest_buf, chunk_len); + inbuf += chunk_len; + } else { + chunk_len = len; + } len_compressed = gzwrite(file, dest_buf, chunk_len); EVENTHANDLER_INVOKE(app_coredump_progress, td, len_compressed); @@ -1662,7 +1811,6 @@ compress_core (gzFile file, char *inbuf, error = EFAULT; break; } - inbuf += chunk_len; len -= chunk_len; maybe_yield(); } From owner-svn-src-all@FreeBSD.ORG Sun Apr 14 20:01:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id AF4F9F96; Sun, 14 Apr 2013 20:01:37 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A120AFB0; Sun, 14 Apr 2013 20:01:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3EK1bdN010737; Sun, 14 Apr 2013 20:01:37 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3EK1b0v010733; Sun, 14 Apr 2013 20:01:37 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201304142001.r3EK1b0v010733@svn.freebsd.org> From: Mikolaj Golub Date: Sun, 14 Apr 2013 20:01:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249487 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Apr 2013 20:01:37 -0000 Author: trociny Date: Sun Apr 14 20:01:36 2013 New Revision: 249487 URL: http://svnweb.freebsd.org/changeset/base/249487 Log: Re-factor the code to provide kern_proc_filedesc_out(), kern_proc_out(), and kern_proc_vmmap_out() functions to output process kinfo structures to sbuf, to make the code reusable. The functions are going to be used in the coredump routine to store procstat info in the core program header notes. Reviewed by: kib MFC after: 3 weeks Modified: head/sys/kern/kern_descrip.c head/sys/kern/kern_proc.c head/sys/sys/user.h Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Sun Apr 14 19:59:38 2013 (r249486) +++ head/sys/kern/kern_descrip.c Sun Apr 14 20:01:36 2013 (r249487) @@ -71,6 +71,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -3168,9 +3169,9 @@ CTASSERT(sizeof(struct kinfo_file) == KI #endif static int -export_fd_for_sysctl(void *data, int type, int fd, int fflags, int refcnt, +export_fd_to_sb(void *data, int type, int fd, int fflags, int refcnt, int64_t offset, cap_rights_t fd_cap_rights, struct kinfo_file *kif, - struct sysctl_req *req) + struct sbuf *sb, ssize_t *remainder) { struct { int fflag; @@ -3197,6 +3198,8 @@ export_fd_for_sysctl(void *data, int typ int error; unsigned int i; + if (*remainder == 0) + return (0); bzero(kif, sizeof(*kif)); switch (type) { case KF_TYPE_FIFO: @@ -3241,32 +3244,40 @@ export_fd_for_sysctl(void *data, int typ kif->kf_structsize = offsetof(struct kinfo_file, kf_path) + strlen(kif->kf_path) + 1; kif->kf_structsize = roundup(kif->kf_structsize, sizeof(uint64_t)); - error = SYSCTL_OUT(req, kif, kif->kf_structsize); + if (*remainder != -1) { + if (*remainder < kif->kf_structsize) { + /* Terminate export. */ + *remainder = 0; + return (0); + } + *remainder -= kif->kf_structsize; + } + error = sbuf_bcat(sb, kif, kif->kf_structsize); return (error); } /* - * Get per-process file descriptors for use by procstat(1), et al. + * Store a process file descriptor information to sbuf. + * + * Takes a locked proc as argument, and returns with the proc unlocked. */ -static int -sysctl_kern_proc_filedesc(SYSCTL_HANDLER_ARGS) +int +kern_proc_filedesc_out(struct proc *p, struct sbuf *sb, ssize_t maxlen) { struct file *fp; struct filedesc *fdp; struct kinfo_file *kif; - struct proc *p; struct vnode *cttyvp, *textvp, *tracevp; - size_t oldidx; int64_t offset; void *data; - int error, i, *name; + ssize_t remainder; + int error, i; int type, refcnt, fflags; cap_rights_t fd_cap_rights; - name = (int *)arg1; - error = pget((pid_t)name[0], PGET_CANDEBUG, &p); - if (error != 0) - return (error); + PROC_LOCK_ASSERT(p, MA_OWNED); + + remainder = maxlen; /* ktrace vnode */ tracevp = p->p_tracevp; if (tracevp != NULL) @@ -3286,14 +3297,15 @@ sysctl_kern_proc_filedesc(SYSCTL_HANDLER PROC_UNLOCK(p); kif = malloc(sizeof(*kif), M_TEMP, M_WAITOK); if (tracevp != NULL) - export_fd_for_sysctl(tracevp, KF_TYPE_VNODE, KF_FD_TYPE_TRACE, - FREAD | FWRITE, -1, -1, 0, kif, req); + export_fd_to_sb(tracevp, KF_TYPE_VNODE, KF_FD_TYPE_TRACE, + FREAD | FWRITE, -1, -1, 0, kif, sb, &remainder); if (textvp != NULL) - export_fd_for_sysctl(textvp, KF_TYPE_VNODE, KF_FD_TYPE_TEXT, - FREAD, -1, -1, 0, kif, req); + export_fd_to_sb(textvp, KF_TYPE_VNODE, KF_FD_TYPE_TEXT, + FREAD, -1, -1, 0, kif, sb, &remainder); if (cttyvp != NULL) - export_fd_for_sysctl(cttyvp, KF_TYPE_VNODE, KF_FD_TYPE_CTTY, - FREAD | FWRITE, -1, -1, 0, kif, req); + export_fd_to_sb(cttyvp, KF_TYPE_VNODE, KF_FD_TYPE_CTTY, + FREAD | FWRITE, -1, -1, 0, kif, sb, &remainder); + error = 0; if (fdp == NULL) goto fail; FILEDESC_SLOCK(fdp); @@ -3302,8 +3314,8 @@ sysctl_kern_proc_filedesc(SYSCTL_HANDLER vref(fdp->fd_cdir); data = fdp->fd_cdir; FILEDESC_SUNLOCK(fdp); - export_fd_for_sysctl(data, KF_TYPE_VNODE, KF_FD_TYPE_CWD, - FREAD, -1, -1, 0, kif, req); + export_fd_to_sb(data, KF_TYPE_VNODE, KF_FD_TYPE_CWD, + FREAD, -1, -1, 0, kif, sb, &remainder); FILEDESC_SLOCK(fdp); } /* root directory */ @@ -3311,8 +3323,8 @@ sysctl_kern_proc_filedesc(SYSCTL_HANDLER vref(fdp->fd_rdir); data = fdp->fd_rdir; FILEDESC_SUNLOCK(fdp); - export_fd_for_sysctl(data, KF_TYPE_VNODE, KF_FD_TYPE_ROOT, - FREAD, -1, -1, 0, kif, req); + export_fd_to_sb(data, KF_TYPE_VNODE, KF_FD_TYPE_ROOT, + FREAD, -1, -1, 0, kif, sb, &remainder); FILEDESC_SLOCK(fdp); } /* jail directory */ @@ -3320,8 +3332,8 @@ sysctl_kern_proc_filedesc(SYSCTL_HANDLER vref(fdp->fd_jdir); data = fdp->fd_jdir; FILEDESC_SUNLOCK(fdp); - export_fd_for_sysctl(data, KF_TYPE_VNODE, KF_FD_TYPE_JAIL, - FREAD, -1, -1, 0, kif, req); + export_fd_to_sb(data, KF_TYPE_VNODE, KF_FD_TYPE_JAIL, + FREAD, -1, -1, 0, kif, sb, &remainder); FILEDESC_SLOCK(fdp); } for (i = 0; i < fdp->fd_nfiles; i++) { @@ -3403,26 +3415,14 @@ sysctl_kern_proc_filedesc(SYSCTL_HANDLER * re-validate and re-evaluate its properties when * the loop continues. */ - oldidx = req->oldidx; if (type == KF_TYPE_VNODE || type == KF_TYPE_FIFO) FILEDESC_SUNLOCK(fdp); - error = export_fd_for_sysctl(data, type, i, fflags, refcnt, - offset, fd_cap_rights, kif, req); + error = export_fd_to_sb(data, type, i, fflags, refcnt, + offset, fd_cap_rights, kif, sb, &remainder); if (type == KF_TYPE_VNODE || type == KF_TYPE_FIFO) FILEDESC_SLOCK(fdp); - if (error) { - if (error == ENOMEM) { - /* - * The hack to keep the ABI of sysctl - * kern.proc.filedesc intact, but not - * to account a partially copied - * kinfo_file into the oldidx. - */ - req->oldidx = oldidx; - error = 0; - } + if (error) break; - } } FILEDESC_SUNLOCK(fdp); fail: @@ -3432,6 +3432,34 @@ fail: return (error); } +#define FILEDESC_SBUF_SIZE (sizeof(struct kinfo_file) * 5) + +/* + * Get per-process file descriptors for use by procstat(1), et al. + */ +static int +sysctl_kern_proc_filedesc(SYSCTL_HANDLER_ARGS) +{ + struct sbuf sb; + struct proc *p; + ssize_t maxlen; + int error, error2, *name; + + name = (int *)arg1; + + sbuf_new_for_sysctl(&sb, NULL, FILEDESC_SBUF_SIZE, req); + error = pget((pid_t)name[0], PGET_CANDEBUG, &p); + if (error != 0) { + sbuf_delete(&sb); + return (error); + } + maxlen = req->oldptr != NULL ? req->oldlen : -1; + error = kern_proc_filedesc_out(p, &sb, maxlen); + error2 = sbuf_finish(&sb); + sbuf_delete(&sb); + return (error != 0 ? error : error2); +} + int vntype_to_kinfo(int vtype) { Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Sun Apr 14 19:59:38 2013 (r249486) +++ head/sys/kern/kern_proc.c Sun Apr 14 20:01:36 2013 (r249487) @@ -1089,9 +1089,6 @@ zpfind(pid_t pid) return (p); } -#define KERN_PROC_ZOMBMASK 0x3 -#define KERN_PROC_NOTHREADS 0x4 - #ifdef COMPAT_FREEBSD32 /* @@ -1191,59 +1188,69 @@ freebsd32_kinfo_proc_out(const struct ki CP(*ki, *ki32, ki_sflag); CP(*ki, *ki32, ki_tdflags); } - -static int -sysctl_out_proc_copyout(struct kinfo_proc *ki, struct sysctl_req *req) -{ - struct kinfo_proc32 ki32; - int error; - - if (req->flags & SCTL_MASK32) { - freebsd32_kinfo_proc_out(ki, &ki32); - error = SYSCTL_OUT(req, &ki32, sizeof(struct kinfo_proc32)); - } else - error = SYSCTL_OUT(req, ki, sizeof(struct kinfo_proc)); - return (error); -} -#else -static int -sysctl_out_proc_copyout(struct kinfo_proc *ki, struct sysctl_req *req) -{ - - return (SYSCTL_OUT(req, ki, sizeof(struct kinfo_proc))); -} #endif -/* - * Must be called with the process locked and will return with it unlocked. - */ -static int -sysctl_out_proc(struct proc *p, struct sysctl_req *req, int flags) +int +kern_proc_out(struct proc *p, struct sbuf *sb, int flags) { struct thread *td; - struct kinfo_proc kinfo_proc; - int error = 0; - struct proc *np; - pid_t pid = p->p_pid; + struct kinfo_proc ki; +#ifdef COMPAT_FREEBSD32 + struct kinfo_proc32 ki32; +#endif + int error; PROC_LOCK_ASSERT(p, MA_OWNED); MPASS(FIRST_THREAD_IN_PROC(p) != NULL); - fill_kinfo_proc(p, &kinfo_proc); - if (flags & KERN_PROC_NOTHREADS) - error = sysctl_out_proc_copyout(&kinfo_proc, req); - else { + error = 0; + fill_kinfo_proc(p, &ki); + if ((flags & KERN_PROC_NOTHREADS) != 0) { +#ifdef COMPAT_FREEBSD32 + if ((flags & KERN_PROC_MASK32) != 0) { + freebsd32_kinfo_proc_out(&ki, &ki32); + error = sbuf_bcat(sb, &ki32, sizeof(ki32)); + } else +#endif + error = sbuf_bcat(sb, &ki, sizeof(ki)); + } else { FOREACH_THREAD_IN_PROC(p, td) { - fill_kinfo_thread(td, &kinfo_proc, 1); - error = sysctl_out_proc_copyout(&kinfo_proc, req); + fill_kinfo_thread(td, &ki, 1); +#ifdef COMPAT_FREEBSD32 + if ((flags & KERN_PROC_MASK32) != 0) { + freebsd32_kinfo_proc_out(&ki, &ki32); + error = sbuf_bcat(sb, &ki32, sizeof(ki32)); + } else +#endif + error = sbuf_bcat(sb, &ki, sizeof(ki)); if (error) break; } } PROC_UNLOCK(p); - if (error) + return (error); +} + +static int +sysctl_out_proc(struct proc *p, struct sysctl_req *req, int flags, + int doingzomb) +{ + struct sbuf sb; + struct kinfo_proc ki; + struct proc *np; + int error, error2; + pid_t pid; + + pid = p->p_pid; + sbuf_new_for_sysctl(&sb, (char *)&ki, sizeof(ki), req); + error = kern_proc_out(p, &sb, flags); + error2 = sbuf_finish(&sb); + sbuf_delete(&sb); + if (error != 0) return (error); - if (flags & KERN_PROC_ZOMBMASK) + else if (error2 != 0) + return (error2); + if (doingzomb) np = zpfind(pid); else { if (pid == 0) @@ -1277,6 +1284,10 @@ sysctl_kern_proc(SYSCTL_HANDLER_ARGS) flags = 0; oid_number &= ~KERN_PROC_INC_THREAD; } +#ifdef COMPAT_FREEBSD32 + if (req->flags & SCTL_MASK32) + flags |= KERN_PROC_MASK32; +#endif if (oid_number == KERN_PROC_PID) { if (namelen != 1) return (EINVAL); @@ -1286,7 +1297,7 @@ sysctl_kern_proc(SYSCTL_HANDLER_ARGS) error = pget((pid_t)name[0], PGET_CANSEE, &p); if (error != 0) return (error); - error = sysctl_out_proc(p, req, flags); + error = sysctl_out_proc(p, req, flags, 0); return (error); } @@ -1415,7 +1426,7 @@ sysctl_kern_proc(SYSCTL_HANDLER_ARGS) } - error = sysctl_out_proc(p, req, flags | doingzomb); + error = sysctl_out_proc(p, req, flags, doingzomb); if (error) { sx_sunlock(&allproc_lock); return (error); @@ -2119,8 +2130,11 @@ sysctl_kern_proc_ovmmap(SYSCTL_HANDLER_A CTASSERT(sizeof(struct kinfo_vmentry) == KINFO_VMENTRY_SIZE); #endif -static int -sysctl_kern_proc_vmmap(SYSCTL_HANDLER_ARGS) +/* + * Must be called with the process locked and will return unlocked. + */ +int +kern_proc_vmmap_out(struct proc *p, struct sbuf *sb) { vm_map_entry_t entry, tmp_entry; unsigned int last_timestamp; @@ -2128,16 +2142,15 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_AR struct kinfo_vmentry *kve; struct vattr va; struct ucred *cred; - int error, *name; + int error; struct vnode *vp; - struct proc *p; struct vmspace *vm; vm_map_t map; - name = (int *)arg1; - error = pget((pid_t)name[0], PGET_WANTREAD, &p); - if (error != 0) - return (error); + PROC_LOCK_ASSERT(p, MA_OWNED); + + _PHOLD(p); + PROC_UNLOCK(p); vm = vmspace_acquire_ref(p); if (vm == NULL) { PRELE(p); @@ -2145,6 +2158,7 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_AR } kve = malloc(sizeof(*kve), M_TEMP, M_WAITOK); + error = 0; map = &vm->vm_map; vm_map_lock_read(map); for (entry = map->header.next; entry != &map->header; @@ -2284,7 +2298,7 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_AR strlen(kve->kve_path) + 1; kve->kve_structsize = roundup(kve->kve_structsize, sizeof(uint64_t)); - error = SYSCTL_OUT(req, kve, kve->kve_structsize); + error = sbuf_bcat(sb, kve, kve->kve_structsize); vm_map_lock_read(map); if (error) break; @@ -2300,6 +2314,26 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_AR return (error); } +static int +sysctl_kern_proc_vmmap(SYSCTL_HANDLER_ARGS) +{ + struct proc *p; + struct sbuf sb; + int error, error2, *name; + + name = (int *)arg1; + sbuf_new_for_sysctl(&sb, NULL, sizeof(struct kinfo_vmentry), req); + error = pget((pid_t)name[0], PGET_CANDEBUG | PGET_NOTWEXIT, &p); + if (error != 0) { + sbuf_delete(&sb); + return (error); + } + error = kern_proc_vmmap_out(p, &sb); + error2 = sbuf_finish(&sb); + sbuf_delete(&sb); + return (error != 0 ? error : error2); +} + #if defined(STACK) || defined(DDB) static int sysctl_kern_proc_kstack(SYSCTL_HANDLER_ARGS) Modified: head/sys/sys/user.h ============================================================================== --- head/sys/sys/user.h Sun Apr 14 19:59:38 2013 (r249486) +++ head/sys/sys/user.h Sun Apr 14 20:01:36 2013 (r249487) @@ -491,6 +491,25 @@ struct kinfo_kstack { }; #ifdef _KERNEL +/* Flags for kern_proc_out function. */ +#define KERN_PROC_NOTHREADS 0x1 +#define KERN_PROC_MASK32 0x2 + +struct sbuf; + +/* + * The kern_proc out functions are helper functions to dump process + * miscellaneous kinfo structures to sbuf. The main consumers are KERN_PROC + * sysctls but they may also be used by other kernel subsystems. + * + * The functions manipulate the process locking state and expect the process + * to be locked on enter. On return the process is unlocked. + */ + +int kern_proc_filedesc_out(struct proc *p, struct sbuf *sb, ssize_t maxlen); +int kern_proc_out(struct proc *p, struct sbuf *sb, int flags); +int kern_proc_vmmap_out(struct proc *p, struct sbuf *sb); + int vntype_to_kinfo(int vtype); #endif /* !_KERNEL */ From owner-svn-src-all@FreeBSD.ORG Sun Apr 14 20:03:49 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3B6EF1A5; Sun, 14 Apr 2013 20:03:49 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 13A78FBE; Sun, 14 Apr 2013 20:03:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3EK3m4D011163; Sun, 14 Apr 2013 20:03:48 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3EK3meI011161; Sun, 14 Apr 2013 20:03:48 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201304142003.r3EK3meI011161@svn.freebsd.org> From: Mikolaj Golub Date: Sun, 14 Apr 2013 20:03:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249488 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Apr 2013 20:03:49 -0000 Author: trociny Date: Sun Apr 14 20:03:48 2013 New Revision: 249488 URL: http://svnweb.freebsd.org/changeset/base/249488 Log: Similarly to proc_getargv() and proc_getenvv(), export proc_getauxv() to be able to reuse the code. MFC after: 3 weeks Modified: head/sys/kern/kern_proc.c head/sys/sys/proc.h Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Sun Apr 14 20:01:36 2013 (r249487) +++ head/sys/kern/kern_proc.c Sun Apr 14 20:03:48 2013 (r249488) @@ -1759,6 +1759,27 @@ proc_getenvv(struct thread *td, struct p return (get_ps_strings(curthread, p, sb, PROC_ENV)); } +int +proc_getauxv(struct thread *td, struct proc *p, struct sbuf *sb) +{ + size_t vsize, size; + char **auxv; + int error; + + error = get_proc_vector(td, p, &auxv, &vsize, PROC_AUX); + if (error == 0) { +#ifdef COMPAT_FREEBSD32 + if (SV_PROC_FLAG(p, SV_ILP32) != 0) + size = vsize * sizeof(Elf32_Auxinfo); + else +#endif + size = vsize * sizeof(Elf_Auxinfo); + error = sbuf_bcat(sb, auxv, size); + free(auxv, M_TEMP); + } + return (error); +} + /* * This sysctl allows a process to retrieve the argument list or process * title for another process without groping around in the address space @@ -1864,9 +1885,8 @@ sysctl_kern_proc_auxv(SYSCTL_HANDLER_ARG int *name = (int *)arg1; u_int namelen = arg2; struct proc *p; - size_t vsize, size; - char **auxv; - int error; + struct sbuf sb; + int error, error2; if (namelen != 1) return (EINVAL); @@ -1878,21 +1898,12 @@ sysctl_kern_proc_auxv(SYSCTL_HANDLER_ARG PRELE(p); return (0); } - error = get_proc_vector(curthread, p, &auxv, &vsize, PROC_AUX); - if (error == 0) { -#ifdef COMPAT_FREEBSD32 - if (SV_PROC_FLAG(p, SV_ILP32) != 0) - size = vsize * sizeof(Elf32_Auxinfo); - else -#endif - size = vsize * sizeof(Elf_Auxinfo); - PRELE(p); - error = SYSCTL_OUT(req, auxv, size); - free(auxv, M_TEMP); - } else { - PRELE(p); - } - return (error); + sbuf_new_for_sysctl(&sb, NULL, GET_PS_STRINGS_CHUNK_SZ, req); + error = proc_getauxv(curthread, p, &sb); + error2 = sbuf_finish(&sb); + PRELE(p); + sbuf_delete(&sb); + return (error != 0 ? error : error2); } /* Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Sun Apr 14 20:01:36 2013 (r249487) +++ head/sys/sys/proc.h Sun Apr 14 20:03:48 2013 (r249488) @@ -873,6 +873,7 @@ struct pargs *pargs_alloc(int len); void pargs_drop(struct pargs *pa); void pargs_hold(struct pargs *pa); int proc_getargv(struct thread *td, struct proc *p, struct sbuf *sb); +int proc_getauxv(struct thread *td, struct proc *p, struct sbuf *sb); int proc_getenvv(struct thread *td, struct proc *p, struct sbuf *sb); void procinit(void); void proc_linkup0(struct proc *p, struct thread *td); From owner-svn-src-all@FreeBSD.ORG Sun Apr 14 20:52:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4F22A9B1; Sun, 14 Apr 2013 20:52:33 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id BA4521BC; Sun, 14 Apr 2013 20:52:32 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.6/8.14.6) with ESMTP id r3EKqM6o060194; Sun, 14 Apr 2013 23:52:22 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.2 kib.kiev.ua r3EKqM6o060194 Received: (from kostik@localhost) by tom.home (8.14.6/8.14.6/Submit) id r3EKqMmW060193; Sun, 14 Apr 2013 23:52:22 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 14 Apr 2013 23:52:22 +0300 From: Konstantin Belousov To: Marius Strobl Subject: Re: svn commit: r249476 - in head/sys/dev: ata pci Message-ID: <20130414205222.GG2930@kib.kiev.ua> References: <201304141402.r3EE2YIi001357@svn.freebsd.org> <20130414150507.GA62578@alchemy.franken.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Kra4tWuoVJHqwr45" Content-Disposition: inline In-Reply-To: <20130414150507.GA62578@alchemy.franken.de> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Apr 2013 20:52:33 -0000 --Kra4tWuoVJHqwr45 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Apr 14, 2013 at 05:05:07PM +0200, Marius Strobl wrote: > On Sun, Apr 14, 2013 at 02:02:34PM +0000, Konstantin Belousov wrote: > > Author: kib > > Date: Sun Apr 14 14:02:34 2013 > > New Revision: 249476 > > URL: http://svnweb.freebsd.org/changeset/base/249476 > >=20 > > Log: > > Usnure that PCI bus BIS_GET_DMA_TAG() method sees the actual PCI > > device which makes the request for dma tag, instead of some descendant > > of the PCI device, by creating a pass-through trampoline for vga_pci > > and ata_pci buses. >=20 > If you need to know the last PCI device requesting the DMA tag, > wouldn't it make more sense to let the consumer of this walk up the > tree as necessary instead of hacking N drivers? I.e.: > foo_get_dma_tag(device_t bus, device_t child) > { > device_t device, parent; > devclass_t pci_devclass; >=20 > pci_devclass =3D devclass_find("pci"); > for (device =3D child; child !=3D bus; device =3D parent) { > parent =3D device_get_parent(device); > if (device_get_devclass(parent) !=3D pci_devclass) > continue; > break; > } > /* use device */ > } The similar approach was my first thought, and I discussed it with John. After the discussion, I agreed that this is a hack. My understanding is that this default behaviour is only correct for the simple cases like the one fixed in the commit. Forcing this on other buses would only make the bugs hidden and cause more efforts in trying to identify it. >=20 > I suspect the problem you are hitting is also true for ISA devices > behind a PCI-ISA-bridge, PCI device drivers attaching non-PCI sub- > devices requesting DMA tags like sk(4) etc. And ISA DMA is probably good example why bus by default should not do the walking up. ISA bridge would need to allocate its own root tag for the ISA, while ISA bus needs to provide the specific tags and, most likely, specific busdma functions implementation for the ISA DMA channels. Of course, this talk assumes that ISA DMA is going to be converted to busdma. Unfortunately for me, the conversion looks inevitable. --Kra4tWuoVJHqwr45 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQIcBAEBAgAGBQJRaxcGAAoJEJDCuSvBvK1B1ccP/2j6mIBYsX7We7930/45fS6Y USydw8SQWN4N9Oaq/SOqWukF3wMRz/7arX62wrl+JMVicMp+twf6rC2j0A5ax30B tlMdkw5qmC8yZy8WJNNa0Vn6G5uF9+X7WO0BmXymXJhg2/Kf1xYDkcN+cFKHPzAN oPb78obSSxDYq1qemexgQBcC9deOJBd9xsWM3fv8VMa8IExRhaANEUOoQ8hN3/M5 EoAe6kBYB+0XNrUOu9vBeW3qi1m24OradrfmM72tHKzQWdORekr803s5XcDVUZiw 4/bmuF1pk3HZPPi0s4w0Kshg5MzOJn6Gm5keyoQ5T0FQlLFLEJTaP0/tYfgeelcQ RePeWLTuY5kYoEKJkq7fONBWBwOcjrWEf3dyKYqEn+mcrdX/U029WnryqUZgyuX7 THGwt41vRVNwlejqVnxtDL/LoaPW46/HCb2wiS4Z0/0y9E/G/CvwZ98dcRutU6LA 9joWoNqRr3ZLedVvAT0g92KXG4SLoKEWUoEst7dckjgsUvRekd5azHZF6ELtKs56 Tke6HDPy7sX9urj6+AC/R/GFLCgee7YGVEnaDWmqMYosO063MB+zVa3zzAnUWv0r Gsy4s7v0ctul82TmrJL7CbKidv3wg1wdiWhzxotxi+2Vjzr5bZu2CU46z5MVGV+g Cz184944vair0Hth9lRS =E2IE -----END PGP SIGNATURE----- --Kra4tWuoVJHqwr45-- From owner-svn-src-all@FreeBSD.ORG Sun Apr 14 21:11:20 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7ECDAC63; Sun, 14 Apr 2013 21:11:20 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 70BD2244; Sun, 14 Apr 2013 21:11:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3ELBKdJ032134; Sun, 14 Apr 2013 21:11:20 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3ELBKRG032133; Sun, 14 Apr 2013 21:11:20 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201304142111.r3ELBKRG032133@svn.freebsd.org> From: Bryan Drewery Date: Sun, 14 Apr 2013 21:11:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249489 - head/etc/rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Apr 2013 21:11:20 -0000 Author: bdrewery (ports committer) Date: Sun Apr 14 21:11:19 2013 New Revision: 249489 URL: http://svnweb.freebsd.org/changeset/base/249489 Log: Run configtest before restarting so that the system is not left without a running sshd. Approved by: des MFC after: 1 week Modified: head/etc/rc.d/sshd Modified: head/etc/rc.d/sshd ============================================================================== --- head/etc/rc.d/sshd Sun Apr 14 20:03:48 2013 (r249488) +++ head/etc/rc.d/sshd Sun Apr 14 21:11:19 2013 (r249489) @@ -14,6 +14,7 @@ rcvar="sshd_enable" command="/usr/sbin/${name}" keygen_cmd="sshd_keygen" start_precmd="sshd_precmd" +restart_precmd="sshd_configtest" configtest_cmd="sshd_configtest" pidfile="/var/run/${name}.pid" extra_commands="configtest keygen reload" From owner-svn-src-all@FreeBSD.ORG Sun Apr 14 21:18:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E04B2E83; Sun, 14 Apr 2013 21:18:46 +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 7BDDF27E; Sun, 14 Apr 2013 21:18:46 +0000 (UTC) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.14.6/8.14.6/ALCHEMY.FRANKEN.DE) with ESMTP id r3ELIjmX069077; Sun, 14 Apr 2013 23:18:45 +0200 (CEST) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.14.6/8.14.6/Submit) id r3ELIimp069076; Sun, 14 Apr 2013 23:18:44 +0200 (CEST) (envelope-from marius) Date: Sun, 14 Apr 2013 23:18:44 +0200 From: Marius Strobl To: Konstantin Belousov Subject: Re: svn commit: r249476 - in head/sys/dev: ata pci Message-ID: <20130414211844.GB62578@alchemy.franken.de> References: <201304141402.r3EE2YIi001357@svn.freebsd.org> <20130414150507.GA62578@alchemy.franken.de> <20130414205222.GG2930@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130414205222.GG2930@kib.kiev.ua> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Apr 2013 21:18:47 -0000 On Sun, Apr 14, 2013 at 11:52:22PM +0300, Konstantin Belousov wrote: > On Sun, Apr 14, 2013 at 05:05:07PM +0200, Marius Strobl wrote: > > On Sun, Apr 14, 2013 at 02:02:34PM +0000, Konstantin Belousov wrote: > > > Author: kib > > > Date: Sun Apr 14 14:02:34 2013 > > > New Revision: 249476 > > > URL: http://svnweb.freebsd.org/changeset/base/249476 > > > > > > Log: > > > Usnure that PCI bus BIS_GET_DMA_TAG() method sees the actual PCI > > > device which makes the request for dma tag, instead of some descendant > > > of the PCI device, by creating a pass-through trampoline for vga_pci > > > and ata_pci buses. > > > > If you need to know the last PCI device requesting the DMA tag, > > wouldn't it make more sense to let the consumer of this walk up the > > tree as necessary instead of hacking N drivers? I.e.: > > foo_get_dma_tag(device_t bus, device_t child) > > { > > device_t device, parent; > > devclass_t pci_devclass; > > > > pci_devclass = devclass_find("pci"); > > for (device = child; child != bus; device = parent) { > > parent = device_get_parent(device); > > if (device_get_devclass(parent) != pci_devclass) > > continue; > > break; > > } > > /* use device */ > > } > The similar approach was my first thought, and I discussed it with John. > After the discussion, I agreed that this is a hack. > > My understanding is that this default behaviour is only correct for > the simple cases like the one fixed in the commit. Forcing this on > other buses would only make the bugs hidden and cause more efforts > in trying to identify it. Oh, I see that now. Thanks for the clarification. Marius From owner-svn-src-all@FreeBSD.ORG Sun Apr 14 22:38:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 83A9E70E; Sun, 14 Apr 2013 22:38:30 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 73D7466A; Sun, 14 Apr 2013 22:38:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3EMcUc2056863; Sun, 14 Apr 2013 22:38:30 GMT (envelope-from jpaetzel@svn.freebsd.org) Received: (from jpaetzel@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3EMcSuY056852; Sun, 14 Apr 2013 22:38:28 GMT (envelope-from jpaetzel@svn.freebsd.org) Message-Id: <201304142238.r3EMcSuY056852@svn.freebsd.org> From: Josh Paetzel Date: Sun, 14 Apr 2013 22:38:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249490 - in stable/9: sbin/iscontrol sys/dev/iscsi/initiator X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Apr 2013 22:38:30 -0000 Author: jpaetzel Date: Sun Apr 14 22:38:28 2013 New Revision: 249490 URL: http://svnweb.freebsd.org/changeset/base/249490 Log: MFC 234223: Update to version 2.3.1.0 MFC 234284, 234425, 234481: Unbreak the build caused by 234233 PR: kern/157770 Obtained from: Daniel Braniss Modified: stable/9/sbin/iscontrol/Makefile stable/9/sbin/iscontrol/iscontrol.8 stable/9/sbin/iscontrol/iscontrol.c stable/9/sbin/iscontrol/iscsi.conf.5 stable/9/sys/dev/iscsi/initiator/isc_subr.c stable/9/sys/dev/iscsi/initiator/iscsi.c stable/9/sys/dev/iscsi/initiator/iscsi_subr.c stable/9/sys/dev/iscsi/initiator/iscsivar.h Directory Properties: stable/9/sbin/iscontrol/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sbin/iscontrol/Makefile ============================================================================== --- stable/9/sbin/iscontrol/Makefile Sun Apr 14 21:11:19 2013 (r249489) +++ stable/9/sbin/iscontrol/Makefile Sun Apr 14 22:38:28 2013 (r249490) @@ -7,8 +7,7 @@ LDADD= -lcam -lmd S= ${.CURDIR}/../../sys WARNS?= 3 -CFLAGS += -I$S -#CFLAGS += -g -DDEBUG +CFLAGS+= -I$S MAN= iscsi.conf.5 iscontrol.8 Modified: stable/9/sbin/iscontrol/iscontrol.8 ============================================================================== --- stable/9/sbin/iscontrol/iscontrol.8 Sun Apr 14 21:11:19 2013 (r249489) +++ stable/9/sbin/iscontrol/iscontrol.8 Sun Apr 14 22:38:28 2013 (r249490) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 22, 2007 +.Dd August 9, 2010 .Dt ISCONTROL 8 .Os .Sh NAME Modified: stable/9/sbin/iscontrol/iscontrol.c ============================================================================== --- stable/9/sbin/iscontrol/iscontrol.c Sun Apr 14 21:11:19 2013 (r249489) +++ stable/9/sbin/iscontrol/iscontrol.c Sun Apr 14 22:38:28 2013 (r249490) @@ -44,18 +44,22 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include -#include -#include +#include #include #include +#include +#include +#include +#include #include +#include #include #include #include "iscontrol.h" +static char version[] = "2.3.1"; // keep in sync with iscsi_initiator + #define USAGE "[-v] [-d] [-c config] [-n name] [-t target] [-p pidfile]" #define OPTIONS "vdc:t:n:p:" @@ -109,6 +113,13 @@ isc_opt_t opvals = { .immediateData = TRUE, }; +static void +usage(const char *pname) +{ + fprintf(stderr, "usage: %s " USAGE "\n", pname); + exit(1); +} + int lookup(token_t *tbl, char *m) { @@ -124,20 +135,40 @@ int main(int cc, char **vv) { int ch, disco; - char *pname, *pidfile, *p, *q, *ta, *kw; + char *pname, *pidfile, *p, *q, *ta, *kw, *v; isc_opt_t *op; FILE *fd; + size_t n; op = &opvals; iscsidev = "/dev/"ISCSIDEV; fd = NULL; pname = vv[0]; - if((p = strrchr(pname, '/')) != NULL) - pname = p + 1; + if ((pname = basename(pname)) == NULL) + err(1, "basename"); kw = ta = 0; disco = 0; pidfile = NULL; + /* + | check for driver & controller version match + */ + n = 0; +#define VERSION_OID_S "net.iscsi_initiator.driver_version" + if (sysctlbyname(VERSION_OID_S, 0, &n, 0, 0) != 0) { + if (errno == ENOENT) + errx(1, "sysctlbyname(\"" VERSION_OID_S "\") " + "failed; is the iscsi driver loaded?"); + err(1, "sysctlbyname(\"" VERSION_OID_S "\")"); + } + v = malloc(n+1); + if (v == NULL) + err(1, "malloc"); + if (sysctlbyname(VERSION_OID_S, v, &n, 0, 0) != 0) + err(1, "sysctlbyname"); + + if (strncmp(version, v, 3) != 0) + errx(1, "versions mismatch"); while((ch = getopt(cc, vv, OPTIONS)) != -1) { switch(ch) { @@ -146,10 +177,8 @@ main(int cc, char **vv) break; case 'c': fd = fopen(optarg, "r"); - if(fd == NULL) { - perror(optarg); - exit(1); - } + if (fd == NULL) + err(1, "fopen(\"%s\")", optarg); break; case 'd': disco = 1; @@ -164,9 +193,7 @@ main(int cc, char **vv) pidfile = optarg; break; default: - badu: - fprintf(stderr, "Usage: %s %s\n", pname, USAGE); - exit(1); + usage(pname); } } if(fd == NULL) @@ -187,8 +214,8 @@ main(int cc, char **vv) op->targetAddress = ta; if(op->targetAddress == NULL) { - fprintf(stderr, "No target!\n"); - goto badu; + warnx("no target specified!"); + usage(pname); } q = op->targetAddress; if(*q == '[' && (q = strchr(q, ']')) != NULL) { @@ -206,7 +233,7 @@ main(int cc, char **vv) op->targetPortalGroupTag = atoi(p); } if(op->initiatorName == 0) { - char hostname[256]; + char hostname[MAXHOSTNAMELEN]; if(op->iqn) { if(gethostname(hostname, sizeof(hostname)) == 0) Modified: stable/9/sbin/iscontrol/iscsi.conf.5 ============================================================================== --- stable/9/sbin/iscontrol/iscsi.conf.5 Sun Apr 14 21:11:19 2013 (r249489) +++ stable/9/sbin/iscontrol/iscsi.conf.5 Sun Apr 14 22:38:28 2013 (r249490) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 25, 2012 +.Dd June 5, 2007 .Dt ISCSI.CONF 5 .Os .Sh NAME Modified: stable/9/sys/dev/iscsi/initiator/isc_subr.c ============================================================================== --- stable/9/sys/dev/iscsi/initiator/isc_subr.c Sun Apr 14 21:11:19 2013 (r249489) +++ stable/9/sys/dev/iscsi/initiator/isc_subr.c Sun Apr 14 22:38:28 2013 (r249490) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2005-2010 Daniel Braniss + * Copyright (c) 2005-2011 Daniel Braniss * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -77,6 +77,104 @@ i_strdupin(char *s, size_t maxlen) return q; } +#if __FreeBSD_version < 800000 +/*****************************************************************/ +/* */ +/* CRC LOOKUP TABLE */ +/* ================ */ +/* The following CRC lookup table was generated automagically */ +/* by the Rocksoft^tm Model CRC Algorithm Table Generation */ +/* Program V1.0 using the following model parameters: */ +/* */ +/* Width : 4 bytes. */ +/* Poly : 0x1EDC6F41L */ +/* Reverse : TRUE. */ +/* */ +/* For more information on the Rocksoft^tm Model CRC Algorithm, */ +/* see the document titled "A Painless Guide to CRC Error */ +/* Detection Algorithms" by Ross Williams */ +/* (ross@guest.adelaide.edu.au.). This document is likely to be */ +/* in the FTP archive "ftp.adelaide.edu.au/pub/rocksoft". */ +/* */ +/*****************************************************************/ + +static uint32_t crc32Table[256] = { + 0x00000000L, 0xF26B8303L, 0xE13B70F7L, 0x1350F3F4L, + 0xC79A971FL, 0x35F1141CL, 0x26A1E7E8L, 0xD4CA64EBL, + 0x8AD958CFL, 0x78B2DBCCL, 0x6BE22838L, 0x9989AB3BL, + 0x4D43CFD0L, 0xBF284CD3L, 0xAC78BF27L, 0x5E133C24L, + 0x105EC76FL, 0xE235446CL, 0xF165B798L, 0x030E349BL, + 0xD7C45070L, 0x25AFD373L, 0x36FF2087L, 0xC494A384L, + 0x9A879FA0L, 0x68EC1CA3L, 0x7BBCEF57L, 0x89D76C54L, + 0x5D1D08BFL, 0xAF768BBCL, 0xBC267848L, 0x4E4DFB4BL, + 0x20BD8EDEL, 0xD2D60DDDL, 0xC186FE29L, 0x33ED7D2AL, + 0xE72719C1L, 0x154C9AC2L, 0x061C6936L, 0xF477EA35L, + 0xAA64D611L, 0x580F5512L, 0x4B5FA6E6L, 0xB93425E5L, + 0x6DFE410EL, 0x9F95C20DL, 0x8CC531F9L, 0x7EAEB2FAL, + 0x30E349B1L, 0xC288CAB2L, 0xD1D83946L, 0x23B3BA45L, + 0xF779DEAEL, 0x05125DADL, 0x1642AE59L, 0xE4292D5AL, + 0xBA3A117EL, 0x4851927DL, 0x5B016189L, 0xA96AE28AL, + 0x7DA08661L, 0x8FCB0562L, 0x9C9BF696L, 0x6EF07595L, + 0x417B1DBCL, 0xB3109EBFL, 0xA0406D4BL, 0x522BEE48L, + 0x86E18AA3L, 0x748A09A0L, 0x67DAFA54L, 0x95B17957L, + 0xCBA24573L, 0x39C9C670L, 0x2A993584L, 0xD8F2B687L, + 0x0C38D26CL, 0xFE53516FL, 0xED03A29BL, 0x1F682198L, + 0x5125DAD3L, 0xA34E59D0L, 0xB01EAA24L, 0x42752927L, + 0x96BF4DCCL, 0x64D4CECFL, 0x77843D3BL, 0x85EFBE38L, + 0xDBFC821CL, 0x2997011FL, 0x3AC7F2EBL, 0xC8AC71E8L, + 0x1C661503L, 0xEE0D9600L, 0xFD5D65F4L, 0x0F36E6F7L, + 0x61C69362L, 0x93AD1061L, 0x80FDE395L, 0x72966096L, + 0xA65C047DL, 0x5437877EL, 0x4767748AL, 0xB50CF789L, + 0xEB1FCBADL, 0x197448AEL, 0x0A24BB5AL, 0xF84F3859L, + 0x2C855CB2L, 0xDEEEDFB1L, 0xCDBE2C45L, 0x3FD5AF46L, + 0x7198540DL, 0x83F3D70EL, 0x90A324FAL, 0x62C8A7F9L, + 0xB602C312L, 0x44694011L, 0x5739B3E5L, 0xA55230E6L, + 0xFB410CC2L, 0x092A8FC1L, 0x1A7A7C35L, 0xE811FF36L, + 0x3CDB9BDDL, 0xCEB018DEL, 0xDDE0EB2AL, 0x2F8B6829L, + 0x82F63B78L, 0x709DB87BL, 0x63CD4B8FL, 0x91A6C88CL, + 0x456CAC67L, 0xB7072F64L, 0xA457DC90L, 0x563C5F93L, + 0x082F63B7L, 0xFA44E0B4L, 0xE9141340L, 0x1B7F9043L, + 0xCFB5F4A8L, 0x3DDE77ABL, 0x2E8E845FL, 0xDCE5075CL, + 0x92A8FC17L, 0x60C37F14L, 0x73938CE0L, 0x81F80FE3L, + 0x55326B08L, 0xA759E80BL, 0xB4091BFFL, 0x466298FCL, + 0x1871A4D8L, 0xEA1A27DBL, 0xF94AD42FL, 0x0B21572CL, + 0xDFEB33C7L, 0x2D80B0C4L, 0x3ED04330L, 0xCCBBC033L, + 0xA24BB5A6L, 0x502036A5L, 0x4370C551L, 0xB11B4652L, + 0x65D122B9L, 0x97BAA1BAL, 0x84EA524EL, 0x7681D14DL, + 0x2892ED69L, 0xDAF96E6AL, 0xC9A99D9EL, 0x3BC21E9DL, + 0xEF087A76L, 0x1D63F975L, 0x0E330A81L, 0xFC588982L, + 0xB21572C9L, 0x407EF1CAL, 0x532E023EL, 0xA145813DL, + 0x758FE5D6L, 0x87E466D5L, 0x94B49521L, 0x66DF1622L, + 0x38CC2A06L, 0xCAA7A905L, 0xD9F75AF1L, 0x2B9CD9F2L, + 0xFF56BD19L, 0x0D3D3E1AL, 0x1E6DCDEEL, 0xEC064EEDL, + 0xC38D26C4L, 0x31E6A5C7L, 0x22B65633L, 0xD0DDD530L, + 0x0417B1DBL, 0xF67C32D8L, 0xE52CC12CL, 0x1747422FL, + 0x49547E0BL, 0xBB3FFD08L, 0xA86F0EFCL, 0x5A048DFFL, + 0x8ECEE914L, 0x7CA56A17L, 0x6FF599E3L, 0x9D9E1AE0L, + 0xD3D3E1ABL, 0x21B862A8L, 0x32E8915CL, 0xC083125FL, + 0x144976B4L, 0xE622F5B7L, 0xF5720643L, 0x07198540L, + 0x590AB964L, 0xAB613A67L, 0xB831C993L, 0x4A5A4A90L, + 0x9E902E7BL, 0x6CFBAD78L, 0x7FAB5E8CL, 0x8DC0DD8FL, + 0xE330A81AL, 0x115B2B19L, 0x020BD8EDL, 0xF0605BEEL, + 0x24AA3F05L, 0xD6C1BC06L, 0xC5914FF2L, 0x37FACCF1L, + 0x69E9F0D5L, 0x9B8273D6L, 0x88D28022L, 0x7AB90321L, + 0xAE7367CAL, 0x5C18E4C9L, 0x4F48173DL, 0xBD23943EL, + 0xF36E6F75L, 0x0105EC76L, 0x12551F82L, 0xE03E9C81L, + 0x34F4F86AL, 0xC69F7B69L, 0xD5CF889DL, 0x27A40B9EL, + 0x79B737BAL, 0x8BDCB4B9L, 0x988C474DL, 0x6AE7C44EL, + 0xBE2DA0A5L, 0x4C4623A6L, 0x5F16D052L, 0xAD7D5351L +}; + +static __inline int +calculate_crc32c(uint32_t crc, const void *buf, size_t size) +{ + const uint8_t *p = buf; + + while (size--) + crc = crc32Table[(crc ^ *p++) & 0xff] ^ (crc >> 8); + return crc; +} +#endif static uint32_t i_crc32c(const void *buf, size_t size, uint32_t crc) Modified: stable/9/sys/dev/iscsi/initiator/iscsi.c ============================================================================== --- stable/9/sys/dev/iscsi/initiator/iscsi.c Sun Apr 14 21:11:19 2013 (r249489) +++ stable/9/sys/dev/iscsi/initiator/iscsi.c Sun Apr 14 22:38:28 2013 (r249490) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2005-2010 Daniel Braniss + * Copyright (c) 2005-2011 Daniel Braniss * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -60,7 +60,7 @@ __FBSDID("$FreeBSD$"); #include #include -static char *iscsi_driver_version = "2.2.4.2"; +static char *iscsi_driver_version = "2.3.1"; static struct isc_softc *isc; @@ -231,8 +231,8 @@ iscsi_ioctl(struct cdev *dev, u_long cmd if(error == 0) { sp->proc = td->td_proc; SYSCTL_ADD_INT(&sp->clist, SYSCTL_CHILDREN(sp->oid), - OID_AUTO, "pid", CTLFLAG_RD, - &sp->proc->p_pid, sizeof(pid_t), "control process id"); + OID_AUTO, "pid", CTLFLAG_RD, + &sp->proc->p_pid, sizeof(pid_t), "control process id"); } break; @@ -290,8 +290,7 @@ iscsi_read(struct cdev *dev, struct uio sprintf(buf, "%03d] '%s' '%s'\n", i++, sp->opt.targetAddress, sp->opt.targetName); uiomove(buf, strlen(buf), uio); } - sprintf(buf, "%d/%d /---- free -----/\n", sc->npdu_alloc, sc->npdu_max); - i = 0; + sprintf(buf, "free npdu_alloc=%d, npdu_max=%d\n", sc->npdu_alloc, sc->npdu_max); uiomove(buf, strlen(buf), uio); } else { @@ -696,7 +695,6 @@ iscsi_shutdown(void *v) static void free_pdus(struct isc_softc *sc) { - debug_called(8); if(sc->pdu_zone != NULL) { @@ -777,6 +775,10 @@ iscsi_start(void) sizeof(isc->nsess), "number of active session"); +#ifdef ISCSI_INITIATOR_DEBUG + mtx_init(&iscsi_dbg_mtx, "iscsi_dbg", NULL, MTX_DEF); +#endif + printf("iscsi: version %s\n", iscsi_driver_version); } @@ -814,6 +816,11 @@ iscsi_stop(void) xdebug("sysctl_ctx_free failed"); iscsi_shutdown(isc); // XXX: check EVENTHANDLER_ ... + +#ifdef ISCSI_INITIATOR_DEBUG + mtx_destroy(&iscsi_dbg_mtx); +#endif + free(isc, M_ISCSI); } Modified: stable/9/sys/dev/iscsi/initiator/iscsi_subr.c ============================================================================== --- stable/9/sys/dev/iscsi/initiator/iscsi_subr.c Sun Apr 14 21:11:19 2013 (r249489) +++ stable/9/sys/dev/iscsi/initiator/iscsi_subr.c Sun Apr 14 22:38:28 2013 (r249490) @@ -154,7 +154,7 @@ getSenseData(u_int status, union ccb *cc scsi_rsp_t *cmd = &pp->ipdu.scsi_rsp; caddr_t bp; int sense_len, mustfree = 0; - int error_code, sense_key, asc, ascq; + int error_code, sense_key, asc, ascq; bp = mtod(pq->mp, caddr_t); if((sense_len = scsi_2btoul(bp)) == 0) @@ -176,9 +176,8 @@ getSenseData(u_int status, union ccb *cc scsi->sense_resid = 0; if(cmd->flag & (BIT(1)|BIT(2))) scsi->sense_resid = ntohl(pp->ipdu.scsi_rsp.rcnt); - scsi_extract_sense_len(sense, scsi->sense_len - scsi->sense_resid, - &error_code, &sense_key, &asc, &ascq, /*show_errors*/ 1); + &error_code, &sense_key, &asc, &ascq, /*show_errors*/ 1); debug(3, "sense_len=%d rcnt=%d sense_resid=%d dsl=%d error_code=%x flags=%x", sense_len, @@ -479,6 +478,8 @@ scsi_encap(struct cam_sim *sim, union cc cmd = &pq->pdu.ipdu.scsi_req; cmd->opcode = ISCSI_SCSI_CMD; cmd->F = 1; +#if 0 +// this breaks at least Isilon's iscsi target. /* | map tag option, default is UNTAGGED */ @@ -488,6 +489,9 @@ scsi_encap(struct cam_sim *sim, union cc case MSG_ORDERED_Q_TAG: cmd->attr = iSCSI_TASK_ORDER; break; case MSG_ACA_TASK: cmd->attr = iSCSI_TASK_ACA; break; } +#else + cmd->attr = iSCSI_TASK_SIMPLE; +#endif dwl(sp, ccb_h->target_lun, (u_char *)&cmd->lun); Modified: stable/9/sys/dev/iscsi/initiator/iscsivar.h ============================================================================== --- stable/9/sys/dev/iscsi/initiator/iscsivar.h Sun Apr 14 21:11:19 2013 (r249489) +++ stable/9/sys/dev/iscsi/initiator/iscsivar.h Sun Apr 14 22:38:28 2013 (r249490) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2005-2010 Daniel Braniss + * Copyright (c) 2005-2011 Daniel Braniss * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -204,6 +204,8 @@ struct isc_softc { struct sx unit_sx; uma_zone_t pdu_zone; // pool of free pdu's + TAILQ_HEAD(,pduq) freepdu; + #ifdef ISCSI_INITIATOR_DEBUG int npdu_alloc, npdu_max; // for instrumentation #endif @@ -306,9 +308,11 @@ pdu_alloc(struct isc_softc *isc, int wai return NULL; } #ifdef ISCSI_INITIATOR_DEBUG + mtx_lock(&iscsi_dbg_mtx); isc->npdu_alloc++; if(isc->npdu_alloc > isc->npdu_max) isc->npdu_max = isc->npdu_alloc; + mtx_unlock(&iscsi_dbg_mtx); #endif memset(pq, 0, sizeof(pduq_t)); @@ -324,10 +328,12 @@ pdu_free(struct isc_softc *isc, pduq_t * if(pq->buf != NULL) free(pq->buf, M_ISCSIBUF); #endif + uma_zfree(isc->pdu_zone, pq); #ifdef ISCSI_INITIATOR_DEBUG + mtx_lock(&iscsi_dbg_mtx); isc->npdu_alloc--; + mtx_unlock(&iscsi_dbg_mtx); #endif - uma_zfree(isc->pdu_zone, pq); } static __inline void From owner-svn-src-all@FreeBSD.ORG Mon Apr 15 03:02:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D9DB8DAD; Mon, 15 Apr 2013 03:02:55 +0000 (UTC) (envelope-from hiren@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CC5D4DE7; Mon, 15 Apr 2013 03:02:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3F32toR040909; Mon, 15 Apr 2013 03:02:55 GMT (envelope-from hiren@svn.freebsd.org) Received: (from hiren@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3F32tDK040908; Mon, 15 Apr 2013 03:02:55 GMT (envelope-from hiren@svn.freebsd.org) Message-Id: <201304150302.r3F32tDK040908@svn.freebsd.org> From: Hiren Panchasara Date: Mon, 15 Apr 2013 03:02:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249491 - head/share/man/man3 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Apr 2013 03:02:55 -0000 Author: hiren Date: Mon Apr 15 03:02:55 2013 New Revision: 249491 URL: http://svnweb.freebsd.org/changeset/base/249491 Log: Fixing a typo. Submitted by: Benedikt Steinbusch (benedikt.steinbusch@googlemail.com) Approved by: sbruno (mentor) Modified: head/share/man/man3/pthread_getconcurrency.3 Modified: head/share/man/man3/pthread_getconcurrency.3 ============================================================================== --- head/share/man/man3/pthread_getconcurrency.3 Sun Apr 14 22:38:28 2013 (r249490) +++ head/share/man/man3/pthread_getconcurrency.3 Mon Apr 15 03:02:55 2013 (r249491) @@ -40,7 +40,7 @@ .Fn pthread_setconcurrency "int new_level" .Sh DESCRIPTION The -.Fn pthread_getconcurrency +.Fn pthread_setconcurrency function allows an application to inform the threads implementation of its desired concurrency level, .Fa new_level . From owner-svn-src-all@FreeBSD.ORG Mon Apr 15 03:10:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id DA0EAFE3; Mon, 15 Apr 2013 03:10:00 +0000 (UTC) (envelope-from hiren@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CA8B8E36; Mon, 15 Apr 2013 03:10:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3F3A0Wb042288; Mon, 15 Apr 2013 03:10:00 GMT (envelope-from hiren@svn.freebsd.org) Received: (from hiren@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3F3A0Hu042269; Mon, 15 Apr 2013 03:10:00 GMT (envelope-from hiren@svn.freebsd.org) Message-Id: <201304150310.r3F3A0Hu042269@svn.freebsd.org> From: Hiren Panchasara Date: Mon, 15 Apr 2013 03:10:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249492 - in stable/9: lib/libpmc sys/dev/hwpmc sys/sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Apr 2013 03:10:00 -0000 Author: hiren Date: Mon Apr 15 03:09:59 2013 New Revision: 249492 URL: http://svnweb.freebsd.org/changeset/base/249492 Log: MFC: r246166 Update hwpmc to support the Xeon class of Ivybridge processors. case 0x3E: /* Per Intel document 325462-045US 01/2013. */ Add manpage to document all the goodness that is available in this processor model. No support for uncore events at this time. Approved by: sbruno (mentor) Added: stable/9/lib/libpmc/pmc.ivybridgexeon.3 (contents, props changed) Modified: stable/9/lib/libpmc/Makefile stable/9/lib/libpmc/libpmc.c stable/9/lib/libpmc/pmc.ivybridge.3 stable/9/lib/libpmc/pmc.sandybridge.3 stable/9/lib/libpmc/pmc.sandybridgexeon.3 stable/9/sys/dev/hwpmc/hwpmc_core.c stable/9/sys/dev/hwpmc/hwpmc_intel.c stable/9/sys/dev/hwpmc/pmc_events.h stable/9/sys/sys/pmc.h Directory Properties: stable/9/lib/libpmc/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/lib/libpmc/Makefile ============================================================================== --- stable/9/lib/libpmc/Makefile Mon Apr 15 03:02:55 2013 (r249491) +++ stable/9/lib/libpmc/Makefile Mon Apr 15 03:09:59 2013 (r249492) @@ -29,6 +29,7 @@ MAN+= pmc.core.3 MAN+= pmc.core2.3 MAN+= pmc.iaf.3 MAN+= pmc.ivybridge.3 +MAN+= pmc.ivybridgexeon.3 MAN+= pmc.ucf.3 MAN+= pmc.k7.3 MAN+= pmc.k8.3 Modified: stable/9/lib/libpmc/libpmc.c ============================================================================== --- stable/9/lib/libpmc/libpmc.c Mon Apr 15 03:02:55 2013 (r249491) +++ stable/9/lib/libpmc/libpmc.c Mon Apr 15 03:09:59 2013 (r249492) @@ -187,6 +187,11 @@ static const struct pmc_event_descr ivyb __PMC_EV_ALIAS_IVYBRIDGE() }; +static const struct pmc_event_descr ivybridge_xeon_event_table[] = +{ + __PMC_EV_ALIAS_IVYBRIDGE_XEON() +}; + static const struct pmc_event_descr sandybridge_event_table[] = { __PMC_EV_ALIAS_SANDYBRIDGE() @@ -232,6 +237,7 @@ PMC_MDEP_TABLE(core, IAP, PMC_CLASS_SOFT PMC_MDEP_TABLE(core2, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC); PMC_MDEP_TABLE(corei7, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC, PMC_CLASS_UCF, PMC_CLASS_UCP); PMC_MDEP_TABLE(ivybridge, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC); +PMC_MDEP_TABLE(ivybridge_xeon, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC); PMC_MDEP_TABLE(sandybridge, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC, PMC_CLASS_UCF, PMC_CLASS_UCP); PMC_MDEP_TABLE(sandybridge_xeon, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC); PMC_MDEP_TABLE(westmere, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC, PMC_CLASS_UCF, PMC_CLASS_UCP); @@ -270,6 +276,7 @@ PMC_CLASS_TABLE_DESC(core, IAP, core, ia PMC_CLASS_TABLE_DESC(core2, IAP, core2, iap); PMC_CLASS_TABLE_DESC(corei7, IAP, corei7, iap); PMC_CLASS_TABLE_DESC(ivybridge, IAP, ivybridge, iap); +PMC_CLASS_TABLE_DESC(ivybridge_xeon, IAP, ivybridge_xeon, iap); PMC_CLASS_TABLE_DESC(sandybridge, IAP, sandybridge, iap); PMC_CLASS_TABLE_DESC(sandybridge_xeon, IAP, sandybridge_xeon, iap); PMC_CLASS_TABLE_DESC(westmere, IAP, westmere, iap); @@ -574,6 +581,8 @@ static struct pmc_event_alias core2_alia #define corei7_aliases_without_iaf core2_aliases_without_iaf #define ivybridge_aliases core2_aliases #define ivybridge_aliases_without_iaf core2_aliases_without_iaf +#define ivybridge_xeon_aliases core2_aliases +#define ivybridge_xeon_aliases_without_iaf core2_aliases_without_iaf #define sandybridge_aliases core2_aliases #define sandybridge_aliases_without_iaf core2_aliases_without_iaf #define sandybridge_xeon_aliases core2_aliases @@ -804,7 +813,8 @@ iap_allocate_pmc(enum pmc_event pe, char return (-1); } else if (cpu_info.pm_cputype == PMC_CPU_INTEL_SANDYBRIDGE || cpu_info.pm_cputype == PMC_CPU_INTEL_SANDYBRIDGE_XEON || - cpu_info.pm_cputype == PMC_CPU_INTEL_IVYBRIDGE) { + cpu_info.pm_cputype == PMC_CPU_INTEL_IVYBRIDGE || + cpu_info.pm_cputype == PMC_CPU_INTEL_IVYBRIDGE_XEON ) { if (KWPREFIXMATCH(p, IAP_KW_RSP "=")) { n = pmc_parse_mask(iap_rsp_mask_sb_sbx_ib, p, &rsp); } else @@ -2673,6 +2683,10 @@ pmc_event_names_of_class(enum pmc_class ev = ivybridge_event_table; count = PMC_EVENT_TABLE_SIZE(ivybridge); break; + case PMC_CPU_INTEL_IVYBRIDGE_XEON: + ev = ivybridge_xeon_event_table; + count = PMC_EVENT_TABLE_SIZE(ivybridge_xeon); + break; case PMC_CPU_INTEL_SANDYBRIDGE: ev = sandybridge_event_table; count = PMC_EVENT_TABLE_SIZE(sandybridge); @@ -2968,6 +2982,9 @@ pmc_init(void) case PMC_CPU_INTEL_IVYBRIDGE: PMC_MDEP_INIT_INTEL_V2(ivybridge); break; + case PMC_CPU_INTEL_IVYBRIDGE_XEON: + PMC_MDEP_INIT_INTEL_V2(ivybridge_xeon); + break; case PMC_CPU_INTEL_SANDYBRIDGE: pmc_class_table[n++] = &ucf_class_table_descr; pmc_class_table[n++] = &sandybridgeuc_class_table_descr; @@ -3106,6 +3123,10 @@ _pmc_name_of_event(enum pmc_event pe, en ev = ivybridge_event_table; evfence = ivybridge_event_table + PMC_EVENT_TABLE_SIZE(ivybridge); break; + case PMC_CPU_INTEL_IVYBRIDGE_XEON: + ev = ivybridge_xeon_event_table; + evfence = ivybridge_xeon_event_table + PMC_EVENT_TABLE_SIZE(ivybridge_xeon); + break; case PMC_CPU_INTEL_SANDYBRIDGE: ev = sandybridge_event_table; evfence = sandybridge_event_table + PMC_EVENT_TABLE_SIZE(sandybridge); Modified: stable/9/lib/libpmc/pmc.ivybridge.3 ============================================================================== --- stable/9/lib/libpmc/pmc.ivybridge.3 Mon Apr 15 03:02:55 2013 (r249491) +++ stable/9/lib/libpmc/pmc.ivybridge.3 Mon Apr 15 03:09:59 2013 (r249492) @@ -854,6 +854,7 @@ Dirty L2 cache lines evicted by the MLC .Xr pmc.p6 3 , .Xr pmc.corei7 3 , .Xr pmc.corei7uc 3 , +.Xr pmc.ivybridgexeon 3 , .Xr pmc.sandybridge 3 , .Xr pmc.sandybridgeuc 3 , .Xr pmc.sandybridgexeon 3 , Added: stable/9/lib/libpmc/pmc.ivybridgexeon.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/lib/libpmc/pmc.ivybridgexeon.3 Mon Apr 15 03:09:59 2013 (r249492) @@ -0,0 +1,911 @@ +.\" Copyright (c) 2013 Hiren Panchasara +.\" 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 Jan 25, 2013 +.Dt PMC.IVYBRIDGEXEON 3 +.Os +.Sh NAME +.Nm pmc.ivybridgexeon +.Nd measurement events for +.Tn Intel +.Tn Ivy Bridge Xeon +family CPUs +.Sh LIBRARY +.Lb libpmc +.Sh SYNOPSIS +.In pmc.h +.Sh DESCRIPTION +.Tn Intel +.Tn "Ivy Bridge Xeon" +CPUs contain PMCs conforming to version 2 of the +.Tn Intel +performance measurement architecture. +These CPUs may contain up to three classes of PMCs: +.Bl -tag -width "Li PMC_CLASS_IAP" +.It Li PMC_CLASS_IAF +Fixed-function counters that count only one hardware event per counter. +.It Li PMC_CLASS_IAP +Programmable counters that may be configured to count one of a defined +set of hardware events. +.El +.Pp +The number of PMCs available in each class and their widths need to be +determined at run time by calling +.Xr pmc_cpuinfo 3 . +.Pp +Intel Ivy Bridge Xeon PMCs are documented in +.Rs +.%B "Intel(R) 64 and IA-32 Architectures Software Developer's Manual" +.%N "Order Number: 325462-045US" +.%D January 2013 +.%Q "Intel Corporation" +.Re +.Ss IVYBRIDGE FIXED FUNCTION PMCS +These PMCs and their supported events are documented in +.Xr pmc.iaf 3 . +.Ss IVYBRIDGE PROGRAMMABLE PMCS +The programmable PMCs support the following capabilities: +.Bl -column "PMC_CAP_INTERRUPT" "Support" +.It Em Capability Ta Em Support +.It PMC_CAP_CASCADE Ta \&No +.It PMC_CAP_EDGE Ta Yes +.It PMC_CAP_INTERRUPT Ta Yes +.It PMC_CAP_INVERT Ta Yes +.It PMC_CAP_READ Ta Yes +.It PMC_CAP_PRECISE Ta \&No +.It PMC_CAP_SYSTEM Ta Yes +.It PMC_CAP_TAGGING Ta \&No +.It PMC_CAP_THRESHOLD Ta Yes +.It PMC_CAP_USER Ta Yes +.It PMC_CAP_WRITE Ta Yes +.El +.Ss Event Qualifiers +Event specifiers for these PMCs support the following common +qualifiers: +.Bl -tag -width indent +.It Li rsp= Ns Ar value +Configure the Off-core Response bits. +.Bl -tag -width indent +.It Li REQ_DMND_DATA_RD +Counts the number of demand and DCU prefetch data reads of full and partial +cachelines as well as demand data page table entry cacheline reads. Does not +count L2 data read prefetches or instruction fetches. +.It Li REQ_DMND_RFO +Counts the number of demand and DCU prefetch reads for ownership (RFO) +requests generated by a write to data cacheline. Does not count L2 RFO +prefetches. +.It Li REQ_DMND_IFETCH +Counts the number of demand and DCU prefetch instruction cacheline reads. +Does not count L2 code read prefetches. +.It Li REQ_WB +Counts the number of writeback (modified to exclusive) transactions. +.It Li REQ_PF_DATA_RD +Counts the number of data cacheline reads generated by L2 prefetchers. +.It Li REQ_PF_RFO +Counts the number of RFO requests generated by L2 prefetchers. +.It Li REQ_PF_IFETCH +Counts the number of code reads generated by L2 prefetchers. +.It Li REQ_PF_LLC_DATA_RD +L2 prefetcher to L3 for loads. +.It Li REQ_PF_LLC_RFO +RFO requests generated by L2 prefetcher +.It Li REQ_PF_LLC_IFETCH +L2 prefetcher to L3 for instruction fetches. +.It Li REQ_BUS_LOCKS +Bus lock and split lock requests. +.It Li REQ_STRM_ST +Streaming store requests. +.It Li REQ_OTHER +Any other request that crosses IDI, including I/O. +.It Li RES_ANY +Catch all value for any response types. +.It Li RES_SUPPLIER_NO_SUPP +No Supplier Information available. +.It Li RES_SUPPLIER_LLC_HITM +M-state initial lookup stat in L3. +.It Li RES_SUPPLIER_LLC_HITE +E-state. +.It Li RES_SUPPLIER_LLC_HITS +S-state. +.It Li RES_SUPPLIER_LLC_HITF +F-state. +.It Li RES_SUPPLIER_LOCAL +Local DRAM Controller. +.It Li RES_SNOOP_SNP_NONE +No details on snoop-related information. +.It Li RES_SNOOP_SNP_NO_NEEDED +No snoop was needed to satisfy the request. +.It Li RES_SNOOP_SNP_MISS +A snoop was needed and it missed all snooped caches: +-For LLC Hit, ReslHitl was returned by all cores +-For LLC Miss, Rspl was returned by all sockets and data was returned from +DRAM. +.It Li RES_SNOOP_HIT_NO_FWD +A snoop was needed and it hits in at least one snooped cache. Hit denotes a +cache-line was valid before snoop effect. This includes: +-Snoop Hit w/ Invalidation (LLC Hit, RFO) +-Snoop Hit, Left Shared (LLC Hit/Miss, IFetch/Data_RD) +-Snoop Hit w/ Invalidation and No Forward (LLC Miss, RFO Hit S) +In the LLC Miss case, data is returned from DRAM. +.It Li RES_SNOOP_HIT_FWD +A snoop was needed and data was forwarded from a remote socket. +This includes: +-Snoop Forward Clean, Left Shared (LLC Hit/Miss, IFetch/Data_RD/RFT). +.It Li RES_SNOOP_HITM +A snoop was needed and it HitM-ed in local or remote cache. HitM denotes a +cache-line was in modified state before effect as a results of snoop. This +includes: +-Snoop HitM w/ WB (LLC miss, IFetch/Data_RD) +-Snoop Forward Modified w/ Invalidation (LLC Hit/Miss, RFO) +-Snoop MtoS (LLC Hit, IFetch/Data_RD). +.It Li RES_NON_DRAM +Target was non-DRAM system address. This includes MMIO transactions. +.El +.It Li cmask= Ns Ar value +Configure the PMC to increment only if the number of configured +events measured in a cycle is greater than or equal to +.Ar value . +.It Li edge +Configure the PMC to count the number of de-asserted to asserted +transitions of the conditions expressed by the other qualifiers. +If specified, the counter will increment only once whenever a +condition becomes true, irrespective of the number of clocks during +which the condition remains true. +.It Li inv +Invert the sense of comparison when the +.Dq Li cmask +qualifier is present, making the counter increment when the number of +events per cycle is less than the value specified by the +.Dq Li cmask +qualifier. +.It Li os +Configure the PMC to count events happening at processor privilege +level 0. +.It Li usr +Configure the PMC to count events occurring at privilege levels 1, 2 +or 3. +.El +.Pp +If neither of the +.Dq Li os +or +.Dq Li usr +qualifiers are specified, the default is to enable both. +.Ss Event Specifiers (Programmable PMCs) +Ivy Bridge programmable PMCs support the following events: +.Bl -tag -width indent +.It Li LD_BLOCKS.STORE_FORWARD +.Pq Event 03H , Umask 02H +loads blocked by overlapping with store buffer that cannot be forwarded . +.It Li MISALIGN_MEM_REF.LOADS +.Pq Event 05H , Umask 01H +Speculative cache-line split load uops dispatched to L1D. +.It Li MISALIGN_MEM_REF.STORES +.Pq Event 05H , Umask 02H +Speculative cache-line split Store- address uops dispatched to L1D. +.It Li LD_BLOCKS_PARTIAL.ADDRESS_ALIAS +.Pq Event 07H , Umask 01H +False dependencies in MOB due to partial compare on address. +.It Li DTLB_LOAD_MISSES.DEMAND_LD_MISS_CAUSES_A_WALK +.Pq Event 08H , Umask 81H +Misses in all TLB levels that cause a page walk of any page size from demand loads. +.It Li DTLB_LOAD_MISSES.DEMAND_LD_WALK_COMPLETED +.Pq Event 08H , Umask 82H +Misses in all TLB levels that caused page walk completed of any size by demand loads. +.It Li DTLB_LOAD_MISSES.DEMAND_LD_WALK_DURATION +.Pq Event 08H , Umask 84H +Cycle PMH is busy with a walk due to demand loads. +.It Li UOPS_ISSUED.ANY +.Pq Event 0EH , Umask 01H +Increments each cycle the # of Uops issued by the RAT to RS. +Set Cmask = 1, Inv = 1to count stalled cycles. +Set Cmask = 1, Inv = 1, Any= 1to count stalled cycles of this core. +.It Li UOPS_ISSUED.FLAGS_MERGE +.Pq Event 0EH , Umask 10H +Number of flags-merge uops allocated. Such uops adds delay. +.It Li UOPS_ISSUED.SLOW_LEA +.Pq Event 0EH , Umask 20H +Number of slow LEA or similar uops allocated. Such uop has 3 sources (e.g. 2 +sources + immediate) regardless if as a result of LEA instruction or not. +.It Li UOPS_ISSUED.SINGLE_MUL +.Pq Event 0EH , Umask 40H +Number of multiply packed/scalar single precision uops allocated. +.It Li ARITH.FPU_DIV_ACTIVE +.Pq Event 14H , Umask 01H +Cycles that the divider is active, includes INT and FP. Set 'edge =1, +cmask=1' to count the number of divides. +.It Li L2_RQSTS.DEMAND_DATA_RD_HIT +.Pq Event 24H , Umask 01H +Demand Data Read requests that hit L2 cache. +.It Li L2_RQSTS.ALL_DEMAND_DATA_RD +.Pq Event 24H , Umask 03H +Counts any demand and L1 HW prefetch data load requests to L2. +.It Li L2_RQSTS.RFO_HITS +.Pq Event 24H , Umask 04H +Counts the number of store RFO requests that hit the L2 cache. +.It Li L2_RQSTS.RFO_MISS +.Pq Event 24H , Umask 08H +Counts the number of store RFO requests that miss the L2 cache. +.It Li L2_RQSTS.ALL_RFO +.Pq Event 24H , Umask 0CH +Counts all L2 store RFO requests. +.It Li L2_RQSTS.CODE_RD_HIT +.Pq Event 24H , Umask 10H +Number of instruction fetches that hit the L2 cache. +.It Li L2_RQSTS.CODE_RD_MISS +.Pq Event 24H , Umask 20H +Number of instruction fetches that missed the L2 cache. +.It Li L2_RQSTS.ALL_CODE_RD +.Pq Event 24H , Umask 30H +Counts all L2 code requests. +.It Li L2_RQSTS.PF_HIT +.Pq Event 24H , Umask 40H +Counts all L2 HW prefetcher requests that hit L2. +.It Li L2_RQSTS.PF_MISS +.Pq Event 24H , Umask 80H +Counts all L2 HW prefetcher requests that missed L2. +.It Li L2_RQSTS.ALL_PF +.Pq Event 24H , Umask C0H +Counts all L2 HW prefetcher requests. +.It Li L2_STORE_LOCK_RQSTS.MISS +.Pq Event 27H , Umask 01H +RFOs that miss cache lines. +.It Li L2_STORE_LOCK_RQSTS.HIT_M +.Pq Event 27H , Umask 08H +RFOs that hit cache lines in M state. +.It Li L2_STORE_LOCK_RQSTS.ALL +.Pq Event 27H , Umask 0FH +RFOs that access cache lines in any state. +.It Li L2_L1D_WB_RQSTS.MISS +.Pq Event 28H , Umask 01H +Not rejected writebacks that missed LLC. +.It Li L2_L1D_WB_RQSTS.HIT_E +.Pq Event 28H , Umask 04H +Not rejected writebacks from L1D to L2 cache lines in E state. +.It Li L2_L1D_WB_RQSTS.HIT_M +.Pq Event 28H , Umask 08H +Not rejected writebacks from L1D to L2 cache lines in M state. +.It Li L2_L1D_WB_RQSTS.ALL +.Pq Event 28H , Umask 0FH +Not rejected writebacks from L1D to L2 cache lines in any state. +.It Li LONGEST_LAT_CACHE.REFERENCE +.Pq Event 2EH , Umask 4FH +This event counts requests originating from the core that reference a cache +line in the last level cache. +.It Li LONGEST_LAT_CACHE.MISS +.Pq Event 2EH , Umask 41H +This event counts each cache miss condition for references to the last level +cache. +.It Li CPU_CLK_UNHALTED.THREAD_P +.Pq Event 3CH , Umask 00H +Counts the number of thread cycles while the thread is not in a halt state. +The thread enters the halt state when it is running the HLT instruction. The +core frequency may change from time to time due to power or thermal +throttling. +.It Li CPU_CLK_THREAD_UNHALTED.REF_XCLK +.Pq Event 3CH , Umask 01H +Increments at the frequency of XCLK (100 MHz) when not halted. +.It Li L1D_PEND_MISS.PENDING +.Pq Event 48H , Umask 01H +Increments the number of outstanding L1D misses every cycle. Set Cmaks = 1 +and Edge =1 to count occurrences. +Counter 2 only. +Set Cmask = 1 to count cycles. +.It Li DTLB_STORE_MISSES.MISS_CAUSES_A_WALK +.Pq Event 49H , Umask 01H +Miss in all TLB levels causes an page walk of any page size (4K/2M/4M/1G). +.It Li DTLB_STORE_MISSES.WALK_COMPLETED +.Pq Event 49H , Umask 02H +Miss in all TLB levels causes a page walk that completes of any page size +(4K/2M/4M/1G). +.It Li DTLB_STORE_MISSES.WALK_DURATION +.Pq Event 49H , Umask 04H +Cycles PMH is busy with this walk. +.It Li DTLB_STORE_MISSES.STLB_HIT +.Pq Event 49H , Umask 10H +Store operations that miss the first TLB level but hit the second and do not +cause page walks. +.It Li LOAD_HIT_PRE.SW_PF +.Pq Event 4CH , Umask 01H +Non-SW-prefetch load dispatches that hit fill buffer allocated for S/W prefetch. +.It Li LOAD_HIT_PRE.HW_PF +.Pq Event 4CH , Umask 02H +Non-SW-prefetch load dispatches that hit fill buffer allocated for H/W prefetch. +.It Li L1D.REPLACEMENT +.Pq Event 51H , Umask 01H +Counts the number of lines brought into the L1 data cache. +.It Li MOVE_ELIMINATION.INT_NOT_ELIMINATED +.Pq Event 58H , Umask 01H +Number of integer Move Elimination candidate uops that were not eliminated. +.It Li MOVE_ELIMINATION.SIMD_NOT_ELIMINATED +.Pq Event 58H , Umask 02H +Number of SIMD Move Elimination candidate uops that were not eliminated. +.It Li MOVE_ELIMINATION.INT_ELIMINATED +.Pq Event 58H , Umask 04H +Number of integer Move Elimination candidate uops that were eliminated. +.It Li MOVE_ELIMINATION.SIMD_ELIMINATED +.Pq Event 58H , Umask 08H +Number of SIMD Move Elimination candidate uops that were eliminated. +.It Li CPL_CYCLES.RING0 +.Pq Event 5CH , Umask 01H +Unhalted core cycles when the thread is in ring 0. +Use Edge to count transition. +.It Li CPL_CYCLES.RING123 +.Pq Event 5CH , Umask 02H +Unhalted core cycles when the thread is not in ring 0. +.It Li RS_EVENTS.EMPTY_CYCLES +.Pq Event 5EH , Umask 01H +Cycles the RS is empty for the thread. +.It Li DTLB_LOAD_MISSES.STLB_HIT +.Pq Event 5FH , Umask 04H +Counts load operations that missed 1st level DTLB but hit the 2nd level. +.It Li OFFCORE_REQUESTS_OUTSTANDING.DEMAND_DATA_RD +.Pq Event 60H , Umask 01H +Offcore outstanding Demand Data Read transactions in SQ to uncore. Set +Cmask=1 to count cycles. +.It Li OFFCORE_REQUESTS_OUTSTANDING.DEMAND_CODE_RD +.Pq Event 60H , Umask 02H +Offcore outstanding Demand Code Read transactions in SQ to uncore. Set +Cmask=1 to count cycles. +.It Li OFFCORE_REQUESTS_OUTSTANDING.DEMAND_RFO +.Pq Event 60H , Umask 04H +Offcore outstanding RFO store transactions in SQ to uncore. Set Cmask=1 to +count cycles. +.It Li OFFCORE_REQUESTS_OUTSTANDING.ALL_DATA_RD +.Pq Event 60H , Umask 08H +Offcore outstanding cacheable data read transactions in SQ to uncore. Set +Cmask=1 to count cycles. +.It Li LOCK_CYCLES.SPLIT_LOCK_UC_LOCK_DURATION +.Pq Event 63H , Umask 01H +Cycles in which the L1D and L2 are locked, due to a UC lock or split lock. +.It Li LOCK_CYCLES.CACHE_LOCK_DURATION +.Pq Event 63H , Umask 02H +Cycles in which the L1D is locked. +.It Li IDQ.EMPTY +.Pq Event 79H , Umask 02H +Counts cycles the IDQ is empty. +.It Li IDQ.MITE_UOPS +.Pq Event 79H , Umask 04H +Increment each cycle # of uops delivered to IDQ from MITE path. +Can combine Umask 04H and 20H. +Set Cmask = 1 to count cycles. +.It Li IDQ.DSB_UOPS +.Pq Event 79H , Umask 08H +Increment each cycle. # of uops delivered to IDQ from DSB path. +Can combine Umask 08H and 10H +Set Cmask = 1 to count cycles. +.It Li IDQ.MS_DSB_UOPS +.Pq Event 79H , Umask 10H +Increment each cycle # of uops delivered to IDQ when MS_busy by DSB. Set +Cmask = 1 to count cycles. Add Edge=1 to count # of delivery. +Can combine Umask 04H, 08H. +.It Li IDQ.MS_MITE_UOPS +.Pq Event 79H , Umask 20H +Increment each cycle # of uops delivered to IDQ when MS_busy by MITE. Set +Cmask = 1 to count cycles. +Can combine Umask 04H, 08H. +.It Li IDQ.MS_UOPS +.Pq Event 79H , Umask 30H +Increment each cycle # of uops delivered to IDQ from MS by either DSB or +MITE. Set Cmask = 1 to count cycles. +Can combine Umask 04H, 08H. +.It Li IDQ.ALL_DSB_CYCLES_ANY_UOPS +.Pq Event 79H , Umask 18H +Counts cycles DSB is delivered at least one uops. Set Cmask = 1. +.It Li IDQ.ALL_DSB_CYCLES_4_UOPS +.Pq Event 79H , Umask 18H +Counts cycles DSB is delivered four uops. Set Cmask = 4. +.It Li IDQ.ALL_MITE_CYCLES_ANY_UOPS +.Pq Event 79H , Umask 24H +Counts cycles MITE is delivered at least one uops. Set Cmask = 1. +.It Li IDQ.ALL_MITE_CYCLES_4_UOPS +.Pq Event 79H , Umask 24H +Counts cycles MITE is delivered four uops. Set Cmask = 4. +.It Li IDQ.MITE_ALL_UOPS +.Pq Event 79H , Umask 3CH +# of uops delivered to IDQ from any path. +.It Li ICACHE.MISSES +.Pq Event 80H , Umask 02H +Number of Instruction Cache, Streaming Buffer and Victim Cache Misses. +Includes UC accesses. +.It Li ITLB_MISSES.MISS_CAUSES_A_WALK +.Pq Event 85H , Umask 01H +Misses in all ITLB levels that cause page walks. +.It Li ITLB_MISSES.WALK_COMPLETED +.Pq Event 85H , Umask 02H +Misses in all ITLB levels that cause completed page walks. +.It Li ITLB_MISSES.WALK_DURATION +.Pq Event 85H , Umask 04H +Cycle PMH is busy with a walk. +.It Li ITLB_MISSES.STLB_HIT +.Pq Event 85H , Umask 10H +Number of cache load STLB hits. No page walk. +.It Li ILD_STALL.LCP +.Pq Event 87H , Umask 01H +Stalls caused by changing prefix length of the instruction. +.It Li ILD_STALL.IQ_FULL +.Pq Event 87H , Umask 04H +Stall cycles due to IQ is full. +.It Li BR_INST_EXEC.COND +.Pq Event 88H , Umask 01H +Qualify conditional near branch instructions executed, but not necessarily +retired. +Must combine with umask 40H, 80H. +.It Li BR_INST_EXEC.DIRECT_JMP +.Pq Event 88H , Umask 02H +Qualify all unconditional near branch instructions excluding calls and +indirect branches. +Must combine with umask 80H. +.It Li BR_INST_EXEC.INDIRECT_JMP_NON_CALL_RET +.Pq Event 88H , Umask 04H +Qualify executed indirect near branch instructions that are not calls nor +returns. +Must combine with umask 80H. +.It Li BR_INST_EXEC.RETURN_NEAR +.Pq Event 88H , Umask 08H +Qualify indirect near branches that have a return mnemonic. +Must combine with umask 80H. +.It Li BR_INST_EXEC.DIRECT_NEAR_CALL +.Pq Event 88H , Umask 10H +Qualify unconditional near call branch instructions, excluding non call +branch, executed. +Must combine with umask 80H. +.It Li BR_INST_EXEC.INDIRECT_NEAR_CALL +.Pq Event 88H , Umask 20H +Qualify indirect near calls, including both register and memory indirect, +executed. +Must combine with umask 80H. +.It Li BR_INST_EXEC.NONTAKEN +.Pq Event 88H , Umask 40H +Qualify non-taken near branches executed. +Applicable to umask 01H only. +.It Li BR_INST_EXEC.TAKEN +.Pq Event 88H , Umask 80H +Qualify taken near branches executed. Must combine with 01H,02H, 04H, 08H, +10H, 20H. +.It Li BR_INST_EXEC.ALL_BRANCHES +.Pq Event 88H , Umask FFH +Counts all near executed branches (not necessarily retired). +.It Li BR_MISP_EXEC.COND +.Pq Event 89H , Umask 01H +Qualify conditional near branch instructions mispredicted. +Must combine with umask 40H, 80H. +.It Li BR_MISP_EXEC.INDIRECT_JMP_NON_CALL_RET +.Pq Event 89H , Umask 04H +Qualify mispredicted indirect near branch instructions that are not calls +nor returns. +Must combine with umask 80H. +.It Li BR_MISP_EXEC.RETURN_NEAR +.Pq Event 89H , Umask 08H +Qualify mispredicted indirect near branches that have a return mnemonic. +Must combine with umask 80H. +.It Li BR_MISP_EXEC.DIRECT_NEAR_CALL +.Pq Event 89H , Umask 10H +Qualify mispredicted unconditional near call branch instructions, excluding +non call branch, executed. +Must combine with umask 80H. +.It Li BR_MISP_EXEC.INDIRECT_NEAR_CALL +.Pq Event 89H , Umask 20H +Qualify mispredicted indirect near calls, including both register and memory +indirect, executed. +Must combine with umask 80H. +.It Li BR_MISP_EXEC.NONTAKEN +.Pq Event 89H , Umask 40H +Qualify mispredicted non-taken near branches executed. +Applicable to umask 01H only. +.It Li BR_MISP_EXEC.TAKEN +.Pq Event 89H , Umask 80H +Qualify mispredicted taken near branches executed. Must combine with +01H,02H, 04H, 08H, 10H, 20H. +.It Li BR_MISP_EXEC.ALL_BRANCHES +.Pq Event 89H , Umask FFH +Counts all near executed branches (not necessarily retired). +.It Li IDQ_UOPS_NOT_DELIVERED.CORE +.Pq Event 9CH , Umask 01H +Count number of non-delivered uops to RAT per thread. +Use Cmask to qualify uop b/w. +.It Li UOPS_DISPATCHED_PORT.PORT_0 +.Pq Event A1H , Umask 01H +Cycles which a Uop is dispatched on port 0. +.It Li UOPS_DISPATCHED_PORT.PORT_1 +.Pq Event A1H , Umask 02H +Cycles which a Uop is dispatched on port 1. +.It Li UOPS_DISPATCHED_PORT.PORT_2_LD +.Pq Event A1H , Umask 04H +Cycles which a load uop is dispatched on port 2. +.It Li UOPS_DISPATCHED_PORT.PORT_2_STA +.Pq Event A1H , Umask 08H +Cycles which a store address uop is dispatched on port 2. +.It Li UOPS_DISPATCHED_PORT.PORT_2 +.Pq Event A1H , Umask 0CH +Cycles which a Uop is dispatched on port 2. +.It Li UOPS_DISPATCHED_PORT.PORT_3_LD +.Pq Event A1H , Umask 10H +Cycles which a load uop is dispatched on port 3. +.It Li UOPS_DISPATCHED_PORT.PORT_3_STA +.Pq Event A1H , Umask 20H +Cycles which a store address uop is dispatched on port 3. +.It Li UOPS_DISPATCHED_PORT.PORT_3 +.Pq Event A1H , Umask 30H +Cycles which a Uop is dispatched on port 3. +.It Li UOPS_DISPATCHED_PORT.PORT_4 +.Pq Event A1H , Umask 40H +Cycles which a Uop is dispatched on port 4. +.It Li UOPS_DISPATCHED_PORT.PORT_5 +.Pq Event A1H , Umask 80H +Cycles which a Uop is dispatched on port 5. +.It Li RESOURCE_STALLS.ANY +.Pq Event A2H , Umask 01H +Cycles Allocation is stalled due to Resource Related reason. +.It Li RESOURCE_STALLS.RS +.Pq Event A2H , Umask 04H +Cycles stalled due to no eligible RS entry available. +.It Li RESOURCE_STALLS.SB +.Pq Event A2H , Umask 08H +Cycles stalled due to no store buffers available. (not including draining +form sync). +.It Li RESOURCE_STALLS.ROB +.Pq Event A2H , Umask 10H +Cycles stalled due to re-order buffer full. +.It Li CYCLE_ACTIVITY.CYCLES_L2_PENDING +.Pq Event A3H , Umask 01H +Cycles with pending L2 miss loads. Set AnyThread to count per core. +.It Li CYCLE_ACTIVITY.CYCLES_LDM_PENDING +.Pq Event A3H , Umask 02H +Cycles with pending memory loads. Set AnyThread to count per core. +.It Li CYCLE_ACTIVITY.CYCLES_NO_EXECUTE +.Pq Event A3H , Umask 04H +Cycles of dispatch stalls. Set AnyThread to count per core. +.It Li CYCLE_ACTIVITY.CYCLES_L1D_PENDING +.Pq Event A3H , Umask 08H +Cycles with pending L1 cache miss loads. Set AnyThread to count per core. +.It Li DSB2MITE_SWITCHES.COUNT +.Pq Event ABH , Umask 01H +Number of DSB to MITE switches. +.It Li DSB2MITE_SWITCHES.PENALTY_CYCLES +.Pq Event ABH , Umask 02H +Cycles DSB to MITE switches caused delay. +.It Li DSB_FILL.EXCEED_DSB_LINES +.Pq Event ACH , Umask 08H +DSB Fill encountered > 3 DSB lines. +.It Li ITLB.ITLB_FLUSH +.Pq Event AEH , Umask 01H +Counts the number of ITLB flushes, includes 4k/2M/4M pages. +.It Li OFFCORE_REQUESTS.DEMAND_DATA_RD +.Pq Event B0H , Umask 01H +Demand data read requests sent to uncore. +.It Li OFFCORE_REQUESTS.DEMAND_CODE_RD +.Pq Event B0H , Umask 02H +Demand code read requests sent to uncore. +.It Li OFFCORE_REQUESTS.DEMAND_RFO +.Pq Event B0H , Umask 04H +Demand RFO read requests sent to uncore, including regular RFOs, locks, +ItoM. +.It Li OFFCORE_REQUESTS.ALL_DATA_RD +.Pq Event B0H , Umask 08H +Data read requests sent to uncore (demand and prefetch). +.It Li UOPS_EXECUTED.THREAD +.Pq Event B1H , Umask 01H +Counts total number of uops to be executed per-thread each cycle. Set Cmask += 1, INV =1 to count stall cycles. +.It Li UOPS_EXECUTED.CORE +.Pq Event B1H , Umask 02H +Counts total number of uops to be executed per-core each cycle. +Do not need to set ANY. +.It Li OFF_CORE_RESPONSE_0 +.Pq Event B7H , Umask 01H +Off-core Response Performance Monitoring. +PMC0 only. +Requires programming MSR 01A6H. +.It Li OFF_CORE_RESPONSE_1 +.Pq Event BBH , Umask 01H +Off-core Response Performance Monitoring. +PMC3 only. +Requires programming MSR 01A7H. +.It Li TLB_FLUSH.DTLB_THREAD +.Pq Event BDH , Umask 01H +DTLB flush attempts of the thread- specific entries. +.It Li TLB_FLUSH.STLB_ANY +.Pq Event BDH , Umask 20H +Count number of STLB flush attempts. +.It Li INST_RETIRED.ANY_P +.Pq Event C0H , Umask 00H +Number of instructions at retirement. +.It Li INST_RETIRED.ALL +.Pq Event C0H , Umask 01H +Precise instruction retired event with HW to reduce effect of PEBS shadow in +IP distribution. +PMC1 only. +Must quiesce other PMCs. +.It Li OTHER_ASSISTS.AVX_STORE +.Pq Event C1H , Umask 08H +Number of assists associated with 256-bit AVX store operations. +.It Li OTHER_ASSISTS.AVX_TO_SSE +.Pq Event C1H , Umask 10H +Number of transitions from AVX- 256 to legacy SSE when penalty applicable. +.It Li OTHER_ASSISTS.SSE_TO_AVX +.Pq Event C1H , Umask 20H +Number of transitions from SSE to AVX-256 when penalty applicable. +.It Li UOPS_RETIRED.ALL +.Pq Event C2H , Umask 01H +Counts the number of micro-ops retired, Use cmask=1 and invert to count +active cycles or stalled cycles. +Supports PEBS, use Any=1 for core granular. +.It Li UOPS_RETIRED.RETIRE_SLOTS +.Pq Event C2H , Umask 02H +Counts the number of retirement slots used each cycle. +.It Li MACHINE_CLEARS.MEMORY_ORDERING +.Pq Event C3H , Umask 02H +Counts the number of machine clears due to memory order conflicts. +.It Li MACHINE_CLEARS.SMC +.Pq Event C3H , Umask 04H +Number of self-modifying-code machine clears detected. +.It Li MACHINE_CLEARS.MASKMOV +.Pq Event C3H , Umask 20H +Counts the number of executed AVX masked load operations that refer to an +illegal address range with the mask bits set to 0. +.It Li BR_INST_RETIRED.ALL_BRANCHES +.Pq Event C4H , Umask 00H +Branch instructions at retirement. +.It Li BR_INST_RETIRED.CONDITIONAL +.Pq Event C4H , Umask 01H +Counts the number of conditional branch instructions retired. +Supports PEBS. +.It Li BR_INST_RETIRED.NEAR_CALL +.Pq Event C4H , Umask 02H +Direct and indirect near call instructions retired. +.It Li BR_INST_RETIRED.ALL_BRANCHES +.Pq Event C4H , Umask 04H +Counts the number of branch instructions retired. +.It Li BR_INST_RETIRED.NEAR_RETURN +.Pq Event C4H , Umask 08H +Counts the number of near return instructions retired. +.It Li BR_INST_RETIRED.NOT_TAKEN +.Pq Event C4H , Umask 10H +Counts the number of not taken branch instructions retired. +.It Li BR_INST_RETIRED.NEAR_TAKEN +.Pq Event C4H , Umask 20H +Number of near taken branches retired. +.It Li BR_INST_RETIRED.FAR_BRANCH +.Pq Event C4H , Umask 40H +Number of far branches retired. +.It Li BR_MISP_RETIRED.ALL_BRANCHES +.Pq Event C5H , Umask 00H +Mispredicted branch instructions at retirement. +.It Li BR_MISP_RETIRED.CONDITIONAL +.Pq Event C5H , Umask 01H +Mispredicted conditional branch instructions retired. +Supports PEBS. +.It Li BR_MISP_RETIRED.NEAR_CALL +.Pq Event C5H , Umask 02H +Direct and indirect mispredicted near call instructions retired. +.It Li BR_MISP_RETIRED.ALL_BRANCHES +.Pq Event C5H , Umask 04H +Mispredicted macro branch instructions retired. +.It Li BR_MISP_RETIRED.NOT_TAKEN +.Pq Event C5H , Umask 10H +Mispredicted not taken branch instructions retired. +.It Li BR_MISP_RETIRED.TAKEN +.Pq Event C5H , Umask 20H +Mispredicted taken branch instructions retired. +.It Li FP_ASSIST.X87_OUTPUT +.Pq Event CAH , Umask 02H +Number of X87 FP assists due to Output values. +.It Li FP_ASSIST.X87_INPUT +.Pq Event CAH , Umask 04H +Number of X87 FP assists due to input values. +.It Li FP_ASSIST.SIMD_OUTPUT +.Pq Event CAH , Umask 08H +Number of SIMD FP assists due to Output values. +.It Li FP_ASSIST.SIMD_INPUT +.Pq Event CAH , Umask 10H +Number of SIMD FP assists due to input values. +.It Li FP_ASSIST.ANY +.Pq Event CAH , Umask 1EH +Cycles with any input/output SSE* or FP assists. +.It Li ROB_MISC_EVENTS.LBR_INSERTS +.Pq Event CCH , Umask 20H +Count cases of saving new LBR records by hardware. +.It Li MEM_TRANS_RETIRED.LOAD_LATENCY +.Pq Event CDH , Umask 01H +Sample loads with specified latency threshold. +PMC3 only. +Specify threshold in MSR 0x3F6. +.It Li MEM_TRANS_RETIRED.PRECISE_STORE +.Pq Event CDH , Umask 02H +Sample stores and collect precise store operation via PEBS record. +PMC3 only. +.It Li MEM_UOP_RETIRED.LOADS +.Pq Event D0H , Umask 01H +Qualify retired memory uops that are loads. Combine with umask 10H, 20H, +40H, 80H. +Supports PEBS. +.It Li MEM_UOP_RETIRED.STORES +.Pq Event D0H , Umask 02H +Qualify retired memory uops that are stores. Combine with umask 10H, 20H, +40H, 80H. +.It Li MEM_UOP_RETIRED.STLB_MISS +.Pq Event D0H , Umask 10H +Qualify retired memory uops with STLB miss. Must combine with umask 01H, +02H, to produce counts. +.It Li MEM_UOP_RETIRED.LOCK +.Pq Event D0H , Umask 20H +Qualify retired memory uops with lock. Must combine with umask 01H, 02H, to +produce counts. +.It Li MEM_UOP_RETIRED.SPLIT +.Pq Event D0H , Umask 40H +Qualify retired memory uops with line split. Must combine with umask 01H, +02H, to produce counts. +.It Li MEM_UOP_RETIRED.ALL +.Pq Event D0H , Umask 80H +Qualify any retired memory uops. Must combine with umask 01H, 02H, to +produce counts. +.It Li MEM_LOAD_UOPS_RETIRED.L1_HIT +.Pq Event D1H , Umask 01H +Retired load uops with L1 cache hits as data sources. +Supports PEBS. +.It Li MEM_LOAD_UOPS_RETIRED.L2_HIT +.Pq Event D1H , Umask 02H +Retired load uops with L2 cache hits as data sources. +.It Li MEM_LOAD_UOPS_RETIRED.LLC_HIT +.Pq Event D1H , Umask 04H +Retired load uops whose data source was LLC hit with no snoop required. +.It Li MEM_LOAD_UOPS_RETIRED.LLC_MISS +.Pq Event D1H , Umask 20H +Retired load uops whose data source is LLC miss. +.It Li MEM_LOAD_UOPS_RETIRED.HIT_LFB +.Pq Event D1H , Umask 40H +Retired load uops which data sources were load uops missed L1 but hit FB due +to preceding miss to the same cache line with data not ready. +.It Li MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_MISS +.Pq Event D2H , Umask 01H +Retired load uops which data sources were LLC hit and cross-core snoop +missed in on-pkg core cache. +Supports PEBS. +.It Li MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HIT +.Pq Event D2H , Umask 02H +Retired load uops which data sources were LLC and cross-core snoop hits in +on-pkg core cache. +Supports PEBS. +.It Li MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HITM +.Pq Event D2H , Umask 04H +Retired load uops which data sources were HitM responses from shared LLC. +.It Li MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_NONE +.Pq Event D2H , Umask 08H +Retired load uops which data sources were hits in LLC without snoops +required. +.It Li MEM_LOAD_UOPS_LLC_MISS_RETIRED.LOCAL_DRAM +.Pq Event D3H , Umask 01H +Retired load uops which data sources missed LLC but serviced from local +dram. +Supports PEBS. +.It Li MEM_LOAD_UOPS_LLC_MISS_RETIRED.REMOTE_DRAM +.Pq Event D3H , Umask 04H +Retired load uops whose data source was remote DRAM. +.It Li MEM_LOAD_UOPS_LLC_MISS_RETIRED.REMOTE_HITM +.Pq Event D3H , Umask 10H +Retired load uops whose data source was remote HITM. +.It Li MEM_LOAD_UOPS_LLC_MISS_RETIRED.REMOTE_FWD +.Pq Event D3H , Umask 20H +Retired load uops whose data source was forwards from a remote cache. +.It Li BACLEARS.ANY +.Pq Event E6H , Umask 1FH +Number of front end re-steers due to BPU misprediction. +.It Li L2_TRANS.DEMAND_DATA_RD +.Pq Event F0H , Umask 01H +Demand Data Read requests that access L2 cache. +.It Li L2_TRANS.RFO +.Pq Event F0H , Umask 02H +RFO requests that access L2 cache. +.It Li L2_TRANS.CODE_RD +.Pq Event F0H , Umask 04H +L2 cache accesses when fetching instructions. +.It Li L2_TRANS.ALL_PF +.Pq Event F0H , Umask 08H +Any MLC or LLC HW prefetch accessing L2, including rejects. +.It Li L2_TRANS.L1D_WB +.Pq Event F0H , Umask 10H +L1D writebacks that access L2 cache. +.It Li L2_TRANS.L2_FILL +.Pq Event F0H , Umask 20H +L2 fill requests that access L2 cache. +.It Li L2_TRANS.L2_WB +.Pq Event F0H , Umask 40H +L2 writebacks that access L2 cache. +.It Li L2_TRANS.ALL_REQUESTS +.Pq Event F0H , Umask 80H +Transactions accessing L2 pipe. +.It Li L2_LINES_IN.I +.Pq Event F1H , Umask 01H +L2 cache lines in I state filling L2. +Counting does not cover rejects. +.It Li L2_LINES_IN.S +.Pq Event F1H , Umask 02H +L2 cache lines in S state filling L2. +Counting does not cover rejects. +.It Li L2_LINES_IN.E +.Pq Event F1H , Umask 04H +L2 cache lines in E state filling L2. +Counting does not cover rejects. +.It Li L2_LINES_IN.ALL +.Pq Event F1H , Umask 07H +L2 cache lines filling L2. +Counting does not cover rejects. +.It Li L2_LINES_OUT.DEMAND_CLEAN +.Pq Event F2H , Umask 01H +Clean L2 cache lines evicted by demand. +.It Li L2_LINES_OUT.DEMAND_DIRTY +.Pq Event F2H , Umask 02H +Dirty L2 cache lines evicted by demand. +.It Li L2_LINES_OUT.PF_CLEAN +.Pq Event F2H , Umask 04H +Clean L2 cache lines evicted by the MLC prefetcher. +.It Li L2_LINES_OUT.PF_DIRTY +.Pq Event F2H , Umask 08H +Dirty L2 cache lines evicted by the MLC prefetcher. +.It Li L2_LINES_OUT.DIRTY_ALL +.Pq Event F2H , Umask 0AH +Dirty L2 cache lines filling the L2. +.El +.Sh SEE ALSO +.Xr pmc 3 , +.Xr pmc.atom 3 , +.Xr pmc.core 3 , +.Xr pmc.iaf 3 , +.Xr pmc.ucf 3 , +.Xr pmc.k7 3 , +.Xr pmc.k8 3 , +.Xr pmc.p4 3 , +.Xr pmc.p5 3 , +.Xr pmc.p6 3 , +.Xr pmc.corei7 3 , +.Xr pmc.corei7uc 3 , +.Xr pmc.ivybridge 3 , +.Xr pmc.sandybridge 3 , +.Xr pmc.sandybridgeuc 3 , +.Xr pmc.sandybridgexeon 3 , +.Xr pmc.westmere 3 , +.Xr pmc.westmereuc 3 , +.Xr pmc.soft 3 , +.Xr pmc.tsc 3 , +.Xr pmc_cpuinfo 3 , +.Xr pmclog 3 , +.Xr hwpmc 4 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Apr 15 05:00:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id F36BF290; Mon, 15 Apr 2013 05:00:41 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E1B9719E; Mon, 15 Apr 2013 05:00:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3F50fxM076966; Mon, 15 Apr 2013 05:00:41 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3F50fDg076965; Mon, 15 Apr 2013 05:00:41 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201304150500.r3F50fDg076965@svn.freebsd.org> From: Xin LI Date: Mon, 15 Apr 2013 05:00:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249494 - stable/9/release/doc/en_US.ISO8859-1/hardware X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Apr 2013 05:00:42 -0000 Author: delphij Date: Mon Apr 15 05:00:41 2013 New Revision: 249494 URL: http://svnweb.freebsd.org/changeset/base/249494 Log: MFC r249397: Fix a few typos. Reviewed by: gjb Modified: stable/9/release/doc/en_US.ISO8859-1/hardware/article.xml Directory Properties: stable/9/release/doc/en_US.ISO8859-1/hardware/ (props changed) Modified: stable/9/release/doc/en_US.ISO8859-1/hardware/article.xml ============================================================================== --- stable/9/release/doc/en_US.ISO8859-1/hardware/article.xml Mon Apr 15 04:16:12 2013 (r249493) +++ stable/9/release/doc/en_US.ISO8859-1/hardware/article.xml Mon Apr 15 05:00:41 2013 (r249494) @@ -171,7 +171,7 @@ There is a wide variety of motherboards available for this architecture. Motherboards using the ISA, VLB, EISA, AGP, and - PCI expansion busses are well-supported. There is some + PCI expansion buses are well-supported. There is some limited support for the MCA (MicroChannel) expansion bus used in the IBM PS/2 line of PCs. @@ -200,7 +200,7 @@ memory above 4 gigabytes and allow it to be used by the system. This feature places constraints on the device drivers and other features of &os; which may be used; consult the - &man.pae.4; manpage for more details. + &man.pae.4; manual page for more details. &os; will generally run on i386-based laptops, albeit with varying levels of support for certain hardware features such @@ -533,7 +533,7 @@ The following systems are partially supported by &os;. In - particular the fibre channel controllers in SBus-based systems are not + particular the fiber channel controllers in SBus-based systems are not supported. However, it is possible to use these with a SCSI controller supported by the &man.esp.4 driver (Sun ESP SCSI, Sun FAS Fast-SCSI and Sun FAS366 Fast-Wide SCSI controllers). From owner-svn-src-all@FreeBSD.ORG Mon Apr 15 05:01:13 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1C8D63F9; Mon, 15 Apr 2013 05:01:13 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0DFC21A3; Mon, 15 Apr 2013 05:01:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3F51CTf077147; Mon, 15 Apr 2013 05:01:12 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3F51CSG077146; Mon, 15 Apr 2013 05:01:12 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201304150501.r3F51CSG077146@svn.freebsd.org> From: Xin LI Date: Mon, 15 Apr 2013 05: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 Subject: svn commit: r249495 - stable/8/release/doc/en_US.ISO8859-1/hardware X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Apr 2013 05:01:13 -0000 Author: delphij Date: Mon Apr 15 05:01:12 2013 New Revision: 249495 URL: http://svnweb.freebsd.org/changeset/base/249495 Log: MFC r249397: Fix a few typos. Reviewed by: gjb Modified: stable/8/release/doc/en_US.ISO8859-1/hardware/article.xml Directory Properties: stable/8/release/doc/en_US.ISO8859-1/hardware/ (props changed) Modified: stable/8/release/doc/en_US.ISO8859-1/hardware/article.xml ============================================================================== --- stable/8/release/doc/en_US.ISO8859-1/hardware/article.xml Mon Apr 15 05:00:41 2013 (r249494) +++ stable/8/release/doc/en_US.ISO8859-1/hardware/article.xml Mon Apr 15 05:01:12 2013 (r249495) @@ -171,7 +171,7 @@ There is a wide variety of motherboards available for this architecture. Motherboards using the ISA, VLB, EISA, AGP, and - PCI expansion busses are well-supported. There is some + PCI expansion buses are well-supported. There is some limited support for the MCA (MicroChannel) expansion bus used in the IBM PS/2 line of PCs. @@ -202,7 +202,7 @@ memory above 4 gigabytes and allow it to be used by the system. This feature places constraints on the device drivers and other features of &os; which may be used; consult the - &man.pae.4; manpage for more details. + &man.pae.4; manual page for more details. &os; will generally run on i386-based laptops, albeit with varying levels of support for certain hardware features such @@ -480,7 +480,7 @@ The following systems are partially supported by &os;. In - particular the fibre channel controllers in SBus-based systems are not + particular the fiber channel controllers in SBus-based systems are not supported. However, it is possible to use these with a SCSI controller supported by the &man.esp.4 driver (Sun ESP SCSI, Sun FAS Fast-SCSI and Sun FAS366 Fast-Wide SCSI controllers). From owner-svn-src-all@FreeBSD.ORG Mon Apr 15 05:18:50 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 39750754; Mon, 15 Apr 2013 05:18:50 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2B7AB22D; Mon, 15 Apr 2013 05:18:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3F5Inin081580; Mon, 15 Apr 2013 05:18:49 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3F5InLG081579; Mon, 15 Apr 2013 05:18:49 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201304150518.r3F5InLG081579@svn.freebsd.org> From: Xin LI Date: Mon, 15 Apr 2013 05:18:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r249496 - vendor/netcat/dist X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Apr 2013 05:18:50 -0000 Author: delphij Date: Mon Apr 15 05:18:49 2013 New Revision: 249496 URL: http://svnweb.freebsd.org/changeset/base/249496 Log: Vendor import from OpenBSD tag OPENBSD_5_3 as of today. Modified: vendor/netcat/dist/atomicio.c Modified: vendor/netcat/dist/atomicio.c ============================================================================== --- vendor/netcat/dist/atomicio.c Mon Apr 15 05:01:12 2013 (r249495) +++ vendor/netcat/dist/atomicio.c Mon Apr 15 05:18:49 2013 (r249496) @@ -1,4 +1,4 @@ -/* $OpenBSD: atomicio.c,v 1.10 2011/01/08 00:47:19 jeremy Exp $ */ +/* $OpenBSD: atomicio.c,v 1.11 2012/12/04 02:24:47 deraadt Exp $ */ /* * Copyright (c) 2006 Damien Miller. All rights reserved. * Copyright (c) 2005 Anil Madhavapeddy. All rights reserved. @@ -26,8 +26,6 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include - #include #include #include From owner-svn-src-all@FreeBSD.ORG Mon Apr 15 05:19:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7930B8E2; Mon, 15 Apr 2013 05:19:57 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 51B6C23F; Mon, 15 Apr 2013 05:19:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3F5JvTt081761; Mon, 15 Apr 2013 05:19:57 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3F5JvhF081760; Mon, 15 Apr 2013 05:19:57 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201304150519.r3F5JvhF081760@svn.freebsd.org> From: Xin LI Date: Mon, 15 Apr 2013 05:19:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r249497 - vendor/netcat/5.3 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Apr 2013 05:19:57 -0000 Author: delphij Date: Mon Apr 15 05:19:56 2013 New Revision: 249497 URL: http://svnweb.freebsd.org/changeset/base/249497 Log: Tag netcat from OpenBSD 5.3. Added: vendor/netcat/5.3/ - copied from r249496, vendor/netcat/dist/ From owner-svn-src-all@FreeBSD.ORG Mon Apr 15 05:24:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 81657AB9; Mon, 15 Apr 2013 05:24:44 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 733CF27E; Mon, 15 Apr 2013 05:24:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3F5OiTU084079; Mon, 15 Apr 2013 05:24:44 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3F5Oi1q084076; Mon, 15 Apr 2013 05:24:44 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201304150524.r3F5Oi1q084076@svn.freebsd.org> From: Xin LI Date: Mon, 15 Apr 2013 05:24:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r249498 - vendor/netcat/dist X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Apr 2013 05:24:44 -0000 Author: delphij Date: Mon Apr 15 05:24:43 2013 New Revision: 249498 URL: http://svnweb.freebsd.org/changeset/base/249498 Log: Integrate two OpenBSD commits to nc(1): date: 2013/03/12 02:57:37; author: deraadt; All accept() errors are considered fatal, until someone gives a different reason. No code changed, just documenting it... date: 2013/03/20 09:27:56; author: sthen; Don't shutdown nc(1)'s network socket when stdin closes. Matches *Hobbit*'s original netcat and GNU netcat; revert to old behaviour with the new -N flag if needed. After much discussion with otto deraadt tedu and Martin Pelikan. ok deraadt@ Modified: vendor/netcat/dist/nc.1 vendor/netcat/dist/netcat.c Modified: vendor/netcat/dist/nc.1 ============================================================================== --- vendor/netcat/dist/nc.1 Mon Apr 15 05:19:56 2013 (r249497) +++ vendor/netcat/dist/nc.1 Mon Apr 15 05:24:43 2013 (r249498) @@ -1,4 +1,4 @@ -.\" $OpenBSD: nc.1,v 1.61 2012/07/07 15:33:02 haesbaert Exp $ +.\" $OpenBSD: nc.1,v 1.62 2013/03/20 09:27:56 sthen Exp $ .\" .\" Copyright (c) 1996 David Sacerdote .\" All rights reserved. @@ -25,7 +25,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: February 7 2012 $ +.Dd $Mdocdate: July 7 2012 $ .Dt NC 1 .Os .Sh NAME @@ -34,7 +34,7 @@ .Sh SYNOPSIS .Nm nc .Bk -words -.Op Fl 46DdhklnrStUuvz +.Op Fl 46DdhklNnrStUuvz .Op Fl I Ar length .Op Fl i Ar interval .Op Fl O Ar length @@ -137,6 +137,10 @@ options. Additionally, any timeouts specified with the .Fl w option are ignored. +.It Fl N +.Xr shutdown 2 +the network socket after EOF on the input. +Some servers require this to finish their work. .It Fl n Do not do any DNS or service lookups on any specified addresses, hostnames or ports. Modified: vendor/netcat/dist/netcat.c ============================================================================== --- vendor/netcat/dist/netcat.c Mon Apr 15 05:19:56 2013 (r249497) +++ vendor/netcat/dist/netcat.c Mon Apr 15 05:24:43 2013 (r249498) @@ -1,4 +1,4 @@ -/* $OpenBSD: netcat.c,v 1.109 2012/07/07 15:33:02 haesbaert Exp $ */ +/* $OpenBSD: netcat.c,v 1.111 2013/03/20 09:27:56 sthen Exp $ */ /* * Copyright (c) 2001 Eric Jackson * @@ -69,6 +69,7 @@ int dflag; /* detached, no stdin */ unsigned int iflag; /* Interval Flag */ int kflag; /* More than one connect */ int lflag; /* Bind to local port */ +int Nflag; /* shutdown() network socket */ int nflag; /* Don't do name look up */ char *Pflag; /* Proxy username */ char *pflag; /* Localport flag */ @@ -131,7 +132,7 @@ main(int argc, char *argv[]) sv = NULL; while ((ch = getopt(argc, argv, - "46DdhI:i:klnO:P:p:rSs:tT:UuV:vw:X:x:z")) != -1) { + "46DdhI:i:klNnO:P:p:rSs:tT:UuV:vw:X:x:z")) != -1) { switch (ch) { case '4': family = AF_INET; @@ -169,6 +170,9 @@ main(int argc, char *argv[]) case 'l': lflag = 1; break; + case 'N': + Nflag = 1; + break; case 'n': nflag = 1; break; @@ -379,9 +383,10 @@ main(int argc, char *argv[]) len = sizeof(cliaddr); connfd = accept(s, (struct sockaddr *)&cliaddr, &len); - if (connfd == -1) - err(1, "accept"); - + if (connfd == -1) { + /* For now, all errnos are fatal */ + err(1, "accept"); + } if (vflag) report_connect((struct sockaddr *)&cliaddr, len); @@ -770,7 +775,8 @@ readwrite(int nfd) if ((n = read(wfd, buf, plen)) < 0) return; else if (n == 0) { - shutdown(nfd, SHUT_WR); + if (Nflag) + shutdown(nfd, SHUT_WR); pfd[1].fd = -1; pfd[1].events = 0; } else { @@ -1013,6 +1019,7 @@ help(void) \t-i secs\t Delay interval for lines sent, ports scanned\n\ \t-k Keep inbound sockets open for multiple connects\n\ \t-l Listen mode, for inbound connects\n\ + \t-N Shutdown the network socket after EOF on stdin\n\ \t-n Suppress name/port resolutions\n\ \t-O length TCP send buffer length\n\ \t-P proxyuser\tUsername for proxy authentication\n\ @@ -1038,7 +1045,7 @@ void usage(int ret) { fprintf(stderr, - "usage: nc [-46DdhklnrStUuvz] [-I length] [-i interval] [-O length]\n" + "usage: nc [-46DdhklNnrStUuvz] [-I length] [-i interval] [-O length]\n" "\t [-P proxy_username] [-p source_port] [-s source] [-T ToS]\n" "\t [-V rtable] [-w timeout] [-X proxy_protocol]\n" "\t [-x proxy_address[:port]] [destination] [port]\n"); From owner-svn-src-all@FreeBSD.ORG Mon Apr 15 05:32:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 90021CD4; Mon, 15 Apr 2013 05:32:00 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 72C2B2D6; Mon, 15 Apr 2013 05:32:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3F5W0wL086687; Mon, 15 Apr 2013 05:32:00 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3F5Vxin086676; Mon, 15 Apr 2013 05:31:59 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201304150531.r3F5Vxin086676@svn.freebsd.org> From: Xin LI Date: Mon, 15 Apr 2013 05:31:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249499 - head/contrib/netcat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Apr 2013 05:32:00 -0000 Author: delphij Date: Mon Apr 15 05:31:59 2013 New Revision: 249499 URL: http://svnweb.freebsd.org/changeset/base/249499 Log: MFV r249496,249498. The most visible change is that we no longer shuts down the connection when stdin closes, by default. This matches Hobbit's original netcat and GNU netcat. Old behavior can be restored with the new -N flag. MFC after: 2 weeks Modified: head/contrib/netcat/atomicio.c head/contrib/netcat/nc.1 head/contrib/netcat/netcat.c Directory Properties: head/contrib/netcat/ (props changed) Modified: head/contrib/netcat/atomicio.c ============================================================================== --- head/contrib/netcat/atomicio.c Mon Apr 15 05:24:43 2013 (r249498) +++ head/contrib/netcat/atomicio.c Mon Apr 15 05:31:59 2013 (r249499) @@ -1,4 +1,4 @@ -/* $OpenBSD: atomicio.c,v 1.10 2011/01/08 00:47:19 jeremy Exp $ */ +/* $OpenBSD: atomicio.c,v 1.11 2012/12/04 02:24:47 deraadt Exp $ */ /* * Copyright (c) 2006 Damien Miller. All rights reserved. * Copyright (c) 2005 Anil Madhavapeddy. All rights reserved. @@ -26,8 +26,6 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include - #include #include #include Modified: head/contrib/netcat/nc.1 ============================================================================== --- head/contrib/netcat/nc.1 Mon Apr 15 05:24:43 2013 (r249498) +++ head/contrib/netcat/nc.1 Mon Apr 15 05:31:59 2013 (r249499) @@ -1,4 +1,4 @@ -.\" $OpenBSD: nc.1,v 1.61 2012/07/07 15:33:02 haesbaert Exp $ +.\" $OpenBSD: nc.1,v 1.62 2013/03/20 09:27:56 sthen Exp $ .\" .\" Copyright (c) 1996 David Sacerdote .\" All rights reserved. @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 7, 2012 +.Dd July 7, 2012 .Dt NC 1 .Os .Sh NAME @@ -36,7 +36,7 @@ .Sh SYNOPSIS .Nm nc .Bk -words -.Op Fl 46DdEhklnrStUuvz +.Op Fl 46DdEhklNnrStUuvz .Op Fl e Ar IPsec_policy .Op Fl I Ar length .Op Fl i Ar interval @@ -155,6 +155,10 @@ options. Additionally, any timeouts specified with the .Fl w option are ignored. +.It Fl N +.Xr shutdown 2 +the network socket after EOF on the input. +Some servers require this to finish their work. .It Fl n Do not do any DNS or service lookups on any specified addresses, hostnames or ports. Modified: head/contrib/netcat/netcat.c ============================================================================== --- head/contrib/netcat/netcat.c Mon Apr 15 05:24:43 2013 (r249498) +++ head/contrib/netcat/netcat.c Mon Apr 15 05:31:59 2013 (r249499) @@ -1,4 +1,4 @@ -/* $OpenBSD: netcat.c,v 1.109 2012/07/07 15:33:02 haesbaert Exp $ */ +/* $OpenBSD: netcat.c,v 1.111 2013/03/20 09:27:56 sthen Exp $ */ /* * Copyright (c) 2001 Eric Jackson * @@ -77,6 +77,7 @@ int dflag; /* detached, no stdin */ unsigned int iflag; /* Interval Flag */ int kflag; /* More than one connect */ int lflag; /* Bind to local port */ +int Nflag; /* shutdown() network socket */ int nflag; /* Don't do name look up */ int FreeBSD_Oflag; /* Do not use TCP options */ char *Pflag; /* Proxy username */ @@ -153,7 +154,7 @@ main(int argc, char *argv[]) sv = NULL; while ((ch = getopt_long(argc, argv, - "46DdEe:hI:i:klnoO:P:p:rSs:tT:UuV:vw:X:x:z", + "46DdEe:hI:i:klNnoO:P:p:rSs:tT:UuV:vw:X:x:z", longopts, NULL)) != -1) { switch (ch) { case '4': @@ -207,6 +208,9 @@ main(int argc, char *argv[]) case 'l': lflag = 1; break; + case 'N': + Nflag = 1; + break; case 'n': nflag = 1; break; @@ -424,9 +428,10 @@ main(int argc, char *argv[]) len = sizeof(cliaddr); connfd = accept(s, (struct sockaddr *)&cliaddr, &len); - if (connfd == -1) - err(1, "accept"); - + if (connfd == -1) { + /* For now, all errnos are fatal */ + err(1, "accept"); + } if (vflag) report_connect((struct sockaddr *)&cliaddr, len); @@ -833,7 +838,8 @@ readwrite(int nfd) if ((n = read(wfd, buf, plen)) < 0) return; else if (n == 0) { - shutdown(nfd, SHUT_WR); + if (Nflag) + shutdown(nfd, SHUT_WR); pfd[1].fd = -1; pfd[1].events = 0; } else { @@ -1087,6 +1093,7 @@ help(void) \t-i secs\t Delay interval for lines sent, ports scanned\n\ \t-k Keep inbound sockets open for multiple connects\n\ \t-l Listen mode, for inbound connects\n\ + \t-N Shutdown the network socket after EOF on stdin\n\ \t-n Suppress name/port resolutions\n\ \t--no-tcpopt Disable TCP options\n\ \t-O length TCP send buffer length\n\ @@ -1139,9 +1146,9 @@ usage(int ret) { fprintf(stderr, #ifdef IPSEC - "usage: nc [-46DdEhklnrStUuvz] [-e policy] [-I length] [-i interval] [-O length]\n" + "usage: nc [-46DdEhklNnrStUuvz] [-e policy] [-I length] [-i interval] [-O length]\n" #else - "usage: nc [-46DdhklnrStUuvz] [-I length] [-i interval] [-O length]\n" + "usage: nc [-46DdhklNnrStUuvz] [-I length] [-i interval] [-O length]\n" #endif "\t [-P proxy_username] [-p source_port] [-s source] [-T ToS]\n" "\t [-V rtable] [-w timeout] [-X proxy_protocol]\n" From owner-svn-src-all@FreeBSD.ORG Mon Apr 15 05:39:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 54B8AEE0; Mon, 15 Apr 2013 05:39:22 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 464C5321; Mon, 15 Apr 2013 05:39:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3F5dMFj087725; Mon, 15 Apr 2013 05:39:22 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3F5dMgk087724; Mon, 15 Apr 2013 05:39:22 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201304150539.r3F5dMgk087724@svn.freebsd.org> From: Xin LI Date: Mon, 15 Apr 2013 05:39:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249500 - head/sbin/growfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Apr 2013 05:39:22 -0000 Author: delphij Date: Mon Apr 15 05:39:21 2013 New Revision: 249500 URL: http://svnweb.freebsd.org/changeset/base/249500 Log: Use arc4random() instead of random(). MFC after: 2 weeks Modified: head/sbin/growfs/growfs.c Modified: head/sbin/growfs/growfs.c ============================================================================== --- head/sbin/growfs/growfs.c Mon Apr 15 05:31:59 2013 (r249499) +++ head/sbin/growfs/growfs.c Mon Apr 15 05:39:21 2013 (r249500) @@ -141,14 +141,9 @@ growfs(int fsi, int fso, unsigned int Nf uint cylno; int i, j, width; char tmpbuf[100]; - static int randinit = 0; DBG_ENTER; - if (!randinit) { - randinit = 1; - srandomdev(); - } time(&modtime); /* @@ -407,7 +402,7 @@ initcg(int cylno, time_t modtime, int fs i += sblock.fs_frag) { dp1 = (struct ufs1_dinode *)(void *)iobuf; for (j = 0; j < INOPB(&sblock); j++) { - dp1->di_gen = random(); + dp1->di_gen = arc4random(); dp1++; } wtfs(fsbtodb(&sblock, cgimin(&sblock, cylno) + i), From owner-svn-src-all@FreeBSD.ORG Mon Apr 15 05:50:10 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 586BC2B9; Mon, 15 Apr 2013 05:50:10 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2EF0B38D; Mon, 15 Apr 2013 05:50:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3F5oApw090809; Mon, 15 Apr 2013 05:50:10 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3F5oAsp090808; Mon, 15 Apr 2013 05:50:10 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201304150550.r3F5oAsp090808@svn.freebsd.org> From: Xin LI Date: Mon, 15 Apr 2013 05:50:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r249501 - releng/8.4/release/doc/en_US.ISO8859-1/hardware X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Apr 2013 05:50:10 -0000 Author: delphij Date: Mon Apr 15 05:50:09 2013 New Revision: 249501 URL: http://svnweb.freebsd.org/changeset/base/249501 Log: MFS r249495: Fix a few typos. Reviewed by: gjb Approved by: re (hrs) Modified: releng/8.4/release/doc/en_US.ISO8859-1/hardware/article.xml Directory Properties: releng/8.4/release/doc/en_US.ISO8859-1/hardware/ (props changed) Modified: releng/8.4/release/doc/en_US.ISO8859-1/hardware/article.xml ============================================================================== --- releng/8.4/release/doc/en_US.ISO8859-1/hardware/article.xml Mon Apr 15 05:39:21 2013 (r249500) +++ releng/8.4/release/doc/en_US.ISO8859-1/hardware/article.xml Mon Apr 15 05:50:09 2013 (r249501) @@ -171,7 +171,7 @@ There is a wide variety of motherboards available for this architecture. Motherboards using the ISA, VLB, EISA, AGP, and - PCI expansion busses are well-supported. There is some + PCI expansion buses are well-supported. There is some limited support for the MCA (MicroChannel) expansion bus used in the IBM PS/2 line of PCs. @@ -202,7 +202,7 @@ memory above 4 gigabytes and allow it to be used by the system. This feature places constraints on the device drivers and other features of &os; which may be used; consult the - &man.pae.4; manpage for more details. + &man.pae.4; manual page for more details. &os; will generally run on i386-based laptops, albeit with varying levels of support for certain hardware features such @@ -480,7 +480,7 @@ The following systems are partially supported by &os;. In - particular the fibre channel controllers in SBus-based systems are not + particular the fiber channel controllers in SBus-based systems are not supported. However, it is possible to use these with a SCSI controller supported by the &man.esp.4 driver (Sun ESP SCSI, Sun FAS Fast-SCSI and Sun FAS366 Fast-Wide SCSI controllers). From owner-svn-src-all@FreeBSD.ORG Mon Apr 15 06:12:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 11BFB5F4; Mon, 15 Apr 2013 06:12:01 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E8EE7642; Mon, 15 Apr 2013 06:12:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3F6C0kx099135; Mon, 15 Apr 2013 06:12:00 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3F6C0w1099134; Mon, 15 Apr 2013 06:12:00 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201304150612.r3F6C0w1099134@svn.freebsd.org> From: Alan Cox Date: Mon, 15 Apr 2013 06:12:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249502 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Apr 2013 06:12:01 -0000 Author: alc Date: Mon Apr 15 06:12:00 2013 New Revision: 249502 URL: http://svnweb.freebsd.org/changeset/base/249502 Log: Although we perform path compression to reduce the height of the trie and the number of interior nodes, we have previously created a level zero interior node at the root of every non-empty trie, even when that node is not strictly necessary, i.e., it has only one child. This change is the second (and final) step in eliminating those unnecessary level zero interior nodes. Specifically, it updates the deletion and insertion functions so that they do not require a level zero interior node at the root of the trie. For a "buildworld" workload, this change results in a 16.8% reduction in the number of interior nodes allocated and a similar reduction in the average execution time for lookup functions. For example, the average execution time for a call to vm_radix_lookup_ge() is reduced by 22.9%. Reviewed by: attilio, jeff (an earlier version) Sponsored by: EMC / Isilon Storage Division Modified: head/sys/vm/vm_radix.c Modified: head/sys/vm/vm_radix.c ============================================================================== --- head/sys/vm/vm_radix.c Mon Apr 15 05:50:09 2013 (r249501) +++ head/sys/vm/vm_radix.c Mon Apr 15 06:12:00 2013 (r249502) @@ -396,7 +396,8 @@ void vm_radix_insert(struct vm_radix *rtree, vm_page_t page) { vm_pindex_t index, newind; - struct vm_radix_node *parent, *rnode, *tmp; + void **parentp; + struct vm_radix_node *rnode, *tmp; vm_page_t m; int slot; uint16_t clev; @@ -409,34 +410,34 @@ vm_radix_insert(struct vm_radix *rtree, */ rnode = vm_radix_getroot(rtree); if (rnode == NULL) { - rnode = vm_radix_node_get(0, 1, 0); - vm_radix_setroot(rtree, rnode); - vm_radix_addpage(rnode, index, 0, page); + rtree->rt_root = (uintptr_t)page | VM_RADIX_ISLEAF; return; } - do { - slot = vm_radix_slot(index, rnode->rn_clev); - if (vm_radix_isleaf(rnode->rn_child[slot])) { - m = vm_radix_topage(rnode->rn_child[slot]); + parentp = (void **)&rtree->rt_root; + for (;;) { + if (vm_radix_isleaf(rnode)) { + m = vm_radix_topage(rnode); if (m->pindex == index) panic("%s: key %jx is already present", __func__, (uintmax_t)index); clev = vm_radix_keydiff(m->pindex, index); tmp = vm_radix_node_get(vm_radix_trimkey(index, clev - 1), 2, clev); - rnode->rn_child[slot] = tmp; + *parentp = tmp; vm_radix_addpage(tmp, index, clev, page); vm_radix_addpage(tmp, m->pindex, clev, m); return; - } + } else if (vm_radix_keybarr(rnode, index)) + break; + slot = vm_radix_slot(index, rnode->rn_clev); if (rnode->rn_child[slot] == NULL) { rnode->rn_count++; vm_radix_addpage(rnode, index, rnode->rn_clev, page); return; } - parent = rnode; + parentp = &rnode->rn_child[slot]; rnode = rnode->rn_child[slot]; - } while (!vm_radix_keybarr(rnode, index)); + } /* * A new node is needed because the right insertion level is reached. @@ -447,7 +448,7 @@ vm_radix_insert(struct vm_radix *rtree, clev = vm_radix_keydiff(newind, index); tmp = vm_radix_node_get(vm_radix_trimkey(index, clev - 1), 2, clev); - parent->rn_child[slot] = tmp; + *parentp = tmp; vm_radix_addpage(tmp, index, clev, page); slot = vm_radix_slot(newind, clev); tmp->rn_child[slot] = rnode; @@ -694,8 +695,15 @@ vm_radix_remove(struct vm_radix *rtree, vm_page_t m; int i, slot; - parent = NULL; rnode = vm_radix_getroot(rtree); + if (vm_radix_isleaf(rnode)) { + m = vm_radix_topage(rnode); + if (m->pindex != index) + panic("%s: invalid key found", __func__); + vm_radix_setroot(rtree, NULL); + return; + } + parent = NULL; for (;;) { if (rnode == NULL) panic("vm_radix_remove: impossible to locate the key"); @@ -708,22 +716,19 @@ vm_radix_remove(struct vm_radix *rtree, rnode->rn_count--; if (rnode->rn_count > 1) break; - if (parent == NULL) { - if (rnode->rn_count == 0) { - vm_radix_node_put(rnode); - vm_radix_setroot(rtree, NULL); - } - break; - } for (i = 0; i < VM_RADIX_COUNT; i++) if (rnode->rn_child[i] != NULL) break; KASSERT(i != VM_RADIX_COUNT, ("%s: invalid node configuration", __func__)); - slot = vm_radix_slot(index, parent->rn_clev); - KASSERT(parent->rn_child[slot] == rnode, - ("%s: invalid child value", __func__)); - parent->rn_child[slot] = rnode->rn_child[i]; + if (parent == NULL) + vm_radix_setroot(rtree, rnode->rn_child[i]); + else { + slot = vm_radix_slot(index, parent->rn_clev); + KASSERT(parent->rn_child[slot] == rnode, + ("%s: invalid child value", __func__)); + parent->rn_child[slot] = rnode->rn_child[i]; + } rnode->rn_count--; rnode->rn_child[i] = NULL; vm_radix_node_put(rnode); @@ -748,7 +753,8 @@ vm_radix_reclaim_allnodes(struct vm_radi if (root == NULL) return; vm_radix_setroot(rtree, NULL); - vm_radix_reclaim_allnodes_int(root); + if (!vm_radix_isleaf(root)) + vm_radix_reclaim_allnodes_int(root); } #ifdef DDB From owner-svn-src-all@FreeBSD.ORG Mon Apr 15 07:01:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4AB0FC6E; Mon, 15 Apr 2013 07:01:22 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3C865845; Mon, 15 Apr 2013 07:01:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3F71MaA013907; Mon, 15 Apr 2013 07:01:22 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3F71LI5013899; Mon, 15 Apr 2013 07:01:21 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201304150701.r3F71LI5013899@svn.freebsd.org> From: Baptiste Daroussin Date: Mon, 15 Apr 2013 07:01:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249503 - in stable/9: . share/examples share/examples/cvsup X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Apr 2013 07:01:22 -0000 Author: bapt Date: Mon Apr 15 07:01:20 2013 New Revision: 249503 URL: http://svnweb.freebsd.org/changeset/base/249503 Log: MFC: r248151, r248168 Ports are no more exported via cvsup, remove cvsup examples and documentation refering to ports Deleted: stable/9/share/examples/cvsup/ports-supfile stable/9/share/examples/cvsup/refuse stable/9/share/examples/cvsup/refuse.README Modified: stable/9/ObsoleteFiles.inc stable/9/share/examples/Makefile stable/9/share/examples/cvsup/README stable/9/share/examples/cvsup/cvs-supfile stable/9/share/examples/cvsup/stable-supfile Directory Properties: stable/9/share/examples/ (props changed) stable/9/share/examples/cvsup/ (props changed) Modified: stable/9/ObsoleteFiles.inc ============================================================================== --- stable/9/ObsoleteFiles.inc Mon Apr 15 06:12:00 2013 (r249502) +++ stable/9/ObsoleteFiles.inc Mon Apr 15 07:01:20 2013 (r249503) @@ -38,6 +38,10 @@ # xargs -n1 | sort | uniq -d; # done +# 20130415: Ports are no more available via cvsup +OLD_FILES+=usr/share/examples/cvsup/ports-supfile +OLD_FILES+=usr/share/examples/cvsup/refuse +OLD_FILES+=usr/share/examples/cvsup/refuse.README # 20130315: removed long unused directories for .1aout section manpages OLD_FILES+=usr/share/man/en.ISO8859-1/man1aout OLD_FILES+=usr/share/man/en.UTF-8/man1aout Modified: stable/9/share/examples/Makefile ============================================================================== --- stable/9/share/examples/Makefile Mon Apr 15 06:12:00 2013 (r249502) +++ stable/9/share/examples/Makefile Mon Apr 15 07:01:20 2013 (r249503) @@ -54,9 +54,6 @@ XFILES= BSD_daemon/FreeBSD.pfa \ cvsup/README \ cvsup/cvs-supfile \ cvsup/gnats-supfile \ - cvsup/ports-supfile \ - cvsup/refuse \ - cvsup/refuse.README \ cvsup/stable-supfile \ cvsup/standard-supfile \ diskless/ME \ Modified: stable/9/share/examples/cvsup/README ============================================================================== --- stable/9/share/examples/cvsup/README Mon Apr 15 06:12:00 2013 (r249502) +++ stable/9/share/examples/cvsup/README Mon Apr 15 07:01:20 2013 (r249503) @@ -9,8 +9,6 @@ To maintain the sources for the FreeBSD- standard-supfile Main source tree - ports-supfile Ports collection - To maintain the sources for the FreeBSD-stable release, use: stable-supfile Main source tree @@ -18,7 +16,7 @@ To maintain the sources for the FreeBSD- To maintain a copy of the CVS repository containing all versions of FreeBSD, use: - cvs-supfile Main source tree and ports collection + cvs-supfile Main source tree collection To maintain a copy of the FreeBSD bug database, use the file: Modified: stable/9/share/examples/cvsup/cvs-supfile ============================================================================== --- stable/9/share/examples/cvsup/cvs-supfile Mon Apr 15 06:12:00 2013 (r249502) +++ stable/9/share/examples/cvsup/cvs-supfile Mon Apr 15 07:01:20 2013 (r249503) @@ -36,9 +36,8 @@ # prefix=/home/ncvs # This specifies where to place the requested files. A # setting of "/home/ncvs" will place all of the files -# requested in /home/ncvs (e.g., "/home/ncvs/src/bin", -# "/home/ncvs/ports/archivers"). The prefix directory -# must exist in order to run CVSup. +# requested in /home/ncvs (e.g., "/home/ncvs/src/bin"). +# The prefix directory must exist in order to run CVSup. # Defaults that apply to all the collections # @@ -91,84 +90,6 @@ src-all #src-secure #src-sys-crypto -## Ports Collection. -# -# The easiest way to get the ports tree is to use the "ports-all" -# mega-collection. It includes all of the individual "ports-*" -# collections, -ports-all - -# These are the individual collections that make up "ports-all". If you -# use these, be sure to comment out "ports-all" above and always include -# "ports-base" if you use any of the other individual collections below. -# Your ports may not build correctly without an up-to-date "ports-base". -# -#ports-base -# -#ports-accessibility -#ports-arabic -#ports-archivers -#ports-astro -#ports-audio -#ports-benchmarks -#ports-biology -#ports-cad -#ports-chinese -#ports-comms -#ports-converters -#ports-databases -#ports-deskutils -#ports-devel -#ports-dns -#ports-editors -#ports-emulators -#ports-finance -#ports-french -#ports-ftp -#ports-games -#ports-german -#ports-graphics -#ports-hebrew -#ports-hungarian -#ports-irc -#ports-japanese -#ports-java -#ports-korean -#ports-lang -#ports-mail -#ports-math -#ports-misc -#ports-multimedia -#ports-net -#ports-net-im -#ports-net-mgmt -#ports-net-p2p -#ports-news -#ports-palm -#ports-picobsd -#ports-polish -#ports-ports-mgmt -#ports-portuguese -#ports-print -#ports-russian -#ports-science -#ports-security -#ports-shells -#ports-sysutils -#ports-textproc -#ports-ukrainian -#ports-vietnamese -#ports-www -#ports-x11 -#ports-x11-clocks -#ports-x11-drivers -#ports-x11-fm -#ports-x11-fonts -#ports-x11-servers -#ports-x11-themes -#ports-x11-toolkits -#ports-x11-wm - ## Projects # # This collection retrieves the projects tree of the FreeBSD @@ -186,4 +107,3 @@ cvsroot-all # directories merged into one, and merged commitlogs via symlinks. #cvsroot-common #cvsroot-src -#cvsroot-ports Modified: stable/9/share/examples/cvsup/stable-supfile ============================================================================== --- stable/9/share/examples/cvsup/stable-supfile Mon Apr 15 06:12:00 2013 (r249502) +++ stable/9/share/examples/cvsup/stable-supfile Mon Apr 15 07:01:20 2013 (r249503) @@ -39,21 +39,6 @@ # in "/usr/src" (e.g., "/usr/src/bin", "/usr/src/lib"). # The prefix directory must exist in order to run CVSup. # -############################################################################### -# -# DANGER! WARNING! LOOK OUT! VORSICHT! -# -# If you add any of the ports collections to this file, be sure to -# specify them with a "tag" value set to ".", like this: -# -# ports-all tag=. -# -# If you leave out the "tag=." portion, CVSup will delete all of -# the files in your ports. That is because the ports -# collections do not use the same tags as the main part of the FreeBSD -# source tree. -# -############################################################################### # Defaults that apply to all the collections # From owner-svn-src-all@FreeBSD.ORG Mon Apr 15 11:49:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7AAEF829; Mon, 15 Apr 2013 11:49:17 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6DC0AAA9; Mon, 15 Apr 2013 11:49:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3FBnHcw099021; Mon, 15 Apr 2013 11:49:17 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3FBnHCO099020; Mon, 15 Apr 2013 11:49:17 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201304151149.r3FBnHCO099020@svn.freebsd.org> From: Luigi Rizzo Date: Mon, 15 Apr 2013 11:49:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249504 - head/sys/dev/netmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Apr 2013 11:49:17 -0000 Author: luigi Date: Mon Apr 15 11:49:16 2013 New Revision: 249504 URL: http://svnweb.freebsd.org/changeset/base/249504 Log: fix a bug in the computation of the userspace offset for a give netmap buffer. Submitted by: Hugh Nhan Modified: head/sys/dev/netmap/netmap_mem2.c Modified: head/sys/dev/netmap/netmap_mem2.c ============================================================================== --- head/sys/dev/netmap/netmap_mem2.c Mon Apr 15 07:01:20 2013 (r249503) +++ head/sys/dev/netmap/netmap_mem2.c Mon Apr 15 11:49:16 2013 (r249504) @@ -278,7 +278,7 @@ netmap_obj_offset(struct netmap_obj_pool const char *base = p->lut[i].vaddr; ssize_t relofs = (const char *) vaddr - base; - if (relofs < 0 || relofs > p->_clustsize) + if (relofs < 0 || relofs >= p->_clustsize) continue; ofs = ofs + relofs; From owner-svn-src-all@FreeBSD.ORG Mon Apr 15 12:34:11 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D8102649; Mon, 15 Apr 2013 12:34:11 +0000 (UTC) (envelope-from gprspb@mail.ru) Received: from fallback4.mail.ru (fallback4.mail.ru [94.100.176.42]) by mx1.freebsd.org (Postfix) with ESMTP id 5753DDCC; Mon, 15 Apr 2013 12:34:10 +0000 (UTC) Received: from smtp32.i.mail.ru (smtp32.i.mail.ru [94.100.177.92]) by fallback4.mail.ru (mPOP.Fallback_MX) with ESMTP id C7B691DF1AA; Mon, 15 Apr 2013 16:34:06 +0400 (MSK) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.ru; s=mail2; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=jk6HMpUzNlaZmZyS/lbbOvDhQBerP+xgFqS4s8GJ2iQ=; b=tsALsNi985/KOmzkOA5ZzZIIfkGIjr/teTopA+WFe3ZMD6jUTmD6xxr4GJcoFhgidY18X9++Q+xet8dWBCSrvHnbDNLwFIpkZoaZoE2nUNEqVO/PevJRpj6k44KnrngHW6jR9+W4jy2EWjh2nTss2NL62hU4Y2JDNhK0LFWe1DE=; Received: from [93.185.182.46] (port=26122 helo=gpr.nnz-home.ru) by smtp32.i.mail.ru with esmtpa (envelope-from ) id 1URibe-0002eB-Pl; Mon, 15 Apr 2013 16:33:58 +0400 Received: from gpr by gpr.nnz-home.ru with local (Exim 4.80.1 (FreeBSD)) (envelope-from ) id 1URibW-0007J5-1H; Mon, 15 Apr 2013 16:33:50 +0400 Date: Mon, 15 Apr 2013 16:33:50 +0400 From: Gennady Proskurin To: Tim Kientzle Subject: Re: svn commit: r249484 - head/lib Message-ID: <20130415123349.GA27773@gpr.nnz-home.ru> References: <201304141913.r3EJDqPI095965@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201304141913.r3EJDqPI095965@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam: Not detected X-Mras: Ok Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Apr 2013 12:34:11 -0000 Here is the quote from r231336 commit message: === commit be984b719cbcb225dc4afaf9f52b38fb882a09d3 Author: kientzle Date: Fri Feb 10 05:05:42 2012 +0000 Implement -print-file-name=include (which is undocumented but used by some Linux boot loaders). This option prints out the directory holding the include files needed by a freestanding program. The default implementation of this doesn't work on FreeBSD because of the different include file layout. But it's easy to implement: just return /usr/include (or the cross-compiling equivalent). === It turns out, that now we create useless symlink /usr/lib/include just to ease support of "some Linux boot loaders"? I do not have full knowledge about the issue, so excuse me if I misunderstood something. On Sun, Apr 14, 2013 at 07:13:52PM +0000, Tim Kientzle wrote: > Author: kientzle > Date: Sun Apr 14 19:13:51 2013 > New Revision: 249484 > URL: http://svnweb.freebsd.org/changeset/base/249484 > > Log: > Install a symlink > /usr/lib/include ==> /usr/include > > This fixes -print-file-name=include in clang (and is > arguably a better way to fix the same issue in GCC than > the change I made in r231336). > > MFC after: 1 week > > Modified: > head/lib/Makefile > > Modified: head/lib/Makefile > ============================================================================== > --- head/lib/Makefile Sun Apr 14 18:36:30 2013 (r249483) > +++ head/lib/Makefile Sun Apr 14 19:13:51 2013 (r249484) > @@ -252,4 +252,7 @@ _libusbhid= libusbhid > _libusb= libusb > .endif > > +afterinstall: > + ln -fs ../include ${DESTDIR}/usr/lib/include > + > .include > _______________________________________________ > svn-src-head@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > From owner-svn-src-all@FreeBSD.ORG Mon Apr 15 13:00:43 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 64BBBCA7; Mon, 15 Apr 2013 13:00:43 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5797DEE9; Mon, 15 Apr 2013 13:00:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3FD0g2v021143; Mon, 15 Apr 2013 13:00:42 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3FD0gDV021140; Mon, 15 Apr 2013 13:00:42 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201304151300.r3FD0gDV021140@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 15 Apr 2013 13:00:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249506 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Apr 2013 13:00:43 -0000 Author: glebius Date: Mon Apr 15 13:00:42 2013 New Revision: 249506 URL: http://svnweb.freebsd.org/changeset/base/249506 Log: Switch lagg(4) statistics to counter(9). The lagg(4) is often used to bond high speed links, so basic per-packet += on statistics cause cache misses and statistics loss. Perfect solution would be to convert ifnet(9) to counters(9), but this requires much more work, and unfortunately ABI change, so temporarily patch lagg(4) manually. We store counters in the softc, and once per second push their values to legacy ifnet counters. Sponsored by: Nginx, Inc. Modified: head/sys/net/if_lagg.c head/sys/net/if_lagg.h Modified: head/sys/net/if_lagg.c ============================================================================== --- head/sys/net/if_lagg.c Mon Apr 15 12:16:24 2013 (r249505) +++ head/sys/net/if_lagg.c Mon Apr 15 13:00:42 2013 (r249506) @@ -153,6 +153,8 @@ static struct mbuf *lagg_lacp_input(stru struct mbuf *); static void lagg_lacp_lladdr(struct lagg_softc *); +static void lagg_callout(void *); + /* lagg protocol table */ static const struct { int ti_proto; @@ -278,6 +280,11 @@ lagg_clone_create(struct if_clone *ifc, return (ENOSPC); } + sc->sc_ipackets = counter_u64_alloc(M_WAITOK); + sc->sc_opackets = counter_u64_alloc(M_WAITOK); + sc->sc_ibytes = counter_u64_alloc(M_WAITOK); + sc->sc_obytes = counter_u64_alloc(M_WAITOK); + sysctl_ctx_init(&sc->ctx); snprintf(num, sizeof(num), "%u", unit); sc->use_flowid = def_use_flowid; @@ -307,6 +314,7 @@ lagg_clone_create(struct if_clone *ifc, LAGG_LOCK_INIT(sc); SLIST_INIT(&sc->sc_ports); TASK_INIT(&sc->sc_lladdr_task, 0, lagg_port_setlladdr, sc); + callout_init_rw(&sc->sc_callout, &sc->sc_mtx, CALLOUT_SHAREDLOCK); /* Initialise pseudo media types */ ifmedia_init(&sc->sc_media, 0, lagg_media_change, @@ -338,6 +346,8 @@ lagg_clone_create(struct if_clone *ifc, SLIST_INSERT_HEAD(&lagg_list, sc, sc_entries); mtx_unlock(&lagg_list_mtx); + callout_reset(&sc->sc_callout, hz, lagg_callout, sc); + return (0); } @@ -369,6 +379,12 @@ lagg_clone_destroy(struct ifnet *ifp) ether_ifdetach(ifp); if_free(ifp); + callout_drain(&sc->sc_callout); + counter_u64_free(sc->sc_ipackets); + counter_u64_free(sc->sc_opackets); + counter_u64_free(sc->sc_ibytes); + counter_u64_free(sc->sc_obytes); + mtx_lock(&lagg_list_mtx); SLIST_REMOVE(&lagg_list, sc, lagg_softc, sc_entries); mtx_unlock(&lagg_list_mtx); @@ -1243,9 +1259,9 @@ lagg_transmit(struct ifnet *ifp, struct LAGG_RUNLOCK(sc); if (error == 0) { - ifp->if_opackets++; + counter_u64_add(sc->sc_opackets, 1); + counter_u64_add(sc->sc_obytes, len); ifp->if_omcasts += mcast; - ifp->if_obytes += len; } else ifp->if_oerrors++; @@ -1281,8 +1297,8 @@ lagg_input(struct ifnet *ifp, struct mbu m = (*sc->sc_input)(sc, lp, m); if (m != NULL) { - scifp->if_ipackets++; - scifp->if_ibytes += m->m_pkthdr.len; + counter_u64_add(sc->sc_ipackets, 1); + counter_u64_add(sc->sc_ibytes, m->m_pkthdr.len); if (scifp->if_flags & IFF_MONITOR) { m_freem(m); @@ -1892,3 +1908,17 @@ lagg_lacp_input(struct lagg_softc *sc, s m->m_pkthdr.rcvif = ifp; return (m); } + +static void +lagg_callout(void *arg) +{ + struct lagg_softc *sc = (struct lagg_softc *)arg; + struct ifnet *ifp = sc->sc_ifp; + + ifp->if_ipackets = counter_u64_fetch(sc->sc_ipackets); + ifp->if_opackets = counter_u64_fetch(sc->sc_opackets); + ifp->if_ibytes = counter_u64_fetch(sc->sc_ibytes); + ifp->if_obytes = counter_u64_fetch(sc->sc_obytes); + + callout_reset(&sc->sc_callout, hz, lagg_callout, sc); +} Modified: head/sys/net/if_lagg.h ============================================================================== --- head/sys/net/if_lagg.h Mon Apr 15 12:16:24 2013 (r249505) +++ head/sys/net/if_lagg.h Mon Apr 15 13:00:42 2013 (r249506) @@ -21,8 +21,6 @@ #ifndef _NET_LAGG_H #define _NET_LAGG_H -#include - /* * Global definitions */ @@ -137,6 +135,9 @@ struct lagg_reqflags { #define SIOCSLAGGHASH _IOW('i', 146, struct lagg_reqflags) #ifdef _KERNEL + +#include + /* * Internal kernel part */ @@ -195,6 +196,11 @@ struct lagg_softc { uint32_t sc_seq; /* sequence counter */ uint32_t sc_flags; + counter_u64_t sc_ipackets; + counter_u64_t sc_opackets; + counter_u64_t sc_ibytes; + counter_u64_t sc_obytes; + SLIST_HEAD(__tplhd, lagg_port) sc_ports; /* list of interfaces */ SLIST_ENTRY(lagg_softc) sc_entries; @@ -217,6 +223,7 @@ struct lagg_softc { void (*sc_portreq)(struct lagg_port *, caddr_t); eventhandler_tag vlan_attach; eventhandler_tag vlan_detach; + struct callout sc_callout; struct sysctl_ctx_list ctx; /* sysctl variables */ int use_flowid; /* use M_FLOWID */ }; From owner-svn-src-all@FreeBSD.ORG Mon Apr 15 15:55:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 42ED2D90; Mon, 15 Apr 2013 15:55:41 +0000 (UTC) (envelope-from ivoras@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 359819D0; Mon, 15 Apr 2013 15:55:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3FFtfFv075595; Mon, 15 Apr 2013 15:55:41 GMT (envelope-from ivoras@svn.freebsd.org) Received: (from ivoras@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3FFtebI075592; Mon, 15 Apr 2013 15:55:40 GMT (envelope-from ivoras@svn.freebsd.org) Message-Id: <201304151555.r3FFtebI075592@svn.freebsd.org> From: Ivan Voras Date: Mon, 15 Apr 2013 15:55:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249507 - head/sys/geom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Apr 2013 15:55:41 -0000 Author: ivoras Date: Mon Apr 15 15:55:40 2013 New Revision: 249507 URL: http://svnweb.freebsd.org/changeset/base/249507 Log: Introduce a symbol for the GEOM class name instead of using the ad-hoc string constant. Modified: head/sys/geom/geom_disk.c head/sys/geom/geom_disk.h head/sys/geom/geom_dump.c Modified: head/sys/geom/geom_disk.c ============================================================================== --- head/sys/geom/geom_disk.c Mon Apr 15 13:00:42 2013 (r249506) +++ head/sys/geom/geom_disk.c Mon Apr 15 15:55:40 2013 (r249507) @@ -75,7 +75,7 @@ static g_dumpconf_t g_disk_dumpconf; static g_provgone_t g_disk_providergone; static struct g_class g_disk_class = { - .name = "DISK", + .name = G_DISK_CLASS_NAME, .version = G_VERSION, .start = g_disk_start, .access = g_disk_access, Modified: head/sys/geom/geom_disk.h ============================================================================== --- head/sys/geom/geom_disk.h Mon Apr 15 13:00:42 2013 (r249506) +++ head/sys/geom/geom_disk.h Mon Apr 15 15:55:40 2013 (r249507) @@ -44,6 +44,8 @@ #include #include +#define G_DISK_CLASS_NAME "DISK" + struct disk; typedef int disk_open_t(struct disk *); Modified: head/sys/geom/geom_dump.c ============================================================================== --- head/sys/geom/geom_dump.c Mon Apr 15 13:00:42 2013 (r249506) +++ head/sys/geom/geom_dump.c Mon Apr 15 15:55:40 2013 (r249507) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include static void @@ -146,7 +147,7 @@ g_conftxt(void *p, int flag) sb = p; g_topology_assert(); LIST_FOREACH(mp, &g_classes, class) { - if (!strcmp(mp->name, "DISK") || !strcmp(mp->name, "MD")) + if (!strcmp(mp->name, G_DISK_CLASS_NAME) || !strcmp(mp->name, "MD")) g_conftxt_class(sb, mp); } sbuf_finish(sb); From owner-svn-src-all@FreeBSD.ORG Mon Apr 15 16:09:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3503ECE; Mon, 15 Apr 2013 16:09:26 +0000 (UTC) (envelope-from ivoras@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 17696A6A; Mon, 15 Apr 2013 16:09:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3FG9POn079486; Mon, 15 Apr 2013 16:09:25 GMT (envelope-from ivoras@svn.freebsd.org) Received: (from ivoras@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3FG9Oga079482; Mon, 15 Apr 2013 16:09:24 GMT (envelope-from ivoras@svn.freebsd.org) Message-Id: <201304151609.r3FG9Oga079482@svn.freebsd.org> From: Ivan Voras Date: Mon, 15 Apr 2013 16:09:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249508 - in head/sys: conf geom/label X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Apr 2013 16:09:26 -0000 Author: ivoras Date: Mon Apr 15 16:09:24 2013 New Revision: 249508 URL: http://svnweb.freebsd.org/changeset/base/249508 Log: Introduce glabel labels based on GEOM ident attributes. In this initial implementation, error on the side of conservatism and only create labels for GEOMs of classes DISK and MULTIPATH. Discussed with: trasz Approved by: silence from freebsd-geom@ Added: head/sys/geom/label/g_label_disk_ident.c (contents, props changed) Modified: head/sys/conf/files head/sys/geom/label/g_label.c head/sys/geom/label/g_label.h Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Apr 15 15:55:40 2013 (r249507) +++ head/sys/conf/files Mon Apr 15 16:09:24 2013 (r249508) @@ -2495,6 +2495,7 @@ geom/label/g_label_ntfs.c optional geom_ geom/label/g_label_reiserfs.c optional geom_label geom/label/g_label_ufs.c optional geom_label geom/label/g_label_gpt.c optional geom_label +geom/label/g_label_disk_ident.c optional geom_label geom/linux_lvm/g_linux_lvm.c optional geom_linux_lvm geom/mirror/g_mirror.c optional geom_mirror geom/mirror/g_mirror_ctl.c optional geom_mirror Modified: head/sys/geom/label/g_label.c ============================================================================== --- head/sys/geom/label/g_label.c Mon Apr 15 15:55:40 2013 (r249507) +++ head/sys/geom/label/g_label.c Mon Apr 15 16:09:24 2013 (r249508) @@ -89,6 +89,7 @@ const struct g_label_desc *g_labels[] = &g_label_ntfs, &g_label_gpt, &g_label_gpt_uuid, + &g_label_disk_ident, NULL }; @@ -339,7 +340,7 @@ g_label_taste(struct g_class *mp, struct pp->mediasize - pp->sectorsize); } while (0); for (i = 0; g_labels[i] != NULL; i++) { - char label[64]; + char label[128]; if (g_labels[i]->ld_enabled == 0) continue; Modified: head/sys/geom/label/g_label.h ============================================================================== --- head/sys/geom/label/g_label.h Mon Apr 15 15:55:40 2013 (r249507) +++ head/sys/geom/label/g_label.h Mon Apr 15 16:09:24 2013 (r249508) @@ -87,6 +87,7 @@ extern struct g_label_desc g_label_reise extern struct g_label_desc g_label_ntfs; extern struct g_label_desc g_label_gpt; extern struct g_label_desc g_label_gpt_uuid; +extern struct g_label_desc g_label_disk_ident; #endif /* _KERNEL */ struct g_label_metadata { Added: head/sys/geom/label/g_label_disk_ident.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/geom/label/g_label_disk_ident.c Mon Apr 15 16:09:24 2013 (r249508) @@ -0,0 +1,84 @@ +/*- + * Copyright (c) 2012 Ivan Voras + * 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include +#include +#include +#include + + +#define G_LABEL_DISK_IDENT_DIR "diskid" + +static char* classes_pass[] = { G_DISK_CLASS_NAME, G_MULTIPATH_CLASS_NAME, NULL }; + +static void +g_label_disk_ident_taste(struct g_consumer *cp, char *label, size_t size) +{ + struct g_class *cls; + char ident[100]; + int ident_len = sizeof(ident); + + g_topology_assert_not(); + label[0] = '\0'; + + cls = cp->provider->geom->class; + + /* Get the GEOM::ident string and construct a label in the format CLASS_NAME-ident */ + if (g_io_getattr("GEOM::ident", cp, &ident_len, ident) == 0) { + int i, found = 0; + + if (ident_len == 0 || ident[0] == '\0') + return; + for (i = 0; classes_pass[i] != NULL; i++) + if (strcmp(classes_pass[i], cls->name) == 0) + found = 1; + if (!found) + return; + if (strlen(cls->name) + ident_len + 2 > size) + ident[ident_len - strlen(cls->name) - 2] = '\0'; + else + ident[ident_len] = '\0'; + strcpy(label, cls->name); + strcat(label, "-"); + strcat(label, ident); + } +} + +struct g_label_desc g_label_disk_ident = { + .ld_taste = g_label_disk_ident_taste, + .ld_dir = G_LABEL_DISK_IDENT_DIR, + .ld_enabled = 1 +}; + +G_LABEL_INIT(disk_ident, g_label_disk_ident, "Create device nodes for drives which export a disk identification string"); From owner-svn-src-all@FreeBSD.ORG Mon Apr 15 16:11:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2F92528A; Mon, 15 Apr 2013 16:11:37 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from mail.ipfw.ru (unknown [IPv6:2a01:4f8:120:6141::2]) by mx1.freebsd.org (Postfix) with ESMTP id 9D31BA8F; Mon, 15 Apr 2013 16:11:36 +0000 (UTC) Received: from dhcp170-36-red.yandex.net ([95.108.170.36]) by mail.ipfw.ru with esmtpsa (TLSv1:CAMELLIA256-SHA:256) (Exim 4.76 (FreeBSD)) (envelope-from ) id 1URm3b-000Cy6-Uk; Mon, 15 Apr 2013 20:15:04 +0400 Message-ID: <516C2694.9090906@FreeBSD.org> Date: Mon, 15 Apr 2013 20:11:00 +0400 From: "Alexander V. Chernikov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Gleb Smirnoff Subject: Re: svn commit: r249506 - head/sys/net References: <201304151300.r3FD0gDV021140@svn.freebsd.org> In-Reply-To: <201304151300.r3FD0gDV021140@svn.freebsd.org> X-Enigmail-Version: 1.4.6 Content-Type: multipart/mixed; boundary="------------020404010101070001050708" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Apr 2013 16:11:37 -0000 This is a multi-part message in MIME format. --------------020404010101070001050708 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 15.04.2013 17:00, Gleb Smirnoff wrote: > Author: glebius > Date: Mon Apr 15 13:00:42 2013 > New Revision: 249506 > URL: http://svnweb.freebsd.org/changeset/base/249506 > > Log: > Switch lagg(4) statistics to counter(9). > > The lagg(4) is often used to bond high speed links, so basic per-packet += > on statistics cause cache misses and statistics loss. Lagg is probably the only interface where we really do not need to account (most) per-packet traffic. It is probably better to import statistics from underlying interfaces with callout. Additionally, this approach allows us not to use lagg RX path at all skipping lock (reference patch to ixgbe in the -net@ follows). > > Perfect solution would be to convert ifnet(9) to counters(9), but this > requires much more work, and unfortunately ABI change, so temporarily > patch lagg(4) manually. > > We store counters in the softc, and once per second push their values > to legacy ifnet counters. > > Sponsored by: Nginx, Inc. > > Modified: > head/sys/net/if_lagg.c > head/sys/net/if_lagg.h > > Modified: head/sys/net/if_lagg.c > ============================================================================== > --- head/sys/net/if_lagg.c Mon Apr 15 12:16:24 2013 (r249505) > +++ head/sys/net/if_lagg.c Mon Apr 15 13:00:42 2013 (r249506) > @@ -153,6 +153,8 @@ static struct mbuf *lagg_lacp_input(stru > struct mbuf *); > static void lagg_lacp_lladdr(struct lagg_softc *); > > +static void lagg_callout(void *); > + > /* lagg protocol table */ > static const struct { > int ti_proto; > @@ -278,6 +280,11 @@ lagg_clone_create(struct if_clone *ifc, > return (ENOSPC); > } > > + sc->sc_ipackets = counter_u64_alloc(M_WAITOK); > + sc->sc_opackets = counter_u64_alloc(M_WAITOK); > + sc->sc_ibytes = counter_u64_alloc(M_WAITOK); > + sc->sc_obytes = counter_u64_alloc(M_WAITOK); > + > sysctl_ctx_init(&sc->ctx); > snprintf(num, sizeof(num), "%u", unit); > sc->use_flowid = def_use_flowid; > @@ -307,6 +314,7 @@ lagg_clone_create(struct if_clone *ifc, > LAGG_LOCK_INIT(sc); > SLIST_INIT(&sc->sc_ports); > TASK_INIT(&sc->sc_lladdr_task, 0, lagg_port_setlladdr, sc); > + callout_init_rw(&sc->sc_callout, &sc->sc_mtx, CALLOUT_SHAREDLOCK); > > /* Initialise pseudo media types */ > ifmedia_init(&sc->sc_media, 0, lagg_media_change, > @@ -338,6 +346,8 @@ lagg_clone_create(struct if_clone *ifc, > SLIST_INSERT_HEAD(&lagg_list, sc, sc_entries); > mtx_unlock(&lagg_list_mtx); > > + callout_reset(&sc->sc_callout, hz, lagg_callout, sc); > + > return (0); > } > > @@ -369,6 +379,12 @@ lagg_clone_destroy(struct ifnet *ifp) > ether_ifdetach(ifp); > if_free(ifp); > > + callout_drain(&sc->sc_callout); > + counter_u64_free(sc->sc_ipackets); > + counter_u64_free(sc->sc_opackets); > + counter_u64_free(sc->sc_ibytes); > + counter_u64_free(sc->sc_obytes); > + > mtx_lock(&lagg_list_mtx); > SLIST_REMOVE(&lagg_list, sc, lagg_softc, sc_entries); > mtx_unlock(&lagg_list_mtx); > @@ -1243,9 +1259,9 @@ lagg_transmit(struct ifnet *ifp, struct > LAGG_RUNLOCK(sc); > > if (error == 0) { > - ifp->if_opackets++; > + counter_u64_add(sc->sc_opackets, 1); > + counter_u64_add(sc->sc_obytes, len); > ifp->if_omcasts += mcast; > - ifp->if_obytes += len; > } else > ifp->if_oerrors++; > > @@ -1281,8 +1297,8 @@ lagg_input(struct ifnet *ifp, struct mbu > m = (*sc->sc_input)(sc, lp, m); > > if (m != NULL) { > - scifp->if_ipackets++; > - scifp->if_ibytes += m->m_pkthdr.len; > + counter_u64_add(sc->sc_ipackets, 1); > + counter_u64_add(sc->sc_ibytes, m->m_pkthdr.len); > > if (scifp->if_flags & IFF_MONITOR) { > m_freem(m); > @@ -1892,3 +1908,17 @@ lagg_lacp_input(struct lagg_softc *sc, s > m->m_pkthdr.rcvif = ifp; > return (m); > } > + > +static void > +lagg_callout(void *arg) > +{ > + struct lagg_softc *sc = (struct lagg_softc *)arg; > + struct ifnet *ifp = sc->sc_ifp; > + > + ifp->if_ipackets = counter_u64_fetch(sc->sc_ipackets); > + ifp->if_opackets = counter_u64_fetch(sc->sc_opackets); > + ifp->if_ibytes = counter_u64_fetch(sc->sc_ibytes); > + ifp->if_obytes = counter_u64_fetch(sc->sc_obytes); > + > + callout_reset(&sc->sc_callout, hz, lagg_callout, sc); > +} > > Modified: head/sys/net/if_lagg.h > ============================================================================== > --- head/sys/net/if_lagg.h Mon Apr 15 12:16:24 2013 (r249505) > +++ head/sys/net/if_lagg.h Mon Apr 15 13:00:42 2013 (r249506) > @@ -21,8 +21,6 @@ > #ifndef _NET_LAGG_H > #define _NET_LAGG_H > > -#include > - > /* > * Global definitions > */ > @@ -137,6 +135,9 @@ struct lagg_reqflags { > #define SIOCSLAGGHASH _IOW('i', 146, struct lagg_reqflags) > > #ifdef _KERNEL > + > +#include > + > /* > * Internal kernel part > */ > @@ -195,6 +196,11 @@ struct lagg_softc { > uint32_t sc_seq; /* sequence counter */ > uint32_t sc_flags; > > + counter_u64_t sc_ipackets; > + counter_u64_t sc_opackets; > + counter_u64_t sc_ibytes; > + counter_u64_t sc_obytes; > + > SLIST_HEAD(__tplhd, lagg_port) sc_ports; /* list of interfaces */ > SLIST_ENTRY(lagg_softc) sc_entries; > > @@ -217,6 +223,7 @@ struct lagg_softc { > void (*sc_portreq)(struct lagg_port *, caddr_t); > eventhandler_tag vlan_attach; > eventhandler_tag vlan_detach; > + struct callout sc_callout; > struct sysctl_ctx_list ctx; /* sysctl variables */ > int use_flowid; /* use M_FLOWID */ > }; > -- WBR, Alexander --------------020404010101070001050708 Content-Type: text/plain; charset=UTF-8; name="if_lagg.diff" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="if_lagg.diff" SW5kZXg6IHN5cy9uZXQvaWZfbGFnZy5jCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIHN5cy9uZXQvaWZf bGFnZy5jCShyZXZpc2lvbiAyNDg3MDQpCisrKyBzeXMvbmV0L2lmX2xhZ2cuYwkod29ya2lu ZyBjb3B5KQpAQCAtMjYxLDYgKzI2MSw0MSBAQCBsYWdnX3VucmVnaXN0ZXJfdmxhbih2b2lk ICphcmcsIHN0cnVjdCBpZm5ldCAqaWZwLAogICAgICAgICBMQUdHX1JVTkxPQ0soc2MpOwog fQogCisjZGVmaW5lCUxBR0dfVVBEQVRFX0NPVU5URVIoX25hbWUpCWRvIHsJCVwKKwlpZiAo cF9pZnAtPmlmX2RhdGEuX25hbWUgPj0gbHAtPl9uYW1lKSB7CVwKKwkJaSA9IHBfaWZwLT5p Zl9kYXRhLl9uYW1lIC0gbHAtPl9uYW1lOwlcCisJCWxhZ2dfaWZwLT5pZl9kYXRhLl9uYW1l ICs9IGk7CQlcCisJCWxwLT5fbmFtZSArPSBpOwkJCQlcCisJfSBlbHNlIAkJCQkJCVwKKwkJ bHAtPl9uYW1lID0gcF9pZnAtPmlmX2RhdGEuX25hbWU7CVwKK30gd2hpbGUgKDApCisKK3N0 YXRpYyB2b2lkCitsYWdnX3VwZGF0ZV9jb3VudGVycyh2b2lkICphcmcpCit7CisJc3RydWN0 IGxhZ2dfc29mdGMJKnNjID0gYXJnOworICAgICAgICBzdHJ1Y3QgbGFnZ19wb3J0ICAgICAg ICAqbHA7CisJc3RydWN0IGlmbmV0CQkqbGFnZ19pZnAsICpwX2lmcDsKKwl1X2xvbmcgaTsK KworCWxhZ2dfaWZwID0gc2MtPnNjX2lmcDsKKworCUxBR0dfUkxPQ0soc2MpOworCisJU0xJ U1RfRk9SRUFDSChscCwgJnNjLT5zY19wb3J0cywgbHBfZW50cmllcykgeworCQlwX2lmcCA9 IGxwLT5scF9pZnA7CisKKwkJTEFHR19VUERBVEVfQ09VTlRFUihpZmlfaXBhY2tldHMpOwor CQlMQUdHX1VQREFURV9DT1VOVEVSKGlmaV9vcGFja2V0cyk7CisJCUxBR0dfVVBEQVRFX0NP VU5URVIoaWZpX2lieXRlcyk7CisJCUxBR0dfVVBEQVRFX0NPVU5URVIoaWZpX29ieXRlcyk7 CisJfQorCisJTEFHR19SVU5MT0NLKHNjKTsKKworCWNhbGxvdXRfcmVzZXQoJnNjLT5jb3Vu dGVyc19zeW5jLCBoeiwgbGFnZ191cGRhdGVfY291bnRlcnMsIHNjKTsKK30KKwogc3RhdGlj IGludAogbGFnZ19jbG9uZV9jcmVhdGUoc3RydWN0IGlmX2Nsb25lICppZmMsIGludCB1bml0 LCBjYWRkcl90IHBhcmFtcykKIHsKQEAgLTMwNyw2ICszNDIsNyBAQCBsYWdnX2Nsb25lX2Ny ZWF0ZShzdHJ1Y3QgaWZfY2xvbmUgKmlmYywgaW50IHVuaXQsCiAJTEFHR19MT0NLX0lOSVQo c2MpOwogCVNMSVNUX0lOSVQoJnNjLT5zY19wb3J0cyk7CiAJVEFTS19JTklUKCZzYy0+c2Nf bGxhZGRyX3Rhc2ssIDAsIGxhZ2dfcG9ydF9zZXRsbGFkZHIsIHNjKTsKKwljYWxsb3V0X2lu aXQoJnNjLT5jb3VudGVyc19zeW5jLCAwKTsKIAogCS8qIEluaXRpYWxpc2UgcHNldWRvIG1l ZGlhIHR5cGVzICovCiAJaWZtZWRpYV9pbml0KCZzYy0+c2NfbWVkaWEsIDAsIGxhZ2dfbWVk aWFfY2hhbmdlLApAQCAtMzM4LDYgKzM3NCw4IEBAIGxhZ2dfY2xvbmVfY3JlYXRlKHN0cnVj dCBpZl9jbG9uZSAqaWZjLCBpbnQgdW5pdCwKIAlTTElTVF9JTlNFUlRfSEVBRCgmbGFnZ19s aXN0LCBzYywgc2NfZW50cmllcyk7CiAJbXR4X3VubG9jaygmbGFnZ19saXN0X210eCk7CiAK KwljYWxsb3V0X3Jlc2V0KCZzYy0+Y291bnRlcnNfc3luYywgaHogLyAxMCwgbGFnZ191cGRh dGVfY291bnRlcnMsIHNjKTsKKwogCXJldHVybiAoMCk7CiB9CiAKQEAgLTM0Nyw2ICszODUs OSBAQCBsYWdnX2Nsb25lX2Rlc3Ryb3koc3RydWN0IGlmbmV0ICppZnApCiAJc3RydWN0IGxh Z2dfc29mdGMgKnNjID0gKHN0cnVjdCBsYWdnX3NvZnRjICopaWZwLT5pZl9zb2Z0YzsKIAlz dHJ1Y3QgbGFnZ19wb3J0ICpscDsKIAorCS8qIFN0b3AgY29sbGVjdGluZyBjb3VudGVycyAq LworCWNhbGxvdXRfZHJhaW4oJnNjLT5jb3VudGVyc19zeW5jKTsKKwogCUxBR0dfV0xPQ0so c2MpOwogCiAJbGFnZ19zdG9wKHNjKTsKQEAgLTU3MSw2ICs2MTIsMTIgQEAgbGFnZ19wb3J0 X2NyZWF0ZShzdHJ1Y3QgbGFnZ19zb2Z0YyAqc2MsIHN0cnVjdCBpZm4KIAlscC0+bHBfaWZw ID0gaWZwOwogCWxwLT5scF9zb2Z0YyA9IHNjOwogCisJLyogU2V0IGNvdW50ZXJzICovCisJ bHAtPmlmaV9pYnl0ZXMgPSBpZnAtPmlmX2lieXRlczsKKwlscC0+aWZpX29ieXRlcyA9IGlm cC0+aWZfb2J5dGVzOworCWxwLT5pZmlfaXBhY2tldHMgPSBpZnAtPmlmX2lwYWNrZXRzOwor CWxwLT5pZmlfb3BhY2tldHMgPSBpZnAtPmlmX29wYWNrZXRzOworCiAJLyogU2F2ZSBwb3J0 IGxpbmsgbGF5ZXIgYWRkcmVzcyAqLwogCWJjb3B5KElGX0xMQUREUihpZnApLCBscC0+bHBf bGxhZGRyLCBFVEhFUl9BRERSX0xFTik7CiAKQEAgLTEyNDMsOSArMTI5MCw3IEBAIGxhZ2df dHJhbnNtaXQoc3RydWN0IGlmbmV0ICppZnAsIHN0cnVjdCBtYnVmICptKQogCUxBR0dfUlVO TE9DSyhzYyk7CiAKIAlpZiAoZXJyb3IgPT0gMCkgewotCQlpZnAtPmlmX29wYWNrZXRzKys7 CiAJCWlmcC0+aWZfb21jYXN0cyArPSBtY2FzdDsKLQkJaWZwLT5pZl9vYnl0ZXMgKz0gbGVu OwogCX0gZWxzZQogCQlpZnAtPmlmX29lcnJvcnMrKzsKIApAQCAtMTI4MSw5ICsxMzI2LDYg QEAgbGFnZ19pbnB1dChzdHJ1Y3QgaWZuZXQgKmlmcCwgc3RydWN0IG1idWYgKm0pCiAJbSA9 ICgqc2MtPnNjX2lucHV0KShzYywgbHAsIG0pOwogCiAJaWYgKG0gIT0gTlVMTCkgewotCQlz Y2lmcC0+aWZfaXBhY2tldHMrKzsKLQkJc2NpZnAtPmlmX2lieXRlcyArPSBtLT5tX3BrdGhk ci5sZW47Ci0KIAkJaWYgKHNjaWZwLT5pZl9mbGFncyAmIElGRl9NT05JVE9SKSB7CiAJCQlt X2ZyZWVtKG0pOwogCQkJbSA9IE5VTEw7CkluZGV4OiBzeXMvbmV0L2lmX2xhZ2cuaAo9PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09Ci0tLSBzeXMvbmV0L2lmX2xhZ2cuaAkocmV2aXNpb24gMjQ4NzA0KQorKysg c3lzL25ldC9pZl9sYWdnLmgJKHdvcmtpbmcgY29weSkKQEAgLTIxOSw2ICsyMTksNyBAQCBz dHJ1Y3QgbGFnZ19zb2Z0YyB7CiAJZXZlbnRoYW5kbGVyX3RhZyB2bGFuX2RldGFjaDsKIAlz dHJ1Y3Qgc3lzY3RsX2N0eF9saXN0CQljdHg7CQkvKiBzeXNjdGwgdmFyaWFibGVzICovCiAJ aW50CQkJCXVzZV9mbG93aWQ7CS8qIHVzZSBNX0ZMT1dJRCAqLworCXN0cnVjdCBjYWxsb3V0 CQkJY291bnRlcnNfc3luYzsJLyogY291bnRlcnMgcGVyaW9kaWMgKi8KIH07CiAKIHN0cnVj dCBsYWdnX3BvcnQgewpAQCAtMjQxLDYgKzI0MiwxMSBAQCBzdHJ1Y3QgbGFnZ19wb3J0IHsK IAlpbnQJKCpscF9vdXRwdXQpKHN0cnVjdCBpZm5ldCAqLCBzdHJ1Y3QgbWJ1ZiAqLCBzdHJ1 Y3Qgc29ja2FkZHIgKiwKIAkJICAgICBzdHJ1Y3Qgcm91dGUgKik7CiAKKwl1X2xvbmcJCQkJ aWZpX2lwYWNrZXRzOwkvKiBwYWNrZXRzIHJlY2VpdmVkIG9uIGludGVyZmFjZSAqLworCXVf bG9uZwkJCQlpZmlfb3BhY2tldHM7CS8qIHBhY2tldHMgc2VudCBvbiBpbnRlcmZhY2UgKi8K Kwl1X2xvbmcJCQkJaWZpX2lieXRlczsJLyogdG90YWwgbnVtYmVyIG9mIG9jdGV0cyByZWNl aXZlZCAqLworCXVfbG9uZwkJCQlpZmlfb2J5dGVzOwkvKiB0b3RhbCBudW1iZXIgb2Ygb2N0 ZXRzIHNlbnQgKi8KKwogCVNMSVNUX0VOVFJZKGxhZ2dfcG9ydCkJCWxwX2VudHJpZXM7CiB9 OwogCkluZGV4OiBzeXMvbmV0L2lmX3ZsYW4uYwo9PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBzeXMvbmV0 L2lmX3ZsYW4uYwkocmV2aXNpb24gMjQ4NzA0KQorKysgc3lzL25ldC9pZl92bGFuLmMJKHdv cmtpbmcgY29weSkKQEAgLTEzOCw2ICsxMzgsMTIgQEAgc3RhdGljIGludCBzb2Z0X3BhZCA9 IDA7CiBTWVNDVExfSU5UKF9uZXRfbGlua192bGFuLCBPSURfQVVUTywgc29mdF9wYWQsIENU TEZMQUdfUlcsICZzb2Z0X3BhZCwgMCwKIAkgICAicGFkIHNob3J0IGZyYW1lcyBiZWZvcmUg dGFnZ2luZyIpOwogCitzdGF0aWMgaW50IHN5c2N0bF9wcmlvcml0eV92YWwoU1lTQ1RMX0hB TkRMRVJfQVJHUyk7CitzdGF0aWMgaW50IHByaW9yaXR5ID0gaHRvbnMoMSA8PCAxMyk7CitT WVNDVExfVk5FVF9QUk9DKF9uZXRfbGlua192bGFuLCBPSURfQVVUTywgZG90MXBfcHJpb3Jp dHksCisgICAgQ1RMVFlQRV9VSU5UfENUTEZMQUdfUlcsIDAsIDAsIHN5c2N0bF9wcmlvcml0 eV92YWwsICJJVSIsCisJICAgInNldCBkb3QxcCBwcmlvcml0eSIpOworCiBzdGF0aWMgY29u c3QgY2hhciB2bGFubmFtZVtdID0gInZsYW4iOwogc3RhdGljIE1BTExPQ19ERUZJTkUoTV9W TEFOLCB2bGFubmFtZSwgIjgwMi4xUSBWaXJ0dWFsIExBTiBJbnRlcmZhY2UiKTsKIApAQCAt MjE3LDYgKzIyMywyNyBAQCBzdGF0aWMgVk5FVF9ERUZJTkUoc3RydWN0IGlmX2Nsb25lICos IHZsYW5fY2xvbmVyKQogI2lmbmRlZiBWTEFOX0FSUkFZCiAjZGVmaW5lIEhBU0gobiwgbSkJ KCgoKG4pID4+IDgpIF4gKChuKSA+PiA0KSBeIChuKSkgJiAobSkpCiAKKy8qCisgKiBTZXQg bWF4aW11bSBudW1iZXIgb2YgdGFibGVzIHRoYXQgY2FuIGJlIHVzZWQgaW4gZ2l2ZW4gVk5F VCBpcGZ3IGluc3RhbmNlLgorICovCitzdGF0aWMgaW50CitzeXNjdGxfcHJpb3JpdHlfdmFs KFNZU0NUTF9IQU5ETEVSX0FSR1MpCit7CisJaW50IGVycm9yOworCXVuc2lnbmVkIGludCBu cHJpbzsKKworCW5wcmlvID0gbnRvaHMocHJpb3JpdHkpID4+IDEzOworCisJZXJyb3IgPSBz eXNjdGxfaGFuZGxlX2ludChvaWRwLCAmbnByaW8sIDAsIHJlcSk7CisJLyogUmVhZCBvcGVy YXRpb24gb3Igc29tZSBlcnJvciAqLworCWlmICgoZXJyb3IgIT0gMCkgfHwgKHJlcS0+bmV3 cHRyID09IE5VTEwpKQorCQlyZXR1cm4gKGVycm9yKTsKKwkKKwlwcmlvcml0eSA9IGh0b25z KChucHJpbyAmIDB4NykgPDwgMTMpOworCisJcmV0dXJuICgwKTsKK30KKwogc3RhdGljIHZv aWQKIHZsYW5faW5pdGhhc2goc3RydWN0IGlmdmxhbnRydW5rICp0cnVuaykKIHsKQEAgLTEw NzYsNyArMTEwMyw3IEBAIHZsYW5fdHJhbnNtaXQoc3RydWN0IGlmbmV0ICppZnAsIHN0cnVj dCBtYnVmICptKQogCSAqIHBhY2tldCB0YWcgdGhhdCBob2xkcyBpdC4KIAkgKi8KIAlpZiAo cC0+aWZfY2FwZW5hYmxlICYgSUZDQVBfVkxBTl9IV1RBR0dJTkcpIHsKLQkJbS0+bV9wa3Ro ZHIuZXRoZXJfdnRhZyA9IGlmdi0+aWZ2X3ZpZDsKKwkJbS0+bV9wa3RoZHIuZXRoZXJfdnRh ZyA9IGlmdi0+aWZ2X3ZpZCB8IHByaW9yaXR5OwogCQltLT5tX2ZsYWdzIHw9IE1fVkxBTlRB RzsKIAl9IGVsc2UgewogCQltID0gZXRoZXJfdmxhbmVuY2FwKG0sIGlmdi0+aWZ2X3ZpZCk7 Cg== --------------020404010101070001050708-- From owner-svn-src-all@FreeBSD.ORG Mon Apr 15 17:01:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id F0484383; Mon, 15 Apr 2013 17:01:42 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C9A3BE7D; Mon, 15 Apr 2013 17:01:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3FH1gEa096460; Mon, 15 Apr 2013 17:01:42 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3FH1gV1096459; Mon, 15 Apr 2013 17:01:42 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201304151701.r3FH1gV1096459@svn.freebsd.org> From: Jack F Vogel Date: Mon, 15 Apr 2013 17:01:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249509 - head/sys/dev/e1000 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Apr 2013 17:01:43 -0000 Author: jfv Date: Mon Apr 15 17:01:42 2013 New Revision: 249509 URL: http://svnweb.freebsd.org/changeset/base/249509 Log: Corrections to the RX checksum code, make sure its disabled as well as enabled when necessary. And simplify the checksum routine itself, adding UDP bit to the test. Thanks to Kevin Lo for pointing out the problems and code suggestions. Modified: head/sys/dev/e1000/if_em.c Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Mon Apr 15 16:09:24 2013 (r249508) +++ head/sys/dev/e1000/if_em.c Mon Apr 15 17:01:42 2013 (r249509) @@ -4322,11 +4322,12 @@ em_initialize_receive_unit(struct adapte E1000_WRITE_REG(hw, E1000_RFCTL, E1000_RFCTL_ACK_DIS); } - if (ifp->if_capenable & IFCAP_RXCSUM) { - rxcsum = E1000_READ_REG(hw, E1000_RXCSUM); - rxcsum |= (E1000_RXCSUM_IPOFL | E1000_RXCSUM_TUOFL); - E1000_WRITE_REG(hw, E1000_RXCSUM, rxcsum); - } + rxcsum = E1000_READ_REG(hw, E1000_RXCSUM); + if (ifp->if_capenable & IFCAP_RXCSUM) + rxcsum |= E1000_RXCSUM_TUOFL; + else + rxcsum &= ~E1000_RXCSUM_TUOFL; + E1000_WRITE_REG(hw, E1000_RXCSUM, rxcsum); /* ** XXX TEMPORARY WORKAROUND: on some systems with 82573 @@ -4644,31 +4645,23 @@ em_fixup_rx(struct rx_ring *rxr) static void em_receive_checksum(struct e1000_rx_desc *rx_desc, struct mbuf *mp) { + mp->m_pkthdr.csum_flags = 0; + /* Ignore Checksum bit is set */ - if (rx_desc->status & E1000_RXD_STAT_IXSM) { - mp->m_pkthdr.csum_flags = 0; + if (rx_desc->status & E1000_RXD_STAT_IXSM) return; - } - - if (rx_desc->status & E1000_RXD_STAT_IPCS) { - /* Did it pass? */ - if (!(rx_desc->errors & E1000_RXD_ERR_IPE)) { - /* IP Checksum Good */ - mp->m_pkthdr.csum_flags = CSUM_IP_CHECKED; - mp->m_pkthdr.csum_flags |= CSUM_IP_VALID; - } else { - mp->m_pkthdr.csum_flags = 0; - } - } + if (rx_desc->errors & (E1000_RXD_ERR_TCPE | E1000_RXD_ERR_IPE)) + return; - if (rx_desc->status & E1000_RXD_STAT_TCPCS) { - /* Did it pass? */ - if (!(rx_desc->errors & E1000_RXD_ERR_TCPE)) { - mp->m_pkthdr.csum_flags |= - (CSUM_DATA_VALID | CSUM_PSEUDO_HDR); - mp->m_pkthdr.csum_data = htons(0xffff); - } + /* IP Checksum Good? */ + if (rx_desc->status & E1000_RXD_STAT_IPCS) + mp->m_pkthdr.csum_flags = (CSUM_IP_CHECKED | CSUM_IP_VALID); + + /* TCP or UDP checksum */ + if (rx_desc->status & (E1000_RXD_STAT_TCPCS | E1000_RXD_STAT_UDPCS)) { + mp->m_pkthdr.csum_flags |= (CSUM_DATA_VALID | CSUM_PSEUDO_HDR); + mp->m_pkthdr.csum_data = htons(0xffff); } } From owner-svn-src-all@FreeBSD.ORG Mon Apr 15 17:16:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E4F4CA05; Mon, 15 Apr 2013 17:16:14 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C703CF5D; Mon, 15 Apr 2013 17:16:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3FHGEuY000614; Mon, 15 Apr 2013 17:16:14 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3FHGCdT000602; Mon, 15 Apr 2013 17:16:12 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201304151716.r3FHGCdT000602@svn.freebsd.org> From: Edward Tomasz Napierala Date: Mon, 15 Apr 2013 17:16:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249510 - in stable/9: share/man/man4 sys/cam/ctl sys/modules sys/modules/ctl usr.bin/ctlstat usr.sbin/ctladm X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Apr 2013 17:16:15 -0000 Author: trasz Date: Mon Apr 15 17:16:12 2013 New Revision: 249510 URL: http://svnweb.freebsd.org/changeset/base/249510 Log: MFC r249009: Make it possible to build CTL as a module. MFC r249022 by glebius@: - Remove extra $FreeBSD$ - Touch options headers to make module buildable. Added: stable/9/share/man/man4/ctl.4 - copied unchanged from r249009, head/share/man/man4/ctl.4 stable/9/sys/modules/ctl/ - copied from r249009, head/sys/modules/ctl/ Modified: stable/9/share/man/man4/Makefile stable/9/sys/cam/ctl/README.ctl.txt stable/9/sys/cam/ctl/ctl.c stable/9/sys/cam/ctl/ctl_frontend_cam_sim.c stable/9/sys/cam/ctl/ctl_frontend_internal.c stable/9/sys/cam/ctl/scsi_ctl.c stable/9/sys/modules/Makefile stable/9/sys/modules/ctl/Makefile stable/9/usr.bin/ctlstat/ctlstat.8 stable/9/usr.sbin/ctladm/ctladm.8 Directory Properties: stable/9/share/man/man4/ (props changed) stable/9/sys/ (props changed) stable/9/sys/modules/ (props changed) stable/9/usr.bin/ctlstat/ (props changed) stable/9/usr.sbin/ctladm/ (props changed) Modified: stable/9/share/man/man4/Makefile ============================================================================== --- stable/9/share/man/man4/Makefile Mon Apr 15 17:01:42 2013 (r249509) +++ stable/9/share/man/man4/Makefile Mon Apr 15 17:16:12 2013 (r249510) @@ -93,6 +93,7 @@ MAN= aac.4 \ ${_cpuctl.4} \ cpufreq.4 \ crypto.4 \ + ctl.4 \ cue.4 \ cxgb.4 \ cxgbe.4 \ Copied: stable/9/share/man/man4/ctl.4 (from r249009, head/share/man/man4/ctl.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/share/man/man4/ctl.4 Mon Apr 15 17:16:12 2013 (r249510, copy of r249009, head/share/man/man4/ctl.4) @@ -0,0 +1,90 @@ +.\" Copyright (c) 2013 Edward Tomasz Napierala +.\" 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 March 8, 2013 +.Dt CTL 4 +.Os +.Sh NAME +.Nm ctl +.Nd CAM Target Layer +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following line in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device ctl" +.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 +ctl_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +subsystem provides SCSI disk and processor emulation. +It supports features such as: +.Pp +.Bl -bullet -compact +.It +Disk and processor device emulation +.It +Tagged queueing +.It +SCSI task attribute support (ordered, head of queue, simple tags) +.It +SCSI implicit command ordering support. +.It +Full task management support (abort, LUN reset, target reset, etc.) +.It +Support for multiple ports +.It +Support for multiple simultaneous initiators +.It +Support for multiple simultaneous backing stores +.It +Persistent reservation support +.It +Mode sense/select support +.It +Error injection support +.It +All I/O handled in-kernel, no userland context switch overhead +.El +.Sh SEE ALSO +.Xr ctladm 8 , +.Xr ctlstat 8 +.Sh HISTORY +The +.Nm +subsystem first appeared in +.Fx 9.1 . +.Sh AUTHORS +The +.Nm +subsystem was written by +.An Kenneth Merry Aq ken@FreeBSD.org . Modified: stable/9/sys/cam/ctl/README.ctl.txt ============================================================================== --- stable/9/sys/cam/ctl/README.ctl.txt Mon Apr 15 17:01:42 2013 (r249509) +++ stable/9/sys/cam/ctl/README.ctl.txt Mon Apr 15 17:16:12 2013 (r249510) @@ -227,9 +227,6 @@ Revision 1.2 Changes To Do List: ========== - - Make CTL buildable as a module. Work needs to be done on initialization, - and on freeing resources and LUNs when it is built as a module. - - Use devstat(9) for CTL's statistics collection. CTL uses a home-grown statistics collection system that is similar to devstat(9). ctlstat should be retired in favor of iostat, etc., once aggregation modes are Modified: stable/9/sys/cam/ctl/ctl.c ============================================================================== --- stable/9/sys/cam/ctl/ctl.c Mon Apr 15 17:01:42 2013 (r249509) +++ stable/9/sys/cam/ctl/ctl.c Mon Apr 15 17:16:12 2013 (r249510) @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -332,7 +333,7 @@ TUNABLE_INT("kern.cam.ctl.disable", &ctl static void ctl_isc_event_handler(ctl_ha_channel chanel, ctl_ha_event event, int param); static void ctl_copy_sense_data(union ctl_ha_msg *src, union ctl_io *dest); -static void ctl_init(void); +static int ctl_init(void); void ctl_shutdown(void); static int ctl_open(struct cdev *dev, int flags, int fmt, struct thread *td); static int ctl_close(struct cdev *dev, int flags, int fmt, struct thread *td); @@ -451,11 +452,16 @@ static struct cdevsw ctl_cdevsw = { MALLOC_DEFINE(M_CTL, "ctlmem", "Memory used for CTL"); -/* - * If we have the CAM SIM, we may or may not have another SIM that will - * cause CTL to get initialized. If not, we need to initialize it. - */ -SYSINIT(ctl_init, SI_SUB_CONFIGURE, SI_ORDER_THIRD, ctl_init, NULL); +static int ctl_module_event_handler(module_t, int /*modeventtype_t*/, void *); + +static moduledata_t ctl_moduledata = { + "ctl", + ctl_module_event_handler, + NULL +}; + +DECLARE_MODULE(ctl, ctl_moduledata, SI_SUB_CONFIGURE, SI_ORDER_THIRD); +MODULE_VERSION(ctl, 1); static void ctl_isc_handler_finish_xfer(struct ctl_softc *ctl_softc, @@ -935,7 +941,7 @@ ctl_copy_sense_data(union ctl_ha_msg *sr dest->io_hdr.status = src->hdr.status; } -static void +static int ctl_init(void) { struct ctl_softc *softc; @@ -946,7 +952,7 @@ ctl_init(void) #if 0 int i; #endif - int retval; + int error, retval; //int isc_retval; retval = 0; @@ -955,7 +961,7 @@ ctl_init(void) /* If we're disabled, don't initialize. */ if (ctl_disable != 0) - return; + return (0); control_softc = malloc(sizeof(*control_softc), M_DEVBUF, M_WAITOK | M_ZERO); @@ -984,7 +990,7 @@ ctl_init(void) destroy_dev(softc->dev); free(control_softc, M_DEVBUF); control_softc = NULL; - return; + return (ENOMEM); } SYSCTL_ADD_INT(&softc->sysctl_ctx, @@ -1046,7 +1052,7 @@ ctl_init(void) &internal_pool)!= 0){ printf("ctl: can't allocate %d entry internal pool, " "exiting\n", CTL_POOL_ENTRIES_INTERNAL); - return; + return (ENOMEM); } if (ctl_pool_create(softc, CTL_POOL_EMERGENCY, @@ -1054,7 +1060,7 @@ ctl_init(void) printf("ctl: can't allocate %d entry emergency pool, " "exiting\n", CTL_POOL_ENTRIES_EMERGENCY); ctl_pool_free(softc, internal_pool); - return; + return (ENOMEM); } if (ctl_pool_create(softc, CTL_POOL_4OTHERSC, CTL_POOL_ENTRIES_OTHER_SC, @@ -1064,7 +1070,7 @@ ctl_init(void) "exiting\n", CTL_POOL_ENTRIES_OTHER_SC); ctl_pool_free(softc, internal_pool); ctl_pool_free(softc, emergency_pool); - return; + return (ENOMEM); } softc->internal_pool = internal_pool; @@ -1085,14 +1091,15 @@ ctl_init(void) mtx_unlock(&softc->ctl_lock); #endif - if (kproc_create(ctl_work_thread, softc, &softc->work_thread, 0, 0, - "ctl_thrd") != 0) { + error = kproc_create(ctl_work_thread, softc, &softc->work_thread, 0, 0, + "ctl_thrd"); + if (error != 0) { printf("error creating CTL work thread!\n"); ctl_free_lun(lun); ctl_pool_free(softc, internal_pool); ctl_pool_free(softc, emergency_pool); ctl_pool_free(softc, other_pool); - return; + return (error); } printf("ctl: CAM Target Layer loaded\n"); @@ -1132,10 +1139,11 @@ ctl_init(void) if (sizeof(struct callout) > CTL_TIMER_BYTES) { printf("sizeof(struct callout) %zd > CTL_TIMER_BYTES %zd\n", sizeof(struct callout), CTL_TIMER_BYTES); - return; + return (EINVAL); } #endif /* CTL_IO_DELAY */ + return (0); } void @@ -1192,6 +1200,20 @@ ctl_shutdown(void) printf("ctl: CAM Target Layer unloaded\n"); } +static int +ctl_module_event_handler(module_t mod, int what, void *arg) +{ + + switch (what) { + case MOD_LOAD: + return (ctl_init()); + case MOD_UNLOAD: + return (EBUSY); + default: + return (EOPNOTSUPP); + } +} + /* * XXX KDM should we do some access checks here? Bump a reference count to * prevent a CTL module from being unloaded while someone has it open? Modified: stable/9/sys/cam/ctl/ctl_frontend_cam_sim.c ============================================================================== --- stable/9/sys/cam/ctl/ctl_frontend_cam_sim.c Mon Apr 15 17:01:42 2013 (r249509) +++ stable/9/sys/cam/ctl/ctl_frontend_cam_sim.c Mon Apr 15 17:16:12 2013 (r249510) @@ -121,12 +121,23 @@ struct cfcs_softc cfcs_softc; static int cfcs_max_sense = sizeof(struct scsi_sense_data); extern int ctl_disable; -SYSINIT(cfcs_init, SI_SUB_CONFIGURE, SI_ORDER_FOURTH, cfcs_init, NULL); SYSCTL_NODE(_kern_cam, OID_AUTO, ctl2cam, CTLFLAG_RD, 0, "CAM Target Layer SIM frontend"); SYSCTL_INT(_kern_cam_ctl2cam, OID_AUTO, max_sense, CTLFLAG_RW, &cfcs_max_sense, 0, "Maximum sense data size"); +static int cfcs_module_event_handler(module_t, int /*modeventtype_t*/, void *); + +static moduledata_t cfcs_moduledata = { + "ctlcfcs", + cfcs_module_event_handler, + NULL +}; + +DECLARE_MODULE(ctlcfcs, cfcs_moduledata, SI_SUB_CONFIGURE, SI_ORDER_FOURTH); +MODULE_VERSION(ctlcfcs, 1); +MODULE_DEPEND(ctlcfi, ctl, 1, 1, 1); +MODULE_DEPEND(ctlcfi, cam, 1, 1, 1); int cfcs_init(void) @@ -176,7 +187,7 @@ cfcs_init(void) printf("%s: ctl_frontend_register() failed with error %d!\n", __func__, retval); mtx_destroy(&softc->lock); - return (1); + return (retval); } /* @@ -236,7 +247,7 @@ cfcs_init(void) CAM_LUN_WILDCARD) != CAM_REQ_CMP) { printf("%s: error creating path\n", __func__); xpt_bus_deregister(cam_sim_path(softc->sim)); - retval = 1; + retval = EINVAL; goto bailout; } @@ -274,6 +285,20 @@ cfcs_shutdown(void) } +static int +cfcs_module_event_handler(module_t mod, int what, void *arg) +{ + + switch (what) { + case MOD_LOAD: + return (cfcs_init()); + case MOD_UNLOAD: + return (EBUSY); + default: + return (EOPNOTSUPP); + } +} + static void cfcs_onoffline(void *arg, int online) { Modified: stable/9/sys/cam/ctl/ctl_frontend_internal.c ============================================================================== --- stable/9/sys/cam/ctl/ctl_frontend_internal.c Mon Apr 15 17:01:42 2013 (r249509) +++ stable/9/sys/cam/ctl/ctl_frontend_internal.c Mon Apr 15 17:16:12 2013 (r249510) @@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -189,7 +190,7 @@ MALLOC_DEFINE(M_CTL_CFI, "ctlcfi", "CTL static struct cfi_softc fetd_internal_softc; extern int ctl_disable; -void cfi_init(void); +int cfi_init(void); void cfi_shutdown(void) __unused; static void cfi_online(void *arg); static void cfi_offline(void *arg); @@ -217,9 +218,19 @@ static void cfi_metatask_io_done(union c static void cfi_err_recovery_done(union ctl_io *io); static void cfi_lun_io_done(union ctl_io *io); -SYSINIT(cfi_init, SI_SUB_CONFIGURE, SI_ORDER_FOURTH, cfi_init, NULL); +static int cfi_module_event_handler(module_t, int /*modeventtype_t*/, void *); -void +static moduledata_t cfi_moduledata = { + "ctlcfi", + cfi_module_event_handler, + NULL +}; + +DECLARE_MODULE(ctlcfi, cfi_moduledata, SI_SUB_CONFIGURE, SI_ORDER_FOURTH); +MODULE_VERSION(ctlcfi, 1); +MODULE_DEPEND(ctlcfi, ctl, 1, 1, 1); + +int cfi_init(void) { struct cfi_softc *softc; @@ -234,7 +245,7 @@ cfi_init(void) /* If we're disabled, don't initialize */ if (ctl_disable != 0) - return; + return (0); if (sizeof(struct cfi_lun_io) > CTL_PORT_PRIV_SIZE) { printf("%s: size of struct cfi_lun_io %zd > " @@ -292,7 +303,7 @@ cfi_init(void) } bailout: - return; + return (0); bailout_error: @@ -309,6 +320,8 @@ bailout_error: default: break; } + + return (ENOMEM); } void @@ -331,6 +344,20 @@ cfi_shutdown(void) printf("%s: error shrinking LUN pool\n", __func__); } +static int +cfi_module_event_handler(module_t mod, int what, void *arg) +{ + + switch (what) { + case MOD_LOAD: + return (cfi_init()); + case MOD_UNLOAD: + return (EBUSY); + default: + return (EOPNOTSUPP); + } +} + static void cfi_online(void *arg) { Modified: stable/9/sys/cam/ctl/scsi_ctl.c ============================================================================== --- stable/9/sys/cam/ctl/scsi_ctl.c Mon Apr 15 17:01:42 2013 (r249509) +++ stable/9/sys/cam/ctl/scsi_ctl.c Mon Apr 15 17:16:12 2013 (r249510) @@ -225,11 +225,28 @@ static struct periph_driver ctlfe_driver ctlfeinit, "ctl", TAILQ_HEAD_INITIALIZER(ctlfe_driver.units), /*generation*/ 0 }; -PERIPHDRIVER_DECLARE(ctl, ctlfe_driver); + +static int ctlfe_module_event_handler(module_t, int /*modeventtype_t*/, void *); + +/* + * We're not using PERIPHDRIVER_DECLARE(), because it runs at SI_SUB_DRIVERS, + * and that happens before CTL gets initialised. + */ +static moduledata_t ctlfe_moduledata = { + "ctlfe", + ctlfe_module_event_handler, + NULL +}; + +DECLARE_MODULE(ctlfe, ctlfe_moduledata, SI_SUB_CONFIGURE, SI_ORDER_FOURTH); +MODULE_VERSION(ctlfe, 1); +MODULE_DEPEND(ctlfe, ctl, 1, 1, 1); +MODULE_DEPEND(ctlfe, cam, 1, 1, 1); extern struct ctl_softc *control_softc; extern int ctl_disable; +#ifdef seems_unused int ctlfeinitialize(void) { @@ -257,6 +274,7 @@ ctlfeinitialize(void) return (0); } +#endif void ctlfeshutdown(void) @@ -288,6 +306,21 @@ ctlfeinit(void) } } +static int +ctlfe_module_event_handler(module_t mod, int what, void *arg) +{ + + switch (what) { + case MOD_LOAD: + periphdriver_register(&ctlfe_driver); + return (0); + case MOD_UNLOAD: + return (EBUSY); + default: + return (EOPNOTSUPP); + } +} + static void ctlfeasync(void *callback_arg, uint32_t code, struct cam_path *path, void *arg) { @@ -1969,7 +2002,6 @@ ctlfe_lun_enable(void *arg, struct ctl_i struct cam_sim *sim; cam_status status; - bus_softc = (struct ctlfe_softc *)arg; sim = bus_softc->sim; Modified: stable/9/sys/modules/Makefile ============================================================================== --- stable/9/sys/modules/Makefile Mon Apr 15 17:01:42 2013 (r249509) +++ stable/9/sys/modules/Makefile Mon Apr 15 17:16:12 2013 (r249510) @@ -75,6 +75,7 @@ SUBDIR= \ ${_cryptodev} \ ${_cs} \ ${_ctau} \ + ctl \ ${_cxgb} \ cxgbe \ ${_cyclic} \ Modified: stable/9/sys/modules/ctl/Makefile ============================================================================== --- head/sys/modules/ctl/Makefile Tue Apr 2 09:42:42 2013 (r249009) +++ stable/9/sys/modules/ctl/Makefile Mon Apr 15 17:16:12 2013 (r249510) @@ -1,7 +1,5 @@ # $FreeBSD$ -# $FreeBSD$ - .PATH: ${.CURDIR}/../../cam/ctl KMOD= ctl @@ -22,5 +20,7 @@ SRCS+= scsi_ctl.c SRCS+= bus_if.h SRCS+= device_if.h SRCS+= vnode_if.h +SRCS+= opt_cam.h +SRCS+= opt_kdtrace.h .include Modified: stable/9/usr.bin/ctlstat/ctlstat.8 ============================================================================== --- stable/9/usr.bin/ctlstat/ctlstat.8 Mon Apr 15 17:01:42 2013 (r249509) +++ stable/9/usr.bin/ctlstat/ctlstat.8 Mon Apr 15 17:16:12 2013 (r249510) @@ -34,7 +34,7 @@ .\" $Id: //depot/users/kenm/FreeBSD-test2/usr.bin/ctlstat/ctlstat.8#2 $ .\" $FreeBSD$ .\" -.Dd June 4, 2010 +.Dd March 6, 2013 .Dt CTLSTAT 8 .Os .Sh NAME @@ -113,6 +113,7 @@ every 10 seconds. .Sh SEE ALSO .Xr cam 3 , .Xr cam 4 , +.Xr ctl 4 , .Xr xpt 4 , .Xr camcontrol 8 , .Xr ctladm 8 , Modified: stable/9/usr.sbin/ctladm/ctladm.8 ============================================================================== --- stable/9/usr.sbin/ctladm/ctladm.8 Mon Apr 15 17:01:42 2013 (r249509) +++ stable/9/usr.sbin/ctladm/ctladm.8 Mon Apr 15 17:16:12 2013 (r249510) @@ -34,7 +34,7 @@ .\" $Id: //depot/users/kenm/FreeBSD-test2/usr.sbin/ctladm/ctladm.8#3 $ .\" $FreeBSD$ .\" -.Dd March 6, 2012 +.Dd March 6, 2013 .Dt CTLADM 8 .Os .Sh NAME @@ -978,6 +978,7 @@ This will result in a sense key of NOT R .Xr cam 3 , .Xr cam_cdbparse 3 , .Xr cam 4 , +.Xr ctl 4 , .Xr xpt 4 , .Xr camcontrol 8 .Sh HISTORY From owner-svn-src-all@FreeBSD.ORG Mon Apr 15 17:19:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5CB08BA9; Mon, 15 Apr 2013 17:19:29 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4F43CF86; Mon, 15 Apr 2013 17:19:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3FHJTFG001124; Mon, 15 Apr 2013 17:19:29 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3FHJTcu001122; Mon, 15 Apr 2013 17:19:29 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201304151719.r3FHJTcu001122@svn.freebsd.org> From: Edward Tomasz Napierala Date: Mon, 15 Apr 2013 17:19:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249511 - stable/9/sys/cam/ctl X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Apr 2013 17:19:29 -0000 Author: trasz Date: Mon Apr 15 17:19:28 2013 New Revision: 249511 URL: http://svnweb.freebsd.org/changeset/base/249511 Log: MFC r249012: Remove unused code. Modified: stable/9/sys/cam/ctl/scsi_ctl.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ctl/scsi_ctl.c ============================================================================== --- stable/9/sys/cam/ctl/scsi_ctl.c Mon Apr 15 17:16:12 2013 (r249510) +++ stable/9/sys/cam/ctl/scsi_ctl.c Mon Apr 15 17:19:28 2013 (r249511) @@ -246,36 +246,6 @@ MODULE_DEPEND(ctlfe, cam, 1, 1, 1); extern struct ctl_softc *control_softc; extern int ctl_disable; -#ifdef seems_unused -int -ctlfeinitialize(void) -{ - cam_status status; - - /* Don't initialize if we're disabled */ - if (ctl_disable != 0) - return (0); - - STAILQ_INIT(&ctlfe_softc_list); - - mtx_init(&ctlfe_list_mtx, ctlfe_mtx_desc, NULL, MTX_DEF); - - xpt_lock_buses(); - periphdriver_register(&ctlfe_driver); - xpt_unlock_buses(); - - status = xpt_register_async(AC_PATH_REGISTERED | AC_PATH_DEREGISTERED | - AC_CONTRACT, ctlfeasync, NULL, NULL); - - if (status != CAM_REQ_CMP) { - printf("ctl: Failed to attach async callback due to CAM " - "status 0x%x!\n", status); - } - - return (0); -} -#endif - void ctlfeshutdown(void) { From owner-svn-src-all@FreeBSD.ORG Mon Apr 15 17:20:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 91AC1E37; Mon, 15 Apr 2013 17:20:44 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8470AF91; Mon, 15 Apr 2013 17:20:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3FHKiNp002879; Mon, 15 Apr 2013 17:20:44 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3FHKiro002878; Mon, 15 Apr 2013 17:20:44 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201304151720.r3FHKiro002878@svn.freebsd.org> From: Edward Tomasz Napierala Date: Mon, 15 Apr 2013 17:20:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249513 - stable/9/sys/cam/ctl X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Apr 2013 17:20:44 -0000 Author: trasz Date: Mon Apr 15 17:20:44 2013 New Revision: 249513 URL: http://svnweb.freebsd.org/changeset/base/249513 Log: MFC r249019: Fix comment formatting. Modified: stable/9/sys/cam/ctl/ctl.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ctl/ctl.c ============================================================================== --- stable/9/sys/cam/ctl/ctl.c Mon Apr 15 17:19:57 2013 (r249512) +++ stable/9/sys/cam/ctl/ctl.c Mon Apr 15 17:20:44 2013 (r249513) @@ -90,9 +90,9 @@ struct ctl_softc *control_softc = NULL; #define CTL_DONE_THREAD /* - * * Use the serial number and device ID provided by the backend, rather than - * * making up our own. - * */ + * Use the serial number and device ID provided by the backend, rather than + * making up our own. + */ #define CTL_USE_BACKEND_SN /* @@ -7874,7 +7874,7 @@ ctl_persistent_reserve_out(struct ctl_sc return (CTL_RETVAL_COMPLETE); } } else if ((cdb->action & SPRO_ACTION_MASK) != SPRO_REGISTER) { - /* + /* * We are not registered */ mtx_unlock(&softc->ctl_lock); From owner-svn-src-all@FreeBSD.ORG Mon Apr 15 17:21:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C28ADF9E; Mon, 15 Apr 2013 17:21:02 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B59AFF98; Mon, 15 Apr 2013 17:21:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3FHL20V003127; Mon, 15 Apr 2013 17:21:02 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3FHL2rg003126; Mon, 15 Apr 2013 17:21:02 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201304151721.r3FHL2rg003126@svn.freebsd.org> From: "George V. Neville-Neil" Date: Mon, 15 Apr 2013 17:21:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249514 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Apr 2013 17:21:02 -0000 Author: gnn Date: Mon Apr 15 17:21:02 2013 New Revision: 249514 URL: http://svnweb.freebsd.org/changeset/base/249514 Log: Point args[0] not at the thread that is ending but at the one that is starting. This is in line with practice in OpenSolaris. Note that this change is only in ULE and not in the 4BSD scheduler. Once this change settles in (MFC timeout has expired) we'll try it out on 4BSD as well. PR: 177706 Submitted by: Tiwei Bie MFC after: 1 month Modified: head/sys/kern/sched_ule.c Modified: head/sys/kern/sched_ule.c ============================================================================== --- head/sys/kern/sched_ule.c Mon Apr 15 17:20:44 2013 (r249513) +++ head/sys/kern/sched_ule.c Mon Apr 15 17:21:02 2013 (r249514) @@ -1930,7 +1930,7 @@ sched_switch(struct thread *td, struct t if (PMC_PROC_IS_USING_PMCS(td->td_proc)) PMC_SWITCH_CONTEXT(td, PMC_FN_CSW_OUT); #endif - SDT_PROBE2(sched, , , off_cpu, td, td->td_proc); + SDT_PROBE2(sched, , , off_cpu, newtd, newtd->td_proc); lock_profile_release_lock(&TDQ_LOCKPTR(tdq)->lock_object); TDQ_LOCKPTR(tdq)->mtx_lock = (uintptr_t)newtd; sched_pctcpu_update(newtd->td_sched, 0); From owner-svn-src-all@FreeBSD.ORG Mon Apr 15 17:35:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BE2FB527; Mon, 15 Apr 2013 17:35:14 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 96AD61051; Mon, 15 Apr 2013 17:35:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3FHZEsW006837; Mon, 15 Apr 2013 17:35:14 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3FHZEPr006836; Mon, 15 Apr 2013 17:35:14 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201304151735.r3FHZEPr006836@svn.freebsd.org> From: Edward Tomasz Napierala Date: Mon, 15 Apr 2013 17:35:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249515 - stable/9/sys/cam/ctl X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Apr 2013 17:35:14 -0000 Author: trasz Date: Mon Apr 15 17:35:14 2013 New Revision: 249515 URL: http://svnweb.freebsd.org/changeset/base/249515 Log: MFC r249026: Don't directly dereference userland pointer; instead use kernel pointer copied in from userspace. This fixes instant panic when creating CTL LUN on sparc64. Not a security problem, since the API is root-only. Modified: stable/9/sys/cam/ctl/ctl_backend_block.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- stable/9/sys/cam/ctl/ctl_backend_block.c Mon Apr 15 17:21:02 2013 (r249514) +++ stable/9/sys/cam/ctl/ctl_backend_block.c Mon Apr 15 17:35:14 2013 (r249515) @@ -1671,7 +1671,7 @@ ctl_be_block_create(struct ctl_be_block_ if (be_lun->ctl_be_lun.lun_type == T_DIRECT) { for (i = 0; i < req->num_be_args; i++) { - if (strcmp(req->kern_be_args[i].name, "file") == 0) { + if (strcmp(req->kern_be_args[i].kname, "file") == 0) { file_arg = &req->kern_be_args[i]; break; } @@ -1686,7 +1686,7 @@ ctl_be_block_create(struct ctl_be_block_ be_lun->dev_path = malloc(file_arg->vallen, M_CTLBLK, M_WAITOK | M_ZERO); - strlcpy(be_lun->dev_path, (char *)file_arg->value, + strlcpy(be_lun->dev_path, (char *)file_arg->kvalue, file_arg->vallen); retval = ctl_be_block_open(softc, be_lun, req); @@ -1725,7 +1725,7 @@ ctl_be_block_create(struct ctl_be_block_ * the loop above, */ for (i = 0; i < req->num_be_args; i++) { - if (strcmp(req->kern_be_args[i].name, "num_threads") == 0) { + if (strcmp(req->kern_be_args[i].kname, "num_threads") == 0) { struct ctl_be_arg *thread_arg; char num_thread_str[16]; int tmp_num_threads; @@ -1733,7 +1733,7 @@ ctl_be_block_create(struct ctl_be_block_ thread_arg = &req->kern_be_args[i]; - strlcpy(num_thread_str, (char *)thread_arg->value, + strlcpy(num_thread_str, (char *)thread_arg->kvalue, min(thread_arg->vallen, sizeof(num_thread_str))); From owner-svn-src-all@FreeBSD.ORG Mon Apr 15 17:58:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1A5D3C59; Mon, 15 Apr 2013 17:58:12 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0CE801148; Mon, 15 Apr 2013 17:58:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3FHwBWH013171; Mon, 15 Apr 2013 17:58:11 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3FHwBFp013170; Mon, 15 Apr 2013 17:58:11 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201304151758.r3FHwBFp013170@svn.freebsd.org> From: Adrian Chadd Date: Mon, 15 Apr 2013 17:58:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249516 - head/sys/dev/ath/ath_hal/ar5416 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Apr 2013 17:58:12 -0000 Author: adrian Date: Mon Apr 15 17:58:11 2013 New Revision: 249516 URL: http://svnweb.freebsd.org/changeset/base/249516 Log: Bring over some AR9271 register definitions from the QCA HAL. Obtained from: Qualcomm Atheros Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h Mon Apr 15 17:35:14 2013 (r249515) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h Mon Apr 15 17:58:11 2013 (r249516) @@ -603,6 +603,25 @@ #define AR_EEPROM_STATUS_DATA_PROT_ACCESS 0x00040000 #define AR_EEPROM_STATUS_DATA_ABSENT_ACCESS 0x00080000 +/* K2 (9271) */ +#define AR9271_CLOCK_CONTROL 0x50040 +#define AR9271_CLOCK_SELECTION_22 0x0 +#define AR9271_CLOCK_SELECTION_88 0x1 +#define AR9271_CLOCK_SELECTION_44 0x2 +#define AR9271_CLOCK_SELECTION_117 0x4 +#define AR9271_CLOCK_SELECTION_OSC_40 0x6 +#define AR9271_CLOCK_SELECTION_RTC 0x7 +#define AR9271_SPI_SEL 0x100 +#define AR9271_UART_SEL 0x200 + +#define AR9271_RESET_POWER_DOWN_CONTROL 0x50044 +#define AR9271_RADIO_RF_RST 0x20 +#define AR9271_GATE_MAC_CTL 0x4000 +#define AR9271_MAIN_PLL_PWD_CTL 0x40000 + +#define AR9271_CLKMISC 0x4090 +#define AR9271_OSC_to_10M_EN 0x00000001 + /* * AR5212 defines the MAC revision mask as 0xF, but both ath9k and * the Atheros HAL define it as 0x7. From owner-svn-src-all@FreeBSD.ORG Mon Apr 15 17:59:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id EE623DEA; Mon, 15 Apr 2013 17:59:06 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E13BD115B; Mon, 15 Apr 2013 17:59:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3FHx6qr013332; Mon, 15 Apr 2013 17:59:06 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3FHx6lh013331; Mon, 15 Apr 2013 17:59:06 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201304151759.r3FHx6lh013331@svn.freebsd.org> From: Adrian Chadd Date: Mon, 15 Apr 2013 17:59:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249517 - head/sys/dev/ath/ath_hal/ar5416 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Apr 2013 17:59:07 -0000 Author: adrian Date: Mon Apr 15 17:59:06 2013 New Revision: 249517 URL: http://svnweb.freebsd.org/changeset/base/249517 Log: Now that the register definitions are in -HEAD, enable this. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_btcoex.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_btcoex.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_btcoex.c Mon Apr 15 17:58:11 2013 (r249516) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_btcoex.c Mon Apr 15 17:59:06 2013 (r249517) @@ -269,14 +269,14 @@ ar5416BTCoexEnable(struct ath_hal *ah) } OS_REG_WRITE(ah, AR_BT_COEX_MODE2, ahp->ah_btCoexMode2); -#if 0 - /* Added Select GPIO5~8 instaed SPI */ - if (AR_SREV_9271(ah)) { - val = OS_REG_READ(ah, AR9271_CLOCK_CONTROL); - val &= 0xFFFFFEFF; - OS_REG_WRITE(ah, AR9271_CLOCK_CONTROL, val); - } -#endif + /* Added Select GPIO5~8 instaed SPI */ + if (AR_SREV_9271(ah)) { + uint32_t val; + + val = OS_REG_READ(ah, AR9271_CLOCK_CONTROL); + val &= 0xFFFFFEFF; + OS_REG_WRITE(ah, AR9271_CLOCK_CONTROL, val); + } if (ahp->ah_btCoexFlag & HAL_BT_COEX_FLAG_LOW_ACK_PWR) OS_REG_WRITE(ah, AR_TPC, HAL_BT_COEX_LOW_ACK_POWER); From owner-svn-src-all@FreeBSD.ORG Mon Apr 15 18:30:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DD08D426; Mon, 15 Apr 2013 18:30:01 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C12A71270; Mon, 15 Apr 2013 18:30:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3FIU18E023206; Mon, 15 Apr 2013 18:30:01 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3FIU1Hd023205; Mon, 15 Apr 2013 18:30:01 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201304151830.r3FIU1Hd023205@svn.freebsd.org> From: Dimitry Andric Date: Mon, 15 Apr 2013 18:30:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249518 - stable/9/contrib/llvm/lib/Support X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Apr 2013 18:30:01 -0000 Author: dim Date: Mon Apr 15 18:30:00 2013 New Revision: 249518 URL: http://svnweb.freebsd.org/changeset/base/249518 Log: Pull in r178636 from upstream llvm trunk: Second pass at addressing PR15351 by explicitly checking for AVX support when getting the host processor information. It emits a .byte sequence on GNUC compilers to work around lack of xgetbv support with older assemblers, and resolves a comment typo found in the previous patch. This should fix crashes due to emitting of AVX instructions on certain processors, which do not support then, when using -march=native. This is a direct commit to stable/9, since head has a complete import of llvm/clang trunk, and there is no single commit to merge. Reported by: Kubilay Kocak Modified: stable/9/contrib/llvm/lib/Support/Host.cpp Modified: stable/9/contrib/llvm/lib/Support/Host.cpp ============================================================================== --- stable/9/contrib/llvm/lib/Support/Host.cpp Mon Apr 15 17:59:06 2013 (r249517) +++ stable/9/contrib/llvm/lib/Support/Host.cpp Mon Apr 15 18:30:00 2013 (r249518) @@ -111,6 +111,21 @@ static bool GetX86CpuIDAndInfo(unsigned #endif } +static bool OSHasAVXSupport() { +#if defined( __GNUC__ ) + // Check xgetbv; this uses a .byte sequence instead of the instruction + // directly because older assemblers do not include support for xgetbv and + // there is no easy way to conditionally compile based on the assembler used. + int rEAX, rEDX; + __asm__ (".byte 0x0f, 0x01, 0xd0" : "=a" (rEAX), "=d" (rEDX) : "c" (0)); +#elif defined(_MSC_VER) + unsigned long long rEAX = _xgetbv(_XCR_XFEATURE_ENABLED_MASK); +#else + int rEAX = 0; // Ensures we return false +#endif + return (rEAX & 6) == 6; +} + static void DetectX86FamilyModel(unsigned EAX, unsigned &Family, unsigned &Model) { Family = (EAX >> 8) & 0xf; // Bits 8 - 11 @@ -133,6 +148,10 @@ std::string sys::getHostCPUName() { DetectX86FamilyModel(EAX, Family, Model); bool HasSSE3 = (ECX & 0x1); + // If CPUID indicates support for XSAVE, XRESTORE and AVX, and XGETBV + // indicates that the AVX registers will be saved and restored on context + // switch, then we have full AVX support. + bool HasAVX = (ECX & ((1 << 28) | (1 << 27))) != 0 && OSHasAVXSupport(); GetX86CpuIDAndInfo(0x80000001, &EAX, &EBX, &ECX, &EDX); bool Em64T = (EDX >> 29) & 0x1; @@ -242,11 +261,15 @@ std::string sys::getHostCPUName() { case 42: // Intel Core i7 processor. All processors are manufactured // using the 32 nm process. case 45: - return "corei7-avx"; + // Not all Sandy Bridge processors support AVX (such as the Pentium + // versions instead of the i7 versions). + return HasAVX ? "corei7-avx" : "corei7"; // Ivy Bridge: case 58: - return "core-avx-i"; + // Not all Ivy Bridge processors support AVX (such as the Pentium + // versions instead of the i7 versions). + return HasAVX ? "core-avx-i" : "corei7"; case 28: // Most 45 nm Intel Atom processors case 38: // 45 nm Atom Lincroft From owner-svn-src-all@FreeBSD.ORG Mon Apr 15 18:32:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B14FA5C4; Mon, 15 Apr 2013 18:32:36 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A3579128F; Mon, 15 Apr 2013 18:32:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3FIWan5025225; Mon, 15 Apr 2013 18:32:36 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3FIWakT025223; Mon, 15 Apr 2013 18:32:36 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201304151832.r3FIWakT025223@svn.freebsd.org> From: Edward Tomasz Napierala Date: Mon, 15 Apr 2013 18:32:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249519 - in stable/9: share/man/man4 usr.sbin/ctladm X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Apr 2013 18:32:36 -0000 Author: trasz Date: Mon Apr 15 18:32:35 2013 New Revision: 249519 URL: http://svnweb.freebsd.org/changeset/base/249519 Log: MFC r249011: Fix dates in manual pages modified in 249009. Modified: stable/9/share/man/man4/ctl.4 stable/9/usr.sbin/ctladm/ctladm.8 Directory Properties: stable/9/share/man/man4/ (props changed) stable/9/usr.sbin/ctladm/ (props changed) Modified: stable/9/share/man/man4/ctl.4 ============================================================================== --- stable/9/share/man/man4/ctl.4 Mon Apr 15 18:30:00 2013 (r249518) +++ stable/9/share/man/man4/ctl.4 Mon Apr 15 18:32:35 2013 (r249519) @@ -23,7 +23,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd March 8, 2013 +.Dd April 2, 2013 .Dt CTL 4 .Os .Sh NAME Modified: stable/9/usr.sbin/ctladm/ctladm.8 ============================================================================== --- stable/9/usr.sbin/ctladm/ctladm.8 Mon Apr 15 18:30:00 2013 (r249518) +++ stable/9/usr.sbin/ctladm/ctladm.8 Mon Apr 15 18:32:35 2013 (r249519) @@ -34,7 +34,7 @@ .\" $Id: //depot/users/kenm/FreeBSD-test2/usr.sbin/ctladm/ctladm.8#3 $ .\" $FreeBSD$ .\" -.Dd March 6, 2013 +.Dd April 2, 2013 .Dt CTLADM 8 .Os .Sh NAME From owner-svn-src-all@FreeBSD.ORG Mon Apr 15 18:35:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A61F3756; Mon, 15 Apr 2013 18:35:09 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 98FCC12A6; Mon, 15 Apr 2013 18:35:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3FIZ9s3025675; Mon, 15 Apr 2013 18:35:09 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3FIZ9Oo025674; Mon, 15 Apr 2013 18:35:09 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201304151835.r3FIZ9Oo025674@svn.freebsd.org> From: Xin LI Date: Mon, 15 Apr 2013 18:35:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249520 - head/contrib/netcat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Apr 2013 18:35:09 -0000 Author: delphij Date: Mon Apr 15 18:35:09 2013 New Revision: 249520 URL: http://svnweb.freebsd.org/changeset/base/249520 Log: Reflect version update. MFC after: 13 days Modified: head/contrib/netcat/FREEBSD-vendor Modified: head/contrib/netcat/FREEBSD-vendor ============================================================================== --- head/contrib/netcat/FREEBSD-vendor Mon Apr 15 18:32:35 2013 (r249519) +++ head/contrib/netcat/FREEBSD-vendor Mon Apr 15 18:35:09 2013 (r249520) @@ -1,5 +1,5 @@ # $FreeBSD$ Project: netcat (aka src/usr.bin/nc in OpenBSD) ProjectURL: http://www.openbsd.org/ -Version: 5.2 +Version: 5.3 License: BSD From owner-svn-src-all@FreeBSD.ORG Mon Apr 15 18:38:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6E9318F5; Mon, 15 Apr 2013 18:38:22 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 472E212BC; Mon, 15 Apr 2013 18:38:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3FIcMb1026180; Mon, 15 Apr 2013 18:38:22 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3FIcMOt026179; Mon, 15 Apr 2013 18:38:22 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201304151838.r3FIcMOt026179@svn.freebsd.org> From: Baptiste Daroussin Date: Mon, 15 Apr 2013 18:38:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249521 - stable/9 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Apr 2013 18:38:22 -0000 Author: bapt Date: Mon Apr 15 18:38:21 2013 New Revision: 249521 URL: http://svnweb.freebsd.org/changeset/base/249521 Log: Fix mergeinfo after r249503 Submitted by: gavin Modified: Directory Properties: stable/9/ObsoleteFiles.inc (props changed) From owner-svn-src-all@FreeBSD.ORG Mon Apr 15 18:56:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B86071C4; Mon, 15 Apr 2013 18:56:03 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AA42B13A5; Mon, 15 Apr 2013 18:56:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3FIu3Qc031923; Mon, 15 Apr 2013 18:56:03 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3FIu3eX031922; Mon, 15 Apr 2013 18:56:03 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201304151856.r3FIu3eX031922@svn.freebsd.org> From: Mikolaj Golub Date: Mon, 15 Apr 2013 18:56:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249522 - stable/9/sys/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Apr 2013 18:56:03 -0000 Author: trociny Date: Mon Apr 15 18:56:03 2013 New Revision: 249522 URL: http://svnweb.freebsd.org/changeset/base/249522 Log: MFC r249240: Use pget(9) to reduce code duplication. Modified: stable/9/sys/kern/kern_descrip.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/kern_descrip.c ============================================================================== --- stable/9/sys/kern/kern_descrip.c Mon Apr 15 18:38:21 2013 (r249521) +++ stable/9/sys/kern/kern_descrip.c Mon Apr 15 18:56:03 2013 (r249522) @@ -3013,12 +3013,9 @@ sysctl_kern_proc_ofiledesc(SYSCTL_HANDLE int vfslocked; name = (int *)arg1; - if ((p = pfind((pid_t)name[0])) == NULL) - return (ESRCH); - if ((error = p_candebug(curthread, p))) { - PROC_UNLOCK(p); + error = pget((pid_t)name[0], PGET_CANDEBUG, &p); + if (error != 0) return (error); - } fdp = fdhold(p); PROC_UNLOCK(p); if (fdp == NULL) @@ -3330,12 +3327,9 @@ sysctl_kern_proc_filedesc(SYSCTL_HANDLER cap_rights_t fd_cap_rights; name = (int *)arg1; - if ((p = pfind((pid_t)name[0])) == NULL) - return (ESRCH); - if ((error = p_candebug(curthread, p))) { - PROC_UNLOCK(p); + error = pget((pid_t)name[0], PGET_CANDEBUG, &p); + if (error != 0) return (error); - } /* ktrace vnode */ tracevp = p->p_tracevp; if (tracevp != NULL) From owner-svn-src-all@FreeBSD.ORG Mon Apr 15 19:32:15 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7091FBE5; Mon, 15 Apr 2013 19:32:15 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 49677160D; Mon, 15 Apr 2013 19:32:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3FJWEX1043460; Mon, 15 Apr 2013 19:32:14 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3FJWEJB043459; Mon, 15 Apr 2013 19:32:14 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201304151932.r3FJWEJB043459@svn.freebsd.org> From: Warner Losh Date: Mon, 15 Apr 2013 19:32:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249523 - head/sys/mips/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Apr 2013 19:32:15 -0000 Author: imp Date: Mon Apr 15 19:32:14 2013 New Revision: 249523 URL: http://svnweb.freebsd.org/changeset/base/249523 Log: Fix N32/N64 register saving by ensuring that all registers resolve to unique values. There's some confusion about what the n32 assembler API really is (since on page 9 of the spec they say that t0-t3 don't exist, then turn around on page 22 and say that t4-t7 don't exist), and this doesn't touch that. NetBSD's version of this file follows the convention I used here, and is likely to be correct. This should fix gdb/ptrace. Modified: head/sys/mips/include/regnum.h Modified: head/sys/mips/include/regnum.h ============================================================================== --- head/sys/mips/include/regnum.h Mon Apr 15 18:56:03 2013 (r249522) +++ head/sys/mips/include/regnum.h Mon Apr 15 19:32:14 2013 (r249523) @@ -42,9 +42,8 @@ #ifndef _MACHINE_REGNUM_H_ #define _MACHINE_REGNUM_H_ -/* This must match the numbers - * in pcb.h and is used by - * swtch.S +/* + * This must match the numbers in pcb.h and is used by swtch.S */ #define PREG_S0 0 #define PREG_S1 1 @@ -64,6 +63,7 @@ /* * Location of the saved registers relative to ZERO. * This must match struct trapframe defined in frame.h exactly. + * This must also match regdef.h. */ #define ZERO 0 #define AST 1 @@ -73,6 +73,16 @@ #define A1 5 #define A2 6 #define A3 7 +#if defined(__mips_n32) || defined(__mips_n64) +#define A4 8 +#define A5 9 +#define A6 10 +#define A7 11 +#define T0 12 +#define T1 13 +#define T2 14 +#define T3 15 +#else #define T0 8 #define T1 9 #define T2 10 @@ -81,6 +91,7 @@ #define TA1 13 #define TA2 14 #define TA3 15 +#endif #define S0 16 #define S1 17 #define S2 18 @@ -113,6 +124,23 @@ #define NUMSAVEREGS 40 /* + * Pseudo registers so we save a complete set of registers regardless of + * the ABI + */ +#if defined(__mips_n32) || defined(__mips_n64) +#define TA0 8 +#define TA1 9 +#define TA2 10 +#define TA3 11 +#else +#define TA0 12 +#define TA1 13 +#define TA2 14 +#define TA3 15 +#endif + + +/* * Index of FP registers in 'struct frame', counting from the beginning * of the frame (i.e., including the general registers). */ From owner-svn-src-all@FreeBSD.ORG Mon Apr 15 19:45:11 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B9F07142; Mon, 15 Apr 2013 19:45:11 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9CC51168A; Mon, 15 Apr 2013 19:45:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3FJjB3C046465; Mon, 15 Apr 2013 19:45:11 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3FJj9nW046455; Mon, 15 Apr 2013 19:45:09 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201304151945.r3FJj9nW046455@svn.freebsd.org> From: Steven Hartland Date: Mon, 15 Apr 2013 19:45:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r249524 - in releng/8.4/sys: cddl/contrib/opensolaris/uts/common/fs/zfs cddl/contrib/opensolaris/uts/common/fs/zfs/sys kern sys X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Apr 2013 19:45:11 -0000 Author: smh Date: Mon Apr 15 19:45:09 2013 New Revision: 249524 URL: http://svnweb.freebsd.org/changeset/base/249524 Log: MFC three change sets (details below) which fix system shutdown and reboots hanging at "All buffers synced" when using ZFS. MFC r241556: Add a KPI to allow to reserve some amount of space in the numvnodes counter, without actually allocating the vnodes. For KBI stability, the td_vp_reserv was moved to the end of struct thread MFC r241628: zfs: make use of getnewvnode_reserve in zfs_mknode and zfs_zget MFC r243520, r243521: zfs: overhaul zfs-vfs glue for vnode life-cycle management Reviewed by: avg Approved by: re (jpaetzel), avg (co-mentor) Modified: releng/8.4/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h releng/8.4/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c releng/8.4/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c releng/8.4/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c releng/8.4/sys/kern/kern_thread.c releng/8.4/sys/kern/subr_trap.c releng/8.4/sys/kern/vfs_subr.c releng/8.4/sys/sys/proc.h releng/8.4/sys/sys/vnode.h Directory Properties: releng/8.4/sys/ (props changed) releng/8.4/sys/cddl/ (props changed) releng/8.4/sys/cddl/contrib/opensolaris/ (props changed) releng/8.4/sys/kern/ (props changed) releng/8.4/sys/sys/ (props changed) Modified: releng/8.4/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h ============================================================================== --- releng/8.4/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h Mon Apr 15 19:32:14 2013 (r249523) +++ releng/8.4/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h Mon Apr 15 19:45:09 2013 (r249524) @@ -207,8 +207,6 @@ typedef struct znode { list_node_t z_link_node; /* all znodes in fs link */ sa_handle_t *z_sa_hdl; /* handle to sa data */ boolean_t z_is_sa; /* are we native sa? */ - /* FreeBSD-specific field. */ - struct task z_task; } znode_t; Modified: releng/8.4/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- releng/8.4/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Mon Apr 15 19:32:14 2013 (r249523) +++ releng/8.4/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Mon Apr 15 19:45:09 2013 (r249524) @@ -1844,18 +1844,6 @@ zfsvfs_teardown(zfsvfs_t *zfsvfs, boolea zfsvfs->z_unmounted = B_TRUE; rrw_exit(&zfsvfs->z_teardown_lock, FTAG); rw_exit(&zfsvfs->z_teardown_inactive_lock); - -#ifdef __FreeBSD__ - /* - * Some znodes might not be fully reclaimed, wait for them. - */ - mutex_enter(&zfsvfs->z_znodes_lock); - while (list_head(&zfsvfs->z_all_znodes) != NULL) { - msleep(zfsvfs, &zfsvfs->z_znodes_lock, 0, - "zteardown", 0); - } - mutex_exit(&zfsvfs->z_znodes_lock); -#endif } /* Modified: releng/8.4/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- releng/8.4/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Apr 15 19:32:14 2013 (r249523) +++ releng/8.4/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Apr 15 19:45:09 2013 (r249524) @@ -4579,14 +4579,22 @@ zfs_inactive(vnode_t *vp, cred_t *cr, ca * The fs has been unmounted, or we did a * suspend/resume and this file no longer exists. */ - VI_LOCK(vp); - ASSERT(vp->v_count <= 1); - vp->v_count = 0; - VI_UNLOCK(vp); + rw_exit(&zfsvfs->z_teardown_inactive_lock); vrecycle(vp, curthread); + return; + } + + mutex_enter(&zp->z_lock); + if (zp->z_unlinked) { + /* + * Fast path to recycle a vnode of a removed file. + */ + mutex_exit(&zp->z_lock); rw_exit(&zfsvfs->z_teardown_inactive_lock); + vrecycle(vp, curthread); return; } + mutex_exit(&zp->z_lock); if (zp->z_atime_dirty && zp->z_unlinked == 0) { dmu_tx_t *tx = dmu_tx_create(zfsvfs->z_os); @@ -4605,8 +4613,6 @@ zfs_inactive(vnode_t *vp, cred_t *cr, ca dmu_tx_commit(tx); } } - - zfs_zinactive(zp); rw_exit(&zfsvfs->z_teardown_inactive_lock); } @@ -6116,28 +6122,6 @@ zfs_freebsd_inactive(ap) return (0); } -static void -zfs_reclaim_complete(void *arg, int pending) -{ - znode_t *zp = arg; - zfsvfs_t *zfsvfs = zp->z_zfsvfs; - - rw_enter(&zfsvfs->z_teardown_inactive_lock, RW_READER); - if (zp->z_sa_hdl != NULL) { - ZFS_OBJ_HOLD_ENTER(zfsvfs, zp->z_id); - zfs_znode_dmu_fini(zp); - ZFS_OBJ_HOLD_EXIT(zfsvfs, zp->z_id); - } - zfs_znode_free(zp); - rw_exit(&zfsvfs->z_teardown_inactive_lock); - /* - * If the file system is being unmounted, there is a process waiting - * for us, wake it up. - */ - if (zfsvfs->z_unmounted) - wakeup_one(zfsvfs); -} - static int zfs_freebsd_reclaim(ap) struct vop_reclaim_args /* { @@ -6148,53 +6132,25 @@ zfs_freebsd_reclaim(ap) vnode_t *vp = ap->a_vp; znode_t *zp = VTOZ(vp); zfsvfs_t *zfsvfs = zp->z_zfsvfs; - boolean_t rlocked; - - rlocked = rw_tryenter(&zfsvfs->z_teardown_inactive_lock, RW_READER); ASSERT(zp != NULL); - /* - * Destroy the vm object and flush associated pages. - */ + /* Destroy the vm object and flush associated pages. */ vnode_destroy_vobject(vp); - mutex_enter(&zp->z_lock); - zp->z_vnode = NULL; - mutex_exit(&zp->z_lock); - - if (zp->z_unlinked) { - ; /* Do nothing. */ - } else if (!rlocked) { - TASK_INIT(&zp->z_task, 0, zfs_reclaim_complete, zp); - taskqueue_enqueue(taskqueue_thread, &zp->z_task); - } else if (zp->z_sa_hdl == NULL) { + /* + * z_teardown_inactive_lock protects from a race with + * zfs_znode_dmu_fini in zfsvfs_teardown during + * force unmount. + */ + rw_enter(&zfsvfs->z_teardown_inactive_lock, RW_READER); + if (zp->z_sa_hdl == NULL) zfs_znode_free(zp); - } else /* if (!zp->z_unlinked && zp->z_dbuf != NULL) */ { - int locked; + else + zfs_zinactive(zp); + rw_exit(&zfsvfs->z_teardown_inactive_lock); - locked = MUTEX_HELD(ZFS_OBJ_MUTEX(zfsvfs, zp->z_id)) ? 2 : - ZFS_OBJ_HOLD_TRYENTER(zfsvfs, zp->z_id); - if (locked == 0) { - /* - * Lock can't be obtained due to deadlock possibility, - * so defer znode destruction. - */ - TASK_INIT(&zp->z_task, 0, zfs_reclaim_complete, zp); - taskqueue_enqueue(taskqueue_thread, &zp->z_task); - } else { - zfs_znode_dmu_fini(zp); - if (locked == 1) - ZFS_OBJ_HOLD_EXIT(zfsvfs, zp->z_id); - zfs_znode_free(zp); - } - } - VI_LOCK(vp); vp->v_data = NULL; - ASSERT(vp->v_holdcnt >= 1); - VI_UNLOCK(vp); - if (rlocked) - rw_exit(&zfsvfs->z_teardown_inactive_lock); return (0); } Modified: releng/8.4/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c ============================================================================== --- releng/8.4/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Mon Apr 15 19:32:14 2013 (r249523) +++ releng/8.4/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Mon Apr 15 19:45:09 2013 (r249524) @@ -855,6 +855,7 @@ zfs_mknode(znode_t *dzp, vattr_t *vap, d } } + getnewvnode_reserve(1); ZFS_OBJ_HOLD_ENTER(zfsvfs, obj); VERIFY(0 == sa_buf_hold(zfsvfs->z_os, obj, NULL, &db)); @@ -1041,6 +1042,7 @@ zfs_mknode(znode_t *dzp, vattr_t *vap, d KASSERT(err == 0, ("insmntque() failed: error %d", err)); } ZFS_OBJ_HOLD_EXIT(zfsvfs, obj); + getnewvnode_drop_reserve(); } /* @@ -1145,18 +1147,22 @@ zfs_zget(zfsvfs_t *zfsvfs, uint64_t obj_ dmu_object_info_t doi; dmu_buf_t *db; znode_t *zp; - int err; + vnode_t *vp; sa_handle_t *hdl; - int first = 1; - - *zpp = NULL; + struct thread *td; + int locked; + int err; + td = curthread; + getnewvnode_reserve(1); again: + *zpp = NULL; ZFS_OBJ_HOLD_ENTER(zfsvfs, obj_num); err = sa_buf_hold(zfsvfs->z_os, obj_num, NULL, &db); if (err) { ZFS_OBJ_HOLD_EXIT(zfsvfs, obj_num); + getnewvnode_drop_reserve(); return (err); } @@ -1167,6 +1173,7 @@ again: doi.doi_bonus_size < sizeof (znode_phys_t)))) { sa_buf_rele(db, NULL); ZFS_OBJ_HOLD_EXIT(zfsvfs, obj_num); + getnewvnode_drop_reserve(); return (EINVAL); } @@ -1188,48 +1195,39 @@ again: if (zp->z_unlinked) { err = ENOENT; } else { - vnode_t *vp; - int dying = 0; - vp = ZTOV(zp); - if (vp == NULL) - dying = 1; - else { - VN_HOLD(vp); - if ((vp->v_iflag & VI_DOOMED) != 0) { - dying = 1; - /* - * Don't VN_RELE() vnode here, because - * it can call vn_lock() which creates - * LOR between vnode lock and znode - * lock. We will VN_RELE() the vnode - * after droping znode lock. - */ - } - } - if (dying) { - if (first) { - ZFS_LOG(1, "dying znode detected (zp=%p)", zp); - first = 0; - } - /* - * znode is dying so we can't reuse it, we must - * wait until destruction is completed. - */ - sa_buf_rele(db, NULL); - mutex_exit(&zp->z_lock); - ZFS_OBJ_HOLD_EXIT(zfsvfs, obj_num); - if (vp != NULL) - VN_RELE(vp); - tsleep(zp, 0, "zcollide", 1); - goto again; - } *zpp = zp; err = 0; } sa_buf_rele(db, NULL); + + /* Don't let the vnode disappear after ZFS_OBJ_HOLD_EXIT. */ + if (err == 0) + VN_HOLD(vp); + mutex_exit(&zp->z_lock); ZFS_OBJ_HOLD_EXIT(zfsvfs, obj_num); + + if (err == 0) { + locked = VOP_ISLOCKED(vp); + VI_LOCK(vp); + if ((vp->v_iflag & VI_DOOMED) != 0 && + locked != LK_EXCLUSIVE) { + /* + * The vnode is doomed and this thread doesn't + * hold the exclusive lock on it, so the vnode + * must be being reclaimed by another thread. + * Otherwise the doomed vnode is being reclaimed + * by this thread and zfs_zget is called from + * ZIL internals. + */ + VI_UNLOCK(vp); + VN_RELE(vp); + goto again; + } + VI_UNLOCK(vp); + } + getnewvnode_drop_reserve(); return (err); } @@ -1265,6 +1263,7 @@ again: } } ZFS_OBJ_HOLD_EXIT(zfsvfs, obj_num); + getnewvnode_drop_reserve(); return (err); } @@ -1393,10 +1392,8 @@ zfs_znode_delete(znode_t *zp, dmu_tx_t * void zfs_zinactive(znode_t *zp) { - vnode_t *vp = ZTOV(zp); zfsvfs_t *zfsvfs = zp->z_zfsvfs; uint64_t z_id = zp->z_id; - int vfslocked; ASSERT(zp->z_sa_hdl); @@ -1406,19 +1403,6 @@ zfs_zinactive(znode_t *zp) ZFS_OBJ_HOLD_ENTER(zfsvfs, z_id); mutex_enter(&zp->z_lock); - VI_LOCK(vp); - if (vp->v_count > 0) { - /* - * If the hold count is greater than zero, somebody has - * obtained a new reference on this znode while we were - * processing it here, so we are done. - */ - VI_UNLOCK(vp); - mutex_exit(&zp->z_lock); - ZFS_OBJ_HOLD_EXIT(zfsvfs, z_id); - return; - } - VI_UNLOCK(vp); /* * If this was the last reference to a file with no links, @@ -1427,16 +1411,14 @@ zfs_zinactive(znode_t *zp) if (zp->z_unlinked) { mutex_exit(&zp->z_lock); ZFS_OBJ_HOLD_EXIT(zfsvfs, z_id); - ASSERT(vp->v_count == 0); - vrecycle(vp, curthread); - vfslocked = VFS_LOCK_GIANT(zfsvfs->z_vfs); zfs_rmnode(zp); - VFS_UNLOCK_GIANT(vfslocked); return; } mutex_exit(&zp->z_lock); + zfs_znode_dmu_fini(zp); ZFS_OBJ_HOLD_EXIT(zfsvfs, z_id); + zfs_znode_free(zp); } void @@ -1444,8 +1426,8 @@ zfs_znode_free(znode_t *zp) { zfsvfs_t *zfsvfs = zp->z_zfsvfs; - ASSERT(ZTOV(zp) == NULL); ASSERT(zp->z_sa_hdl == NULL); + zp->z_vnode = NULL; mutex_enter(&zfsvfs->z_znodes_lock); POINTER_INVALIDATE(&zp->z_zfsvfs); list_remove(&zfsvfs->z_all_znodes, zp); Modified: releng/8.4/sys/kern/kern_thread.c ============================================================================== --- releng/8.4/sys/kern/kern_thread.c Mon Apr 15 19:32:14 2013 (r249523) +++ releng/8.4/sys/kern/kern_thread.c Mon Apr 15 19:45:09 2013 (r249524) @@ -159,6 +159,7 @@ thread_init(void *mem, int size, int fla td->td_sleepqueue = sleepq_alloc(); td->td_turnstile = turnstile_alloc(); + td->td_vp_reserv = 0; EVENTHANDLER_INVOKE(thread_init, td); td->td_sched = (struct td_sched *)&td[1]; umtx_thread_init(td); Modified: releng/8.4/sys/kern/subr_trap.c ============================================================================== --- releng/8.4/sys/kern/subr_trap.c Mon Apr 15 19:32:14 2013 (r249523) +++ releng/8.4/sys/kern/subr_trap.c Mon Apr 15 19:45:09 2013 (r249524) @@ -132,6 +132,8 @@ userret(struct thread *td, struct trapfr sched_userret(td); KASSERT(td->td_locks == 0, ("userret: Returning with %d locks held.", td->td_locks)); + KASSERT(td->td_vp_reserv == 0, + ("userret: Returning while holding vnode reservation")); #ifdef VIMAGE /* Unfortunately td_vnet_lpush needs VNET_DEBUG. */ VNET_ASSERT(curvnet == NULL, Modified: releng/8.4/sys/kern/vfs_subr.c ============================================================================== --- releng/8.4/sys/kern/vfs_subr.c Mon Apr 15 19:32:14 2013 (r249523) +++ releng/8.4/sys/kern/vfs_subr.c Mon Apr 15 19:45:09 2013 (r249524) @@ -977,34 +977,22 @@ vtryrecycle(struct vnode *vp) } /* - * Return the next vnode from the free list. + * Wait for available vnodes. */ -int -getnewvnode(const char *tag, struct mount *mp, struct vop_vector *vops, - struct vnode **vpp) +static int +getnewvnode_wait(int suspended) { - struct vnode *vp = NULL; - struct bufobj *bo; - CTR3(KTR_VFS, "%s: mp %p with tag %s", __func__, mp, tag); - mtx_lock(&vnode_free_list_mtx); - /* - * Lend our context to reclaim vnodes if they've exceeded the max. - */ - if (freevnodes > wantfreevnodes) - vnlru_free(1); - /* - * Wait for available vnodes. - */ + mtx_assert(&vnode_free_list_mtx, MA_OWNED); if (numvnodes > desiredvnodes) { - if (mp != NULL && (mp->mnt_kern_flag & MNTK_SUSPEND)) { + if (suspended) { /* * File system is beeing suspended, we cannot risk a * deadlock here, so allocate new vnode anyway. */ if (freevnodes > wantfreevnodes) vnlru_free(freevnodes - wantfreevnodes); - goto alloc; + return (0); } if (vnlruproc_sig == 0) { vnlruproc_sig = 1; /* avoid unnecessary wakeups */ @@ -1012,16 +1000,76 @@ getnewvnode(const char *tag, struct moun } msleep(&vnlruproc_sig, &vnode_free_list_mtx, PVFS, "vlruwk", hz); -#if 0 /* XXX Not all VFS_VGET/ffs_vget callers check returns. */ - if (numvnodes > desiredvnodes) { - mtx_unlock(&vnode_free_list_mtx); - return (ENFILE); + } + return (numvnodes > desiredvnodes ? ENFILE : 0); +} + +void +getnewvnode_reserve(u_int count) +{ + struct thread *td; + + td = curthread; + mtx_lock(&vnode_free_list_mtx); + while (count > 0) { + if (getnewvnode_wait(0) == 0) { + count--; + td->td_vp_reserv++; + numvnodes++; } -#endif } -alloc: + mtx_unlock(&vnode_free_list_mtx); +} + +void +getnewvnode_drop_reserve(void) +{ + struct thread *td; + + td = curthread; + mtx_lock(&vnode_free_list_mtx); + KASSERT(numvnodes >= td->td_vp_reserv, ("reserve too large")); + numvnodes -= td->td_vp_reserv; + mtx_unlock(&vnode_free_list_mtx); + td->td_vp_reserv = 0; +} + +/* + * Return the next vnode from the free list. + */ +int +getnewvnode(const char *tag, struct mount *mp, struct vop_vector *vops, + struct vnode **vpp) +{ + struct vnode *vp; + struct bufobj *bo; + struct thread *td; + int error; + + CTR3(KTR_VFS, "%s: mp %p with tag %s", __func__, mp, tag); + vp = NULL; + td = curthread; + if (td->td_vp_reserv > 0) { + td->td_vp_reserv -= 1; + goto alloc; + } + mtx_lock(&vnode_free_list_mtx); + /* + * Lend our context to reclaim vnodes if they've exceeded the max. + */ + if (freevnodes > wantfreevnodes) + vnlru_free(1); + error = getnewvnode_wait(mp != NULL && (mp->mnt_kern_flag & + MNTK_SUSPEND)); +#if 0 /* XXX Not all VFS_VGET/ffs_vget callers check returns. */ + if (error != 0) { + mtx_unlock(&vnode_free_list_mtx); + return (error); + } +#endif numvnodes++; mtx_unlock(&vnode_free_list_mtx); +alloc: vp = (struct vnode *) uma_zalloc(vnode_zone, M_WAITOK|M_ZERO); /* * Setup locks. Modified: releng/8.4/sys/sys/proc.h ============================================================================== --- releng/8.4/sys/sys/proc.h Mon Apr 15 19:32:14 2013 (r249523) +++ releng/8.4/sys/sys/proc.h Mon Apr 15 19:45:09 2013 (r249524) @@ -308,6 +308,7 @@ struct thread { struct rusage_ext td_rux; /* (t) Internal rusage information. */ struct vm_map_entry *td_map_def_user; /* (k) Deferred entries. */ pid_t td_dbg_forked; /* (c) Child pid for debugger. */ + u_int td_vp_reserv; /* (k) Count of reserved vnodes. */ }; struct mtx *thread_lock_block(struct thread *); Modified: releng/8.4/sys/sys/vnode.h ============================================================================== --- releng/8.4/sys/sys/vnode.h Mon Apr 15 19:32:14 2013 (r249523) +++ releng/8.4/sys/sys/vnode.h Mon Apr 15 19:45:09 2013 (r249524) @@ -604,6 +604,8 @@ void cvtstat(struct stat *st, struct ost void cvtnstat(struct stat *sb, struct nstat *nsb); int getnewvnode(const char *tag, struct mount *mp, struct vop_vector *vops, struct vnode **vpp); +void getnewvnode_reserve(u_int count); +void getnewvnode_drop_reserve(void); int insmntque1(struct vnode *vp, struct mount *mp, void (*dtr)(struct vnode *, void *), void *dtr_arg); int insmntque(struct vnode *vp, struct mount *mp); From owner-svn-src-all@FreeBSD.ORG Mon Apr 15 20:06:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3E672905; Mon, 15 Apr 2013 20:06:57 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 212D61779; Mon, 15 Apr 2013 20:06:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3FK6vPm052271; Mon, 15 Apr 2013 20:06:57 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3FK6uv4052270; Mon, 15 Apr 2013 20:06:56 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201304152006.r3FK6uv4052270@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 15 Apr 2013 20:06:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249525 - head/libexec/rtld-elf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Apr 2013 20:06:57 -0000 Author: kib Date: Mon Apr 15 20:06:56 2013 New Revision: 249525 URL: http://svnweb.freebsd.org/changeset/base/249525 Log: The origin_subst_one() function limits the length of the string to PATH_MAX after the token substitution. This is wrong, because origin_subst_one() performs the substitution on the whole rpath and similar strings, which contain several pathes separated by colon. As result, long (but correct) rpath consisting of many path elements is rejected by the function. Correct the problem by rewriting the origin_subst_one() to perform two passes, first pass to calculate the number of substitutions to be performed, and second pass to generate the resulting string. Second pass allocates the memory for the result based on the count from the first pass, without enforcing a limit. Reported and tested by: pgj Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Mon Apr 15 19:45:09 2013 (r249524) +++ head/libexec/rtld-elf/rtld.c Mon Apr 15 20:06:56 2013 (r249525) @@ -145,9 +145,8 @@ static void unlink_object(Obj_Entry *); static void unload_object(Obj_Entry *); static void unref_dag(Obj_Entry *); static void ref_dag(Obj_Entry *); -static int origin_subst_one(char **, const char *, const char *, - const char *, char *); -static char *origin_subst(const char *, const char *); +static char *origin_subst_one(char *, const char *, const char *, bool); +static char *origin_subst(char *, const char *); static void preinit_main(void); static int rtld_verify_versions(const Objlist *); static int rtld_verify_object_versions(Obj_Entry *); @@ -748,79 +747,80 @@ basename(const char *name) static struct utsname uts; -static int -origin_subst_one(char **res, const char *real, const char *kw, const char *subst, - char *may_free) +static char * +origin_subst_one(char *real, const char *kw, const char *subst, + bool may_free) { - const char *p, *p1; - char *res1; - int subst_len; - int kw_len; - - res1 = *res = NULL; - p = real; - subst_len = kw_len = 0; - for (;;) { - p1 = strstr(p, kw); - if (p1 != NULL) { - if (subst_len == 0) { - subst_len = strlen(subst); - kw_len = strlen(kw); - } - if (*res == NULL) { - *res = xmalloc(PATH_MAX); - res1 = *res; - } - if ((res1 - *res) + subst_len + (p1 - p) >= PATH_MAX) { - _rtld_error("Substitution of %s in %s cannot be performed", - kw, real); - if (may_free != NULL) - free(may_free); - free(res); - return (false); - } - memcpy(res1, p, p1 - p); - res1 += p1 - p; - memcpy(res1, subst, subst_len); - res1 += subst_len; - p = p1 + kw_len; - } else { - if (*res == NULL) { - if (may_free != NULL) - *res = may_free; - else - *res = xstrdup(real); - return (true); - } - *res1 = '\0'; - if (may_free != NULL) - free(may_free); - if (strlcat(res1, p, PATH_MAX - (res1 - *res)) >= PATH_MAX) { - free(res); - return (false); - } - return (true); - } - } + char *p, *p1, *res, *resp; + int subst_len, kw_len, subst_count, old_len, new_len; + + kw_len = strlen(kw); + + /* + * First, count the number of the keyword occurences, to + * preallocate the final string. + */ + for (p = real, subst_count = 0;; p = p1 + kw_len, subst_count++) { + p1 = strstr(p, kw); + if (p1 == NULL) + break; + } + + /* + * If the keyword is not found, just return. + */ + if (subst_count == 0) + return (may_free ? real : xstrdup(real)); + + /* + * There is indeed something to substitute. Calculate the + * length of the resulting string, and allocate it. + */ + subst_len = strlen(subst); + old_len = strlen(real); + new_len = old_len + (subst_len - kw_len) * subst_count; + res = xmalloc(new_len + 1); + + /* + * Now, execute the substitution loop. + */ + for (p = real, resp = res;;) { + p1 = strstr(p, kw); + if (p1 != NULL) { + /* Copy the prefix before keyword. */ + memcpy(resp, p, p1 - p); + resp += p1 - p; + /* Keyword replacement. */ + memcpy(resp, subst, subst_len); + resp += subst_len; + p = p1 + kw_len; + } else + break; + } + + /* Copy to the end of string and finish. */ + strcat(resp, p); + if (may_free) + free(real); + return (res); } static char * -origin_subst(const char *real, const char *origin_path) +origin_subst(char *real, const char *origin_path) { - char *res1, *res2, *res3, *res4; + char *res1, *res2, *res3, *res4; - if (uts.sysname[0] == '\0') { - if (uname(&uts) != 0) { - _rtld_error("utsname failed: %d", errno); - return (NULL); + if (uts.sysname[0] == '\0') { + if (uname(&uts) != 0) { + _rtld_error("utsname failed: %d", errno); + return (NULL); + } } - } - if (!origin_subst_one(&res1, real, "$ORIGIN", origin_path, NULL) || - !origin_subst_one(&res2, res1, "$OSNAME", uts.sysname, res1) || - !origin_subst_one(&res3, res2, "$OSREL", uts.release, res2) || - !origin_subst_one(&res4, res3, "$PLATFORM", uts.machine, res3)) - return (NULL); - return (res4); + res1 = origin_subst_one(real, "$ORIGIN", origin_path, false); + res2 = origin_subst_one(res1, "$OSNAME", uts.sysname, true); + res3 = origin_subst_one(res2, "$OSREL", uts.release, true); + res4 = origin_subst_one(res3, "$PLATFORM", uts.machine, true); + return (res4); } static void @@ -1438,10 +1438,12 @@ find_library(const char *xname, const Ob xname); return NULL; } - if (objgiven && refobj->z_origin) - return origin_subst(xname, refobj->origin_path); - else - return xstrdup(xname); + if (objgiven && refobj->z_origin) { + return (origin_subst(__DECONST(char *, xname), + refobj->origin_path)); + } else { + return (xstrdup(xname)); + } } if (libmap_disable || !objgiven || From owner-svn-src-all@FreeBSD.ORG Mon Apr 15 20:16:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 79CC4D90; Mon, 15 Apr 2013 20:16:32 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6C93517EB; Mon, 15 Apr 2013 20:16:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3FKGWeO055192; Mon, 15 Apr 2013 20:16:32 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3FKGW5f055190; Mon, 15 Apr 2013 20:16:32 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201304152016.r3FKGW5f055190@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Mon, 15 Apr 2013 20:16:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249526 - head/cddl/lib/libdtrace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Apr 2013 20:16:32 -0000 Author: pfg Date: Mon Apr 15 20:16:31 2013 New Revision: 249526 URL: http://svnweb.freebsd.org/changeset/base/249526 Log: DTrace: NFS translators should be split into client/server pieces Merge change from illumos: 1731 DTrace NFS translators should be split into client/server pieces Illumos Revision: 13523:6763769941d2 This code seems to be currently unused on FreeBSD. Reference: https://www.illumos.org/issues/1731 Obtained from: Illumos MFC after: 1 week Added: head/cddl/lib/libdtrace/nfssrv.d - copied, changed from r249521, head/cddl/lib/libdtrace/nfs.d Modified: head/cddl/lib/libdtrace/nfs.d Modified: head/cddl/lib/libdtrace/nfs.d ============================================================================== --- head/cddl/lib/libdtrace/nfs.d Mon Apr 15 20:06:56 2013 (r249525) +++ head/cddl/lib/libdtrace/nfs.d Mon Apr 15 20:16:31 2013 (r249526) @@ -32,7 +32,7 @@ #pragma D depends_on library ip.d #pragma D depends_on library net.d -#pragma D depends_on module genunix +#pragma D depends_on module nfs typedef struct nfsv4opinfo { uint64_t noi_xid; /* unique transation ID */ @@ -76,21 +76,3 @@ translator nfsv4opinfo_t < struct compou noi_cred = P->basecr; noi_curpath = (P->vp == NULL) ? "" : P->vp->v_path; }; - -#pragma D binding "1.5" translator -translator conninfo_t < rfs4_client_t *P > { - ci_protocol = (P->cl_addr.ss_family == AF_INET) ? "ipv4" : "ipv6"; - - ci_local = ""; - - ci_remote = (P->cl_addr.ss_family == AF_INET) ? - inet_ntoa((ipaddr_t *) - &((struct sockaddr_in *)&P->cl_addr)->sin_addr) : - inet_ntoa6(&((struct sockaddr_in6 *)&P->cl_addr)->sin6_addr); -}; - -#pragma D binding "1.5" translator -translator nfsv4cbinfo_t < rfs4_deleg_state_t *P > { - nci_curpath = (P->finfo->vp == NULL) ? "" : - P->finfo->vp->v_path; -}; Copied and modified: head/cddl/lib/libdtrace/nfssrv.d (from r249521, head/cddl/lib/libdtrace/nfs.d) ============================================================================== --- head/cddl/lib/libdtrace/nfs.d Mon Apr 15 18:38:21 2013 (r249521, copy source) +++ head/cddl/lib/libdtrace/nfssrv.d Mon Apr 15 20:16:31 2013 (r249526) @@ -32,50 +32,8 @@ #pragma D depends_on library ip.d #pragma D depends_on library net.d -#pragma D depends_on module genunix - -typedef struct nfsv4opinfo { - uint64_t noi_xid; /* unique transation ID */ - cred_t *noi_cred; /* credentials for operation */ - string noi_curpath; /* current file handle path (if any) */ -} nfsv4opinfo_t; - -typedef struct nfsv4cbinfo { - string nci_curpath; /* current file handle path (if any) */ -} nfsv4cbinfo_t; - -#pragma D binding "1.5" translator -translator conninfo_t < struct svc_req *P > { - ci_protocol = P->rq_xprt->xp_master->xp_netid == "tcp" ? "ipv4" : - P->rq_xprt->xp_master->xp_netid == "tcp6" ? "ipv6" : - ""; - - ci_local = inet_ntoa6(&((conn_t *)P->rq_xprt->xp_xpc. - xpc_wq->q_next->q_ptr)->connua_v6addr.connua_laddr); - - ci_remote = inet_ntoa6(&((conn_t *)P->rq_xprt->xp_xpc. - xpc_wq->q_next->q_ptr)->connua_v6addr.connua_faddr); -}; - -#pragma D binding "1.5" translator -translator conninfo_t < struct compound_state *P > { - ci_protocol = P->req->rq_xprt->xp_master->xp_netid == "tcp" ? "ipv4" : - P->req->rq_xprt->xp_master->xp_netid == "tcp6" ? "ipv6" : - ""; - - ci_local = inet_ntoa6(&((conn_t *)P->req->rq_xprt->xp_xpc. - xpc_wq->q_next->q_ptr)->connua_v6addr.connua_laddr); - - ci_remote = inet_ntoa6(&((conn_t *)P->req->rq_xprt->xp_xpc. - xpc_wq->q_next->q_ptr)->connua_v6addr.connua_faddr); -}; - -#pragma D binding "1.5" translator -translator nfsv4opinfo_t < struct compound_state *P > { - noi_xid = P->req->rq_xprt->xp_xid; - noi_cred = P->basecr; - noi_curpath = (P->vp == NULL) ? "" : P->vp->v_path; -}; +#pragma D depends_on module nfs.d +#pragma D depends_on module nfssrv #pragma D binding "1.5" translator translator conninfo_t < rfs4_client_t *P > { From owner-svn-src-all@FreeBSD.ORG Mon Apr 15 21:02:40 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id AF15F95; Mon, 15 Apr 2013 21:02:40 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 918501B41; Mon, 15 Apr 2013 21:02:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3FL2eRB068170; Mon, 15 Apr 2013 21:02:40 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3FL2eku068169; Mon, 15 Apr 2013 21:02:40 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201304152102.r3FL2eku068169@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Mon, 15 Apr 2013 21:02:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249528 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Apr 2013 21:02:40 -0000 Author: ae Date: Mon Apr 15 21:02:40 2013 New Revision: 249528 URL: http://svnweb.freebsd.org/changeset/base/249528 Log: The source address selection algorithm tries to apply several rules for the set of IPv6 addresses. Now each attempt goes into IPv6 statistics, even if given rule did not won. Change this and take into account only those rules, that won. Also add accounting for cases, when algorithm fails to select an address. Modified: head/sys/netinet6/in6_src.c Modified: head/sys/netinet6/in6_src.c ============================================================================== --- head/sys/netinet6/in6_src.c Mon Apr 15 20:57:55 2013 (r249527) +++ head/sys/netinet6/in6_src.c Mon Apr 15 21:02:40 2013 (r249528) @@ -151,9 +151,7 @@ static struct in6_addrpolicy *match_addr * an entry to the caller for later use. */ #define REPLACE(r) do {\ - if ((r) < sizeof(V_ip6stat.ip6s_sources_rule) / \ - sizeof(V_ip6stat.ip6s_sources_rule[0])) /* check for safety */ \ - IP6STAT_INC(ip6s_sources_rule[(r)]); \ + rule = (r); \ /* { \ char ip6buf[INET6_ADDRSTRLEN], ip6b[INET6_ADDRSTRLEN]; \ printf("in6_selectsrc: replace %s with %s by %d\n", ia_best ? ip6_sprintf(ip6buf, &ia_best->ia_addr.sin6_addr) : "none", ip6_sprintf(ip6b, &ia->ia_addr.sin6_addr), (r)); \ @@ -161,9 +159,6 @@ static struct in6_addrpolicy *match_addr goto replace; \ } while(0) #define NEXT(r) do {\ - if ((r) < sizeof(V_ip6stat.ip6s_sources_rule) / \ - sizeof(V_ip6stat.ip6s_sources_rule[0])) /* check for safety */ \ - IP6STAT_INC(ip6s_sources_rule[(r)]); \ /* { \ char ip6buf[INET6_ADDRSTRLEN], ip6b[INET6_ADDRSTRLEN]; \ printf("in6_selectsrc: keep %s against %s by %d\n", ia_best ? ip6_sprintf(ip6buf, &ia_best->ia_addr.sin6_addr) : "none", ip6_sprintf(ip6b, &ia->ia_addr.sin6_addr), (r)); \ @@ -171,9 +166,7 @@ static struct in6_addrpolicy *match_addr goto next; /* XXX: we can't use 'continue' here */ \ } while(0) #define BREAK(r) do { \ - if ((r) < sizeof(V_ip6stat.ip6s_sources_rule) / \ - sizeof(V_ip6stat.ip6s_sources_rule[0])) /* check for safety */ \ - IP6STAT_INC(ip6s_sources_rule[(r)]); \ + rule = (r); \ goto out; /* XXX: we can't use 'break' here */ \ } while(0) @@ -190,7 +183,7 @@ in6_selectsrc(struct sockaddr_in6 *dstso struct in6_addrpolicy *dst_policy = NULL, *best_policy = NULL; u_int32_t odstzone; int prefer_tempaddr; - int error; + int error, rule; struct ip6_moptions *mopts; KASSERT(srcp != NULL, ("%s: srcp is NULL", __func__)); @@ -306,6 +299,7 @@ in6_selectsrc(struct sockaddr_in6 *dstso if (error) return (error); + rule = 0; IN6_IFADDR_RLOCK(); TAILQ_FOREACH(ia, &V_in6_ifaddrhead, ia_link) { int new_scope = -1, new_matchlen = -1; @@ -487,6 +481,7 @@ in6_selectsrc(struct sockaddr_in6 *dstso if ((ia = ia_best) == NULL) { IN6_IFADDR_RUNLOCK(); + IP6STAT_INC(ip6s_sources_none); return (EADDRNOTAVAIL); } @@ -503,6 +498,7 @@ in6_selectsrc(struct sockaddr_in6 *dstso if (cred != NULL && prison_local_ip6(cred, &tmp, (inp != NULL && (inp->inp_flags & IN6P_IPV6_V6ONLY) != 0)) != 0) { IN6_IFADDR_RUNLOCK(); + IP6STAT_INC(ip6s_sources_none); return (EADDRNOTAVAIL); } @@ -511,6 +507,7 @@ in6_selectsrc(struct sockaddr_in6 *dstso bcopy(&tmp, srcp, sizeof(*srcp)); IN6_IFADDR_RUNLOCK(); + IP6STAT_INC(ip6s_sources_rule[rule]); return (0); } From owner-svn-src-all@FreeBSD.ORG Mon Apr 15 21:50:45 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B5E7CB4C; Mon, 15 Apr 2013 21:50:45 +0000 (UTC) (envelope-from peter@rulingia.com) Received: from vps.rulingia.com (host-122-100-2-194.octopus.com.au [122.100.2.194]) by mx1.freebsd.org (Postfix) with ESMTP id 4EA3B1D23; Mon, 15 Apr 2013 21:50:44 +0000 (UTC) Received: from server.rulingia.com (c220-239-237-213.belrs5.nsw.optusnet.com.au [220.239.237.213]) by vps.rulingia.com (8.14.5/8.14.5) with ESMTP id r3FLoYLa090142 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 16 Apr 2013 07:50:35 +1000 (EST) (envelope-from peter@rulingia.com) X-Bogosity: Ham, spamicity=0.000000 Received: from server.rulingia.com (localhost.rulingia.com [127.0.0.1]) by server.rulingia.com (8.14.5/8.14.5) with ESMTP id r3FLoN0C081669 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 16 Apr 2013 07:50:23 +1000 (EST) (envelope-from peter@server.rulingia.com) Received: (from peter@localhost) by server.rulingia.com (8.14.5/8.14.5/Submit) id r3FLoMeD081667; Tue, 16 Apr 2013 07:50:22 +1000 (EST) (envelope-from peter) Date: Tue, 16 Apr 2013 07:50:22 +1000 From: Peter Jeremy To: Tim Kientzle Subject: Re: svn commit: r249484 - head/lib Message-ID: <20130415215022.GA80800@server.rulingia.com> References: <201304141913.r3EJDqPI095965@svn.freebsd.org> <20130415123349.GA27773@gpr.nnz-home.ru> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="7JfCtLOvnd9MIVvH" Content-Disposition: inline In-Reply-To: <20130415123349.GA27773@gpr.nnz-home.ru> X-PGP-Key: http://www.rulingia.com/keys/peter.pgp User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Apr 2013 21:50:45 -0000 --7JfCtLOvnd9MIVvH Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Apr 14, 2013 at 07:13:52PM +0000, Tim Kientzle wrote: > Install a symlink > /usr/lib/include =3D=3D> /usr/include April 1st was several weeks ago. =20 > This fixes -print-file-name=3Dinclude in clang (and is > arguably a better way to fix the same issue in GCC than > the change I made in r231336). I would disagree that this is a better solution. On 2013-Apr-15 16:33:50 +0400, Gennady Proskurin wrote: >Here is the quote from r231336 commit message: > Implement -print-file-name=3Dinclude (which is undocumented > but used by some Linux boot loaders). I don't see why base needs to grow an ugly symlink to support a couple of ports. Surely if ports rely on an undocumented features of the toolchain, the correct solution is to fix the ports. --=20 Peter Jeremy --7JfCtLOvnd9MIVvH Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlFsdh4ACgkQ/opHv/APuIcU/wCgm10wx4BCOn6BiUS/+RDxg5HY uOkAoLF+UfEXIXRN/sraEyrLumxW/arb =MHIT -----END PGP SIGNATURE----- --7JfCtLOvnd9MIVvH-- From owner-svn-src-all@FreeBSD.ORG Tue Apr 16 04:20:05 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D6CC2E92; Tue, 16 Apr 2013 04:20:05 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from tux-cave.hellug.gr (tux-cave.hellug.gr [195.134.99.74]) by mx1.freebsd.org (Postfix) with ESMTP id 5350BB51; Tue, 16 Apr 2013 04:20:04 +0000 (UTC) X-Spam-Status: No X-Hellug-MailScanner-From: keramida@ceid.upatras.gr X-Hellug-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-2.9, required 5, autolearn=not spam, ALL_TRUSTED -1.00, BAYES_00 -1.90) X-Hellug-MailScanner: Found to be clean X-Hellug-MailScanner-ID: r3G4JpGM001874 Received: from saturn.laptop (217-162-217-29.dynamic.hispeed.ch [217.162.217.29]) (authenticated bits=0) by tux-cave.hellug.gr (8.14.3/8.14.3/Debian-9.4) with ESMTP id r3G4JpGM001874 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 16 Apr 2013 07:19:59 +0300 Received: from saturn.laptop (localhost [127.0.0.1]) by saturn.laptop (8.14.4/8.14.4/Debian-2.1ubuntu1) with ESMTP id r3G4JiTk011526 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 16 Apr 2013 06:19:44 +0200 Received: (from keramida@localhost) by saturn.laptop (8.14.4/8.14.4/Submit) id r3G4Jh3F011523; Tue, 16 Apr 2013 06:19:43 +0200 X-Authentication-Warning: saturn.laptop: keramida set sender to keramida@ceid.upatras.gr using -f From: keramida@ceid.upatras.gr (=?utf-8?B?zpPOuc+Oz4HOs86/z4IgzprOtc+BzrE=?= =?utf-8?B?zrzOr860zrHPgg==?=) To: Dimitry Andric , Gregory Shapiro Subject: Re: svn commit: r246880 - in head: lib/libsm libexec/mail.local libexec/smrsh share/mk usr.bin/vacation usr.sbin/sendmail References: <201302162017.r1GKHVdY022667@svn.freebsd.org> Date: Tue, 16 Apr 2013 06:19:43 +0200 In-Reply-To: <201302162017.r1GKHVdY022667@svn.freebsd.org> (Dimitry Andric's message of "Sat, 16 Feb 2013 20:17:31 +0000 (UTC)") Message-ID: <87a9ozayzk.fsf@saturn.laptop> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 04:20:05 -0000 On Sat, 16 Feb 2013 20:17:31 +0000 (UTC), Dimitry Andric wrote: > Author: dim > Date: Sat Feb 16 20:17:31 2013 > New Revision: 246880 > URL: http://svnweb.freebsd.org/changeset/base/246880 > > Log: > Since clang 3.2 now has an option to suppress warnings about implicitly > promoted K&R parameters, remove the workarounds added for sendmail > components in r228558. > > MFC after: 1 week > Modified: head/usr.sbin/sendmail/Makefile > ============================================================================== > --- head/usr.sbin/sendmail/Makefile Sat Feb 16 19:11:57 2013 (r246879) > +++ head/usr.sbin/sendmail/Makefile Sat Feb 16 20:17:31 2013 (r246880) > @@ -45,11 +45,6 @@ CFLAGS+= -DNETINET6 > > WARNS?= 1 > > -# Unfortunately, clang gives warnings about sendmail code that cannot > -# be turned off yet. Since this is contrib code, and we don't really > -# care about the warnings, just make them non-fatal for now. > -NO_WERROR.clang= > - > DPADD= ${LIBUTIL} ${LIBWRAP} > LDADD= -lutil -lwrap The part of the commit that removes NO_WERROR.clang for usr.sbin/sendmail/ breaks the build of Sendmail with -DSASL. I just tried rebuilding Sendmail with the following in "/etc/make.conf": # Build Sendmail with SASL support. SENDMAIL_CFLAGS ?= -I/usr/local/include -DSASL=20126 SENDMAIL_LDFLAGS ?= -L/usr/local/lib SENDMAIL_LDADD ?= -lsasl2 The warnings that usersmtp.c still triggers when -DSASL is used are: : cc -O2 -pipe -I/usr/src/usr.sbin/sendmail/../../contrib/sendmail/src -I/usr/src/usr.sbin/sendmail/../../contrib/sendmail/include -I. -DNEWDB -DNIS -DTCPWRAPPERS -DMAP_REGEX -DDNSMAP -DNETINET6 -DSTARTTLS -D_FFR_TLS_1 -I/usr/local/include -DSASL=20126 -std=gnu99 -Qunused-arguments -fstack-protector -Wsystem-headers -Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality -Wno-unused-function -Wno-conversion -Wno-switch -Wno-switch-enum -Wno-knr-promoted-parameter -Wno-parentheses -c /usr/src/usr.sbin/sendmail/../../contrib/sendmail/src/usersmtp.c : /usr/src/usr.sbin/sendmail/../../contrib/sendmail/src/usersmtp.c:1797:50: warning: incompatible pointer types passing 'void ()' to parameter of type 'void (*)(char *, bool, MAILER *, struct : mailer_con_info *, ENVELOPE *)' [-Wincompatible-pointer-types] : smtpresult = reply(m, mci, e, TimeOuts.to_auth, getsasldata, NULL, : ^~~~~~~~~~~ : /usr/src/usr.sbin/sendmail/../../contrib/sendmail/src/sendmail.h:2519:67: note: passing argument to parameter here : extern int reply __P((MAILER *, MCI *, ENVELOPE *, time_t, void (*)__P((char *, bool, MAILER *, MCI *, ENVELOPE *)), char **, int)); : ^ : /usr/include/sys/cdefs.h:136:21: note: expanded from macro '__P' : #define __P(protos) protos /* full-blown ANSI C */ : ^ : /usr/src/usr.sbin/sendmail/../../contrib/sendmail/src/usersmtp.c:1842:9: warning: incompatible pointer types passing 'void ()' to parameter of type 'void (*)(char *, bool, MAILER *, struct : mailer_con_info *, ENVELOPE *)' [-Wincompatible-pointer-types] : getsasldata, NULL, XS_AUTH); : ^~~~~~~~~~~ : /usr/src/usr.sbin/sendmail/../../contrib/sendmail/src/sendmail.h:2519:67: note: passing argument to parameter here : extern int reply __P((MAILER *, MCI *, ENVELOPE *, time_t, void (*)__P((char *, bool, MAILER *, MCI *, ENVELOPE *)), char **, int)); : ^ : /usr/include/sys/cdefs.h:136:21: note: expanded from macro '__P' : #define __P(protos) protos /* full-blown ANSI C */ : ^ : /usr/src/usr.sbin/sendmail/../../contrib/sendmail/src/usersmtp.c:1864:8: warning: incompatible pointer types passing 'void ()' to parameter of type 'void (*)(char *, bool, MAILER *, struct : mailer_con_info *, ENVELOPE *)' [-Wincompatible-pointer-types] : getsasldata, NULL, XS_AUTH); : ^~~~~~~~~~~ : /usr/src/usr.sbin/sendmail/../../contrib/sendmail/src/sendmail.h:2519:67: note: passing argument to parameter here : extern int reply __P((MAILER *, MCI *, ENVELOPE *, time_t, void (*)__P((char *, bool, MAILER *, MCI *, ENVELOPE *)), char **, int)); : ^ : /usr/include/sys/cdefs.h:136:21: note: expanded from macro '__P' : #define __P(protos) protos /* full-blown ANSI C */ : ^ : 3 warnings generated. We have to either fix the warnings in the contrib/sendmail/src/usersmtp.c code or put back NO_WERROR.clang, at least for usr.sbin/sendmail/Makefile. From owner-svn-src-all@FreeBSD.ORG Tue Apr 16 04:24:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 966BFF5; Tue, 16 Apr 2013 04:24:46 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from onyx.glenbarber.us (onyx.glenbarber.us [IPv6:2607:fc50:1000:c200::face]) by mx1.freebsd.org (Postfix) with ESMTP id 6CE1ABD9; Tue, 16 Apr 2013 04:24:46 +0000 (UTC) Received: from glenbarber.us (70.15.88.86.res-cmts.sewb.ptd.net [70.15.88.86]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gjb) by onyx.glenbarber.us (Postfix) with ESMTPSA id A694923F804; Tue, 16 Apr 2013 00:24:44 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.8.2 onyx.glenbarber.us A694923F804 Authentication-Results: onyx.glenbarber.us; dkim=none reason="no signature"; dkim-adsp=none Date: Tue, 16 Apr 2013 00:24:42 -0400 From: Glen Barber To: Edward Tomasz Napierala Subject: Re: svn commit: r249510 - in stable/9: share/man/man4 sys/cam/ctl sys/modules sys/modules/ctl usr.bin/ctlstat usr.sbin/ctladm Message-ID: <20130416042442.GI1553@glenbarber.us> References: <201304151716.r3FHGCdT000602@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="aFi3jz1oiPowsTUB" Content-Disposition: inline In-Reply-To: <201304151716.r3FHGCdT000602@svn.freebsd.org> X-Operating-System: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 04:24:46 -0000 --aFi3jz1oiPowsTUB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Apr 15, 2013 at 05:16:12PM +0000, Edward Tomasz Napierala wrote: > Author: trasz > Date: Mon Apr 15 17:16:12 2013 > New Revision: 249510 > URL: http://svnweb.freebsd.org/changeset/base/249510 >=20 > Log: > MFC r249009: > =20 > Make it possible to build CTL as a module. > =20 > MFC r249022 by glebius@: > =20 > - Remove extra $FreeBSD$ > - Touch options headers to make module buildable. >=20 I think this commit has broken stable/9. Glen --aFi3jz1oiPowsTUB Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQEcBAEBCAAGBQJRbNKKAAoJEFJPDDeguUajd7MH/i+mmOY5b3msKLKWep91rHke dT8u+hqht55Oo+KghlDywQwT2jpOmA/szEGAzAy+xnljJfFKjdbHuuJIF/W8ePbb W1vQUaVoco4IjxkR0qUcaKD02XyCrDuFQ4h8vYevzeyp+pMDH5Yw8hxKa/FhWknt 4S8n07FRVRU0tpiu5VEOmG51hHapMcVKkVrUYLGxp1EFxzP7TJ0dO6f3in2eoSL0 qkSwV1n/mv0yfmBuDneTZOMc+MJ57D4hW8XvKWEM0M/dre19N8m1kyuLm+2LNQoc nr97nL0kOlae34hW5Qyr5NhTsM3zA+MrVxcp8TRRxP9oQJUy7/nmmsFUdwlyG7g= =jEBq -----END PGP SIGNATURE----- --aFi3jz1oiPowsTUB-- From owner-svn-src-all@FreeBSD.ORG Tue Apr 16 05:57:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 15601A0A; Tue, 16 Apr 2013 05:57:17 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E0523E24; Tue, 16 Apr 2013 05:57:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3G5vGr9020536; Tue, 16 Apr 2013 05:57:16 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3G5vGMs020535; Tue, 16 Apr 2013 05:57:16 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201304160557.r3G5vGMs020535@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 16 Apr 2013 05:57:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249530 - stable/9/sys/modules X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 05:57:17 -0000 Author: trasz Date: Tue Apr 16 05:57:16 2013 New Revision: 249530 URL: http://svnweb.freebsd.org/changeset/base/249530 Log: Disconnect the CTL module for now; it breaks i386 XEN. Modified: stable/9/sys/modules/Makefile Modified: stable/9/sys/modules/Makefile ============================================================================== --- stable/9/sys/modules/Makefile Mon Apr 15 21:58:47 2013 (r249529) +++ stable/9/sys/modules/Makefile Tue Apr 16 05:57:16 2013 (r249530) @@ -75,7 +75,6 @@ SUBDIR= \ ${_cryptodev} \ ${_cs} \ ${_ctau} \ - ctl \ ${_cxgb} \ cxgbe \ ${_cyclic} \ From owner-svn-src-all@FreeBSD.ORG Tue Apr 16 06:17:15 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E3410EA4; Tue, 16 Apr 2013 06:17:15 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D5F5EEBE; Tue, 16 Apr 2013 06:17:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3G6HFLo027129; Tue, 16 Apr 2013 06:17:15 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3G6HFZY027128; Tue, 16 Apr 2013 06:17:15 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201304160617.r3G6HFZY027128@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 16 Apr 2013 06:17:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249531 - stable/9/sys/vm X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 06:17:16 -0000 Author: kib Date: Tue Apr 16 06:17:15 2013 New Revision: 249531 URL: http://svnweb.freebsd.org/changeset/base/249531 Log: MFC r249303: Fix the assertions for the state of the object under the map entry with the MAP_ENTRY_VN_WRITECNT flag. Modified: stable/9/sys/vm/vm_map.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/vm/vm_map.c ============================================================================== --- stable/9/sys/vm/vm_map.c Tue Apr 16 05:57:16 2013 (r249530) +++ stable/9/sys/vm/vm_map.c Tue Apr 16 06:17:15 2013 (r249531) @@ -3160,6 +3160,22 @@ vmspace_fork(struct vmspace *vm1, vm_oof object->charge = old_entry->end - old_entry->start; old_entry->cred = NULL; } + + /* + * Assert the correct state of the vnode + * v_writecount while the object is locked, to + * not relock it later for the assertion + * correctness. + */ + if (old_entry->eflags & MAP_ENTRY_VN_WRITECNT && + object->type == OBJT_VNODE) { + KASSERT(((struct vnode *)object->handle)-> + v_writecount > 0, + ("vmspace_fork: v_writecount %p", object)); + KASSERT(object->un_pager.vnp.writemappings > 0, + ("vmspace_fork: vnp.writecount %p", + object)); + } VM_OBJECT_UNLOCK(object); /* @@ -3171,12 +3187,6 @@ vmspace_fork(struct vmspace *vm1, vm_oof MAP_ENTRY_IN_TRANSITION); new_entry->wired_count = 0; if (new_entry->eflags & MAP_ENTRY_VN_WRITECNT) { - object = new_entry->object.vm_object; - KASSERT(((struct vnode *)object->handle)-> - v_writecount > 0, - ("vmspace_fork: v_writecount")); - KASSERT(object->un_pager.vnp.writemappings > 0, - ("vmspace_fork: vnp.writecount")); vnode_pager_update_writecount(object, new_entry->start, new_entry->end); } From owner-svn-src-all@FreeBSD.ORG Tue Apr 16 06:20:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 63444C1; Tue, 16 Apr 2013 06:20:36 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 52E2EED6; Tue, 16 Apr 2013 06:20:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3G6KauP029064; Tue, 16 Apr 2013 06:20:36 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3G6Kasa029062; Tue, 16 Apr 2013 06:20:36 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201304160620.r3G6Kasa029062@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 16 Apr 2013 06:20:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249532 - in stable/9/sys: amd64/amd64 i386/i386 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 06:20:36 -0000 Author: kib Date: Tue Apr 16 06:20:35 2013 New Revision: 249532 URL: http://svnweb.freebsd.org/changeset/base/249532 Log: MFC r249439: Fix the name of the pcb member in the comments. Modified: stable/9/sys/amd64/amd64/support.S stable/9/sys/i386/i386/support.s Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/amd64/amd64/support.S ============================================================================== --- stable/9/sys/amd64/amd64/support.S Tue Apr 16 06:17:15 2013 (r249531) +++ stable/9/sys/amd64/amd64/support.S Tue Apr 16 06:20:35 2013 (r249532) @@ -200,9 +200,9 @@ END(fillw) * Access user memory from inside the kernel. These routines should be * the only places that do this. * - * These routines set curpcb->onfault for the time they execute. When a + * These routines set curpcb->pcb_onfault for the time they execute. When a * protection violation occurs inside the functions, the trap handler - * returns to *curpcb->onfault instead of the function. + * returns to *curpcb->pcb_onfault instead of the function. */ /* Modified: stable/9/sys/i386/i386/support.s ============================================================================== --- stable/9/sys/i386/i386/support.s Tue Apr 16 06:17:15 2013 (r249531) +++ stable/9/sys/i386/i386/support.s Tue Apr 16 06:20:35 2013 (r249532) @@ -262,9 +262,9 @@ END(memcpy) * write permissions when we are executing with EPL 0. The 486 does check * this if the WP bit is set in CR0, so we can use a simpler version here. * - * These routines set curpcb->onfault for the time they execute. When a + * These routines set curpcb->pcb_onfault for the time they execute. When a * protection violation occurs inside the functions, the trap handler - * returns to *curpcb->onfault instead of the function. + * returns to *curpcb->pcb_onfault instead of the function. */ /* From owner-svn-src-all@FreeBSD.ORG Tue Apr 16 06:21:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8BA9B23D; Tue, 16 Apr 2013 06:21:58 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7DE80EE5; Tue, 16 Apr 2013 06:21:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3G6Lwre029447; Tue, 16 Apr 2013 06:21:58 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3G6LwkQ029445; Tue, 16 Apr 2013 06:21:58 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201304160621.r3G6LwkQ029445@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 16 Apr 2013 06:21:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r249533 - in stable/8/sys: amd64/amd64 i386/i386 X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 06:21:58 -0000 Author: kib Date: Tue Apr 16 06:21:57 2013 New Revision: 249533 URL: http://svnweb.freebsd.org/changeset/base/249533 Log: MFC r249439: Fix the name of the pcb member in the comments. Modified: stable/8/sys/amd64/amd64/support.S stable/8/sys/i386/i386/support.s Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/ (props changed) stable/8/sys/i386/ (props changed) Modified: stable/8/sys/amd64/amd64/support.S ============================================================================== --- stable/8/sys/amd64/amd64/support.S Tue Apr 16 06:20:35 2013 (r249532) +++ stable/8/sys/amd64/amd64/support.S Tue Apr 16 06:21:57 2013 (r249533) @@ -212,9 +212,9 @@ END(fillw) * Access user memory from inside the kernel. These routines should be * the only places that do this. * - * These routines set curpcb->onfault for the time they execute. When a + * These routines set curpcb->pcb_onfault for the time they execute. When a * protection violation occurs inside the functions, the trap handler - * returns to *curpcb->onfault instead of the function. + * returns to *curpcb->pcb_onfault instead of the function. */ /* Modified: stable/8/sys/i386/i386/support.s ============================================================================== --- stable/8/sys/i386/i386/support.s Tue Apr 16 06:20:35 2013 (r249532) +++ stable/8/sys/i386/i386/support.s Tue Apr 16 06:21:57 2013 (r249533) @@ -274,9 +274,9 @@ END(memcpy) * write permissions when we are executing with EPL 0. The 486 does check * this if the WP bit is set in CR0, so we can use a simpler version here. * - * These routines set curpcb->onfault for the time they execute. When a + * These routines set curpcb->pcb_onfault for the time they execute. When a * protection violation occurs inside the functions, the trap handler - * returns to *curpcb->onfault instead of the function. + * returns to *curpcb->pcb_onfault instead of the function. */ /* From owner-svn-src-all@FreeBSD.ORG Tue Apr 16 06:51:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8DEE594D; Tue, 16 Apr 2013 06:51:07 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 80D9DFF0; Tue, 16 Apr 2013 06:51:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3G6p7Oa038185; Tue, 16 Apr 2013 06:51:07 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3G6p78P038184; Tue, 16 Apr 2013 06:51:07 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201304160651.r3G6p78P038184@svn.freebsd.org> From: Dimitry Andric Date: Tue, 16 Apr 2013 06:51:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249534 - stable/9 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 06:51:07 -0000 Author: dim Date: Tue Apr 16 06:51:07 2013 New Revision: 249534 URL: http://svnweb.freebsd.org/changeset/base/249534 Log: MFC r249316: Ensure make -j N universe works correctly, by checking for an up-to-date make before starting the universe targets themselves. Otherwise, all of the targets would attempt to build make simultaneously, overwriting each other's copies of the make object files and executable. This could lead to strange errors, for example when partially-written make executables are invoked. Also amend r216620, to make the rest of universe wait properly until the upgrade_checks target is finished, by adding universe_${target}_prologue to the .ORDER target. Otherwise, make will be too smart for its own good, and start building the universe targets simultaneously with the prologues anyway. Modified: stable/9/Makefile (contents, props changed) Modified: stable/9/Makefile ============================================================================== --- stable/9/Makefile Tue Apr 16 06:21:57 2013 (r249533) +++ stable/9/Makefile Tue Apr 16 06:51:07 2013 (r249534) @@ -356,7 +356,7 @@ MAKEFAIL=tee -a ${FAILFILE} MAKEFAIL=cat .endif -universe: universe_prologue +universe: universe_prologue upgrade_checks universe_prologue: @echo "--------------------------------------------------------------" @echo ">>> make universe started on ${STARTTIME}" @@ -366,7 +366,7 @@ universe_prologue: .endif .for target in ${TARGETS} universe: universe_${target} -.ORDER: universe_prologue universe_${target} universe_epilogue +.ORDER: universe_prologue upgrade_checks universe_${target}_prologue universe_${target} universe_epilogue universe_${target}: universe_${target}_prologue universe_${target}_prologue: @echo ">> ${target} started on `LC_ALL=C date`" From owner-svn-src-all@FreeBSD.ORG Tue Apr 16 06:52:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B6B1EAC6; Tue, 16 Apr 2013 06:52:32 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A9D1CC; Tue, 16 Apr 2013 06:52:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3G6qWov038431; Tue, 16 Apr 2013 06:52:32 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3G6qWDB038430; Tue, 16 Apr 2013 06:52:32 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201304160652.r3G6qWDB038430@svn.freebsd.org> From: Dimitry Andric Date: Tue, 16 Apr 2013 06:52:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r249535 - stable/8 X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 06:52:32 -0000 Author: dim Date: Tue Apr 16 06:52:32 2013 New Revision: 249535 URL: http://svnweb.freebsd.org/changeset/base/249535 Log: MFC r249316: Ensure make -j N universe works correctly, by checking for an up-to-date make before starting the universe targets themselves. Otherwise, all of the targets would attempt to build make simultaneously, overwriting each other's copies of the make object files and executable. This could lead to strange errors, for example when partially-written make executables are invoked. Also amend r216620, to make the rest of universe wait properly until the upgrade_checks target is finished, by adding universe_${target}_prologue to the .ORDER target. Otherwise, make will be too smart for its own good, and start building the universe targets simultaneously with the prologues anyway. Modified: stable/8/Makefile (contents, props changed) Modified: stable/8/Makefile ============================================================================== --- stable/8/Makefile Tue Apr 16 06:51:07 2013 (r249534) +++ stable/8/Makefile Tue Apr 16 06:52:32 2013 (r249535) @@ -300,7 +300,7 @@ MAKEFAIL=tee -a ${FAILFILE} MAKEFAIL=cat .endif -universe: universe_prologue +universe: universe_prologue upgrade_checks universe_prologue: @echo "--------------------------------------------------------------" @echo ">>> make universe started on ${STARTTIME}" @@ -310,7 +310,7 @@ universe_prologue: .endif .for target in ${TARGETS} universe: universe_${target} -.ORDER: universe_prologue universe_${target} universe_epilogue +.ORDER: universe_prologue upgrade_checks universe_${target}_prologue universe_${target} universe_epilogue universe_${target}: @echo ">> ${target} started on `LC_ALL=C date`" .if !defined(MAKE_JUST_KERNELS) From owner-svn-src-all@FreeBSD.ORG Tue Apr 16 06:53:21 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1F8EAC3B; Tue, 16 Apr 2013 06:53:21 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1265F6F; Tue, 16 Apr 2013 06:53:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3G6rK9x038589; Tue, 16 Apr 2013 06:53:20 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3G6rKwo038588; Tue, 16 Apr 2013 06:53:20 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201304160653.r3G6rKwo038588@svn.freebsd.org> From: Dimitry Andric Date: Tue, 16 Apr 2013 06:53:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r249536 - stable/7 X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 06:53:21 -0000 Author: dim Date: Tue Apr 16 06:53:20 2013 New Revision: 249536 URL: http://svnweb.freebsd.org/changeset/base/249536 Log: MFC r249316: Ensure make -j N universe works correctly, by checking for an up-to-date make before starting the universe targets themselves. Otherwise, all of the targets would attempt to build make simultaneously, overwriting each other's copies of the make object files and executable. This could lead to strange errors, for example when partially-written make executables are invoked. Also amend r216620, to make the rest of universe wait properly until the upgrade_checks target is finished, by adding universe_${target}_prologue to the .ORDER target. Otherwise, make will be too smart for its own good, and start building the universe targets simultaneously with the prologues anyway. Modified: stable/7/Makefile (contents, props changed) Modified: stable/7/Makefile ============================================================================== --- stable/7/Makefile Tue Apr 16 06:52:32 2013 (r249535) +++ stable/7/Makefile Tue Apr 16 06:53:20 2013 (r249536) @@ -274,7 +274,7 @@ make: .PHONY .if make(universe) TARGETS?=amd64 arm i386 ia64 pc98 powerpc sparc64 -universe: universe_prologue +universe: universe_prologue upgrade_checks universe_prologue: @echo "--------------------------------------------------------------" @echo ">>> make universe started on ${STARTTIME}" @@ -285,7 +285,7 @@ KERNCONFS!= cd ${.CURDIR}/sys/${target}/ ! -name DEFAULTS ! -name LINT KERNCONFS:= ${KERNCONFS:S/^NOTES$/LINT/} universe: universe_${target} -.ORDER: universe_prologue universe_${target} universe_epilogue +.ORDER: universe_prologue upgrade_checks universe_${target}_prologue universe_${target} universe_epilogue universe_${target}: .if !defined(MAKE_JUST_KERNELS) @echo ">> ${target} started on `LC_ALL=C date`" From owner-svn-src-all@FreeBSD.ORG Tue Apr 16 07:11:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 44DF2310; Tue, 16 Apr 2013 07:11:53 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3838E142; Tue, 16 Apr 2013 07:11:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3G7BrTg045002; Tue, 16 Apr 2013 07:11:53 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3G7Br1Z045001; Tue, 16 Apr 2013 07:11:53 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201304160711.r3G7Br1Z045001@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 16 Apr 2013 07:11:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249538 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 07:11:53 -0000 Author: kib Date: Tue Apr 16 07:11:52 2013 New Revision: 249538 URL: http://svnweb.freebsd.org/changeset/base/249538 Log: Some compilers issue a warning when wider integer is casted to narrow pointer. Supposedly shut down the warning by casting through uintptr_t. Reported by: ian Modified: head/sys/kern/subr_bus_dma.c Modified: head/sys/kern/subr_bus_dma.c ============================================================================== --- head/sys/kern/subr_bus_dma.c Tue Apr 16 07:02:13 2013 (r249537) +++ head/sys/kern/subr_bus_dma.c Tue Apr 16 07:11:52 2013 (r249538) @@ -66,8 +66,8 @@ _bus_dmamap_load_vlist(bus_dma_tag_t dma error = 0; for (; sglist_cnt > 0; sglist_cnt--, list++) { error = _bus_dmamap_load_buffer(dmat, map, - (void *)list->ds_addr, list->ds_len, pmap, flags, NULL, - nsegs); + (void *)(uintptr_t)list->ds_addr, list->ds_len, pmap, + flags, NULL, nsegs); if (error) break; } From owner-svn-src-all@FreeBSD.ORG Tue Apr 16 09:03:09 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 18F22FC4; Tue, 16 Apr 2013 09:03:09 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:7b8:3a7:1:2d0:b7ff:fea0:8c26]) by mx1.freebsd.org (Postfix) with ESMTP id D43E7D19; Tue, 16 Apr 2013 09:03:08 +0000 (UTC) Received: from spaceball.andric.com (spaceball.andric.com [IPv6:2001:7b8:3a7:0:204:4bff:fe01:de8a]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 54AF55C44; Tue, 16 Apr 2013 11:03:06 +0200 (CEST) Message-ID: <516D13C5.70900@FreeBSD.org> Date: Tue, 16 Apr 2013 11:03:01 +0200 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:21.0) Gecko/20100101 Thunderbird/21.0 MIME-Version: 1.0 To: =?UTF-8?B?zpPOuc+Oz4HOs86/z4IgzprOtc+BzrHOvM6vzrTOsc+C?= , Gregory Shapiro Subject: Re: svn commit: r246880 - in head: lib/libsm libexec/mail.local libexec/smrsh share/mk usr.bin/vacation usr.sbin/sendmail References: <201302162017.r1GKHVdY022667@svn.freebsd.org> <87a9ozayzk.fsf@saturn.laptop> In-Reply-To: <87a9ozayzk.fsf@saturn.laptop> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 09:03:09 -0000 On 2013-04-16 06:19, =CE=93=CE=B9=CF=8E=CF=81=CE=B3=CE=BF=CF=82 =CE=9A=CE= =B5=CF=81=CE=B1=CE=BC=CE=AF=CE=B4=CE=B1=CF=82 wrote: > On Sat, 16 Feb 2013 20:17:31 +0000 (UTC), Dimitry Andric wrote: =2E.. >> Since clang 3.2 now has an option to suppress warnings about implic= itly >> promoted K&R parameters, remove the workarounds added for sendmail >> components in r228558. =2E.. > The part of the commit that removes NO_WERROR.clang for usr.sbin/sendma= il/ > breaks the build of Sendmail with -DSASL. I just tried rebuilding Send= mail > with the following in "/etc/make.conf": > > # Build Sendmail with SASL support. > SENDMAIL_CFLAGS ?=3D -I/usr/local/include -DSASL=3D20126 > SENDMAIL_LDFLAGS ?=3D -L/usr/local/lib > SENDMAIL_LDADD ?=3D -lsasl2 > > The warnings that usersmtp.c still triggers when -DSASL is used are: > > : cc -O2 -pipe -I/usr/src/usr.sbin/sendmail/../../contrib/sendmail/src= -I/usr/src/usr.sbin/sendmail/../../contrib/sendmail/include -I. -DNEWDB = -DNIS -DTCPWRAPPERS -DMAP_REGEX -DDNSMAP -DNETINET6 -DSTARTTLS -D_FFR_TLS= _1 -I/usr/local/include -DSASL=3D20126 -std=3Dgnu99 -Qunused-arguments -f= stack-protector -Wsystem-headers -Wno-pointer-sign -Wno-empty-body -Wno-s= tring-plus-int -Wno-tautological-compare -Wno-unused-value -Wno-parenthes= es-equality -Wno-unused-function -Wno-conversion -Wno-switch -Wno-switch-= enum -Wno-knr-promoted-parameter -Wno-parentheses -c /usr/src/usr.sbin/se= ndmail/../../contrib/sendmail/src/usersmtp.c > : /usr/src/usr.sbin/sendmail/../../contrib/sendmail/src/usersmtp.c:1797= :50: warning: incompatible pointer types passing 'void ()' to parameter o= f type 'void (*)(char *, bool, MAILER *, struct > : mailer_con_info *, ENVELOPE *)' [-Wincompatible-pointer-types] > : smtpresult =3D reply(m, mci, e, TimeOuts.to_auth, getsasldata= , NULL, > : ^~~~~~~~~~~ Have you tried the patch I posted here? http://lists.freebsd.org/pipermail/freebsd-current/2013-March/040634.html= If people feel this is the right approach, I am happy to commit it. If people prefer to just shut up warnings, I am happy with that too. From owner-svn-src-all@FreeBSD.ORG Tue Apr 16 09:40:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id AD3C896E; Tue, 16 Apr 2013 09:40:02 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from gw01.mail.saunalahti.fi (gw01.mail.saunalahti.fi [195.197.172.115]) by mx1.freebsd.org (Postfix) with ESMTP id 7000BEAF; Tue, 16 Apr 2013 09:40:02 +0000 (UTC) Received: from jh (a91-153-115-208.elisa-laajakaista.fi [91.153.115.208]) by gw01.mail.saunalahti.fi (Postfix) with SMTP id 669A71516B1; Tue, 16 Apr 2013 12:31:08 +0300 (EEST) Date: Tue, 16 Apr 2013 12:31:08 +0300 From: Jaakko Heinonen To: Ivan Voras Subject: Re: svn commit: r249508 - in head/sys: conf geom/label Message-ID: <20130416093108.GA26598@jh> References: <201304151609.r3FG9Oga079482@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201304151609.r3FG9Oga079482@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 09:40:02 -0000 On 2013-04-15, Ivan Voras wrote: > Introduce glabel labels based on GEOM ident attributes. In this initial > implementation, error on the side of conservatism and only create labels > for GEOMs of classes DISK and MULTIPATH. After this commit I get a panic on boot. My kernel has been compiled with gcc. panic: stack overflow detected; backtrace may be corrupted cpuid = 1 KDB: enter: panic [ thread pid 13 tid 100009 ] Stopped at kdb_enter+0x3a: movl $0,kdb_why db> bt Tracing pid 13 tid 100009 td 0xc7322000 kdb_enter(c0f374a2,c0f374a2,c0f3a31b,c6edbabc,1,...) at kdb_enter+0x3a/frame 0xc6edba7c vpanic(c6edbabc,c6edbabc,c0a3ee02,c0f3a31b,c6edbb50,...) at vpanic+0x12d/frame 0xc6edbaa4 panic(c0f3a31b,c6edbb50,c09a5d98,c6edbb90,c6edbadc,...) at panic+0x14/frame 0xc6edbab0 __stack_chk_fail(c6edbb90,c6edbadc,c6edbad8,c6edbadc,1,...) at __stack_chk_fail+0x12/frame 0xc6edbabc g_label_disk_ident_taste(c7511e40,c6edbb90,80,15e,0,...) at g_label_disk_ident_taste+0x138/frame 0xc6edbb50 g_label_taste(c105a5e0,c732be00,0,229,c732bd80,...) at g_label_taste+0x486/frame 0xc6edbc4c g_new_provider_event(c732be00,0,c0f29730,100,80246,...) at g_new_provider_event+0xe8/frame 0xc6edbc6c g_run_events(c10de890,0,c0f29f9d,79,c6edbcf4,...) at g_run_events+0x31c/frame 0xc6edbcb0 g_event_procbody(0,c6edbd08,c0f30630,3d7,c72b92e8,...) at g_event_procbody+0x93/frame 0xc6edbcc8 fork_exit(c099da20,0,c6edbd08) at fork_exit+0xc0/frame 0xc6edbcf4 fork_trampoline() at fork_trampoline+0x8/frame 0xc6edbcf4 --- trap 0, eip = 0, esp = 0xc6edbd40, ebp = 0 --- -- Jaakko From owner-svn-src-all@FreeBSD.ORG Tue Apr 16 10:19:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8B810161; Tue, 16 Apr 2013 10:19:59 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: from mail-ve0-f172.google.com (mail-ve0-f172.google.com [209.85.128.172]) by mx1.freebsd.org (Postfix) with ESMTP id 1363F9B; Tue, 16 Apr 2013 10:19:59 +0000 (UTC) Received: by mail-ve0-f172.google.com with SMTP id db10so261069veb.3 for ; Tue, 16 Apr 2013 03:19:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=vtzwtvanB9SIc37dOfhjuxcKlFk7A20jBobmRf5bHu0=; b=itjSebzL5nL+qM2hHB78U80eya5r7MDCI05yEdDFDDY90720YW7avmqhgV8aJRZWN0 ftflpD0ncfCd7OzylFl6iS9LNuOtNVuMCcTNxv6yJuNChpQp1lXTdVpOr+3v3S05+oU6 914Mhg8vazZJXXnaVc/fpwPtl4J7U4getI2hXCwxzQXYhoF+F4YMAZFNQdPmPEY08Hcs ogQlko+g4vxLn53ZrXHrx9BnUXO8XFD8WOsBShxLxWoZ/1ue2xlbSjG7CUgCggZeQWhg hvlNHCMQTp4gwxp5EzvUMBogGVe/m8x7LXAhqAxcsDNoyVxc39E8xTA9radQmHEwLPN2 mPWQ== X-Received: by 10.58.15.232 with SMTP id a8mr1018883ved.27.1366107598312; Tue, 16 Apr 2013 03:19:58 -0700 (PDT) MIME-Version: 1.0 Sender: ivoras@gmail.com Received: by 10.58.34.162 with HTTP; Tue, 16 Apr 2013 03:19:18 -0700 (PDT) In-Reply-To: <20130416093108.GA26598@jh> References: <201304151609.r3FG9Oga079482@svn.freebsd.org> <20130416093108.GA26598@jh> From: Ivan Voras Date: Tue, 16 Apr 2013 12:19:18 +0200 X-Google-Sender-Auth: SASsk2v9Z8Iwt4GCSK1D6L7dn8c Message-ID: Subject: Re: svn commit: r249508 - in head/sys: conf geom/label To: Jaakko Heinonen Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 10:19:59 -0000 On 16 April 2013 11:31, Jaakko Heinonen wrote: > On 2013-04-15, Ivan Voras wrote: >> Introduce glabel labels based on GEOM ident attributes. In this initial >> implementation, error on the side of conservatism and only create labels >> for GEOMs of classes DISK and MULTIPATH. > > After this commit I get a panic on boot. My kernel has been compiled > with gcc. Thanks for the report, I'm investigating it. From owner-svn-src-all@FreeBSD.ORG Tue Apr 16 11:12:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 612DFABE; Tue, 16 Apr 2013 11:12:59 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 39C44259; Tue, 16 Apr 2013 11:12:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3GBCxG9018726; Tue, 16 Apr 2013 11:12:59 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3GBCx2n018725; Tue, 16 Apr 2013 11:12:59 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201304161112.r3GBCx2n018725@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Tue, 16 Apr 2013 11:12:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249543 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 11:12:59 -0000 Author: ae Date: Tue Apr 16 11:12:58 2013 New Revision: 249543 URL: http://svnweb.freebsd.org/changeset/base/249543 Log: Replace hardcoded numbers. Modified: head/sys/netinet6/ip6_var.h Modified: head/sys/netinet6/ip6_var.h ============================================================================== --- head/sys/netinet6/ip6_var.h Tue Apr 16 08:54:50 2013 (r249542) +++ head/sys/netinet6/ip6_var.h Tue Apr 16 11:12:58 2013 (r249543) @@ -204,9 +204,11 @@ struct ip6stat { u_quad_t ip6s_rawout; /* total raw ip packets generated */ u_quad_t ip6s_badscope; /* scope error */ u_quad_t ip6s_notmember; /* don't join this multicast group */ - u_quad_t ip6s_nxthist[256]; /* next header history */ +#define IP6S_HDRCNT 256 /* headers count */ + u_quad_t ip6s_nxthist[IP6S_HDRCNT]; /* next header history */ u_quad_t ip6s_m1; /* one mbuf */ - u_quad_t ip6s_m2m[32]; /* two or more mbuf */ +#define IP6S_M2MMAX 32 + u_quad_t ip6s_m2m[IP6S_M2MMAX]; /* two or more mbuf */ u_quad_t ip6s_mext1; /* one ext mbuf */ u_quad_t ip6s_mext2m; /* two or more ext mbuf */ u_quad_t ip6s_exthdrtoolong; /* ext hdr are not contiguous */ @@ -218,27 +220,29 @@ struct ip6stat { * algorithm: * XXX: hardcoded 16 = # of ip6 multicast scope types + 1 */ +#define IP6S_RULESMAX 16 +#define IP6S_SCOPECNT 16 /* number of times that address selection fails */ u_quad_t ip6s_sources_none; /* number of times that an address on the outgoing I/F is chosen */ - u_quad_t ip6s_sources_sameif[16]; + u_quad_t ip6s_sources_sameif[IP6S_SCOPECNT]; /* number of times that an address on a non-outgoing I/F is chosen */ - u_quad_t ip6s_sources_otherif[16]; + u_quad_t ip6s_sources_otherif[IP6S_SCOPECNT]; /* * number of times that an address that has the same scope * from the destination is chosen. */ - u_quad_t ip6s_sources_samescope[16]; + u_quad_t ip6s_sources_samescope[IP6S_SCOPECNT]; /* * number of times that an address that has a different scope * from the destination is chosen. */ - u_quad_t ip6s_sources_otherscope[16]; + u_quad_t ip6s_sources_otherscope[IP6S_SCOPECNT]; /* number of times that a deprecated address is chosen */ - u_quad_t ip6s_sources_deprecated[16]; + u_quad_t ip6s_sources_deprecated[IP6S_SCOPECNT]; /* number of times that each rule of source selection is applied. */ - u_quad_t ip6s_sources_rule[16]; + u_quad_t ip6s_sources_rule[IP6S_MAXRULES]; }; #ifdef _KERNEL From owner-svn-src-all@FreeBSD.ORG Tue Apr 16 11:19:13 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id EAB96DDF; Tue, 16 Apr 2013 11:19:13 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DDB942B0; Tue, 16 Apr 2013 11:19:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3GBJDA4019648; Tue, 16 Apr 2013 11:19:13 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3GBJDVr019647; Tue, 16 Apr 2013 11:19:13 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201304161119.r3GBJDVr019647@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Tue, 16 Apr 2013 11:19:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249544 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 11:19:14 -0000 Author: ae Date: Tue Apr 16 11:19:13 2013 New Revision: 249544 URL: http://svnweb.freebsd.org/changeset/base/249544 Log: Use IP6S_M2MMAX macro. Modified: head/sys/netinet6/ip6_input.c Modified: head/sys/netinet6/ip6_input.c ============================================================================== --- head/sys/netinet6/ip6_input.c Tue Apr 16 11:12:58 2013 (r249543) +++ head/sys/netinet6/ip6_input.c Tue Apr 16 11:19:13 2013 (r249544) @@ -466,18 +466,16 @@ ip6_input(struct mbuf *m) else IP6STAT_INC(ip6s_mext1); } else { -#define M2MMAX (sizeof(V_ip6stat.ip6s_m2m)/sizeof(V_ip6stat.ip6s_m2m[0])) if (m->m_next) { if (m->m_flags & M_LOOP) { IP6STAT_INC(ip6s_m2m[V_loif->if_index]); - } else if (m->m_pkthdr.rcvif->if_index < M2MMAX) + } else if (m->m_pkthdr.rcvif->if_index < IP6S_M2MMAX) IP6STAT_INC( ip6s_m2m[m->m_pkthdr.rcvif->if_index]); else IP6STAT_INC(ip6s_m2m[0]); } else IP6STAT_INC(ip6s_m1); -#undef M2MMAX } /* drop the packet if IPv6 operation is disabled on the IF */ From owner-svn-src-all@FreeBSD.ORG Tue Apr 16 11:25:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 847ED2E4; Tue, 16 Apr 2013 11:25:46 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 76CD8323; Tue, 16 Apr 2013 11:25:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3GBPk2d022192; Tue, 16 Apr 2013 11:25:46 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3GBPkAe022191; Tue, 16 Apr 2013 11:25:46 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201304161125.r3GBPkAe022191@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Tue, 16 Apr 2013 11:25:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249545 - head/usr.bin/netstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 11:25:46 -0000 Author: ae Date: Tue Apr 16 11:25:45 2013 New Revision: 249545 URL: http://svnweb.freebsd.org/changeset/base/249545 Log: Replace hardcoded numbers. Also use interface-local scope name instead of node-local. Modified: head/usr.bin/netstat/inet6.c Modified: head/usr.bin/netstat/inet6.c ============================================================================== --- head/usr.bin/netstat/inet6.c Tue Apr 16 11:19:13 2013 (r249544) +++ head/usr.bin/netstat/inet6.c Tue Apr 16 11:25:45 2013 (r249545) @@ -408,7 +408,7 @@ ip6_stats(u_long off, const char *name, p(ip6s_cantfrag, "\t%ju datagram%s that can't be fragmented\n"); p(ip6s_badscope, "\t%ju packet%s that violated scope rules\n"); p(ip6s_notmember, "\t%ju multicast packet%s which we don't join\n"); - for (first = 1, i = 0; i < 256; i++) + for (first = 1, i = 0; i < IP6S_HDRCNT; i++) if (ip6stat.ip6s_nxthist[i] != 0) { if (first) { printf("\tInput histogram:\n"); @@ -419,7 +419,7 @@ ip6_stats(u_long off, const char *name, } printf("\tMbuf statistics:\n"); printf("\t\t%ju one mbuf\n", (uintmax_t)ip6stat.ip6s_m1); - for (first = 1, i = 0; i < 32; i++) { + for (first = 1, i = 0; i < IP6S_M2MMAX; i++) { char ifbuf[IFNAMSIZ]; if (ip6stat.ip6s_m2m[i] != 0) { if (first) { @@ -445,7 +445,7 @@ ip6_stats(u_long off, const char *name, #define PRINT_SCOPESTAT(s,i) do {\ switch(i) { /* XXX hardcoding in each case */\ case 1:\ - p(s, "\t\t%ju node-local%s\n");\ + p(s, "\t\t%ju interface-local%s\n");\ break;\ case 2:\ p(s,"\t\t%ju link-local%s\n");\ @@ -464,7 +464,7 @@ ip6_stats(u_long off, const char *name, p(ip6s_sources_none, "\t%ju failure%s of source address selection\n"); - for (first = 1, i = 0; i < 16; i++) { + for (first = 1, i = 0; i < IP6S_SCOPECNT; i++) { if (ip6stat.ip6s_sources_sameif[i]) { if (first) { printf("\tsource addresses on an outgoing I/F\n"); @@ -473,7 +473,7 @@ ip6_stats(u_long off, const char *name, PRINT_SCOPESTAT(ip6s_sources_sameif[i], i); } } - for (first = 1, i = 0; i < 16; i++) { + for (first = 1, i = 0; i < IP6S_SCOPECNT; i++) { if (ip6stat.ip6s_sources_otherif[i]) { if (first) { printf("\tsource addresses on a non-outgoing I/F\n"); @@ -482,7 +482,7 @@ ip6_stats(u_long off, const char *name, PRINT_SCOPESTAT(ip6s_sources_otherif[i], i); } } - for (first = 1, i = 0; i < 16; i++) { + for (first = 1, i = 0; i < IP6S_SCOPECNT; i++) { if (ip6stat.ip6s_sources_samescope[i]) { if (first) { printf("\tsource addresses of same scope\n"); @@ -491,7 +491,7 @@ ip6_stats(u_long off, const char *name, PRINT_SCOPESTAT(ip6s_sources_samescope[i], i); } } - for (first = 1, i = 0; i < 16; i++) { + for (first = 1, i = 0; i < IP6S_SCOPECNT; i++) { if (ip6stat.ip6s_sources_otherscope[i]) { if (first) { printf("\tsource addresses of a different scope\n"); @@ -500,7 +500,7 @@ ip6_stats(u_long off, const char *name, PRINT_SCOPESTAT(ip6s_sources_otherscope[i], i); } } - for (first = 1, i = 0; i < 16; i++) { + for (first = 1, i = 0; i < IP6S_SCOPECNT; i++) { if (ip6stat.ip6s_sources_deprecated[i]) { if (first) { printf("\tdeprecated source addresses\n"); @@ -511,7 +511,7 @@ ip6_stats(u_long off, const char *name, } printf("\tSource addresses selection rule applied:\n"); - for (i = 0; i < 16; i++) { + for (i = 0; i < IP6S_RULESMAX; i++) { if (ip6stat.ip6s_sources_rule[i]) printf("\t\t%ju %s\n", (uintmax_t)ip6stat.ip6s_sources_rule[i], From owner-svn-src-all@FreeBSD.ORG Tue Apr 16 11:31:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1E5DA4C8; Tue, 16 Apr 2013 11:31:27 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 110E9350; Tue, 16 Apr 2013 11:31:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3GBVQ5D024582; Tue, 16 Apr 2013 11:31:26 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3GBVQNc024581; Tue, 16 Apr 2013 11:31:26 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201304161131.r3GBVQNc024581@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Tue, 16 Apr 2013 11:31:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249546 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 11:31:27 -0000 Author: ae Date: Tue Apr 16 11:31:26 2013 New Revision: 249546 URL: http://svnweb.freebsd.org/changeset/base/249546 Log: Fix accounting after the r249528, also add several another counters to the statistics. Modified: head/sys/netinet6/in6_src.c Modified: head/sys/netinet6/in6_src.c ============================================================================== --- head/sys/netinet6/in6_src.c Tue Apr 16 11:25:45 2013 (r249545) +++ head/sys/netinet6/in6_src.c Tue Apr 16 11:31:26 2013 (r249546) @@ -151,6 +151,7 @@ static struct in6_addrpolicy *match_addr * an entry to the caller for later use. */ #define REPLACE(r) do {\ + IP6STAT_INC(ip6s_sources_rule[(r)]); \ rule = (r); \ /* { \ char ip6buf[INET6_ADDRSTRLEN], ip6b[INET6_ADDRSTRLEN]; \ @@ -166,6 +167,7 @@ static struct in6_addrpolicy *match_addr goto next; /* XXX: we can't use 'continue' here */ \ } while(0) #define BREAK(r) do { \ + IP6STAT_INC(ip6s_sources_rule[(r)]); \ rule = (r); \ goto out; /* XXX: we can't use 'break' here */ \ } while(0) @@ -506,8 +508,17 @@ in6_selectsrc(struct sockaddr_in6 *dstso *ifpp = ifp; bcopy(&tmp, srcp, sizeof(*srcp)); + if (ia->ia_ifp == ifp) + IP6STAT_INC(ip6s_sources_sameif[best_scope]); + else + IP6STAT_INC(ip6s_sources_otherif[best_scope]); + if (dst_scope == best_scope) + IP6STAT_INC(ip6s_sources_samescope[best_scope]); + else + IP6STAT_INC(ip6s_sources_otherscope[best_scope]); + if (IFA6_IS_DEPRECATED(ia)) + IP6STAT_INC(ip6s_sources_deprecated[best_scope]); IN6_IFADDR_RUNLOCK(); - IP6STAT_INC(ip6s_sources_rule[rule]); return (0); } From owner-svn-src-all@FreeBSD.ORG Tue Apr 16 11:50:52 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id CDECD906; Tue, 16 Apr 2013 11:50:52 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail107.syd.optusnet.com.au (mail107.syd.optusnet.com.au [211.29.132.53]) by mx1.freebsd.org (Postfix) with ESMTP id 76465608; Tue, 16 Apr 2013 11:50:52 +0000 (UTC) Received: from c211-30-173-106.carlnfd1.nsw.optusnet.com.au (c211-30-173-106.carlnfd1.nsw.optusnet.com.au [211.30.173.106]) by mail107.syd.optusnet.com.au (Postfix) with ESMTPS id 98662D41AC8; Tue, 16 Apr 2013 21:28:38 +1000 (EST) Date: Tue, 16 Apr 2013 21:28:36 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Dimitry Andric Subject: Re: svn commit: r246880 - in head: lib/libsm libexec/mail.local libexec/smrsh share/mk usr.bin/vacation usr.sbin/sendmail In-Reply-To: <516D13C5.70900@FreeBSD.org> Message-ID: <20130416205349.W1783@besplex.bde.org> References: <201302162017.r1GKHVdY022667@svn.freebsd.org> <87a9ozayzk.fsf@saturn.laptop> <516D13C5.70900@FreeBSD.org> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-2082392551-1366111716=:1783" X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.0 cv=HfxM1V48 c=1 sm=1 a=rG3yl5gHAqsA:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=mZmTMruuRn4A:10 a=6I5d2MoRAAAA:8 a=jqniBCV5i6nGcZ7JSMQA:9 a=45ClL6m2LaAA:10 a=7IFj921gttwA:10 a=TEtd8y5WR3g2ypngnwZWYw==:117 Cc: =?UTF-8?B?zpPOuc+Oz4HOs86/z4IgzprOtc+BzrHOvM6vzrTOsc+C?= , svn-src-head@FreeBSD.org, Gregory Shapiro , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 11:50:53 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --0-2082392551-1366111716=:1783 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE On Tue, 16 Apr 2013, Dimitry Andric wrote: > On 2013-04-16 06:19, =CE=93=CE=B9=CF=8E=CF=81=CE=B3=CE=BF=CF=82 =CE=9A=CE= =B5=CF=81=CE=B1=CE=BC=CE=AF=CE=B4=CE=B1=CF=82 wrote: >> ... >> The warnings that usersmtp.c still triggers when -DSASL is used are: >>=20 >> : cc -O2 -pipe -I/usr/src/usr.sbin/sendmail/../../contrib/sendmail/src= =20 >> -I/usr/src/usr.sbin/sendmail/../../contrib/sendmail/include -I. -DNEWDB= =20 >> -DNIS -DTCPWRAPPERS -DMAP_REGEX -DDNSMAP -DNETINET6 -DSTARTTLS -D_FFR_TL= S_1=20 >> -I/usr/local/include -DSASL=3D20126 -std=3Dgnu99 -Qunused-arguments=20 >> -fstack-protector -Wsystem-headers -Wno-pointer-sign -Wno-empty-body=20 >> -Wno-string-plus-int -Wno-tautological-compare -Wno-unused-value=20 >> -Wno-parentheses-equality -Wno-unused-function -Wno-conversion -Wno-swit= ch=20 >> -Wno-switch-enum -Wno-knr-promoted-parameter -Wno-parentheses -c=20 >> /usr/src/usr.sbin/sendmail/../../contrib/sendmail/src/usersmtp.c >> : /usr/src/usr.sbin/sendmail/../../contrib/sendmail/src/usersmtp.c:1797:= 50:=20 >> warning: incompatible pointer types passing 'void ()' to parameter of ty= pe=20 >> 'void (*)(char *, bool, MAILER *, struct >> : mailer_con_info *, ENVELOPE *)' [-Wincompatible-pointer-types] >> : smtpresult =3D reply(m, mci, e, TimeOuts.to_auth, getsasldata,= =20 >> NULL, >> : ^~~~~~~~~~~ > > Have you tried the patch I posted here? > > http://lists.freebsd.org/pipermail/freebsd-current/2013-March/040634.html > > If people feel this is the right approach, I am happy to commit it. If > people prefer to just shut up warnings, I am happy with that too. stdbool is certainly incompatible with simple use of __P(()), but why does the error message say that the function type is 'void ()', and why doesn't it say that the prototype doesn't match the function? The function is declared as: @ static void getsasldata __P((char *, bool, MAILER *, MCI *, ENVELOPE *)); This says that the function type is the same as the parameter type. @ static void @ getsasldata(line, firstline, m, mci, e) @ =09char *line; @ =09bool firstline; @ =09MAILER *m; @ =09register MCI *mci; @ =09ENVELOPE *e; @ { This says that the function type is different from what the function's prototype is, at least if the bool is smaller than int or otherwise magic, which it is on at least amd64. clang prints a good error message in the following simplified example: @ #include @=20 @ void foo(bool first); @=20 @ void @ foo(first) @ =09bool first; @ { @ } @ z.c:7:7: warning: promoted type 'int' of K&R function parameter is not co= mpatible with the parameter type 'bool' declared in a previous prototype [-= Wknr-promoted-parameter] @ bool first; @ ^ @ z.c:3:15: note: previous declaration is here @ void foo(bool first); @ ^ @ 1 warning generated. This happens with plain cc -c. gcc of course turns the undefined behaviour from this into a portability problem by accepting the bad code. It takes gcc -pedantic to get a warning= =2E The correct prototype on amd64 is 'void foo(int first);'. This is MD. Unfortunately, the correct way to declare this is unsupported AFAIK. It is 'void foo(__promoteof(bool) first);'. __P(()) is really hard to use, since to use it you first have to modify compilers to support __promoteof(), then use it on the type of all integer args whose type is not int or larger, or do this using MD ifdefs. Extending the example a little gives the answer to my question: @ #include @=20 @ typedef void vb(bool first); @=20 @ vb foo; @ void bar(vb *p); @=20 @ void @ foo(first) @ =09bool first; @ { @ =09bar(foo); @ } @ z.c:10:7: warning: promoted type 'int' of K&R function parameter is not c= ompatible with the parameter type 'bool' declared in a previous prototype [= -Wknr-promoted-parameter] @ bool first; @ ^ @ z.c:5:4: note: previous declaration is here @ vb foo; @ ^ @ z.c:12:6: warning: incompatible pointer types passing 'void ()' to parame= ter of type 'vb *' (aka 'void (*)(bool)') [-Wincompatible-pointer-types] @ bar(foo); @ ^~~ @ z.c:6:14: note: passing argument to parameter 'p' here @ void bar(vb *p); @ ^ @ 2 warnings generated. Apparently clang ignores the mismatched prototype after printing a warning about it, and also throws away the type info that it learns by compiling the K&R function, so it is left with only 'void ()' for the type. Then the warnings for some reason emphasize the secondary warnings from this. The first warning should be an error. It is only a warning for gcc -pedant= ic too. Bruce --0-2082392551-1366111716=:1783-- From owner-svn-src-all@FreeBSD.ORG Tue Apr 16 12:31:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1B9C552F; Tue, 16 Apr 2013 12:31:17 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CF7CF897; Tue, 16 Apr 2013 12:31:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3GCVGZq042797; Tue, 16 Apr 2013 12:31:16 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3GCVG3x042796; Tue, 16 Apr 2013 12:31:16 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201304161231.r3GCVG3x042796@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Tue, 16 Apr 2013 12:31:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249547 - head/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 12:31:17 -0000 Author: pjd Date: Tue Apr 16 12:31:16 2013 New Revision: 249547 URL: http://svnweb.freebsd.org/changeset/base/249547 Log: Correct error message. Reported by: Dirk Engling Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Tue Apr 16 11:31:26 2013 (r249546) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Tue Apr 16 12:31:16 2013 (r249547) @@ -4590,7 +4590,7 @@ zfs_jail(zfs_handle_t *zhp, int jailid, dgettext(TEXT_DOMAIN, "cannot jail '%s'"), zhp->zfs_name); } else { (void) snprintf(errbuf, sizeof (errbuf), - dgettext(TEXT_DOMAIN, "cannot jail '%s'"), zhp->zfs_name); + dgettext(TEXT_DOMAIN, "cannot unjail '%s'"), zhp->zfs_name); } switch (zhp->zfs_type) { From owner-svn-src-all@FreeBSD.ORG Tue Apr 16 12:52:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7E76A812; Tue, 16 Apr 2013 12:52:57 +0000 (UTC) (envelope-from tijl@coosemans.org) Received: from mailrelay011.isp.belgacom.be (mailrelay011.isp.belgacom.be [195.238.6.178]) by mx1.freebsd.org (Postfix) with ESMTP id 94442943; Tue, 16 Apr 2013 12:52:56 +0000 (UTC) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AoYGAJ9IbVFR8ZLu/2dsb2JhbABQgwY2gzG9VYELF3SCHwEBBSMzIxALFAQJIQICDwIoHgYNAQcBAYgUCKl/gkCQR45+EQeCL4ETA49UgSmHK49xgw06 Received: from 238.146-241-81.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([81.241.146.238]) by relay.skynet.be with ESMTP; 16 Apr 2013 14:52:49 +0200 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.14.6/8.14.6) with ESMTP id r3GCqldt005028; Tue, 16 Apr 2013 14:52:48 +0200 (CEST) (envelope-from tijl@coosemans.org) Message-ID: <516D4998.20905@coosemans.org> Date: Tue, 16 Apr 2013 14:52:40 +0200 From: Tijl Coosemans User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:17.0) Gecko/20130408 Thunderbird/17.0.5 MIME-Version: 1.0 To: "Andrey V. Elsukov" Subject: Re: svn commit: r249543 - head/sys/netinet6 References: <201304161112.r3GBCx2n018725@svn.freebsd.org> In-Reply-To: <201304161112.r3GBCx2n018725@svn.freebsd.org> X-Enigmail-Version: 1.5.1 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="----enig2EJBPDPFSKQOOUETWFMRC" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 12:52:57 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2EJBPDPFSKQOOUETWFMRC Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 2013-04-16 13:12, Andrey V. Elsukov wrote: > Author: ae > Date: Tue Apr 16 11:12:58 2013 > New Revision: 249543 > URL: http://svnweb.freebsd.org/changeset/base/249543 >=20 > Log: > Replace hardcoded numbers. >=20 > Modified: > head/sys/netinet6/ip6_var.h >=20 > Modified: head/sys/netinet6/ip6_var.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/netinet6/ip6_var.h Tue Apr 16 08:54:50 2013 (r249542) > +++ head/sys/netinet6/ip6_var.h Tue Apr 16 11:12:58 2013 (r249543) > @@ -204,9 +204,11 @@ struct ip6stat { > u_quad_t ip6s_rawout; /* total raw ip packets generated */ > u_quad_t ip6s_badscope; /* scope error */ > u_quad_t ip6s_notmember; /* don't join this multicast group */ > - u_quad_t ip6s_nxthist[256]; /* next header history */ > +#define IP6S_HDRCNT 256 /* headers count */ > + u_quad_t ip6s_nxthist[IP6S_HDRCNT]; /* next header history */ > u_quad_t ip6s_m1; /* one mbuf */ > - u_quad_t ip6s_m2m[32]; /* two or more mbuf */ > +#define IP6S_M2MMAX 32 > + u_quad_t ip6s_m2m[IP6S_M2MMAX]; /* two or more mbuf */ > u_quad_t ip6s_mext1; /* one ext mbuf */ > u_quad_t ip6s_mext2m; /* two or more ext mbuf */ > u_quad_t ip6s_exthdrtoolong; /* ext hdr are not contiguous */ > @@ -218,27 +220,29 @@ struct ip6stat { > * algorithm: > * XXX: hardcoded 16 =3D # of ip6 multicast scope types + 1 > */ > +#define IP6S_RULESMAX 16 > +#define IP6S_SCOPECNT 16 > /* number of times that address selection fails */ > u_quad_t ip6s_sources_none; > /* number of times that an address on the outgoing I/F is chosen */ > - u_quad_t ip6s_sources_sameif[16]; > + u_quad_t ip6s_sources_sameif[IP6S_SCOPECNT]; > /* number of times that an address on a non-outgoing I/F is chosen */= > - u_quad_t ip6s_sources_otherif[16]; > + u_quad_t ip6s_sources_otherif[IP6S_SCOPECNT]; > /* > * number of times that an address that has the same scope > * from the destination is chosen. > */ > - u_quad_t ip6s_sources_samescope[16]; > + u_quad_t ip6s_sources_samescope[IP6S_SCOPECNT]; > /* > * number of times that an address that has a different scope > * from the destination is chosen. > */ > - u_quad_t ip6s_sources_otherscope[16]; > + u_quad_t ip6s_sources_otherscope[IP6S_SCOPECNT]; > /* number of times that a deprecated address is chosen */ > - u_quad_t ip6s_sources_deprecated[16]; > + u_quad_t ip6s_sources_deprecated[IP6S_SCOPECNT]; > =20 > /* number of times that each rule of source selection is applied. */ > - u_quad_t ip6s_sources_rule[16]; > + u_quad_t ip6s_sources_rule[IP6S_MAXRULES]; This breaks buildworld because IP6S_MAXRULES is undefined. It's called IP6S_RULESMAX above. ------enig2EJBPDPFSKQOOUETWFMRC Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iF4EAREIAAYFAlFtSZ8ACgkQfoCS2CCgtit5RwD+I+RxLgMTUwVHdwlK2NnlC2pc QQ1pOuOtO5UeVDbKdEwA/iU6V1qMCLLRBqud7THISIol9yksUqjmDgKtnogvdKul =s47v -----END PGP SIGNATURE----- ------enig2EJBPDPFSKQOOUETWFMRC-- From owner-svn-src-all@FreeBSD.ORG Tue Apr 16 13:14:19 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 2971FCD9; Tue, 16 Apr 2013 13:14:19 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from tux-cave.hellug.gr (tux-cave.hellug.gr [195.134.99.74]) by mx1.freebsd.org (Postfix) with ESMTP id 9A33FA18; Tue, 16 Apr 2013 13:14:18 +0000 (UTC) X-Spam-Status: No X-Hellug-MailScanner-From: keramida@ceid.upatras.gr X-Hellug-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-2.9, required 5, autolearn=not spam, ALL_TRUSTED -1.00, BAYES_00 -1.90) X-Hellug-MailScanner: Found to be clean X-Hellug-MailScanner-ID: r3GDE4Lj013142 Received: from saturn.laptop (217-162-217-29.dynamic.hispeed.ch [217.162.217.29]) (authenticated bits=0) by tux-cave.hellug.gr (8.14.3/8.14.3/Debian-9.4) with ESMTP id r3GDE4Lj013142 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 16 Apr 2013 16:14:13 +0300 Received: from saturn.laptop (localhost [127.0.0.1]) by saturn.laptop (8.14.4/8.14.4/Debian-2.1ubuntu1) with ESMTP id r3GDDvK3027102 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 16 Apr 2013 15:13:57 +0200 Received: (from keramida@localhost) by saturn.laptop (8.14.4/8.14.4/Submit) id r3GDDtne027095; Tue, 16 Apr 2013 15:13:55 +0200 X-Authentication-Warning: saturn.laptop: keramida set sender to keramida@ceid.upatras.gr using -f From: keramida@ceid.upatras.gr (Giorgos Keramidas) To: Bruce Evans Subject: Re: svn commit: r246880 - in head: lib/libsm libexec/mail.local libexec/smrsh share/mk usr.bin/vacation usr.sbin/sendmail References: <201302162017.r1GKHVdY022667@svn.freebsd.org> <87a9ozayzk.fsf@saturn.laptop> <516D13C5.70900@FreeBSD.org> <20130416205349.W1783@besplex.bde.org> Date: Tue, 16 Apr 2013 15:13:55 +0200 In-Reply-To: <20130416205349.W1783@besplex.bde.org> (Bruce Evans's message of "Tue, 16 Apr 2013 21:28:36 +1000 (EST)") Message-ID: <87zjwy62jw.fsf@saturn.laptop> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Cc: svn-src-head@FreeBSD.org, Gregory Shapiro , src-committers@FreeBSD.org, Dimitry Andric , svn-src-all@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 13:14:19 -0000 On Tue, 16 Apr 2013 21:28:36 +1000 (EST), Bruce Evans wrote: >On Tue, 16 Apr 2013, Dimitry Andric wrote: >> Have you tried the patch I posted here? >> >> http://lists.freebsd.org/pipermail/freebsd-current/2013-March/040634.html >> >> If people feel this is the right approach, I am happy to commit it. If >> people prefer to just shut up warnings, I am happy with that too. Hi Dimitry, I haven't but I will right now. Thanks for pointing me to it :) Also Bruce, thanks for the very detailed explanation. I admit I was a bit confused when a similar small test program I wrote failed to trigger the warning in clang: #include void foo(int code, const char *text); void foo(code, text) int code; const char *text; { printf("error %d: %s", code, text); } int main(void) { foo(0, "unknown error"); return 0; } But now -- having read all the details you wrote -- using stdbool.h and changing the type of 'code' to bool, *does* trigger the promotion and the warning: #include #include void foo(bool code, const char *text); void foo(code, text) bool code; const char *text; { if (code != false) printf("error: %s", text); } int main(void) { foo(false, "unknown error"); return 0; } % cc -O2 -pipe -std=gnu99 -Qunused-arguments -fstack-protector -c proto.c proto.c:8:10: warning: promoted type 'int' of K&R function parameter is not compatible with the parameter type 'bool' declared in a previous prototype [-Wknr-promoted-parameter] bool code; ^ proto.c:4:15: note: previous declaration is here void foo(bool code, const char *text); ^ 1 warning generated. > stdbool is certainly incompatible with simple use of __P(()), but why does > the error message say that the function type is 'void ()', and why doesn't > it say that the prototype doesn't match the function? The function is > declared as: > > @ static void getsasldata __P((char *, bool, MAILER *, MCI *, ENVELOPE *)); > > This says that the function type is the same as the parameter type. > > @ static void > @ getsasldata(line, firstline, m, mci, e) > @ char *line; > @ bool firstline; > @ MAILER *m; > @ register MCI *mci; > @ ENVELOPE *e; > @ { > > This says that the function type is different from what the function's > prototype is, at least if the bool is smaller than int or otherwise > magic, which it is on at least amd64. > > clang prints a good error message in the following simplified example: > > @ #include > @ @ void foo(bool first); > @ @ void > @ foo(first) > @ bool first; > @ { > @ } > > @ z.c:7:7: warning: promoted type 'int' of K&R function parameter is not compatible with the parameter type 'bool' declared in a previous prototype [-Wknr-promoted-parameter] > @ bool first; > @ ^ > @ z.c:3:15: note: previous declaration is here > @ void foo(bool first); > @ ^ > @ 1 warning generated. > > This happens with plain cc -c. > > gcc of course turns the undefined behaviour from this into a portability > problem by accepting the bad code. It takes gcc -pedantic to get a warning. > > The correct prototype on amd64 is 'void foo(int first);'. This is MD. > Unfortunately, the correct way to declare this is unsupported AFAIK. It > is 'void foo(__promoteof(bool) first);'. __P(()) is really hard to use, > since to use it you first have to modify compilers to support > __promoteof(), then use it on the type of all integer args whose type is > not int or larger, or do this using MD ifdefs. > > Extending the example a little gives the answer to my question: > > @ #include > @ @ typedef void vb(bool first); > @ @ vb foo; > @ void bar(vb *p); > @ @ void > @ foo(first) > @ bool first; > @ { > @ bar(foo); > @ } > > @ z.c:10:7: warning: promoted type 'int' of K&R function parameter is not compatible with the parameter type 'bool' declared in a previous prototype [-Wknr-promoted-parameter] > @ bool first; > @ ^ > @ z.c:5:4: note: previous declaration is here > @ vb foo; > @ ^ > @ z.c:12:6: warning: incompatible pointer types passing 'void ()' to parameter of type 'vb *' (aka 'void (*)(bool)') [-Wincompatible-pointer-types] > @ bar(foo); > @ ^~~ > @ z.c:6:14: note: passing argument to parameter 'p' here > @ void bar(vb *p); > @ ^ > @ 2 warnings generated. > > Apparently clang ignores the mismatched prototype after printing a warning > about it, and also throws away the type info that it learns by compiling > the K&R function, so it is left with only 'void ()' for the type. Then > the warnings for some reason emphasize the secondary warnings from this. > > The first warning should be an error. It is only a warning for gcc -pedantic > too. > > Bruce -- Giorgos Keramidas; gkeramidas@gmail.com From owner-svn-src-all@FreeBSD.ORG Tue Apr 16 13:20:20 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 663A2E9E; Tue, 16 Apr 2013 13:20:20 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from tux-cave.hellug.gr (tux-cave.hellug.gr [195.134.99.74]) by mx1.freebsd.org (Postfix) with ESMTP id D4321A40; Tue, 16 Apr 2013 13:20:19 +0000 (UTC) X-Spam-Status: No X-Hellug-MailScanner-From: keramida@ceid.upatras.gr X-Hellug-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-2.9, required 5, autolearn=not spam, ALL_TRUSTED -1.00, BAYES_00 -1.90) X-Hellug-MailScanner: Found to be clean X-Hellug-MailScanner-ID: r3GDK9nL014108 Received: from saturn.laptop (217-162-217-29.dynamic.hispeed.ch [217.162.217.29]) (authenticated bits=0) by tux-cave.hellug.gr (8.14.3/8.14.3/Debian-9.4) with ESMTP id r3GDK9nL014108 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 16 Apr 2013 16:20:17 +0300 Received: from saturn.laptop (localhost [127.0.0.1]) by saturn.laptop (8.14.4/8.14.4/Debian-2.1ubuntu1) with ESMTP id r3GDK4An027845 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 16 Apr 2013 15:20:04 +0200 Received: (from keramida@localhost) by saturn.laptop (8.14.4/8.14.4/Submit) id r3GDK3sI027837; Tue, 16 Apr 2013 15:20:03 +0200 X-Authentication-Warning: saturn.laptop: keramida set sender to keramida@ceid.upatras.gr using -f From: keramida@ceid.upatras.gr (Giorgos Keramidas) To: Dimitry Andric Subject: Re: svn commit: r246880 - in head: lib/libsm libexec/mail.local libexec/smrsh share/mk usr.bin/vacation usr.sbin/sendmail References: <201302162017.r1GKHVdY022667@svn.freebsd.org> <87a9ozayzk.fsf@saturn.laptop> <516D13C5.70900@FreeBSD.org> Date: Tue, 16 Apr 2013 15:20:03 +0200 In-Reply-To: <516D13C5.70900@FreeBSD.org> (Dimitry Andric's message of "Tue, 16 Apr 2013 11:03:01 +0200") Message-ID: <87vc7m629o.fsf@saturn.laptop> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@FreeBSD.org, Gregory Shapiro , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 13:20:20 -0000 On Tue, 16 Apr 2013 11:03:01 +0200, Dimitry Andric wrote: > On 2013-04-16 06:19, =CE=93=CE=B9=CF=8E=CF=81=CE=B3=CE=BF=CF=82 =CE=9A=CE= =B5=CF=81=CE=B1=CE=BC=CE=AF=CE=B4=CE=B1=CF=82 wrote: >> On Sat, 16 Feb 2013 20:17:31 +0000 (UTC), Dimitry Andric wrote: > ... >>> Since clang 3.2 now has an option to suppress warnings about implici= tly >>> promoted K&R parameters, remove the workarounds added for sendmail >>> components in r228558. > ... >> The part of the commit that removes NO_WERROR.clang for usr.sbin/sendmai= l/ >> breaks the build of Sendmail with -DSASL. I just tried rebuilding Sendm= ail >> with the following in "/etc/make.conf": >> >> # Build Sendmail with SASL support. >> SENDMAIL_CFLAGS ?=3D -I/usr/local/include -DSASL=3D20126 >> SENDMAIL_LDFLAGS ?=3D -L/usr/local/lib >> SENDMAIL_LDADD ?=3D -lsasl2 >> >> The warnings that usersmtp.c still triggers when -DSASL is used are: >> >> : cc -O2 -pipe -I/usr/src/usr.sbin/sendmail/../../contrib/sendmail/src >> -I/usr/src/usr.sbin/sendmail/../../contrib/sendmail/include >> -I. -DNEWDB -DNIS -DTCPWRAPPERS -DMAP_REGEX -DDNSMAP -DNETINET6 >> -DSTARTTLS -D_FFR_TLS_1 -I/usr/local/include -DSASL=3D20126 -std=3Dgnu99 >> -Qunused-arguments -fstack-protector -Wsystem-headers >> -Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int >> -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality >> -Wno-unused-function -Wno-conversion -Wno-switch -Wno-switch-enum >> -Wno-knr-promoted-parameter -Wno-parentheses -c >> /usr/src/usr.sbin/sendmail/../../contrib/sendmail/src/usersmtp.c >> : >> /usr/src/usr.sbin/sendmail/../../contrib/sendmail/src/usersmtp.c:1797:50: >> warning: incompatible pointer types passing 'void ()' to parameter of >> type 'void (*)(char *, bool, MAILER *, struct >> : mailer_con_info *, ENVELOPE *)' [-Wincompatible-pointer-types] >> : smtpresult =3D reply(m, mci, e, TimeOuts.to_auth, getsasldata,= NULL, >> : ^~~~~~~~~~~ > > Have you tried the patch I posted here? > > http://lists.freebsd.org/pipermail/freebsd-current/2013-March/040634.html > > If people feel this is the right approach, I am happy to commit it. If > people prefer to just shut up warnings, I am happy with that too. Confirmed. This fixes the build of usr.sbin/sendmail even without the NO_WERROR.clang=3D option. Thanks :-) From owner-svn-src-all@FreeBSD.ORG Tue Apr 16 13:41:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D51BB43E; Tue, 16 Apr 2013 13:41:19 +0000 (UTC) (envelope-from tijl@freebsd.org) Received: from mailrelay009.isp.belgacom.be (mailrelay009.isp.belgacom.be [195.238.6.176]) by mx1.freebsd.org (Postfix) with ESMTP id F1054B5B; Tue, 16 Apr 2013 13:41:18 +0000 (UTC) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AocGANFTbVFR8ZLu/2dsb2JhbABQgwY2gzG9VYELF3SCHwEBBSMzIxALFAQJFgsCAgkDAgECASceBg0BBwEBiBQIqhKCQJBDjn4RBwmCJoETA49UgSmHK49xgw06 Received: from 238.146-241-81.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([81.241.146.238]) by relay.skynet.be with ESMTP; 16 Apr 2013 15:41:16 +0200 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.14.6/8.14.6) with ESMTP id r3GDfFYR021134; Tue, 16 Apr 2013 15:41:15 +0200 (CEST) (envelope-from tijl@FreeBSD.org) Message-ID: <516D54F5.4010501@FreeBSD.org> Date: Tue, 16 Apr 2013 15:41:09 +0200 From: Tijl Coosemans User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:17.0) Gecko/20130408 Thunderbird/17.0.5 MIME-Version: 1.0 To: Tim Kientzle Subject: Re: svn commit: r249484 - head/lib References: <201304141913.r3EJDqPI095965@svn.freebsd.org> In-Reply-To: <201304141913.r3EJDqPI095965@svn.freebsd.org> X-Enigmail-Version: 1.5.1 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="----enig2NLKUGFSIRFVEBONHBTKX" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 13:41:19 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2NLKUGFSIRFVEBONHBTKX Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 2013-04-14 21:13, Tim Kientzle wrote: > Author: kientzle > Date: Sun Apr 14 19:13:51 2013 > New Revision: 249484 > URL: http://svnweb.freebsd.org/changeset/base/249484 >=20 > Log: > Install a symlink > /usr/lib/include =3D=3D> /usr/include > =20 > This fixes -print-file-name=3Dinclude in clang (and is > arguably a better way to fix the same issue in GCC than > the change I made in r231336). > =20 > MFC after: 1 week >=20 > Modified: > head/lib/Makefile >=20 > Modified: head/lib/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/lib/Makefile Sun Apr 14 18:36:30 2013 (r249483) > +++ head/lib/Makefile Sun Apr 14 19:13:51 2013 (r249484) > @@ -252,4 +252,7 @@ _libusbhid=3D libusbhid > _libusb=3D libusb > .endif > =20 > +afterinstall: > + ln -fs ../include ${DESTDIR}/usr/lib/include > + > .include This breaks with -DNO_CLEAN defined, because then ${DESTDIR}/usr/lib/include/include is created. I'm not that fond of this patch by the way, but I don't fully understand the problem it's trying to solve so I won't object. It just looks too much like a hack to me. ------enig2NLKUGFSIRFVEBONHBTKX Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iF4EAREIAAYFAlFtVPsACgkQfoCS2CCgtisXIAD/S3CqiTuMctYwQ10yBQ9nzdtZ KBdjA2SEatk1Bky9z/sA/2UUL4besuqrSrzMhidDevnS+/Qvap3XfPuLu23UZl0M =rC1m -----END PGP SIGNATURE----- ------enig2NLKUGFSIRFVEBONHBTKX-- From owner-svn-src-all@FreeBSD.ORG Tue Apr 16 13:44:41 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E0DAD707; Tue, 16 Apr 2013 13:44:41 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) by mx1.freebsd.org (Postfix) with ESMTP id 6C767BE1; Tue, 16 Apr 2013 13:44:40 +0000 (UTC) Received: from spaceball.andric.com (spaceball.andric.com [IPv6:2001:7b8:3a7:0:204:4bff:fe01:de8a]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id F37FD5C44; Tue, 16 Apr 2013 15:44:37 +0200 (CEST) Message-ID: <516D55C4.1050102@FreeBSD.org> Date: Tue, 16 Apr 2013 15:44:36 +0200 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:21.0) Gecko/20100101 Thunderbird/21.0 MIME-Version: 1.0 To: Bruce Evans Subject: Re: svn commit: r246880 - in head: lib/libsm libexec/mail.local libexec/smrsh share/mk usr.bin/vacation usr.sbin/sendmail References: <201302162017.r1GKHVdY022667@svn.freebsd.org> <87a9ozayzk.fsf@saturn.laptop> <516D13C5.70900@FreeBSD.org> <20130416205349.W1783@besplex.bde.org> In-Reply-To: <20130416205349.W1783@besplex.bde.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Cc: =?UTF-8?B?zpPOuc+Oz4HOs86/z4IgzprOtc+BzrHOvM6vzrTOsc+C?= , svn-src-head@FreeBSD.org, Gregory Shapiro , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 13:44:42 -0000 On 2013-04-16 13:28, Bruce Evans wrote: > On Tue, 16 Apr 2013, Dimitry Andric wrote: >> On 2013-04-16 06:19, =CE=93=CE=B9=CF=8E=CF=81=CE=B3=CE=BF=CF=82 =CE=9A= =CE=B5=CF=81=CE=B1=CE=BC=CE=AF=CE=B4=CE=B1=CF=82 wrote: =2E.. >>> : cc -O2 -pipe -I/usr/src/usr.sbin/sendmail/../../contrib/sendmail/s= rc >>> -I/usr/src/usr.sbin/sendmail/../../contrib/sendmail/include -I. -DNEW= DB >>> -DNIS -DTCPWRAPPERS -DMAP_REGEX -DDNSMAP -DNETINET6 -DSTARTTLS -D_FFR= _TLS_1 >>> -I/usr/local/include -DSASL=3D20126 -std=3Dgnu99 -Qunused-arguments >>> -fstack-protector -Wsystem-headers -Wno-pointer-sign -Wno-empty-body >>> -Wno-string-plus-int -Wno-tautological-compare -Wno-unused-value >>> -Wno-parentheses-equality -Wno-unused-function -Wno-conversion -Wno-s= witch >>> -Wno-switch-enum -Wno-knr-promoted-parameter -Wno-parentheses -c >>> /usr/src/usr.sbin/sendmail/../../contrib/sendmail/src/usersmtp.c >>> : /usr/src/usr.sbin/sendmail/../../contrib/sendmail/src/usersmtp.c:17= 97:50: >>> warning: incompatible pointer types passing 'void ()' to parameter of= type >>> 'void (*)(char *, bool, MAILER *, struct >>> : mailer_con_info *, ENVELOPE *)' [-Wincompatible-pointer-types= ] >>> : smtpresult =3D reply(m, mci, e, TimeOuts.to_auth, getsaslda= ta, >>> NULL, >>> : ^~~~~~~~~~~= =2E.. > stdbool is certainly incompatible with simple use of __P(()), but why d= oes > the error message say that the function type is 'void ()', and why does= n't > it say that the prototype doesn't match the function? Because we pass -Wno-knr-promoted-parameter to suppress the warning. Before clang grew this flag, we had to set NO_WERROR to make it non-fatal. =2E.. > Extending the example a little gives the answer to my question: > > @ #include > @ > @ typedef void vb(bool first); > @ > @ vb foo; > @ void bar(vb *p); > @ > @ void > @ foo(first) > @ bool first; > @ { > @ bar(foo); > @ } > > @ z.c:10:7: warning: promoted type 'int' of K&R function parameter is n= ot compatible with the parameter type 'bool' declared in a previous proto= type [-Wknr-promoted-parameter] > @ bool first; > @ ^ > @ z.c:5:4: note: previous declaration is here > @ vb foo; > @ ^ > @ z.c:12:6: warning: incompatible pointer types passing 'void ()' to pa= rameter of type 'vb *' (aka 'void (*)(bool)') [-Wincompatible-pointer-typ= es] > @ bar(foo); > @ ^~~ > @ z.c:6:14: note: passing argument to parameter 'p' here > @ void bar(vb *p); > @ ^ > @ 2 warnings generated. > > Apparently clang ignores the mismatched prototype after printing a warn= ing > about it, and also throws away the type info that it learns by compilin= g > the K&R function, so it is left with only 'void ()' for the type. Yes, this is basically what happens. The actual definition of the function overrides the prototype, if it comes before the invocation. For example, in the original problem case, the warning could also be worked around by moving the getsasldata() definition to below attemptauth(), where it is invoked. This still counts as cheating, though. :-) From owner-svn-src-all@FreeBSD.ORG Tue Apr 16 14:22:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 64D6426F; Tue, 16 Apr 2013 14:22:17 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 56793E92; Tue, 16 Apr 2013 14:22:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3GEMHA2076532; Tue, 16 Apr 2013 14:22:17 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3GEMH8F076531; Tue, 16 Apr 2013 14:22:17 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201304161422.r3GEMH8F076531@svn.freebsd.org> From: Rick Macklem Date: Tue, 16 Apr 2013 14:22:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249548 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 14:22:17 -0000 Author: rmacklem Date: Tue Apr 16 14:22:16 2013 New Revision: 249548 URL: http://svnweb.freebsd.org/changeset/base/249548 Log: Allow the vnode to be unlocked for the weird case of LK_EXCLOTHER. LK_EXCLOTHER is only used to acquire a usecount on a vnode during NFSv4 recovery from an expired lease. Reported and tested by: pho MFC after: 2 weeks Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Tue Apr 16 12:31:16 2013 (r249547) +++ head/sys/kern/vfs_subr.c Tue Apr 16 14:22:16 2013 (r249548) @@ -4123,7 +4123,7 @@ vop_lock_post(void *ap, int rc) struct vop_lock1_args *a = ap; ASSERT_VI_UNLOCKED(a->a_vp, "VOP_LOCK"); - if (rc == 0) + if (rc == 0 && (a->a_flags & LK_EXCLOTHER) == 0) ASSERT_VOP_LOCKED(a->a_vp, "VOP_LOCK"); #endif } From owner-svn-src-all@FreeBSD.ORG Tue Apr 16 14:34:35 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B33D05DE; Tue, 16 Apr 2013 14:34:35 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from tux-cave.hellug.gr (tux-cave.hellug.gr [195.134.99.74]) by mx1.freebsd.org (Postfix) with ESMTP id 199DEF0C; Tue, 16 Apr 2013 14:34:34 +0000 (UTC) X-Spam-Status: No X-Hellug-MailScanner-From: keramida@ceid.upatras.gr X-Hellug-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-2.9, required 5, autolearn=not spam, ALL_TRUSTED -1.00, BAYES_00 -1.90) X-Hellug-MailScanner: Found to be clean X-Hellug-MailScanner-ID: r3GEYLZR024559 Received: from saturn.laptop (217-162-217-29.dynamic.hispeed.ch [217.162.217.29]) (authenticated bits=0) by tux-cave.hellug.gr (8.14.3/8.14.3/Debian-9.4) with ESMTP id r3GEYLZR024559 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 16 Apr 2013 17:34:29 +0300 Received: from saturn.laptop (localhost [127.0.0.1]) by saturn.laptop (8.14.4/8.14.4/Debian-2.1ubuntu1) with ESMTP id r3GEYFQK003340 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 16 Apr 2013 16:34:15 +0200 Received: (from keramida@localhost) by saturn.laptop (8.14.4/8.14.4/Submit) id r3GEYEdU003337; Tue, 16 Apr 2013 16:34:14 +0200 X-Authentication-Warning: saturn.laptop: keramida set sender to keramida@ceid.upatras.gr using -f From: keramida@ceid.upatras.gr (Giorgos Keramidas) To: Dimitry Andric Subject: Re: svn commit: r246880 - in head: lib/libsm libexec/mail.local libexec/smrsh share/mk usr.bin/vacation usr.sbin/sendmail References: <201302162017.r1GKHVdY022667@svn.freebsd.org> <87a9ozayzk.fsf@saturn.laptop> <516D13C5.70900@FreeBSD.org> <20130416205349.W1783@besplex.bde.org> <516D55C4.1050102@FreeBSD.org> Date: Tue, 16 Apr 2013 16:34:14 +0200 In-Reply-To: <516D55C4.1050102@FreeBSD.org> (Dimitry Andric's message of "Tue, 16 Apr 2013 15:44:36 +0200") Message-ID: <87r4iaa6jd.fsf@saturn.laptop> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Cc: svn-src-head@FreeBSD.org, Gregory Shapiro , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, Bruce Evans X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 14:34:35 -0000 On Tue, 16 Apr 2013 15:44:36 +0200, Dimitry Andric wrote: > On 2013-04-16 13:28, Bruce Evans wrote: >> Extending the example a little gives the answer to my question: >> >> @ #include >> @ >> @ typedef void vb(bool first); >> @ >> @ vb foo; >> @ void bar(vb *p); >> @ >> @ void >> @ foo(first) >> @ bool first; >> @ { >> @ bar(foo); >> @ } >> >> @ z.c:10:7: warning: promoted type 'int' of K&R function parameter is >> not compatible with the parameter type 'bool' declared in a previous >> prototype [-Wknr-promoted-parameter] >> @ bool first; >> @ ^ >> @ z.c:5:4: note: previous declaration is here >> @ vb foo; >> @ ^ >> @ z.c:12:6: warning: incompatible pointer types passing 'void ()' to parameter of type 'vb *' (aka 'void (*)(bool)') [-Wincompatible-pointer-types] >> @ bar(foo); >> @ ^~~ >> @ z.c:6:14: note: passing argument to parameter 'p' here >> @ void bar(vb *p); >> @ ^ >> @ 2 warnings generated. >> >> Apparently clang ignores the mismatched prototype after printing a warning >> about it, and also throws away the type info that it learns by compiling >> the K&R function, so it is left with only 'void ()' for the type. > > Yes, this is basically what happens. The actual definition of the > function overrides the prototype, if it comes before the invocation. > > For example, in the original problem case, the warning could also be > worked around by moving the getsasldata() definition to below > attemptauth(), where it is invoked. This still counts as cheating, > though. :-) And that's precisely why other functions, like esmtp_check() do not have the same problem, even though they have exactly the same signature and they are used in the same way! From owner-svn-src-all@FreeBSD.ORG Tue Apr 16 16:09:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 919ABB1F; Tue, 16 Apr 2013 16:09:28 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 69997603; Tue, 16 Apr 2013 16:09:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3GG9SKb009939; Tue, 16 Apr 2013 16:09:28 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3GG9SID009937; Tue, 16 Apr 2013 16:09:28 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201304161609.r3GG9SID009937@svn.freebsd.org> From: Brooks Davis Date: Tue, 16 Apr 2013 16:09:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249549 - in stable/9/sys: amd64/conf i386/conf X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 16:09:28 -0000 Author: brooks Date: Tue Apr 16 16:09:27 2013 New Revision: 249549 URL: http://svnweb.freebsd.org/changeset/base/249549 Log: MFC (much delayed) 234504: Enable DTrace hooks in GENERIC. Modified: stable/9/sys/amd64/conf/GENERIC stable/9/sys/i386/conf/GENERIC Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/amd64/conf/GENERIC ============================================================================== --- stable/9/sys/amd64/conf/GENERIC Tue Apr 16 14:22:16 2013 (r249548) +++ stable/9/sys/amd64/conf/GENERIC Tue Apr 16 16:09:27 2013 (r249549) @@ -22,6 +22,7 @@ cpu HAMMER ident GENERIC makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols +makeoptions WITH_CTF=1 # Run ctfconvert(1) for DTrace support options SCHED_ULE # ULE scheduler options PREEMPTION # Enable kernel thread preemption @@ -63,11 +64,12 @@ options KBD_INSTALL_CDEV # install a CD options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) options AUDIT # Security event auditing options MAC # TrustedBSD MAC Framework -#options KDTRACE_FRAME # Ensure frames are compiled in -#options KDTRACE_HOOKS # Kernel DTrace hooks +options KDTRACE_FRAME # Ensure frames are compiled in +options KDTRACE_HOOKS # Kernel DTrace hooks options INCLUDE_CONFIG_FILE # Include this file in kernel options KDB # Kernel debugger related code options KDB_TRACE # Print a stack trace for a panic +options DDB_CTF # kernel ELF linker loads CTF data # Make an SMP-capable kernel by default options SMP # Symmetric MultiProcessor Kernel Modified: stable/9/sys/i386/conf/GENERIC ============================================================================== --- stable/9/sys/i386/conf/GENERIC Tue Apr 16 14:22:16 2013 (r249548) +++ stable/9/sys/i386/conf/GENERIC Tue Apr 16 16:09:27 2013 (r249549) @@ -24,6 +24,7 @@ cpu I686_CPU ident GENERIC makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols +makeoptions WITH_CTF=1 # Run ctfconvert(1) for DTrace support options SCHED_ULE # ULE scheduler options PREEMPTION # Enable kernel thread preemption @@ -64,10 +65,11 @@ options KBD_INSTALL_CDEV # install a CD options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) options AUDIT # Security event auditing options MAC # TrustedBSD MAC Framework -#options KDTRACE_HOOKS # Kernel DTrace hooks +options KDTRACE_HOOKS # Kernel DTrace hooks options INCLUDE_CONFIG_FILE # Include this file in kernel options KDB # Kernel debugger related code options KDB_TRACE # Print a stack trace for a panic +options DDB_CTF # kernel ELF linker loads CTF data # To make an SMP kernel, the next two lines are needed options SMP # Symmetric MultiProcessor Kernel From owner-svn-src-all@FreeBSD.ORG Tue Apr 16 16:14:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 66C35200; Tue, 16 Apr 2013 16:14:31 +0000 (UTC) (envelope-from prvs=18180aeca7=killing@multiplay.co.uk) Received: from mail1.multiplay.co.uk (mail1.multiplay.co.uk [85.236.96.23]) by mx1.freebsd.org (Postfix) with ESMTP id 5B03E676; Tue, 16 Apr 2013 16:14:30 +0000 (UTC) Received: from r2d2 ([46.65.172.4]) by mail1.multiplay.co.uk (mail1.multiplay.co.uk [85.236.96.23]) (MDaemon PRO v10.0.4) with ESMTP id md50003302279.msg; Tue, 16 Apr 2013 17:14:23 +0100 X-Spam-Processed: mail1.multiplay.co.uk, Tue, 16 Apr 2013 17:14:23 +0100 (not processed: message from valid local sender) X-MDDKIM-Result: neutral (mail1.multiplay.co.uk) X-MDRemoteIP: 46.65.172.4 X-Return-Path: prvs=18180aeca7=killing@multiplay.co.uk X-Envelope-From: killing@multiplay.co.uk Message-ID: <2F45DF711D81416BBAD8B24EAF8AFA36@multiplay.co.uk> From: "Steven Hartland" To: "Brooks Davis" , , , , References: <201304161609.r3GG9SID009937@svn.freebsd.org> Subject: Re: svn commit: r249549 - in stable/9/sys: amd64/conf i386/conf Date: Tue, 16 Apr 2013 17:14:41 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="UTF-8"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 16:14:31 -0000 ----- Original Message ----- From: "Brooks Davis" > Author: brooks > Date: Tue Apr 16 16:09:27 2013 > New Revision: 249549 > URL: http://svnweb.freebsd.org/changeset/base/249549 > > Log: > MFC (much delayed) 234504: > > Enable DTrace hooks in GENERIC. > > Modified: > stable/9/sys/amd64/conf/GENERIC > stable/9/sys/i386/conf/GENERIC > Directory Properties: > stable/9/sys/ (props changed) > > Modified: stable/9/sys/amd64/conf/GENERIC > ============================================================================== > --- stable/9/sys/amd64/conf/GENERIC Tue Apr 16 14:22:16 2013 (r249548) > +++ stable/9/sys/amd64/conf/GENERIC Tue Apr 16 16:09:27 2013 (r249549) > @@ -22,6 +22,7 @@ cpu HAMMER > ident GENERIC > > makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols > +makeoptions WITH_CTF=1 # Run ctfconvert(1) for DTrace support > > options SCHED_ULE # ULE scheduler > options PREEMPTION # Enable kernel thread preemption > @@ -63,11 +64,12 @@ options KBD_INSTALL_CDEV # install a CD > options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) > options AUDIT # Security event auditing > options MAC # TrustedBSD MAC Framework > -#options KDTRACE_FRAME # Ensure frames are compiled in > -#options KDTRACE_HOOKS # Kernel DTrace hooks > +options KDTRACE_FRAME # Ensure frames are compiled in > +options KDTRACE_HOOKS # Kernel DTrace hooks > options INCLUDE_CONFIG_FILE # Include this file in kernel > options KDB # Kernel debugger related code > options KDB_TRACE # Print a stack trace for a panic > +options DDB_CTF # kernel ELF linker loads CTF data > > # Make an SMP-capable kernel by default > options SMP # Symmetric MultiProcessor Kernel > > Modified: stable/9/sys/i386/conf/GENERIC > ============================================================================== > --- stable/9/sys/i386/conf/GENERIC Tue Apr 16 14:22:16 2013 (r249548) > +++ stable/9/sys/i386/conf/GENERIC Tue Apr 16 16:09:27 2013 (r249549) > @@ -24,6 +24,7 @@ cpu I686_CPU > ident GENERIC > > makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols > +makeoptions WITH_CTF=1 # Run ctfconvert(1) for DTrace support > > options SCHED_ULE # ULE scheduler > options PREEMPTION # Enable kernel thread preemption > @@ -64,10 +65,11 @@ options KBD_INSTALL_CDEV # install a CD > options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) > options AUDIT # Security event auditing > options MAC # TrustedBSD MAC Framework > -#options KDTRACE_HOOKS # Kernel DTrace hooks > +options KDTRACE_HOOKS # Kernel DTrace hooks > options INCLUDE_CONFIG_FILE # Include this file in kernel > options KDB # Kernel debugger related code > options KDB_TRACE # Print a stack trace for a panic > +options DDB_CTF # kernel ELF linker loads CTF data > > # To make an SMP kernel, the next two lines are needed > options SMP # Symmetric MultiProcessor Kernel What's the performance / memory usage impact of enabling these by default? Regards Steve ================================================ This e.mail is private and confidential between Multiplay (UK) Ltd. and the person or entity to whom it is addressed. In the event of misdirection, the recipient is prohibited from using, copying, printing or otherwise disseminating it or any information contained in it. In the event of misdirection, illegible or incomplete transmission please telephone +44 845 868 1337 or return the E.mail to postmaster@multiplay.co.uk. From owner-svn-src-all@FreeBSD.ORG Tue Apr 16 16:19:21 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6306E83E for ; Tue, 16 Apr 2013 16:19:21 +0000 (UTC) (envelope-from jdc@koitsu.org) Received: from qmta01.emeryville.ca.mail.comcast.net (qmta01.emeryville.ca.mail.comcast.net [IPv6:2001:558:fe2d:43:76:96:30:16]) by mx1.freebsd.org (Postfix) with ESMTP id 48A396C3 for ; Tue, 16 Apr 2013 16:19:21 +0000 (UTC) Received: from omta01.emeryville.ca.mail.comcast.net ([76.96.30.11]) by qmta01.emeryville.ca.mail.comcast.net with comcast id QdAx1l0060EPchoA1gKMx4; Tue, 16 Apr 2013 16:19:21 +0000 Received: from koitsu.strangled.net ([67.180.84.87]) by omta01.emeryville.ca.mail.comcast.net with comcast id QgKL1l0041t3BNj8MgKLn4; Tue, 16 Apr 2013 16:19:20 +0000 Received: by icarus.home.lan (Postfix, from userid 1000) id DEA0073A33; Tue, 16 Apr 2013 09:19:19 -0700 (PDT) Date: Tue, 16 Apr 2013 09:19:19 -0700 From: Jeremy Chadwick To: Brooks Davis Subject: Re: svn commit: r249549 - in stable/9/sys: amd64/conf i386/conf Message-ID: <20130416161919.GA80626@icarus.home.lan> References: <201304161609.r3GG9SID009937@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201304161609.r3GG9SID009937@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20121106; t=1366129161; bh=c39IGxW/Xm4Z0cLTIsn5919wyGaCl2zOjqsrEgA6gU8=; h=Received:Received:Received:Date:From:To:Subject:Message-ID: MIME-Version:Content-Type; b=mUxJurbryp7jSOpvS+luny7X2ylKf84UfL2exGyQcAne+ey7MqnfPnlraljG5uKR3 fxPrV5BwdSDuVzon+ILTscrlxRpKNSrsJIbNSiMO28t34GoPnCHcypknPBjN3Zu9dR qJ3KLlfjHQmFAgUFfvUcVnEQPCdyfMrgfH5NXcIsyC73+mdakrbX1I1q4M+vZGXPFN 80bgMUMe/1FDJ+nnfLZKW/gTVe+lZurVFAMu13CGwFCE2MmG7Z5vghQFSC7rZjalAp O9PugFVoRmE9rPIimhBcaBCJkTJ5P2qMYajyMT31xNxiNtJkqq/tWhb9v2sNc3eG8y RwgtCjVCQ6wqw== Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 16:19:21 -0000 On Tue, Apr 16, 2013 at 04:09:28PM +0000, Brooks Davis wrote: > Author: brooks > Date: Tue Apr 16 16:09:27 2013 > New Revision: 249549 > URL: http://svnweb.freebsd.org/changeset/base/249549 > > Log: > MFC (much delayed) 234504: > > Enable DTrace hooks in GENERIC. > > Modified: > stable/9/sys/amd64/conf/GENERIC > stable/9/sys/i386/conf/GENERIC > Directory Properties: > stable/9/sys/ (props changed) > > Modified: stable/9/sys/amd64/conf/GENERIC > ============================================================================== > --- stable/9/sys/amd64/conf/GENERIC Tue Apr 16 14:22:16 2013 (r249548) > +++ stable/9/sys/amd64/conf/GENERIC Tue Apr 16 16:09:27 2013 (r249549) > @@ -22,6 +22,7 @@ cpu HAMMER > ident GENERIC > > makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols > +makeoptions WITH_CTF=1 # Run ctfconvert(1) for DTrace support > > options SCHED_ULE # ULE scheduler > options PREEMPTION # Enable kernel thread preemption > @@ -63,11 +64,12 @@ options KBD_INSTALL_CDEV # install a CD > options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) > options AUDIT # Security event auditing > options MAC # TrustedBSD MAC Framework > -#options KDTRACE_FRAME # Ensure frames are compiled in > -#options KDTRACE_HOOKS # Kernel DTrace hooks > +options KDTRACE_FRAME # Ensure frames are compiled in > +options KDTRACE_HOOKS # Kernel DTrace hooks > options INCLUDE_CONFIG_FILE # Include this file in kernel > options KDB # Kernel debugger related code > options KDB_TRACE # Print a stack trace for a panic > +options DDB_CTF # kernel ELF linker loads CTF data > > # Make an SMP-capable kernel by default > options SMP # Symmetric MultiProcessor Kernel > > Modified: stable/9/sys/i386/conf/GENERIC > ============================================================================== > --- stable/9/sys/i386/conf/GENERIC Tue Apr 16 14:22:16 2013 (r249548) > +++ stable/9/sys/i386/conf/GENERIC Tue Apr 16 16:09:27 2013 (r249549) > @@ -24,6 +24,7 @@ cpu I686_CPU > ident GENERIC > > makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols > +makeoptions WITH_CTF=1 # Run ctfconvert(1) for DTrace support > > options SCHED_ULE # ULE scheduler > options PREEMPTION # Enable kernel thread preemption > @@ -64,10 +65,11 @@ options KBD_INSTALL_CDEV # install a CD > options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) > options AUDIT # Security event auditing > options MAC # TrustedBSD MAC Framework > -#options KDTRACE_HOOKS # Kernel DTrace hooks > +options KDTRACE_HOOKS # Kernel DTrace hooks > options INCLUDE_CONFIG_FILE # Include this file in kernel > options KDB # Kernel debugger related code > options KDB_TRACE # Print a stack trace for a panic > +options DDB_CTF # kernel ELF linker loads CTF data > > # To make an SMP kernel, the next two lines are needed > options SMP # Symmetric MultiProcessor Kernel Now that this has been enabled by default, I should warn folks of a caveat that I found in the buildworld/buildkernel framework. It's easiest to explain like this: 1. Install FreeBSD 9.x, svn checkout of stable/9, etc... 2. Add WITHOUT_CDDL=true to /etc/src.conf 3. Rebuild + install kernel/world per src/Makefile procedure 4. Remove WITHOUT_CDDL=true from /etc/src.conf 5. rm -fr /usr/obj/* 6. Rebuild world 7. Rebuild kernel -- fails, stating "ctfconvert: not found". For whatever reason the buildkernel bits make the assumption that ctfconvert exists on the system (presumably in $PATH or possibly a hard-coded), when ideally it should try to use the recently-built version in /usr/obj first. -- | Jeremy Chadwick jdc@koitsu.org | | UNIX Systems Administrator http://jdc.koitsu.org/ | | Mountain View, CA, US | | Making life hard for others since 1977. PGP 4BD6C0CB | From owner-svn-src-all@FreeBSD.ORG Tue Apr 16 16:35:49 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5593DC4D; Tue, 16 Apr 2013 16:35:49 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 37AB87B9; Tue, 16 Apr 2013 16:35:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3GGZn3C019369; Tue, 16 Apr 2013 16:35:49 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3GGZmaT019365; Tue, 16 Apr 2013 16:35:48 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201304161635.r3GGZmaT019365@svn.freebsd.org> From: Dimitry Andric Date: Tue, 16 Apr 2013 16:35:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249550 - in stable/9/sys: arm/xscale/ixp425 mips/atheros mips/rt305x X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 16:35:49 -0000 Author: dim Date: Tue Apr 16 16:35:48 2013 New Revision: 249550 URL: http://svnweb.freebsd.org/changeset/base/249550 Log: MFC r249449: Fix undefined behaviour in several gpio_pin_setflags() routines (under sys/arm and sys/mips), squelching the clang 3.3 warnings about this. Noticed by: tinderbox and many irate spectators Submitted by: Luiz Otavio O Souza PR: kern/177759 Modified: stable/9/sys/arm/xscale/ixp425/avila_gpio.c stable/9/sys/arm/xscale/ixp425/cambria_gpio.c stable/9/sys/mips/atheros/ar71xx_gpio.c stable/9/sys/mips/rt305x/rt305x_gpio.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/arm/xscale/ixp425/avila_gpio.c ============================================================================== --- stable/9/sys/arm/xscale/ixp425/avila_gpio.c Tue Apr 16 16:09:27 2013 (r249549) +++ stable/9/sys/arm/xscale/ixp425/avila_gpio.c Tue Apr 16 16:35:48 2013 (r249550) @@ -220,8 +220,8 @@ avila_gpio_pin_setflags(device_t dev, ui if (pin >= IXP4XX_GPIO_PINS || !(sc->sc_valid & mask)) return (EINVAL); - /* Filter out unwanted flags */ - if ((flags &= sc->sc_pins[pin].gp_caps) != flags) + /* Check for unwanted flags. */ + if ((flags & sc->sc_pins[pin].gp_caps) != flags) return (EINVAL); /* Can't mix input/output together */ Modified: stable/9/sys/arm/xscale/ixp425/cambria_gpio.c ============================================================================== --- stable/9/sys/arm/xscale/ixp425/cambria_gpio.c Tue Apr 16 16:09:27 2013 (r249549) +++ stable/9/sys/arm/xscale/ixp425/cambria_gpio.c Tue Apr 16 16:35:48 2013 (r249550) @@ -317,8 +317,8 @@ cambria_gpio_pin_setflags(device_t dev, if (pin >= GPIO_PINS) return (EINVAL); - /* Filter out unwanted flags */ - if ((flags &= sc->sc_pins[pin].gp_caps) != flags) + /* Check for unwanted flags. */ + if ((flags & sc->sc_pins[pin].gp_caps) != flags) return (EINVAL); /* Can't mix input/output together */ Modified: stable/9/sys/mips/atheros/ar71xx_gpio.c ============================================================================== --- stable/9/sys/mips/atheros/ar71xx_gpio.c Tue Apr 16 16:09:27 2013 (r249549) +++ stable/9/sys/mips/atheros/ar71xx_gpio.c Tue Apr 16 16:35:48 2013 (r249550) @@ -238,8 +238,8 @@ ar71xx_gpio_pin_setflags(device_t dev, u if (i >= sc->gpio_npins) return (EINVAL); - /* Filter out unwanted flags */ - if ((flags &= sc->gpio_pins[i].gp_caps) != flags) + /* Check for unwanted flags. */ + if ((flags & sc->gpio_pins[i].gp_caps) != flags) return (EINVAL); /* Can't mix input/output together */ Modified: stable/9/sys/mips/rt305x/rt305x_gpio.c ============================================================================== --- stable/9/sys/mips/rt305x/rt305x_gpio.c Tue Apr 16 16:09:27 2013 (r249549) +++ stable/9/sys/mips/rt305x/rt305x_gpio.c Tue Apr 16 16:35:48 2013 (r249550) @@ -242,8 +242,8 @@ rt305x_gpio_pin_setflags(device_t dev, u if (i >= sc->gpio_npins) return (EINVAL); - /* Filter out unwanted flags */ - if ((flags &= sc->gpio_pins[i].gp_caps) != flags) + /* Check for unwanted flags. */ + if ((flags & sc->gpio_pins[i].gp_caps) != flags) return (EINVAL); /* Can't mix input/output together */ From owner-svn-src-all@FreeBSD.ORG Tue Apr 16 16:39:02 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id ACB82E0F; Tue, 16 Apr 2013 16:39:02 +0000 (UTC) (envelope-from gshapiro@freebsd.org) Received: from zim.gshapiro.net (zim.gshapiro.net [IPv6:2001:4f8:3:36::224]) by mx1.freebsd.org (Postfix) with ESMTP id 970DE7E6; Tue, 16 Apr 2013 16:39:02 +0000 (UTC) Received: from rugsucker.smi.sendmail.com (natted.sendmail.com [63.211.143.38]) (authenticated bits=0) by zim.gshapiro.net (8.14.7.Alpha0/8.14.6) with ESMTP id r3GGcoiB082945 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 16 Apr 2013 09:38:55 -0700 (PDT) (envelope-from gshapiro@freebsd.org) Date: Tue, 16 Apr 2013 09:38:49 -0700 From: Gregory Shapiro To: Giorgos Keramidas Subject: Re: svn commit: r246880 - in head: lib/libsm libexec/mail.local libexec/smrsh share/mk usr.bin/vacation usr.sbin/sendmail Message-ID: <20130416163849.GZ681@rugsucker.smi.sendmail.com> References: <201302162017.r1GKHVdY022667@svn.freebsd.org> <87a9ozayzk.fsf@saturn.laptop> <516D13C5.70900@FreeBSD.org> <20130416205349.W1783@besplex.bde.org> <516D55C4.1050102@FreeBSD.org> <87r4iaa6jd.fsf@saturn.laptop> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87r4iaa6jd.fsf@saturn.laptop> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Dimitry Andric , Bruce Evans X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 16:39:02 -0000 Just a quick comment that I will be committing a fix to the sendmail source tree on FreeBSD to avoid this issue. It will avoid loading stdbool.h when clang is in use, thereby turning all bools to ints. It will be checked in this weekend (currently being tested before release). /* ** SM_CONF_STDBOOL_H is 1 if exists ** ** Note, unlike gcc, clang doesn't apply full prototypes to K&R definitions. */ # ifndef SM_CONF_STDBOOL_H # if !defined(__clang__) && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L # define SM_CONF_STDBOOL_H 1 # else /* !defined(__clang__) && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L */ # define SM_CONF_STDBOOL_H 0 # endif /* !defined(__clang__) && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L */ # endif /* ! SM_CONF_STDBOOL_H */ From owner-svn-src-all@FreeBSD.ORG Tue Apr 16 16:43:34 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B6B1B1D2; Tue, 16 Apr 2013 16:43:34 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (lor.one-eyed-alien.net [69.66.77.232]) by mx1.freebsd.org (Postfix) with ESMTP id EC9B3831; Tue, 16 Apr 2013 16:43:26 +0000 (UTC) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.5/8.14.5) with ESMTP id r3GGhVjF014722; Tue, 16 Apr 2013 11:43:31 -0500 (CDT) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.5/8.14.5/Submit) id r3GGhVsY014721; Tue, 16 Apr 2013 11:43:31 -0500 (CDT) (envelope-from brooks) Date: Tue, 16 Apr 2013 11:43:31 -0500 From: Brooks Davis To: Steven Hartland Subject: Re: svn commit: r249549 - in stable/9/sys: amd64/conf i386/conf Message-ID: <20130416164331.GF98205@lor.one-eyed-alien.net> References: <201304161609.r3GG9SID009937@svn.freebsd.org> <2F45DF711D81416BBAD8B24EAF8AFA36@multiplay.co.uk> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Ls2Gy6y7jbHLe9Od" Content-Disposition: inline In-Reply-To: <2F45DF711D81416BBAD8B24EAF8AFA36@multiplay.co.uk> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-9@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 16:43:34 -0000 --Ls2Gy6y7jbHLe9Od Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Apr 16, 2013 at 05:14:41PM +0100, Steven Hartland wrote: > ----- Original Message -----=20 > From: "Brooks Davis" > > Author: brooks > > Date: Tue Apr 16 16:09:27 2013 > > New Revision: 249549 > > URL: http://svnweb.freebsd.org/changeset/base/249549 > >=20 > > Log: > > MFC (much delayed) 234504: > > =20 > > Enable DTrace hooks in GENERIC. > >=20 > > Modified: > > stable/9/sys/amd64/conf/GENERIC > > stable/9/sys/i386/conf/GENERIC > > Directory Properties: > > stable/9/sys/ (props changed) > >=20 > > Modified: stable/9/sys/amd64/conf/GENERIC > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- stable/9/sys/amd64/conf/GENERIC Tue Apr 16 14:22:16 2013 (r249548) > > +++ stable/9/sys/amd64/conf/GENERIC Tue Apr 16 16:09:27 2013 (r249549) > > @@ -22,6 +22,7 @@ cpu HAMMER > > ident GENERIC > >=20 > > makeoptions DEBUG=3D-g # Build kernel with gdb(1) debug symbols > > +makeoptions WITH_CTF=3D1 # Run ctfconvert(1) for DTrace support > >=20 > > options SCHED_ULE # ULE scheduler > > options PREEMPTION # Enable kernel thread preemption > > @@ -63,11 +64,12 @@ options KBD_INSTALL_CDEV # install a CD > > options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) > > options AUDIT # Security event auditing > > options MAC # TrustedBSD MAC Framework > > -#options KDTRACE_FRAME # Ensure frames are compiled in > > -#options KDTRACE_HOOKS # Kernel DTrace hooks > > +options KDTRACE_FRAME # Ensure frames are compiled in > > +options KDTRACE_HOOKS # Kernel DTrace hooks > > options INCLUDE_CONFIG_FILE # Include this file in kernel > > options KDB # Kernel debugger related code > > options KDB_TRACE # Print a stack trace for a panic > > +options DDB_CTF # kernel ELF linker loads CTF data > >=20 > > # Make an SMP-capable kernel by default > > options SMP # Symmetric MultiProcessor Kernel > >=20 > > Modified: stable/9/sys/i386/conf/GENERIC > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- stable/9/sys/i386/conf/GENERIC Tue Apr 16 14:22:16 2013 (r249548) > > +++ stable/9/sys/i386/conf/GENERIC Tue Apr 16 16:09:27 2013 (r249549) > > @@ -24,6 +24,7 @@ cpu I686_CPU > > ident GENERIC > >=20 > > makeoptions DEBUG=3D-g # Build kernel with gdb(1) debug symbols > > +makeoptions WITH_CTF=3D1 # Run ctfconvert(1) for DTrace support > >=20 > > options SCHED_ULE # ULE scheduler > > options PREEMPTION # Enable kernel thread preemption > > @@ -64,10 +65,11 @@ options KBD_INSTALL_CDEV # install a CD > > options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) > > options AUDIT # Security event auditing > > options MAC # TrustedBSD MAC Framework > > -#options KDTRACE_HOOKS # Kernel DTrace hooks > > +options KDTRACE_HOOKS # Kernel DTrace hooks > > options INCLUDE_CONFIG_FILE # Include this file in kernel > > options KDB # Kernel debugger related code > > options KDB_TRACE # Print a stack trace for a panic > > +options DDB_CTF # kernel ELF linker loads CTF data > >=20 > > # To make an SMP kernel, the next two lines are needed > > options SMP # Symmetric MultiProcessor Kernel >=20 > What's the performance / memory usage impact of enabling these > by default? The performance impact should be close to zero, but I've not attempted to measure it. Others who are using DTrace in production could probably comment more usefully. DDB_CTF causes the slightly less than 700KB SUNW_ctf section to be loaded into RAM that should be the majority of the overhead. -- Brooks --Ls2Gy6y7jbHLe9Od Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iD8DBQFRbX+yXY6L6fI4GtQRAiT4AJ9NbF20hUhxQ2UGymuei0z8G7QFkACfcblM EPEUqDwksu6Jax7ksXmNea4= =3TlJ -----END PGP SIGNATURE----- --Ls2Gy6y7jbHLe9Od-- From owner-svn-src-all@FreeBSD.ORG Tue Apr 16 16:54:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CA38CB2C; Tue, 16 Apr 2013 16:54:37 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BCAE08CD; Tue, 16 Apr 2013 16:54:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3GGsbPd025653; Tue, 16 Apr 2013 16:54:37 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3GGsbi3025652; Tue, 16 Apr 2013 16:54:37 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201304161654.r3GGsbi3025652@svn.freebsd.org> From: Warner Losh Date: Tue, 16 Apr 2013 16:54:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249551 - head/sys/mips/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 16:54:37 -0000 Author: imp Date: Tue Apr 16 16:54:37 2013 New Revision: 249551 URL: http://svnweb.freebsd.org/changeset/base/249551 Log: Point to regdef.h. May need to dig up references to the N32 standard that support this usage (which may be a bit rough, since different parts of the standard say mutually contradictory things). Modified: head/sys/mips/include/regnum.h Modified: head/sys/mips/include/regnum.h ============================================================================== --- head/sys/mips/include/regnum.h Tue Apr 16 16:35:48 2013 (r249550) +++ head/sys/mips/include/regnum.h Tue Apr 16 16:54:37 2013 (r249551) @@ -125,7 +125,7 @@ /* * Pseudo registers so we save a complete set of registers regardless of - * the ABI + * the ABI. See regdef.h for a more complete explanation. */ #if defined(__mips_n32) || defined(__mips_n64) #define TA0 8 From owner-svn-src-all@FreeBSD.ORG Tue Apr 16 16:59:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id DB7E1F54; Tue, 16 Apr 2013 16:59:29 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CE43F8F2; Tue, 16 Apr 2013 16:59:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3GGxTno026697; Tue, 16 Apr 2013 16:59:29 GMT (envelope-from tijl@svn.freebsd.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3GGxTgW026696; Tue, 16 Apr 2013 16:59:29 GMT (envelope-from tijl@svn.freebsd.org) Message-Id: <201304161659.r3GGxTgW026696@svn.freebsd.org> From: Tijl Coosemans Date: Tue, 16 Apr 2013 16:59:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249552 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 16:59:29 -0000 Author: tijl Date: Tue Apr 16 16:59:29 2013 New Revision: 249552 URL: http://svnweb.freebsd.org/changeset/base/249552 Log: Fix build after r249543. Modified: head/sys/netinet6/ip6_var.h Modified: head/sys/netinet6/ip6_var.h ============================================================================== --- head/sys/netinet6/ip6_var.h Tue Apr 16 16:54:37 2013 (r249551) +++ head/sys/netinet6/ip6_var.h Tue Apr 16 16:59:29 2013 (r249552) @@ -242,7 +242,7 @@ struct ip6stat { u_quad_t ip6s_sources_deprecated[IP6S_SCOPECNT]; /* number of times that each rule of source selection is applied. */ - u_quad_t ip6s_sources_rule[IP6S_MAXRULES]; + u_quad_t ip6s_sources_rule[IP6S_RULESMAX]; }; #ifdef _KERNEL From owner-svn-src-all@FreeBSD.ORG Tue Apr 16 17:03:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1967B2B4; Tue, 16 Apr 2013 17:03:36 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 09DBA92C; Tue, 16 Apr 2013 17:03:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3GH3ZtC029198; Tue, 16 Apr 2013 17:03:35 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3GH3Z7W029197; Tue, 16 Apr 2013 17:03:35 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201304161703.r3GH3Z7W029197@svn.freebsd.org> From: Robert Watson Date: Tue, 16 Apr 2013 17:03:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249553 - head/lib/libstand/mips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 17:03:36 -0000 Author: rwatson Date: Tue Apr 16 17:03:35 2013 New Revision: 249553 URL: http://svnweb.freebsd.org/changeset/base/249553 Log: Adapt libstand's setjmp/longjmp MIPS support to be portable across 32-bit and 64-bit MIPS. Don't use the floating-point coprocessor in the libstand context for MIPS. Reviewed by: imp MFC after: 3 days Sponsored by: DARPA, AFRL Modified: head/lib/libstand/mips/_setjmp.S Modified: head/lib/libstand/mips/_setjmp.S ============================================================================== --- head/lib/libstand/mips/_setjmp.S Tue Apr 16 16:59:29 2013 (r249552) +++ head/lib/libstand/mips/_setjmp.S Tue Apr 16 17:03:35 2013 (r249553) @@ -59,33 +59,20 @@ LEAF(_setjmp) .set noreorder - li v0, 0xACEDBADE # sigcontext magic number - sw ra, (2 * 4)(a0) # sc_pc = return address - sw v0, (3 * 4)(a0) # saved in sc_regs[0] - sw s0, ((S0 + 3) * 4)(a0) - sw s1, ((S1 + 3) * 4)(a0) - sw s2, ((S2 + 3) * 4)(a0) - sw s3, ((S3 + 3) * 4)(a0) - sw s4, ((S4 + 3) * 4)(a0) - sw s5, ((S5 + 3) * 4)(a0) - sw s6, ((S6 + 3) * 4)(a0) - sw s7, ((S7 + 3) * 4)(a0) - sw sp, ((SP + 3) * 4)(a0) - sw s8, ((S8 + 3) * 4)(a0) - cfc1 v0, $31 # too bad cant check if FP used - swc1 $f20, ((20 + 38) * 4)(a0) - swc1 $f21, ((21 + 38) * 4)(a0) - swc1 $f22, ((22 + 38) * 4)(a0) - swc1 $f23, ((23 + 38) * 4)(a0) - swc1 $f24, ((24 + 38) * 4)(a0) - swc1 $f25, ((25 + 38) * 4)(a0) - swc1 $f26, ((26 + 38) * 4)(a0) - swc1 $f27, ((27 + 38) * 4)(a0) - swc1 $f28, ((28 + 38) * 4)(a0) - swc1 $f29, ((29 + 38) * 4)(a0) - swc1 $f30, ((30 + 38) * 4)(a0) - swc1 $f31, ((31 + 38) * 4)(a0) - sw v0, ((32 + 38) * 4)(a0) + REG_LI v0, 0xACEDBADE # sigcontext magic number + REG_S ra, (2 * SZREG)(a0) # sc_pc = return address + REG_S v0, (3 * SZREG)(a0) # saved in sc_regs[0] + REG_S s0, ((S0 + 3) * SZREG)(a0) + REG_S s1, ((S1 + 3) * SZREG)(a0) + REG_S s2, ((S2 + 3) * SZREG)(a0) + REG_S s3, ((S3 + 3) * SZREG)(a0) + REG_S s4, ((S4 + 3) * SZREG)(a0) + REG_S s5, ((S5 + 3) * SZREG)(a0) + REG_S s6, ((S6 + 3) * SZREG)(a0) + REG_S s7, ((S7 + 3) * SZREG)(a0) + REG_S sp, ((SP + 3) * SZREG)(a0) + REG_S s8, ((S8 + 3) * SZREG)(a0) + REG_S v0, ((32 + 38) * SZREG)(a0) j ra move v0, zero END(_setjmp) @@ -96,38 +83,22 @@ LEAF(_longjmp) .cprestore 16 #endif .set noreorder - lw v0, (3 * 4)(a0) # get magic number - lw ra, (2 * 4)(a0) + REG_L v0, (3 * SZREG)(a0) # get magic number + REG_L ra, (2 * SZREG)(a0) bne v0, 0xACEDBADE, botch # jump if error addu sp, sp, 32 # does not matter, sanity - lw s0, ((S0 + 3) * 4)(a0) - lw s1, ((S1 + 3) * 4)(a0) - lw s2, ((S2 + 3) * 4)(a0) - lw s3, ((S3 + 3) * 4)(a0) - lw s4, ((S4 + 3) * 4)(a0) - lw s5, ((S5 + 3) * 4)(a0) - lw s6, ((S6 + 3) * 4)(a0) - lw s7, ((S7 + 3) * 4)(a0) - lw v0, ((32 + 38) * 4)(a0) # get fpu status - lw sp, ((SP + 3) * 4)(a0) - lw s8, ((S8 + 3) * 4)(a0) -/* Octeon does not have an FPU */ -#if !defined(_MIPS_ARCH_OCTEON) - ctc1 v0, $31 - lwc1 $f20, ((20 + 38) * 4)(a0) - lwc1 $f21, ((21 + 38) * 4)(a0) - lwc1 $f22, ((22 + 38) * 4)(a0) - lwc1 $f23, ((23 + 38) * 4)(a0) - lwc1 $f24, ((24 + 38) * 4)(a0) - lwc1 $f25, ((25 + 38) * 4)(a0) - lwc1 $f26, ((26 + 38) * 4)(a0) - lwc1 $f27, ((27 + 38) * 4)(a0) - lwc1 $f28, ((28 + 38) * 4)(a0) - lwc1 $f29, ((29 + 38) * 4)(a0) - lwc1 $f30, ((30 + 38) * 4)(a0) - lwc1 $f31, ((31 + 38) * 4)(a0) -#endif /* _MIPS_ARCH_OCTEON */ + REG_L s0, ((S0 + 3) * SZREG)(a0) + REG_L s1, ((S1 + 3) * SZREG)(a0) + REG_L s2, ((S2 + 3) * SZREG)(a0) + REG_L s3, ((S3 + 3) * SZREG)(a0) + REG_L s4, ((S4 + 3) * SZREG)(a0) + REG_L s5, ((S5 + 3) * SZREG)(a0) + REG_L s6, ((S6 + 3) * SZREG)(a0) + REG_L s7, ((S7 + 3) * SZREG)(a0) + REG_L v0, ((32 + 38) * SZREG)(a0) # get fpu status + REG_L sp, ((SP + 3) * SZREG)(a0) + REG_L s8, ((S8 + 3) * SZREG)(a0) j ra move v0, a1 From owner-svn-src-all@FreeBSD.ORG Tue Apr 16 17:11:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D6C62D1C; Tue, 16 Apr 2013 17:11:32 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) by mx1.freebsd.org (Postfix) with ESMTP id B3A829C0; Tue, 16 Apr 2013 17:11:32 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 241BAB962; Tue, 16 Apr 2013 13:11:32 -0400 (EDT) From: John Baldwin To: Hiren Panchasara Subject: Re: svn commit: r249461 - head/sys/dev/ips Date: Tue, 16 Apr 2013 12:10:08 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; ) References: <201304140242.r3E2geSq094403@svn.freebsd.org> In-Reply-To: <201304140242.r3E2geSq094403@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201304161210.09058.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 16 Apr 2013 13:11:32 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 17:11:32 -0000 On Saturday, April 13, 2013 10:42:40 pm Hiren Panchasara wrote: > Author: hiren > Date: Sun Apr 14 02:42:40 2013 > New Revision: 249461 > URL: http://svnweb.freebsd.org/changeset/base/249461 > > Log: > Fixing a clang warning indicating uninitialized variable usage. > > PR: kern/177164 > Approved by: sbruno (mentor) Hmm, I always thought that dmatags and maps were opaque types and not necessarily "known" in consumers to be pointers. (Some drivers do check tehm against NULL implicitly via 'if (map)' or 'if (tag)', but well-behaved drivers use other means (flags, etc.) to know if they are valid.) -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Tue Apr 16 17:11:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6813FD1E; Tue, 16 Apr 2013 17:11:35 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) by mx1.freebsd.org (Postfix) with ESMTP id 458C19C1; Tue, 16 Apr 2013 17:11:35 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 90470B976; Tue, 16 Apr 2013 13:11:34 -0400 (EDT) From: John Baldwin To: Bryan Drewery Subject: Re: svn commit: r249489 - head/etc/rc.d Date: Tue, 16 Apr 2013 12:20:45 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; ) References: <201304142111.r3ELBKRG032133@svn.freebsd.org> In-Reply-To: <201304142111.r3ELBKRG032133@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201304161220.45956.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 16 Apr 2013 13:11:34 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 17:11:35 -0000 On Sunday, April 14, 2013 5:11:20 pm Bryan Drewery wrote: > Author: bdrewery (ports committer) > Date: Sun Apr 14 21:11:19 2013 > New Revision: 249489 > URL: http://svnweb.freebsd.org/changeset/base/249489 > > Log: > Run configtest before restarting so that the system is not > left without a running sshd. > > Approved by: des > MFC after: 1 week > > Modified: > head/etc/rc.d/sshd Maybe do the same for 'reload' as well? -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Tue Apr 16 17:20:52 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 844F8465; Tue, 16 Apr 2013 17:20:52 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7756BA2B; Tue, 16 Apr 2013 17:20:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3GHKqxe035451; Tue, 16 Apr 2013 17:20:52 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3GHKq9m035450; Tue, 16 Apr 2013 17:20:52 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201304161720.r3GHKq9m035450@svn.freebsd.org> From: Robert Watson Date: Tue, 16 Apr 2013 17:20:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249554 - head/lib/libstand X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 17:20:52 -0000 Author: rwatson Date: Tue Apr 16 17:20:52 2013 New Revision: 249554 URL: http://svnweb.freebsd.org/changeset/base/249554 Log: Use a suitable code generation when building libstand for MIPS. Reviewed by: imp Sponsored by: DARPA, AFRL MFC after: 3 days Modified: head/lib/libstand/Makefile Modified: head/lib/libstand/Makefile ============================================================================== --- head/lib/libstand/Makefile Tue Apr 16 17:03:35 2013 (r249553) +++ head/lib/libstand/Makefile Tue Apr 16 17:20:52 2013 (r249554) @@ -36,6 +36,9 @@ CFLAGS+= -m32 -I. .if ${MACHINE_CPUARCH} == "arm" CFLAGS+= -msoft-float -D_STANDALONE .endif +.if ${MACHINE_CPUARCH} == "mips" +CFLAGS+= -G0 -fno-pic -mno-abicalls +.endif # standalone components and stuff we have modified locally SRCS+= gzguts.h zutil.h __main.c assert.c bcd.c bswap.c environment.c getopt.c gets.c \ From owner-svn-src-all@FreeBSD.ORG Tue Apr 16 17:30:13 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E5F1792E; Tue, 16 Apr 2013 17:30:13 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D895DA91; Tue, 16 Apr 2013 17:30:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3GHUDDO036995; Tue, 16 Apr 2013 17:30:13 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3GHUDDt036994; Tue, 16 Apr 2013 17:30:13 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201304161730.r3GHUDDt036994@svn.freebsd.org> From: Bryan Drewery Date: Tue, 16 Apr 2013 17:30:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249555 - head/etc/rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 17:30:14 -0000 Author: bdrewery (ports committer) Date: Tue Apr 16 17:30:13 2013 New Revision: 249555 URL: http://svnweb.freebsd.org/changeset/base/249555 Log: Also call configtest before reload to ensure working config. Approved by: jhb MFC after: 1 week X-MFC-With: r249489 Modified: head/etc/rc.d/sshd Modified: head/etc/rc.d/sshd ============================================================================== --- head/etc/rc.d/sshd Tue Apr 16 17:20:52 2013 (r249554) +++ head/etc/rc.d/sshd Tue Apr 16 17:30:13 2013 (r249555) @@ -14,6 +14,7 @@ rcvar="sshd_enable" command="/usr/sbin/${name}" keygen_cmd="sshd_keygen" start_precmd="sshd_precmd" +reload_precmd="sshd_configtest" restart_precmd="sshd_configtest" configtest_cmd="sshd_configtest" pidfile="/var/run/${name}.pid" From owner-svn-src-all@FreeBSD.ORG Tue Apr 16 17:30:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 260F7AB9 for ; Tue, 16 Apr 2013 17:30:58 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id E7F14AA3 for ; Tue, 16 Apr 2013 17:30:57 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.6/8.14.6) with ESMTP id r3GHUvYr010749 for ; Tue, 16 Apr 2013 17:30:57 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.6/8.14.6/Submit) id r3GHUvDt010743 for svn-src-all@freebsd.org; Tue, 16 Apr 2013 17:30:57 GMT (envelope-from bdrewery) Received: (qmail 70038 invoked from network); 16 Apr 2013 12:30:56 -0500 Received: from unknown (HELO ?192.168.0.74?) (freebsd@shatow.net@74.94.87.209) by sweb.xzibition.com with ESMTPA; 16 Apr 2013 12:30:56 -0500 Message-ID: <516D8ACA.9080700@FreeBSD.org> Date: Tue, 16 Apr 2013 12:30:50 -0500 From: Bryan Drewery Organization: FreeBSD User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130328 Thunderbird/17.0.5 MIME-Version: 1.0 To: John Baldwin Subject: Re: svn commit: r249489 - head/etc/rc.d References: <201304142111.r3ELBKRG032133@svn.freebsd.org> <201304161220.45956.jhb@freebsd.org> In-Reply-To: <201304161220.45956.jhb@freebsd.org> X-Enigmail-Version: 1.5.1 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="----enig2DQMRRLIKRTBIBGCGUJQC" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 17:30:58 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2DQMRRLIKRTBIBGCGUJQC Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 4/16/2013 11:20 AM, John Baldwin wrote: > On Sunday, April 14, 2013 5:11:20 pm Bryan Drewery wrote: >> Author: bdrewery (ports committer) >> Date: Sun Apr 14 21:11:19 2013 >> New Revision: 249489 >> URL: http://svnweb.freebsd.org/changeset/base/249489 >> >> Log: >> Run configtest before restarting so that the system is not >> left without a running sshd. >> =20 >> Approved by: des >> MFC after: 1 week >> >> Modified: >> head/etc/rc.d/sshd >=20 > Maybe do the same for 'reload' as well? >=20 Done. --=20 Regards, Bryan Drewery ------enig2DQMRRLIKRTBIBGCGUJQC 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.9 (MingW32) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBAgAGBQJRbYrTAAoJEG54KsA8mwz5y00P/03qkBe25w6ac9QEs493iNFY a6vRMnkzcUwZpbQ+exWYDyCK+1eKU+J+gcfjrKjpiin5eYDpdJGZYFLf2Nl4EP8x ZB9h5UpWDATrfBErWHUFhOZ3V45JcivKI2gV5e/PmpqDiuecaCcRTqDWCeo7Ixg7 K7vF9kFiapa7P1IOYkupjZWJr3p+iHfEWbnwhf4UOqPk7e4umsxYyoqJoL8ghDYA 4aPrQ63RYHX9FkVn2U/OCLGt1kDSImlClyU8MNKkVj7zkIeY1vp97um5484DuJ1Y 7ydpdfMG78Apda0MUTZnwbZ/fYbStTBo28sZm5BJk+JPz9gB4tXoVeX88u3/5ihj LcJgqI+x6cSrnj/aCn7WYvBmMj4DZFvXaNHDw8fGmYTZnI/p4HB/6FTx22A0Rq4U IrDhqy0cC9R1pb7SLdt0zZdJ6kdkZEy1GZpcYN/G53blEVkF5w82yrMTvELMnLbT TerK2RDxTPRHfQyOB6xT+q/Oyg/7Nix35XH8ADn6BS5hqKexLsyj6BKba9vaSXqC pS5nHWUg4qPk2arJ30phxO+B3dmfEll7SpZJnLjmGS7SRicJOFAUZMiT9FSfu5kj Xicn3BpBITs2vFtT42rTbxRKEM6N461qO7RlqZvy3I1lBRwlJZo6nJbIwlcvtrzq h7V2puMeIvefDnXhldnY =tyZR -----END PGP SIGNATURE----- ------enig2DQMRRLIKRTBIBGCGUJQC-- From owner-svn-src-all@FreeBSD.ORG Tue Apr 16 17:47:13 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D24E93D7; Tue, 16 Apr 2013 17:47:13 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C5210B3A; Tue, 16 Apr 2013 17:47:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3GHlDYN043149; Tue, 16 Apr 2013 17:47:13 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3GHlDI7043148; Tue, 16 Apr 2013 17:47:13 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201304161747.r3GHlDI7043148@svn.freebsd.org> From: Brooks Davis Date: Tue, 16 Apr 2013 17:47:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249556 - head/sys/geom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 17:47:13 -0000 Author: brooks Date: Tue Apr 16 17:47:13 2013 New Revision: 249556 URL: http://svnweb.freebsd.org/changeset/base/249556 Log: Partial MFP4 of 222836: Only look for FDT partitions if our potential parent is a DISK device. Excluding direct recursion on the flashmap geoms was insufficient because it did not prevent the underlying device from being retrieved if flashmap geoms were further partitioned. Reviewed by: imp Sponsored by: DARPA, AFRL Modified: head/sys/geom/geom_flashmap.c Modified: head/sys/geom/geom_flashmap.c ============================================================================== --- head/sys/geom/geom_flashmap.c Tue Apr 16 17:30:13 2013 (r249555) +++ head/sys/geom/geom_flashmap.c Tue Apr 16 17:47:13 2013 (r249556) @@ -174,7 +174,7 @@ g_flashmap_taste(struct g_class *mp, str g_topology_assert(); if (flags == G_TF_NORMAL && - !strcmp(pp->geom->class->name, FLASHMAP_CLASS_NAME)) + strcmp(pp->geom->class->name, G_DISK_CLASS_NAME) != 0) return (NULL); gp = g_slice_new(mp, FLASH_SLICES_MAX_NUM, pp, &cp, NULL, 0, From owner-svn-src-all@FreeBSD.ORG Tue Apr 16 17:50:20 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E6EF47D0; Tue, 16 Apr 2013 17:50:20 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D95ECB69; Tue, 16 Apr 2013 17:50:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3GHoKP4045225; Tue, 16 Apr 2013 17:50:20 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3GHoKTR045224; Tue, 16 Apr 2013 17:50:20 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201304161750.r3GHoKTR045224@svn.freebsd.org> From: Dimitry Andric Date: Tue, 16 Apr 2013 17:50:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r249557 - stable/8/sys/mips/atheros X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 17:50:21 -0000 Author: dim Date: Tue Apr 16 17:50:20 2013 New Revision: 249557 URL: http://svnweb.freebsd.org/changeset/base/249557 Log: MFC r249449: Fix undefined behaviour in several gpio_pin_setflags() routines (under sys/arm and sys/mips), squelching the clang 3.3 warnings about this. Noticed by: tinderbox and many irate spectators Submitted by: Luiz Otavio O Souza PR: kern/177759 Modified: stable/8/sys/mips/atheros/ar71xx_gpio.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/mips/ (props changed) Modified: stable/8/sys/mips/atheros/ar71xx_gpio.c ============================================================================== --- stable/8/sys/mips/atheros/ar71xx_gpio.c Tue Apr 16 17:47:13 2013 (r249556) +++ stable/8/sys/mips/atheros/ar71xx_gpio.c Tue Apr 16 17:50:20 2013 (r249557) @@ -225,8 +225,8 @@ ar71xx_gpio_pin_setflags(device_t dev, u if (i >= sc->gpio_npins) return (EINVAL); - /* Filter out unwanted flags */ - if ((flags &= sc->gpio_pins[i].gp_caps) != flags) + /* Check for unwanted flags. */ + if ((flags & sc->gpio_pins[i].gp_caps) != flags) return (EINVAL); /* Can't mix input/output together */ From owner-svn-src-all@FreeBSD.ORG Tue Apr 16 19:19:15 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7751F1C9; Tue, 16 Apr 2013 19:19:15 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 693E21108; Tue, 16 Apr 2013 19:19:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3GJJFFD072273; Tue, 16 Apr 2013 19:19:15 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3GJJF92072268; Tue, 16 Apr 2013 19:19:15 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201304161919.r3GJJF92072268@svn.freebsd.org> From: Mikolaj Golub Date: Tue, 16 Apr 2013 19:19:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249558 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 19:19:15 -0000 Author: trociny Date: Tue Apr 16 19:19:14 2013 New Revision: 249558 URL: http://svnweb.freebsd.org/changeset/base/249558 Log: Add a new set of notes to a process core dump to store procstat data. The notes format is a header of sizeof(int), which stores the size of the corresponding data structure to provide some versioning, and data in the format as it is returned by a related sysctl call. The userland tools (procstat(1)) will be taught to extract this data, providing additional info for postmortem analysis. PR: kern/173723 Suggested by: jhb Discussed with: jhb, kib Reviewed by: jhb (initial version), kib MFC after: 1 month Modified: head/sys/kern/imgact_elf.c head/sys/sys/elf_common.h Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Tue Apr 16 17:50:20 2013 (r249557) +++ head/sys/kern/imgact_elf.c Tue Apr 16 19:19:14 2013 (r249558) @@ -66,6 +66,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -1062,12 +1063,22 @@ static void __elfN(puthdr)(struct thread static void __elfN(putnote)(struct note_info *, struct sbuf *); static size_t register_note(struct note_info_list *, int, outfunc_t, void *); static int sbuf_drain_core_output(void *, const char *, int); +static int sbuf_drain_count(void *arg, const char *data, int len); static void __elfN(note_fpregset)(void *, struct sbuf *, size_t *); static void __elfN(note_prpsinfo)(void *, struct sbuf *, size_t *); static void __elfN(note_prstatus)(void *, struct sbuf *, size_t *); static void __elfN(note_threadmd)(void *, struct sbuf *, size_t *); static void __elfN(note_thrmisc)(void *, struct sbuf *, size_t *); +static void __elfN(note_procstat_auxv)(void *, struct sbuf *, size_t *); +static void __elfN(note_procstat_proc)(void *, struct sbuf *, size_t *); +static void __elfN(note_procstat_psstrings)(void *, struct sbuf *, size_t *); +static void note_procstat_files(void *, struct sbuf *, size_t *); +static void note_procstat_groups(void *, struct sbuf *, size_t *); +static void note_procstat_osrel(void *, struct sbuf *, size_t *); +static void note_procstat_rlimit(void *, struct sbuf *, size_t *); +static void note_procstat_umask(void *, struct sbuf *, size_t *); +static void note_procstat_vmmap(void *, struct sbuf *, size_t *); #ifdef COMPRESS_USER_CORES extern int compress_user_cores; @@ -1113,9 +1124,21 @@ static int sbuf_drain_core_output(void *arg, const char *data, int len) { struct sbuf_drain_core_params *p; - int error; + int error, locked; p = (struct sbuf_drain_core_params *)arg; + + /* + * Some kern_proc out routines that print to this sbuf may + * call us with the process lock held. Draining with the + * non-sleepable lock held is unsafe. The lock is needed for + * those routines when dumping a live process. In our case we + * can safely release the lock before draining and acquire + * again after. + */ + locked = PROC_LOCKED(p->td->td_proc); + if (locked) + PROC_UNLOCK(p->td->td_proc); #ifdef COMPRESS_USER_CORES if (p->gzfile != Z_NULL) error = compress_core(p->gzfile, NULL, __DECONST(char *, data), @@ -1126,12 +1149,27 @@ sbuf_drain_core_output(void *arg, const __DECONST(void *, data), len, p->offset, UIO_SYSSPACE, IO_UNIT | IO_DIRECT, p->active_cred, p->file_cred, NULL, p->td); + if (locked) + PROC_LOCK(p->td->td_proc); if (error != 0) return (-error); p->offset += len; return (len); } +/* + * Drain into a counter. + */ +static int +sbuf_drain_count(void *arg, const char *data __unused, int len) +{ + size_t *sizep; + + sizep = (size_t *)arg; + *sizep += len; + return (len); +} + int __elfN(coredump)(struct thread *td, struct vnode *vp, off_t limit, int flags) { @@ -1436,6 +1474,25 @@ __elfN(prepare_notes)(struct thread *td, thr = TAILQ_NEXT(thr, td_plist); } + size += register_note(list, NT_PROCSTAT_PROC, + __elfN(note_procstat_proc), p); + size += register_note(list, NT_PROCSTAT_FILES, + note_procstat_files, p); + size += register_note(list, NT_PROCSTAT_VMMAP, + note_procstat_vmmap, p); + size += register_note(list, NT_PROCSTAT_GROUPS, + note_procstat_groups, p); + size += register_note(list, NT_PROCSTAT_UMASK, + note_procstat_umask, p); + size += register_note(list, NT_PROCSTAT_RLIMIT, + note_procstat_rlimit, p); + size += register_note(list, NT_PROCSTAT_OSREL, + note_procstat_osrel, p); + size += register_note(list, NT_PROCSTAT_PSSTRINGS, + __elfN(note_procstat_psstrings), p); + size += register_note(list, NT_PROCSTAT_AUXV, + __elfN(note_procstat_auxv), p); + *sizep = size; } @@ -1562,6 +1619,9 @@ typedef struct fpreg32 elf_prfpregset_t; typedef struct fpreg32 elf_fpregset_t; typedef struct reg32 elf_gregset_t; typedef struct thrmisc32 elf_thrmisc_t; +#define ELF_KERN_PROC_MASK KERN_PROC_MASK32 +typedef struct kinfo_proc32 elf_kinfo_proc_t; +typedef uint32_t elf_ps_strings_t; #else typedef prstatus_t elf_prstatus_t; typedef prpsinfo_t elf_prpsinfo_t; @@ -1569,6 +1629,9 @@ typedef prfpregset_t elf_prfpregset_t; typedef prfpregset_t elf_fpregset_t; typedef gregset_t elf_gregset_t; typedef thrmisc_t elf_thrmisc_t; +#define ELF_KERN_PROC_MASK 0 +typedef struct kinfo_proc elf_kinfo_proc_t; +typedef vm_offset_t elf_ps_strings_t; #endif static void @@ -1686,6 +1749,221 @@ __elfN(note_threadmd)(void *arg, struct *sizep = size; } +#ifdef KINFO_PROC_SIZE +CTASSERT(sizeof(struct kinfo_proc) == KINFO_PROC_SIZE); +#endif + +static void +__elfN(note_procstat_proc)(void *arg, struct sbuf *sb, size_t *sizep) +{ + struct proc *p; + size_t size; + int structsize; + + p = (struct proc *)arg; + size = sizeof(structsize) + p->p_numthreads * + sizeof(elf_kinfo_proc_t); + + if (sb != NULL) { + KASSERT(*sizep == size, ("invalid size")); + structsize = sizeof(elf_kinfo_proc_t); + sbuf_bcat(sb, &structsize, sizeof(structsize)); + PROC_LOCK(p); + kern_proc_out(p, sb, ELF_KERN_PROC_MASK); + } + *sizep = size; +} + +#ifdef KINFO_FILE_SIZE +CTASSERT(sizeof(struct kinfo_file) == KINFO_FILE_SIZE); +#endif + +static void +note_procstat_files(void *arg, struct sbuf *sb, size_t *sizep) +{ + struct proc *p; + size_t size; + int structsize; + + p = (struct proc *)arg; + if (sb == NULL) { + size = 0; + sb = sbuf_new(NULL, NULL, 128, SBUF_FIXEDLEN); + sbuf_set_drain(sb, sbuf_drain_count, &size); + sbuf_bcat(sb, &structsize, sizeof(structsize)); + PROC_LOCK(p); + kern_proc_filedesc_out(p, sb, -1); + sbuf_finish(sb); + sbuf_delete(sb); + *sizep = size; + } else { + structsize = sizeof(struct kinfo_file); + sbuf_bcat(sb, &structsize, sizeof(structsize)); + PROC_LOCK(p); + kern_proc_filedesc_out(p, sb, -1); + } +} + +#ifdef KINFO_VMENTRY_SIZE +CTASSERT(sizeof(struct kinfo_vmentry) == KINFO_VMENTRY_SIZE); +#endif + +static void +note_procstat_vmmap(void *arg, struct sbuf *sb, size_t *sizep) +{ + struct proc *p; + size_t size; + int structsize; + + p = (struct proc *)arg; + if (sb == NULL) { + size = 0; + sb = sbuf_new(NULL, NULL, 128, SBUF_FIXEDLEN); + sbuf_set_drain(sb, sbuf_drain_count, &size); + sbuf_bcat(sb, &structsize, sizeof(structsize)); + PROC_LOCK(p); + kern_proc_vmmap_out(p, sb); + sbuf_finish(sb); + sbuf_delete(sb); + *sizep = size; + } else { + structsize = sizeof(struct kinfo_vmentry); + sbuf_bcat(sb, &structsize, sizeof(structsize)); + PROC_LOCK(p); + kern_proc_vmmap_out(p, sb); + } +} + +static void +note_procstat_groups(void *arg, struct sbuf *sb, size_t *sizep) +{ + struct proc *p; + size_t size; + int structsize; + + p = (struct proc *)arg; + size = sizeof(structsize) + p->p_ucred->cr_ngroups * sizeof(gid_t); + if (sb != NULL) { + KASSERT(*sizep == size, ("invalid size")); + structsize = sizeof(gid_t); + sbuf_bcat(sb, &structsize, sizeof(structsize)); + sbuf_bcat(sb, p->p_ucred->cr_groups, p->p_ucred->cr_ngroups * + sizeof(gid_t)); + } + *sizep = size; +} + +static void +note_procstat_umask(void *arg, struct sbuf *sb, size_t *sizep) +{ + struct proc *p; + size_t size; + int structsize; + + p = (struct proc *)arg; + size = sizeof(structsize) + sizeof(p->p_fd->fd_cmask); + if (sb != NULL) { + KASSERT(*sizep == size, ("invalid size")); + structsize = sizeof(p->p_fd->fd_cmask); + sbuf_bcat(sb, &structsize, sizeof(structsize)); + sbuf_bcat(sb, &p->p_fd->fd_cmask, sizeof(p->p_fd->fd_cmask)); + } + *sizep = size; +} + +static void +note_procstat_rlimit(void *arg, struct sbuf *sb, size_t *sizep) +{ + struct proc *p; + struct rlimit rlim[RLIM_NLIMITS]; + size_t size; + int structsize, i; + + p = (struct proc *)arg; + size = sizeof(structsize) + sizeof(rlim); + if (sb != NULL) { + KASSERT(*sizep == size, ("invalid size")); + structsize = sizeof(rlim); + sbuf_bcat(sb, &structsize, sizeof(structsize)); + PROC_LOCK(p); + for (i = 0; i < RLIM_NLIMITS; i++) + lim_rlimit(p, i, &rlim[i]); + PROC_UNLOCK(p); + sbuf_bcat(sb, rlim, sizeof(rlim)); + } + *sizep = size; +} + +static void +note_procstat_osrel(void *arg, struct sbuf *sb, size_t *sizep) +{ + struct proc *p; + size_t size; + int structsize; + + p = (struct proc *)arg; + size = sizeof(structsize) + sizeof(p->p_osrel); + if (sb != NULL) { + KASSERT(*sizep == size, ("invalid size")); + structsize = sizeof(p->p_osrel); + sbuf_bcat(sb, &structsize, sizeof(structsize)); + sbuf_bcat(sb, &p->p_osrel, sizeof(p->p_osrel)); + } + *sizep = size; +} + +static void +__elfN(note_procstat_psstrings)(void *arg, struct sbuf *sb, size_t *sizep) +{ + struct proc *p; + elf_ps_strings_t ps_strings; + size_t size; + int structsize; + + p = (struct proc *)arg; + size = sizeof(structsize) + sizeof(ps_strings); + if (sb != NULL) { + KASSERT(*sizep == size, ("invalid size")); + structsize = sizeof(ps_strings); +#if defined(COMPAT_FREEBSD32) && __ELF_WORD_SIZE == 32 + ps_strings = PTROUT(p->p_sysent->sv_psstrings); +#else + ps_strings = p->p_sysent->sv_psstrings; +#endif + sbuf_bcat(sb, &structsize, sizeof(structsize)); + sbuf_bcat(sb, &ps_strings, sizeof(ps_strings)); + } + *sizep = size; +} + +static void +__elfN(note_procstat_auxv)(void *arg, struct sbuf *sb, size_t *sizep) +{ + struct proc *p; + size_t size; + int structsize; + + p = (struct proc *)arg; + if (sb == NULL) { + size = 0; + sb = sbuf_new(NULL, NULL, 128, SBUF_FIXEDLEN); + sbuf_set_drain(sb, sbuf_drain_count, &size); + sbuf_bcat(sb, &structsize, sizeof(structsize)); + PHOLD(p); + proc_getauxv(curthread, p, sb); + PRELE(p); + sbuf_finish(sb); + sbuf_delete(sb); + *sizep = size; + } else { + structsize = sizeof(Elf_Auxinfo); + sbuf_bcat(sb, &structsize, sizeof(structsize)); + PHOLD(p); + proc_getauxv(curthread, p, sb); + PRELE(p); + } +} + static boolean_t __elfN(parse_notes)(struct image_params *imgp, Elf_Brandnote *checknote, int32_t *osrel, const Elf_Phdr *pnote) Modified: head/sys/sys/elf_common.h ============================================================================== --- head/sys/sys/elf_common.h Tue Apr 16 17:50:20 2013 (r249557) +++ head/sys/sys/elf_common.h Tue Apr 16 19:19:14 2013 (r249558) @@ -487,6 +487,15 @@ typedef struct { #define NT_FPREGSET 2 /* Floating point registers. */ #define NT_PRPSINFO 3 /* Process state info. */ #define NT_THRMISC 7 /* Thread miscellaneous info. */ +#define NT_PROCSTAT_PROC 8 /* Procstat proc data. */ +#define NT_PROCSTAT_FILES 9 /* Procstat files data. */ +#define NT_PROCSTAT_VMMAP 10 /* Procstat vmmap data. */ +#define NT_PROCSTAT_GROUPS 11 /* Procstat groups data. */ +#define NT_PROCSTAT_UMASK 12 /* Procstat umask data. */ +#define NT_PROCSTAT_RLIMIT 13 /* Procstat rlimit data. */ +#define NT_PROCSTAT_OSREL 14 /* Procstat osreldate data. */ +#define NT_PROCSTAT_PSSTRINGS 15 /* Procstat ps_strings data. */ +#define NT_PROCSTAT_AUXV 16 /* Procstat auxv data. */ /* Symbol Binding - ELFNN_ST_BIND - st_info */ #define STB_LOCAL 0 /* Local symbol */ From owner-svn-src-all@FreeBSD.ORG Tue Apr 16 19:25:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7186976A; Tue, 16 Apr 2013 19:25:42 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 65214119B; Tue, 16 Apr 2013 19:25:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3GJPgUr074788; Tue, 16 Apr 2013 19:25:42 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3GJPgmh074787; Tue, 16 Apr 2013 19:25:42 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201304161925.r3GJPgmh074787@svn.freebsd.org> From: Xin LI Date: Tue, 16 Apr 2013 19:25:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249559 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 19:25:42 -0000 Author: delphij Date: Tue Apr 16 19:25:41 2013 New Revision: 249559 URL: http://svnweb.freebsd.org/changeset/base/249559 Log: Don't leak lock when returning. PR: kern/177888 Submitted by: Sven-Thorsten Dietrich MFC after: 1 week Modified: head/sys/netinet/ip_mroute.c Modified: head/sys/netinet/ip_mroute.c ============================================================================== --- head/sys/netinet/ip_mroute.c Tue Apr 16 19:19:14 2013 (r249558) +++ head/sys/netinet/ip_mroute.c Tue Apr 16 19:25:41 2013 (r249559) @@ -824,6 +824,7 @@ set_api_config(uint32_t *apival) for (i = 0; i < mfchashsize; i++) { if (LIST_FIRST(&V_mfchashtbl[i]) != NULL) { + MFC_UNLOCK(); *apival = 0; return EPERM; } From owner-svn-src-all@FreeBSD.ORG Tue Apr 16 19:27:10 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A2DA5999; Tue, 16 Apr 2013 19:27:10 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 838BF11B9; Tue, 16 Apr 2013 19:27:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3GJRAb7075036; Tue, 16 Apr 2013 19:27:10 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3GJR9Xt075029; Tue, 16 Apr 2013 19:27:09 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201304161927.r3GJR9Xt075029@svn.freebsd.org> From: Brooks Davis Date: Tue, 16 Apr 2013 19:27:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249560 - in stable/9: contrib/libc-vis lib/libc/gen X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 19:27:10 -0000 Author: brooks Date: Tue Apr 16 19:27:09 2013 New Revision: 249560 URL: http://svnweb.freebsd.org/changeset/base/249560 Log: MFC r248302: Update to the latest (un)vis(3) sources from NetBSD. This adds multibyte support[0] and the new functions strenvisx and strsenvisx. Add MLINKS for vis(3) functions add by this and the initial import from NetBSD[1]. PR: bin/166364, bin/175418 Submitted by: "J.R. Oldroyd" [0] stefanf[1] Obtained from: NetBSD Modified: stable/9/contrib/libc-vis/unvis.3 stable/9/contrib/libc-vis/unvis.c stable/9/contrib/libc-vis/vis.3 stable/9/contrib/libc-vis/vis.c stable/9/contrib/libc-vis/vis.h stable/9/lib/libc/gen/Makefile.inc stable/9/lib/libc/gen/Symbol.map Directory Properties: stable/9/contrib/libc-vis/ (props changed) stable/9/lib/libc/ (props changed) Modified: stable/9/contrib/libc-vis/unvis.3 ============================================================================== --- stable/9/contrib/libc-vis/unvis.3 Tue Apr 16 19:25:41 2013 (r249559) +++ stable/9/contrib/libc-vis/unvis.3 Tue Apr 16 19:27:09 2013 (r249560) @@ -1,4 +1,4 @@ -.\" $NetBSD: unvis.3,v 1.23 2011/03/17 14:06:29 wiz Exp $ +.\" $NetBSD: unvis.3,v 1.27 2012/12/15 07:34:36 wiz Exp $ .\" $FreeBSD$ .\" .\" Copyright (c) 1989, 1991, 1993 @@ -126,15 +126,17 @@ The function has several return codes that must be handled properly. They are: .Bl -tag -width UNVIS_VALIDPUSH -.It Li \&0 (zero) +.It Li \&0 No (zero) Another character is necessary; nothing has been recognized yet. .It Dv UNVIS_VALID A valid character has been recognized and is available at the location -pointed to by cp. +pointed to by +.Fa cp . .It Dv UNVIS_VALIDPUSH A valid character has been recognized and is available at the location -pointed to by cp; however, the character currently passed in should -be passed in again. +pointed to by +.Fa cp ; +however, the character currently passed in should be passed in again. .It Dv UNVIS_NOCHAR A valid sequence was detected, but no character was produced. This return code is necessary to indicate a logical break between characters. @@ -150,7 +152,7 @@ one more time with flag set to to extract any remaining character (the character passed in is ignored). .Pp The -.Ar flag +.Fa flag argument is also used to specify the encoding style of the source. If set to .Dv VIS_HTTPSTYLE @@ -161,7 +163,8 @@ will decode URI strings as specified in If set to .Dv VIS_HTTP1866 , .Fn unvis -will decode URI strings as specified in RFC 1866. +will decode entity references and numeric character references +as specified in RFC 1866. If set to .Dv VIS_MIMESTYLE , .Fn unvis @@ -169,7 +172,9 @@ will decode MIME Quoted-Printable string If set to .Dv VIS_NOESCAPE , .Fn unvis -will not decode \e quoted characters. +will not decode +.Ql \e +quoted characters. .Pp The following code fragment illustrates a proper use of .Fn unvis . @@ -204,7 +209,7 @@ The functions and .Fn strnunvisx will return \-1 on error and set -.Va errno +.Va errno to: .Bl -tag -width Er .It Bq Er EINVAL @@ -212,7 +217,7 @@ An invalid escape sequence was detected, .El .Pp In addition the functions -.Fn strnunvis +.Fn strnunvis and .Fn strnunvisx will can also set @@ -244,4 +249,14 @@ and functions appeared in .Nx 6.0 and -.Fx 10.0 . +.Fx 9.2 . +.Sh BUGS +The names +.Dv VIS_HTTP1808 +and +.Dv VIS_HTTP1866 +are wrong. +Percent-encoding was defined in RFC 1738, the original RFC for URL. +RFC 1866 defines HTML 2.0, an application of SGML, from which it +inherits concepts of numeric character references and entity +references. Modified: stable/9/contrib/libc-vis/unvis.c ============================================================================== --- stable/9/contrib/libc-vis/unvis.c Tue Apr 16 19:25:41 2013 (r249559) +++ stable/9/contrib/libc-vis/unvis.c Tue Apr 16 19:27:09 2013 (r249560) @@ -1,4 +1,4 @@ -/* $NetBSD: unvis.c,v 1.40 2012/12/14 21:31:01 christos Exp $ */ +/* $NetBSD: unvis.c,v 1.41 2012/12/15 04:29:53 matt Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)unvis.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: unvis.c,v 1.40 2012/12/14 21:31:01 christos Exp $"); +__RCSID("$NetBSD: unvis.c,v 1.41 2012/12/15 04:29:53 matt Exp $"); #endif #endif /* LIBC_SCCS and not lint */ __FBSDID("$FreeBSD$"); @@ -90,7 +90,7 @@ __weak_alias(strnunvisx,_strnunvisx) * RFC 1866 */ static const struct nv { - const char name[7]; + char name[7]; uint8_t value; } nv[] = { { "AElig", 198 }, /* capital AE diphthong (ligature) */ Modified: stable/9/contrib/libc-vis/vis.3 ============================================================================== --- stable/9/contrib/libc-vis/vis.3 Tue Apr 16 19:25:41 2013 (r249559) +++ stable/9/contrib/libc-vis/vis.3 Tue Apr 16 19:27:09 2013 (r249560) @@ -1,4 +1,4 @@ -.\" $NetBSD: vis.3,v 1.29 2012/12/14 22:55:59 christos Exp $ +.\" $NetBSD: vis.3,v 1.39 2013/02/20 20:05:26 christos Exp $ .\" $FreeBSD$ .\" .\" Copyright (c) 1989, 1991, 1993 @@ -30,7 +30,7 @@ .\" .\" @(#)vis.3 8.1 (Berkeley) 6/9/93 .\" -.Dd December 14, 2012 +.Dd February 19, 2013 .Dt VIS 3 .Os .Sh NAME @@ -40,12 +40,14 @@ .Nm strnvis , .Nm strvisx , .Nm strnvisx , +.Nm strenvisx , .Nm svis , .Nm snvis , .Nm strsvis , .Nm strsnvis , -.Nm strsvisx -.Nm strsnvisx +.Nm strsvisx , +.Nm strsnvisx , +.Nm strsenvisx .Nd visually encode characters .Sh LIBRARY .Lb libc @@ -63,6 +65,8 @@ .Fn strvisx "char *dst" "const char *src" "size_t len" "int flag" .Ft int .Fn strnvisx "char *dst" "size_t dlen" "const char *src" "size_t len" "int flag" +.Ft int +.Fn strenvisx "char *dst" "size_t dlen" "const char *src" "size_t len" "int flag" "int *cerr_ptr" .Ft char * .Fn svis "char *dst" "int c" "int flag" "int nextc" "const char *extra" .Ft char * @@ -75,6 +79,8 @@ .Fn strsvisx "char *dst" "const char *src" "size_t len" "int flag" "const char *extra" .Ft int .Fn strsnvisx "char *dst" "size_t dlen" "const char *src" "size_t len" "int flag" "const char *extra" +.Ft int +.Fn strsenvisx "char *dst" "size_t dlen" "const char *src" "size_t len" "int flag" "const char *extra" "int *cerr_ptr" .Sh DESCRIPTION The .Fn vis @@ -89,11 +95,11 @@ needs no encoding, it is copied in unalt The string is null terminated, and a pointer to the end of the string is returned. The maximum length of any encoding is four -characters (not including the trailing +bytes (not including the trailing .Dv NUL ) ; thus, when encoding a set of characters into a buffer, the size of the buffer should -be four times the number of characters encoded, plus one for the trailing +be four times the number of bytes encoded, plus one for the trailing .Dv NUL . The flag parameter is used for altering the default range of characters considered for encoding and for altering the visual @@ -142,16 +148,17 @@ terminate The size of .Fa dst must be four times the number -of characters encoded from +of bytes encoded from .Fa src (plus one for the .Dv NUL ) . Both -forms return the number of characters in dst (not including -the trailing +forms return the number of characters in +.Fa dst +(not including the trailing .Dv NUL ) . The -.Dq n +.Dq Nm n versions of the functions also take an additional argument .Fa dlen that indicates the length of the @@ -159,7 +166,7 @@ that indicates the length of the buffer. If .Fa dlen -is not large enough to fix the converted string then the +is not large enough to fit the converted string then the .Fn strnvis and .Fn strnvisx @@ -167,6 +174,14 @@ functions return \-1 and set .Va errno to .Dv ENOSPC . +The +.Fn strenvisx +function takes an additional argument, +.Fa cerr_ptr , +that is used to pass in and out a multibyte conversion error flag. +This is useful when processing single characters at a time when +it is possible that the locale may be set to something other +than the locale of the characters in the input data. .Pp The functions .Fn svis , @@ -174,16 +189,18 @@ The functions .Fn strsvis , .Fn strsnvis , .Fn strsvisx , +.Fn strsnvisx , and -.Fn strsnvisx +.Fn strsenvisx correspond to .Fn vis , .Fn nvis , .Fn strvis , .Fn strnvis , .Fn strvisx , +.Fn strnvisx , and -.Fn strnvisx +.Fn strenvisx but have an additional argument .Fa extra , pointing to a @@ -214,14 +231,13 @@ and .Fn strnvisx ) , and the type of representation used. By default, all non-graphic characters, -except space, tab, and newline are encoded. -(See -.Xr isgraph 3 . ) +except space, tab, and newline are encoded (see +.Xr isgraph 3 ) . The following flags alter this: .Bl -tag -width VIS_WHITEX .It Dv VIS_GLOB -Also encode magic characters +Also encode the magic characters .Ql ( * , .Ql \&? , .Ql \&[ @@ -243,11 +259,13 @@ Synonym for \&| .Dv VIS_NL . .It Dv VIS_SAFE -Only encode "unsafe" characters. +Only encode +.Dq unsafe +characters. Unsafe means control characters which may cause common terminals to perform unexpected functions. Currently this form allows space, tab, newline, backspace, bell, and -return - in addition to all graphic characters - unencoded. +return \(em in addition to all graphic characters \(em unencoded. .El .Pp (The above flags have no effect for @@ -287,8 +305,8 @@ Use an to represent meta characters (characters with the 8th bit set), and use caret .Ql ^ -to represent control characters see -.Pf ( Xr iscntrl 3 ) . +to represent control characters (see +.Xr iscntrl 3 ) . The following formats are used: .Bl -tag -width xxxxx .It Dv \e^C @@ -335,19 +353,20 @@ Use C-style backslash sequences to repre characters. The following sequences are used to represent the indicated characters: .Bd -unfilled -offset indent -.Li \ea Tn - BEL No (007) -.Li \eb Tn - BS No (010) -.Li \ef Tn - NP No (014) -.Li \en Tn - NL No (012) -.Li \er Tn - CR No (015) -.Li \es Tn - SP No (040) -.Li \et Tn - HT No (011) -.Li \ev Tn - VT No (013) -.Li \e0 Tn - NUL No (000) +.Li \ea Tn \(em BEL No (007) +.Li \eb Tn \(em BS No (010) +.Li \ef Tn \(em NP No (014) +.Li \en Tn \(em NL No (012) +.Li \er Tn \(em CR No (015) +.Li \es Tn \(em SP No (040) +.Li \et Tn \(em HT No (011) +.Li \ev Tn \(em VT No (013) +.Li \e0 Tn \(em NUL No (000) .Ed .Pp -When using this format, the nextc parameter is looked at to determine -if a +When using this format, the +.Fa nextc +parameter is looked at to determine if a .Dv NUL character can be encoded as .Ql \e0 @@ -374,8 +393,8 @@ represents a lower case hexadecimal digi .It Dv VIS_MIMESTYLE Use MIME Quoted-Printable encoding as described in RFC 2045, only don't break lines and don't handle CRLF. -The form is: -.Ql %XX +The form is +.Ql =XX where .Em X represents an upper case hexadecimal digit. @@ -392,6 +411,41 @@ meta characters as .Ql M-C ) . With this flag set, the encoding is ambiguous and non-invertible. +.Sh MULTIBYTE CHARACTER SUPPORT +These functions support multibyte character input. +The encoding conversion is influenced by the setting of the +.Ev LC_CTYPE +environment variable which defines the set of characters +that can be copied without encoding. +.Pp +When 8-bit data is present in the input, +.Ev LC_CTYPE +must be set to the correct locale or to the C locale. +If the locales of the data and the conversion are mismatched, +multibyte character recognition may fail and encoding will be performed +byte-by-byte instead. +.Pp +As noted above, +.Fa dst +must be four times the number of bytes processed from +.Fa src . +But note that each multibyte character can be up to +.Dv MB_LEN_MAX +bytes +.\" (see +.\" .Xr multibyte 3 ) +so in terms of multibyte characters, +.Fa dst +must be four times +.Dv MB_LEN_MAX +times the number of characters processed from +.Fa src . +.Sh ENVIRONMENT +.Bl -tag -width ".Ev LC_CTYPE" +.It Ev LC_CTYPE +Specify the locale of the input data. +Set to C if the input data locale is unknown. +.El .Sh ERRORS The functions .Fn nvis @@ -407,11 +461,11 @@ and .Fn strsnvisx , will return \-1 when the .Fa dlen -destination buffer length size is not enough to perform the conversion while +destination buffer size is not enough to perform the conversion while setting .Va errno to: -.Bl -tag -width Er +.Bl -tag -width ".Bq Er ENOSPC" .It Bq Er ENOSPC The destination buffer size is not large enough to perform the conversion. .El @@ -419,18 +473,23 @@ The destination buffer size is not large .Xr unvis 1 , .Xr vis 1 , .Xr glob 3 , +.\" .Xr multibyte 3 , .Xr unvis 3 .Rs .%A T. Berners-Lee .%T Uniform Resource Locators (URL) -.%O RFC1738 +.%O "RFC 1738" +.Re +.Rs +.%T "Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies" +.%O "RFC 2045" .Re .Sh HISTORY The .Fn vis , .Fn strvis , and -.Fa strvisx +.Fn strvisx functions first appeared in .Bx 4.4 . The @@ -441,7 +500,7 @@ and functions appeared in .Nx 1.5 and -.Fx 10.0 . +.Fx 9.2 . The buffer size limited versions of the functions .Po Fn nvis , .Fn strnvis , @@ -451,6 +510,9 @@ The buffer size limited versions of the and .Fn strsnvisx Pc appeared in -.Nx 6.0 and -.Fx 10.0 . +.Fx 9.2 . +Myltibyte character support was added in +.Nx 7.0 +and +.Fx 9.2 . Modified: stable/9/contrib/libc-vis/vis.c ============================================================================== --- stable/9/contrib/libc-vis/vis.c Tue Apr 16 19:25:41 2013 (r249559) +++ stable/9/contrib/libc-vis/vis.c Tue Apr 16 19:27:09 2013 (r249560) @@ -1,4 +1,4 @@ -/* $NetBSD: vis.c,v 1.45 2012/12/14 21:38:18 christos Exp $ */ +/* $NetBSD: vis.c,v 1.60 2013/02/21 16:21:20 joerg Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -57,19 +57,23 @@ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: vis.c,v 1.45 2012/12/14 21:38:18 christos Exp $"); +__RCSID("$NetBSD: vis.c,v 1.60 2013/02/21 16:21:20 joerg Exp $"); #endif /* LIBC_SCCS and not lint */ +#ifdef __FBSDID __FBSDID("$FreeBSD$"); +#define _DIAGASSERT(x) assert(x) +#endif #include "namespace.h" #include +#include #include #include #include #include - -#define _DIAGASSERT(x) assert(x) +#include +#include #ifdef __weak_alias __weak_alias(strvisx,_strvisx) @@ -81,65 +85,66 @@ __weak_alias(strvisx,_strvisx) #include #include -static char *do_svis(char *, size_t *, int, int, int, const char *); +/* + * The reason for going through the trouble to deal with character encodings + * in vis(3), is that we use this to safe encode output of commands. This + * safe encoding varies depending on the character set. For example if we + * display ps output in French, we don't want to display French characters + * as M-foo. + */ + +static wchar_t *do_svis(wchar_t *, wint_t, int, wint_t, const wchar_t *); #undef BELL -#define BELL '\a' +#define BELL L'\a' + +#define iswoctal(c) (((u_char)(c)) >= L'0' && ((u_char)(c)) <= L'7') +#define iswwhite(c) (c == L' ' || c == L'\t' || c == L'\n') +#define iswsafe(c) (c == L'\b' || c == BELL || c == L'\r') +#define xtoa(c) L"0123456789abcdef"[c] +#define XTOA(c) L"0123456789ABCDEF"[c] -#define isoctal(c) (((u_char)(c)) >= '0' && ((u_char)(c)) <= '7') -#define iswhite(c) (c == ' ' || c == '\t' || c == '\n') -#define issafe(c) (c == '\b' || c == BELL || c == '\r') -#define xtoa(c) "0123456789abcdef"[c] -#define XTOA(c) "0123456789ABCDEF"[c] - -#define MAXEXTRAS 9 - -#define MAKEEXTRALIST(flag, extra, orig_str) \ -do { \ - const char *orig = orig_str; \ - const char *o = orig; \ - char *e; \ - while (*o++) \ - continue; \ - extra = malloc((size_t)((o - orig) + MAXEXTRAS)); \ - if (!extra) break; \ - for (o = orig, e = extra; (*e++ = *o++) != '\0';) \ - continue; \ - e--; \ - if (flag & VIS_GLOB) { \ - *e++ = '*'; \ - *e++ = '?'; \ - *e++ = '['; \ - *e++ = '#'; \ - } \ - if (flag & VIS_SP) *e++ = ' '; \ - if (flag & VIS_TAB) *e++ = '\t'; \ - if (flag & VIS_NL) *e++ = '\n'; \ - if ((flag & VIS_NOSLASH) == 0) *e++ = '\\'; \ - *e = '\0'; \ -} while (/*CONSTCOND*/0) +#define MAXEXTRAS 10 + +#if !HAVE_NBTOOL_CONFIG_H +#ifndef __NetBSD__ +/* + * On NetBSD MB_LEN_MAX is currently 32 which does not fit on any integer + * integral type and it is probably wrong, since currently the maximum + * number of bytes and character needs is 6. Until this is fixed, the + * loops below are using sizeof(uint64_t) - 1 instead of MB_LEN_MAX, and + * the assertion is commented out. + */ +#ifdef __FreeBSD__ +/* + * On FreeBSD including for CTASSERT only works in kernel + * mode. + */ +#ifndef CTASSERT +#define CTASSERT(x) _CTASSERT(x, __LINE__) +#define _CTASSERT(x, y) __CTASSERT(x, y) +#define __CTASSERT(x, y) typedef char __assert ## y[(x) ? 1 : -1] +#endif +#endif /* __FreeBSD__ */ +CTASSERT(MB_LEN_MAX <= sizeof(uint64_t)); +#endif /* !__NetBSD__ */ +#endif /* * This is do_hvis, for HTTP style (RFC 1808) */ -static char * -do_hvis(char *dst, size_t *dlen, int c, int flag, int nextc, const char *extra) +static wchar_t * +do_hvis(wchar_t *dst, wint_t c, int flags, wint_t nextc, const wchar_t *extra) { - - if ((isascii(c) && isalnum(c)) + if (iswalnum(c) /* safe */ - || c == '$' || c == '-' || c == '_' || c == '.' || c == '+' + || c == L'$' || c == L'-' || c == L'_' || c == L'.' || c == L'+' /* extra */ - || c == '!' || c == '*' || c == '\'' || c == '(' || c == ')' - || c == ',') { - dst = do_svis(dst, dlen, c, flag, nextc, extra); - } else { - if (dlen) { - if (*dlen < 3) - return NULL; - *dlen -= 3; - } - *dst++ = '%'; + || c == L'!' || c == L'*' || c == L'\'' || c == L'(' || c == L')' + || c == L',') + dst = do_svis(dst, c, flags, nextc, extra); + else { + *dst++ = L'%'; *dst++ = xtoa(((unsigned int)c >> 4) & 0xf); *dst++ = xtoa((unsigned int)c & 0xf); } @@ -151,312 +156,448 @@ do_hvis(char *dst, size_t *dlen, int c, * This is do_mvis, for Quoted-Printable MIME (RFC 2045) * NB: No handling of long lines or CRLF. */ -static char * -do_mvis(char *dst, size_t *dlen, int c, int flag, int nextc, const char *extra) +static wchar_t * +do_mvis(wchar_t *dst, wint_t c, int flags, wint_t nextc, const wchar_t *extra) { - if ((c != '\n') && + if ((c != L'\n') && /* Space at the end of the line */ - ((isspace(c) && (nextc == '\r' || nextc == '\n')) || + ((iswspace(c) && (nextc == L'\r' || nextc == L'\n')) || /* Out of range */ - (!isspace(c) && (c < 33 || (c > 60 && c < 62) || c > 126)) || - /* Specific char to be escaped */ - strchr("#$@[\\]^`{|}~", c) != NULL)) { - if (dlen) { - if (*dlen < 3) - return NULL; - *dlen -= 3; - } - *dst++ = '='; + (!iswspace(c) && (c < 33 || (c > 60 && c < 62) || c > 126)) || + /* Specific char to be escaped */ + wcschr(L"#$@[\\]^`{|}~", c) != NULL)) { + *dst++ = L'='; *dst++ = XTOA(((unsigned int)c >> 4) & 0xf); *dst++ = XTOA((unsigned int)c & 0xf); - } else { - dst = do_svis(dst, dlen, c, flag, nextc, extra); - } + } else + dst = do_svis(dst, c, flags, nextc, extra); return dst; } /* - * This is do_vis, the central code of vis. - * dst: Pointer to the destination buffer - * c: Character to encode - * flag: Flag word - * nextc: The character following 'c' - * extra: Pointer to the list of extra characters to be - * backslash-protected. + * Output single byte of multibyte character. */ -static char * -do_svis(char *dst, size_t *dlen, int c, int flag, int nextc, const char *extra) +static wchar_t * +do_mbyte(wchar_t *dst, wint_t c, int flags, wint_t nextc, int iswextra) { - int isextra; - size_t odlen = dlen ? *dlen : 0; - - isextra = strchr(extra, c) != NULL; -#define HAVE(x) \ - do { \ - if (dlen) { \ - if (*dlen < (x)) \ - goto out; \ - *dlen -= (x); \ - } \ - } while (/*CONSTCOND*/0) - if (!isextra && isascii(c) && (isgraph(c) || iswhite(c) || - ((flag & VIS_SAFE) && issafe(c)))) { - HAVE(1); - *dst++ = c; - return dst; - } - if (flag & VIS_CSTYLE) { - HAVE(2); + if (flags & VIS_CSTYLE) { switch (c) { - case '\n': - *dst++ = '\\'; *dst++ = 'n'; + case L'\n': + *dst++ = L'\\'; *dst++ = L'n'; return dst; - case '\r': - *dst++ = '\\'; *dst++ = 'r'; + case L'\r': + *dst++ = L'\\'; *dst++ = L'r'; return dst; - case '\b': - *dst++ = '\\'; *dst++ = 'b'; + case L'\b': + *dst++ = L'\\'; *dst++ = L'b'; return dst; case BELL: - *dst++ = '\\'; *dst++ = 'a'; + *dst++ = L'\\'; *dst++ = L'a'; return dst; - case '\v': - *dst++ = '\\'; *dst++ = 'v'; + case L'\v': + *dst++ = L'\\'; *dst++ = L'v'; return dst; - case '\t': - *dst++ = '\\'; *dst++ = 't'; + case L'\t': + *dst++ = L'\\'; *dst++ = L't'; return dst; - case '\f': - *dst++ = '\\'; *dst++ = 'f'; + case L'\f': + *dst++ = L'\\'; *dst++ = L'f'; return dst; - case ' ': - *dst++ = '\\'; *dst++ = 's'; + case L' ': + *dst++ = L'\\'; *dst++ = L's'; return dst; - case '\0': - *dst++ = '\\'; *dst++ = '0'; - if (isoctal(nextc)) { - HAVE(2); - *dst++ = '0'; - *dst++ = '0'; + case L'\0': + *dst++ = L'\\'; *dst++ = L'0'; + if (iswoctal(nextc)) { + *dst++ = L'0'; + *dst++ = L'0'; } return dst; default: - if (isgraph(c)) { - *dst++ = '\\'; *dst++ = c; + if (iswgraph(c)) { + *dst++ = L'\\'; + *dst++ = c; return dst; } - if (dlen) - *dlen = odlen; } } - if (isextra || ((c & 0177) == ' ') || (flag & VIS_OCTAL)) { - HAVE(4); - *dst++ = '\\'; - *dst++ = (u_char)(((u_int32_t)(u_char)c >> 6) & 03) + '0'; - *dst++ = (u_char)(((u_int32_t)(u_char)c >> 3) & 07) + '0'; - *dst++ = (c & 07) + '0'; + if (iswextra || ((c & 0177) == L' ') || (flags & VIS_OCTAL)) { + *dst++ = L'\\'; + *dst++ = (u_char)(((u_int32_t)(u_char)c >> 6) & 03) + L'0'; + *dst++ = (u_char)(((u_int32_t)(u_char)c >> 3) & 07) + L'0'; + *dst++ = (c & 07) + L'0'; } else { - if ((flag & VIS_NOSLASH) == 0) { - HAVE(1); - *dst++ = '\\'; - } + if ((flags & VIS_NOSLASH) == 0) + *dst++ = L'\\'; if (c & 0200) { - HAVE(1); - c &= 0177; *dst++ = 'M'; + c &= 0177; + *dst++ = L'M'; } - if (iscntrl(c)) { - HAVE(2); - *dst++ = '^'; + if (iswcntrl(c)) { + *dst++ = L'^'; if (c == 0177) - *dst++ = '?'; + *dst++ = L'?'; else - *dst++ = c + '@'; + *dst++ = c + L'@'; } else { - HAVE(2); - *dst++ = '-'; *dst++ = c; + *dst++ = L'-'; + *dst++ = c; } } + + return dst; +} + +/* + * This is do_vis, the central code of vis. + * dst: Pointer to the destination buffer + * c: Character to encode + * flags: Flags word + * nextc: The character following 'c' + * extra: Pointer to the list of extra characters to be + * backslash-protected. + */ +static wchar_t * +do_svis(wchar_t *dst, wint_t c, int flags, wint_t nextc, const wchar_t *extra) +{ + int iswextra, i, shft; + uint64_t bmsk, wmsk; + + iswextra = wcschr(extra, c) != NULL; + if (!iswextra && (iswgraph(c) || iswwhite(c) || + ((flags & VIS_SAFE) && iswsafe(c)))) { + *dst++ = c; + return dst; + } + + /* See comment in istrsenvisx() output loop, below. */ + wmsk = 0; + for (i = sizeof(wmsk) - 1; i >= 0; i--) { + shft = i * NBBY; + bmsk = (uint64_t)0xffLL << shft; + wmsk |= bmsk; + if ((c & wmsk) || i == 0) + dst = do_mbyte(dst, (wint_t)( + (uint64_t)(c & bmsk) >> shft), + flags, nextc, iswextra); + } + return dst; -out: - *dlen = odlen; - return NULL; } -typedef char *(*visfun_t)(char *, size_t *, int, int, int, const char *); +typedef wchar_t *(*visfun_t)(wchar_t *, wint_t, int, wint_t, const wchar_t *); /* * Return the appropriate encoding function depending on the flags given. */ static visfun_t -getvisfun(int flag) +getvisfun(int flags) { - if (flag & VIS_HTTPSTYLE) + if (flags & VIS_HTTPSTYLE) return do_hvis; - if (flag & VIS_MIMESTYLE) + if (flags & VIS_MIMESTYLE) return do_mvis; return do_svis; } /* - * isnvis - visually encode characters, also encoding the characters - * pointed to by `extra' + * Expand list of extra characters to not visually encode. */ -static char * -isnvis(char *dst, size_t *dlen, int c, int flag, int nextc, const char *extra) +static wchar_t * +makeextralist(int flags, const char *src) { - char *nextra = NULL; - visfun_t f; + wchar_t *dst, *d; + size_t len; - _DIAGASSERT(dst != NULL); - _DIAGASSERT(extra != NULL); - MAKEEXTRALIST(flag, nextra, extra); - if (!nextra) { - if (dlen && *dlen == 0) { - errno = ENOSPC; - return NULL; - } - *dst = '\0'; /* can't create nextra, return "" */ - return dst; - } - f = getvisfun(flag); - dst = (*f)(dst, dlen, c, flag, nextc, nextra); - free(nextra); - if (dst == NULL || (dlen && *dlen == 0)) { - errno = ENOSPC; + len = strlen(src); + if ((dst = calloc(len + MAXEXTRAS, sizeof(*dst))) == NULL) return NULL; - } - *dst = '\0'; - return dst; -} -char * -svis(char *dst, int c, int flag, int nextc, const char *extra) -{ - return isnvis(dst, NULL, c, flag, nextc, extra); -} + if (mbstowcs(dst, src, len) == (size_t)-1) { + size_t i; + for (i = 0; i < len; i++) + dst[i] = (wint_t)(u_char)src[i]; + d = dst + len; + } else + d = dst + wcslen(dst); + + if (flags & VIS_GLOB) { + *d++ = L'*'; + *d++ = L'?'; + *d++ = L'['; + *d++ = L'#'; + } + + if (flags & VIS_SP) *d++ = L' '; + if (flags & VIS_TAB) *d++ = L'\t'; + if (flags & VIS_NL) *d++ = L'\n'; + if ((flags & VIS_NOSLASH) == 0) *d++ = L'\\'; + *d = L'\0'; -char * -snvis(char *dst, size_t dlen, int c, int flag, int nextc, const char *extra) -{ - return isnvis(dst, &dlen, c, flag, nextc, extra); + return dst; } - /* - * strsvis, strsvisx - visually encode characters from src into dst - * - * Extra is a pointer to a \0-terminated list of characters to - * be encoded, too. These functions are useful e. g. to - * encode strings in such a way so that they are not interpreted - * by a shell. - * - * Dst must be 4 times the size of src to account for possible - * expansion. The length of dst, not including the trailing NULL, - * is returned. - * - * Strsvisx encodes exactly len bytes from src into dst. - * This is useful for encoding a block of data. + * istrsenvisx() + * The main internal function. + * All user-visible functions call this one. */ static int -istrsnvis(char *dst, size_t *dlen, const char *csrc, int flag, const char *extra) +istrsenvisx(char *mbdst, size_t *dlen, const char *mbsrc, size_t mblength, + int flags, const char *mbextra, int *cerr_ptr) { - int c; - char *start; - char *nextra = NULL; - const unsigned char *src = (const unsigned char *)csrc; + wchar_t *dst, *src, *pdst, *psrc, *start, *extra; + size_t len, olen; + uint64_t bmsk, wmsk; + wint_t c; visfun_t f; + int clen = 0, cerr = 0, error = -1, i, shft; + ssize_t mbslength, maxolen; - _DIAGASSERT(dst != NULL); - _DIAGASSERT(src != NULL); - _DIAGASSERT(extra != NULL); - MAKEEXTRALIST(flag, nextra, extra); - if (!nextra) { - *dst = '\0'; /* can't create nextra, return "" */ - return 0; + _DIAGASSERT(mbdst != NULL); + _DIAGASSERT(mbsrc != NULL); + _DIAGASSERT(mbextra != NULL); + + /* + * Input (mbsrc) is a char string considered to be multibyte + * characters. The input loop will read this string pulling + * one character, possibly multiple bytes, from mbsrc and + * converting each to wchar_t in src. + * + * The vis conversion will be done using the wide char + * wchar_t string. + * + * This will then be converted back to a multibyte string to + * return to the caller. + */ + + /* Allocate space for the wide char strings */ + psrc = pdst = extra = NULL; + if (!mblength) + mblength = strlen(mbsrc); + if ((psrc = calloc(mblength + 1, sizeof(*psrc))) == NULL) + return -1; + if ((pdst = calloc((4 * mblength) + 1, sizeof(*pdst))) == NULL) + goto out; + dst = pdst; + src = psrc; + + /* Use caller's multibyte conversion error flag. */ + if (cerr_ptr) + cerr = *cerr_ptr; + + /* + * Input loop. + * Handle up to mblength characters (not bytes). We do not + * stop at NULs because we may be processing a block of data + * that includes NULs. + */ + mbslength = (ssize_t)mblength; + /* + * When inputing a single character, must also read in the + * next character for nextc, the look-ahead character. + */ + if (mbslength == 1) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Apr 16 19:28:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 62805B3E; Tue, 16 Apr 2013 19:28:01 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 54C2C11CC; Tue, 16 Apr 2013 19:28:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3GJS1Xm075190; Tue, 16 Apr 2013 19:28:01 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3GJS1db075181; Tue, 16 Apr 2013 19:28:01 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201304161928.r3GJS1db075181@svn.freebsd.org> From: Brooks Davis Date: Tue, 16 Apr 2013 19:28:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249561 - in stable/9/usr.bin: unvis vis X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 19:28:01 -0000 Author: brooks Date: Tue Apr 16 19:28:00 2013 New Revision: 249561 URL: http://svnweb.freebsd.org/changeset/base/249561 Log: MFC r248303: Replace our (un)vis(1) commands with implementations from NetBSD to match our import of the (un)vis(3) APIs. This adds support for multibyte encoding and the -h and -m flags which support HTTP and MIME encoding respectively. PR: bin/175418 Obtained from: NetBSD Added: - copied from r249557, head/contrib/unvis/ - copied from r249557, head/contrib/vis/ Directory Properties: stable/9/contrib/unvis/ (props changed) stable/9/contrib/vis/ (props changed) Deleted: stable/9/usr.bin/unvis/unvis.1 stable/9/usr.bin/unvis/unvis.c stable/9/usr.bin/vis/extern.h stable/9/usr.bin/vis/foldit.c stable/9/usr.bin/vis/vis.1 stable/9/usr.bin/vis/vis.c Modified: stable/9/usr.bin/unvis/Makefile stable/9/usr.bin/vis/Makefile Directory Properties: stable/9/usr.bin/unvis/ (props changed) stable/9/usr.bin/vis/ (props changed) Modified: stable/9/usr.bin/unvis/Makefile ============================================================================== --- stable/9/usr.bin/unvis/Makefile Tue Apr 16 19:27:09 2013 (r249560) +++ stable/9/usr.bin/unvis/Makefile Tue Apr 16 19:28:00 2013 (r249561) @@ -3,4 +3,6 @@ PROG= unvis +.PATH: ${.CURDIR}/../../contrib/unvis + .include Modified: stable/9/usr.bin/vis/Makefile ============================================================================== --- stable/9/usr.bin/vis/Makefile Tue Apr 16 19:27:09 2013 (r249560) +++ stable/9/usr.bin/vis/Makefile Tue Apr 16 19:28:00 2013 (r249561) @@ -1,6 +1,10 @@ # @(#)Makefile 8.1 (Berkeley) 6/6/93 +# $FreeBSD$ PROG= vis SRCS= vis.c foldit.c +.PATH: ${.CURDIR}/../../contrib/vis +CFLAGS+= -I${.CURDIR}/../../contrib/vis + .include From owner-svn-src-all@FreeBSD.ORG Tue Apr 16 19:32:13 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 71138D1F; Tue, 16 Apr 2013 19:32:13 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6201C1205; Tue, 16 Apr 2013 19:32:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3GJWDqD077441; Tue, 16 Apr 2013 19:32:13 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3GJWDEr077440; Tue, 16 Apr 2013 19:32:13 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201304161932.r3GJWDEr077440@svn.freebsd.org> From: Xin LI Date: Tue, 16 Apr 2013 19:32:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249562 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 19:32:13 -0000 Author: delphij Date: Tue Apr 16 19:32:12 2013 New Revision: 249562 URL: http://svnweb.freebsd.org/changeset/base/249562 Log: Fix incomplete printf. PR: kern/177889 Submitted by: Sven-Thorsten Dietrich MFC after: 1 week Modified: head/sys/netinet/ip_mroute.c Modified: head/sys/netinet/ip_mroute.c ============================================================================== --- head/sys/netinet/ip_mroute.c Tue Apr 16 19:28:00 2013 (r249561) +++ head/sys/netinet/ip_mroute.c Tue Apr 16 19:32:12 2013 (r249562) @@ -2846,7 +2846,8 @@ ip_mroute_modevent(module_t mod, int typ if_detach_event_tag = EVENTHANDLER_REGISTER(ifnet_departure_event, if_detached_event, NULL, EVENTHANDLER_PRI_ANY); if (if_detach_event_tag == NULL) { - printf("ip_mroute: unable to ifnet_deperture_even handler\n"); + printf("ip_mroute: unable to register " + "ifnet_departure_event handler\n"); MROUTER_LOCK_DESTROY(); return (EINVAL); } From owner-svn-src-all@FreeBSD.ORG Tue Apr 16 19:39:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 840DC392; Tue, 16 Apr 2013 19:39:28 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 668351290; Tue, 16 Apr 2013 19:39:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3GJdSaP078550; Tue, 16 Apr 2013 19:39:28 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3GJdRdA078548; Tue, 16 Apr 2013 19:39:27 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201304161939.r3GJdRdA078548@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Tue, 16 Apr 2013 19:39:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249563 - in head/cddl/contrib/opensolaris: cmd/dtrace/test/tst/common/print lib/libdtrace/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 19:39:28 -0000 Author: pfg Date: Tue Apr 16 19:39:27 2013 New Revision: 249563 URL: http://svnweb.freebsd.org/changeset/base/249563 Log: DTrace: print() should try to resolve function pointers Merge changes from illumos: 3675 DTrace print() should try to resolve function pointers 3676 dt_print_enum hardcodes a value of zero Illumos Revision: b1fa6326238973aeaf12c34fcda75985b6c06be1 Reference: https://www.illumos.org/issues/3675 https://www.illumos.org/issues/3676 Obtained from: Illumos MFC after: 1 month Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.enum.d - copied unchanged from r249443, vendor/illumos/dist/cmd/dtrace/test/tst/common/print/tst.enum.d head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.enum.d.out - copied unchanged from r249443, vendor/illumos/dist/cmd/dtrace/test/tst/common/print/tst.enum.d.out Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_print.c Copied: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.enum.d (from r249443, vendor/illumos/dist/cmd/dtrace/test/tst/common/print/tst.enum.d) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.enum.d Tue Apr 16 19:39:27 2013 (r249563, copy of r249443, vendor/illumos/dist/cmd/dtrace/test/tst/common/print/tst.enum.d) @@ -0,0 +1,33 @@ +/* + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + */ +/* + * Copyright (c) 2013, Joyent, Inc. All rights reserved. + */ + +#pragma D option quiet + +enum simpson { + homer, + marge, + bart, + lisa, + maggie, + snowball_ii, + santas_little_helper +}; + +BEGIN +{ + print(bart); + print((enum simpson)4); + print(snowball_ii); + exit(0); +} Copied: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.enum.d.out (from r249443, vendor/illumos/dist/cmd/dtrace/test/tst/common/print/tst.enum.d.out) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.enum.d.out Tue Apr 16 19:39:27 2013 (r249563, copy of r249443, vendor/illumos/dist/cmd/dtrace/test/tst/common/print/tst.enum.d.out) @@ -0,0 +1,4 @@ +enum simpson bart +enum simpson maggie +enum simpson snowball_ii + Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_print.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_print.c Tue Apr 16 19:32:12 2013 (r249562) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_print.c Tue Apr 16 19:39:27 2013 (r249563) @@ -25,6 +25,9 @@ /* * Copyright (c) 2011 by Delphix. All rights reserved. */ +/* + * Copyright (c) 2013, Joyent, Inc. All rights reserved. + */ /* * DTrace print() action @@ -93,6 +96,7 @@ * Print structure passed down recursively through printing algorithm. */ typedef struct dt_printarg { + dtrace_hdl_t *pa_dtp; /* libdtrace handle */ caddr_t pa_addr; /* base address of trace data */ ctf_file_t *pa_ctfp; /* CTF container */ int pa_depth; /* member depth */ @@ -303,8 +307,8 @@ dt_print_float(ctf_id_t base, ulong_t of } /* - * A pointer is printed as a fixed-size integer. This is used both for - * pointers and functions. + * A pointer is generally printed as a fixed-size integer. If we have a + * function pointer, we try to look up its name. */ static void dt_print_ptr(ctf_id_t base, ulong_t off, dt_printarg_t *pap) @@ -313,8 +317,23 @@ dt_print_ptr(ctf_id_t base, ulong_t off, ctf_file_t *ctfp = pap->pa_ctfp; caddr_t addr = pap->pa_addr + off / NBBY; size_t size = ctf_type_size(ctfp, base); - - dt_print_hex(fp, addr, size); + ctf_id_t bid = ctf_type_reference(ctfp, base); + uint64_t pc; + dtrace_syminfo_t dts; + GElf_Sym sym; + + if (bid == CTF_ERR || ctf_type_kind(ctfp, bid) != CTF_K_FUNCTION) { + dt_print_hex(fp, addr, size); + } else { + /* LINTED - alignment */ + pc = *((uint64_t *)addr); + if (dtrace_lookup_by_addr(pap->pa_dtp, pc, &sym, &dts) != 0) { + dt_print_hex(fp, addr, size); + } else { + (void) fprintf(fp, "%s`%s", dts.dts_object, + dts.dts_name); + } + } } /* @@ -459,8 +478,31 @@ dt_print_enum(ctf_id_t base, ulong_t off FILE *fp = pap->pa_file; ctf_file_t *ctfp = pap->pa_ctfp; const char *ename; + ssize_t size; + caddr_t addr = pap->pa_addr + off / NBBY; int value = 0; + /* + * The C standard says that an enum will be at most the sizeof (int). + * But if all the values are less than that, the compiler can use a + * smaller size. Thanks standards. + */ + size = ctf_type_size(ctfp, base); + switch (size) { + case sizeof (uint8_t): + value = *(uint8_t *)addr; + break; + case sizeof (uint16_t): + value = *(uint16_t *)addr; + break; + case sizeof (int32_t): + value = *(int32_t *)addr; + break; + default: + (void) fprintf(fp, "", (uint_t)size); + return; + } + if ((ename = ctf_enum_name(ctfp, base, value)) != NULL) (void) fprintf(fp, "%s", ename); else @@ -635,6 +677,7 @@ dtrace_print(dtrace_hdl_t *dtp, FILE *fp } /* setup the print structure and kick off the main print routine */ + pa.pa_dtp = dtp; pa.pa_addr = addr; pa.pa_ctfp = dt_module_getctf(dtp, dmp); pa.pa_nest = 0; From owner-svn-src-all@FreeBSD.ORG Tue Apr 16 19:58:24 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E6E18C8; Tue, 16 Apr 2013 19:58:24 +0000 (UTC) (envelope-from ivoras@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BFCBC1397; Tue, 16 Apr 2013 19:58:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3GJwOYF084816; Tue, 16 Apr 2013 19:58:24 GMT (envelope-from ivoras@svn.freebsd.org) Received: (from ivoras@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3GJwO2h084815; Tue, 16 Apr 2013 19:58:24 GMT (envelope-from ivoras@svn.freebsd.org) Message-Id: <201304161958.r3GJwO2h084815@svn.freebsd.org> From: Ivan Voras Date: Tue, 16 Apr 2013 19:58:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249564 - head/sys/geom/label X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 19:58:25 -0000 Author: ivoras Date: Tue Apr 16 19:58:24 2013 New Revision: 249564 URL: http://svnweb.freebsd.org/changeset/base/249564 Log: Fix the buffer-overflow-fixing fixes. Pointy-hat to: me, for not realizing snprintf() is available in kernel. Thanks to: jh, for bringing me the good news of snprintf(), Pawel Worach, for noting that the panic can be provoked in i386 and not in amd64 Modified: head/sys/geom/label/g_label_disk_ident.c Modified: head/sys/geom/label/g_label_disk_ident.c ============================================================================== --- head/sys/geom/label/g_label_disk_ident.c Tue Apr 16 19:39:27 2013 (r249563) +++ head/sys/geom/label/g_label_disk_ident.c Tue Apr 16 19:58:24 2013 (r249564) @@ -40,38 +40,41 @@ __FBSDID("$FreeBSD$"); #define G_LABEL_DISK_IDENT_DIR "diskid" -static char* classes_pass[] = { G_DISK_CLASS_NAME, G_MULTIPATH_CLASS_NAME, NULL }; +static char* classes_pass[] = { G_DISK_CLASS_NAME, G_MULTIPATH_CLASS_NAME, + NULL }; static void g_label_disk_ident_taste(struct g_consumer *cp, char *label, size_t size) { struct g_class *cls; char ident[100]; - int ident_len = sizeof(ident); + int ident_len, found, i; g_topology_assert_not(); label[0] = '\0'; cls = cp->provider->geom->class; - /* Get the GEOM::ident string and construct a label in the format CLASS_NAME-ident */ + /* + * Get the GEOM::ident string, and construct a label in the format + * "CLASS_NAME-ident" + */ + ident_len = sizeof(ident); if (g_io_getattr("GEOM::ident", cp, &ident_len, ident) == 0) { - int i, found = 0; - if (ident_len == 0 || ident[0] == '\0') return; - for (i = 0; classes_pass[i] != NULL; i++) - if (strcmp(classes_pass[i], cls->name) == 0) + for (i = 0, found = 0; classes_pass[i] != NULL; i++) + if (strcmp(classes_pass[i], cls->name) == 0) { found = 1; + break; + } if (!found) return; - if (strlen(cls->name) + ident_len + 2 > size) - ident[ident_len - strlen(cls->name) - 2] = '\0'; - else - ident[ident_len] = '\0'; - strcpy(label, cls->name); - strcat(label, "-"); - strcat(label, ident); + /* + * We can safely ignore the result of strncpy; the label will + * simply be truncated, which at most is only annoying. + */ + (void)snprintf(label, size, "%s-%s", cls->name, ident); } } @@ -81,4 +84,5 @@ struct g_label_desc g_label_disk_ident = .ld_enabled = 1 }; -G_LABEL_INIT(disk_ident, g_label_disk_ident, "Create device nodes for drives which export a disk identification string"); +G_LABEL_INIT(disk_ident, g_label_disk_ident, "Create device nodes for drives " + "which export a disk identification string"); From owner-svn-src-all@FreeBSD.ORG Tue Apr 16 20:01:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4346E377; Tue, 16 Apr 2013 20:01:31 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) by mx1.freebsd.org (Postfix) with ESMTP id 07D2213C5; Tue, 16 Apr 2013 20:01:30 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7::b037:d3c5:d0df:2e6b] (unknown [IPv6:2001:7b8:3a7:0:b037:d3c5:d0df:2e6b]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 39C8E5C44; Tue, 16 Apr 2013 22:01:28 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.3 \(1503\)) Subject: Re: svn commit: r249564 - head/sys/geom/label From: Dimitry Andric In-Reply-To: <201304161958.r3GJwO2h084815@svn.freebsd.org> Date: Tue, 16 Apr 2013 22:01:21 +0200 Content-Transfer-Encoding: 7bit Message-Id: References: <201304161958.r3GJwO2h084815@svn.freebsd.org> To: Ivan Voras X-Mailer: Apple Mail (2.1503) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 20:01:31 -0000 On Apr 16, 2013, at 21:58, Ivan Voras wrote: > Author: ivoras > Date: Tue Apr 16 19:58:24 2013 > New Revision: 249564 > URL: http://svnweb.freebsd.org/changeset/base/249564 > > Log: > Fix the buffer-overflow-fixing fixes. ... > + /* > + * We can safely ignore the result of strncpy; the label will > + * simply be truncated, which at most is only annoying. > + */ > + (void)snprintf(label, size, "%s-%s", cls->name, ident); s/strncpy/snprintf/ ? :-) From owner-svn-src-all@FreeBSD.ORG Tue Apr 16 20:21:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 238C911D; Tue, 16 Apr 2013 20:21:03 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 04B3D15AB; Tue, 16 Apr 2013 20:21:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3GKL2Ow093087; Tue, 16 Apr 2013 20:21:02 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3GKL2M4093082; Tue, 16 Apr 2013 20:21:02 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201304162021.r3GKL2M4093082@svn.freebsd.org> From: Adrian Chadd Date: Tue, 16 Apr 2013 20:21:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249565 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 20:21:03 -0000 Author: adrian Date: Tue Apr 16 20:21:02 2013 New Revision: 249565 URL: http://svnweb.freebsd.org/changeset/base/249565 Log: Use a per-RX-queue deferred list, rather than a single deferred list for both queues. Since ath_rx_pkt() does multi-mbuf frame recombining based on the RX queue, this needs to occur. Tested: * AR9380 (XB112), hostap mode Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_rx_edma.c head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Tue Apr 16 19:58:24 2013 (r249564) +++ head/sys/dev/ath/if_ath.c Tue Apr 16 20:21:02 2013 (r249565) @@ -842,7 +842,8 @@ ath_attach(u_int16_t devid, struct ath_s /* * Initialise the deferred completed RX buffer list. */ - TAILQ_INIT(&sc->sc_rx_rxlist); + TAILQ_INIT(&sc->sc_rx_rxlist[HAL_RX_QUEUE_HP]); + TAILQ_INIT(&sc->sc_rx_rxlist[HAL_RX_QUEUE_LP]); /* * Indicate we need the 802.11 header padded to a Modified: head/sys/dev/ath/if_ath_rx_edma.c ============================================================================== --- head/sys/dev/ath/if_ath_rx_edma.c Tue Apr 16 19:58:24 2013 (r249564) +++ head/sys/dev/ath/if_ath_rx_edma.c Tue Apr 16 20:21:02 2013 (r249565) @@ -398,7 +398,7 @@ ath_edma_recv_proc_queue(struct ath_soft * queue. */ re->m_fifo[re->m_fifo_head] = NULL; - TAILQ_INSERT_TAIL(&sc->sc_rx_rxlist, bf, bf_list); + TAILQ_INSERT_TAIL(&sc->sc_rx_rxlist[qtype], bf, bf_list); /* Bump the descriptor FIFO stats */ INCR(re->m_fifo_head, re->m_fifolen); @@ -451,8 +451,15 @@ ath_edma_flush_deferred_queue(struct ath struct ath_buf *bf, *next; ATH_RX_LOCK_ASSERT(sc); + /* Free in one set, inside the lock */ - TAILQ_FOREACH_SAFE(bf, &sc->sc_rx_rxlist, bf_list, next) { + TAILQ_FOREACH_SAFE(bf, + &sc->sc_rx_rxlist[HAL_RX_QUEUE_LP], bf_list, next) { + /* Free the buffer/mbuf */ + ath_edma_rxbuf_free(sc, bf); + } + TAILQ_FOREACH_SAFE(bf, + &sc->sc_rx_rxlist[HAL_RX_QUEUE_HP], bf_list, next) { /* Free the buffer/mbuf */ ath_edma_rxbuf_free(sc, bf); } @@ -482,7 +489,7 @@ ath_edma_recv_proc_deferred_queue(struct /* Copy the list over */ ATH_RX_LOCK(sc); - TAILQ_CONCAT(&rxlist, &sc->sc_rx_rxlist, bf_list); + TAILQ_CONCAT(&rxlist, &sc->sc_rx_rxlist[qtype], bf_list); ATH_RX_UNLOCK(sc); /* Handle the completed descriptors */ Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Tue Apr 16 19:58:24 2013 (r249564) +++ head/sys/dev/ath/if_athvar.h Tue Apr 16 20:21:02 2013 (r249565) @@ -542,6 +542,7 @@ struct ath_softc { struct ath_rx_methods sc_rx; struct ath_rx_edma sc_rxedma[HAL_NUM_RX_QUEUES]; /* HP/LP queues */ + ath_bufhead sc_rx_rxlist[HAL_NUM_RX_QUEUES]; /* deferred RX completion */ struct ath_tx_methods sc_tx; struct ath_tx_edma_fifo sc_txedma[HAL_NUM_TX_QUEUES]; @@ -700,7 +701,6 @@ struct ath_softc { struct ath_descdma sc_rxdma; /* RX descriptors */ ath_bufhead sc_rxbuf; /* receive buffer */ - ath_bufhead sc_rx_rxlist; /* deferred RX completion */ u_int32_t *sc_rxlink; /* link ptr in last RX desc */ struct task sc_rxtask; /* rx int processing */ u_int8_t sc_defant; /* current default antenna */ From owner-svn-src-all@FreeBSD.ORG Tue Apr 16 20:26:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 05C422EB; Tue, 16 Apr 2013 20:26:32 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EC1DB15D1; Tue, 16 Apr 2013 20:26:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3GKQV7J093878; Tue, 16 Apr 2013 20:26:31 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3GKQVgs093874; Tue, 16 Apr 2013 20:26:31 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201304162026.r3GKQVgs093874@svn.freebsd.org> From: John Baldwin Date: Tue, 16 Apr 2013 20:26:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249566 - in head: lib/libc/gen sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 20:26:32 -0000 Author: jhb Date: Tue Apr 16 20:26:31 2013 New Revision: 249566 URL: http://svnweb.freebsd.org/changeset/base/249566 Log: - Document that sem_wait() can fail with EINTR if it is interrupted by a signal. - Fix the old ksem implementation for POSIX semaphores to not restart sem_wait() or sem_timedwait() if interrupted by a signal. MFC after: 1 week Modified: head/lib/libc/gen/sem_wait.3 head/sys/kern/uipc_sem.c Modified: head/lib/libc/gen/sem_wait.3 ============================================================================== --- head/lib/libc/gen/sem_wait.3 Tue Apr 16 20:21:02 2013 (r249565) +++ head/lib/libc/gen/sem_wait.3 Tue Apr 16 20:26:31 2013 (r249566) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 15, 2000 +.Dd April 16, 2013 .Dt SEM_WAIT 3 .Os .Sh NAME @@ -75,6 +75,14 @@ points to an invalid semaphore. .El .Pp Additionally, +.Fn sem_wait +will fail if: +.Bl -tag -width Er +.Pp +.It Bq Er EINTR +A signal interrupted this function. +.El +Additionally, .Fn sem_trywait will fail if: .Bl -tag -width Er Modified: head/sys/kern/uipc_sem.c ============================================================================== --- head/sys/kern/uipc_sem.c Tue Apr 16 20:21:02 2013 (r249565) +++ head/sys/kern/uipc_sem.c Tue Apr 16 20:26:31 2013 (r249566) @@ -846,6 +846,8 @@ kern_sem_wait(struct thread *td, semid_t err: mtx_unlock(&sem_lock); fdrop(fp, td); + if (error == ERESTART) + error = EINTR; DP(("<<< kern_sem_wait leaving, pid=%d, error = %d\n", (int)td->td_proc->p_pid, error)); return (error); From owner-svn-src-all@FreeBSD.ORG Tue Apr 16 20:31:15 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A7AEC5B4; Tue, 16 Apr 2013 20:31:15 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8145515FA; Tue, 16 Apr 2013 20:31:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3GKVFw1096224; Tue, 16 Apr 2013 20:31:15 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3GKVFjN096223; Tue, 16 Apr 2013 20:31:15 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201304162031.r3GKVFjN096223@svn.freebsd.org> From: Joel Dahl Date: Tue, 16 Apr 2013 20:31:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249567 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 20:31:15 -0000 Author: joel (doc committer) Date: Tue Apr 16 20:31:15 2013 New Revision: 249567 URL: http://svnweb.freebsd.org/changeset/base/249567 Log: mdoc: remove superfluous paragraph macro. Modified: head/lib/libc/gen/sem_wait.3 Modified: head/lib/libc/gen/sem_wait.3 ============================================================================== --- head/lib/libc/gen/sem_wait.3 Tue Apr 16 20:26:31 2013 (r249566) +++ head/lib/libc/gen/sem_wait.3 Tue Apr 16 20:31:15 2013 (r249567) @@ -78,7 +78,6 @@ Additionally, .Fn sem_wait will fail if: .Bl -tag -width Er -.Pp .It Bq Er EINTR A signal interrupted this function. .El From owner-svn-src-all@FreeBSD.ORG Tue Apr 16 20:36:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C0DFB89B; Tue, 16 Apr 2013 20:36:32 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B1331163B; Tue, 16 Apr 2013 20:36:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3GKaWET096983; Tue, 16 Apr 2013 20:36:32 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3GKaWqH096982; Tue, 16 Apr 2013 20:36:32 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201304162036.r3GKaWqH096982@svn.freebsd.org> From: Adrian Chadd Date: Tue, 16 Apr 2013 20:36:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249568 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 20:36:32 -0000 Author: adrian Date: Tue Apr 16 20:36:32 2013 New Revision: 249568 URL: http://svnweb.freebsd.org/changeset/base/249568 Log: Implement a utility function to return the current TX power cap for the given node. This takes into account the per-node cap, the ic cap and the per-channel regulatory caps. This is designed to replace references to ni_txpower in various net80211 drivers - ni_txpower doesn't necessarily reflect the actual cap for the given node (eg if the node has the default value of 50dBm (100) and the administrator has manually configured a lower TX power.) Modified: head/sys/net80211/ieee80211_var.h Modified: head/sys/net80211/ieee80211_var.h ============================================================================== --- head/sys/net80211/ieee80211_var.h Tue Apr 16 20:31:15 2013 (r249567) +++ head/sys/net80211/ieee80211_var.h Tue Apr 16 20:36:32 2013 (r249568) @@ -822,6 +822,28 @@ ieee80211_htchanflags(const struct ieee8 } /* + * Fetch the current TX power (cap) for the given node. + * + * This includes the node and ic/vap TX power limit as needed, + * but it doesn't take into account any per-rate limit. + */ +static __inline uint16_t +ieee80211_get_node_txpower(struct ieee80211_node *ni) +{ + struct ieee80211com *ic = ni->ni_ic; + uint16_t txpower; + + txpower = ni->ni_txpower; + txpower = MIN(txpower, ic->ic_txpowlimit); + if (ic->ic_curchan != NULL) { + txpower = MIN(txpower, 2 * ic->ic_curchan->ic_maxregpower); + txpower = MIN(txpower, ic->ic_curchan->ic_maxpower); + } + + return (txpower); +} + +/* * Debugging facilities compiled in when IEEE80211_DEBUG is defined. * * The intent is that any problem in the net80211 layer can be From owner-svn-src-all@FreeBSD.ORG Tue Apr 16 21:15:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 95A12B01; Tue, 16 Apr 2013 21:15:07 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) by mx1.freebsd.org (Postfix) with ESMTP id 1724217CB; Tue, 16 Apr 2013 21:15:07 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 2E0CC359319; Tue, 16 Apr 2013 23:15:04 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id 150292848C; Tue, 16 Apr 2013 23:15:04 +0200 (CEST) Date: Tue, 16 Apr 2013 23:15:03 +0200 From: Jilles Tjoelker To: John Baldwin Subject: Re: svn commit: r249566 - in head: lib/libc/gen sys/kern Message-ID: <20130416211503.GA1025@stack.nl> References: <201304162026.r3GKQVgs093874@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201304162026.r3GKQVgs093874@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 21:15:07 -0000 On Tue, Apr 16, 2013 at 08:26:31PM +0000, John Baldwin wrote: > Author: jhb > Date: Tue Apr 16 20:26:31 2013 > New Revision: 249566 > URL: http://svnweb.freebsd.org/changeset/base/249566 > Log: > - Document that sem_wait() can fail with EINTR if it is interrupted by a > signal. > - Fix the old ksem implementation for POSIX semaphores to not restart > sem_wait() or sem_timedwait() if interrupted by a signal. > MFC after: 1 week > Modified: > head/lib/libc/gen/sem_wait.3 > head/sys/kern/uipc_sem.c > Modified: head/lib/libc/gen/sem_wait.3 > ============================================================================== > --- head/lib/libc/gen/sem_wait.3 Tue Apr 16 20:21:02 2013 (r249565) > +++ head/lib/libc/gen/sem_wait.3 Tue Apr 16 20:26:31 2013 (r249566) > @@ -27,7 +27,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd February 15, 2000 > +.Dd April 16, 2013 > .Dt SEM_WAIT 3 > .Os > .Sh NAME > @@ -75,6 +75,14 @@ points to an invalid semaphore. > .El > .Pp > Additionally, > +.Fn sem_wait > +will fail if: > +.Bl -tag -width Er > +.Pp > +.It Bq Er EINTR > +A signal interrupted this function. > +.El > +Additionally, > .Fn sem_trywait > will fail if: > .Bl -tag -width Er > > Modified: head/sys/kern/uipc_sem.c > ============================================================================== > --- head/sys/kern/uipc_sem.c Tue Apr 16 20:21:02 2013 (r249565) > +++ head/sys/kern/uipc_sem.c Tue Apr 16 20:26:31 2013 (r249566) > @@ -846,6 +846,8 @@ kern_sem_wait(struct thread *td, semid_t > err: > mtx_unlock(&sem_lock); > fdrop(fp, td); > + if (error == ERESTART) > + error = EINTR; > DP(("<<< kern_sem_wait leaving, pid=%d, error = %d\n", > (int)td->td_proc->p_pid, error)); > return (error); It would normally be expected (and required by POSIX) that a signal with SA_RESTART set does not cause a function to fail with [EINTR], so more rationale is needed here. Also, the timeouts passed to these functions are absolute and also are at the system call level except UMTX_OP_SEM_WAIT which can take a relative or an absolute timeout but libc passed it an absolute timeout. So there is no need for a caller to see [EINTR] to avoid overlong timeouts. Given the number of times people call sem_wait() without checking the return value, call sem_wait() and assume any error is fatal or call sem_timedwait() and assume any error is a timeout, I think it may be better to go the other way and never fail with [EINTR], just like the pthread functions. POSIX explicitly permits this: the [EINTR] error for sem_wait(), sem_trywait() and sem_timedwait() is "may fail" rather than the usual "shall fail" (note that SA_RESTART overrides such a "shall fail" unless there is a relative timeout or it is explicitly excluded with the function). I realize that this reduces functionality, but relying on [EINTR] here introduces a race condition anyway (because the signal handler may be called just before sem_wait() blocks). I suggest pthread cancellation, not returning from the signal handler or leaving the default action in place (if it is termination). The racy functionality can be kept by leaving [EINTR] and [ERESTART] from the sleep function as they are except for changing [ERESTART] to [EINTR] when UMTX_OP_SEM_WAIT was passed a relative timeout. Breakage in programs that check sem_wait()'s return value incorrectly will then be less frequent and only present when POSIX permits it. -- Jilles Tjoelker From owner-svn-src-all@FreeBSD.ORG Tue Apr 16 21:26:45 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 67D476F; Tue, 16 Apr 2013 21:26:45 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 408BB184C; Tue, 16 Apr 2013 21:26:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3GLQj5f014321; Tue, 16 Apr 2013 21:26:45 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3GLQixY014319; Tue, 16 Apr 2013 21:26:44 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201304162126.r3GLQixY014319@svn.freebsd.org> From: Adrian Chadd Date: Tue, 16 Apr 2013 21:26:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249569 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 21:26:45 -0000 Author: adrian Date: Tue Apr 16 21:26:44 2013 New Revision: 249569 URL: http://svnweb.freebsd.org/changeset/base/249569 Log: Use the new net80211 method to fetch the node TX power, rather than directly referencing ni->ni_txpower. This provides the hardware with a slightly more accurate idea of the maximum TX power to be using. This is part of a series to get per-packet TPC to work (better). Tested: * AR5416, hostap mode Modified: head/sys/dev/ath/if_ath_beacon.c head/sys/dev/ath/if_ath_tx.c Modified: head/sys/dev/ath/if_ath_beacon.c ============================================================================== --- head/sys/dev/ath/if_ath_beacon.c Tue Apr 16 20:36:32 2013 (r249568) +++ head/sys/dev/ath/if_ath_beacon.c Tue Apr 16 21:26:44 2013 (r249569) @@ -322,7 +322,7 @@ ath_beacon_setup(struct ath_softc *sc, s , m->m_len + IEEE80211_CRC_LEN /* frame length */ , sizeof(struct ieee80211_frame)/* header length */ , HAL_PKT_TYPE_BEACON /* Atheros packet type */ - , ni->ni_txpower /* txpower XXX */ + , ieee80211_get_node_txpower(ni) /* txpower XXX */ , rate, 1 /* series 0 rate/tries */ , HAL_TXKEYIX_INVALID /* no encryption */ , antenna /* antenna mode */ Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Tue Apr 16 20:36:32 2013 (r249568) +++ head/sys/dev/ath/if_ath_tx.c Tue Apr 16 21:26:44 2013 (r249569) @@ -1722,7 +1722,7 @@ ath_tx_normal_setup(struct ath_softc *sc if (isfrag) sc->sc_tx_th.wt_flags |= IEEE80211_RADIOTAP_F_FRAG; sc->sc_tx_th.wt_rate = sc->sc_hwmap[rix].ieeerate; - sc->sc_tx_th.wt_txpower = ni->ni_txpower; + sc->sc_tx_th.wt_txpower = ieee80211_get_node_txpower(ni); sc->sc_tx_th.wt_antenna = sc->sc_txantenna; ieee80211_radiotap_tx(vap, m0); @@ -1743,7 +1743,7 @@ ath_tx_normal_setup(struct ath_softc *sc bf->bf_state.bfs_pktlen = pktlen; bf->bf_state.bfs_hdrlen = hdrlen; bf->bf_state.bfs_atype = atype; - bf->bf_state.bfs_txpower = ni->ni_txpower; + bf->bf_state.bfs_txpower = ieee80211_get_node_txpower(ni); bf->bf_state.bfs_txrate0 = txrate; bf->bf_state.bfs_try0 = try0; bf->bf_state.bfs_keyix = keyix; @@ -2088,7 +2088,8 @@ ath_tx_raw_start(struct ath_softc *sc, s if (m0->m_flags & M_FRAG) sc->sc_tx_th.wt_flags |= IEEE80211_RADIOTAP_F_FRAG; sc->sc_tx_th.wt_rate = sc->sc_hwmap[rix].ieeerate; - sc->sc_tx_th.wt_txpower = ni->ni_txpower; + sc->sc_tx_th.wt_txpower = MIN(params->ibp_power, + ieee80211_get_node_txpower(ni)); sc->sc_tx_th.wt_antenna = sc->sc_txantenna; ieee80211_radiotap_tx(vap, m0); @@ -2104,7 +2105,8 @@ ath_tx_raw_start(struct ath_softc *sc, s bf->bf_state.bfs_pktlen = pktlen; bf->bf_state.bfs_hdrlen = hdrlen; bf->bf_state.bfs_atype = atype; - bf->bf_state.bfs_txpower = params->ibp_power; + bf->bf_state.bfs_txpower = MIN(params->ibp_power, + ieee80211_get_node_txpower(ni)); bf->bf_state.bfs_txrate0 = txrate; bf->bf_state.bfs_try0 = try0; bf->bf_state.bfs_keyix = keyix; From owner-svn-src-all@FreeBSD.ORG Tue Apr 16 22:09:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id F0A52C5B; Tue, 16 Apr 2013 22:09:08 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E3A2A1B38; Tue, 16 Apr 2013 22:09:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3GM98BQ026880; Tue, 16 Apr 2013 22:09:08 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3GM98RO026879; Tue, 16 Apr 2013 22:09:08 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201304162209.r3GM98RO026879@svn.freebsd.org> From: Warner Losh Date: Tue, 16 Apr 2013 22:09:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249570 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 22:09:09 -0000 Author: imp Date: Tue Apr 16 22:09:08 2013 New Revision: 249570 URL: http://svnweb.freebsd.org/changeset/base/249570 Log: r249408 and r249436 cause a NULL pointer dereference on the CUBIEBOARD since it doesn't set the kernel envrionment at all. Work around this by making sure kern_envp is non-NULL before dereferencing it. Modified: head/sys/kern/kern_environment.c Modified: head/sys/kern/kern_environment.c ============================================================================== --- head/sys/kern/kern_environment.c Tue Apr 16 21:26:44 2013 (r249569) +++ head/sys/kern/kern_environment.c Tue Apr 16 22:09:08 2013 (r249570) @@ -231,7 +231,7 @@ init_dynamic_kenv(void *data __unused) kenvp = malloc((KENV_SIZE + 1) * sizeof(char *), M_KENV, M_WAITOK | M_ZERO); i = 0; - if (*kern_envp != '\0') { + if (kern_envp && *kern_envp != '\0') { for (cp = kern_envp; cp != NULL; cp = kernenv_next(cp)) { len = strlen(cp) + 1; if (len > KENV_MNAMELEN + 1 + KENV_MVALLEN + 1) { From owner-svn-src-all@FreeBSD.ORG Tue Apr 16 22:42:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 53F034EC; Tue, 16 Apr 2013 22:42:41 +0000 (UTC) (envelope-from ivoras@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 46C4E1C9E; Tue, 16 Apr 2013 22:42:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3GMgfXj038152; Tue, 16 Apr 2013 22:42:41 GMT (envelope-from ivoras@svn.freebsd.org) Received: (from ivoras@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3GMgf8k038151; Tue, 16 Apr 2013 22:42:41 GMT (envelope-from ivoras@svn.freebsd.org) Message-Id: <201304162242.r3GMgf8k038151@svn.freebsd.org> From: Ivan Voras Date: Tue, 16 Apr 2013 22:42:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249571 - head/sys/geom/label X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 22:42:41 -0000 Author: ivoras Date: Tue Apr 16 22:42:40 2013 New Revision: 249571 URL: http://svnweb.freebsd.org/changeset/base/249571 Log: Comment typo fix. Is aware of the importance of comments: dim Modified: head/sys/geom/label/g_label_disk_ident.c Modified: head/sys/geom/label/g_label_disk_ident.c ============================================================================== --- head/sys/geom/label/g_label_disk_ident.c Tue Apr 16 22:09:08 2013 (r249570) +++ head/sys/geom/label/g_label_disk_ident.c Tue Apr 16 22:42:40 2013 (r249571) @@ -71,8 +71,8 @@ g_label_disk_ident_taste(struct g_consum if (!found) return; /* - * We can safely ignore the result of strncpy; the label will - * simply be truncated, which at most is only annoying. + * We can safely ignore the result of snprintf(): the label + * will simply be truncated, which at most is only annoying. */ (void)snprintf(label, size, "%s-%s", cls->name, ident); } From owner-svn-src-all@FreeBSD.ORG Tue Apr 16 22:44:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E9FFC6A6; Tue, 16 Apr 2013 22:44:01 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: from mail-ve0-f169.google.com (mail-ve0-f169.google.com [209.85.128.169]) by mx1.freebsd.org (Postfix) with ESMTP id 72BB91CAE; Tue, 16 Apr 2013 22:44:00 +0000 (UTC) Received: by mail-ve0-f169.google.com with SMTP id d10so948174vea.0 for ; Tue, 16 Apr 2013 15:43:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=entza7VvV6xA/2cRae4rz7UqexxuZYr/C29yW0+lQLA=; b=dKRTUlK3um+EgqNK6Y8jIZoXBZQX+GThjHsaXFitHlB+mNoCq1QGR+3R4Mu3dmep2m z6psFlUzP0jQAPlAIKgpK5LnUb+YyQP06Z3C8KO9jyS7RRA8Rrtwu5M7dJFHBlF2PIKK pgwRtuQM2ioZr06sWjUQF+uRheyaEd15eg8bYOFYiSdYcbgDiOAGotkbVs4q73if0c9W 9dHGfO1UigIbSxqmRfUmzDpOqk77ciMn9NIrGcCa+Iy3u4Ht7Pg2cnjH+J4lMZITXpJZ EMRY+2RIrG1hvtQDmdnRqInn1xQq3aYTcOn2b1Xe4IckZO9WxxIvDWZjV1hPP3KRLxim 97wg== X-Received: by 10.52.99.67 with SMTP id eo3mr2676430vdb.21.1366152234115; Tue, 16 Apr 2013 15:43:54 -0700 (PDT) MIME-Version: 1.0 Sender: ivoras@gmail.com Received: by 10.58.34.162 with HTTP; Tue, 16 Apr 2013 15:43:13 -0700 (PDT) In-Reply-To: References: <201304161958.r3GJwO2h084815@svn.freebsd.org> From: Ivan Voras Date: Wed, 17 Apr 2013 00:43:13 +0200 X-Google-Sender-Auth: BlLAcfVy7RhbSoA8TUbR7ehZT8E Message-ID: Subject: Re: svn commit: r249564 - head/sys/geom/label To: Dimitry Andric Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 22:44:02 -0000 On 16 April 2013 22:01, Dimitry Andric wrote: > On Apr 16, 2013, at 21:58, Ivan Voras wrote: >> Author: ivoras >> Date: Tue Apr 16 19:58:24 2013 >> New Revision: 249564 >> URL: http://svnweb.freebsd.org/changeset/base/249564 >> >> Log: >> Fix the buffer-overflow-fixing fixes. > ... >> + /* >> + * We can safely ignore the result of strncpy; the label will >> + * simply be truncated, which at most is only annoying. >> + */ >> + (void)snprintf(label, size, "%s-%s", cls->name, ident); > > s/strncpy/snprintf/ ? :-) The typo fairy is strong this day :) Thanks! From owner-svn-src-all@FreeBSD.ORG Wed Apr 17 02:03:13 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4E9E782E; Wed, 17 Apr 2013 02:03:13 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 27A2F2D3; Wed, 17 Apr 2013 02:03:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3H23DCj099294; Wed, 17 Apr 2013 02:03:13 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3H23D1r099293; Wed, 17 Apr 2013 02:03:13 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201304170203.r3H23D1r099293@svn.freebsd.org> From: Neel Natu Date: Wed, 17 Apr 2013 02:03:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249572 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2013 02:03:13 -0000 Author: neel Date: Wed Apr 17 02:03:12 2013 New Revision: 249572 URL: http://svnweb.freebsd.org/changeset/base/249572 Log: Setup accesses to the memory hole below 4GB to return all 1's on read and consume all writes without any side effects. Obtained from: NetApp Modified: head/usr.sbin/bhyve/pci_emul.c Modified: head/usr.sbin/bhyve/pci_emul.c ============================================================================== --- head/usr.sbin/bhyve/pci_emul.c Tue Apr 16 22:42:40 2013 (r249571) +++ head/usr.sbin/bhyve/pci_emul.c Wed Apr 17 02:03:12 2013 (r249572) @@ -88,8 +88,6 @@ static struct lirqinfo { SET_DECLARE(pci_devemu_set, struct pci_devemu); -static uint32_t pci_hole_startaddr; - static uint64_t pci_emul_iobase; static uint64_t pci_emul_membase32; static uint64_t pci_emul_membase64; @@ -977,13 +975,12 @@ init_pci(struct vmctx *ctx) struct mem_range memp; struct pci_devemu *pde; struct slotinfo *si; + size_t lowmem; int slot, func; int error; - pci_hole_startaddr = vm_get_lowmem_limit(ctx); - pci_emul_iobase = PCI_EMUL_IOBASE; - pci_emul_membase32 = pci_hole_startaddr; + pci_emul_membase32 = vm_get_lowmem_limit(ctx); pci_emul_membase64 = PCI_EMUL_MEMBASE64; for (slot = 0; slot < MAXSLOTS; slot++) { @@ -1010,14 +1007,23 @@ init_pci(struct vmctx *ctx) lirq[15].li_generic = 1; /* - * Setup the PCI hole to return 0xff's when accessed in a region - * with no devices + * The guest physical memory map looks like the following: + * [0, lowmem) guest system memory + * [lowmem, lowmem_limit) memory hole (may be absent) + * [lowmem_limit, 4GB) PCI hole (32-bit BAR allocation) + * [4GB, 4GB + highmem) + * + * Accesses to memory addresses that are not allocated to system + * memory or PCI devices return 0xff's. */ + error = vm_get_memory_seg(ctx, 0, &lowmem); + assert(error == 0); + memset(&memp, 0, sizeof(struct mem_range)); memp.name = "PCI hole"; memp.flags = MEM_F_RW; - memp.base = pci_hole_startaddr; - memp.size = (4ULL * 1024 * 1024 * 1024) - pci_hole_startaddr; + memp.base = lowmem; + memp.size = (4ULL * 1024 * 1024 * 1024) - lowmem; memp.handler = pci_emul_fallback_handler; error = register_mem_fallback(&memp); From owner-svn-src-all@FreeBSD.ORG Wed Apr 17 02:20:20 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 76748A87; Wed, 17 Apr 2013 02:20:20 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6632B342; Wed, 17 Apr 2013 02:20:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3H2KK1k004970; Wed, 17 Apr 2013 02:20:20 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3H2KHIb004949; Wed, 17 Apr 2013 02:20:17 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201304170220.r3H2KHIb004949@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Wed, 17 Apr 2013 02:20:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249573 - in head: cddl/contrib/opensolaris/cmd/dtrace cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs cddl/contrib/opensol... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2013 02:20:20 -0000 Author: pfg Date: Wed Apr 17 02:20:17 2013 New Revision: 249573 URL: http://svnweb.freebsd.org/changeset/base/249573 Log: DTrace: Revert r249367 The following change from illumos brought caused DTrace to pause in an interactive environment: 3026 libdtrace should set LD_NOLAZYLOAD=1 to help the pid provider This was not detected during testing because it doesn't affect scripts. We shouldn't be changing the environment, especially since the LD_NOLAZYLOAD option doesn't apply to our (GNU) ld. Unfortunately the change from upstream was made in such a way that it is very difficult to separate this change from the others so, at least for now, it's better to just revert everything. Reference: https://www.illumos.org/issues/3026 Reported by: Navdeep Parhar and Mark Johnston Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.complex.d - copied unchanged from r249366, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.complex.d head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/predicates/tst.predcache.ksh - copied unchanged from r249366, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/predicates/tst.predcache.ksh head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PRINT_DYN.bad.d - copied unchanged from r249366, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PRINT_DYN.bad.d head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/man.TestTransStability.d - copied unchanged from r249366, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/man.TestTransStability.d Deleted: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.sizedkeys.d head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.sizedkeys.d.out head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.basics.d.out head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compcast.d head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compcast.d.out head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compnarrowassign.d head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compnarrowassign.d.out head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.execcast.d head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.execcast.d.out head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/cg/ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.assigncast1.d head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.assigncast2.d head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.temporal.ksh head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.temporal2.ksh head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.temporal3.d head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.dyn.d head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.xlate.d head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.xlate.d.out head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.signs.d head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.signs.d.out head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/tst.dyn.d head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability1.ksh head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability1.ksh.out head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability2.ksh head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/tst.TestTransStability2.ksh.out head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pq.c head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pq.h Modified: head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c head/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dtest.pl head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.fill1.d head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.ring3.d head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.newprobes.ksh head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.ints.d.out head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.BufSizeVariations1.d head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.SpecSizeVariations3.d head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_aggregate.c head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cg.c head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dis.c head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_error.c head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_errtags.h head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_options.c head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_printf.c head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.c head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.h head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_regset.c head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_regset.h head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c head/cddl/contrib/opensolaris/lib/libdtrace/i386/dt_isadep.c head/cddl/lib/libdtrace/Makefile head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h Modified: head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c Wed Apr 17 02:03:12 2013 (r249572) +++ head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c Wed Apr 17 02:20:17 2013 (r249573) @@ -23,9 +23,8 @@ * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ -/* - * Copyright (c) 2012 by Delphix. All rights reserved. - */ + +#pragma ident "%Z%%M% %I% %E% SMI" #include #include @@ -1410,7 +1409,6 @@ main(int argc, char *argv[]) (void) dtrace_setopt(g_dtp, "bufsize", "4m"); (void) dtrace_setopt(g_dtp, "aggsize", "4m"); #endif - (void) dtrace_setopt(g_dtp, "temporal", "yes"); /* * If -G is specified, enable -xlink=dynamic and -xunodefs to permit Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dtest.pl ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dtest.pl Wed Apr 17 02:03:12 2013 (r249572) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dtest.pl Wed Apr 17 02:20:17 2013 (r249573) @@ -583,8 +583,6 @@ if ($opt_x) { die "$PNAME: failed to open $PNAME.$$.log: $!\n" unless (!$opt_l || open(LOG, ">$PNAME.$$.log")); -$ENV{'DTRACE_DEBUG_REGSET'} = 'true'; - if ($opt_g) { $ENV{'UMEM_DEBUG'} = 'default,verbose'; $ENV{'UMEM_LOGGING'} = 'fail,contents'; Copied: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.complex.d (from r249366, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.complex.d) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.complex.d Wed Apr 17 02:20:17 2013 (r249573, copy of r249366, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.complex.d) @@ -0,0 +1,57 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * Complex expressions. + * Call complex expressions and make sure test succeeds. + * Match expected output in tst.complex.d.out + * + * SECTION: Types, Operators, and Expressions/Arithmetic Operators + * + */ + +#pragma D option quiet + +BEGIN +{ + i = 0; + i = i++ + ++i; + printf("The value of i is %d\n", i); + i = i-- - --i; + printf("The value of i is %d\n", i); + i = i-- + ++i; + printf("The value of i is %d\n", i); + i += i++ + -- i + ++i - ++i * i ; + printf("The value of i is %d\n", i); + i -= i++ * 3; + printf("The value of i is %d\n", i); + i = i++/i--+i++-++i-++i; + printf("The value of i is %d\n", i); + exit (0); +} Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.fill1.d ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.fill1.d Wed Apr 17 02:03:12 2013 (r249572) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.fill1.d Wed Apr 17 02:20:17 2013 (r249573) @@ -23,29 +23,26 @@ * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ -/* - * Copyright (c) 2012 by Delphix. All rights reserved. - */ + +#pragma ident "%Z%%M% %I% %E% SMI" /* * ASSERTION: * Positive test for fill buffer policy. * * SECTION: Buffers and Buffering/fill Policy; - * Buffers and Buffering/Buffer Sizes; + * Buffers and Buffering/Buffer Sizes; * Options and Tunables/bufsize; * Options and Tunables/bufpolicy; * Options and Tunables/statusrate */ /* - * This is a brute-force way of testing fill buffers. We assume that - * each printf() stores 16 bytes (4x 32-bit words for EPID, timestamp - * lo, timestamp hi, and the variable i). Because each fill buffer is - * per-CPU, we must fill up our buffer in one series of enablings on a - * single CPU. + * This is a brute-force way of testing fill buffers. We assume that each + * printf() stores 8 bytes. Because each fill buffer is per-CPU, we must + * fill up our buffer in one series of enablings on a single CPU. */ #pragma D option bufpolicy=fill -#pragma D option bufsize=128 +#pragma D option bufsize=64 #pragma D option statusrate=10ms #pragma D option quiet Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.ring3.d ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.ring3.d Wed Apr 17 02:03:12 2013 (r249572) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/tst.ring3.d Wed Apr 17 02:20:17 2013 (r249573) @@ -23,9 +23,8 @@ * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ -/* - * Copyright (c) 2012 by Delphix. All rights reserved. - */ + +#pragma ident "%Z%%M% %I% %E% SMI" /* * ASSERTION: @@ -38,20 +37,19 @@ */ /* - * We make some regrettable assumptions about the implementation in this - * test. First, we assume that each entry for the printf() of an int - * takes _exactly_ 16 bytes (4 bytes for the EPID, 8 bytes for the - * timestamp, 4 bytes for the payload). Second, we assume that by - * allocating storage for n + 1 records, we will get exactly n. Here is - * why: the final predicate that evaluates to false will reserve space - * that it won't use. This act of reservation will advance the wrapped - * offset. That record won't be subsequently used, but the wrapped - * offset has advanced. (And in this case, that old record is clobbered - * by the exit() anyway.) Thirdly: we rely on t_cpu/cpu_id. Finally: - * we rely on being able to run on the CPU that we first ran on. + * We make some regrettable assumptions about the implementation in this test. + * First, we assume that each entry for the printf() of an int takes _exactly_ + * eight bytes (four bytes for the EPID, four bytes for the payload). Second, + * we assume that by allocating storage for n + 1 records, we will get exactly + * n. Here is why: the final predicate that evaluates to false will reserve + * space that it won't use. This act of reservation will advance the wrapped + * offset. That record won't be subsequently used, but the wrapped offset has + * advanced. (And in this case, that old record is clobbered by the exit() + * anyway.) Thirdly: we rely on t_cpu/cpu_id. Finally: we rely on being + * able to run on the CPU that we first ran on. */ #pragma D option bufpolicy=ring -#pragma D option bufsize=80 +#pragma D option bufsize=40 #pragma D option quiet int n; Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.newprobes.ksh ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.newprobes.ksh Wed Apr 17 02:03:12 2013 (r249572) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.newprobes.ksh Wed Apr 17 02:20:17 2013 (r249573) @@ -24,9 +24,7 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # - -# -# Copyright (c) 2012 by Delphix. All rights reserved. +# ident "%Z%%M% %I% %E% SMI" # if [ $# != 1 ]; then @@ -51,13 +49,13 @@ tick-1s tick-1s /(i % 2) == 0/ { - system("dtrace -c date -n 'pid\$target::main:entry' >/dev/null"); + system("dtrace -c date -ln 'pid\$target::main:entry' >/dev/null"); } tick-1s /(i % 2) == 1/ { - system("dtrace -c date -n 'pid\$target::main:return' >/dev/null"); + system("dtrace -c date -ln 'pid\$target::main:return' >/dev/null"); } EOF Copied: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/predicates/tst.predcache.ksh (from r249366, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/predicates/tst.predcache.ksh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/predicates/tst.predcache.ksh Wed Apr 17 02:20:17 2013 (r249573, copy of r249366, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/predicates/tst.predcache.ksh) @@ -0,0 +1,197 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" + +unload() +{ + # + # Get the list of services whose processes have USDT probes. Ideally + # it would be possible to unload the fasttrap provider while USDT + # probes exist -- once that fix is integrated, this hack can go away + # We create two lists -- one of regular SMF services and one of legacy + # services -- since each must be enabled and disabled using a specific + # mechanism. + # + pids=$(dtrace -l | \ + perl -ne 'print "$1\n" if (/^\s*\S+\s+\S*\D(\d+)\s+/);' | \ + sort | uniq | tr '\n' ',') + + ctids=$(ps -p $pids -o ctid | tail +2 | sort | uniq) + svcs= + lrcs= + + for ct in $ctids + do + line=$(svcs -o fmri,ctid | grep " $ct\$") + svc=$(echo $line | cut -d' ' -f1) + + if [[ $(svcs -Ho STA $svc) == "LRC" ]]; then + lrc=$(svcs -Ho SVC $svc | tr _ '?') + lrcs="$lrcs $lrc" + else + svcs="$svcs $svc" + fi + done + + for svc in $svcs + do + svcadm disable -ts $svc + done + + for lrc in $lrcs + do + # + # Does it seem a little paternalistic that lsvcrun requires + # this environment variable to be set? I'd say so... + # + SMF_RESTARTER=svc:/system/svc/restarter:default \ + /lib/svc/bin/lsvcrun $lrc stop + done + + modunload -i 0 + modunload -i 0 + modunload -i 0 + modinfo | grep dtrace + success=$? + + for svc in $svcs + do + svcadm enable -ts $svc + done + + for lrc in $lrcs + do + SMF_RESTARTER=svc:/system/svc/restarter:default \ + /lib/svc/bin/lsvcrun $lrc start + done + + if [ ! $success ]; then + echo $tst: could not unload dtrace + exit 1 + fi +} + +script1() +{ + $dtrace -s /dev/stdin <' + exit 2 +fi + +ppid=$$ +dtrace=$1 + +unload +script1 & +child=$! + +let waited=0 + +while [ "$waited" -lt 5 ]; do + seconds=`date +%S` + + if [ "$seconds" -ne "$last" ]; then + last=$seconds + let waited=waited+1 + fi +done + +wait $child +status=$? + +if [ "$status" -ne 0 ]; then + echo $tst: first dtrace failed + exit $status +fi + +unload +script2 & +child=$! + +let waited=0 + +while [ "$waited" -lt 10 ]; do + seconds=`date +%S` + + if [ "$seconds" -ne "$last" ]; then + last=$seconds + let waited=waited+1 + fi +done + +wait $child +status=$? + +exit $status Copied: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PRINT_DYN.bad.d (from r249366, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PRINT_DYN.bad.d) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PRINT_DYN.bad.d Wed Apr 17 02:20:17 2013 (r249573, copy of r249366, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PRINT_DYN.bad.d) @@ -0,0 +1,29 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2011 by Delphix. All rights reserved. + */ + +BEGIN +{ + print(*curpsinfo); +} Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.ints.d.out ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.ints.d.out Wed Apr 17 02:03:12 2013 (r249572) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.ints.d.out Wed Apr 17 02:20:17 2013 (r249573) @@ -1,6 +1,6 @@ --17 --12817 +239 +52719 -1867788817 1311768467294899695 Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.BufSizeVariations1.d ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.BufSizeVariations1.d Wed Apr 17 02:03:12 2013 (r249572) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.BufSizeVariations1.d Wed Apr 17 02:20:17 2013 (r249573) @@ -24,10 +24,7 @@ * Use is subject to license terms. */ -/* - * Copyright (c) 2012 by Delphix. All rights reserved. - */ - +#pragma ident "%Z%%M% %I% %E% SMI" /* * ASSERTION: @@ -38,10 +35,17 @@ * * NOTES: This test behaves differently depending on the values * assigned to bufsize. + * 1. 0 > bufsize. + * 2. 0 == bufsize. + * 3. 0 < bufsize <= 7 + * 4. 8 <= bufsize <= 31 + * 5. 32 <= bufsize <= 47 + * 6. 48 <= bufsize <= 71 + * 7. 72 <= bufsize */ #pragma D option quiet -#pragma D option bufsize=49 +#pragma D option bufsize=41 BEGIN { Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.SpecSizeVariations3.d ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.SpecSizeVariations3.d Wed Apr 17 02:03:12 2013 (r249572) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.SpecSizeVariations3.d Wed Apr 17 02:20:17 2013 (r249573) @@ -24,10 +24,7 @@ * Use is subject to license terms. */ -/* - * Copyright (c) 2012 by Delphix. All rights reserved. - */ - +#pragma ident "%Z%%M% %I% %E% SMI" /* * ASSERTION: * Verify the behavior of speculations with changes in specsize. @@ -38,7 +35,7 @@ */ #pragma D option quiet -#pragma D option specsize=48 +#pragma D option specsize=40 BEGIN { Copied: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/man.TestTransStability.d (from r249366, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/man.TestTransStability.d) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/man.TestTransStability.d Wed Apr 17 02:20:17 2013 (r249573, copy of r249366, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/translators/man.TestTransStability.d) @@ -0,0 +1,61 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +/* + * ASSERTION: + * The D inline translation mechanism can be used to facilitate stable + * translations. + * + * SECTION: Translators/ Translator Declarations + * SECTION: Translators/ Translate Operator + * SECTION: Translators/Stable Translations + * + * NOTES: Uncomment the pragma that explicitly resets the attributes of + * myinfo identifier to Stable/Stable/Common from Private/Private/Unknown. + * Run the program with and without the comments as: + * /usr/sbin/dtrace -vs man.TestTransStability.d + */ + +#pragma D option quiet + +inline lwpsinfo_t *myinfo = xlate < lwpsinfo_t *> (curthread); + +/* +#pragma D attributes Stable/Stable/Common myinfo +*/ + +BEGIN +{ + trace(myinfo->pr_flag); + exit(0); +} + +ERROR +{ + exit(1); +} Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_aggregate.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_aggregate.c Wed Apr 17 02:03:12 2013 (r249572) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_aggregate.c Wed Apr 17 02:20:17 2013 (r249573) @@ -26,7 +26,6 @@ /* * Copyright (c) 2011, Joyent, Inc. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. */ #include @@ -895,14 +894,33 @@ dt_aggregate_valcmp(const void *lhs, con caddr_t rdata = rh->dtahe_data.dtada_data; dtrace_recdesc_t *lrec, *rrec; int64_t *laddr, *raddr; - int rval; + int rval, i; + + if ((rval = dt_aggregate_hashcmp(lhs, rhs)) != 0) + return (rval); + + if (lagg->dtagd_nrecs > ragg->dtagd_nrecs) + return (DT_GREATERTHAN); + + if (lagg->dtagd_nrecs < ragg->dtagd_nrecs) + return (DT_LESSTHAN); - assert(lagg->dtagd_nrecs == ragg->dtagd_nrecs); + for (i = 0; i < lagg->dtagd_nrecs; i++) { + lrec = &lagg->dtagd_rec[i]; + rrec = &ragg->dtagd_rec[i]; - lrec = &lagg->dtagd_rec[lagg->dtagd_nrecs - 1]; - rrec = &ragg->dtagd_rec[ragg->dtagd_nrecs - 1]; + if (lrec->dtrd_offset < rrec->dtrd_offset) + return (DT_LESSTHAN); + + if (lrec->dtrd_offset > rrec->dtrd_offset) + return (DT_GREATERTHAN); - assert(lrec->dtrd_action == rrec->dtrd_action); + if (lrec->dtrd_action < rrec->dtrd_action) + return (DT_LESSTHAN); + + if (lrec->dtrd_action > rrec->dtrd_action) + return (DT_GREATERTHAN); + } laddr = (int64_t *)(uintptr_t)(ldata + lrec->dtrd_offset); raddr = (int64_t *)(uintptr_t)(rdata + rrec->dtrd_offset); Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c Wed Apr 17 02:03:12 2013 (r249572) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c Wed Apr 17 02:20:17 2013 (r249573) @@ -22,7 +22,7 @@ /* * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, Joyent Inc. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2011 by Delphix. All rights reserved. */ /* @@ -664,17 +664,15 @@ static void dt_action_trace(dtrace_hdl_t *dtp, dt_node_t *dnp, dtrace_stmtdesc_t *sdp) { dtrace_actdesc_t *ap = dt_stmt_action(dtp, sdp); - boolean_t istrace = (dnp->dn_ident->di_id == DT_ACT_TRACE); - const char *act = istrace ? "trace" : "print"; if (dt_node_is_void(dnp->dn_args)) { - dnerror(dnp->dn_args, istrace ? D_TRACE_VOID : D_PRINT_VOID, - "%s( ) may not be applied to a void expression\n", act); + dnerror(dnp->dn_args, D_TRACE_VOID, + "trace( ) may not be applied to a void expression\n"); } - if (dt_node_resolve(dnp->dn_args, DT_IDENT_XLPTR) != NULL) { - dnerror(dnp->dn_args, istrace ? D_TRACE_DYN : D_PRINT_DYN, - "%s( ) may not be applied to a translated pointer\n", act); + if (dt_node_is_dynamic(dnp->dn_args)) { + dnerror(dnp->dn_args, D_TRACE_DYN, + "trace( ) may not be applied to a dynamic expression\n"); } if (dnp->dn_args->dn_kind == DT_NODE_AGG) { @@ -684,34 +682,51 @@ dt_action_trace(dtrace_hdl_t *dtp, dt_no } dt_cg(yypcb, dnp->dn_args); + ap->dtad_difo = dt_as(yypcb); + ap->dtad_kind = DTRACEACT_DIFEXPR; +} - /* - * The print() action behaves identically to trace(), except that it - * stores the CTF type of the argument (if present) within the DOF for - * the DIFEXPR action. To do this, we set the 'dtsd_strdata' to point - * to the fully-qualified CTF type ID for the result of the DIF - * action. We use the ID instead of the name to handles complex types - * like arrays and function pointers that can't be resolved by - * ctf_type_lookup(). This is later processed by dtrace_dof_create() - * and turned into a reference into the string table so that we can - * get the type information when we process the data after the fact. - */ - if (dnp->dn_ident->di_id == DT_ACT_PRINT) { - dt_node_t *dret; - size_t n; - dt_module_t *dmp; - - dret = yypcb->pcb_dret; - dmp = dt_module_lookup_by_ctf(dtp, dret->dn_ctfp); - - n = snprintf(NULL, 0, "%s`%ld", dmp->dm_name, dret->dn_type) + 1; - sdp->dtsd_strdata = dt_alloc(dtp, n); - if (sdp->dtsd_strdata == NULL) - longjmp(yypcb->pcb_jmpbuf, EDT_NOMEM); - (void) snprintf(sdp->dtsd_strdata, n, "%s`%ld", dmp->dm_name, - dret->dn_type); +/* + * The print() action behaves identically to trace(), except that it stores the + * CTF type of the argument (if present) within the DOF for the DIFEXPR action. + * To do this, we set the 'dtsd_strdata' to point to the fully-qualified CTF + * type ID for the result of the DIF action. We use the ID instead of the name + * to handles complex types like arrays and function pointers that can't be + * resolved by ctf_type_lookup(). This is later processed by + * dtrace_dof_create() and turned into a reference into the string table so + * that we can get the type information when we process the data after the + * fact. + */ +static void +dt_action_print(dtrace_hdl_t *dtp, dt_node_t *dnp, dtrace_stmtdesc_t *sdp) +{ + dtrace_actdesc_t *ap = dt_stmt_action(dtp, sdp); + dt_node_t *dret; + size_t len; + dt_module_t *dmp; + + if (dt_node_is_void(dnp->dn_args)) { + dnerror(dnp->dn_args, D_PRINT_VOID, + "print( ) may not be applied to a void expression\n"); } + if (dt_node_is_dynamic(dnp->dn_args)) { + dnerror(dnp->dn_args, D_PRINT_DYN, + "print( ) may not be applied to a dynamic expression\n"); + } + + dt_cg(yypcb, dnp->dn_args); + + dret = yypcb->pcb_dret; + dmp = dt_module_lookup_by_ctf(dtp, dret->dn_ctfp); + + len = snprintf(NULL, 0, "%s`%ld", dmp->dm_name, dret->dn_type) + 1; + sdp->dtsd_strdata = dt_alloc(dtp, len); + if (sdp->dtsd_strdata == NULL) + longjmp(yypcb->pcb_jmpbuf, EDT_NOMEM); + (void) snprintf(sdp->dtsd_strdata, len, "%s`%ld", dmp->dm_name, + dret->dn_type); + ap->dtad_difo = dt_as(yypcb); ap->dtad_kind = DTRACEACT_DIFEXPR; } @@ -1136,9 +1151,6 @@ dt_compile_fun(dtrace_hdl_t *dtp, dt_nod case DT_ACT_PANIC: dt_action_panic(dtp, dnp->dn_expr, sdp); break; - case DT_ACT_PRINT: - dt_action_trace(dtp, dnp->dn_expr, sdp); - break; case DT_ACT_PRINTA: dt_action_printa(dtp, dnp->dn_expr, sdp); break; @@ -1175,6 +1187,9 @@ dt_compile_fun(dtrace_hdl_t *dtp, dt_nod case DT_ACT_TRACE: dt_action_trace(dtp, dnp->dn_expr, sdp); break; + case DT_ACT_PRINT: + dt_action_print(dtp, dnp->dn_expr, sdp); + break; case DT_ACT_TRACEMEM: dt_action_tracemem(dtp, dnp->dn_expr, sdp); break; @@ -2550,8 +2565,7 @@ dt_compile(dtrace_hdl_t *dtp, int contex } out: - if (context != DT_CTX_DTYPE && yypcb->pcb_root != NULL && - DT_TREEDUMP_PASS(dtp, 3)) + if (context != DT_CTX_DTYPE && DT_TREEDUMP_PASS(dtp, 3)) dt_node_printr(yypcb->pcb_root, stderr, 0); if (dtp->dt_cdefs_fd != -1 && (ftruncate64(dtp->dt_cdefs_fd, 0) == -1 || Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cg.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cg.c Wed Apr 17 02:03:12 2013 (r249572) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cg.c Wed Apr 17 02:20:17 2013 (r249573) @@ -19,15 +19,12 @@ * * CDDL HEADER END */ - /* * Copyright 2005 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ -/* - * Copyright (c) 2012 by Delphix. All rights reserved. - */ +#pragma ident "%Z%%M% %I% %E% SMI" #include #include @@ -196,6 +193,9 @@ dt_cg_ptrsize(dt_node_t *dnp, dt_irlist_ ssize_t size; int sreg; + if ((sreg = dt_regset_alloc(drp)) == -1) + longjmp(yypcb->pcb_jmpbuf, EDT_NOREG); + type = ctf_type_resolve(ctfp, dnp->dn_type); kind = ctf_type_kind(ctfp, type); assert(kind == CTF_K_POINTER || kind == CTF_K_ARRAY); @@ -212,7 +212,6 @@ dt_cg_ptrsize(dt_node_t *dnp, dt_irlist_ if ((size = ctf_type_size(ctfp, type)) == 1) return; /* multiply or divide by one can be omitted */ - sreg = dt_regset_alloc(drp); dt_cg_setx(dlp, sreg, size); instr = DIF_INSTR_FMT(op, dreg, sreg, dreg); dt_irlist_append(dlp, dt_cg_node_alloc(DT_LBL_NONE, instr)); @@ -252,7 +251,9 @@ dt_cg_field_get(dt_node_t *dnp, dt_irlis assert(dnp->dn_op == DT_TOK_PTR || dnp->dn_op == DT_TOK_DOT); r1 = dnp->dn_left->dn_reg; - r2 = dt_regset_alloc(drp); + + if ((r2 = dt_regset_alloc(drp)) == -1) + longjmp(yypcb->pcb_jmpbuf, EDT_NOREG); /* * On little-endian architectures, ctm_offset counts from the right so @@ -355,9 +356,10 @@ dt_cg_field_set(dt_node_t *src, dt_irlis "bits %u\n", m.ctm_offset, m.ctm_type, e.cte_bits); } - r1 = dt_regset_alloc(drp); - r2 = dt_regset_alloc(drp); - r3 = dt_regset_alloc(drp); + if ((r1 = dt_regset_alloc(drp)) == -1 || + (r2 = dt_regset_alloc(drp)) == -1 || + (r3 = dt_regset_alloc(drp)) == -1) + longjmp(yypcb->pcb_jmpbuf, EDT_NOREG); /* * Compute shifts and masks. We need to compute "shift" as the amount @@ -421,7 +423,8 @@ dt_cg_store(dt_node_t *src, dt_irlist_t size = dt_node_type_size(src); if (src->dn_flags & DT_NF_REF) { - reg = dt_regset_alloc(drp); + if ((reg = dt_regset_alloc(drp)) == -1) + longjmp(yypcb->pcb_jmpbuf, EDT_NOREG); dt_cg_setx(dlp, reg, size); instr = DIF_INSTR_COPYS(src->dn_reg, reg, dst->dn_reg); dt_irlist_append(dlp, dt_cg_node_alloc(DT_LBL_NONE, instr)); @@ -471,58 +474,30 @@ dt_cg_typecast(const dt_node_t *src, con size_t dstsize = dt_node_type_size(dst); dif_instr_t instr; - int rg; - - if (!dt_node_is_scalar(dst)) - return; /* not a scalar */ - if (dstsize == srcsize && - ((src->dn_flags ^ dst->dn_flags) & DT_NF_SIGNED) != 0) - return; /* not narrowing or changing signed-ness */ - if (dstsize > srcsize && (src->dn_flags & DT_NF_SIGNED) == 0) - return; /* nothing to do in this case */ - - rg = dt_regset_alloc(drp); - - if (dstsize > srcsize) { - int n = sizeof (uint64_t) * NBBY - srcsize * NBBY; - int s = (dstsize - srcsize) * NBBY; - - dt_cg_setx(dlp, rg, n); + int reg, n; - instr = DIF_INSTR_FMT(DIF_OP_SLL, src->dn_reg, rg, dst->dn_reg); - dt_irlist_append(dlp, dt_cg_node_alloc(DT_LBL_NONE, instr)); + if (dt_node_is_scalar(dst) && (dstsize < srcsize || + (src->dn_flags & DT_NF_SIGNED) ^ (dst->dn_flags & DT_NF_SIGNED))) { + if ((reg = dt_regset_alloc(drp)) == -1) + longjmp(yypcb->pcb_jmpbuf, EDT_NOREG); - if ((dst->dn_flags & DT_NF_SIGNED) || n == s) { - instr = DIF_INSTR_FMT(DIF_OP_SRA, - dst->dn_reg, rg, dst->dn_reg); - dt_irlist_append(dlp, - dt_cg_node_alloc(DT_LBL_NONE, instr)); - } else { - dt_cg_setx(dlp, rg, s); - instr = DIF_INSTR_FMT(DIF_OP_SRA, - dst->dn_reg, rg, dst->dn_reg); - dt_irlist_append(dlp, - dt_cg_node_alloc(DT_LBL_NONE, instr)); - dt_cg_setx(dlp, rg, n - s); - instr = DIF_INSTR_FMT(DIF_OP_SRL, - dst->dn_reg, rg, dst->dn_reg); - dt_irlist_append(dlp, - dt_cg_node_alloc(DT_LBL_NONE, instr)); - } - } else if (dstsize != sizeof (uint64_t)) { - int n = sizeof (uint64_t) * NBBY - dstsize * NBBY; + if (dstsize < srcsize) + n = sizeof (uint64_t) * NBBY - dstsize * NBBY; + else + n = sizeof (uint64_t) * NBBY - srcsize * NBBY; - dt_cg_setx(dlp, rg, n); + dt_cg_setx(dlp, reg, n); - instr = DIF_INSTR_FMT(DIF_OP_SLL, src->dn_reg, rg, dst->dn_reg); + instr = DIF_INSTR_FMT(DIF_OP_SLL, + src->dn_reg, reg, dst->dn_reg); dt_irlist_append(dlp, dt_cg_node_alloc(DT_LBL_NONE, instr)); instr = DIF_INSTR_FMT((dst->dn_flags & DT_NF_SIGNED) ? - DIF_OP_SRA : DIF_OP_SRL, dst->dn_reg, rg, dst->dn_reg); + DIF_OP_SRA : DIF_OP_SRL, dst->dn_reg, reg, dst->dn_reg); + dt_irlist_append(dlp, dt_cg_node_alloc(DT_LBL_NONE, instr)); + dt_regset_free(drp, reg); } - - dt_regset_free(drp, rg); } /* @@ -548,7 +523,8 @@ dt_cg_arglist(dt_ident_t *idp, dt_node_t for (dnp = args; dnp != NULL; dnp = dnp->dn_list) dt_cg_node(dnp, dlp, drp); - dt_irlist_append(dlp, dt_cg_node_alloc(DT_LBL_NONE, DIF_INSTR_FLUSHTS)); + dt_irlist_append(dlp, + dt_cg_node_alloc(DT_LBL_NONE, DIF_INSTR_FLUSHTS)); for (dnp = args; dnp != NULL; dnp = dnp->dn_list, i++) { dtrace_diftype_t t; @@ -562,18 +538,17 @@ dt_cg_arglist(dt_ident_t *idp, dt_node_t dt_cg_typecast(dnp, &isp->dis_args[i], dlp, drp); isp->dis_args[i].dn_reg = -1; - if (t.dtdt_flags & DIF_TF_BYREF) { + if (t.dtdt_flags & DIF_TF_BYREF) op = DIF_OP_PUSHTR; - if (t.dtdt_size != 0) { - reg = dt_regset_alloc(drp); - dt_cg_setx(dlp, reg, t.dtdt_size); - } else { - reg = DIF_REG_R0; - } - } else { + else op = DIF_OP_PUSHTV; + + if (t.dtdt_size != 0) { + if ((reg = dt_regset_alloc(drp)) == -1) + longjmp(yypcb->pcb_jmpbuf, EDT_NOREG); + dt_cg_setx(dlp, reg, t.dtdt_size); + } else reg = DIF_REG_R0; - } instr = DIF_INSTR_PUSHTS(op, t.dtdt_kind, reg, dnp->dn_reg); dt_irlist_append(dlp, dt_cg_node_alloc(DT_LBL_NONE, instr)); @@ -654,7 +629,9 @@ dt_cg_prearith_op(dt_node_t *dnp, dt_irl dt_cg_node(dnp->dn_child, dlp, drp); dnp->dn_reg = dnp->dn_child->dn_reg; - reg = dt_regset_alloc(drp); + if ((reg = dt_regset_alloc(drp)) == -1) + longjmp(yypcb->pcb_jmpbuf, EDT_NOREG); + dt_cg_setx(dlp, reg, size); instr = DIF_INSTR_FMT(op, dnp->dn_reg, reg, dnp->dn_reg); @@ -711,7 +688,9 @@ dt_cg_postarith_op(dt_node_t *dnp, dt_ir dt_cg_node(dnp->dn_child, dlp, drp); dnp->dn_reg = dnp->dn_child->dn_reg; - nreg = dt_regset_alloc(drp); + if ((nreg = dt_regset_alloc(drp)) == -1) + longjmp(yypcb->pcb_jmpbuf, EDT_NOREG); + dt_cg_setx(dlp, nreg, size); instr = DIF_INSTR_FMT(op, dnp->dn_reg, nreg, nreg); dt_irlist_append(dlp, dt_cg_node_alloc(DT_LBL_NONE, instr)); @@ -1029,7 +1008,9 @@ dt_cg_asgn_op(dt_node_t *dnp, dt_irlist_ * set it to the size of our data structure, and then replace * it with the result of an allocs of the specified size. */ - r1 = dt_regset_alloc(drp); + if ((r1 = dt_regset_alloc(drp)) == -1) + longjmp(yypcb->pcb_jmpbuf, EDT_NOREG); + dt_cg_setx(dlp, r1, ctf_type_size(dxp->dx_dst_ctfp, dxp->dx_dst_base)); @@ -1073,7 +1054,8 @@ dt_cg_asgn_op(dt_node_t *dnp, dt_irlist_ * and add r1 to it before storing the result. */ if (ctm.ctm_offset != 0) { - r2 = dt_regset_alloc(drp); + if ((r2 = dt_regset_alloc(drp)) == -1) + longjmp(yypcb->pcb_jmpbuf, EDT_NOREG); /* * Add the member offset rounded down to the @@ -1160,7 +1142,8 @@ dt_cg_assoc_op(dt_node_t *dnp, dt_irlist dt_cg_arglist(dnp->dn_ident, dnp->dn_args, dlp, drp); - dnp->dn_reg = dt_regset_alloc(drp); + if ((dnp->dn_reg = dt_regset_alloc(drp)) == -1) + longjmp(yypcb->pcb_jmpbuf, EDT_NOREG); if (dnp->dn_ident->di_flags & DT_IDFLG_TLS) op = DIF_OP_LDTAA; @@ -1290,7 +1273,9 @@ dt_cg_array_op(dt_node_t *dnp, dt_irlist if ((size = dt_node_type_size(dnp)) == sizeof (uint64_t)) return; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Apr 17 02:33:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 67CB4DDA; Wed, 17 Apr 2013 02:33:57 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5AD4E3D6; Wed, 17 Apr 2013 02:33:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3H2XvAi008473; Wed, 17 Apr 2013 02:33:57 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3H2XvI3008472; Wed, 17 Apr 2013 02:33:57 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201304170233.r3H2XvI3008472@svn.freebsd.org> From: Neel Natu Date: Wed, 17 Apr 2013 02:33:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249574 - head/sys/dev/aic7xxx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2013 02:33:57 -0000 Author: neel Date: Wed Apr 17 02:33:56 2013 New Revision: 249574 URL: http://svnweb.freebsd.org/changeset/base/249574 Log: Correct misleading bootverbose output: ahc_isa_probe -> ahc_isa_identify Modified: head/sys/dev/aic7xxx/ahc_isa.c Modified: head/sys/dev/aic7xxx/ahc_isa.c ============================================================================== --- head/sys/dev/aic7xxx/ahc_isa.c Wed Apr 17 02:20:17 2013 (r249573) +++ head/sys/dev/aic7xxx/ahc_isa.c Wed Apr 17 02:33:56 2013 (r249574) @@ -98,7 +98,7 @@ ahc_isa_identify(driver_t *driver, devic RF_ACTIVE); if (regs == NULL) { if (bootverbose) - printf("ahc_isa_probe %d: ioport 0x%x " + printf("ahc_isa_identify %d: ioport 0x%x " "alloc failed\n", slot, iobase); continue; } From owner-svn-src-all@FreeBSD.ORG Wed Apr 17 02:40:11 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 12E0C80; Wed, 17 Apr 2013 02:40:11 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 02925400; Wed, 17 Apr 2013 02:40:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3H2eArX009403; Wed, 17 Apr 2013 02:40:10 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3H2e8T6009388; Wed, 17 Apr 2013 02:40:08 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201304170240.r3H2e8T6009388@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Wed, 17 Apr 2013 02:40:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249575 - in head/cddl/contrib/opensolaris: cmd/dtrace/test/tst/common/funcs cmd/dtrace/test/tst/common/pointers cmd/dtrace/test/tst/common/print cmd/dtrace/test/tst/common/safety cmd/d... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2013 02:40:11 -0000 Author: pfg Date: Wed Apr 17 02:40:07 2013 New Revision: 249575 URL: http://svnweb.freebsd.org/changeset/base/249575 Log: DTrace: Revert r249426 This change actually depends on r249367 which had to be reverted Pointy Hat: pfg Deleted: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PRINT_AGG.bad.d head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/err.D_TRACE_AGG.bad.d head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/types/tst.const.d Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.strjoin.d head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.BadAlign.d head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress2.d head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress3.d head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress4.d head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PRINT_VOID.bad.d head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PROTO_LEN.bad.d head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.copyin.d head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.BufSizeVariations2.d head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/err.D_PROTO_LEN.bad.d head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/err.D_TRACE_VOID.bad.d head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_decl.c head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_errtags.h Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.strjoin.d ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.strjoin.d Wed Apr 17 02:33:56 2013 (r249574) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.strjoin.d Wed Apr 17 02:40:07 2013 (r249575) @@ -24,9 +24,7 @@ * Use is subject to license terms. */ -/* - * Copyright (c) 2012 by Delphix. All rights reserved. - */ +#pragma ident "%Z%%M% %I% %E% SMI" #pragma D option quiet @@ -38,8 +36,3 @@ BEGIN printf("%s\n", strjoin("", "")); exit(0); } - -BEGIN -{ - exit(1); -} Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.BadAlign.d ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.BadAlign.d Wed Apr 17 02:33:56 2013 (r249574) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.BadAlign.d Wed Apr 17 02:40:07 2013 (r249575) @@ -24,9 +24,7 @@ * Use is subject to license terms. */ -/* - * Copyright (c) 2012 by Delphix. All rights reserved. - */ +#pragma ident "%Z%%M% %I% %E% SMI" /* * ASSERTION: This test reproduces the alignment error. @@ -41,10 +39,9 @@ BEGIN { - x = (int *)64; + x = (int *) 64; y = *x; trace(y); - exit(0); } ERROR Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress2.d ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress2.d Wed Apr 17 02:33:56 2013 (r249574) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress2.d Wed Apr 17 02:40:07 2013 (r249575) @@ -24,9 +24,7 @@ * Use is subject to license terms. */ -/* - * Copyright (c) 2012 by Delphix. All rights reserved. - */ +#pragma ident "%Z%%M% %I% %E% SMI" /* * ASSERTION: D pointers do not allow invalid pointer accesses. @@ -46,7 +44,6 @@ BEGIN y = (int *) (x - 3300778156056); *y = 3; trace(*y); - exit(0); } ERROR Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress3.d ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress3.d Wed Apr 17 02:33:56 2013 (r249574) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress3.d Wed Apr 17 02:40:07 2013 (r249575) @@ -24,9 +24,7 @@ * Use is subject to license terms. */ -/* - * Copyright (c) 2012 by Delphix. All rights reserved. - */ +#pragma ident "%Z%%M% %I% %E% SMI" /* * ASSERTION: D pointers do not allow invalid pointer accesses. @@ -41,10 +39,9 @@ BEGIN { - y = (int *)-33007; + y = (int *) (-33007); *y = 3; trace(*y); - exit(0); } ERROR Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress4.d ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress4.d Wed Apr 17 02:33:56 2013 (r249574) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress4.d Wed Apr 17 02:40:07 2013 (r249575) @@ -24,9 +24,7 @@ * Use is subject to license terms. */ -/* - * Copyright (c) 2012 by Delphix. All rights reserved. - */ +#pragma ident "%Z%%M% %I% %E% SMI" /* * ASSERTION: Demonstrating valid memory access. @@ -42,11 +40,10 @@ BEGIN { x = (int *)alloca(sizeof (int)); - printf("Address x: %x\n", (int)x); - y = (int *)(x - 2); + printf("Address x: %x\n", (int) x); + y = (int *) (x - 2); *y = 3; - printf("Address y: %x\tValue: %d\n", (int)y, *y); - exit(0); + printf("Address y: %x\tValue: %d\n", (int) y, *y); } ERROR Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PRINT_VOID.bad.d ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PRINT_VOID.bad.d Wed Apr 17 02:33:56 2013 (r249574) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PRINT_VOID.bad.d Wed Apr 17 02:40:07 2013 (r249575) @@ -20,15 +20,10 @@ */ /* - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2011 by Delphix. All rights reserved. */ BEGIN { print((void)`p0); } - -BEGIN -{ - exit(0); -} Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PROTO_LEN.bad.d ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PROTO_LEN.bad.d Wed Apr 17 02:33:56 2013 (r249574) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PROTO_LEN.bad.d Wed Apr 17 02:40:07 2013 (r249575) @@ -20,15 +20,10 @@ */ /* - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2011 by Delphix. All rights reserved. */ BEGIN { print(); } - -BEGIN -{ - exit(0); -} Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.copyin.d ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.copyin.d Wed Apr 17 02:33:56 2013 (r249574) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.copyin.d Wed Apr 17 02:40:07 2013 (r249575) @@ -24,9 +24,7 @@ * Use is subject to license terms. */ -/* - * Copyright (c) 2012 by Delphix. All rights reserved. - */ +#pragma ident "%Z%%M% %I% %E% SMI" /* * ASSERTION: @@ -41,7 +39,7 @@ */ -#pragma D option bufsize=32 +#pragma D option bufsize=16 #pragma D option bufpolicy=ring #pragma D option statusrate=1nsec Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.BufSizeVariations2.d ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.BufSizeVariations2.d Wed Apr 17 02:33:56 2013 (r249574) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/speculation/err.BufSizeVariations2.d Wed Apr 17 02:40:07 2013 (r249575) @@ -24,9 +24,7 @@ * Use is subject to license terms. */ -/* - * Copyright (c) 2012 by Delphix. All rights reserved. - */ +#pragma ident "%Z%%M% %I% %E% SMI" /* * ASSERTION: Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/err.D_PROTO_LEN.bad.d ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/err.D_PROTO_LEN.bad.d Wed Apr 17 02:33:56 2013 (r249574) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/err.D_PROTO_LEN.bad.d Wed Apr 17 02:40:07 2013 (r249575) @@ -24,9 +24,8 @@ * Use is subject to license terms. */ -/* - * Copyright (c) 2012 by Delphix. All rights reserved. - */ +#pragma ident "%Z%%M% %I% %E% SMI" + /* * ASSERTION: @@ -40,8 +39,3 @@ BEGIN trace(); } - -BEGIN -{ - exit(0); -} Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/err.D_TRACE_VOID.bad.d ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/err.D_TRACE_VOID.bad.d Wed Apr 17 02:33:56 2013 (r249574) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/trace/err.D_TRACE_VOID.bad.d Wed Apr 17 02:40:07 2013 (r249575) @@ -24,9 +24,7 @@ * Use is subject to license terms. */ -/* - * Copyright (c) 2012 by Delphix. All rights reserved. - */ +#pragma ident "%Z%%M% %I% %E% SMI" /* * ASSERTION: @@ -39,8 +37,3 @@ BEGIN { trace((void)`kmem_flags); } - -BEGIN -{ - exit(0); -} Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c Wed Apr 17 02:33:56 2013 (r249574) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c Wed Apr 17 02:40:07 2013 (r249575) @@ -675,12 +675,6 @@ dt_action_trace(dtrace_hdl_t *dtp, dt_no "trace( ) may not be applied to a dynamic expression\n"); } - if (dnp->dn_args->dn_kind == DT_NODE_AGG) { - dnerror(dnp->dn_args, istrace ? D_TRACE_AGG : D_PRINT_AGG, - "%s( ) may not be applied to an aggregation%s\n", act, - istrace ? "" : " -- did you mean printa()?"); - } - dt_cg(yypcb, dnp->dn_args); ap->dtad_difo = dt_as(yypcb); ap->dtad_kind = DTRACEACT_DIFEXPR; Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_decl.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_decl.c Wed Apr 17 02:33:56 2013 (r249574) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_decl.c Wed Apr 17 02:40:07 2013 (r249575) @@ -21,7 +21,6 @@ */ /* * Copyright 2005 Sun Microsystems, Inc. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. * Use is subject to license terms. */ @@ -255,6 +254,11 @@ dt_decl_spec(ushort_t kind, char *name) ddp->dd_kind = kind; ddp->dd_name = name; + if (name != NULL && strchr(name, '`') != NULL) { + xyerror(D_DECL_SCOPE, "D scoping operator may not be used " + "in a type name\n"); + } + return (dt_decl_check(ddp)); } Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_errtags.h ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_errtags.h Wed Apr 17 02:33:56 2013 (r249574) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_errtags.h Wed Apr 17 02:40:07 2013 (r249575) @@ -190,10 +190,8 @@ typedef enum { D_PRINTA_AGGPROTO, /* printa() aggregation mismatch */ D_TRACE_VOID, /* trace() argument has void type */ D_TRACE_DYN, /* trace() argument has dynamic type */ - D_TRACE_AGG, /* trace() argument is an aggregation */ D_PRINT_VOID, /* print() argument has void type */ D_PRINT_DYN, /* print() argument has dynamic type */ - D_PRINT_AGG, /* print() argument is an aggregation */ D_TRACEMEM_ADDR, /* tracemem() address bad type */ D_TRACEMEM_SIZE, /* tracemem() size bad type */ D_TRACEMEM_ARGS, /* tracemem() illegal number of args */ From owner-svn-src-all@FreeBSD.ORG Wed Apr 17 05:56:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CB028A06; Wed, 17 Apr 2013 05:56:59 +0000 (UTC) (envelope-from danfe@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BCD6BCB8; Wed, 17 Apr 2013 05:56:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3H5uxWc069684; Wed, 17 Apr 2013 05:56:59 GMT (envelope-from danfe@svn.freebsd.org) Received: (from danfe@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3H5ux7V069683; Wed, 17 Apr 2013 05:56:59 GMT (envelope-from danfe@svn.freebsd.org) Message-Id: <201304170556.r3H5ux7V069683@svn.freebsd.org> From: Alexey Dokuchaev Date: Wed, 17 Apr 2013 05:56:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r249576 - stable/8/sys/dev/sound/pci/hda X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2013 05:56:59 -0000 Author: danfe (ports committer) Date: Wed Apr 17 05:56:59 2013 New Revision: 249576 URL: http://svnweb.freebsd.org/changeset/base/249576 Log: MFC r247910: Plug a memory leak. Reviewed by: mav Sponsored by: Nginx, Inc. Approved by: glebius Modified: stable/8/sys/dev/sound/pci/hda/hdacc.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/sound/ (props changed) stable/8/sys/dev/sound/pci/ (props changed) Modified: stable/8/sys/dev/sound/pci/hda/hdacc.c ============================================================================== --- stable/8/sys/dev/sound/pci/hda/hdacc.c Wed Apr 17 02:40:07 2013 (r249575) +++ stable/8/sys/dev/sound/pci/hda/hdacc.c Wed Apr 17 05:56:59 2013 (r249576) @@ -460,8 +460,12 @@ hdacc_attach(device_t dev) static int hdacc_detach(device_t dev) { + struct hdacc_softc *codec = device_get_softc(dev); + int error; - return (device_delete_children(dev)); + error = device_delete_children(dev); + free(codec->fgs, M_HDACC); + return (error); } static int From owner-svn-src-all@FreeBSD.ORG Wed Apr 17 06:00:43 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 291A6BB2; Wed, 17 Apr 2013 06:00:43 +0000 (UTC) (envelope-from kientzle@freebsd.org) Received: from monday.kientzle.com (99-115-135-74.uvs.sntcca.sbcglobal.net [99.115.135.74]) by mx1.freebsd.org (Postfix) with ESMTP id EF777CE0; Wed, 17 Apr 2013 06:00:42 +0000 (UTC) Received: (from root@localhost) by monday.kientzle.com (8.14.4/8.14.4) id r3H60aUa067760; Wed, 17 Apr 2013 06:00:36 GMT (envelope-from kientzle@freebsd.org) Received: from [192.168.2.123] (CiscoE3000 [192.168.1.65]) by kientzle.com with SMTP id e345h6zqhwgn4ugxjtkrgnkwaa; Wed, 17 Apr 2013 06:00:36 +0000 (UTC) (envelope-from kientzle@freebsd.org) Subject: Re: svn commit: r249484 - head/lib Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: multipart/signed; boundary="Apple-Mail=_C5B7AA32-82D9-4A21-A2B9-8A1EF782368B"; protocol="application/pgp-signature"; micalg=pgp-sha1 From: Tim Kientzle In-Reply-To: <516D54F5.4010501@FreeBSD.org> Date: Tue, 16 Apr 2013 23:00:34 -0700 Message-Id: <2A0FC59F-E043-4B4E-BABE-E16C6A1FBF5C@freebsd.org> References: <201304141913.r3EJDqPI095965@svn.freebsd.org> <516D54F5.4010501@FreeBSD.org> To: Tijl Coosemans X-Mailer: Apple Mail (2.1283) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2013 06:00:43 -0000 --Apple-Mail=_C5B7AA32-82D9-4A21-A2B9-8A1EF782368B Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On Apr 16, 2013, at 6:41 AM, Tijl Coosemans wrote: > On 2013-04-14 21:13, Tim Kientzle wrote: >> Author: kientzle >> Date: Sun Apr 14 19:13:51 2013 >> New Revision: 249484 >> URL: http://svnweb.freebsd.org/changeset/base/249484 >>=20 >> Log: >> Install a symlink >> /usr/lib/include =3D=3D> /usr/include >>=20 >> This fixes -print-file-name=3Dinclude in clang (and is >> arguably a better way to fix the same issue in GCC than >> the change I made in r231336). >>=20 >> MFC after: 1 week >>=20 >> Modified: >> head/lib/Makefile >>=20 >> Modified: head/lib/Makefile >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/lib/Makefile Sun Apr 14 18:36:30 2013 = (r249483) >> +++ head/lib/Makefile Sun Apr 14 19:13:51 2013 = (r249484) >> @@ -252,4 +252,7 @@ _libusbhid=3D libusbhid >> _libusb=3D libusb >> .endif >>=20 >> +afterinstall: >> + ln -fs ../include ${DESTDIR}/usr/lib/include >> + >> .include >=20 > This breaks with -DNO_CLEAN defined, because then > ${DESTDIR}/usr/lib/include/include is created. That's a good point. Would this work better? afterinstall: if [ ! -e $(DESTDIR)/usr/lib/include ]; then ln -fs ../include $(DESTDIR)/usr/lib/include fi > I'm not that fond of this patch by the way, but I don't fully > understand the problem it's trying to solve so I won't object. > It just looks too much like a hack to me It's a subtle issue and I'm not surprised that it raised some eyebrows. I spent a long time looking for a better solution. In short, both GCC and Clang make some assumptions about the layout of headers used for freestanding compiles. (My earlier commit said these assumptions were "undocumented", but that's not quite true, they're just rather obscure.) This symlink is the simplest way I've found to reconcile those assumptions with the FreeBSD directory layout. I'm happy to consider alternatives. Tim --Apple-Mail=_C5B7AA32-82D9-4A21-A2B9-8A1EF782368B Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.18 (Darwin) iQEcBAEBAgAGBQJRbjqDAAoJEGMNyGo0rfFBegQIALW3pBzjml5NRyfd+pRjEePr H1xLELuQOFcNRMuNFuO1Kvky/p8QBrqqoa73GLcj15/3z1wWWv5wJQSHKp6WasbJ 8kByp2FYVb/GOaydBPGB3+ijlFh/rsUZBYIEsWg5WU2YhwdE2Oc5Y6+3jIAu2STJ yNy0uz9wN6GGlmPgf3GdTMEq00f0iOOGxflWPjJIblmDJm64YEN6pqnUVWwkJ5Wu MB77IdUNGq/bjOSeoXLtdy6kjShALuw25yAKibFL+NlAInHx0IE2Az/bGKqNM1d6 /ZW2ZFGjKFMxkFPQcMEbNB28PhlrANvrZ3G7aipYmenhRS//2IgFPJXvycwVHpc= =dgEC -----END PGP SIGNATURE----- --Apple-Mail=_C5B7AA32-82D9-4A21-A2B9-8A1EF782368B-- From owner-svn-src-all@FreeBSD.ORG Wed Apr 17 06:07:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 419D6F4A for ; Wed, 17 Apr 2013 06:07:02 +0000 (UTC) (envelope-from juli@clockworksquid.com) Received: from mail-lb0-f171.google.com (mail-lb0-f171.google.com [209.85.217.171]) by mx1.freebsd.org (Postfix) with ESMTP id C6C96D1B for ; Wed, 17 Apr 2013 06:07:01 +0000 (UTC) Received: by mail-lb0-f171.google.com with SMTP id v10so1267931lbd.30 for ; Tue, 16 Apr 2013 23:06:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=uhqQe3Scbl8WoatEqsl/fKPVLF8UQAAzO+cRhyd3L/4=; b=CahlBgqZVfS3+4PJx9jswdOaE+H660+7z6U7g6iB3mykFEFeYX4ZvvJih7i5WLgvs+ zaxI0b0t5rY2gKPnUXESX0QCDAE8NPZb9ZnR2DPPd5z+NDXm7wJ3N1g99ogvpeJOv7iu ZRBquuLq7i3FxfnWEa2Xmv1WjP9IpFibVSApkJmcu2TaQFF/1Q8HyCKcTwoJ6nSfivL9 rqRSV3uzjEUi6vkBqZ0Wu/i+1TTWAnVURxUVh5QbfWpRz2TN41JnX6RityWA1AcnAY0E o/8XhcYajA0AfwFlUoHMaPGWdqCkeZZn+AxkRM8YMzR/tswJ1BbZ7KWsazY7JXIFQoB7 CSFw== X-Received: by 10.112.61.6 with SMTP id l6mr2827815lbr.57.1366178815229; Tue, 16 Apr 2013 23:06:55 -0700 (PDT) MIME-Version: 1.0 Sender: juli@clockworksquid.com Received: by 10.152.28.196 with HTTP; Tue, 16 Apr 2013 23:06:34 -0700 (PDT) In-Reply-To: <2A0FC59F-E043-4B4E-BABE-E16C6A1FBF5C@freebsd.org> References: <201304141913.r3EJDqPI095965@svn.freebsd.org> <516D54F5.4010501@FreeBSD.org> <2A0FC59F-E043-4B4E-BABE-E16C6A1FBF5C@freebsd.org> From: Juli Mallett Date: Tue, 16 Apr 2013 23:06:34 -0700 X-Google-Sender-Auth: P2_tWqfPNmFwukTQGb9eVulKWRU Message-ID: Subject: Re: svn commit: r249484 - head/lib To: Tim Kientzle Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQnaRNgQgak6jJYpwjbtGefOjI8z5Q5/9g0g20latmGlNqZsOajM+yxho9W0wD66w/SDnJy5 Cc: svn-src-head@freebsd.org, Tijl Coosemans , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2013 06:07:02 -0000 On Tue, Apr 16, 2013 at 11:00 PM, Tim Kientzle wrote: > > On Apr 16, 2013, at 6:41 AM, Tijl Coosemans wrote: > >> On 2013-04-14 21:13, Tim Kientzle wrote: >>> Author: kientzle >>> Date: Sun Apr 14 19:13:51 2013 >>> New Revision: 249484 >>> URL: http://svnweb.freebsd.org/changeset/base/249484 >>> >>> Log: >>> Install a symlink >>> /usr/lib/include ==> /usr/include >>> >>> This fixes -print-file-name=include in clang (and is >>> arguably a better way to fix the same issue in GCC than >>> the change I made in r231336). >>> >>> MFC after: 1 week >>> >>> Modified: >>> head/lib/Makefile >>> >>> Modified: head/lib/Makefile >>> ============================================================================== >>> --- head/lib/Makefile Sun Apr 14 18:36:30 2013 (r249483) >>> +++ head/lib/Makefile Sun Apr 14 19:13:51 2013 (r249484) >>> @@ -252,4 +252,7 @@ _libusbhid= libusbhid >>> _libusb= libusb >>> .endif >>> >>> +afterinstall: >>> + ln -fs ../include ${DESTDIR}/usr/lib/include >>> + >>> .include >> >> This breaks with -DNO_CLEAN defined, because then >> ${DESTDIR}/usr/lib/include/include is created. > > That's a good point. Would this work better? > > afterinstall: > if [ ! -e $(DESTDIR)/usr/lib/include ]; then > ln -fs ../include $(DESTDIR)/usr/lib/include > fi > >> I'm not that fond of this patch by the way, but I don't fully >> understand the problem it's trying to solve so I won't object. >> It just looks too much like a hack to me > > It's a subtle issue and I'm not surprised that it raised some > eyebrows. I spent a long time looking for a better solution. > > In short, both GCC and Clang make some assumptions > about the layout of headers used for freestanding compiles. > (My earlier commit said these assumptions were "undocumented", > but that's not quite true, they're just rather obscure.) If you're doing a freestanding compile...shouldn't you also be specifying both include and library paths explicitly? I just feel more confused by this explanation. Why not just specify -I/usr/include? (Or even better, if you're doing a freestanding compile, but want the default include paths, get the compiler to dump the default include paths and process that.) /usr/lib/include is just badly and plainly wrong unless it's absolutely, absolutely necessary. > This symlink is the simplest way I've found to reconcile those > assumptions with the FreeBSD directory layout. I'm happy to > consider alternatives. > > Tim > From owner-svn-src-all@FreeBSD.ORG Wed Apr 17 06:26:17 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 2C09D398; Wed, 17 Apr 2013 06:26:17 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from monday.kientzle.com (99-115-135-74.uvs.sntcca.sbcglobal.net [99.115.135.74]) by mx1.freebsd.org (Postfix) with ESMTP id F087BDCF; Wed, 17 Apr 2013 06:26:16 +0000 (UTC) Received: (from root@localhost) by monday.kientzle.com (8.14.4/8.14.4) id r3H6QGWi067875; Wed, 17 Apr 2013 06:26:16 GMT (envelope-from kientzle@FreeBSD.org) Received: from [192.168.2.123] (CiscoE3000 [192.168.1.65]) by kientzle.com with SMTP id mrthxfvvujxf3k4cgie7n4y9i2; Wed, 17 Apr 2013 06:26:16 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Subject: Re: svn commit: r249484 - head/lib Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: text/plain; charset=us-ascii From: Tim Kientzle In-Reply-To: Date: Tue, 16 Apr 2013 23:26:15 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <475555FA-DF6A-42FA-990D-4224ECAEAE52@FreeBSD.org> References: <201304141913.r3EJDqPI095965@svn.freebsd.org> <516D54F5.4010501@FreeBSD.org> <2A0FC59F-E043-4B4E-BABE-E16C6A1FBF5C@freebsd.org> To: Juli Mallett X-Mailer: Apple Mail (2.1283) Cc: svn-src-head@FreeBSD.org, Tijl Coosemans , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2013 06:26:17 -0000 On Apr 16, 2013, at 11:06 PM, Juli Mallett wrote: > On Tue, Apr 16, 2013 at 11:00 PM, Tim Kientzle = wrote: >>=20 >> On Apr 16, 2013, at 6:41 AM, Tijl Coosemans wrote: >>=20 >>> On 2013-04-14 21:13, Tim Kientzle wrote: >>>> Author: kientzle >>>> Date: Sun Apr 14 19:13:51 2013 >>>> New Revision: 249484 >>>> URL: http://svnweb.freebsd.org/changeset/base/249484 >>>>=20 >>>> Log: >>>> Install a symlink >>>> /usr/lib/include =3D=3D> /usr/include >>>>=20 >>>> This fixes -print-file-name=3Dinclude in clang (and is >>>> arguably a better way to fix the same issue in GCC than >>>> the change I made in r231336). >>>>=20 >>>> MFC after: 1 week >>>>=20 >>>> Modified: >>>> head/lib/Makefile >>>>=20 >>>> Modified: head/lib/Makefile >>>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>>> --- head/lib/Makefile Sun Apr 14 18:36:30 2013 = (r249483) >>>> +++ head/lib/Makefile Sun Apr 14 19:13:51 2013 = (r249484) >>>> @@ -252,4 +252,7 @@ _libusbhid=3D libusbhid >>>> _libusb=3D libusb >>>> .endif >>>>=20 >>>> +afterinstall: >>>> + ln -fs ../include ${DESTDIR}/usr/lib/include >>>> + >>>> .include >>>=20 >>> This breaks with -DNO_CLEAN defined, because then >>> ${DESTDIR}/usr/lib/include/include is created. >>=20 >> That's a good point. Would this work better? >>=20 >> afterinstall: >> if [ ! -e $(DESTDIR)/usr/lib/include ]; then >> ln -fs ../include $(DESTDIR)/usr/lib/include >> fi >>=20 >>> I'm not that fond of this patch by the way, but I don't fully >>> understand the problem it's trying to solve so I won't object. >>> It just looks too much like a hack to me >>=20 >> It's a subtle issue and I'm not surprised that it raised some >> eyebrows. I spent a long time looking for a better solution. >>=20 >> In short, both GCC and Clang make some assumptions >> about the layout of headers used for freestanding compiles. >> (My earlier commit said these assumptions were "undocumented", >> but that's not quite true, they're just rather obscure.) >=20 > If you're doing a freestanding compile...shouldn't you also be > specifying both include and library paths explicitly? Yes, of course. But the correct directories to use vary somewhat across platforms, so we would like to have some reasonably portable way to find the right directory to use for building on a particular system. Both gcc and clang support a -print-file-name=3Dinclude option which is supposed to print out the directory containing headers used for freestanding compiles. You can then take that path and use it as the explicit include directory path for freestanding builds. > I just feel more confused by this explanation. Why not just specify > -I/usr/include? That would be FreeBSD-specific. Not everyone lumps all header files together like we do. > (Or even better, if you're doing a freestanding > compile, but want the default include paths, get the compiler to dump > the default include paths and process that.) That's precisely what this is for. I've been working with U-Boot sources which compile on many systems and use -print-file-name=3Dinclude to identify the directory containing the basic freestanding header files. The -print-file-name=3Dinclude option works on Linux, works on MacOS, and --- with this one symlink --- can work on FreeBSD as well. I've been using it to cross-build U-Boot using the FreeBSD xdev toolchain with both GCC and Clang. Tim From owner-svn-src-all@FreeBSD.ORG Wed Apr 17 06:51:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E8A46E34; Wed, 17 Apr 2013 06:51:17 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DB95DEDF; Wed, 17 Apr 2013 06:51:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3H6pHA6087393; Wed, 17 Apr 2013 06:51:17 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3H6pHYo087392; Wed, 17 Apr 2013 06:51:17 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201304170651.r3H6pHYo087392@svn.freebsd.org> From: Rui Paulo Date: Wed, 17 Apr 2013 06:51:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249577 - head/sys/amd64/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2013 06:51:18 -0000 Author: rpaulo Date: Wed Apr 17 06:51:17 2013 New Revision: 249577 URL: http://svnweb.freebsd.org/changeset/base/249577 Log: Print more bits from the standard extended features CPUID which will be available in the Haswell architecture (c.f. Intel Document #319433-012A). Modified: head/sys/amd64/amd64/identcpu.c Modified: head/sys/amd64/amd64/identcpu.c ============================================================================== --- head/sys/amd64/amd64/identcpu.c Wed Apr 17 05:56:59 2013 (r249576) +++ head/sys/amd64/amd64/identcpu.c Wed Apr 17 06:51:17 2013 (r249577) @@ -388,11 +388,24 @@ printcpuinfo(void) printf("\n Standard Extended Features=0x%b", cpu_stdext_feature, "\020" + /* RDFSBASE/RDGSBASE/WRFSBASE/WRGSBASE */ "\001GSFSBASE" "\002TSCADJ" + /* Bit Manipulation Instructions */ + "\004BMI1" + /* Hardware Lock Elision */ + "\005HLE" + /* Advanced Vector Instructions 2 */ + "\006AVX2" + /* Supervisor Mode Execution Prot. */ "\010SMEP" + /* Bit Manipulation Instructions */ + "\011BMI2" "\012ENHMOVSB" + /* Invalidate Processor Context ID */ "\013INVPCID" + /* Restricted Transactional Memory */ + "\014RTM" ); } From owner-svn-src-all@FreeBSD.ORG Wed Apr 17 07:12:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 75FE3880 for ; Wed, 17 Apr 2013 07:12:32 +0000 (UTC) (envelope-from juli@clockworksquid.com) Received: from mail-la0-x22f.google.com (mail-la0-x22f.google.com [IPv6:2a00:1450:4010:c03::22f]) by mx1.freebsd.org (Postfix) with ESMTP id 05AA9FCD for ; Wed, 17 Apr 2013 07:12:31 +0000 (UTC) Received: by mail-la0-f47.google.com with SMTP id fk20so932971lab.20 for ; Wed, 17 Apr 2013 00:12:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=pCCpcaet8DJKgGEyxJNMRmvcu07Izj+cO0TIUHOljPM=; b=Elu9w90VUhvH91V369lqJSoZ3R3hLseqakqgG8wkrS6bAA/2VTVgW5ueBOtwRw2KpW qo32E4ejUREFT6s5xjugkMqpYFKderBdWm/8M7XczIMskXVilg89p1SAfjseYeCz2FAy aZG/r3NLVLJmzzTA4x2qTnGCkgN1HmNdiTh05ZJwuPvHT+Oy0qtJOO+Oet5qOtk1WJ8N /JjqrHlCaMo9D77KQSRS7g3lRtd/n2W3V9voyz2n2zjfsF4zuJeJ/JGqkHzrHR8C1Xf4 LjG1FzHma31FFoPpJJ5svREC+dK7ry+PORSGwOj3siYULgD4sM4xW9DAlVROec5NptbU TI+w== X-Received: by 10.112.61.6 with SMTP id l6mr2931088lbr.57.1366182750843; Wed, 17 Apr 2013 00:12:30 -0700 (PDT) MIME-Version: 1.0 Sender: juli@clockworksquid.com Received: by 10.152.28.196 with HTTP; Wed, 17 Apr 2013 00:12:09 -0700 (PDT) In-Reply-To: <475555FA-DF6A-42FA-990D-4224ECAEAE52@FreeBSD.org> References: <201304141913.r3EJDqPI095965@svn.freebsd.org> <516D54F5.4010501@FreeBSD.org> <2A0FC59F-E043-4B4E-BABE-E16C6A1FBF5C@freebsd.org> <475555FA-DF6A-42FA-990D-4224ECAEAE52@FreeBSD.org> From: Juli Mallett Date: Wed, 17 Apr 2013 00:12:09 -0700 X-Google-Sender-Auth: KmWgIraiG5fMn9H-95_DiqmEZNI Message-ID: Subject: Re: svn commit: r249484 - head/lib To: Tim Kientzle Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQme6t0PlS3YhrnmlGdT8qinOiBucI68P4spqysmw8iUTmQ+oFVIKhKHUXCIDc1zGzvOUEXv Cc: svn-src-head@freebsd.org, Tijl Coosemans , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2013 07:12:32 -0000 On Tue, Apr 16, 2013 at 11:26 PM, Tim Kientzle wrote: > > On Apr 16, 2013, at 11:06 PM, Juli Mallett wrote: >> If you're doing a freestanding compile...shouldn't you also be >> specifying both include and library paths explicitly? > > Yes, of course. But the correct directories to use vary somewhat > across platforms, so we would like to have some reasonably > portable way to find the right directory to use for building on > a particular system. > > Both gcc and clang support a -print-file-name=include option which > is supposed to print out the directory containing headers used > for freestanding compiles. You can then take that path and > use it as the explicit include directory path for freestanding builds. Right... >> (Or even better, if you're doing a freestanding >> compile, but want the default include paths, get the compiler to dump >> the default include paths and process that.) > > That's precisely what this is for. I've been working with U-Boot > sources which compile on many systems and use > -print-file-name=include to identify the directory containing > the basic freestanding header files. > > The -print-file-name=include option works on Linux, works > on MacOS, and --- with this one symlink --- can work on > FreeBSD as well. I've been using it to cross-build U-Boot > using the FreeBSD xdev toolchain with both GCC and Clang. I'm confused as to how it wasn't working, and am not convinced that it shouldn't be fixed otherwise. It seems like for clang the user ought to get /usr/include/clang/{version}, except for the problem that we don't put some headers there that some software might expect; so maybe we should just install copies of things like stddef.h into the compiler-specific directory as well? I'm not sure I'm fully understanding your needs, or what you're seeing in practice. Certainly none of those systems have a /usr/lib/include AFAIK; this seems like we're just not deploying our compilers configured in the way that some software (perhaps rightly) expects. And -print-file-name=include doesn't give you the full search path; shouldn't it just give the compiler-specific include directory? You really want something like: % clang -E -Xpreprocessor -v -x c /dev/null For C, and -x c++ for C++. What are the headers you are expecting to find? stddef.h, stdbool.h, stdarg.h? I think I'd rather just see those installed in the compiler-specific dirs, and if we're not spitting those out with our stock-built compilers, we should fix that to match behaviour on other systems. Other systems' -print-file-name=include doesn't expose all of /usr/include, as far as I can tell. That seem excessive and wrong for a freestanding build. From owner-svn-src-all@FreeBSD.ORG Wed Apr 17 07:21:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7F8ECB13; Wed, 17 Apr 2013 07:21:31 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6231E9A; Wed, 17 Apr 2013 07:21:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3H7LVm4096700; Wed, 17 Apr 2013 07:21:31 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3H7LVYU096698; Wed, 17 Apr 2013 07:21:31 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201304170721.r3H7LVYU096698@svn.freebsd.org> From: Adrian Chadd Date: Wed, 17 Apr 2013 07:21:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249578 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2013 07:21:31 -0000 Author: adrian Date: Wed Apr 17 07:21:30 2013 New Revision: 249578 URL: http://svnweb.freebsd.org/changeset/base/249578 Log: Update the rate series setup code to use the decisions already made in ath_tx_rate_fill_rcflags(). Include setting up the TX power cap in the rate scenario setup code being passed to the HAL. Other things: * add a tx power cap field in ath_rc. * Add a three-stream flag in ath_rc. * Delete the LDPC flag from ath_rc - it's not a per-rate flag, it's a global flag for the transmission. Modified: head/sys/dev/ath/if_ath_tx_ht.c head/sys/dev/ath/if_athrate.h Modified: head/sys/dev/ath/if_ath_tx_ht.c ============================================================================== --- head/sys/dev/ath/if_ath_tx_ht.c Wed Apr 17 06:51:17 2013 (r249577) +++ head/sys/dev/ath/if_ath_tx_ht.c Wed Apr 17 07:21:30 2013 (r249578) @@ -280,10 +280,26 @@ ath_tx_rate_fill_rcflags(struct ath_soft rc[i].flags |= ATH_RC_STBC_FLAG; } - /* XXX dual stream? and 3-stream? */ + /* + * XXX TODO: LDPC + */ + + /* + * Dual / Triple stream rate? + */ + if (HT_RC_2_STREAMS(rate) == 2) + rc[i].flags |= ATH_RC_DS_FLAG; + else if (HT_RC_2_STREAMS(rate) == 3) + rc[i].flags |= ATH_RC_TS_FLAG; } /* + * Calculate the maximum TX power cap for the current + * node. + */ + rc[i].tx_power_cap = ieee80211_get_node_txpower(ni); + + /* * Calculate the maximum 4ms frame length based * on the MCS rate, SGI and channel width flags. */ @@ -470,11 +486,10 @@ ath_get_aggr_limit(struct ath_softc *sc, * * This should be called for both legacy and MCS rates. * + * This uses the rate series stuf from ath_tx_rate_fill_rcflags(). + * * It, along with ath_buf_set_rate, must be called -after- a burst * or aggregate is setup. - * - * XXX TODO: it should use the rate series information from the - * ath_buf, rather than recalculating it here! */ static void ath_rateseries_setup(struct ath_softc *sc, struct ieee80211_node *ni, @@ -486,7 +501,6 @@ ath_rateseries_setup(struct ath_softc *s const HAL_RATE_TABLE *rt = sc->sc_currates; int i; int pktlen; - int flags = bf->bf_state.bfs_txflags; struct ath_rc_series *rc = bf->bf_state.bfs_rc; if ((ic->ic_flags & IEEE80211_F_SHPREAMBLE) && @@ -528,63 +542,33 @@ ath_rateseries_setup(struct ath_softc *s */ series[i].Rate = rt->info[rc[i].rix].rateCode; series[i].RateIndex = rc[i].rix; - series[i].tx_power_cap = 0x3f; /* XXX for now */ + series[i].tx_power_cap = rc[i].tx_power_cap; /* * Enable RTS/CTS as appropriate. */ - if (flags & (HAL_TXDESC_RTSENA | HAL_TXDESC_CTSENA)) + if (rc[i].flags & ATH_RC_RTSCTS_FLAG) series[i].RateFlags |= HAL_RATESERIES_RTS_CTS; - - if (IS_HT_RATE(rt->info[rc[i].rix].rateCode)) { - /* - * Transmit 40MHz frames only if the node has negotiated - * it rather than whether the node is capable of it or not. - * It's subtly different in the hostap case. - */ - if (ni->ni_chw == 40) + /* + * 11n rate? Update 11n flags. + */ + if (rc[i].flags & ATH_RC_HT_FLAG) { + if (rc[i].flags & ATH_RC_CW40_FLAG) series[i].RateFlags |= HAL_RATESERIES_2040; - /* - * Set short-GI only if the node has advertised it - * the channel width is suitable, and we support it. - * We don't currently have a "negotiated" set of bits - - * ni_htcap is what the remote end sends, not what this - * node is capable of. - */ - if (ni->ni_chw == 40 && - ic->ic_htcaps & IEEE80211_HTCAP_SHORTGI40 && - ni->ni_htcap & IEEE80211_HTCAP_SHORTGI40) - series[i].RateFlags |= HAL_RATESERIES_HALFGI; - - if (ni->ni_chw == 20 && - ic->ic_htcaps & IEEE80211_HTCAP_SHORTGI20 && - ni->ni_htcap & IEEE80211_HTCAP_SHORTGI20) + if (rc[i].flags & ATH_RC_SGI_FLAG) series[i].RateFlags |= HAL_RATESERIES_HALFGI; - /* - * If we have STBC TX enabled and the receiver - * can receive (at least) 1 stream STBC, AND it's - * MCS 0-7, AND we have at least two chains enabled, - * enable STBC. - */ - if (ic->ic_htcaps & IEEE80211_HTCAP_TXSTBC && - ni->ni_htcap & IEEE80211_HTCAP_RXSTBC_1STREAM && - (sc->sc_cur_txchainmask > 1) && - HT_RC_2_STREAMS(series[i].Rate) == 1) { + if (rc[i].flags & ATH_RC_STBC_FLAG) series[i].RateFlags |= HAL_RATESERIES_STBC; - } - /* - * XXX TODO: LDPC if it's possible - */ } /* * PktDuration doesn't include slot, ACK, RTS, etc timing - * it's just the packet duration */ - if (series[i].Rate & IEEE80211_RATE_MCS) { + if (rc[i].flags & ATH_RC_HT_FLAG) { series[i].PktDuration = ath_computedur_ht(pktlen , series[i].Rate Modified: head/sys/dev/ath/if_athrate.h ============================================================================== --- head/sys/dev/ath/if_athrate.h Wed Apr 17 06:51:17 2013 (r249577) +++ head/sys/dev/ath/if_athrate.h Wed Apr 17 07:21:30 2013 (r249578) @@ -85,14 +85,15 @@ void ath_rate_detach(struct ath_ratectrl #define ATH_RC_HT_FLAG 0x08 /* use HT */ #define ATH_RC_RTSCTS_FLAG 0x10 /* enable RTS/CTS protection */ #define ATH_RC_STBC_FLAG 0x20 /* enable STBC */ -#define ATH_RC_LDPC_FLAG 0x40 /* enable STBC */ +#define ATH_RC_TS_FLAG 0x40 /* triple-stream rate */ struct ath_rc_series { uint8_t rix; /* ratetable index, not rate code */ uint8_t ratecode; /* hardware rate code */ uint8_t tries; - uint8_t flags; - uint32_t max4msframelen; + uint8_t tx_power_cap; + uint16_t flags; + uint16_t max4msframelen; }; /* From owner-svn-src-all@FreeBSD.ORG Wed Apr 17 07:22:23 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9C737C9B; Wed, 17 Apr 2013 07:22:23 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8F308AC; Wed, 17 Apr 2013 07:22:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3H7MNNj096898; Wed, 17 Apr 2013 07:22:23 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3H7MNEa096897; Wed, 17 Apr 2013 07:22:23 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201304170722.r3H7MNEa096897@svn.freebsd.org> From: Adrian Chadd Date: Wed, 17 Apr 2013 07:22:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249579 - head/sys/dev/ath/ath_hal/ar9001 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2013 07:22:23 -0000 Author: adrian Date: Wed Apr 17 07:22:23 2013 New Revision: 249579 URL: http://svnweb.freebsd.org/changeset/base/249579 Log: Use the TPC bank by default for AR9160. Tested: * AR9160, hostap, verified TX power using (2GHz) spectrum analyser TODO: * 5GHz verification! Modified: head/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c Modified: head/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c Wed Apr 17 07:21:30 2013 (r249578) +++ head/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c Wed Apr 17 07:22:23 2013 (r249579) @@ -183,7 +183,7 @@ ar9160Attach(uint16_t devid, HAL_SOFTC s HAL_INI_INIT(&AH5416(ah)->ah_ini_bank1, ar9160Bank1, 2); HAL_INI_INIT(&AH5416(ah)->ah_ini_bank2, ar9160Bank2, 2); HAL_INI_INIT(&AH5416(ah)->ah_ini_bank3, ar9160Bank3, 3); - HAL_INI_INIT(&AH5416(ah)->ah_ini_bank6, ar9160Bank6, 3); + HAL_INI_INIT(&AH5416(ah)->ah_ini_bank6, ar9160Bank6TPC, 3); HAL_INI_INIT(&AH5416(ah)->ah_ini_bank7, ar9160Bank7, 2); if (AR_SREV_SOWL_11(ah)) HAL_INI_INIT(&AH5416(ah)->ah_ini_addac, ar9160Addac_1_1, 2); From owner-svn-src-all@FreeBSD.ORG Wed Apr 17 07:31:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 05362BF; Wed, 17 Apr 2013 07:31:55 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EBA38115; Wed, 17 Apr 2013 07:31:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3H7Vsah099894; Wed, 17 Apr 2013 07:31:54 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3H7VsmS099883; Wed, 17 Apr 2013 07:31:54 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201304170731.r3H7VsmS099883@svn.freebsd.org> From: Adrian Chadd Date: Wed, 17 Apr 2013 07:31:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249580 - in head/sys/dev/ath/ath_hal: ar5416 ar9002 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2013 07:31:55 -0000 Author: adrian Date: Wed Apr 17 07:31:53 2013 New Revision: 249580 URL: http://svnweb.freebsd.org/changeset/base/249580 Log: Setup needed tables for TPC on AR5416->AR9287 chips. * Add ah_ratesArray[] to the ar5416 HAL state - this stores the maximum values permissable per rate. * Since different chip EEPROM formats store this value in a different place, store the HT40 power detector increment value in the ar5416 HAL state. * Modify the target power setup code to store the maximum values in the ar5416 HAL state rather than using a local variable. * Add ar5416RateToRateTable() - to convert a hardware rate code to the ratesArray enum / index. * Add ar5416GetTxRatePower() - which goes through the gymnastics required to correctly calculate the target TX power: + Add the power detector increment for ht40; + Take the power offset into account for AR9280 and later; + Offset the TX power correctly when doing open-loop TX power control; + Enforce the per-rate maximum value allowable. Note - setting a TPC value of 0x0 in the TX descriptor on (at least) the AR9160 resulted in the TX power being very high indeed. This didn't happen on the AR9220. I'm guessing it's a chip bug that was fixed at some point. So for now, just assume the AR5416/AR5418 and AR9130 are also suspect and clamp the minimum value here at 1. Tested: * AR5416, AR9160, AR9220 hostap, verified using (2GHz) spectrum analyser * Looked at target TX power in TX descriptor (using athalq) as well as TX power on the spectrum analyser. TODO: * The TX descriptor code sets the target TX power to 0 for AR9285 chips. I'm not yet sure why. Disable this for TPC and ensure that the TPC TX power is set. * AR9280, AR9285, AR9227, AR9287 testing! * 5GHz testing! Quirks: * The per-packet TPC code is only exercised when the tpc sysctl is set to 1. (dev.ath.X.tpc=1.) This needs to be done before you bring the interface up. * When TPC is enabled, setting the TX power doesn't end up with a call through to the HAL to update the maximum TX power. So ensure that you set the TPC sysctl before you bring the interface up and configure a lower TX power or the hardware will be clamped by the lower TX power (at least until the next channel change.) Thanks to Qualcomm Atheros for all the hardware, and Sam Leffler for use of his spectrum analyser to verify the TX channel power. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416.h head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c head/sys/dev/ath/ath_hal/ar9002/ar9285_reset.c head/sys/dev/ath/ath_hal/ar9002/ar9287_reset.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416.h Wed Apr 17 07:22:23 2013 (r249579) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416.h Wed Apr 17 07:31:53 2013 (r249580) @@ -132,7 +132,12 @@ struct ath_hal_5416 { struct ar5416NfLimits nf_2g; struct ar5416NfLimits nf_5g; + /* + * TX power configuration related structures + */ int initPDADC; + int ah_ht40PowerIncForPdadc; + int16_t ah_ratesArray[Ar5416RateSize]; int ah_need_an_top2_fixup; /* merlin or later chips that may need this workaround */ Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Wed Apr 17 07:22:23 2013 (r249579) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Wed Apr 17 07:31:53 2013 (r249580) @@ -1005,6 +1005,14 @@ ar5416WriteTxPowerRateRegisters(struct a | POW_SM(ratesArray[rateDupCck], 0) ); } + + /* + * Set max power to 30 dBm and, optionally, + * enable TPC in tx descriptors. + */ + OS_REG_WRITE(ah, AR_PHY_POWER_TX_RATE_MAX, MAX_RATE_POWER | + (AH5212(ah)->ah_tpcEnabled ? AR_PHY_POWER_TX_RATE_MAX_TPC_ENABLE : 0)); +#undef POW_SM } @@ -1019,12 +1027,11 @@ ar5416SetTransmitPower(struct ath_hal *a const struct ieee80211_channel *chan, uint16_t *rfXpdGain) { #define N(a) (sizeof (a) / sizeof (a[0])) +#define POW_SM(_r, _s) (((_r) & 0x3f) << (_s)) MODAL_EEP_HEADER *pModal; struct ath_hal_5212 *ahp = AH5212(ah); - int16_t ratesArray[Ar5416RateSize]; int16_t txPowerIndexOffset = 0; - uint8_t ht40PowerIncForPdadc = 2; int i; uint16_t cfgCtl; @@ -1037,8 +1044,13 @@ ar5416SetTransmitPower(struct ath_hal *a HALASSERT(AH_PRIVATE(ah)->ah_eeversion >= AR_EEPROM_VER14_1); + /* + * Default to 2, is overridden based on the EEPROM version / value. + */ + AH5416(ah)->ah_ht40PowerIncForPdadc = 2; + /* Setup info for the actual eeprom */ - OS_MEMZERO(ratesArray, sizeof(ratesArray)); + OS_MEMZERO(AH5416(ah)->ah_ratesArray, sizeof(AH5416(ah)->ah_ratesArray)); cfgCtl = ath_hal_getctl(ah, chan); powerLimit = chan->ic_maxregpower * 2; twiceAntennaReduction = chan->ic_maxantgain; @@ -1048,11 +1060,12 @@ ar5416SetTransmitPower(struct ath_hal *a __func__,chan->ic_freq, cfgCtl ); if (IS_EEP_MINOR_V2(ah)) { - ht40PowerIncForPdadc = pModal->ht40PowerIncForPdadc; + AH5416(ah)->ah_ht40PowerIncForPdadc = pModal->ht40PowerIncForPdadc; } if (!ar5416SetPowerPerRateTable(ah, pEepData, chan, - &ratesArray[0],cfgCtl, + &AH5416(ah)->ah_ratesArray[0], + cfgCtl, twiceAntennaReduction, twiceMaxRegulatoryPower, powerLimit)) { HALDEBUG(ah, HAL_DEBUG_ANY, @@ -1066,14 +1079,15 @@ ar5416SetTransmitPower(struct ath_hal *a return AH_FALSE; } - maxPower = AH_MAX(ratesArray[rate6mb], ratesArray[rateHt20_0]); + maxPower = AH_MAX(AH5416(ah)->ah_ratesArray[rate6mb], + AH5416(ah)->ah_ratesArray[rateHt20_0]); if (IEEE80211_IS_CHAN_2GHZ(chan)) { - maxPower = AH_MAX(maxPower, ratesArray[rate1l]); + maxPower = AH_MAX(maxPower, AH5416(ah)->ah_ratesArray[rate1l]); } if (IEEE80211_IS_CHAN_HT40(chan)) { - maxPower = AH_MAX(maxPower, ratesArray[rateHt40_0]); + maxPower = AH_MAX(maxPower, AH5416(ah)->ah_ratesArray[rateHt40_0]); } ahp->ah_tx6PowerInHalfDbm = maxPower; @@ -1084,10 +1098,11 @@ ar5416SetTransmitPower(struct ath_hal *a * txPowerIndexOffset is set by the SetPowerTable() call - * adjust the rate table (0 offset if rates EEPROM not loaded) */ - for (i = 0; i < N(ratesArray); i++) { - ratesArray[i] = (int16_t)(txPowerIndexOffset + ratesArray[i]); - if (ratesArray[i] > AR5416_MAX_RATE_POWER) - ratesArray[i] = AR5416_MAX_RATE_POWER; + for (i = 0; i < N(AH5416(ah)->ah_ratesArray); i++) { + AH5416(ah)->ah_ratesArray[i] = + (int16_t)(txPowerIndexOffset + AH5416(ah)->ah_ratesArray[i]); + if (AH5416(ah)->ah_ratesArray[i] > AR5416_MAX_RATE_POWER) + AH5416(ah)->ah_ratesArray[i] = AR5416_MAX_RATE_POWER; } #ifdef AH_EEPROM_DUMP @@ -1098,7 +1113,7 @@ ar5416SetTransmitPower(struct ath_hal *a * this debugging; the values won't necessarily be what's being * programmed into the hardware. */ - ar5416PrintPowerPerRate(ah, ratesArray); + ar5416PrintPowerPerRate(ah, AH5416(ah)->ah_ratesArray); #endif /* @@ -1114,16 +1129,16 @@ ar5416SetTransmitPower(struct ath_hal *a &pwr_table_offset); /* Underflow power gets clamped at raw value 0 */ /* Overflow power gets camped at AR5416_MAX_RATE_POWER */ - for (i = 0; i < N(ratesArray); i++) { + for (i = 0; i < N(AH5416(ah)->ah_ratesArray); i++) { /* * + pwr_table_offset is in dBm * + ratesArray is in 1/2 dBm */ - ratesArray[i] -= (pwr_table_offset * 2); - if (ratesArray[i] < 0) - ratesArray[i] = 0; - else if (ratesArray[i] > AR5416_MAX_RATE_POWER) - ratesArray[i] = AR5416_MAX_RATE_POWER; + AH5416(ah)->ah_ratesArray[i] -= (pwr_table_offset * 2); + if (AH5416(ah)->ah_ratesArray[i] < 0) + AH5416(ah)->ah_ratesArray[i] = 0; + else if (AH5416(ah)->ah_ratesArray[i] > AR5416_MAX_RATE_POWER) + AH5416(ah)->ah_ratesArray[i] = AR5416_MAX_RATE_POWER; } } @@ -1150,9 +1165,9 @@ ar5416SetTransmitPower(struct ath_hal *a int cck_ofdm_delta = 2; int i; for (i = 0; i < N(adj); i++) { - ratesArray[adj[i]] -= cck_ofdm_delta; - if (ratesArray[adj[i]] < 0) - ratesArray[adj[i]] = 0; + AH5416(ah)->ah_ratesArray[adj[i]] -= cck_ofdm_delta; + if (AH5416(ah)->ah_ratesArray[adj[i]] < 0) + AH5416(ah)->ah_ratesArray[adj[i]] = 0; } } @@ -1164,18 +1179,20 @@ ar5416SetTransmitPower(struct ath_hal *a * XXX handle overflow/too high power level? */ if (IEEE80211_IS_CHAN_HT40(chan)) { - ratesArray[rateHt40_0] += ht40PowerIncForPdadc; - ratesArray[rateHt40_1] += ht40PowerIncForPdadc; - ratesArray[rateHt40_2] += ht40PowerIncForPdadc; - ratesArray[rateHt40_3] += ht40PowerIncForPdadc; - ratesArray[rateHt40_4] += ht40PowerIncForPdadc; - ratesArray[rateHt40_5] += ht40PowerIncForPdadc; - ratesArray[rateHt40_6] += ht40PowerIncForPdadc; - ratesArray[rateHt40_7] += ht40PowerIncForPdadc; + AH5416(ah)->ah_ratesArray[rateHt40_0] += + AH5416(ah)->ah_ht40PowerIncForPdadc; + AH5416(ah)->ah_ratesArray[rateHt40_1] += + AH5416(ah)->ah_ht40PowerIncForPdadc; + AH5416(ah)->ah_ratesArray[rateHt40_2] += AH5416(ah)->ah_ht40PowerIncForPdadc; + AH5416(ah)->ah_ratesArray[rateHt40_3] += AH5416(ah)->ah_ht40PowerIncForPdadc; + AH5416(ah)->ah_ratesArray[rateHt40_4] += AH5416(ah)->ah_ht40PowerIncForPdadc; + AH5416(ah)->ah_ratesArray[rateHt40_5] += AH5416(ah)->ah_ht40PowerIncForPdadc; + AH5416(ah)->ah_ratesArray[rateHt40_6] += AH5416(ah)->ah_ht40PowerIncForPdadc; + AH5416(ah)->ah_ratesArray[rateHt40_7] += AH5416(ah)->ah_ht40PowerIncForPdadc; } /* Write the TX power rate registers */ - ar5416WriteTxPowerRateRegisters(ah, chan, ratesArray); + ar5416WriteTxPowerRateRegisters(ah, chan, AH5416(ah)->ah_ratesArray); /* Write the Power subtraction for dynamic chain changing, for per-packet powertx */ OS_REG_WRITE(ah, AR_PHY_POWER_TX_SUB, Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c Wed Apr 17 07:22:23 2013 (r249579) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c Wed Apr 17 07:31:53 2013 (r249580) @@ -155,6 +155,169 @@ ar5416StopTxDma(struct ath_hal *ah, u_in /* NB: accept HT rates */ #define isValidTxRate(_r) ((1<<((_r) & 0x7f)) & VALID_TX_RATES) +static inline int +ar5416RateToRateTable(struct ath_hal *ah, uint8_t rate, HAL_BOOL is_ht40) +{ + + /* + * Handle the non-MCS rates + */ + switch (rate) { + case /* 1 Mb */ 0x1b: + case /* 1 MbS*/ 0x1b | 0x4: + return (AH5416(ah)->ah_ratesArray[rate1l]); + case /* 2 Mb */ 0x1a: + return (AH5416(ah)->ah_ratesArray[rate2l]); + case /* 2 MbS*/ 0x1a | 0x4: + return (AH5416(ah)->ah_ratesArray[rate2s]); + case /* 5.5 Mb */ 0x19: + return (AH5416(ah)->ah_ratesArray[rate5_5l]); + case /* 5.5 MbS*/ 0x19 | 0x4: + return (AH5416(ah)->ah_ratesArray[rate5_5s]); + case /* 11 Mb */ 0x18: + return (AH5416(ah)->ah_ratesArray[rate11l]); + case /* 11 MbS*/ 0x18 | 0x4: + return (AH5416(ah)->ah_ratesArray[rate11s]); + } + + /* OFDM rates */ + switch (rate) { + case /* 6 Mb */ 0x0b: + return (AH5416(ah)->ah_ratesArray[rate6mb]); + case /* 9 Mb */ 0x0f: + return (AH5416(ah)->ah_ratesArray[rate9mb]); + case /* 12 Mb */ 0x0a: + return (AH5416(ah)->ah_ratesArray[rate12mb]); + case /* 18 Mb */ 0x0e: + return (AH5416(ah)->ah_ratesArray[rate18mb]); + case /* 24 Mb */ 0x09: + return (AH5416(ah)->ah_ratesArray[rate24mb]); + case /* 36 Mb */ 0x0d: + return (AH5416(ah)->ah_ratesArray[rate36mb]); + case /* 48 Mb */ 0x08: + return (AH5416(ah)->ah_ratesArray[rate48mb]); + case /* 54 Mb */ 0x0c: + return (AH5416(ah)->ah_ratesArray[rate54mb]); + } + + /* + * Handle HT20/HT40 - we only have to do MCS0-7; + * there's no stream differences. + */ + if ((rate & 0x80) && is_ht40) { + return (AH5416(ah)->ah_ratesArray[rateHt40_0 + (rate & 0x7)]); + } else if (rate & 0x80) { + return (AH5416(ah)->ah_ratesArray[rateHt20_0 + (rate & 0x7)]); + } + + /* XXX default (eg XR, bad bad person!) */ + return (AH5416(ah)->ah_ratesArray[rate6mb]); +} + +/* + * Return the TX power to be used for the given rate/chains/TX power. + * + * There are a bunch of tweaks to make to a given TX power based on + * the current configuration, so... + */ +static uint16_t +ar5416GetTxRatePower(struct ath_hal *ah, uint8_t rate, uint8_t tx_chainmask, + uint16_t txPower, HAL_BOOL is_ht40) +{ + int n_txpower, max_txpower; + const int cck_ofdm_delta = 2; +#define EEP_MINOR(_ah) \ + (AH_PRIVATE(_ah)->ah_eeversion & AR5416_EEP_VER_MINOR_MASK) +#define IS_EEP_MINOR_V2(_ah) (EEP_MINOR(_ah) >= AR5416_EEP_MINOR_VER_2) + + /* Take a copy ; we may underflow and thus need to clamp things */ + n_txpower = txPower; + + /* HT40? Need to adjust the TX power by this */ + if (is_ht40) + n_txpower += AH5416(ah)->ah_ht40PowerIncForPdadc; + + /* + * Merlin? Offset the target TX power offset - it defaults to + * starting at -5.0dBm, but that can change! + * + * Kiwi/Kite? Always -5.0dBm offset. + */ + if (AR_SREV_KIWI_10_OR_LATER(ah)) { + n_txpower -= (AR5416_PWR_TABLE_OFFSET_DB * 2); + } else if (AR_SREV_MERLIN_20_OR_LATER(ah)) { + int8_t pwr_table_offset = 0; + /* This is in dBm, convert to 1/2 dBm */ + (void) ath_hal_eepromGet(ah, AR_EEP_PWR_TABLE_OFFSET, + &pwr_table_offset); + n_txpower -= (pwr_table_offset * 2); + } + + /* + * If Open-loop TX power control is used, the CCK rates need + * to be offset by that. + * + * Rates: 2S, 2L, 1S, 1L, 5.5S, 5.5L + * + * XXX Odd, we don't have a PHY table entry for long preamble + * 1mbit CCK? + */ + if (AR_SREV_MERLIN_20_OR_LATER(ah) && + ath_hal_eepromGetFlag(ah, AR_EEP_OL_PWRCTRL)) { + + if (rate == 0x19 || rate == 0x1a || rate == 0x1b || + rate == (0x19 | 0x04) || rate == (0x1a | 0x04) || + rate == (0x1b | 0x04)) { + n_txpower -= cck_ofdm_delta; + } + } + + /* + * We're now offset by the same amount that the static maximum + * PHY power tables are. So, clamp the value based on that rate. + */ + max_txpower = ar5416RateToRateTable(ah, rate, is_ht40); +#if 0 + ath_hal_printf(ah, "%s: n_txpower = %d, max_txpower = %d, " + "rate = 0x%x , is_ht40 = %d\n", + __func__, + n_txpower, + max_txpower, + rate, + is_ht40); +#endif + n_txpower = MIN(max_txpower, n_txpower); + + /* + * We don't have to offset the TX power for two or three + * chain operation here - it's done by the AR_PHY_POWER_TX_SUB + * register setting via the EEPROM. + * + * So for vendors that programmed the maximum target power assuming + * that 2/3 chains are always on, things will just plain work. + * (They won't reach that target power if only one chain is on, but + * that's a different problem.) + */ + + /* Over/underflow? Adjust */ + if (n_txpower < 0) + n_txpower = 0; + else if (n_txpower > 63) + n_txpower = 63; + + /* + * For some odd reason the AR9160 with txpower=0 results in a + * much higher (max?) TX power. So, if it's a chipset before + * AR9220/AR9280, just clamp the minimum value at 1. + */ + if ((! AR_SREV_MERLIN_10_OR_LATER(ah)) && (n_txpower == 0)) + n_txpower = 1; + + return (n_txpower); +#undef EEP_MINOR +#undef IS_EEP_MINOR_V2 +} + HAL_BOOL ar5416SetupTxDesc(struct ath_hal *ah, struct ath_desc *ds, u_int pktLen, @@ -187,6 +350,16 @@ ar5416SetupTxDesc(struct ath_hal *ah, st if (txPower > 63) txPower = 63; + /* + * XXX For now, just assume that this isn't a HT40 frame. + */ + if (AH5212(ah)->ah_tpcEnabled) { + txPower = ar5416GetTxRatePower(ah, txRate0, + ahp->ah_tx_chainmask, + txPower, + AH_FALSE); + } + ads->ds_ctl0 = (pktLen & AR_FrameLen) | (txPower << AR_XmitPower_S) | (flags & HAL_TXDESC_VEOL ? AR_VEOL : 0) @@ -238,6 +411,8 @@ ar5416SetupTxDesc(struct ath_hal *ah, st * Set the TX antenna to 0 for Kite * To preserve existing behaviour, also set the TPC bits to 0; * when TPC is enabled these should be filled in appropriately. + * + * XXX TODO: when doing TPC, set the TX power up appropriately? */ if (AR_SREV_KITE(ah)) { ads->ds_ctl8 = SM(0, AR_AntCtl0); @@ -744,6 +919,48 @@ ar5416Set11nRateScenario(struct ath_hal | set11nRateFlags(series, 2) | set11nRateFlags(series, 3) | SM(rtsctsRate, AR_RTSCTSRate); + + /* + * Doing per-packet TPC - update the TX power for the first + * field; program in the other series. + */ + if (AH5212(ah)->ah_tpcEnabled) { + uint32_t ds_ctl0; + uint16_t txPower; + + /* Modify the tx power field for rate 0 */ + txPower = ar5416GetTxRatePower(ah, series[0].Rate, + series[0].ChSel, + series[0].tx_power_cap, + !! (series[0].RateFlags & HAL_RATESERIES_2040)); + ds_ctl0 = ads->ds_ctl0 & ~AR_XmitPower; + ds_ctl0 |= (txPower << AR_XmitPower_S); + ads->ds_ctl0 = ds_ctl0; + + /* + * Override the whole descriptor field for each TX power. + * + * This will need changing if we ever support antenna control + * programming. + */ + txPower = ar5416GetTxRatePower(ah, series[1].Rate, + series[1].ChSel, + series[1].tx_power_cap, + !! (series[1].RateFlags & HAL_RATESERIES_2040)); + ads->ds_ctl9 = SM(0, AR_AntCtl1) | SM(txPower, AR_XmitPower1); + + txPower = ar5416GetTxRatePower(ah, series[2].Rate, + series[2].ChSel, + series[2].tx_power_cap, + !! (series[2].RateFlags & HAL_RATESERIES_2040)); + ads->ds_ctl10 = SM(0, AR_AntCtl2) | SM(txPower, AR_XmitPower2); + + txPower = ar5416GetTxRatePower(ah, series[3].Rate, + series[3].ChSel, + series[3].tx_power_cap, + !! (series[3].RateFlags & HAL_RATESERIES_2040)); + ads->ds_ctl11 = SM(0, AR_AntCtl3) | SM(txPower, AR_XmitPower3); + } } /* Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285_reset.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9285_reset.c Wed Apr 17 07:22:23 2013 (r249579) +++ head/sys/dev/ath/ath_hal/ar9002/ar9285_reset.c Wed Apr 17 07:31:53 2013 (r249580) @@ -76,9 +76,7 @@ ar9285SetTransmitPower(struct ath_hal *a MODAL_EEP4K_HEADER *pModal; struct ath_hal_5212 *ahp = AH5212(ah); - int16_t ratesArray[Ar5416RateSize]; int16_t txPowerIndexOffset = 0; - uint8_t ht40PowerIncForPdadc = 2; int i; uint16_t cfgCtl; @@ -91,8 +89,10 @@ ar9285SetTransmitPower(struct ath_hal *a HALASSERT(AH_PRIVATE(ah)->ah_eeversion >= AR_EEPROM_VER14_1); + AH5416(ah)->ah_ht40PowerIncForPdadc = 2; + /* Setup info for the actual eeprom */ - OS_MEMZERO(ratesArray, sizeof(ratesArray)); + OS_MEMZERO(AH5416(ah)->ah_ratesArray, sizeof(AH5416(ah)->ah_ratesArray)); cfgCtl = ath_hal_getctl(ah, chan); powerLimit = chan->ic_maxregpower * 2; twiceAntennaReduction = chan->ic_maxantgain; @@ -102,11 +102,11 @@ ar9285SetTransmitPower(struct ath_hal *a __func__,chan->ic_freq, cfgCtl ); if (IS_EEP_MINOR_V2(ah)) { - ht40PowerIncForPdadc = pModal->ht40PowerIncForPdadc; + AH5416(ah)->ah_ht40PowerIncForPdadc = pModal->ht40PowerIncForPdadc; } if (!ar9285SetPowerPerRateTable(ah, pEepData, chan, - &ratesArray[0],cfgCtl, + &AH5416(ah)->ah_ratesArray[0],cfgCtl, twiceAntennaReduction, twiceMaxRegulatoryPower, powerLimit)) { HALDEBUG(ah, HAL_DEBUG_ANY, @@ -120,11 +120,12 @@ ar9285SetTransmitPower(struct ath_hal *a return AH_FALSE; } - maxPower = AH_MAX(ratesArray[rate6mb], ratesArray[rateHt20_0]); - maxPower = AH_MAX(maxPower, ratesArray[rate1l]); + maxPower = AH_MAX(AH5416(ah)->ah_ratesArray[rate6mb], + AH5416(ah)->ah_ratesArray[rateHt20_0]); + maxPower = AH_MAX(maxPower, AH5416(ah)->ah_ratesArray[rate1l]); if (IEEE80211_IS_CHAN_HT40(chan)) { - maxPower = AH_MAX(maxPower, ratesArray[rateHt40_0]); + maxPower = AH_MAX(maxPower, AH5416(ah)->ah_ratesArray[rateHt40_0]); } ahp->ah_tx6PowerInHalfDbm = maxPower; @@ -135,18 +136,18 @@ ar9285SetTransmitPower(struct ath_hal *a * txPowerIndexOffset is set by the SetPowerTable() call - * adjust the rate table (0 offset if rates EEPROM not loaded) */ - for (i = 0; i < N(ratesArray); i++) { - ratesArray[i] = (int16_t)(txPowerIndexOffset + ratesArray[i]); + for (i = 0; i < N(AH5416(ah)->ah_ratesArray); i++) { + AH5416(ah)->ah_ratesArray[i] = (int16_t)(txPowerIndexOffset + AH5416(ah)->ah_ratesArray[i]); /* -5 dBm offset for Merlin and later; this includes Kite */ - ratesArray[i] -= AR5416_PWR_TABLE_OFFSET_DB * 2; - if (ratesArray[i] > AR5416_MAX_RATE_POWER) - ratesArray[i] = AR5416_MAX_RATE_POWER; - if (ratesArray[i] < 0) - ratesArray[i] = 0; + AH5416(ah)->ah_ratesArray[i] -= AR5416_PWR_TABLE_OFFSET_DB * 2; + if (AH5416(ah)->ah_ratesArray[i] > AR5416_MAX_RATE_POWER) + AH5416(ah)->ah_ratesArray[i] = AR5416_MAX_RATE_POWER; + if (AH5416(ah)->ah_ratesArray[i] < 0) + AH5416(ah)->ah_ratesArray[i] = 0; } #ifdef AH_EEPROM_DUMP - ar5416PrintPowerPerRate(ah, ratesArray); + ar5416PrintPowerPerRate(ah, AH5416(ah)->ah_ratesArray); #endif /* @@ -157,18 +158,26 @@ ar9285SetTransmitPower(struct ath_hal *a * XXX handle overflow/too high power level? */ if (IEEE80211_IS_CHAN_HT40(chan)) { - ratesArray[rateHt40_0] += ht40PowerIncForPdadc; - ratesArray[rateHt40_1] += ht40PowerIncForPdadc; - ratesArray[rateHt40_2] += ht40PowerIncForPdadc; - ratesArray[rateHt40_3] += ht40PowerIncForPdadc; - ratesArray[rateHt40_4] += ht40PowerIncForPdadc; - ratesArray[rateHt40_5] += ht40PowerIncForPdadc; - ratesArray[rateHt40_6] += ht40PowerIncForPdadc; - ratesArray[rateHt40_7] += ht40PowerIncForPdadc; + AH5416(ah)->ah_ratesArray[rateHt40_0] += + AH5416(ah)->ah_ht40PowerIncForPdadc; + AH5416(ah)->ah_ratesArray[rateHt40_1] += + AH5416(ah)->ah_ht40PowerIncForPdadc; + AH5416(ah)->ah_ratesArray[rateHt40_2] += + AH5416(ah)->ah_ht40PowerIncForPdadc; + AH5416(ah)->ah_ratesArray[rateHt40_3] += + AH5416(ah)->ah_ht40PowerIncForPdadc; + AH5416(ah)->ah_ratesArray[rateHt40_4] += + AH5416(ah)->ah_ht40PowerIncForPdadc; + AH5416(ah)->ah_ratesArray[rateHt40_5] += + AH5416(ah)->ah_ht40PowerIncForPdadc; + AH5416(ah)->ah_ratesArray[rateHt40_6] += + AH5416(ah)->ah_ht40PowerIncForPdadc; + AH5416(ah)->ah_ratesArray[rateHt40_7] += + AH5416(ah)->ah_ht40PowerIncForPdadc; } /* Write the TX power rate registers */ - ar5416WriteTxPowerRateRegisters(ah, chan, ratesArray); + ar5416WriteTxPowerRateRegisters(ah, chan, AH5416(ah)->ah_ratesArray); return AH_TRUE; #undef POW_SM Modified: head/sys/dev/ath/ath_hal/ar9002/ar9287_reset.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9287_reset.c Wed Apr 17 07:22:23 2013 (r249579) +++ head/sys/dev/ath/ath_hal/ar9002/ar9287_reset.c Wed Apr 17 07:31:53 2013 (r249580) @@ -333,9 +333,7 @@ ar9287SetTransmitPower(struct ath_hal *a const struct modal_eep_ar9287_header *pModal; struct ath_hal_5212 *ahp = AH5212(ah); - int16_t ratesArray[Ar5416RateSize]; int16_t txPowerIndexOffset = 0; - uint8_t ht40PowerIncForPdadc = 2; int i; uint16_t cfgCtl; @@ -346,8 +344,11 @@ ar9287SetTransmitPower(struct ath_hal *a HAL_EEPROM_9287 *ee = AH_PRIVATE(ah)->ah_eeprom; struct ar9287_eeprom *pEepData = &ee->ee_base; + AH5416(ah)->ah_ht40PowerIncForPdadc = 2; + /* Setup info for the actual eeprom */ - OS_MEMZERO(ratesArray, sizeof(ratesArray)); + OS_MEMZERO(AH5416(ah)->ah_ratesArray, + sizeof(AH5416(ah)->ah_ratesArray)); cfgCtl = ath_hal_getctl(ah, chan); powerLimit = chan->ic_maxregpower * 2; twiceAntennaReduction = chan->ic_maxantgain; @@ -358,11 +359,12 @@ ar9287SetTransmitPower(struct ath_hal *a __func__,chan->ic_freq, cfgCtl ); /* XXX Assume Minor is v2 or later */ - ht40PowerIncForPdadc = pModal->ht40PowerIncForPdadc; + AH5416(ah)->ah_ht40PowerIncForPdadc = pModal->ht40PowerIncForPdadc; /* Fetch per-rate power table for the given channel */ if (! ar9287SetPowerPerRateTable(ah, pEepData, chan, - &ratesArray[0],cfgCtl, + &AH5416(ah)->ah_ratesArray[0], + cfgCtl, twiceAntennaReduction, twiceMaxRegulatoryPower, powerLimit)) { HALDEBUG(ah, HAL_DEBUG_ANY, @@ -374,11 +376,14 @@ ar9287SetTransmitPower(struct ath_hal *a ar9287SetPowerCalTable(ah, chan, &txPowerIndexOffset); /* Calculate maximum power level */ - maxPower = AH_MAX(ratesArray[rate6mb], ratesArray[rateHt20_0]); - maxPower = AH_MAX(maxPower, ratesArray[rate1l]); + maxPower = AH_MAX(AH5416(ah)->ah_ratesArray[rate6mb], + AH5416(ah)->ah_ratesArray[rateHt20_0]); + maxPower = AH_MAX(maxPower, + AH5416(ah)->ah_ratesArray[rate1l]); if (IEEE80211_IS_CHAN_HT40(chan)) - maxPower = AH_MAX(maxPower, ratesArray[rateHt40_0]); + maxPower = AH_MAX(maxPower, + AH5416(ah)->ah_ratesArray[rateHt40_0]); ahp->ah_tx6PowerInHalfDbm = maxPower; AH_PRIVATE(ah)->ah_maxPowerLevel = maxPower; @@ -389,18 +394,20 @@ ar9287SetTransmitPower(struct ath_hal *a * adjust the rate table (0 offset if rates EEPROM not loaded) */ /* XXX what about the pwrTableOffset? */ - for (i = 0; i < N(ratesArray); i++) { - ratesArray[i] = (int16_t)(txPowerIndexOffset + ratesArray[i]); + for (i = 0; i < N(AH5416(ah)->ah_ratesArray); i++) { + AH5416(ah)->ah_ratesArray[i] = + (int16_t)(txPowerIndexOffset + + AH5416(ah)->ah_ratesArray[i]); /* -5 dBm offset for Merlin and later; this includes Kiwi */ - ratesArray[i] -= AR5416_PWR_TABLE_OFFSET_DB * 2; - if (ratesArray[i] > AR5416_MAX_RATE_POWER) - ratesArray[i] = AR5416_MAX_RATE_POWER; - if (ratesArray[i] < 0) - ratesArray[i] = 0; + AH5416(ah)->ah_ratesArray[i] -= AR5416_PWR_TABLE_OFFSET_DB * 2; + if (AH5416(ah)->ah_ratesArray[i] > AR5416_MAX_RATE_POWER) + AH5416(ah)->ah_ratesArray[i] = AR5416_MAX_RATE_POWER; + if (AH5416(ah)->ah_ratesArray[i] < 0) + AH5416(ah)->ah_ratesArray[i] = 0; } #ifdef AH_EEPROM_DUMP - ar5416PrintPowerPerRate(ah, ratesArray); + ar5416PrintPowerPerRate(ah, AH5416(ah)->ah_ratesArray); #endif /* @@ -411,18 +418,26 @@ ar9287SetTransmitPower(struct ath_hal *a * XXX handle overflow/too high power level? */ if (IEEE80211_IS_CHAN_HT40(chan)) { - ratesArray[rateHt40_0] += ht40PowerIncForPdadc; - ratesArray[rateHt40_1] += ht40PowerIncForPdadc; - ratesArray[rateHt40_2] += ht40PowerIncForPdadc; - ratesArray[rateHt40_3] += ht40PowerIncForPdadc; - ratesArray[rateHt40_4] += ht40PowerIncForPdadc; - ratesArray[rateHt40_5] += ht40PowerIncForPdadc; - ratesArray[rateHt40_6] += ht40PowerIncForPdadc; - ratesArray[rateHt40_7] += ht40PowerIncForPdadc; + AH5416(ah)->ah_ratesArray[rateHt40_0] += + AH5416(ah)->ah_ht40PowerIncForPdadc; + AH5416(ah)->ah_ratesArray[rateHt40_1] += + AH5416(ah)->ah_ht40PowerIncForPdadc; + AH5416(ah)->ah_ratesArray[rateHt40_2] += + AH5416(ah)->ah_ht40PowerIncForPdadc; + AH5416(ah)->ah_ratesArray[rateHt40_3] += + AH5416(ah)->ah_ht40PowerIncForPdadc; + AH5416(ah)->ah_ratesArray[rateHt40_4] += + AH5416(ah)->ah_ht40PowerIncForPdadc; + AH5416(ah)->ah_ratesArray[rateHt40_5] += + AH5416(ah)->ah_ht40PowerIncForPdadc; + AH5416(ah)->ah_ratesArray[rateHt40_6] += + AH5416(ah)->ah_ht40PowerIncForPdadc; + AH5416(ah)->ah_ratesArray[rateHt40_7] += + AH5416(ah)->ah_ht40PowerIncForPdadc; } /* Write the TX power rate registers */ - ar5416WriteTxPowerRateRegisters(ah, chan, ratesArray); + ar5416WriteTxPowerRateRegisters(ah, chan, AH5416(ah)->ah_ratesArray); return AH_TRUE; #undef POW_SM From owner-svn-src-all@FreeBSD.ORG Wed Apr 17 08:32:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DCBE033E for ; Wed, 17 Apr 2013 08:32:06 +0000 (UTC) (envelope-from jdc@koitsu.org) Received: from qmta03.emeryville.ca.mail.comcast.net (qmta03.emeryville.ca.mail.comcast.net [76.96.30.32]) by mx1.freebsd.org (Postfix) with ESMTP id C308337C for ; Wed, 17 Apr 2013 08:32:06 +0000 (UTC) Received: from omta23.emeryville.ca.mail.comcast.net ([76.96.30.90]) by qmta03.emeryville.ca.mail.comcast.net with comcast id QwPQ1l0011wfjNsA3wVxiV; Wed, 17 Apr 2013 08:29:57 +0000 Received: from koitsu.strangled.net ([67.180.84.87]) by omta23.emeryville.ca.mail.comcast.net with comcast id QwVw1l0071t3BNj8jwVw3N; Wed, 17 Apr 2013 08:29:56 +0000 Received: by icarus.home.lan (Postfix, from userid 1000) id 2512373A33; Wed, 17 Apr 2013 01:29:56 -0700 (PDT) Date: Wed, 17 Apr 2013 01:29:56 -0700 From: Jeremy Chadwick To: Brooks Davis Subject: Re: svn commit: r249549 - in stable/9/sys: amd64/conf i386/conf Message-ID: <20130417082956.GA98554@icarus.home.lan> References: <201304161609.r3GG9SID009937@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201304161609.r3GG9SID009937@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20121106; t=1366187397; bh=hZgqcuTfeJMjWplpegBrFkod3tgvCGkx4BH1X+O8HtY=; h=Received:Received:Received:Date:From:To:Subject:Message-ID: MIME-Version:Content-Type; b=VhqOpasAXPVmsdYXRbKiOg72NpfNO+qkZwyI2SwWKhW6Av5Q/xBbFJXyAoc71e/7e 8c0tRSyCwzYgbPOYW4f3LxL0jcVnenYeHyunvo3Z8TxhWlzdfr/lPzEbvAKkbOc5tK bs8wIoidPRj/6ere10G/wlCVu3FXh1USWH9udJepVZ0Qugu0/ifqebqBXBAPmIIjuf v/yd72cORW8PuelXaX3mXUGcYPYLuP20mHN269kOLsAshU0JcO1+Ln/tSA/dq8nXpb tMlbi61uoYs9Oyy0IYXsDYYz68ZV4UIK6DoNVf/HcDLw77TkxzIaOgSliu6QEWahr+ BIMjU0jz1bdAA== Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2013 08:32:06 -0000 On Tue, Apr 16, 2013 at 04:09:28PM +0000, Brooks Davis wrote: > Author: brooks > Date: Tue Apr 16 16:09:27 2013 > New Revision: 249549 > URL: http://svnweb.freebsd.org/changeset/base/249549 > > Log: > MFC (much delayed) 234504: > > Enable DTrace hooks in GENERIC. > > Modified: > stable/9/sys/amd64/conf/GENERIC > stable/9/sys/i386/conf/GENERIC > Directory Properties: > stable/9/sys/ (props changed) > > Modified: stable/9/sys/amd64/conf/GENERIC > ============================================================================== > --- stable/9/sys/amd64/conf/GENERIC Tue Apr 16 14:22:16 2013 (r249548) > +++ stable/9/sys/amd64/conf/GENERIC Tue Apr 16 16:09:27 2013 (r249549) > @@ -22,6 +22,7 @@ cpu HAMMER > ident GENERIC > > makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols > +makeoptions WITH_CTF=1 # Run ctfconvert(1) for DTrace support > > options SCHED_ULE # ULE scheduler > options PREEMPTION # Enable kernel thread preemption > @@ -63,11 +64,12 @@ options KBD_INSTALL_CDEV # install a CD > options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) > options AUDIT # Security event auditing > options MAC # TrustedBSD MAC Framework > -#options KDTRACE_FRAME # Ensure frames are compiled in > -#options KDTRACE_HOOKS # Kernel DTrace hooks > +options KDTRACE_FRAME # Ensure frames are compiled in > +options KDTRACE_HOOKS # Kernel DTrace hooks > options INCLUDE_CONFIG_FILE # Include this file in kernel > options KDB # Kernel debugger related code > options KDB_TRACE # Print a stack trace for a panic > +options DDB_CTF # kernel ELF linker loads CTF data > > # Make an SMP-capable kernel by default > options SMP # Symmetric MultiProcessor Kernel > > Modified: stable/9/sys/i386/conf/GENERIC > ============================================================================== > --- stable/9/sys/i386/conf/GENERIC Tue Apr 16 14:22:16 2013 (r249548) > +++ stable/9/sys/i386/conf/GENERIC Tue Apr 16 16:09:27 2013 (r249549) > @@ -24,6 +24,7 @@ cpu I686_CPU > ident GENERIC > > makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols > +makeoptions WITH_CTF=1 # Run ctfconvert(1) for DTrace support > > options SCHED_ULE # ULE scheduler > options PREEMPTION # Enable kernel thread preemption > @@ -64,10 +65,11 @@ options KBD_INSTALL_CDEV # install a CD > options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) > options AUDIT # Security event auditing > options MAC # TrustedBSD MAC Framework > -#options KDTRACE_HOOKS # Kernel DTrace hooks > +options KDTRACE_HOOKS # Kernel DTrace hooks > options INCLUDE_CONFIG_FILE # Include this file in kernel > options KDB # Kernel debugger related code > options KDB_TRACE # Print a stack trace for a panic > +options DDB_CTF # kernel ELF linker loads CTF data > > # To make an SMP kernel, the next two lines are needed > options SMP # Symmetric MultiProcessor Kernel And here come the complaints, which warrant responses from key folks who are in the know: http://lists.freebsd.org/pipermail/freebsd-stable/2013-April/073132.html -- | Jeremy Chadwick jdc@koitsu.org | | UNIX Systems Administrator http://jdc.koitsu.org/ | | Mountain View, CA, US | | Making life hard for others since 1977. PGP 4BD6C0CB | From owner-svn-src-all@FreeBSD.ORG Wed Apr 17 08:34:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B1E414F8; Wed, 17 Apr 2013 08:34:39 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id 298CD395; Wed, 17 Apr 2013 08:34:38 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.6/8.14.6) with ESMTP id r3H8YZCp009497; Wed, 17 Apr 2013 11:34:35 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.2 kib.kiev.ua r3H8YZCp009497 Received: (from kostik@localhost) by tom.home (8.14.6/8.14.6/Submit) id r3H8YZwE009496; Wed, 17 Apr 2013 11:34:35 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 17 Apr 2013 11:34:35 +0300 From: Konstantin Belousov To: Rui Paulo Subject: Re: svn commit: r249577 - head/sys/amd64/amd64 Message-ID: <20130417083435.GY2930@kib.kiev.ua> References: <201304170651.r3H6pHYo087392@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="CaDA/LpMQ9SI3HwJ" Content-Disposition: inline In-Reply-To: <201304170651.r3H6pHYo087392@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2013 08:34:39 -0000 --CaDA/LpMQ9SI3HwJ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Apr 17, 2013 at 06:51:17AM +0000, Rui Paulo wrote: > Author: rpaulo > Date: Wed Apr 17 06:51:17 2013 > New Revision: 249577 > URL: http://svnweb.freebsd.org/changeset/base/249577 >=20 > Log: > Print more bits from the standard extended features CPUID which will be > available in the Haswell architecture (c.f. Intel Document #319433-012A= ). Rev. 14 of the same document declares the meaning of the bits 18 (RDSEED), 19 (ADX) and 20 (SMAP) as well. --CaDA/LpMQ9SI3HwJ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQIcBAEBAgAGBQJRbl6aAAoJEJDCuSvBvK1B4k4P/2xaXsi3U/GkaAAg+fWloTgE byI+DUnAFreaC+kaPVhBMT+axBfGnvkwf08W09khqEiDITy3vdlzQ885Jnjooj+u d6ozwkpGx/JX6yZSiJlvqv/+JeBUi+j2mN3EI/lNg1ajvj5pQYsCUVpAYvRP6rAl Yo2/rwvjrduGIkQN/EAzPN2o+ckjbWuewg31nkf2ct/IX9Qcp5Yk1PE37ZsPAxUh wRTe+qz7ysu0vi2CxKO8ZzzWJHrfE2N3/CrmNN7wRVB/sirQVUcg3/ZxudMRdtk4 tiN28LymH796xWwjtrW+/ur7Z62alhqn/ub80CNQXmsNfNCsIuPL+w91HJXaA7nm 85FsGqEKa4WtZ5Zihqdiia9Z45MJRx2/kQlgJ2eQpMttlxXcQxC9Aox7sYHuO7hf 2pjGSZbE6kMQIFlwIQ/LxLO8qDwdMjJ5JxiVrvzSIz5BmQQOyjxNX83E5QcHU3jG 9ULHRpRH7GD2JxAMX5KVVrdmiXVqDUcZPlsFAgdq9linqQq8HI62Tk0OU3yUZQHF Dy5yCVVHkKlVQIB9IWWal6p9XcdLwfhOK8T1omPLRyyRCTvr+repsfA1STgagu/N mog4x+gKNpDkwaIENTbfzWR+1HNqUETxZvBqci3kF9Wr20gynYykMyIYBS+UThu5 X2qBHyJUy9cux/kiU+Cp =XI6W -----END PGP SIGNATURE----- --CaDA/LpMQ9SI3HwJ-- From owner-svn-src-all@FreeBSD.ORG Wed Apr 17 09:19:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 94616FD; Wed, 17 Apr 2013 09:19:29 +0000 (UTC) (envelope-from ivoras@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 87AB6795; Wed, 17 Apr 2013 09:19:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3H9JTEL032834; Wed, 17 Apr 2013 09:19:29 GMT (envelope-from ivoras@svn.freebsd.org) Received: (from ivoras@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3H9JT34032833; Wed, 17 Apr 2013 09:19:29 GMT (envelope-from ivoras@svn.freebsd.org) Message-Id: <201304170919.r3H9JT34032833@svn.freebsd.org> From: Ivan Voras Date: Wed, 17 Apr 2013 09:19:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249581 - head/sys/modules/geom/geom_label X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2013 09:19:29 -0000 Author: ivoras Date: Wed Apr 17 09:19:29 2013 New Revision: 249581 URL: http://svnweb.freebsd.org/changeset/base/249581 Log: Link g_label_disk_ident when building geom_label as a module Modified: head/sys/modules/geom/geom_label/Makefile Modified: head/sys/modules/geom/geom_label/Makefile ============================================================================== --- head/sys/modules/geom/geom_label/Makefile Wed Apr 17 07:31:53 2013 (r249580) +++ head/sys/modules/geom/geom_label/Makefile Wed Apr 17 09:19:29 2013 (r249581) @@ -4,6 +4,7 @@ KMOD= geom_label SRCS= g_label.c +SRCS+= g_label_disk_ident.c SRCS+= g_label_ext2fs.c SRCS+= g_label_gpt.c SRCS+= g_label_iso9660.c From owner-svn-src-all@FreeBSD.ORG Wed Apr 17 11:00:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9B95F6C3; Wed, 17 Apr 2013 11:00:29 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) by mx1.freebsd.org (Postfix) with ESMTP id 7850EC37; Wed, 17 Apr 2013 11:00:29 +0000 (UTC) Received: from ralph.baldwin.cx (c-68-39-198-164.hsd1.de.comcast.net [68.39.198.164]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 34B65B9AC; Wed, 17 Apr 2013 07:00:28 -0400 (EDT) From: John Baldwin To: Rui Paulo Subject: Re: svn commit: r249577 - head/sys/amd64/amd64 Date: Wed, 17 Apr 2013 06:47:05 -0400 User-Agent: KMail/1.13.7 (FreeBSD/9.1-STABLE; KDE/4.8.4; amd64; ; ) References: <201304170651.r3H6pHYo087392@svn.freebsd.org> In-Reply-To: <201304170651.r3H6pHYo087392@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201304170647.05488.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 17 Apr 2013 07:00:28 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2013 11:00:29 -0000 On Wednesday, April 17, 2013 02:51:17 AM Rui Paulo wrote: > Author: rpaulo > Date: Wed Apr 17 06:51:17 2013 > New Revision: 249577 > URL: http://svnweb.freebsd.org/changeset/base/249577 > > Log: > Print more bits from the standard extended features CPUID which will be > available in the Haswell architecture (c.f. Intel Document #319433-012A). Can you add appropriate constants with comments to x86/include/specialreg.h and remove the comments from here? (That is how we have documented all the other feature bits.) -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Wed Apr 17 11:00:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C820C6C6; Wed, 17 Apr 2013 11:00:29 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) by mx1.freebsd.org (Postfix) with ESMTP id 760EAC35; Wed, 17 Apr 2013 11:00:29 +0000 (UTC) Received: from ralph.baldwin.cx (c-68-39-198-164.hsd1.de.comcast.net [68.39.198.164]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id B5809B9B9; Wed, 17 Apr 2013 07:00:28 -0400 (EDT) From: John Baldwin To: Jilles Tjoelker Subject: Re: svn commit: r249566 - in head: lib/libc/gen sys/kern Date: Wed, 17 Apr 2013 06:59:58 -0400 User-Agent: KMail/1.13.7 (FreeBSD/9.1-STABLE; KDE/4.8.4; amd64; ; ) References: <201304162026.r3GKQVgs093874@svn.freebsd.org> <20130416211503.GA1025@stack.nl> In-Reply-To: <20130416211503.GA1025@stack.nl> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201304170659.58569.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 17 Apr 2013 07:00:28 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2013 11:00:29 -0000 On Tuesday, April 16, 2013 05:15:03 PM Jilles Tjoelker wrote: > On Tue, Apr 16, 2013 at 08:26:31PM +0000, John Baldwin wrote: > > Author: jhb > > Date: Tue Apr 16 20:26:31 2013 > > New Revision: 249566 > > URL: http://svnweb.freebsd.org/changeset/base/249566 > > > > Log: > > - Document that sem_wait() can fail with EINTR if it is interrupted by > > a > > > > signal. > > > > - Fix the old ksem implementation for POSIX semaphores to not restart > > > > sem_wait() or sem_timedwait() if interrupted by a signal. > > > > MFC after: 1 week > > > > Modified: > > head/lib/libc/gen/sem_wait.3 > > head/sys/kern/uipc_sem.c > > > > Modified: head/lib/libc/gen/sem_wait.3 > > ========================================================================= > > ===== --- head/lib/libc/gen/sem_wait.3 Tue Apr 16 20:21:02 2013 (r249565) > > +++ head/lib/libc/gen/sem_wait.3 Tue Apr 16 20:26:31 2013 (r249566) @@ > > -27,7 +27,7 @@ > > > > .\" > > .\" $FreeBSD$ > > .\" > > > > -.Dd February 15, 2000 > > +.Dd April 16, 2013 > > > > .Dt SEM_WAIT 3 > > .Os > > .Sh NAME > > > > @@ -75,6 +75,14 @@ points to an invalid semaphore. > > > > .El > > .Pp > > Additionally, > > > > +.Fn sem_wait > > +will fail if: > > +.Bl -tag -width Er > > +.Pp > > +.It Bq Er EINTR > > +A signal interrupted this function. > > +.El > > +Additionally, > > > > .Fn sem_trywait > > will fail if: > > .Bl -tag -width Er > > > > Modified: head/sys/kern/uipc_sem.c > > ========================================================================= > > ===== --- head/sys/kern/uipc_sem.c Tue Apr 16 20:21:02 2013 (r249565) > > +++ head/sys/kern/uipc_sem.c Tue Apr 16 20:26:31 2013 (r249566) > > @@ -846,6 +846,8 @@ kern_sem_wait(struct thread *td, semid_t > > > > err: > > mtx_unlock(&sem_lock); > > fdrop(fp, td); > > > > + if (error == ERESTART) > > + error = EINTR; > > > > DP(("<<< kern_sem_wait leaving, pid=%d, error = %d\n", > > > > (int)td->td_proc->p_pid, error)); > > > > return (error); > > It would normally be expected (and required by POSIX) that a signal with > SA_RESTART set does not cause a function to fail with [EINTR], so more > rationale is needed here. > > Also, the timeouts passed to these functions are absolute and also are > at the system call level except UMTX_OP_SEM_WAIT which can take a > relative or an absolute timeout but libc passed it an absolute timeout. > So there is no need for a caller to see [EINTR] to avoid overlong > timeouts. > > Given the number of times people call sem_wait() without checking the > return value, call sem_wait() and assume any error is fatal or call > sem_timedwait() and assume any error is a timeout, I think it may be > better to go the other way and never fail with [EINTR], just like the > pthread functions. POSIX explicitly permits this: the [EINTR] error for > sem_wait(), sem_trywait() and sem_timedwait() is "may fail" rather than > the usual "shall fail" (note that SA_RESTART overrides such a "shall > fail" unless there is a relative timeout or it is explicitly excluded > with the function). > > I realize that this reduces functionality, but relying on [EINTR] here > introduces a race condition anyway (because the signal handler may be > called just before sem_wait() blocks). I suggest pthread cancellation, > not returning from the signal handler or leaving the default > action in place (if it is termination). The racy functionality can be > kept by leaving [EINTR] and [ERESTART] from the sleep function as they > are except for changing [ERESTART] to [EINTR] when UMTX_OP_SEM_WAIT was > passed a relative timeout. Breakage in programs that check sem_wait()'s > return value incorrectly will then be less frequent and only present > when POSIX permits it. Hmm, this merely documents how our current semaphores in 9.x and later behave and adjusts the semaphores in 8.x to behave the same way. For mutexes it seems we restart non-timed lock attempts and do not restart timed lock attempts in the umtx code (whereas all arbitrary waits in do_wait() are not restarted). If you want to fix the current semaphores to not fail with EINTR that would be fine with me, but our two implementations should be consistent (as should the manpages: sem_timedwait() documented EINTR but sem_wait() did not). -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Wed Apr 17 11:40:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B8DB678B; Wed, 17 Apr 2013 11:40:14 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A917018D; Wed, 17 Apr 2013 11:40:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3HBeExW077857; Wed, 17 Apr 2013 11:40:14 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3HBeB5h076282; Wed, 17 Apr 2013 11:40:11 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201304171140.r3HBeB5h076282@svn.freebsd.org> From: Gabor Kovesdan Date: Wed, 17 Apr 2013 11:40:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249582 - in head: lib/libc/i386/string lib/libc/stdlib lib/libz sys/arm/include sys/arm/xscale/ixp425 sys/cam/scsi sys/dev/cxgb/common sys/dev/msk sys/dev/ppbus sys/dev/rndtest sys/ker... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2013 11:40:14 -0000 Author: gabor Date: Wed Apr 17 11:40:10 2013 New Revision: 249582 URL: http://svnweb.freebsd.org/changeset/base/249582 Log: - Correct mispellings of the word occurrence Submitted by: Christoph Mallon (via private mail) Modified: head/lib/libc/i386/string/memchr.S head/lib/libc/i386/string/strchr.S head/lib/libc/i386/string/strrchr.S head/lib/libc/stdlib/realpath.c head/lib/libz/zlib.h head/sys/arm/include/sysarch.h head/sys/arm/xscale/ixp425/ixp425_npe.c head/sys/cam/scsi/scsi_pass.c head/sys/cam/scsi/scsi_target.c head/sys/dev/cxgb/common/cxgb_t3_hw.c head/sys/dev/msk/if_msk.c head/sys/dev/ppbus/ppbconf.c head/sys/dev/rndtest/rndtest.c head/sys/kern/vfs_mount.c head/sys/ufs/ffs/ffs_balloc.c head/tools/regression/usr.bin/yacc/grammar.y head/tools/regression/usr.bin/yacc/regress.08.out head/usr.sbin/ppp/command.c Modified: head/lib/libc/i386/string/memchr.S ============================================================================== --- head/lib/libc/i386/string/memchr.S Wed Apr 17 09:19:29 2013 (r249581) +++ head/lib/libc/i386/string/memchr.S Wed Apr 17 11:40:10 2013 (r249582) @@ -33,7 +33,7 @@ __FBSDID("$FreeBSD$"); /* * memchr (b, c, len) - * locates the first occurance of c in string b. + * locates the first occurrence of c in string b. * * Written by: * J.T. Conklin (jtc@wimsey.com), Winning Strategies, Inc. Modified: head/lib/libc/i386/string/strchr.S ============================================================================== --- head/lib/libc/i386/string/strchr.S Wed Apr 17 09:19:29 2013 (r249581) +++ head/lib/libc/i386/string/strchr.S Wed Apr 17 11:40:10 2013 (r249582) @@ -33,11 +33,11 @@ __FBSDID("$FreeBSD$"); /* * strchr(s, c) - * return a pointer to the first occurance of the character c in + * return a pointer to the first occurrence of the character c in * string s, or NULL if c does not occur in the string. * * %edx - pointer iterating through string - * %eax - pointer to first occurance of 'c' + * %eax - pointer to first occurrence of 'c' * %cl - character we're comparing against * %bl - character at %edx * Modified: head/lib/libc/i386/string/strrchr.S ============================================================================== --- head/lib/libc/i386/string/strrchr.S Wed Apr 17 09:19:29 2013 (r249581) +++ head/lib/libc/i386/string/strrchr.S Wed Apr 17 11:40:10 2013 (r249582) @@ -33,11 +33,11 @@ __FBSDID("$FreeBSD$"); /* * strrchr(s, c) - * return a pointer to the last occurance of the character c in + * return a pointer to the last occurrence of the character c in * string s, or NULL if c does not occur in the string. * * %edx - pointer iterating through string - * %eax - pointer to last occurance of 'c' + * %eax - pointer to last occurrence of 'c' * %cl - character we're comparing against * %bl - character at %edx * Modified: head/lib/libc/stdlib/realpath.c ============================================================================== --- head/lib/libc/stdlib/realpath.c Wed Apr 17 09:19:29 2013 (r249581) +++ head/lib/libc/stdlib/realpath.c Wed Apr 17 11:40:10 2013 (r249582) @@ -139,7 +139,7 @@ realpath(const char * __restrict path, c * Only the trailing slashes are not covered * by other checks in the loop, but we verify * the prefix for any (rare) "//" or "/\0" - * occurence to not implement lookahead. + * occurrence to not implement lookahead. */ if (lstat(resolved, &sb) != 0) { if (m) Modified: head/lib/libz/zlib.h ============================================================================== --- head/lib/libz/zlib.h Wed Apr 17 09:19:29 2013 (r249581) +++ head/lib/libz/zlib.h Wed Apr 17 11:40:10 2013 (r249582) @@ -846,7 +846,7 @@ ZEXTERN int ZEXPORT inflateSync OF((z_st available input is skipped. No output is provided. inflateSync searches for a 00 00 FF FF pattern in the compressed data. - All full flush points have this pattern, but not all occurences of this + All full flush points have this pattern, but not all occurrences of this pattern are full flush points. inflateSync returns Z_OK if a possible full flush point has been found, Modified: head/sys/arm/include/sysarch.h ============================================================================== --- head/sys/arm/include/sysarch.h Wed Apr 17 09:19:29 2013 (r249581) +++ head/sys/arm/include/sysarch.h Wed Apr 17 11:40:10 2013 (r249582) @@ -47,7 +47,7 @@ * update the cpu_switch() (and cpu_throw()) code as well. * In addition, code in arm/include/atomic.h and arm/include/asmacros.h * assumes that ARM_RAS_END is at ARM_RAS_START+4, so be sure to update those - * if ARM_RAS_END moves in relation to ARM_RAS_START (look for occurrances + * if ARM_RAS_END moves in relation to ARM_RAS_START (look for occurrences * of ldr/str rm,[rn, #4]). */ Modified: head/sys/arm/xscale/ixp425/ixp425_npe.c ============================================================================== --- head/sys/arm/xscale/ixp425/ixp425_npe.c Wed Apr 17 09:19:29 2013 (r249581) +++ head/sys/arm/xscale/ixp425/ixp425_npe.c Wed Apr 17 11:40:10 2013 (r249582) @@ -419,7 +419,7 @@ ixpnpe_stop(struct ixpnpe_softc *sc) /* * Indicates the start of an NPE Image, in new NPE Image Library format. - * 2 consecutive occurances indicates the end of the NPE Image Library + * 2 consecutive occurrences indicates the end of the NPE Image Library */ #define NPE_IMAGE_MARKER 0xfeedf00d Modified: head/sys/cam/scsi/scsi_pass.c ============================================================================== --- head/sys/cam/scsi/scsi_pass.c Wed Apr 17 09:19:29 2013 (r249581) +++ head/sys/cam/scsi/scsi_pass.c Wed Apr 17 11:40:10 2013 (r249582) @@ -694,7 +694,7 @@ passsendccb(struct cam_periph *periph, u * match CCBs. For the SCSI, ATA and ADVINFO CCBs, we only pass the * CCB in if there's actually data to map. cam_periph_mapmem() will * do the right thing, even if there isn't data to map, but since CCBs - * without data are a reasonably common occurance (e.g. test unit + * without data are a reasonably common occurrence (e.g. test unit * ready), it will save a few cycles if we check for it here. * * XXX What happens if a sg list is supplied? We don't filter that Modified: head/sys/cam/scsi/scsi_target.c ============================================================================== --- head/sys/cam/scsi/scsi_target.c Wed Apr 17 09:19:29 2013 (r249581) +++ head/sys/cam/scsi/scsi_target.c Wed Apr 17 11:40:10 2013 (r249582) @@ -734,7 +734,7 @@ targsendccb(struct targ_softc *softc, un * match CCBs. For the SCSI CCBs, we only pass the CCB in if * there's actually data to map. cam_periph_mapmem() will do the * right thing, even if there isn't data to map, but since CCBs - * without data are a reasonably common occurance (e.g. test unit + * without data are a reasonably common occurrence (e.g. test unit * ready), it will save a few cycles if we check for it here. */ if (((ccb_h->flags & CAM_DATA_MASK) == CAM_DATA_VADDR) Modified: head/sys/dev/cxgb/common/cxgb_t3_hw.c ============================================================================== --- head/sys/dev/cxgb/common/cxgb_t3_hw.c Wed Apr 17 09:19:29 2013 (r249581) +++ head/sys/dev/cxgb/common/cxgb_t3_hw.c Wed Apr 17 11:40:10 2013 (r249582) @@ -1727,7 +1727,7 @@ struct intr_info { * @reg: the interrupt status register to process * @mask: a mask to apply to the interrupt status * @acts: table of interrupt actions - * @stats: statistics counters tracking interrupt occurences + * @stats: statistics counters tracking interrupt occurrences * * A table driven interrupt handler that applies a set of masks to an * interrupt status word and performs the corresponding actions if the Modified: head/sys/dev/msk/if_msk.c ============================================================================== --- head/sys/dev/msk/if_msk.c Wed Apr 17 09:19:29 2013 (r249581) +++ head/sys/dev/msk/if_msk.c Wed Apr 17 11:40:10 2013 (r249582) @@ -3526,7 +3526,7 @@ msk_intr_hwerr(struct msk_softc *sc) * On PCI Express bus bridges are called root complexes (RC). * PCI Express errors are recognized by the root complex too, * which requests the system to handle the problem. After - * error occurence it may be that no access to the adapter + * error occurrence it may be that no access to the adapter * may be performed any longer. */ Modified: head/sys/dev/ppbus/ppbconf.c ============================================================================== --- head/sys/dev/ppbus/ppbconf.c Wed Apr 17 09:19:29 2013 (r249581) +++ head/sys/dev/ppbus/ppbconf.c Wed Apr 17 11:40:10 2013 (r249582) @@ -172,7 +172,7 @@ static char *pnp_classes[] = { /* * search_token() * - * Search the first occurence of a token within a string + * Search the first occurrence of a token within a string */ static char * search_token(char *str, int slen, char *token) Modified: head/sys/dev/rndtest/rndtest.c ============================================================================== --- head/sys/dev/rndtest/rndtest.c Wed Apr 17 09:19:29 2013 (r249581) +++ head/sys/dev/rndtest/rndtest.c Wed Apr 17 11:40:10 2013 (r249582) @@ -360,7 +360,7 @@ rndtest_chi_4(struct rndtest_state *rsp) for (i = 0; i < RNDTEST_CHI4_K; i++) freq[i] = 0; - /* Get number of occurances of each 4 bit pattern */ + /* Get number of occurrences of each 4 bit pattern */ for (i = 0; i < RNDTEST_NBYTES; i++) { freq[(rsp->rs_buf[i] >> 4) & RNDTEST_CHI4_K_MASK]++; freq[(rsp->rs_buf[i] >> 0) & RNDTEST_CHI4_K_MASK]++; Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Wed Apr 17 09:19:29 2013 (r249581) +++ head/sys/kern/vfs_mount.c Wed Apr 17 11:40:10 2013 (r249582) @@ -232,7 +232,7 @@ vfs_equalopts(const char *opt1, const ch /* * If a mount option is specified several times, * (with or without the "no" prefix) only keep - * the last occurence of it. + * the last occurrence of it. */ static void vfs_sanitizeopts(struct vfsoptlist *opts) Modified: head/sys/ufs/ffs/ffs_balloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_balloc.c Wed Apr 17 09:19:29 2013 (r249581) +++ head/sys/ufs/ffs/ffs_balloc.c Wed Apr 17 11:40:10 2013 (r249582) @@ -453,7 +453,7 @@ fail: * We have to sync it at the end so that the soft updates code * does not find any untracked changes. Although this is really * slow, running out of disk space is not expected to be a common - * occurence. The error return from fsync is ignored as we already + * occurrence. The error return from fsync is ignored as we already * have an error to return to the user. * * XXX Still have to journal the free below Modified: head/tools/regression/usr.bin/yacc/grammar.y ============================================================================== --- head/tools/regression/usr.bin/yacc/grammar.y Wed Apr 17 09:19:29 2013 (r249581) +++ head/tools/regression/usr.bin/yacc/grammar.y Wed Apr 17 11:40:10 2013 (r249582) @@ -1027,7 +1027,7 @@ extern char *yytext; extern FILE *yyin, *yyout; static int curly; /* number of curly brace nesting levels */ -static int ly_count; /* number of occurances of %% */ +static int ly_count; /* number of occurrences of %% */ static int inc_depth; /* include nesting level */ static SymbolTable *included_files; /* files already included */ static int yy_start = 0; /* start state number */ Modified: head/tools/regression/usr.bin/yacc/regress.08.out ============================================================================== --- head/tools/regression/usr.bin/yacc/regress.08.out Wed Apr 17 09:19:29 2013 (r249581) +++ head/tools/regression/usr.bin/yacc/regress.08.out Wed Apr 17 11:40:10 2013 (r249582) @@ -847,7 +847,7 @@ extern char *yytext; extern FILE *yyin, *yyout; static int curly; /* number of curly brace nesting levels */ -static int ly_count; /* number of occurances of %% */ +static int ly_count; /* number of occurrences of %% */ static int inc_depth; /* include nesting level */ static SymbolTable *included_files; /* files already included */ static int yy_start = 0; /* start state number */ Modified: head/usr.sbin/ppp/command.c ============================================================================== --- head/usr.sbin/ppp/command.c Wed Apr 17 09:19:29 2013 (r249581) +++ head/usr.sbin/ppp/command.c Wed Apr 17 11:40:10 2013 (r249582) @@ -416,7 +416,7 @@ DialCommand(struct cmdargs const *arg) static char * strstrword(char *big, const char *little) { - /* Get the first occurrance of the word ``little'' in ``big'' */ + /* Get the first occurrence of the word ``little'' in ``big'' */ char *pos; int len; From owner-svn-src-all@FreeBSD.ORG Wed Apr 17 11:42:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1FD8B910; Wed, 17 Apr 2013 11:42:42 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0313D19D; Wed, 17 Apr 2013 11:42:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3HBgfEd078232; Wed, 17 Apr 2013 11:42:41 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3HBgeq7078221; Wed, 17 Apr 2013 11:42:40 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201304171142.r3HBgeq7078221@svn.freebsd.org> From: Gabor Kovesdan Date: Wed, 17 Apr 2013 11:42:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249583 - in head: include/rpcsvc sys/dev/cas sys/dev/xen/netback sys/fs/devfs sys/fs/msdosfs sys/kern sys/netgraph usr.sbin/nandsim X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2013 11:42:42 -0000 Author: gabor Date: Wed Apr 17 11:42:40 2013 New Revision: 249583 URL: http://svnweb.freebsd.org/changeset/base/249583 Log: - Correct mispellings of the word necessary Submitted by: Christoph Mallon (via private mail) Modified: head/include/rpcsvc/ypxfrd.x head/sys/dev/cas/if_casvar.h head/sys/dev/xen/netback/netback.c head/sys/fs/devfs/devfs_devs.c head/sys/fs/msdosfs/msdosfs_conv.c head/sys/kern/imgact_gzip.c head/sys/netgraph/ng_base.c head/usr.sbin/nandsim/nandsim_cfgparse.c Modified: head/include/rpcsvc/ypxfrd.x ============================================================================== --- head/include/rpcsvc/ypxfrd.x Wed Apr 17 11:40:10 2013 (r249582) +++ head/include/rpcsvc/ypxfrd.x Wed Apr 17 11:42:40 2013 (r249583) @@ -75,7 +75,7 @@ const _YPMAXDOMAIN = 64; const _YPMAXMAP = 64; const _YPMAXPEER = 64; -/* Suggested default -- not necesarrily the one used. */ +/* Suggested default -- not necessarily the one used. */ const YPXFRBLOCK = 32767; /* Modified: head/sys/dev/cas/if_casvar.h ============================================================================== --- head/sys/dev/cas/if_casvar.h Wed Apr 17 11:40:10 2013 (r249582) +++ head/sys/dev/cas/if_casvar.h Wed Apr 17 11:42:40 2013 (r249583) @@ -56,7 +56,7 @@ /* * Receive completion ring size - we have one completion per - * incoming packet (though the opposite isn't necesarrily true), + * incoming packet (though the opposite isn't necessarily true), * so this logic is a little simpler. */ #define CAS_NRXCOMP 4096 Modified: head/sys/dev/xen/netback/netback.c ============================================================================== --- head/sys/dev/xen/netback/netback.c Wed Apr 17 11:40:10 2013 (r249582) +++ head/sys/dev/xen/netback/netback.c Wed Apr 17 11:42:40 2013 (r249583) @@ -1816,7 +1816,7 @@ xnb_recv(netif_tx_back_ring_t *txb, domi /* * if we got here, then 1 or more requests was consumed, but the packet - * is not necesarily valid. + * is not necessarily valid. */ if (xnb_pkt_is_valid(&pkt) == 0) { /* got a garbage packet, respond and drop it */ Modified: head/sys/fs/devfs/devfs_devs.c ============================================================================== --- head/sys/fs/devfs/devfs_devs.c Wed Apr 17 11:40:10 2013 (r249582) +++ head/sys/fs/devfs/devfs_devs.c Wed Apr 17 11:42:40 2013 (r249583) @@ -655,7 +655,7 @@ devfs_cleanup(struct devfs_mount *dm) /* * devfs_create() and devfs_destroy() are called from kern_conf.c and * in both cases the devlock() mutex is held, so no further locking - * is necesary and no sleeping allowed. + * is necessary and no sleeping allowed. */ void Modified: head/sys/fs/msdosfs/msdosfs_conv.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_conv.c Wed Apr 17 11:40:10 2013 (r249582) +++ head/sys/fs/msdosfs/msdosfs_conv.c Wed Apr 17 11:42:40 2013 (r249583) @@ -774,7 +774,7 @@ winSlotCnt(un, unlen, pmp) } /* - * Determine the number of bytes neccesary for Win95 names + * Determine the number of bytes neccessary for Win95 names */ size_t winLenFixup(un, unlen) Modified: head/sys/kern/imgact_gzip.c ============================================================================== --- head/sys/kern/imgact_gzip.c Wed Apr 17 11:40:10 2013 (r249582) +++ head/sys/kern/imgact_gzip.c Wed Apr 17 11:42:40 2013 (r249583) @@ -18,7 +18,7 @@ * inflate isn't quite reentrant yet... * error-handling is a mess... * so is the rest... - * tidy up unnecesary includes + * tidy up unnecessary includes */ #include Modified: head/sys/netgraph/ng_base.c ============================================================================== --- head/sys/netgraph/ng_base.c Wed Apr 17 11:40:10 2013 (r249582) +++ head/sys/netgraph/ng_base.c Wed Apr 17 11:42:40 2013 (r249583) @@ -92,7 +92,7 @@ static void ng_dumphooks(void); #endif /* NETGRAPH_DEBUG */ /* * DEAD versions of the structures. - * In order to avoid races, it is sometimes neccesary to point + * In order to avoid races, it is sometimes necessary to point * at SOMETHING even though theoretically, the current entity is * INVALID. Use these to avoid these races. */ Modified: head/usr.sbin/nandsim/nandsim_cfgparse.c ============================================================================== --- head/usr.sbin/nandsim/nandsim_cfgparse.c Wed Apr 17 11:40:10 2013 (r249582) +++ head/usr.sbin/nandsim/nandsim_cfgparse.c Wed Apr 17 11:42:40 2013 (r249583) @@ -575,7 +575,7 @@ parse_config(char *cfgfname, const char /* * Function tries to get appropriate value for given key, convert it to - * array of ints (of given size), and perform all the neccesary checks and + * array of ints (of given size), and perform all the necessary checks and * conversions. */ static int From owner-svn-src-all@FreeBSD.ORG Wed Apr 17 11:43:47 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 69034A9C; Wed, 17 Apr 2013 11:43:47 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5B9B31AC; Wed, 17 Apr 2013 11:43:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3HBhlQW078418; Wed, 17 Apr 2013 11:43:47 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3HBhlBu078415; Wed, 17 Apr 2013 11:43:47 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201304171143.r3HBhlBu078415@svn.freebsd.org> From: Gabor Kovesdan Date: Wed, 17 Apr 2013 11:43:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249584 - in head/sys: dev/usb/wlan i386/isa X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2013 11:43:47 -0000 Author: gabor Date: Wed Apr 17 11:43:46 2013 New Revision: 249584 URL: http://svnweb.freebsd.org/changeset/base/249584 Log: - Correct mispellings of word miscellaneous Submitted by: Christoph Mallon (via private mail) Modified: head/sys/dev/usb/wlan/if_zydreg.h head/sys/i386/isa/spic.c Modified: head/sys/dev/usb/wlan/if_zydreg.h ============================================================================== --- head/sys/dev/usb/wlan/if_zydreg.h Wed Apr 17 11:42:40 2013 (r249583) +++ head/sys/dev/usb/wlan/if_zydreg.h Wed Apr 17 11:43:46 2013 (r249584) @@ -112,7 +112,7 @@ #define ZYD_MACB_MAX_RETRY 0x9b28 /* - * Miscellanous registers. + * Miscellaneous registers. */ #define ZYD_FIRMWARE_START_ADDR 0xee00 #define ZYD_FIRMWARE_BASE_ADDR 0xee1d /* Firmware base address */ Modified: head/sys/i386/isa/spic.c ============================================================================== --- head/sys/i386/isa/spic.c Wed Apr 17 11:42:40 2013 (r249583) +++ head/sys/i386/isa/spic.c Wed Apr 17 11:43:46 2013 (r249584) @@ -34,7 +34,7 @@ * and mouse button out of the jog dial. I suspect that this device will * end up having to support at least 2 different minor devices: One to be * the jog wheel device for moused to camp out on and the other to perform - * all of the other miscelaneous functions of this device. But for now, + * all of the other miscellaneous functions of this device. But for now, * the jog wheel is all you get. * * At the moment, the data sent back by the device is rather primitive. From owner-svn-src-all@FreeBSD.ORG Wed Apr 17 11:45:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 449ADC42; Wed, 17 Apr 2013 11:45:17 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 275631BE; Wed, 17 Apr 2013 11:45:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3HBjHq8078750; Wed, 17 Apr 2013 11:45:17 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3HBjFLC078737; Wed, 17 Apr 2013 11:45:15 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201304171145.r3HBjFLC078737@svn.freebsd.org> From: Gabor Kovesdan Date: Wed, 17 Apr 2013 11:45:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249585 - in head/sys: cam dev/bktr dev/ppbus dev/sound/pcm netinet pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2013 11:45:17 -0000 Author: gabor Date: Wed Apr 17 11:45:15 2013 New Revision: 249585 URL: http://svnweb.freebsd.org/changeset/base/249585 Log: - Corrrect mispellings of word useful Submitted by: Christoph Mallon (via private mail) Modified: head/sys/cam/cam_periph.h head/sys/dev/bktr/CHANGELOG.TXT head/sys/dev/bktr/bktr_os.c head/sys/dev/ppbus/ppbconf.c head/sys/dev/sound/pcm/dsp.c head/sys/netinet/tcp_subr.c head/sys/pci/ncr.c Modified: head/sys/cam/cam_periph.h ============================================================================== --- head/sys/cam/cam_periph.h Wed Apr 17 11:43:46 2013 (r249584) +++ head/sys/cam/cam_periph.h Wed Apr 17 11:45:15 2013 (r249585) @@ -90,7 +90,7 @@ typedef enum { CAM_PERIPH_BIO } cam_periph_type; -/* Generically usefull offsets into the peripheral private area */ +/* Generically useful offsets into the peripheral private area */ #define ppriv_ptr0 periph_priv.entries[0].ptr #define ppriv_ptr1 periph_priv.entries[1].ptr #define ppriv_field0 periph_priv.entries[0].field Modified: head/sys/dev/bktr/CHANGELOG.TXT ============================================================================== --- head/sys/dev/bktr/CHANGELOG.TXT Wed Apr 17 11:43:46 2013 (r249584) +++ head/sys/dev/bktr/CHANGELOG.TXT Wed Apr 17 11:45:15 2013 (r249585) @@ -285,7 +285,7 @@ Fix row=0/columns=0 bug. From Randal Hopper Add option to block the reset of the MSP34xx audio chip by adding options BKTR_NO_MSP_RESET to the kernel config file. - This is usefull if you run another operating system + This is useful if you run another operating system first to initialise the audio chip, then do a soft reboot. Added for Yuri Gindin Modified: head/sys/dev/bktr/bktr_os.c ============================================================================== --- head/sys/dev/bktr/bktr_os.c Wed Apr 17 11:43:46 2013 (r249584) +++ head/sys/dev/bktr/bktr_os.c Wed Apr 17 11:45:15 2013 (r249585) @@ -404,7 +404,7 @@ bktr_attach( device_t dev ) #if defined( BKTR_SIS_VIA_MODE ) if (bootverbose) printf("Using SiS/VIA chipset compatibilty mode\n"); - fun = fun | 4; /* Enable SiS/VIA compatibility mode (usefull for + fun = fun | 4; /* Enable SiS/VIA compatibility mode (useful for OPTi chipset motherboards too */ #endif pci_write_config(dev, 0x40, fun, 2); Modified: head/sys/dev/ppbus/ppbconf.c ============================================================================== --- head/sys/dev/ppbus/ppbconf.c Wed Apr 17 11:43:46 2013 (r249584) +++ head/sys/dev/ppbus/ppbconf.c Wed Apr 17 11:45:15 2013 (r249585) @@ -531,7 +531,7 @@ ppb_request_bus(device_t bus, device_t d /* restore the context of the device * The first time, ctx.valid is certainly false - * then do not change anything. This is usefull for + * then do not change anything. This is useful for * drivers that do not set there operating mode * during attachement */ Modified: head/sys/dev/sound/pcm/dsp.c ============================================================================== --- head/sys/dev/sound/pcm/dsp.c Wed Apr 17 11:43:46 2013 (r249584) +++ head/sys/dev/sound/pcm/dsp.c Wed Apr 17 11:45:15 2013 (r249585) @@ -2011,7 +2011,7 @@ dsp_ioctl(struct cdev *i_dev, u_long cmd * OSSv4 docs: "All errors and counters will automatically be * cleared to zeroes after the call so each call will return only * the errors that occurred after the previous invocation. ... The - * play_underruns and rec_overrun fields are the only usefull fields + * play_underruns and rec_overrun fields are the only useful fields * returned by OSS 4.0." */ { Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Wed Apr 17 11:43:46 2013 (r249584) +++ head/sys/netinet/tcp_subr.c Wed Apr 17 11:45:15 2013 (r249585) @@ -1060,7 +1060,7 @@ tcp_drain(void) * XXX: The "Net/3" implementation doesn't imply that the TCP * reassembly queue should be flushed, but in a situation * where we're really low on mbufs, this is potentially - * usefull. + * useful. */ INP_INFO_RLOCK(&V_tcbinfo); LIST_FOREACH(inpb, V_tcbinfo.ipi_listhead, inp_list) { Modified: head/sys/pci/ncr.c ============================================================================== --- head/sys/pci/ncr.c Wed Apr 17 11:43:46 2013 (r249584) +++ head/sys/pci/ncr.c Wed Apr 17 11:45:15 2013 (r249585) @@ -4857,7 +4857,7 @@ static void ncr_getsync(ncb_p np, u_char */ fak = (kpc - 1) / div_10M[div] + 1; -#if 0 /* You can #if 1 if you think this optimization is usefull */ +#if 0 /* You can #if 1 if you think this optimization is useful */ per = (fak * div_10M[div]) / clk; From owner-svn-src-all@FreeBSD.ORG Wed Apr 17 11:47:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A0F51DD6; Wed, 17 Apr 2013 11:47:33 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 833351CF; Wed, 17 Apr 2013 11:47:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3HBlXgc079087; Wed, 17 Apr 2013 11:47:33 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3HBlWbP079078; Wed, 17 Apr 2013 11:47:32 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201304171147.r3HBlWbP079078@svn.freebsd.org> From: Gabor Kovesdan Date: Wed, 17 Apr 2013 11:47:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249586 - in head/sys: arm/ti/omap4 dev/isci/scil dev/mxge pc98/pc98 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2013 11:47:33 -0000 Author: gabor Date: Wed Apr 17 11:47:32 2013 New Revision: 249586 URL: http://svnweb.freebsd.org/changeset/base/249586 Log: - Correct mispellings of word resource Submitted by: Christoph Mallon Modified: head/sys/arm/ti/omap4/omap4_prcm_clks.c head/sys/dev/isci/scil/scic_sds_phy.c head/sys/dev/isci/scil/scic_sds_port.c head/sys/dev/isci/scil/scic_sds_port_configuration_agent.c head/sys/dev/mxge/if_mxge.c head/sys/pc98/pc98/canbus.c Modified: head/sys/arm/ti/omap4/omap4_prcm_clks.c ============================================================================== --- head/sys/arm/ti/omap4/omap4_prcm_clks.c Wed Apr 17 11:45:15 2013 (r249585) +++ head/sys/arm/ti/omap4/omap4_prcm_clks.c Wed Apr 17 11:47:32 2013 (r249586) @@ -1003,7 +1003,7 @@ omap4_clk_get_arm_fclk_freq(struct ti_cl /** * omap4_clk_hsusbhost_activate - activates the USB clocks for the given module * @clkdev: pointer to the clock device structure. - * @mem_res: array of memory resouces allocated by the top level PRCM driver. + * @mem_res: array of memory resources allocated by the top level PRCM driver. * * The USB clocking setup seems to be a bit more tricky than the other modules, * to start with the clocking diagram for the HS host module shows 13 different @@ -1153,7 +1153,7 @@ omap4_clk_hsusbhost_activate(struct ti_c /** * omap4_clk_generic_deactivate - checks if a module is accessible * @clkdev: pointer to the clock device structure. - * @mem_res: array of memory resouces allocated by the top level PRCM driver. + * @mem_res: array of memory resources allocated by the top level PRCM driver. * * * @@ -1242,7 +1242,7 @@ omap4_clk_hsusbhost_deactivate(struct ti /** * omap4_clk_hsusbhost_accessible - checks if a module is accessible * @clkdev: pointer to the clock device structure. - * @mem_res: array of memory resouces allocated by the top level PRCM driver. + * @mem_res: array of memory resources allocated by the top level PRCM driver. * * * @@ -1291,7 +1291,7 @@ omap4_clk_hsusbhost_accessible(struct ti * omap4_clk_hsusbhost_set_source - sets the source clocks * @clkdev: pointer to the clock device structure. * @clksrc: the clock source ID for the given clock. - * @mem_res: array of memory resouces allocated by the top level PRCM driver. + * @mem_res: array of memory resources allocated by the top level PRCM driver. * * * Modified: head/sys/dev/isci/scil/scic_sds_phy.c ============================================================================== --- head/sys/dev/isci/scil/scic_sds_phy.c Wed Apr 17 11:45:15 2013 (r249585) +++ head/sys/dev/isci/scil/scic_sds_phy.c Wed Apr 17 11:47:32 2013 (r249586) @@ -975,7 +975,7 @@ void scic_sds_phy_get_attached_phy_proto * * @param[in] controller This parameter specifies the core controller, one of * its phy's resources are to be released. - * @param[in] this_phy This parameter specifies the phy whose resourse is to + * @param[in] this_phy This parameter specifies the phy whose resource is to * be released. */ void scic_sds_phy_release_resource( Modified: head/sys/dev/isci/scil/scic_sds_port.c ============================================================================== --- head/sys/dev/isci/scil/scic_sds_port.c Wed Apr 17 11:45:15 2013 (r249585) +++ head/sys/dev/isci/scil/scic_sds_port.c Wed Apr 17 11:47:32 2013 (r249586) @@ -1537,7 +1537,7 @@ void scic_port_enable_broadcast_change_n * * @param[in] controller This parameter specifies the core controller, one of * its phy's resources are to be released. - * @param[in] this_port This parameter specifies the port whose resourse is to + * @param[in] this_port This parameter specifies the port whose resource is to * be released. */ void scic_sds_port_release_resource( Modified: head/sys/dev/isci/scil/scic_sds_port_configuration_agent.c ============================================================================== --- head/sys/dev/isci/scil/scic_sds_port_configuration_agent.c Wed Apr 17 11:45:15 2013 (r249585) +++ head/sys/dev/isci/scil/scic_sds_port_configuration_agent.c Wed Apr 17 11:47:32 2013 (r249586) @@ -1109,7 +1109,7 @@ void scic_sds_port_configuration_agent_d * * @param[in] controller This parameter specifies the core controller, one of * its phy's resources are to be released. - * @param[in] this_phy This parameter specifies the phy whose resourse is to + * @param[in] this_phy This parameter specifies the phy whose resource is to * be released. */ void scic_sds_port_configuration_agent_release_resource( Modified: head/sys/dev/mxge/if_mxge.c ============================================================================== --- head/sys/dev/mxge/if_mxge.c Wed Apr 17 11:45:15 2013 (r249585) +++ head/sys/dev/mxge/if_mxge.c Wed Apr 17 11:47:32 2013 (r249586) @@ -3418,7 +3418,7 @@ mxge_alloc_slice_rings(struct mxge_slice return err; } - /* now allocate TX resouces */ + /* now allocate TX resources */ #ifndef IFNET_BUF_RING /* only use a single TX ring for now */ Modified: head/sys/pc98/pc98/canbus.c ============================================================================== --- head/sys/pc98/pc98/canbus.c Wed Apr 17 11:45:15 2013 (r249585) +++ head/sys/pc98/pc98/canbus.c Wed Apr 17 11:47:32 2013 (r249586) @@ -62,13 +62,13 @@ struct canbus_softc { /* index register */ int index_id; /* index ID */ - struct resource *index_res; /* index resouce */ + struct resource *index_res; /* index resource */ bus_space_tag_t index_tag; /* index tag */ bus_space_handle_t index_handle; /* index handle */ /* data register */ int data_id; /* data ID */ - struct resource *data_res; /* data resouce */ + struct resource *data_res; /* data resource */ bus_space_tag_t data_tag; /* data tag */ bus_space_handle_t data_handle; /* data handle */ }; From owner-svn-src-all@FreeBSD.ORG Wed Apr 17 11:48:47 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D07A2E9; Wed, 17 Apr 2013 11:48:47 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B33E61EF; Wed, 17 Apr 2013 11:48:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3HBml6x079291; Wed, 17 Apr 2013 11:48:47 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3HBmkwt079287; Wed, 17 Apr 2013 11:48:46 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201304171148.r3HBmkwt079287@svn.freebsd.org> From: Gabor Kovesdan Date: Wed, 17 Apr 2013 11:48:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249587 - in head: share/i18n/csmapper/KAZAKH sys/dev/sound/pci tools/tools/notescheck X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2013 11:48:48 -0000 Author: gabor Date: Wed Apr 17 11:48:46 2013 New Revision: 249587 URL: http://svnweb.freebsd.org/changeset/base/249587 Log: - Correct mispellings of word and Submitted by: Christoph Mallon (via private mail) Modified: head/share/i18n/csmapper/KAZAKH/KZ1048%UCS.src head/share/i18n/csmapper/KAZAKH/UCS%KZ1048.src head/sys/dev/sound/pci/emu10kx.c head/tools/tools/notescheck/notescheck.py Modified: head/share/i18n/csmapper/KAZAKH/KZ1048%UCS.src ============================================================================== --- head/share/i18n/csmapper/KAZAKH/KZ1048%UCS.src Wed Apr 17 11:47:32 2013 (r249586) +++ head/share/i18n/csmapper/KAZAKH/KZ1048%UCS.src Wed Apr 17 11:48:46 2013 (r249587) @@ -23,7 +23,7 @@ BEGIN_MAP # Yes # Published specification(s): # The official Standard STRK1048-2002 was created by the Committee of standartization of -# Ministry of economy and trade of Kazakhstan Republic ans was published in print by the +# Ministry of economy and trade of Kazakhstan Republic and was published in print by the # Kazakhstan Standard Committee, Astana, February 7, 2002 # # Mapping data are available online at http://www.sci.kz/~sairan/kazcode/TableA.html Modified: head/share/i18n/csmapper/KAZAKH/UCS%KZ1048.src ============================================================================== --- head/share/i18n/csmapper/KAZAKH/UCS%KZ1048.src Wed Apr 17 11:47:32 2013 (r249586) +++ head/share/i18n/csmapper/KAZAKH/UCS%KZ1048.src Wed Apr 17 11:48:46 2013 (r249587) @@ -23,7 +23,7 @@ BEGIN_MAP # Yes # Published specification(s): # The official Standard STRK1048-2002 was created by the Committee of standartization of -# Ministry of economy and trade of Kazakhstan Republic ans was published in print by the +# Ministry of economy and trade of Kazakhstan Republic and was published in print by the # Kazakhstan Standard Committee, Astana, February 7, 2002 # # Mapping data are available online at http://www.sci.kz/~sairan/kazcode/TableA.html Modified: head/sys/dev/sound/pci/emu10kx.c ============================================================================== --- head/sys/dev/sound/pci/emu10kx.c Wed Apr 17 11:47:32 2013 (r249586) +++ head/sys/dev/sound/pci/emu10kx.c Wed Apr 17 11:48:46 2013 (r249587) @@ -1928,7 +1928,7 @@ emu_initefx(struct emu_sc_info *sc) /* * Substream map (in byte offsets, each substream is 2 bytes): * 0x00..0x1E - outputs - * 0x20..0x3E - FX, inputs ans sync stream + * 0x20..0x3E - FX, inputs and sync stream */ /* First 2 channels (offset 0x20,0x22) are empty */ Modified: head/tools/tools/notescheck/notescheck.py ============================================================================== --- head/tools/tools/notescheck/notescheck.py Wed Apr 17 11:47:32 2013 (r249586) +++ head/tools/tools/notescheck/notescheck.py Wed Apr 17 11:48:46 2013 (r249587) @@ -93,7 +93,7 @@ class Option: return if global_platform in self.defines: - # If the device is defined globally ans is never tested, whine. + # If the device is defined globally and is never tested, whine. if len(self.tests) == 0: print('WARN: %s is defined globally but never tested' % \ (self.title())) From owner-svn-src-all@FreeBSD.ORG Wed Apr 17 11:56:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E6D41464; Wed, 17 Apr 2013 11:56:12 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D83D324B; Wed, 17 Apr 2013 11:56:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3HBuC6O082057; Wed, 17 Apr 2013 11:56:12 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3HBuB6F082046; Wed, 17 Apr 2013 11:56:11 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201304171156.r3HBuB6F082046@svn.freebsd.org> From: Gabor Kovesdan Date: Wed, 17 Apr 2013 11:56:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249588 - in head: share/i18n/csmapper/KAZAKH sys/amd64/include/xen sys/dev/xen/netback sys/fs/msdosfs sys/i386/isa X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2013 11:56:13 -0000 Author: gabor Date: Wed Apr 17 11:56:11 2013 New Revision: 249588 URL: http://svnweb.freebsd.org/changeset/base/249588 Log: - Correct spelling in comments Submitted by: Christoph Mallon (via private mail) Modified: head/share/i18n/csmapper/KAZAKH/KZ1048%UCS.src head/share/i18n/csmapper/KAZAKH/UCS%KZ1048.src head/sys/amd64/include/xen/xen-os.h head/sys/dev/xen/netback/netback.c head/sys/fs/msdosfs/msdosfs_conv.c head/sys/i386/isa/spic.c Modified: head/share/i18n/csmapper/KAZAKH/KZ1048%UCS.src ============================================================================== --- head/share/i18n/csmapper/KAZAKH/KZ1048%UCS.src Wed Apr 17 11:48:46 2013 (r249587) +++ head/share/i18n/csmapper/KAZAKH/KZ1048%UCS.src Wed Apr 17 11:56:11 2013 (r249588) @@ -22,7 +22,7 @@ BEGIN_MAP # Suitability for use in MIME text: # Yes # Published specification(s): -# The official Standard STRK1048-2002 was created by the Committee of standartization of +# The official Standard STRK1048-2002 was created by the Committee of standardization of # Ministry of economy and trade of Kazakhstan Republic and was published in print by the # Kazakhstan Standard Committee, Astana, February 7, 2002 # Modified: head/share/i18n/csmapper/KAZAKH/UCS%KZ1048.src ============================================================================== --- head/share/i18n/csmapper/KAZAKH/UCS%KZ1048.src Wed Apr 17 11:48:46 2013 (r249587) +++ head/share/i18n/csmapper/KAZAKH/UCS%KZ1048.src Wed Apr 17 11:56:11 2013 (r249588) @@ -22,7 +22,7 @@ BEGIN_MAP # Suitability for use in MIME text: # Yes # Published specification(s): -# The official Standard STRK1048-2002 was created by the Committee of standartization of +# The official Standard STRK1048-2002 was created by the Committee of standardization of # Ministry of economy and trade of Kazakhstan Republic and was published in print by the # Kazakhstan Standard Committee, Astana, February 7, 2002 # Modified: head/sys/amd64/include/xen/xen-os.h ============================================================================== --- head/sys/amd64/include/xen/xen-os.h Wed Apr 17 11:48:46 2013 (r249587) +++ head/sys/amd64/include/xen/xen-os.h Wed Apr 17 11:56:11 2013 (r249588) @@ -2,6 +2,8 @@ * os.h * * random collection of macros and definition + * + * $FreeBSD$ */ #ifndef _XEN_OS_H_ @@ -57,7 +59,7 @@ void trap_init(void); /* * STI/CLI equivalents. These basically set and clear the virtual - * event_enable flag in teh shared_info structure. Note that when + * event_enable flag in the shared_info structure. Note that when * the enable bit is set, there may be pending events to be handled. * We may therefore call into do_hypervisor_callback() directly. */ Modified: head/sys/dev/xen/netback/netback.c ============================================================================== --- head/sys/dev/xen/netback/netback.c Wed Apr 17 11:48:46 2013 (r249587) +++ head/sys/dev/xen/netback/netback.c Wed Apr 17 11:56:11 2013 (r249588) @@ -1811,7 +1811,7 @@ xnb_recv(netif_tx_back_ring_t *txb, domi if (num_consumed == 0) return 0; /* Nothing to receive */ - /* update statistics indepdent of errors */ + /* update statistics independent of errors */ ifnet->if_ipackets++; /* Modified: head/sys/fs/msdosfs/msdosfs_conv.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_conv.c Wed Apr 17 11:48:46 2013 (r249587) +++ head/sys/fs/msdosfs/msdosfs_conv.c Wed Apr 17 11:56:11 2013 (r249588) @@ -788,7 +788,7 @@ winLenFixup(un, unlen) } /* - * Store an area with multi byte string instr, and reterns left + * Store an area with multi byte string instr, and returns left * byte of instr and moves pointer forward. The area's size is * inlen or outlen. */ Modified: head/sys/i386/isa/spic.c ============================================================================== --- head/sys/i386/isa/spic.c Wed Apr 17 11:48:46 2013 (r249587) +++ head/sys/i386/isa/spic.c Wed Apr 17 11:56:11 2013 (r249588) @@ -41,7 +41,7 @@ * It sends a single character per event: * u = up, d = down -- that's the jog button * l = left, r = right -- that's the dial. - * "left" and "right" are rather caprecious. They actually represent + * "left" and "right" are rather capricious. They actually represent * ccw and cw, respectively * * What documentation exists is thanks to Andrew Tridge, and his page at From owner-svn-src-all@FreeBSD.ORG Wed Apr 17 12:05:45 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id CDD4F8FC; Wed, 17 Apr 2013 12:05:45 +0000 (UTC) (envelope-from tijl@freebsd.org) Received: from mailrelay008.isp.belgacom.be (mailrelay008.isp.belgacom.be [195.238.6.174]) by mx1.freebsd.org (Postfix) with ESMTP id 552632F8; Wed, 17 Apr 2013 12:05:43 +0000 (UTC) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmwGABuPblFR8npE/2dsb2JhbABGCoMGNsEMgQQXdIIfAQEEAVYeBQULCxgJFg8JAwIBAgEnHgYNAQcBAReHcwq9P41egTwHCYM9A49VgSmXHIMNOg Received: from 68.122-242-81.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([81.242.122.68]) by relay.skynet.be with ESMTP; 17 Apr 2013 14:05:36 +0200 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.14.6/8.14.6) with ESMTP id r3HC5ZZ1044288; Wed, 17 Apr 2013 14:05:35 +0200 (CEST) (envelope-from tijl@FreeBSD.org) Message-ID: <516E900B.9090300@FreeBSD.org> Date: Wed, 17 Apr 2013 14:05:31 +0200 From: Tijl Coosemans User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:17.0) Gecko/20130408 Thunderbird/17.0.5 MIME-Version: 1.0 To: Tim Kientzle Subject: Re: svn commit: r249484 - head/lib References: <201304141913.r3EJDqPI095965@svn.freebsd.org> <516D54F5.4010501@FreeBSD.org> <2A0FC59F-E043-4B4E-BABE-E16C6A1FBF5C@freebsd.org> <475555FA-DF6A-42FA-990D-4224ECAEAE52@FreeBSD.org> In-Reply-To: <475555FA-DF6A-42FA-990D-4224ECAEAE52@FreeBSD.org> X-Enigmail-Version: 1.5.1 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="----enig2MJRKOHIWUDIFGFPCMTRT" Cc: src-committers@FreeBSD.org, Juli Mallett , svn-src-all@FreeBSD.org, Dimitry Andric , Brooks Davis , svn-src-head@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2013 12:05:45 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2MJRKOHIWUDIFGFPCMTRT Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 2013-04-17 08:26, Tim Kientzle wrote: > On Apr 16, 2013, at 11:06 PM, Juli Mallett wrote: >> On Tue, Apr 16, 2013 at 11:00 PM, Tim Kientzle wrote: >>> On Apr 16, 2013, at 6:41 AM, Tijl Coosemans wrote: >>>> On 2013-04-14 21:13, Tim Kientzle wrote: >>>>> Modified: head/lib/Makefile >>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>>>> --- head/lib/Makefile Sun Apr 14 18:36:30 2013 (r2494= 83) >>>>> +++ head/lib/Makefile Sun Apr 14 19:13:51 2013 (r2494= 84) >>>>> @@ -252,4 +252,7 @@ _libusbhid=3D libusbhid >>>>> _libusb=3D libusb >>>>> .endif >>>>> >>>>> +afterinstall: >>>>> + ln -fs ../include ${DESTDIR}/usr/lib/include >>>>> + >>>>> .include >>>> >>>> This breaks with -DNO_CLEAN defined, because then >>>> ${DESTDIR}/usr/lib/include/include is created. >>> >>> That's a good point. Would this work better? >>> >>> afterinstall: >>> if [ ! -e $(DESTDIR)/usr/lib/include ]; then >>> ln -fs ../include $(DESTDIR)/usr/lib/include >>> fi Maybe just: ln -fs ../include $(DESTDIR)/usr/lib/ >>>> I'm not that fond of this patch by the way, but I don't fully >>>> understand the problem it's trying to solve so I won't object. >>>> It just looks too much like a hack to me >>> >>> It's a subtle issue and I'm not surprised that it raised some >>> eyebrows. I spent a long time looking for a better solution. >>> >>> In short, both GCC and Clang make some assumptions >>> about the layout of headers used for freestanding compiles. >>> (My earlier commit said these assumptions were "undocumented", >>> but that's not quite true, they're just rather obscure.) >> >> If you're doing a freestanding compile...shouldn't you also be >> specifying both include and library paths explicitly? >=20 > Yes, of course. But the correct directories to use vary somewhat > across platforms, so we would like to have some reasonably > portable way to find the right directory to use for building on > a particular system. >=20 > Both gcc and clang support a -print-file-name=3Dinclude option which > is supposed to print out the directory containing headers used > for freestanding compiles. You can then take that path and > use it as the explicit include directory path for freestanding builds. > >> (Or even better, if you're doing a freestanding >> compile, but want the default include paths, get the compiler to dump >> the default include paths and process that.) >=20 > That's precisely what this is for. I've been working with U-Boot > sources which compile on many systems and use > -print-file-name=3Dinclude to identify the directory containing > the basic freestanding header files. So you compile with -ffreestanding -nostdinc? And then add the include path returned by -print-file-name=3Dinclude? > The -print-file-name=3Dinclude option works on Linux, works > on MacOS, and --- with this one symlink --- can work on > FreeBSD as well. I've been using it to cross-build U-Boot > using the FreeBSD xdev toolchain with both GCC and Clang. "clang -E -v - ) # include_next #else =2E.. #endif In the lang/clang port files/patch-tools_clang_lib_Headers_Makefile should be removed I think. It prevents too many useful headers from being installed (e.g. avxintrin.h) ------enig2MJRKOHIWUDIFGFPCMTRT Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iF4EAREIAAYFAlFukA8ACgkQfoCS2CCgtivnDwEAhwB1rOo6vWCU19JorragUE4f l6JggnJGtDZWi5TAccoA/ioO41XLsdwEHl/E5gCrSFA26rrqWjXAcwpkkjbGjtdz =L+uL -----END PGP SIGNATURE----- ------enig2MJRKOHIWUDIFGFPCMTRT-- From owner-svn-src-all@FreeBSD.ORG Wed Apr 17 13:01:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C6D5C3A4; Wed, 17 Apr 2013 13:01:32 +0000 (UTC) (envelope-from jlh@FreeBSD.org) Received: from caravan.chchile.org (caravan.chchile.org [178.32.125.136]) by mx1.freebsd.org (Postfix) with ESMTP id 8FE157D3; Wed, 17 Apr 2013 13:01:32 +0000 (UTC) Received: by caravan.chchile.org (Postfix, from userid 1000) id 79603C3FB4; Wed, 17 Apr 2013 12:54:33 +0000 (UTC) Date: Wed, 17 Apr 2013 14:54:33 +0200 From: Jeremie Le Hen To: Jeremy Chadwick Subject: Re: svn commit: r249549 - in stable/9/sys: amd64/conf i386/conf Message-ID: <20130417125433.GC30222@caravan.chchile.org> Mail-Followup-To: Jeremy Chadwick , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org References: <201304161609.r3GG9SID009937@svn.freebsd.org> <20130416161919.GA80626@icarus.home.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130416161919.GA80626@icarus.home.lan> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2013 13:01:32 -0000 Hi Jeremy, On Tue, Apr 16, 2013 at 09:19:19AM -0700, Jeremy Chadwick wrote: > > Now that this has been enabled by default, I should warn folks of a > caveat that I found in the buildworld/buildkernel framework. It's > easiest to explain like this: > > 1. Install FreeBSD 9.x, svn checkout of stable/9, etc... > 2. Add WITHOUT_CDDL=true to /etc/src.conf > 3. Rebuild + install kernel/world per src/Makefile procedure > 4. Remove WITHOUT_CDDL=true from /etc/src.conf > 5. rm -fr /usr/obj/* > 6. Rebuild world > 7. Rebuild kernel -- fails, stating "ctfconvert: not found". > > For whatever reason the buildkernel bits make the assumption that > ctfconvert exists on the system (presumably in $PATH or possibly a > hard-coded), when ideally it should try to use the recently-built > version in /usr/obj first. I've tested this is a freshly installed 9.1-RELEASE jail and I haven't been biten by the bug you describe. ctfconvert(1) seems to be installed by default in 9.1-RELEASE, this is probably there problem didn't occur. I can easily verify this in the jail: % root@test9:/usr/src # ls -l /usr/bin/ctfconvert /usr/bin/vi /usr/bin/tail % -r-xr-xr-x 1 root wheel 371536 Dec 4 09:33 /usr/bin/ctfconvert % -r-xr-xr-x 1 root wheel 19848 Apr 17 06:28 /usr/bin/tail % -r-xr-xr-x 6 root wheel 346432 Apr 17 06:28 /usr/bin/vi Do you have a theory about why you've got the problem while I haven't? FYI, it seems 9.0-RELEASE also has ctfconvert(1): http://svnweb.freebsd.org/base/release/9.0.0/cddl/usr.bin/ctfconvert/ My guess is tha this might happen if you don't have /usr/bin/ctfconvert. I've just removed it and trying to build kernel again. Regards, -- Jeremie Le Hen Scientists say the world is made up of Protons, Neutrons and Electrons. They forgot to mention Morons. From owner-svn-src-all@FreeBSD.ORG Wed Apr 17 13:53:23 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D009255C; Wed, 17 Apr 2013 13:53:23 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) by mx1.freebsd.org (Postfix) with ESMTP id A8658A4E; Wed, 17 Apr 2013 13:53:23 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id DACA1B94A; Wed, 17 Apr 2013 09:53:21 -0400 (EDT) From: John Baldwin To: Tijl Coosemans Subject: Re: svn commit: r249484 - head/lib Date: Wed, 17 Apr 2013 08:24:28 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; ) References: <201304141913.r3EJDqPI095965@svn.freebsd.org> <475555FA-DF6A-42FA-990D-4224ECAEAE52@FreeBSD.org> <516E900B.9090300@FreeBSD.org> In-Reply-To: <516E900B.9090300@FreeBSD.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201304170824.29210.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 17 Apr 2013 09:53:22 -0400 (EDT) Cc: src-committers@freebsd.org, Brooks Davis , Juli Mallett , svn-src-all@freebsd.org, Dimitry Andric , Tim Kientzle , svn-src-head@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2013 13:53:23 -0000 On Wednesday, April 17, 2013 8:05:31 am Tijl Coosemans wrote: > In the lang/clang port files/patch-tools_clang_lib_Headers_Makefile > should be removed I think. It prevents too many useful headers from > being installed (e.g. avxintrin.h) I have a local patch to that that I've sent to brooks@ previously to let it install all the intrinsic headers as I needed this for using clang on 8.x. --- tools/clang/lib/Headers/Makefile.orig +++ tools/clang/lib/Headers/Makefile @@ -13,7 +13,7 @@ # FIXME: Get version from a common place. HeaderDir := $(PROJ_OBJ_ROOT)/$(BuildMode)/lib/clang/1.0/include -HEADERS := $(notdir $(wildcard $(PROJ_SRC_DIR)/*.h)) +HEADERS := $(notdir $(wildcard $(PROJ_SRC_DIR)/*mm*.h $(PROJ_SRC_DIR)/*intrin*.h $(PROJ_SRC_DIR)/altivec.h $(PROJ_SRC_DIR)/cpuid.h)) OBJHEADERS := $(addprefix $(HeaderDir)/, $(HEADERS)) And then updates to pkg-plist: --- ports/lang/clang/pkg-plist 2013-03-14 02:43:15.953661102 -0400 +++ ports/lang/clang/pkg-plist 2013-03-04 16:35:57.632039413 -0500 @@ -390,19 +390,33 @@ lib/clang/%%PORTVERSION%%/include/__wmmintrin_aes.h lib/clang/%%PORTVERSION%%/include/__wmmintrin_pclmul.h lib/clang/%%PORTVERSION%%/include/ammintrin.h +lib/clang/%%PORTVERSION%%/include/altivec.h lib/clang/%%PORTVERSION%%/include/arm_neon.h +lib/clang/%%PORTVERSION%%/include/avx2intrin.h +lib/clang/%%PORTVERSION%%/include/avxintrin.h +lib/clang/%%PORTVERSION%%/include/bmi2intrin.h +lib/clang/%%PORTVERSION%%/include/bmiintrin.h +lib/clang/%%PORTVERSION%%/include/cpuid.h lib/clang/%%PORTVERSION%%/include/emmintrin.h +lib/clang/%%PORTVERSION%%/include/f16cintrin.h +lib/clang/%%PORTVERSION%%/include/fmaintrin.h +lib/clang/%%PORTVERSION%%/include/fma4intrin.h lib/clang/%%PORTVERSION%%/include/immintrin.h +lib/clang/%%PORTVERSION%%/include/lzcntintrin.h lib/clang/%%PORTVERSION%%/include/mm3dnow.h lib/clang/%%PORTVERSION%%/include/mm_malloc.h lib/clang/%%PORTVERSION%%/include/mmintrin.h lib/clang/%%PORTVERSION%%/include/module.map lib/clang/%%PORTVERSION%%/include/nmmintrin.h lib/clang/%%PORTVERSION%%/include/pmmintrin.h +lib/clang/%%PORTVERSION%%/include/popcntintrin.h +lib/clang/%%PORTVERSION%%/include/rtmintrin.h lib/clang/%%PORTVERSION%%/include/smmintrin.h lib/clang/%%PORTVERSION%%/include/tmmintrin.h lib/clang/%%PORTVERSION%%/include/wmmintrin.h +lib/clang/%%PORTVERSION%%/include/x86intrin.h lib/clang/%%PORTVERSION%%/include/xmmintrin.h +lib/clang/%%PORTVERSION%%/include/xopintrin.h lib/libclang.a lib/libclang.so lib/libclangARCMigrate.a -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Wed Apr 17 15:47:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 63098C2 for ; Wed, 17 Apr 2013 15:47:32 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm30-vm0.bullet.mail.bf1.yahoo.com (nm30-vm0.bullet.mail.bf1.yahoo.com [98.139.213.126]) by mx1.freebsd.org (Postfix) with ESMTP id DCCDF13F for ; Wed, 17 Apr 2013 15:47:31 +0000 (UTC) Received: from [98.139.212.145] by nm30.bullet.mail.bf1.yahoo.com with NNFMP; 17 Apr 2013 15:41:23 -0000 Received: from [98.139.213.1] by tm2.bullet.mail.bf1.yahoo.com with NNFMP; 17 Apr 2013 15:41:23 -0000 Received: from [127.0.0.1] by smtp101.mail.bf1.yahoo.com with NNFMP; 17 Apr 2013 15:41:23 -0000 X-Yahoo-Newman-Id: 305566.95581.bm@smtp101.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: rik1hBwVM1ngBm7eCZT6OxVypD4nTE1qbHz.owyg95QV_JI uIHYQh112FHpBHr8G7MpoioHXqZErvLABnOFbawrys.AZq50KV3QssyxQJik uH5yFoHjaVa_S1Vshkj_V.3FVlMKx_FLU.caczwhZpzsclLd_iK_RteKWzyX TPXQakDjJxGGIZ85qPISKiD2aLh9PhYOl67ycjfwaUadLh_PbXKj9qYno.sj Sh9lppl8QnDd1sxggJDosWkiWAqCqTdlh7x6CL2gyprs._2PlCG7s1kUJqgq BjoHAApD4jrdc5sO5TRnZj8rZ6tQPOvw9ADBqsIVKUI_UM63JoVpNg6YeFKD 9uZQa1KvKpcT4HARmo.6j0DnfLuImusCrahHqxWDZI.fMAtjA1qPAxJRxbUD 3GMlbse0WDtjXjJ7.IB1wGS5IcR.LgQ5phIk64t7B5cXDSBkkOLo2E9zsbPt RpS6PqUPC1m4kM8A8Wu20r3VvNuOCMItwJm5854X746ZInVBay7.gXcyP4V. O4I2Eibf9e9FzdILrHoID68LnepccpbJfFTaTWVxeGjEPLA-- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf X-Rocket-Received: from [192.168.0.102] (pfg@190.157.126.109 with ) by smtp101.mail.bf1.yahoo.com with SMTP; 17 Apr 2013 15:41:23 +0000 UTC Message-ID: <516EC2A0.6090102@FreeBSD.org> Date: Wed, 17 Apr 2013 10:41:20 -0500 From: Pedro Giffuni User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130324 Thunderbird/17.0.4 MIME-Version: 1.0 To: Jeremy Chadwick Subject: Re: make buildkernel for GENERIC 9-STABLE just hangs, no error (was svn commit: r249549 - in stable/9/sys: amd64/conf i386/conf) References: <201304161609.r3GG9SID009937@svn.freebsd.org> <20130417082956.GA98554@icarus.home.lan> In-Reply-To: <20130417082956.GA98554@icarus.home.lan> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: =?ISO-8859-1?Q?Olav_Gr=F8n=E5s_Gjerde?= , svn-src-all@freebsd.org, freebsd-stable@freebsd.org, svn-src-stable-9@freebsd.org, svn-src-stable@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2013 15:47:32 -0000 On 04/17/13 03:29, Jeremy Chadwick wrote: > On Tue, Apr 16, 2013 at 04:09:28PM +0000, Brooks Davis wrote: >> Author: brooks >> Date: Tue Apr 16 16:09:27 2013 >> New Revision: 249549 >> URL: http://svnweb.freebsd.org/changeset/base/249549 >> >> Log: >> MFC (much delayed) 234504: >> >> Enable DTrace hooks in GENERIC. >> >> Modified: >> stable/9/sys/amd64/conf/GENERIC >> stable/9/sys/i386/conf/GENERIC >> Directory Properties: >> stable/9/sys/ (props changed) >> >> ... > And here come the complaints, which warrant responses from key folks who > are in the know: > > http://lists.freebsd.org/pipermail/freebsd-stable/2013-April/073132.html > It looks like 9 days ago there was a change (r249243) that fixed issues on the userland ctf utilities, so you have to update your userland too if it's not recent (make buildworld works fine). Hope that helps, Pedro. From owner-svn-src-all@FreeBSD.ORG Wed Apr 17 15:58:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1D2B3809; Wed, 17 Apr 2013 15:58:39 +0000 (UTC) (envelope-from kientzle@freebsd.org) Received: from monday.kientzle.com (99-115-135-74.uvs.sntcca.sbcglobal.net [99.115.135.74]) by mx1.freebsd.org (Postfix) with ESMTP id D8163214; Wed, 17 Apr 2013 15:58:38 +0000 (UTC) Received: (from root@localhost) by monday.kientzle.com (8.14.4/8.14.4) id r3HFwbbu070858; Wed, 17 Apr 2013 15:58:37 GMT (envelope-from kientzle@freebsd.org) Received: from [192.168.2.123] (CiscoE3000 [192.168.1.65]) by kientzle.com with SMTP id iiv5sbx8nfhcmmcp3vrgpt38me; Wed, 17 Apr 2013 15:58:37 +0000 (UTC) (envelope-from kientzle@freebsd.org) Subject: Re: svn commit: r249484 - head/lib Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: multipart/signed; boundary="Apple-Mail=_3EE0F6AD-4CE8-4E89-BD09-01FEB7BC606B"; protocol="application/pgp-signature"; micalg=pgp-sha1 From: Tim Kientzle In-Reply-To: <516E900B.9090300@FreeBSD.org> Date: Wed, 17 Apr 2013 08:58:36 -0700 Message-Id: References: <201304141913.r3EJDqPI095965@svn.freebsd.org> <516D54F5.4010501@FreeBSD.org> <2A0FC59F-E043-4B4E-BABE-E16C6A1FBF5C@freebsd.org> <475555FA-DF6A-42FA-990D-4224ECAEAE52@FreeBSD.org> <516E900B.9090300@FreeBSD.org> To: Tijl Coosemans X-Mailer: Apple Mail (2.1283) Cc: src-committers@freebsd.org, Juli Mallett , svn-src-all@freebsd.org, Dimitry Andric , Brooks Davis , svn-src-head@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2013 15:58:39 -0000 --Apple-Mail=_3EE0F6AD-4CE8-4E89-BD09-01FEB7BC606B Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=iso-8859-1 On Apr 17, 2013, at 5:05 AM, Tijl Coosemans wrote: > On 2013-04-17 08:26, Tim Kientzle wrote: >> On Apr 16, 2013, at 11:06 PM, Juli Mallett wrote: >>> On Tue, Apr 16, 2013 at 11:00 PM, Tim Kientzle wrote: >>>> On Apr 16, 2013, at 6:41 AM, Tijl Coosemans wrote: >>>>> On 2013-04-14 21:13, Tim Kientzle wrote: >>>>>> Modified: head/lib/Makefile >>>>>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>>>>> --- head/lib/Makefile Sun Apr 14 18:36:30 2013 = (r249483) >>>>>> +++ head/lib/Makefile Sun Apr 14 19:13:51 2013 = (r249484) >>>>>> @@ -252,4 +252,7 @@ _libusbhid=3D libusbhid >>>>>> _libusb=3D libusb >>>>>> .endif >>>>>>=20 >>>>>> +afterinstall: >>>>>> + ln -fs ../include ${DESTDIR}/usr/lib/include >>>>>> + >>>>>> .include >>>>>=20 >>>>> This breaks with -DNO_CLEAN defined, because then >>>>> ${DESTDIR}/usr/lib/include/include is created. >>>>=20 >>>> That's a good point. Would this work better? >>>>=20 >>>> afterinstall: >>>> if [ ! -e $(DESTDIR)/usr/lib/include ]; then >>>> ln -fs ../include $(DESTDIR)/usr/lib/include >>>> fi >=20 > Maybe just: ln -fs ../include $(DESTDIR)/usr/lib/ Ah, yes. That is the obvious answer. I'll change it to that for now. I'm happy to remove it once we have a better answer in place. >>>>> I'm not that fond of this patch by the way, but I don't fully >>>>> understand the problem it's trying to solve so I won't object. >>>>> It just looks too much like a hack to me >>>>=20 >>>> It's a subtle issue and I'm not surprised that it raised some >>>> eyebrows. I spent a long time looking for a better solution. >>>>=20 >>>> In short, both GCC and Clang make some assumptions >>>> about the layout of headers used for freestanding compiles. >>>> (My earlier commit said these assumptions were "undocumented", >>>> but that's not quite true, they're just rather obscure.) >>>=20 >>> If you're doing a freestanding compile...shouldn't you also be >>> specifying both include and library paths explicitly? >>=20 >> Yes, of course. But the correct directories to use vary somewhat >> across platforms, so we would like to have some reasonably >> portable way to find the right directory to use for building on >> a particular system. >>=20 >> Both gcc and clang support a -print-file-name=3Dinclude option which >> is supposed to print out the directory containing headers used >> for freestanding compiles. You can then take that path and >> use it as the explicit include directory path for freestanding = builds. >>=20 >>> (Or even better, if you're doing a freestanding >>> compile, but want the default include paths, get the compiler to = dump >>> the default include paths and process that.) >>=20 >> That's precisely what this is for. I've been working with U-Boot >> sources which compile on many systems and use >> -print-file-name=3Dinclude to identify the directory containing >> the basic freestanding header files. >=20 > So you compile with -ffreestanding -nostdinc? > And then add the include path returned by -print-file-name=3Dinclude? That's what the U-Boot sources do, yes. >> The -print-file-name=3Dinclude option works on Linux, works >> on MacOS, and --- with this one symlink --- can work on >> FreeBSD as well. I've been using it to cross-build U-Boot >> using the FreeBSD xdev toolchain with both GCC and Clang. >=20 > "clang -E -v - /usr/bin/../lib/clang/3.3" to cc1 stage which then complains about > nonexistent directory "/usr/bin/../lib/clang/3.3/include". >=20 > So how about moving /usr/include/clang/3.3 to > /usr/lib/clang/3.3/include? That seems to be the location clang > expects and what lang/clang port uses (in /usr/local). I would certainly like to see that. I presumed that there was some reason this wasn't done in the initial import. > The path from -resource-dir is also searched by -print-file-name. >=20 > All headers from contrib/llvm/tools/clang/lib/Headers would have > to be installed there to have a complete freestanding environment, > but some of those headers would have to be patched to use the base > system header in the hosted case like the stdint.h header does: >=20 > #if __STDC_HOSTED__ && \ > defined(__has_include_next) && __has_include_next() > # include_next > #else > ... > #endif >=20 > In the lang/clang port files/patch-tools_clang_lib_Headers_Makefile > should be removed I think. It prevents too many useful headers from > being installed (e.g. avxintrin.h) That would be great! I can certainly help with some of this but my time is a little tight. While we're talking about freestanding brokenness, is anyone interested in fixing the fact that FreeBSD/ARM requires freestanding programs to be linked against libc? Tim --Apple-Mail=_3EE0F6AD-4CE8-4E89-BD09-01FEB7BC606B Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.18 (Darwin) iQEcBAEBAgAGBQJRbsatAAoJEGMNyGo0rfFBIecH/izjnxPHMXmS6SXkC3hTU4Aq 2rLkGOZY5WvraF/VIiGG/hqamQ7RR+YAqzAIyhcnKFeXMU/U4zd7ac1UbbdGZCNV su8pLzUOtL80iu9dCBtZMhuqJ+/ztr/IL8InrDONjdh1rm7v78/ic0F+NIhsI+/H VUR5udRcKc5C/8niiYQjp/l4gNQCNFPjBwDMc9HCfq7LUVnPBq7Gc+K91EJTZSVY eMBAk8gaFAf6fb4oKOQJsTYmVenBqI9WL9KKsTcafU1WeZ9deAnkjxSZlKGLnF/Y 0EPV6ktP0AyHj9PpD/Dbkfi+mvDU/5ofD9csFpRFFcHm4siBhoTw+FOyySfEVY4= =DJkS -----END PGP SIGNATURE----- --Apple-Mail=_3EE0F6AD-4CE8-4E89-BD09-01FEB7BC606B-- From owner-svn-src-all@FreeBSD.ORG Wed Apr 17 16:00:04 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5C0079CA; Wed, 17 Apr 2013 16:00:04 +0000 (UTC) (envelope-from rpaulo@freebsd.org) Received: from felyko.com (felyko.com [IPv6:2607:f2f8:a528::3:1337:ca7]) by mx1.freebsd.org (Postfix) with ESMTP id 4A723238; Wed, 17 Apr 2013 16:00:04 +0000 (UTC) Received: from [IPv6:2601:9:4d00:3c:a1cf:7ae3:1aa6:8195] (unknown [IPv6:2601:9:4d00:3c:a1cf:7ae3:1aa6:8195]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by felyko.com (Postfix) with ESMTPSA id 5D28E39821; Wed, 17 Apr 2013 09:00:03 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.3 \(1503\)) Subject: Re: svn commit: r249577 - head/sys/amd64/amd64 From: Rui Paulo In-Reply-To: <201304170647.05488.jhb@freebsd.org> Date: Wed, 17 Apr 2013 09:00:03 -0700 Content-Transfer-Encoding: 7bit Message-Id: References: <201304170651.r3H6pHYo087392@svn.freebsd.org> <201304170647.05488.jhb@freebsd.org> To: John Baldwin X-Mailer: Apple Mail (2.1503) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2013 16:00:04 -0000 On 2013/04/17, at 3:47, John Baldwin wrote: > On Wednesday, April 17, 2013 02:51:17 AM Rui Paulo wrote: >> Author: rpaulo >> Date: Wed Apr 17 06:51:17 2013 >> New Revision: 249577 >> URL: http://svnweb.freebsd.org/changeset/base/249577 >> >> Log: >> Print more bits from the standard extended features CPUID which will be >> available in the Haswell architecture (c.f. Intel Document #319433-012A). > > Can you add appropriate constants with comments to x86/include/specialreg.h > and remove the comments from here? (That is how we have documented all the > other feature bits.) Yes, it's in my TODO list. Regards, -- Rui Paulo From owner-svn-src-all@FreeBSD.ORG Wed Apr 17 17:15:13 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0E6EFDFB; Wed, 17 Apr 2013 17:15:13 +0000 (UTC) (envelope-from hiren.panchasara@gmail.com) Received: from mail-ea0-x22b.google.com (mail-ea0-x22b.google.com [IPv6:2a00:1450:4013:c01::22b]) by mx1.freebsd.org (Postfix) with ESMTP id 365DA786; Wed, 17 Apr 2013 17:15:12 +0000 (UTC) Received: by mail-ea0-f171.google.com with SMTP id b15so839824eae.30 for ; Wed, 17 Apr 2013 10:15:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=ie1J0O3M68qFRoT1eCeEZwIgDPwin/Nv8SzXLX6r+HQ=; b=ecgSWLEdWrmqiU03wR81nslHJRUs3xdHdBU2jRlhFlsMDsDNwLWbqY+xiVWiw/QIb/ /8AjaBPLRr5JYEHioAmJSyU8oDMBJkpwXfPvTxQMU/bdXGIx5/6RhPMEgd1fgVYl/jiG 8ToozNY7mkBbqaMHpOgpAkZk9EOJkGnAF3HRhsQA5RQTt2qwG9NW7FXeiVI8+c1PCHjO 3NHA2DWTA9Nr6e6Kmut3Lwf/hhe7N30QkfqUPol14blApQMlTEwsDDe1fQ1Gk/A71Siq km1rl9ie8OuJXLrdcEB5T92c3CzJ0dN6x46ng3ipBND3k+f1IWSVdM+L170iOhv2WSrB mEPQ== MIME-Version: 1.0 X-Received: by 10.14.219.8 with SMTP id l8mr20135311eep.40.1366218911331; Wed, 17 Apr 2013 10:15:11 -0700 (PDT) Sender: hiren.panchasara@gmail.com Received: by 10.15.91.72 with HTTP; Wed, 17 Apr 2013 10:15:11 -0700 (PDT) In-Reply-To: <201304161210.09058.jhb@freebsd.org> References: <201304140242.r3E2geSq094403@svn.freebsd.org> <201304161210.09058.jhb@freebsd.org> Date: Wed, 17 Apr 2013 10:15:11 -0700 X-Google-Sender-Auth: KEc0hZRjDAmECyFQvcvznp_5_Yk Message-ID: Subject: Re: svn commit: r249461 - head/sys/dev/ips From: hiren panchasara To: John Baldwin Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2013 17:15:13 -0000 On Tue, Apr 16, 2013 at 9:10 AM, John Baldwin wrote: > On Saturday, April 13, 2013 10:42:40 pm Hiren Panchasara wrote: >> Author: hiren >> Date: Sun Apr 14 02:42:40 2013 >> New Revision: 249461 >> URL: http://svnweb.freebsd.org/changeset/base/249461 >> >> Log: >> Fixing a clang warning indicating uninitialized variable usage. >> >> PR: kern/177164 >> Approved by: sbruno (mentor) > > Hmm, I always thought that dmatags and maps were opaque types and not > necessarily "known" in consumers to be pointers. (Some drivers do check tehm > against NULL implicitly via 'if (map)' or 'if (tag)', but well-behaved drivers > use other means (flags, etc.) to know if they are valid.) Hi John, Would this be a better fix? We do not need to do any clean up if we fail to create the tag: Index: ips.c =================================================================== --- ips.c (revision 249588) +++ ips.c (working copy) @@ -578,7 +578,7 @@ { int error; bus_dma_tag_t dmatag; - bus_dmamap_t dmamap = NULL; + bus_dmamap_t dmamap; if (bus_dma_tag_create( /* parent */ sc->adapter_dmatag, /* alignemnt */ 1, /* boundary */ 0, @@ -595,7 +595,7 @@ &dmatag) != 0) { device_printf(sc->dev, "can't alloc dma tag for statue queue\n"); error = ENOMEM; - goto exit; + return error; } if(bus_dmamem_alloc(dmatag, (void *)&(sc->copper_queue), BUS_DMA_NOWAIT, &dmamap)){ Thanks, Hiren > > -- > John Baldwin From owner-svn-src-all@FreeBSD.ORG Wed Apr 17 17:34:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5D113725; Wed, 17 Apr 2013 17:34:01 +0000 (UTC) (envelope-from dim@freebsd.org) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:7b8:3a7:1:2d0:b7ff:fea0:8c26]) by mx1.freebsd.org (Postfix) with ESMTP id 1CF22871; Wed, 17 Apr 2013 17:34:01 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7::dc79:2881:589:7d77] (unknown [IPv6:2001:7b8:3a7:0:dc79:2881:589:7d77]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 5B0165C45; Wed, 17 Apr 2013 19:33:59 +0200 (CEST) Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Mac OS X Mail 6.3 \(1503\)) Subject: Re: svn commit: r249484 - head/lib From: Dimitry Andric In-Reply-To: Date: Wed, 17 Apr 2013 19:33:45 +0200 Content-Transfer-Encoding: 7bit Message-Id: <1FEABB1B-ADDE-412A-9D40-F9FB2822B654@freebsd.org> References: <201304141913.r3EJDqPI095965@svn.freebsd.org> <516D54F5.4010501@FreeBSD.org> <2A0FC59F-E043-4B4E-BABE-E16C6A1FBF5C@freebsd.org> <475555FA-DF6A-42FA-990D-4224ECAEAE52@FreeBSD.org> <516E900B.9090300@FreeBSD.org> To: Tim Kientzle X-Mailer: Apple Mail (2.1503) Cc: Ed Schouten , src-committers@freebsd.org, Juli Mallett , svn-src-all@freebsd.org, Brooks Davis , svn-src-head@freebsd.org, Tijl Coosemans X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2013 17:34:01 -0000 On Apr 17, 2013, at 17:58, Tim Kientzle wrote: > On Apr 17, 2013, at 5:05 AM, Tijl Coosemans wrote: ... >> So you compile with -ffreestanding -nostdinc? >> And then add the include path returned by -print-file-name=include? > > That's what the U-Boot sources do, yes. Why would U-Boot want to build for a freestanding environment, then include standard headers? Isn't that a bit backwards? :-) >>> The -print-file-name=include option works on Linux, works >>> on MacOS, and --- with this one symlink --- can work on >>> FreeBSD as well. I've been using it to cross-build U-Boot >>> using the FreeBSD xdev toolchain with both GCC and Clang. >> >> "clang -E -v - > /usr/bin/../lib/clang/3.3" to cc1 stage which then complains about >> nonexistent directory "/usr/bin/../lib/clang/3.3/include". >> >> So how about moving /usr/include/clang/3.3 to >> /usr/lib/clang/3.3/include? That seems to be the location clang >> expects and what lang/clang port uses (in /usr/local). > > I would certainly like to see that. I presumed that there > was some reason this wasn't done in the initial import. Probably because headers belong under /usr/include, not in a library directory? I do not really agree with upstream's decision to place their internal headers in that location. Third-party software depending on their exact location is just a little braindead IMHO. In any case, the layout has been like this since the initial clangbsd import, and I never saw any reason to change it. Maybe Ed can tell a bit more, since he seems to have done the initial infrastructure setup. >> The path from -resource-dir is also searched by -print-file-name. >> >> All headers from contrib/llvm/tools/clang/lib/Headers would have >> to be installed there to have a complete freestanding environment, >> but some of those headers would have to be patched to use the base >> system header in the hosted case like the stdint.h header does: >> >> #if __STDC_HOSTED__ && \ >> defined(__has_include_next) && __has_include_next() >> # include_next >> #else >> ... >> #endif Indeed, some of clang's internal headers currently conflict with our own, due to several declarations and definitions, and therefore we do not install them at this time. Again, this could be changed, but not without good reason. One specific third-party project is not enough, I think. (Especially since our kernel is also freestanding, and does not depend on these internals.) From owner-svn-src-all@FreeBSD.ORG Wed Apr 17 17:42:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5FECBAA5; Wed, 17 Apr 2013 17:42:58 +0000 (UTC) (envelope-from dimitry@andric.com) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:7b8:3a7:1:2d0:b7ff:fea0:8c26]) by mx1.freebsd.org (Postfix) with ESMTP id 2336C8D0; Wed, 17 Apr 2013 17:42:58 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7::dc79:2881:589:7d77] (unknown [IPv6:2001:7b8:3a7:0:dc79:2881:589:7d77]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 6743D5C45; Wed, 17 Apr 2013 19:42:57 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.3 \(1503\)) Subject: Re: make buildkernel for GENERIC 9-STABLE just hangs, no error (was svn commit: r249549 - in stable/9/sys: amd64/conf i386/conf) From: Dimitry Andric In-Reply-To: <516EC2A0.6090102@FreeBSD.org> Date: Wed, 17 Apr 2013 19:42:43 +0200 Content-Transfer-Encoding: 7bit Message-Id: <13CE3D12-75A7-46A9-920A-F12753E8CF7A@andric.com> References: <201304161609.r3GG9SID009937@svn.freebsd.org> <20130417082956.GA98554@icarus.home.lan> <516EC2A0.6090102@FreeBSD.org> To: Pedro Giffuni X-Mailer: Apple Mail (2.1503) Cc: Jeremy Chadwick , freebsd-stable@freebsd.org, svn-src-stable@freebsd.org, svn-src-all@freebsd.org, svn-src-stable-9@freebsd.org, =?iso-8859-1?Q?Olav_Gr=F8n=E5s_Gjerde?= X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2013 17:42:58 -0000 On Apr 17, 2013, at 17:41, Pedro Giffuni wrote: > On 04/17/13 03:29, Jeremy Chadwick wrote: >> On Tue, Apr 16, 2013 at 04:09:28PM +0000, Brooks Davis wrote: >>> Author: brooks >>> Date: Tue Apr 16 16:09:27 2013 >>> New Revision: 249549 >>> URL: http://svnweb.freebsd.org/changeset/base/249549 >>> >>> Log: >>> MFC (much delayed) 234504: >>> Enable DTrace hooks in GENERIC. >>> >>> Modified: >>> stable/9/sys/amd64/conf/GENERIC >>> stable/9/sys/i386/conf/GENERIC >>> Directory Properties: >>> stable/9/sys/ (props changed) >>> >>> ... >> And here come the complaints, which warrant responses from key folks who >> are in the know: >> >> http://lists.freebsd.org/pipermail/freebsd-stable/2013-April/073132.html >> > > It looks like 9 days ago there was a change (r249243) that fixed > issues on the userland ctf utilities, so you have to update your > userland too if it's not recent (make buildworld works fine). That was only a fix for certain DWARF attributes emitted by clang and/or newer gcc's, which would cause ctfmerge to error out. If ctfmerge is hanging, that is almost certainly another problem. That is, if it is really hanging, isn't it just very slow, maybe? What happens if the original poster lets it run for e.g. an hour? From owner-svn-src-all@FreeBSD.ORG Wed Apr 17 18:02:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DB4ED156; Wed, 17 Apr 2013 18:02:32 +0000 (UTC) (envelope-from olavgg@gmail.com) Received: from mail-lb0-f175.google.com (mail-lb0-f175.google.com [209.85.217.175]) by mx1.freebsd.org (Postfix) with ESMTP id A6BD19CB; Wed, 17 Apr 2013 18:02:31 +0000 (UTC) Received: by mail-lb0-f175.google.com with SMTP id o10so1887240lbi.20 for ; Wed, 17 Apr 2013 11:02:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=zhD3PfcKZ0mzzjc0BBw078I4sJzw58AplrCbs2Ag6Rw=; b=K4kcmPxC1EiNNGidFVq2ObBsZiMmHRKTTmCPtOrOvc2s86Z61aK28REdze3apRXNRq bfAAvTFntbPZ+NhOigjn/SN5f7eU0T+aO8fGiM1yY6Xu6azRRfckt3jhwo3+548DVmuB H6kfB1Whzxj6fllHgj9ojI6ttwfiNRppHf+p8MMdMQIo50szSuOUXvs8SocHf2ADhNb3 C1pFFrCr8HMXlQqhw5PNNWJVpWTjq3Jy/UwKkGYzGGISe6XSjZKjgbxAkk4ftx4rPUPp J+0EKrlCUYA9/MJ2IWrZXP6GD/G4R6C0eYW/QyzFAvbPKwViCErNdRpubnbCang6nAOk n0TA== MIME-Version: 1.0 X-Received: by 10.152.120.40 with SMTP id kz8mr4049092lab.32.1366221744595; Wed, 17 Apr 2013 11:02:24 -0700 (PDT) Received: by 10.112.23.232 with HTTP; Wed, 17 Apr 2013 11:02:24 -0700 (PDT) In-Reply-To: <13CE3D12-75A7-46A9-920A-F12753E8CF7A@andric.com> References: <201304161609.r3GG9SID009937@svn.freebsd.org> <20130417082956.GA98554@icarus.home.lan> <516EC2A0.6090102@FreeBSD.org> <13CE3D12-75A7-46A9-920A-F12753E8CF7A@andric.com> Date: Wed, 17 Apr 2013 20:02:24 +0200 Message-ID: Subject: Re: make buildkernel for GENERIC 9-STABLE just hangs, no error (was svn commit: r249549 - in stable/9/sys: amd64/conf i386/conf) From: =?ISO-8859-1?Q?Olav_Gr=F8n=E5s_Gjerde?= To: Dimitry Andric Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: Jeremy Chadwick , FreeBSD Stable Mailing List , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, svn-src-stable-9@freebsd.org, Pedro Giffuni X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2013 18:02:32 -0000 I have to admit that I didn't wait for an hour, as buildkernel usually complete within 30 minutes on my system. I just tried to build the kernel on another very similar system, no problems there. I forgot to mention that I tried to upgrade from an 8-STABLE from last summer directly to the latest 9-STABLE. Most likely its just something very wrong with my setup and a complete reinstallation would probably be a good idea. Thanks for your help. On Wed, Apr 17, 2013 at 7:42 PM, Dimitry Andric wrote: > On Apr 17, 2013, at 17:41, Pedro Giffuni wrote: > > On 04/17/13 03:29, Jeremy Chadwick wrote: > >> On Tue, Apr 16, 2013 at 04:09:28PM +0000, Brooks Davis wrote: > >>> Author: brooks > >>> Date: Tue Apr 16 16:09:27 2013 > >>> New Revision: 249549 > >>> URL: http://svnweb.freebsd.org/changeset/base/249549 > >>> > >>> Log: > >>> MFC (much delayed) 234504: > >>> Enable DTrace hooks in GENERIC. > >>> > >>> Modified: > >>> stable/9/sys/amd64/conf/GENERIC > >>> stable/9/sys/i386/conf/GENERIC > >>> Directory Properties: > >>> stable/9/sys/ (props changed) > >>> > >>> ... > >> And here come the complaints, which warrant responses from key folks who > >> are in the know: > >> > >> > http://lists.freebsd.org/pipermail/freebsd-stable/2013-April/073132.html > >> > > > > It looks like 9 days ago there was a change (r249243) that fixed > > issues on the userland ctf utilities, so you have to update your > > userland too if it's not recent (make buildworld works fine). > > That was only a fix for certain DWARF attributes emitted by clang and/or > newer gcc's, which would cause ctfmerge to error out. > > If ctfmerge is hanging, that is almost certainly another problem. That > is, if it is really hanging, isn't it just very slow, maybe? What > happens if the original poster lets it run for e.g. an hour? > > From owner-svn-src-all@FreeBSD.ORG Wed Apr 17 18:11:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0A1CF937; Wed, 17 Apr 2013 18:11:18 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) by mx1.freebsd.org (Postfix) with ESMTP id 4C896B0C; Wed, 17 Apr 2013 18:11:17 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 3CADBB977; Wed, 17 Apr 2013 14:11:16 -0400 (EDT) From: John Baldwin To: hiren panchasara Subject: Re: svn commit: r249461 - head/sys/dev/ips Date: Wed, 17 Apr 2013 13:19:26 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; ) References: <201304140242.r3E2geSq094403@svn.freebsd.org> <201304161210.09058.jhb@freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201304171319.26560.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 17 Apr 2013 14:11:16 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2013 18:11:18 -0000 On Wednesday, April 17, 2013 1:15:11 pm hiren panchasara wrote: > On Tue, Apr 16, 2013 at 9:10 AM, John Baldwin wrote: > > On Saturday, April 13, 2013 10:42:40 pm Hiren Panchasara wrote: > >> Author: hiren > >> Date: Sun Apr 14 02:42:40 2013 > >> New Revision: 249461 > >> URL: http://svnweb.freebsd.org/changeset/base/249461 > >> > >> Log: > >> Fixing a clang warning indicating uninitialized variable usage. > >> > >> PR: kern/177164 > >> Approved by: sbruno (mentor) > > > > Hmm, I always thought that dmatags and maps were opaque types and not > > necessarily "known" in consumers to be pointers. (Some drivers do check tehm > > against NULL implicitly via 'if (map)' or 'if (tag)', but well-behaved drivers > > use other means (flags, etc.) to know if they are valid.) > > Hi John, > > Would this be a better fix? We do not need to do any clean up if we > fail to create the tag: > > Index: ips.c > =================================================================== > --- ips.c (revision 249588) > +++ ips.c (working copy) > @@ -578,7 +578,7 @@ > { > int error; > bus_dma_tag_t dmatag; > - bus_dmamap_t dmamap = NULL; > + bus_dmamap_t dmamap; > if (bus_dma_tag_create( /* parent */ sc->adapter_dmatag, > /* alignemnt */ 1, > /* boundary */ 0, > @@ -595,7 +595,7 @@ > &dmatag) != 0) { > device_printf(sc->dev, "can't alloc dma tag for > statue queue\n"); > error = ENOMEM; > - goto exit; > + return error; > } > if(bus_dmamem_alloc(dmatag, (void *)&(sc->copper_queue), > BUS_DMA_NOWAIT, &dmamap)){ That would be fine. I would actually prefer though that this only call bus_dmamem_free() if the alloc succeeds, so in addition I would make the call to bus_dmammem_free() conditional on sc->copper_queue != NULL. Thanks. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Wed Apr 17 18:26:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 758387D9; Wed, 17 Apr 2013 18:26:02 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 67C34D48; Wed, 17 Apr 2013 18:26:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3HIQ2HN006001; Wed, 17 Apr 2013 18:26:02 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3HIQ2AZ006000; Wed, 17 Apr 2013 18:26:02 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201304171826.r3HIQ2AZ006000@svn.freebsd.org> From: Adrian Chadd Date: Wed, 17 Apr 2013 18:26:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249589 - head/sys/mips/malta X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2013 18:26:02 -0000 Author: adrian Date: Wed Apr 17 18:26:01 2013 New Revision: 249589 URL: http://svnweb.freebsd.org/changeset/base/249589 Log: Add the static kernel boot environment, needed to actually boot this thing. (Wasting 4k just as a temporary placeholder for a boot environment seems a bit ridiculous, but hey.) Tested: gxemul: $ gxemul -e malta -d i:/home/adrian/work/freebsd/svn/mfsroot-rspro.img -C 4Kc /tftpboot/kernel.MALTA Modified: head/sys/mips/malta/malta_machdep.c Modified: head/sys/mips/malta/malta_machdep.c ============================================================================== --- head/sys/mips/malta/malta_machdep.c Wed Apr 17 11:56:11 2013 (r249588) +++ head/sys/mips/malta/malta_machdep.c Wed Apr 17 18:26:01 2013 (r249589) @@ -83,6 +83,11 @@ void lcd_puts(char *); void malta_reset(void); /* + * Temporary boot environment used at startup. + */ +static char boot1_env[4096]; + +/* * Offsets to MALTA LCD characters. */ static int malta_lcd_offs[] = { @@ -278,6 +283,7 @@ platform_start(__register_t a0, __regist mips_pcpu0_init(); platform_counter_freq = malta_cpu_freq(); mips_timer_early_init(platform_counter_freq); + init_static_kenv(boot1_env, sizeof(boot1_env)); cninit(); printf("entry: platform_start()\n"); From owner-svn-src-all@FreeBSD.ORG Wed Apr 17 18:30:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 769FBA31 for ; Wed, 17 Apr 2013 18:30:31 +0000 (UTC) (envelope-from andy@fud.org.nz) Received: from mail-pb0-f48.google.com (mail-pb0-f48.google.com [209.85.160.48]) by mx1.freebsd.org (Postfix) with ESMTP id 5455BD7F for ; Wed, 17 Apr 2013 18:30:31 +0000 (UTC) Received: by mail-pb0-f48.google.com with SMTP id xb4so1005859pbc.21 for ; Wed, 17 Apr 2013 11:30:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :x-gm-message-state; bh=baNdXZd6dzrvuCerNkYI10xh7+npb9/IFlHg1NpMtRE=; b=Q07PTyGl+gdnrpyP36brDXNEtraYLB32W5VFzUolK7kL/t6I6eaW42Ylor0ppSdSNe cAbdJuAOPMcScvn/YMuuPQRzAHi2sKwBezyt69F8P4HmvidY6XAvQ/qfeNZotDJipSKB cmYb0ehkAJAdTrR1ki7aUe4F3l+VTKhE84dKaOtOq2BO1pZ5GjiEzrSCSpEcci22aM4Q KPdZ6zOWGDMSpZC5zYU9SaJpX0Tt3qgBWKLQgZKil8AByYtCYgAH7+oAidTMUJR4TzLS MScLHer6ca8P8xICORSSxYBJAUCJoPrDe+j1PicDJ03Hp3BLpSS+bngcUWtMQcZ2CD9F ulHw== MIME-Version: 1.0 X-Received: by 10.68.78.68 with SMTP id z4mr10229966pbw.161.1366223425281; Wed, 17 Apr 2013 11:30:25 -0700 (PDT) Sender: andy@fud.org.nz Received: by 10.70.94.197 with HTTP; Wed, 17 Apr 2013 11:30:25 -0700 (PDT) In-Reply-To: <201304171826.r3HIQ2AZ006000@svn.freebsd.org> References: <201304171826.r3HIQ2AZ006000@svn.freebsd.org> Date: Thu, 18 Apr 2013 06:30:25 +1200 X-Google-Sender-Auth: z-aCVC8cgtRPDJ6GxBBZxdBuK68 Message-ID: Subject: Re: svn commit: r249589 - head/sys/mips/malta From: Andrew Thompson To: Adrian Chadd X-Gm-Message-State: ALoCoQl/bkLuSUOSd1i7V0VUYbDh+UA9z7APbuQU4PXICWH1ERjez0GLDxX3jqjmg5lL1wnFUq+l Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2013 18:30:31 -0000 On 18 April 2013 06:26, Adrian Chadd wrote: > Author: adrian > Date: Wed Apr 17 18:26:01 2013 > New Revision: 249589 > URL: http://svnweb.freebsd.org/changeset/base/249589 > > Log: > Add the static kernel boot environment, needed to actually boot this > thing. > > (Wasting 4k just as a temporary placeholder for a boot environment seems > a bit ridiculous, but hey.) > This isnt needed anymore, see r249570. From owner-svn-src-all@FreeBSD.ORG Wed Apr 17 18:36:50 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7E95ECC2; Wed, 17 Apr 2013 18:36:50 +0000 (UTC) (envelope-from hiren.panchasara@gmail.com) Received: from mail-ea0-x236.google.com (mail-ea0-x236.google.com [IPv6:2a00:1450:4013:c01::236]) by mx1.freebsd.org (Postfix) with ESMTP id A30E7DD4; Wed, 17 Apr 2013 18:36:49 +0000 (UTC) Received: by mail-ea0-f182.google.com with SMTP id q15so872263ead.27 for ; Wed, 17 Apr 2013 11:36:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=FJREa9EEbVlhnoh/wIdDh4O1a3ysehMZxwBlptVvbuQ=; b=UvN6uUpe360j/1cc9lynjUYz/DfN2XW6tTxSedH2A/WvCWU8TFpeWQ9h5tBodTicRR ZTEEQbzU5AZhxwn+THT/9XWHJRcEafG65/ywp826UrvtKS4BvrEDxcGEKG69H2ylWHFy CCHv7ddbK6fA086Tmdg/bpPPxNB4B8jtVB7snBL3IgWbxj5BLtNntedsw2jO0FvLTU8P qjPNx7qJrn5yhKHWWfZEEDiie5FK7NpHb6zY5JZd0K85O27o+IfP5gBo/zosb79DO0dS OtIMc1MNCGbomAL4TWKXfdZbkwPMkJaDziggiCCnrpZehSYgCZYrK8vu8d5z+VKYJUmN XDkw== MIME-Version: 1.0 X-Received: by 10.14.5.137 with SMTP id 9mr20945212eel.30.1366223808825; Wed, 17 Apr 2013 11:36:48 -0700 (PDT) Sender: hiren.panchasara@gmail.com Received: by 10.15.91.72 with HTTP; Wed, 17 Apr 2013 11:36:48 -0700 (PDT) In-Reply-To: <201304171319.26560.jhb@freebsd.org> References: <201304140242.r3E2geSq094403@svn.freebsd.org> <201304161210.09058.jhb@freebsd.org> <201304171319.26560.jhb@freebsd.org> Date: Wed, 17 Apr 2013 11:36:48 -0700 X-Google-Sender-Auth: WhbUwXSFpCMhHoPaNqk2WPGExeU Message-ID: Subject: Re: svn commit: r249461 - head/sys/dev/ips From: hiren panchasara To: John Baldwin Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2013 18:36:50 -0000 On Wed, Apr 17, 2013 at 10:19 AM, John Baldwin wrote: > On Wednesday, April 17, 2013 1:15:11 pm hiren panchasara wrote: >> On Tue, Apr 16, 2013 at 9:10 AM, John Baldwin wrote: >> > On Saturday, April 13, 2013 10:42:40 pm Hiren Panchasara wrote: >> >> Author: hiren >> >> Date: Sun Apr 14 02:42:40 2013 >> >> New Revision: 249461 >> >> URL: http://svnweb.freebsd.org/changeset/base/249461 >> >> >> >> Log: >> >> Fixing a clang warning indicating uninitialized variable usage. >> >> >> >> PR: kern/177164 >> >> Approved by: sbruno (mentor) >> > >> > Hmm, I always thought that dmatags and maps were opaque types and not >> > necessarily "known" in consumers to be pointers. (Some drivers do check tehm >> > against NULL implicitly via 'if (map)' or 'if (tag)', but well-behaved drivers >> > use other means (flags, etc.) to know if they are valid.) >> >> Hi John, >> >> Would this be a better fix? We do not need to do any clean up if we >> fail to create the tag: >> >> Index: ips.c >> =================================================================== >> --- ips.c (revision 249588) >> +++ ips.c (working copy) >> @@ -578,7 +578,7 @@ >> { >> int error; >> bus_dma_tag_t dmatag; >> - bus_dmamap_t dmamap = NULL; >> + bus_dmamap_t dmamap; >> if (bus_dma_tag_create( /* parent */ sc->adapter_dmatag, >> /* alignemnt */ 1, >> /* boundary */ 0, >> @@ -595,7 +595,7 @@ >> &dmatag) != 0) { >> device_printf(sc->dev, "can't alloc dma tag for >> statue queue\n"); >> error = ENOMEM; >> - goto exit; >> + return error; >> } >> if(bus_dmamem_alloc(dmatag, (void *)&(sc->copper_queue), >> BUS_DMA_NOWAIT, &dmamap)){ > > That would be fine. I would actually prefer though that this only > call bus_dmamem_free() if the alloc succeeds, so in addition I would > make the call to bus_dmammem_free() conditional on sc->copper_queue != NULL. > Makes sense, final patch looks like this: Index: ips.c =================================================================== --- ips.c (revision 249588) +++ ips.c (working copy) @@ -578,7 +578,7 @@ { int error; bus_dma_tag_t dmatag; - bus_dmamap_t dmamap = NULL; + bus_dmamap_t dmamap; if (bus_dma_tag_create( /* parent */ sc->adapter_dmatag, /* alignemnt */ 1, /* boundary */ 0, @@ -595,7 +595,7 @@ &dmatag) != 0) { device_printf(sc->dev, "can't alloc dma tag for statue queue\n"); error = ENOMEM; - goto exit; + return error; } if(bus_dmamem_alloc(dmatag, (void *)&(sc->copper_queue), BUS_DMA_NOWAIT, &dmamap)){ @@ -623,7 +623,8 @@ return 0; exit: - bus_dmamem_free(dmatag, sc->copper_queue, dmamap); + if (sc->copper_queue != NULL) + bus_dmamem_free(dmatag, sc->copper_queue, dmamap); bus_dma_tag_destroy(dmatag); return error; } Thanks, Hiren > Thanks. > > -- > John Baldwin From owner-svn-src-all@FreeBSD.ORG Wed Apr 17 18:43:34 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 58D93141; Wed, 17 Apr 2013 18:43:34 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4B4FAE61; Wed, 17 Apr 2013 18:43:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3HIhYGQ011608; Wed, 17 Apr 2013 18:43:34 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3HIhYjJ011607; Wed, 17 Apr 2013 18:43:34 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201304171843.r3HIhYjJ011607@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 17 Apr 2013 18:43:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249590 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2013 18:43:34 -0000 Author: glebius Date: Wed Apr 17 18:43:33 2013 New Revision: 249590 URL: http://svnweb.freebsd.org/changeset/base/249590 Log: On non-ACPI i386 mp_ncpus is initialized at SI_SUB_CPU, and this prevents us from creating UMA_ZONE_PCPU zones earlier. As bandaid shift initialization of counter(9) zone later. Reviewed by: kib Reported & tested by: Lytochkin Boris Modified: head/sys/kern/subr_counter.c Modified: head/sys/kern/subr_counter.c ============================================================================== --- head/sys/kern/subr_counter.c Wed Apr 17 18:26:01 2013 (r249589) +++ head/sys/kern/subr_counter.c Wed Apr 17 18:43:33 2013 (r249590) @@ -106,4 +106,4 @@ counter_startup(void) uint64_pcpu_zone = uma_zcreate("uint64 pcpu", sizeof(uint64_t), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_PCPU); } -SYSINIT(counter, SI_SUB_KMEM, SI_ORDER_ANY, counter_startup, NULL); +SYSINIT(counter, SI_SUB_CPU, SI_ORDER_FOURTH, counter_startup, NULL); From owner-svn-src-all@FreeBSD.ORG Wed Apr 17 19:02:21 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E57E1B1B; Wed, 17 Apr 2013 19:02:21 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) by mx1.freebsd.org (Postfix) with ESMTP id BA9B2F57; Wed, 17 Apr 2013 19:02:21 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 3AAE3B918; Wed, 17 Apr 2013 15:02:21 -0400 (EDT) From: John Baldwin To: hiren panchasara Subject: Re: svn commit: r249461 - head/sys/dev/ips Date: Wed, 17 Apr 2013 14:51:45 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; ) References: <201304140242.r3E2geSq094403@svn.freebsd.org> <201304171319.26560.jhb@freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201304171451.45400.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 17 Apr 2013 15:02:21 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2013 19:02:22 -0000 On Wednesday, April 17, 2013 2:36:48 pm hiren panchasara wrote: > On Wed, Apr 17, 2013 at 10:19 AM, John Baldwin wrote: > > On Wednesday, April 17, 2013 1:15:11 pm hiren panchasara wrote: > >> On Tue, Apr 16, 2013 at 9:10 AM, John Baldwin wrote: > >> > On Saturday, April 13, 2013 10:42:40 pm Hiren Panchasara wrote: > >> >> Author: hiren > >> >> Date: Sun Apr 14 02:42:40 2013 > >> >> New Revision: 249461 > >> >> URL: http://svnweb.freebsd.org/changeset/base/249461 > >> >> > >> >> Log: > >> >> Fixing a clang warning indicating uninitialized variable usage. > >> >> > >> >> PR: kern/177164 > >> >> Approved by: sbruno (mentor) > >> > > >> > Hmm, I always thought that dmatags and maps were opaque types and not > >> > necessarily "known" in consumers to be pointers. (Some drivers do check tehm > >> > against NULL implicitly via 'if (map)' or 'if (tag)', but well-behaved drivers > >> > use other means (flags, etc.) to know if they are valid.) > >> > >> Hi John, > >> > >> Would this be a better fix? We do not need to do any clean up if we > >> fail to create the tag: > >> > >> Index: ips.c > >> =================================================================== > >> --- ips.c (revision 249588) > >> +++ ips.c (working copy) > >> @@ -578,7 +578,7 @@ > >> { > >> int error; > >> bus_dma_tag_t dmatag; > >> - bus_dmamap_t dmamap = NULL; > >> + bus_dmamap_t dmamap; > >> if (bus_dma_tag_create( /* parent */ sc- >adapter_dmatag, > >> /* alignemnt */ 1, > >> /* boundary */ 0, > >> @@ -595,7 +595,7 @@ > >> &dmatag) != 0) { > >> device_printf(sc->dev, "can't alloc dma tag for > >> statue queue\n"); > >> error = ENOMEM; > >> - goto exit; > >> + return error; > >> } > >> if(bus_dmamem_alloc(dmatag, (void *)&(sc->copper_queue), > >> BUS_DMA_NOWAIT, &dmamap)){ > > > > That would be fine. I would actually prefer though that this only > > call bus_dmamem_free() if the alloc succeeds, so in addition I would > > make the call to bus_dmammem_free() conditional on sc->copper_queue != NULL. > > > > Makes sense, final patch looks like this: > > Index: ips.c > =================================================================== > --- ips.c (revision 249588) > +++ ips.c (working copy) > @@ -578,7 +578,7 @@ > { > int error; > bus_dma_tag_t dmatag; > - bus_dmamap_t dmamap = NULL; > + bus_dmamap_t dmamap; > if (bus_dma_tag_create( /* parent */ sc->adapter_dmatag, > /* alignemnt */ 1, > /* boundary */ 0, > @@ -595,7 +595,7 @@ > &dmatag) != 0) { > device_printf(sc->dev, "can't alloc dma tag for > statue queue\n"); > error = ENOMEM; > - goto exit; > + return error; One more suggestion: just use 'return (ENOMEM)' directly perhaps. > } > if(bus_dmamem_alloc(dmatag, (void *)&(sc->copper_queue), > BUS_DMA_NOWAIT, &dmamap)){ > @@ -623,7 +623,8 @@ > > return 0; > exit: > - bus_dmamem_free(dmatag, sc->copper_queue, dmamap); > + if (sc->copper_queue != NULL) > + bus_dmamem_free(dmatag, sc->copper_queue, dmamap); > bus_dma_tag_destroy(dmatag); > return error; > } > > Thanks, > Hiren Looks ok to me with or without the suggestion above. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Wed Apr 17 19:35:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id DDDB9B1D for ; Wed, 17 Apr 2013 19:35:39 +0000 (UTC) (envelope-from jdc@koitsu.org) Received: from qmta01.emeryville.ca.mail.comcast.net (qmta01.emeryville.ca.mail.comcast.net [IPv6:2001:558:fe2d:43:76:96:30:16]) by mx1.freebsd.org (Postfix) with ESMTP id C378118D for ; Wed, 17 Apr 2013 19:35:39 +0000 (UTC) Received: from omta19.emeryville.ca.mail.comcast.net ([76.96.30.76]) by qmta01.emeryville.ca.mail.comcast.net with comcast id R2rB1l0061eYJf8A17bf7m; Wed, 17 Apr 2013 19:35:39 +0000 Received: from koitsu.strangled.net ([67.180.84.87]) by omta19.emeryville.ca.mail.comcast.net with comcast id R7be1l00i1t3BNj017beii; Wed, 17 Apr 2013 19:35:39 +0000 Received: by icarus.home.lan (Postfix, from userid 1000) id 8E79373A33; Wed, 17 Apr 2013 12:35:38 -0700 (PDT) Date: Wed, 17 Apr 2013 12:35:38 -0700 From: Jeremy Chadwick To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: Re: svn commit: r249549 - in stable/9/sys: amd64/conf i386/conf Message-ID: <20130417193538.GB9331@icarus.home.lan> References: <201304161609.r3GG9SID009937@svn.freebsd.org> <20130416161919.GA80626@icarus.home.lan> <20130417125433.GC30222@caravan.chchile.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130417125433.GC30222@caravan.chchile.org> User-Agent: Mutt/1.5.21 (2010-09-15) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20121106; t=1366227339; bh=GfsjwVqjZnYZ0Rhz5n0JUW3cyCKnZ2D9amEGJ6uekOM=; h=Received:Received:Received:Date:From:To:Subject:Message-ID: MIME-Version:Content-Type; b=nL+yIpLWxMUwJ6t3/lHnEn6IAEiNC9+SJhdTtWPfiZbmNPYCR3d/RXHjQi3aODYQA ZsLCfb+YCBUR384h0OUvuyFQqB/BWmc7jvfsPhgv4kHaS+KPlvhSAQtG29OEcLQm/x TBgYe6WWEZ8qPS9yYvSwGVLbyfmaJNvoBD3NU4M6tuW0fSUU1p7+W8aZ0fwqHWWg0x +e+/Oi+0DX9hiPsLhW+32Dmwfi4VX9LxmcFa88tSgi43OjPezJnxnKUSgbTVckZv14 Y7ThTtOGqwvle6ain1Ip9R3Hi+97lo3GBLgxcY5zkXTpmQ5XybT3qwfj4hEqGbZVWt zfubNxQaimFJA== X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2013 19:35:39 -0000 On Wed, Apr 17, 2013 at 02:54:33PM +0200, Jeremie Le Hen wrote: > Hi Jeremy, > > On Tue, Apr 16, 2013 at 09:19:19AM -0700, Jeremy Chadwick wrote: > > > > Now that this has been enabled by default, I should warn folks of a > > caveat that I found in the buildworld/buildkernel framework. It's > > easiest to explain like this: > > > > 1. Install FreeBSD 9.x, svn checkout of stable/9, etc... > > 2. Add WITHOUT_CDDL=true to /etc/src.conf > > 3. Rebuild + install kernel/world per src/Makefile procedure > > 4. Remove WITHOUT_CDDL=true from /etc/src.conf > > 5. rm -fr /usr/obj/* > > 6. Rebuild world > > 7. Rebuild kernel -- fails, stating "ctfconvert: not found". > > > > For whatever reason the buildkernel bits make the assumption that > > ctfconvert exists on the system (presumably in $PATH or possibly a > > hard-coded), when ideally it should try to use the recently-built > > version in /usr/obj first. > > I've tested this is a freshly installed 9.1-RELEASE jail and I haven't > been biten by the bug you describe. > > ctfconvert(1) seems to be installed by default in 9.1-RELEASE, this is > probably there problem didn't occur. I can easily verify this in the > jail: > > % root@test9:/usr/src # ls -l /usr/bin/ctfconvert /usr/bin/vi /usr/bin/tail > % -r-xr-xr-x 1 root wheel 371536 Dec 4 09:33 /usr/bin/ctfconvert > % -r-xr-xr-x 1 root wheel 19848 Apr 17 06:28 /usr/bin/tail > % -r-xr-xr-x 6 root wheel 346432 Apr 17 06:28 /usr/bin/vi > > > Do you have a theory about why you've got the problem while I haven't? > FYI, it seems 9.0-RELEASE also has ctfconvert(1): > http://svnweb.freebsd.org/base/release/9.0.0/cddl/usr.bin/ctfconvert/ > > My guess is tha this might happen if you don't have /usr/bin/ctfconvert. > I've just removed it and trying to build kernel again. I will spend some time to figure out exactly how to reproduce this. Going from recent memory (~2 weeks ago), I encountered it on my VPS box (which does run ntpd, just FYI): 1. Initially installed with 9.1-RELEASE, 2. Upgraded to stable/9 (using svn), 3. WITHOUT_CDDL=true and WITHOUT_ZFS=true added to /etc/src.conf 4. world/kernel rebuilt/reinstalled/etc. (this includes make delete-old, as per instructions in src/Makefile -- which would delete /usr/bin/ctfconvert) 5. Fast forward many months 6. Removed WITHOUT_CDDL=true from src.conf 7. Encountered the above issue ("ctfconvert: not found") during buildkernel 8. Rebuilt kernel again -- same error 9. Removed WITHOUT_ZFS=true from src.conf 10. Rebuilt kernel again -- worked This could mean WITHOUT_ZFS=true has some bearing on this situation, but I don't see how/why, as WITHOUT_CDDL is supposed to be the "trigger" for ctf* utilities. I did poke around the Makefiles and framework a bit but didn't have any epiphanies. Like I said -- I'll try to reproduce the exact scenario. -- | Jeremy Chadwick jdc@koitsu.org | | UNIX Systems Administrator http://jdc.koitsu.org/ | | Mountain View, CA, US | | Making life hard for others since 1977. PGP 4BD6C0CB | From owner-svn-src-all@FreeBSD.ORG Wed Apr 17 19:39:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A6C3FCFB; Wed, 17 Apr 2013 19:39:07 +0000 (UTC) (envelope-from tijl@freebsd.org) Received: from mailrelay009.isp.belgacom.be (mailrelay009.isp.belgacom.be [195.238.6.176]) by mx1.freebsd.org (Postfix) with ESMTP id 338721B9; Wed, 17 Apr 2013 19:39:06 +0000 (UTC) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ao8GAO/5blFR8npE/2dsb2JhbABQgwbAe4EDF3SCHwEBBVYeBRALDgoJFg8JAwIBAgEnHgYNAQUCAQGIFL1UjxoHg0YDj1WBKZccgw06 Received: from 68.122-242-81.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([81.242.122.68]) by relay.skynet.be with ESMTP; 17 Apr 2013 21:39:04 +0200 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.14.6/8.14.6) with ESMTP id r3HJd32w027779; Wed, 17 Apr 2013 21:39:03 +0200 (CEST) (envelope-from tijl@FreeBSD.org) Message-ID: <516EFA52.1020509@FreeBSD.org> Date: Wed, 17 Apr 2013 21:38:58 +0200 From: Tijl Coosemans User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:17.0) Gecko/20130408 Thunderbird/17.0.5 MIME-Version: 1.0 To: Dimitry Andric Subject: Re: svn commit: r249484 - head/lib References: <201304141913.r3EJDqPI095965@svn.freebsd.org> <516D54F5.4010501@FreeBSD.org> <2A0FC59F-E043-4B4E-BABE-E16C6A1FBF5C@freebsd.org> <475555FA-DF6A-42FA-990D-4224ECAEAE52@FreeBSD.org> <516E900B.9090300@FreeBSD.org> <1FEABB1B-ADDE-412A-9D40-F9FB2822B654@freebsd.org> In-Reply-To: <1FEABB1B-ADDE-412A-9D40-F9FB2822B654@freebsd.org> X-Enigmail-Version: 1.5.1 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="----enig2PVDBTXUOHUXKPNDTHPTS" Cc: Ed Schouten , src-committers@freebsd.org, Juli Mallett , svn-src-all@freebsd.org, Tim Kientzle , svn-src-head@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2013 19:39:07 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2PVDBTXUOHUXKPNDTHPTS Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 2013-04-17 19:33, Dimitry Andric wrote: > On Apr 17, 2013, at 17:58, Tim Kientzle wrote: >> On Apr 17, 2013, at 5:05 AM, Tijl Coosemans wrote: >>> So you compile with -ffreestanding -nostdinc? >>> And then add the include path returned by -print-file-name=3Dinclude?= >> >> That's what the U-Boot sources do, yes. >=20 > Why would U-Boot want to build for a freestanding environment, then > include standard headers? Isn't that a bit backwards? :-) There's a list of headers in the standard that freestanding programs are allowed to include. If they drop -nostdinc it should build on FreeBSD. I suppose they use it to prevent accidental use of non-freestanding stuff in the headers. >>>> The -print-file-name=3Dinclude option works on Linux, works >>>> on MacOS, and --- with this one symlink --- can work on >>>> FreeBSD as well. I've been using it to cross-build U-Boot >>>> using the FreeBSD xdev toolchain with both GCC and Clang. >>> >>> "clang -E -v - >> /usr/bin/../lib/clang/3.3" to cc1 stage which then complains about >>> nonexistent directory "/usr/bin/../lib/clang/3.3/include". >>> >>> So how about moving /usr/include/clang/3.3 to >>> /usr/lib/clang/3.3/include? That seems to be the location clang >>> expects and what lang/clang port uses (in /usr/local). >> >> I would certainly like to see that. I presumed that there >> was some reason this wasn't done in the initial import. >=20 > Probably because headers belong under /usr/include, not in a library > directory? I do not really agree with upstream's decision to place > their internal headers in that location. Third-party software dependin= g > on their exact location is just a little braindead IMHO. It doesn't really depend on the exact location. It relies on -print-file-name=3Dinclude to return the location which our clang doesn't. I agree that headers don't belong under lib/, but that's something to discuss upstream. FreeBSD doing little things like this differently than everybody else just makes it harder to use imho. ------enig2PVDBTXUOHUXKPNDTHPTS Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iF4EAREIAAYFAlFu+lcACgkQfoCS2CCgtit3zAD/euMtxrfGhBft/9CTyimsbPEq 7v4SescnPjGXg+FujOwA/0Qw8QwIQTiHJ3L0lAufJRZfCtXBclyjXspKJbJARafI =3sLp -----END PGP SIGNATURE----- ------enig2PVDBTXUOHUXKPNDTHPTS-- From owner-svn-src-all@FreeBSD.ORG Wed Apr 17 19:47:02 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id AE26071; Wed, 17 Apr 2013 19:47:02 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (lor.one-eyed-alien.net [69.66.77.232]) by mx1.freebsd.org (Postfix) with ESMTP id EE06B216; Wed, 17 Apr 2013 19:47:01 +0000 (UTC) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.5/8.14.5) with ESMTP id r3HJl6IA030644; Wed, 17 Apr 2013 14:47:06 -0500 (CDT) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.5/8.14.5/Submit) id r3HJl6CP030643; Wed, 17 Apr 2013 14:47:06 -0500 (CDT) (envelope-from brooks) Date: Wed, 17 Apr 2013 14:47:06 -0500 From: Brooks Davis To: Jeremy Chadwick Subject: Re: svn commit: r249549 - in stable/9/sys: amd64/conf i386/conf Message-ID: <20130417194706.GA30583@lor.one-eyed-alien.net> References: <201304161609.r3GG9SID009937@svn.freebsd.org> <20130416161919.GA80626@icarus.home.lan> <20130417125433.GC30222@caravan.chchile.org> <20130417193538.GB9331@icarus.home.lan> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="lrZ03NoBR/3+SXJZ" Content-Disposition: inline In-Reply-To: <20130417193538.GB9331@icarus.home.lan> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-9@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2013 19:47:02 -0000 --lrZ03NoBR/3+SXJZ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Apr 17, 2013 at 12:35:38PM -0700, Jeremy Chadwick wrote: > On Wed, Apr 17, 2013 at 02:54:33PM +0200, Jeremie Le Hen wrote: > > Hi Jeremy, > >=20 > > On Tue, Apr 16, 2013 at 09:19:19AM -0700, Jeremy Chadwick wrote: > > >=20 > > > Now that this has been enabled by default, I should warn folks of a > > > caveat that I found in the buildworld/buildkernel framework. It's > > > easiest to explain like this: > > >=20 > > > 1. Install FreeBSD 9.x, svn checkout of stable/9, etc... > > > 2. Add WITHOUT_CDDL=3Dtrue to /etc/src.conf > > > 3. Rebuild + install kernel/world per src/Makefile procedure > > > 4. Remove WITHOUT_CDDL=3Dtrue from /etc/src.conf > > > 5. rm -fr /usr/obj/* > > > 6. Rebuild world > > > 7. Rebuild kernel -- fails, stating "ctfconvert: not found". > > >=20 > > > For whatever reason the buildkernel bits make the assumption that > > > ctfconvert exists on the system (presumably in $PATH or possibly a > > > hard-coded), when ideally it should try to use the recently-built > > > version in /usr/obj first. > >=20 > > I've tested this is a freshly installed 9.1-RELEASE jail and I haven't > > been biten by the bug you describe. > >=20 > > ctfconvert(1) seems to be installed by default in 9.1-RELEASE, this is > > probably there problem didn't occur. I can easily verify this in the > > jail: > >=20 > > % root@test9:/usr/src # ls -l /usr/bin/ctfconvert /usr/bin/vi /usr/bin/= tail=20 > > % -r-xr-xr-x 1 root wheel 371536 Dec 4 09:33 /usr/bin/ctfconvert > > % -r-xr-xr-x 1 root wheel 19848 Apr 17 06:28 /usr/bin/tail > > % -r-xr-xr-x 6 root wheel 346432 Apr 17 06:28 /usr/bin/vi > >=20 > >=20 > > Do you have a theory about why you've got the problem while I haven't? > > FYI, it seems 9.0-RELEASE also has ctfconvert(1): > > http://svnweb.freebsd.org/base/release/9.0.0/cddl/usr.bin/ctfconvert/ > >=20 > > My guess is tha this might happen if you don't have /usr/bin/ctfconvert. > > I've just removed it and trying to build kernel again. >=20 > I will spend some time to figure out exactly how to reproduce this. >=20 > Going from recent memory (~2 weeks ago), I encountered it on my VPS box > (which does run ntpd, just FYI): >=20 > 1. Initially installed with 9.1-RELEASE, > 2. Upgraded to stable/9 (using svn), > 3. WITHOUT_CDDL=3Dtrue and WITHOUT_ZFS=3Dtrue added to /etc/src.conf > 4. world/kernel rebuilt/reinstalled/etc. (this includes make delete-old, > as per instructions in src/Makefile -- which would delete > /usr/bin/ctfconvert) > 5. Fast forward many months > 6. Removed WITHOUT_CDDL=3Dtrue from src.conf > 7. Encountered the above issue ("ctfconvert: not found") during > buildkernel > 8. Rebuilt kernel again -- same error > 9. Removed WITHOUT_ZFS=3Dtrue from src.conf > 10. Rebuilt kernel again -- worked >=20 > This could mean WITHOUT_ZFS=3Dtrue has some bearing on this situation, but > I don't see how/why, as WITHOUT_CDDL is supposed to be the "trigger" for > ctf* utilities. I did poke around the Makefiles and framework a bit > but didn't have any epiphanies. >=20 > Like I said -- I'll try to reproduce the exact scenario. Looking at Makefile.inc1 around line 1164 (on HEAD), ctfconvert and cftmerge are bootstrap tools only when they don't exist at all on the host. The code there should be expanded to bootstrap for cases where the installed ones are known to be broken (virtually all prior versions given recent fixes) as well as when they aren't present on the host system. -- Brooks --lrZ03NoBR/3+SXJZ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iD8DBQFRbvw6XY6L6fI4GtQRAiuUAJ4mPg0mE6gpPG7bTmsXJsK3SVC5MQCeKEKg 4CziCb7VgncsyxPGVgCRUmE= =qHIJ -----END PGP SIGNATURE----- --lrZ03NoBR/3+SXJZ-- From owner-svn-src-all@FreeBSD.ORG Wed Apr 17 20:19:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B1DE38A2; Wed, 17 Apr 2013 20:19:32 +0000 (UTC) (envelope-from jlh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A4D92362; Wed, 17 Apr 2013 20:19:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3HKJWVB040805; Wed, 17 Apr 2013 20:19:32 GMT (envelope-from jlh@svn.freebsd.org) Received: (from jlh@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3HKJWRr040804; Wed, 17 Apr 2013 20:19:32 GMT (envelope-from jlh@svn.freebsd.org) Message-Id: <201304172019.r3HKJWRr040804@svn.freebsd.org> From: Jeremie Le Hen Date: Wed, 17 Apr 2013 20:19:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249591 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2013 20:19:32 -0000 Author: jlh Date: Wed Apr 17 20:19:32 2013 New Revision: 249591 URL: http://svnweb.freebsd.org/changeset/base/249591 Log: Document jail__parameters option. The description explains why we should not configure "path", "host.hostname", "command", "ip4.addr" and ip6.addr" parameters with this, but rather use the historical rc.conf(5) options. MFC after: 3 days Modified: head/share/man/man5/rc.conf.5 Modified: head/share/man/man5/rc.conf.5 ============================================================================== --- head/share/man/man5/rc.conf.5 Wed Apr 17 18:43:33 2013 (r249590) +++ head/share/man/man5/rc.conf.5 Wed Apr 17 20:19:32 2013 (r249591) @@ -3982,6 +3982,42 @@ Set to the root directory used by jail Unset by default. Set to the fully qualified domain name (FQDN) assigned to jail .Va jname . +.It Va jail_ Ns Ao Ar jname Ac Ns Va _parameters +.Pq Vt str +Unset by default. +Set extra parameters for jail +.Va jname , +such as +.Dq Li allow.chflags +or +.Dq Li children.max . +See +.Xr jail 8 +for a list of available parameters. +Note that the following parameters are already defined by +.Pa rc.d/jail +script out of their corresponding +.Nm +variables: +.Bl -tag -width "host.hostname" -offset indent +.It Li path +set from +.Va jail_ Ns Ao Ar jname Ac Ns Va _rootdir +.It Li host.hostname +set from +.Va jail_ Ns Ao Ar jname Ac Ns Va _hostname +.It Li command +set from +.Va jail_ Ns Ao Ar jname Ac Ns Va _exec_start +.It Li ip4.addr +set if +.Va jail_ Ns Ao Ar jname Ac Ns Va _ip +contains IPv4 addresses +.It Li ip6.addr +set if +.Va jail_ Ns Ao Ar jname Ac Ns Va _ip6 +contains IPv6 addresses +.El .It Va jail_ Ns Ao Ar jname Ac Ns Va _ip .Pq Vt str Unset by default. From owner-svn-src-all@FreeBSD.ORG Wed Apr 17 20:41:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id F1850F09; Wed, 17 Apr 2013 20:41:26 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-we0-x22d.google.com (mail-we0-x22d.google.com [IPv6:2a00:1450:400c:c03::22d]) by mx1.freebsd.org (Postfix) with ESMTP id 26B36653; Wed, 17 Apr 2013 20:41:26 +0000 (UTC) Received: by mail-we0-f173.google.com with SMTP id t57so1519369wey.4 for ; Wed, 17 Apr 2013 13:41:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=pDs4F1J2x9GtMlqNxdXPsLrRHz9PJ/Kp7DNbxTRDjLY=; b=UpO0qW8rzCj+hj/hZf0oZark3SQCbVBBAHW6aPH/3PqsZ/WwZGDA2rmVDEYkvhC/K2 y7mc4OAdVq25n6iuUbcduEKiASP7V7QS6c3ctPk2VZTScJTjr/rohzGV6wAM3iH716hA lzWdni8RhjkEcC7lWKgUcBJJ/bv5vyYocW6a/kRNukeoXFGlaA4yYBNfSA8d9zL6xQxe jzzfUySVoiJfnSduKbmOqGPHPYodKC5ynzcYGeGm89OLImecoWmfdJfPHJLr8S+GvnQ7 hVCd4Se8+E8Kqyy7q7BQbMpGtnhfVxBclL5buGgMU9D+lbL+0xP1RCXHfpsfw7JXRslh DDbQ== MIME-Version: 1.0 X-Received: by 10.180.85.103 with SMTP id g7mr28889832wiz.23.1366231285331; Wed, 17 Apr 2013 13:41:25 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.217.88.129 with HTTP; Wed, 17 Apr 2013 13:41:25 -0700 (PDT) In-Reply-To: References: <201304171826.r3HIQ2AZ006000@svn.freebsd.org> Date: Wed, 17 Apr 2013 13:41:25 -0700 X-Google-Sender-Auth: TR757z_fx5DpQYPCqv1pgRQL4Cs Message-ID: Subject: Re: svn commit: r249589 - head/sys/mips/malta From: Adrian Chadd To: Andrew Thompson Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2013 20:41:27 -0000 On 17 April 2013 11:30, Andrew Thompson wrote: > > This isnt needed anymore, see r249570. Ah, cool! adrian From owner-svn-src-all@FreeBSD.ORG Wed Apr 17 21:00:12 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id AC967583; Wed, 17 Apr 2013 21:00:12 +0000 (UTC) (envelope-from jlh@FreeBSD.org) Received: from caravan.chchile.org (caravan.chchile.org [178.32.125.136]) by mx1.freebsd.org (Postfix) with ESMTP id 7586F770; Wed, 17 Apr 2013 21:00:12 +0000 (UTC) Received: by caravan.chchile.org (Postfix, from userid 1000) id 28175C31D8; Wed, 17 Apr 2013 21:00:11 +0000 (UTC) Date: Wed, 17 Apr 2013 23:00:11 +0200 From: Jeremie Le Hen To: Brooks Davis Subject: Re: svn commit: r249549 - in stable/9/sys: amd64/conf i386/conf Message-ID: <20130417210011.GD30222@caravan.chchile.org> Mail-Followup-To: Brooks Davis , Jeremy Chadwick , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-stable@FreeBSD.org, svn-src-stable-9@FreeBSD.org References: <201304161609.r3GG9SID009937@svn.freebsd.org> <20130416161919.GA80626@icarus.home.lan> <20130417125433.GC30222@caravan.chchile.org> <20130417193538.GB9331@icarus.home.lan> <20130417194706.GA30583@lor.one-eyed-alien.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130417194706.GA30583@lor.one-eyed-alien.net> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Jeremy Chadwick , svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-9@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2013 21:00:12 -0000 On Wed, Apr 17, 2013 at 02:47:06PM -0500, Brooks Davis wrote: > > > I will spend some time to figure out exactly how to reproduce this. > > > > Going from recent memory (~2 weeks ago), I encountered it on my VPS box > > (which does run ntpd, just FYI): > > > > 1. Initially installed with 9.1-RELEASE, > > 2. Upgraded to stable/9 (using svn), > > 3. WITHOUT_CDDL=true and WITHOUT_ZFS=true added to /etc/src.conf > > 4. world/kernel rebuilt/reinstalled/etc. (this includes make delete-old, > > as per instructions in src/Makefile -- which would delete > > /usr/bin/ctfconvert) > > 5. Fast forward many months > > 6. Removed WITHOUT_CDDL=true from src.conf > > 7. Encountered the above issue ("ctfconvert: not found") during > > buildkernel > > 8. Rebuilt kernel again -- same error > > 9. Removed WITHOUT_ZFS=true from src.conf > > 10. Rebuilt kernel again -- worked > > > > This could mean WITHOUT_ZFS=true has some bearing on this situation, but > > I don't see how/why, as WITHOUT_CDDL is supposed to be the "trigger" for > > ctf* utilities. I did poke around the Makefiles and framework a bit > > but didn't have any epiphanies. > > > > Like I said -- I'll try to reproduce the exact scenario. > > Looking at Makefile.inc1 around line 1164 (on HEAD), ctfconvert and > cftmerge are bootstrap tools only when they don't exist at all on the > host. The code there should be expanded to bootstrap for cases where > the installed ones are known to be broken (virtually all prior versions > given recent fixes) as well as when they aren't present on the host > system. Do you have an idea how we can identify whether the installed ctfconvert(1) is broken or not? I think in Jeremy's case we cannot rely on OSRELDATE given that right before he built and installed world with WITHOUT_CDDL, so ctfconvert and OSRELDATE are not in sync. Why not just always add ctfconvert to bootstrap tools when it is needed? I don't know how long it takes to build though, but it is probably nothing compared to LLVM ;-). -- Jeremie Le Hen Scientists say the world is made up of Protons, Neutrons and Electrons. They forgot to mention Morons. From owner-svn-src-all@FreeBSD.ORG Wed Apr 17 21:00:25 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D03DE6A2; Wed, 17 Apr 2013 21:00:25 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C17F7772; Wed, 17 Apr 2013 21:00:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3HL0PLN054969; Wed, 17 Apr 2013 21:00:25 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3HL0Mrv054939; Wed, 17 Apr 2013 21:00:22 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201304172100.r3HL0Mrv054939@svn.freebsd.org> From: "Kenneth D. Merry" Date: Wed, 17 Apr 2013 21:00:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249592 - in head/sys: conf fs/nfs fs/nfsclient fs/nfsserver modules/nfsd modules/nfsserver nfsserver X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2013 21:00:25 -0000 Author: ken Date: Wed Apr 17 21:00:22 2013 New Revision: 249592 URL: http://svnweb.freebsd.org/changeset/base/249592 Log: Revamp the old NFS server's File Handle Affinity (FHA) code so that it will work with either the old or new server. The FHA code keeps a cache of currently active file handles for NFSv2 and v3 requests, so that read and write requests for the same file are directed to the same group of threads (reads) or thread (writes). It does not currently work for NFSv4 requests. They are more complex, and will take more work to support. This improves read-ahead performance, especially with ZFS, if the FHA tuning parameters are configured appropriately. Without the FHA code, concurrent reads that are part of a sequential read from a file will be directed to separate NFS threads. This has the effect of confusing the ZFS zfetch (prefetch) code and makes sequential reads significantly slower with clients like Linux that do a lot of prefetching. The FHA code has also been updated to direct write requests to nearby file offsets to the same thread in the same way it batches reads, and the FHA code will now also send writes to multiple threads when needed. This improves sequential write performance in ZFS, because writes to a file are now more ordered. Since NFS writes (generally less than 64K) are smaller than the typical ZFS record size (usually 128K), out of order NFS writes to the same block can trigger a read in ZFS. Sending them down the same thread increases the odds of their being in order. In order for multiple write threads per file in the FHA code to be useful, writes in the NFS server have been changed to use a LK_SHARED vnode lock, and upgrade that to LK_EXCLUSIVE if the filesystem doesn't allow multiple writers to a file at once. ZFS is currently the only filesystem that allows multiple writers to a file, because it has internal file range locking. This change does not affect the NFSv4 code. This improves random write performance to a single file in ZFS, since we can now have multiple writers inside ZFS at one time. I have changed the default tuning parameters to a 22 bit (4MB) window size (from 256K) and unlimited commands per thread as a result of my benchmarking with ZFS. The FHA code has been updated to allow configuring the tuning parameters from loader tunable variables in addition to sysctl variables. The read offset window calculation has been slightly modified as well. Instead of having separate bins, each file handle has a rolling window of bin_shift size. This minimizes glitches in throughput when shifting from one bin to another. sys/conf/files: Add nfs_fha_new.c and nfs_fha_old.c. Compile nfs_fha.c when either the old or the new NFS server is built. sys/fs/nfs/nfsport.h, sys/fs/nfs/nfs_commonport.c: Bring in changes from Rick Macklem to newnfs_realign that allow it to operate in blocking (M_WAITOK) or non-blocking (M_NOWAIT) mode. sys/fs/nfs/nfs_commonsubs.c, sys/fs/nfs/nfs_var.h: Bring in a change from Rick Macklem to allow telling nfsm_dissect() whether or not to wait for mallocs. sys/fs/nfs/nfsm_subs.h: Bring in changes from Rick Macklem to create a new nfsm_dissect_nonblock() inline function and NFSM_DISSECT_NONBLOCK() macro. sys/fs/nfs/nfs_commonkrpc.c, sys/fs/nfsclient/nfs_clkrpc.c: Add the malloc wait flag to a newnfs_realign() call. sys/fs/nfsserver/nfs_nfsdkrpc.c: Setup the new NFS server's RPC thread pool so that it will call the FHA code. Add the malloc flag argument to newnfs_realign(). Unstaticize newnfs_nfsv3_procid[] so that we can use it in the FHA code. sys/fs/nfsserver/nfs_nfsdsocket.c: In nfsrvd_dorpc(), add NFSPROC_WRITE to the list of RPC types that use the LK_SHARED lock type. sys/fs/nfsserver/nfs_nfsdport.c: In nfsd_fhtovp(), if we're starting a write, check to see whether the underlying filesystem supports shared writes. If not, upgrade the lock type from LK_SHARED to LK_EXCLUSIVE. sys/nfsserver/nfs_fha.c: Remove all code that is specific to the NFS server implementation. Anything that is server-specific is now accessed through a callback supplied by that server's FHA shim in the new softc. There are now separate sysctls and tunables for the FHA implementations for the old and new NFS servers. The new NFS server has its tunables under vfs.nfsd.fha, the old NFS server's tunables are under vfs.nfsrv.fha as before. In fha_extract_info(), use callouts for all server-specific code. Getting file handles and offsets is now done in the individual server's shim module. In fha_hash_entry_choose_thread(), change the way we decide whether two reads are in proximity to each other. Previously, the calculation was a simple shift operation to see whether the offsets were in the same power of 2 bucket. The issue was that there would be a bucket (and therefore thread) transition, even if the reads were in close proximity. When there is a thread transition, reads wind up going somewhat out of order, and ZFS gets confused. The new calculation simply tries to see whether the offsets are within 1 << bin_shift of each other. If they are, the reads will be sent to the same thread. The effect of this change is that for sequential reads, if the client doesn't exceed the max_reqs_per_nfsd parameter and the bin_shift is set to a reasonable value (22, or 4MB works well in my tests), the reads in any sequential stream will largely be confined to a single thread. Change fha_assign() so that it takes a softc argument. It is now called from the individual server's shim code, which will pass in the softc. Change fhe_stats_sysctl() so that it takes a softc parameter. It is now called from the individual server's shim code. Add the current offset to the list of things printed out about each active thread. Change the num_reads and num_writes counters in the fha_hash_entry structure to 32-bit values, and rename them num_rw and num_exclusive, respectively, to reflect their changed usage. Add an enable sysctl and tunable that allows the user to disable the FHA code (when vfs.XXX.fha.enable = 0). This is useful for before/after performance comparisons. nfs_fha.h: Move most structure definitions out of nfs_fha.c and into the header file, so that the individual server shims can see them. Change the default bin_shift to 22 (4MB) instead of 18 (256K). Allow unlimited commands per thread. sys/nfsserver/nfs_fha_old.c, sys/nfsserver/nfs_fha_old.h, sys/fs/nfsserver/nfs_fha_new.c, sys/fs/nfsserver/nfs_fha_new.h: Add shims for the old and new NFS servers to interface with the FHA code, and callbacks for the The shims contain all of the code and definitions that are specific to the NFS servers. They setup the server-specific callbacks and set the server name for the sysctl and loader tunable variables. sys/nfsserver/nfs_srvkrpc.c: Configure the RPC code to call fhaold_assign() instead of fha_assign(). sys/modules/nfsd/Makefile: Add nfs_fha.c and nfs_fha_new.c. sys/modules/nfsserver/Makefile: Add nfs_fha_old.c. Reviewed by: rmacklem Sponsored by: Spectra Logic MFC after: 2 weeks Added: head/sys/fs/nfsserver/nfs_fha_new.c (contents, props changed) head/sys/fs/nfsserver/nfs_fha_new.h (contents, props changed) head/sys/nfsserver/nfs_fha_old.c (contents, props changed) head/sys/nfsserver/nfs_fha_old.h (contents, props changed) Modified: head/sys/conf/files head/sys/fs/nfs/nfs_commonkrpc.c head/sys/fs/nfs/nfs_commonport.c head/sys/fs/nfs/nfs_commonsubs.c head/sys/fs/nfs/nfs_var.h head/sys/fs/nfs/nfsm_subs.h head/sys/fs/nfs/nfsport.h head/sys/fs/nfsclient/nfs_clkrpc.c head/sys/fs/nfsserver/nfs_nfsdkrpc.c head/sys/fs/nfsserver/nfs_nfsdport.c head/sys/fs/nfsserver/nfs_nfsdsocket.c head/sys/modules/nfsd/Makefile head/sys/modules/nfsserver/Makefile head/sys/nfsserver/nfs_fha.c head/sys/nfsserver/nfs_fha.h head/sys/nfsserver/nfs_srvkrpc.c Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Apr 17 20:19:32 2013 (r249591) +++ head/sys/conf/files Wed Apr 17 21:00:22 2013 (r249592) @@ -2404,6 +2404,7 @@ fs/nfsclient/nfs_clvfsops.c optional nfs fs/nfsclient/nfs_clport.c optional nfscl fs/nfsclient/nfs_clbio.c optional nfscl fs/nfsclient/nfs_clnfsiod.c optional nfscl +fs/nfsserver/nfs_fha_new.c optional nfsd inet fs/nfsserver/nfs_nfsdsocket.c optional nfsd inet fs/nfsserver/nfs_nfsdsubs.c optional nfsd inet fs/nfsserver/nfs_nfsdstate.c optional nfsd inet @@ -3210,7 +3211,8 @@ nfsclient/nfs_subs.c optional nfsclient nfsclient/nfs_nfsiod.c optional nfsclient nfsclient/nfs_vfsops.c optional nfsclient nfsclient/nfs_vnops.c optional nfsclient -nfsserver/nfs_fha.c optional nfsserver +nfsserver/nfs_fha.c optional nfsserver | nfsd +nfsserver/nfs_fha_old.c optional nfsserver nfsserver/nfs_serv.c optional nfsserver nfsserver/nfs_srvkrpc.c optional nfsserver nfsserver/nfs_srvsubs.c optional nfsserver Modified: head/sys/fs/nfs/nfs_commonkrpc.c ============================================================================== --- head/sys/fs/nfs/nfs_commonkrpc.c Wed Apr 17 20:19:32 2013 (r249591) +++ head/sys/fs/nfs/nfs_commonkrpc.c Wed Apr 17 21:00:22 2013 (r249592) @@ -797,7 +797,7 @@ tryagain: * These could cause pointer alignment problems, so copy them to * well aligned mbufs. */ - newnfs_realign(&nd->nd_mrep); + newnfs_realign(&nd->nd_mrep, M_WAITOK); nd->nd_md = nd->nd_mrep; nd->nd_dpos = NFSMTOD(nd->nd_md, caddr_t); nd->nd_repstat = 0; Modified: head/sys/fs/nfs/nfs_commonport.c ============================================================================== --- head/sys/fs/nfs/nfs_commonport.c Wed Apr 17 20:19:32 2013 (r249591) +++ head/sys/fs/nfs/nfs_commonport.c Wed Apr 17 21:00:22 2013 (r249592) @@ -132,11 +132,11 @@ static int nfssvc_call(struct thread *, /* * These architectures don't need re-alignment, so just return. */ -void -newnfs_realign(struct mbuf **pm) +int +newnfs_realign(struct mbuf **pm, int how) { - return; + return (0); } #else /* !__NO_STRICT_ALIGNMENT */ /* @@ -155,8 +155,8 @@ newnfs_realign(struct mbuf **pm) * with TCP. Use vfs.nfs.realign_count and realign_test to check this. * */ -void -newnfs_realign(struct mbuf **pm) +int +newnfs_realign(struct mbuf **pm, int how) { struct mbuf *m, *n; int off, space; @@ -173,11 +173,11 @@ newnfs_realign(struct mbuf **pm) space = m_length(m, NULL); if (space >= MINCLSIZE) { /* NB: m_copyback handles space > MCLBYTES */ - n = m_getcl(M_WAITOK, MT_DATA, 0); + n = m_getcl(how, MT_DATA, 0); } else - n = m_get(M_WAITOK, MT_DATA); + n = m_get(how, MT_DATA); if (n == NULL) - return; + return (ENOMEM); /* * Align the remainder of the mbuf chain. */ @@ -195,6 +195,8 @@ newnfs_realign(struct mbuf **pm) } pm = &m->m_next; } + + return (0); } #endif /* __NO_STRICT_ALIGNMENT */ Modified: head/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- head/sys/fs/nfs/nfs_commonsubs.c Wed Apr 17 20:19:32 2013 (r249591) +++ head/sys/fs/nfs/nfs_commonsubs.c Wed Apr 17 21:00:22 2013 (r249592) @@ -271,7 +271,7 @@ out: * cases. */ APPLESTATIC void * -nfsm_dissct(struct nfsrv_descript *nd, int siz) +nfsm_dissct(struct nfsrv_descript *nd, int siz, int how) { mbuf_t mp2; int siz2, xfer; @@ -296,7 +296,9 @@ nfsm_dissct(struct nfsrv_descript *nd, i } else if (siz > ncl_mbuf_mhlen) { panic("nfs S too big"); } else { - NFSMGET(mp2); + MGET(mp2, MT_DATA, how); + if (mp2 == NULL) + return (NULL); mbuf_setnext(mp2, mbuf_next(nd->nd_md)); mbuf_setnext(nd->nd_md, mp2); mbuf_setlen(nd->nd_md, mbuf_len(nd->nd_md) - left); Modified: head/sys/fs/nfs/nfs_var.h ============================================================================== --- head/sys/fs/nfs/nfs_var.h Wed Apr 17 20:19:32 2013 (r249591) +++ head/sys/fs/nfs/nfs_var.h Wed Apr 17 21:00:22 2013 (r249592) @@ -235,7 +235,7 @@ int nfsm_strtom(struct nfsrv_descript *, int nfsm_mbufuio(struct nfsrv_descript *, struct uio *, int); int nfsm_fhtom(struct nfsrv_descript *, u_int8_t *, int, int); int nfsm_advance(struct nfsrv_descript *, int, int); -void *nfsm_dissct(struct nfsrv_descript *, int); +void *nfsm_dissct(struct nfsrv_descript *, int, int); void newnfs_trimleading(struct nfsrv_descript *); void newnfs_trimtrailing(struct nfsrv_descript *, mbuf_t, caddr_t); Modified: head/sys/fs/nfs/nfsm_subs.h ============================================================================== --- head/sys/fs/nfs/nfsm_subs.h Wed Apr 17 20:19:32 2013 (r249591) +++ head/sys/fs/nfs/nfsm_subs.h Wed Apr 17 21:00:22 2013 (r249592) @@ -100,7 +100,23 @@ nfsm_dissect(struct nfsrv_descript *nd, retp = (void *)nd->nd_dpos; nd->nd_dpos += siz; } else { - retp = nfsm_dissct(nd, siz); + retp = nfsm_dissct(nd, siz, M_WAITOK); + } + return (retp); +} + +static __inline void * +nfsm_dissect_nonblock(struct nfsrv_descript *nd, int siz) +{ + int tt1; + void *retp; + + tt1 = NFSMTOD(nd->nd_md, caddr_t) + nd->nd_md->m_len - nd->nd_dpos; + if (tt1 >= siz) { + retp = (void *)nd->nd_dpos; + nd->nd_dpos += siz; + } else { + retp = nfsm_dissct(nd, siz, M_NOWAIT); } return (retp); } @@ -113,6 +129,15 @@ nfsm_dissect(struct nfsrv_descript *nd, goto nfsmout; \ } \ } while (0) + +#define NFSM_DISSECT_NONBLOCK(a, c, s) \ + do { \ + (a) = (c)nfsm_dissect_nonblock(nd, (s)); \ + if ((a) == NULL) { \ + error = EBADRPC; \ + goto nfsmout; \ + } \ + } while (0) #endif /* !APPLE */ #define NFSM_STRSIZ(s, m) \ Modified: head/sys/fs/nfs/nfsport.h ============================================================================== --- head/sys/fs/nfs/nfsport.h Wed Apr 17 20:19:32 2013 (r249591) +++ head/sys/fs/nfs/nfsport.h Wed Apr 17 21:00:22 2013 (r249592) @@ -806,7 +806,7 @@ MALLOC_DECLARE(M_NEWNFSLAYRECALL); */ int nfscl_loadattrcache(struct vnode **, struct nfsvattr *, void *, void *, int, int); -void newnfs_realign(struct mbuf **); +int newnfs_realign(struct mbuf **, int); /* * If the port runs on an SMP box that can enforce Atomic ops with low Modified: head/sys/fs/nfsclient/nfs_clkrpc.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clkrpc.c Wed Apr 17 20:19:32 2013 (r249591) +++ head/sys/fs/nfsclient/nfs_clkrpc.c Wed Apr 17 21:00:22 2013 (r249592) @@ -83,7 +83,7 @@ nfscb_program(struct svc_req *rqst, SVCX */ nd.nd_mrep = rqst->rq_args; rqst->rq_args = NULL; - newnfs_realign(&nd.nd_mrep); + newnfs_realign(&nd.nd_mrep, M_WAITOK); nd.nd_md = nd.nd_mrep; nd.nd_dpos = mtod(nd.nd_md, caddr_t); nd.nd_nam = svc_getrpccaller(rqst); Added: head/sys/fs/nfsserver/nfs_fha_new.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/fs/nfsserver/nfs_fha_new.c Wed Apr 17 21:00:22 2013 (r249592) @@ -0,0 +1,272 @@ +/*- + * Copyright (c) 2008 Isilon Inc http://www.isilon.com/ + * Copyright (c) 2013 Spectra Logic Corporation + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +#include +#include +#include +#include +#include +#include +#include + +static void fhanew_init(void *foo); +static void fhanew_uninit(void *foo); +rpcproc_t fhanew_get_procnum(rpcproc_t procnum); +int fhanew_realign(struct mbuf **mb, int malloc_flags); +int fhanew_get_fh(fhandle_t *fh, int v3, struct mbuf **md, caddr_t *dpos); +int fhanew_is_read(rpcproc_t procnum); +int fhanew_is_write(rpcproc_t procnum); +int fhanew_get_offset(struct mbuf **md, caddr_t *dpos, int v3, + struct fha_info *info); +int fhanew_no_offset(rpcproc_t procnum); +void fhanew_set_locktype(rpcproc_t procnum, struct fha_info *info); +static int fhenew_stats_sysctl(SYSCTL_HANDLER_ARGS); + +static struct fha_params fhanew_softc; + +SYSCTL_DECL(_vfs_nfsd); + +extern int newnfs_nfsv3_procid[]; +extern SVCPOOL *nfsrvd_pool; + +SYSINIT(nfs_fhanew, SI_SUB_ROOT_CONF, SI_ORDER_ANY, fhanew_init, NULL); +SYSUNINIT(nfs_fhanew, SI_SUB_ROOT_CONF, SI_ORDER_ANY, fhanew_uninit, NULL); + +static void +fhanew_init(void *foo) +{ + struct fha_params *softc; + + softc = &fhanew_softc; + + bzero(softc, sizeof(*softc)); + + /* + * Setup the callbacks for this FHA personality. + */ + softc->callbacks.get_procnum = fhanew_get_procnum; + softc->callbacks.realign = fhanew_realign; + softc->callbacks.get_fh = fhanew_get_fh; + softc->callbacks.is_read = fhanew_is_read; + softc->callbacks.is_write = fhanew_is_write; + softc->callbacks.get_offset = fhanew_get_offset; + softc->callbacks.no_offset = fhanew_no_offset; + softc->callbacks.set_locktype = fhanew_set_locktype; + softc->callbacks.fhe_stats_sysctl = fhenew_stats_sysctl; + + snprintf(softc->server_name, sizeof(softc->server_name), + FHANEW_SERVER_NAME); + + softc->pool = &nfsrvd_pool; + + /* + * Initialize the sysctl context list for the fha module. + */ + sysctl_ctx_init(&softc->sysctl_ctx); + softc->sysctl_tree = SYSCTL_ADD_NODE(&softc->sysctl_ctx, + SYSCTL_STATIC_CHILDREN(_vfs_nfsd), OID_AUTO, "fha", CTLFLAG_RD, + 0, "fha node"); + if (softc->sysctl_tree == NULL) { + printf("%s: unable to allocate sysctl tree\n", __func__); + return; + } + + fha_init(softc); +} + +static void +fhanew_uninit(void *foo) +{ + struct fha_params *softc; + + softc = &fhanew_softc; + + fha_uninit(softc); +} + +rpcproc_t +fhanew_get_procnum(rpcproc_t procnum) +{ + if (procnum > NFSV2PROC_STATFS) + return (-1); + + return (newnfs_nfsv3_procid[procnum]); +} + +int +fhanew_realign(struct mbuf **mb, int malloc_flags) +{ + return (newnfs_realign(mb, malloc_flags)); +} + +int +fhanew_get_fh(fhandle_t *fh, int v3, struct mbuf **md, caddr_t *dpos) +{ + struct nfsrv_descript lnd, *nd; + uint32_t *tl; + int error, len; + + error = 0; + len = 0; + nd = &lnd; + + nd->nd_md = *md; + nd->nd_dpos = *dpos; + + if (v3) { + NFSM_DISSECT_NONBLOCK(tl, uint32_t *, NFSX_UNSIGNED); + if ((len = fxdr_unsigned(int, *tl)) <= 0 || len > NFSX_FHMAX) { + error = EBADRPC; + goto nfsmout; + } + } else { + len = NFSX_V2FH; + } + + if (len != 0) { + NFSM_DISSECT_NONBLOCK(tl, uint32_t *, len); + bcopy(tl, fh, len); + } else + bzero(fh, sizeof(*fh)); + +nfsmout: + *md = nd->nd_md; + *dpos = nd->nd_dpos; + + return (error); +} + +int +fhanew_is_read(rpcproc_t procnum) +{ + if (procnum == NFSPROC_READ) + return (1); + else + return (0); +} + +int +fhanew_is_write(rpcproc_t procnum) +{ + if (procnum == NFSPROC_WRITE) + return (1); + else + return (0); +} + +int +fhanew_get_offset(struct mbuf **md, caddr_t *dpos, int v3, + struct fha_info *info) +{ + struct nfsrv_descript lnd, *nd; + uint32_t *tl; + int error; + + error = 0; + + nd = &lnd; + nd->nd_md = *md; + nd->nd_dpos = *dpos; + + if (v3) { + NFSM_DISSECT_NONBLOCK(tl, uint32_t *, 2 * NFSX_UNSIGNED); + info->offset = fxdr_hyper(tl); + } else { + NFSM_DISSECT_NONBLOCK(tl, uint32_t *, NFSX_UNSIGNED); + info->offset = fxdr_unsigned(uint32_t, *tl); + } + +nfsmout: + *md = nd->nd_md; + *dpos = nd->nd_dpos; + + return (error); +} + +int +fhanew_no_offset(rpcproc_t procnum) +{ + if (procnum == NFSPROC_FSSTAT || + procnum == NFSPROC_FSINFO || + procnum == NFSPROC_PATHCONF || + procnum == NFSPROC_NOOP || + procnum == NFSPROC_NULL) + return (1); + else + return (0); +} + +void +fhanew_set_locktype(rpcproc_t procnum, struct fha_info *info) +{ + switch (procnum) { + case NFSPROC_NULL: + case NFSPROC_GETATTR: + case NFSPROC_LOOKUP: + case NFSPROC_ACCESS: + case NFSPROC_READLINK: + case NFSPROC_READ: + case NFSPROC_READDIR: + case NFSPROC_READDIRPLUS: + case NFSPROC_WRITE: + info->locktype = LK_SHARED; + break; + case NFSPROC_SETATTR: + case NFSPROC_CREATE: + case NFSPROC_MKDIR: + case NFSPROC_SYMLINK: + case NFSPROC_MKNOD: + case NFSPROC_REMOVE: + case NFSPROC_RMDIR: + case NFSPROC_RENAME: + case NFSPROC_LINK: + case NFSPROC_FSSTAT: + case NFSPROC_FSINFO: + case NFSPROC_PATHCONF: + case NFSPROC_COMMIT: + case NFSPROC_NOOP: + info->locktype = LK_EXCLUSIVE; + break; + } +} + +static int +fhenew_stats_sysctl(SYSCTL_HANDLER_ARGS) +{ + return (fhe_stats_sysctl(oidp, arg1, arg2, req, &fhanew_softc)); +} + + +SVCTHREAD * +fhanew_assign(SVCTHREAD *this_thread, struct svc_req *req) +{ + return (fha_assign(this_thread, req, &fhanew_softc)); +} Added: head/sys/fs/nfsserver/nfs_fha_new.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/fs/nfsserver/nfs_fha_new.h Wed Apr 17 21:00:22 2013 (r249592) @@ -0,0 +1,39 @@ +/*- + * Copyright (c) 2008 Isilon Inc http://www.isilon.com/ + * Copyright (c) 2013 Spectra Logic Corporation + * + * + * 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 _NFS_FHA_NEW_H +#define _NFS_FHA_NEW_H 1 + +#ifdef _KERNEL + +#define FHANEW_SERVER_NAME "nfsd" + +SVCTHREAD *fhanew_assign(SVCTHREAD *this_thread, struct svc_req *req); +#endif /* _KERNEL */ + +#endif /* _NFS_FHA_NEW_H */ Modified: head/sys/fs/nfsserver/nfs_nfsdkrpc.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdkrpc.c Wed Apr 17 20:19:32 2013 (r249591) +++ head/sys/fs/nfsserver/nfs_nfsdkrpc.c Wed Apr 17 21:00:22 2013 (r249592) @@ -42,6 +42,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include + #include NFSDLOCKMUTEX; @@ -51,7 +54,7 @@ struct nfsv4lock nfsd_suspend_lock; /* * Mapping of old NFS Version 2 RPC numbers to generic numbers. */ -static int newnfs_nfsv3_procid[NFS_V3NPROCS] = { +int newnfs_nfsv3_procid[NFS_V3NPROCS] = { NFSPROC_NULL, NFSPROC_GETATTR, NFSPROC_SETATTR, @@ -147,7 +150,7 @@ nfssvc_program(struct svc_req *rqst, SVC */ nd.nd_mrep = rqst->rq_args; rqst->rq_args = NULL; - newnfs_realign(&nd.nd_mrep); + newnfs_realign(&nd.nd_mrep, M_WAITOK); nd.nd_md = nd.nd_mrep; nd.nd_dpos = mtod(nd.nd_md, caddr_t); nd.nd_nam = svc_getrpccaller(rqst); @@ -491,8 +494,8 @@ nfsrvd_init(int terminating) nfsrvd_pool = svcpool_create("nfsd", SYSCTL_STATIC_CHILDREN(_vfs_nfsd)); nfsrvd_pool->sp_rcache = NULL; - nfsrvd_pool->sp_assign = NULL; - nfsrvd_pool->sp_done = NULL; + nfsrvd_pool->sp_assign = fhanew_assign; + nfsrvd_pool->sp_done = fha_nd_complete; NFSD_LOCK(); } Modified: head/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdport.c Wed Apr 17 20:19:32 2013 (r249591) +++ head/sys/fs/nfsserver/nfs_nfsdport.c Wed Apr 17 21:00:22 2013 (r249592) @@ -2692,9 +2692,11 @@ nfsd_fhtovp(struct nfsrv_descript *nd, s goto out; } - if (startwrite) + if (startwrite) { vn_start_write(NULL, mpp, V_WAIT); - + if (lktype == LK_SHARED && !(MNT_SHARED_WRITES(mp))) + lktype = LK_EXCLUSIVE; + } nd->nd_repstat = nfsvno_fhtovp(mp, fhp, nd->nd_nam, lktype, vpp, exp, &credanon); vfs_unbusy(mp); Modified: head/sys/fs/nfsserver/nfs_nfsdsocket.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdsocket.c Wed Apr 17 20:19:32 2013 (r249591) +++ head/sys/fs/nfsserver/nfs_nfsdsocket.c Wed Apr 17 21:00:22 2013 (r249592) @@ -379,6 +379,7 @@ nfsrvd_dorpc(struct nfsrv_descript *nd, goto out; } if (nd->nd_procnum == NFSPROC_READ || + nd->nd_procnum == NFSPROC_WRITE || nd->nd_procnum == NFSPROC_READDIR || nd->nd_procnum == NFSPROC_READLINK || nd->nd_procnum == NFSPROC_GETATTR || Modified: head/sys/modules/nfsd/Makefile ============================================================================== --- head/sys/modules/nfsd/Makefile Wed Apr 17 20:19:32 2013 (r249591) +++ head/sys/modules/nfsd/Makefile Wed Apr 17 21:00:22 2013 (r249592) @@ -1,8 +1,10 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../fs/nfsserver +.PATH: ${.CURDIR}/../../fs/nfsserver ${.CURDIR}/../../nfsserver KMOD= nfsd SRCS= vnode_if.h \ + nfs_fha.c \ + nfs_fha_new.c \ nfs_nfsdserv.c \ nfs_nfsdcache.c \ nfs_nfsdkrpc.c \ Modified: head/sys/modules/nfsserver/Makefile ============================================================================== --- head/sys/modules/nfsserver/Makefile Wed Apr 17 20:19:32 2013 (r249591) +++ head/sys/modules/nfsserver/Makefile Wed Apr 17 21:00:22 2013 (r249592) @@ -3,7 +3,7 @@ .PATH: ${.CURDIR}/../../nfsserver KMOD= nfsserver SRCS= vnode_if.h \ - nfs_fha.c nfs_serv.c nfs_srvkrpc.c nfs_srvsubs.c \ + nfs_fha.c nfs_fha_old.c nfs_serv.c nfs_srvkrpc.c nfs_srvsubs.c \ opt_mac.h \ opt_kgssapi.h \ opt_nfs.h Modified: head/sys/nfsserver/nfs_fha.c ============================================================================== --- head/sys/nfsserver/nfs_fha.c Wed Apr 17 20:19:32 2013 (r249591) +++ head/sys/nfsserver/nfs_fha.c Wed Apr 17 21:00:22 2013 (r249592) @@ -38,134 +38,103 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include -#include -#include #include static MALLOC_DEFINE(M_NFS_FHA, "NFS FHA", "NFS FHA"); -/* Sysctl defaults. */ -#define DEF_BIN_SHIFT 18 /* 256k */ -#define DEF_MAX_NFSDS_PER_FH 8 -#define DEF_MAX_REQS_PER_NFSD 4 - -struct fha_ctls { - u_int32_t bin_shift; - u_int32_t max_nfsds_per_fh; - u_int32_t max_reqs_per_nfsd; -} fha_ctls; - -struct sysctl_ctx_list fha_clist; - -SYSCTL_DECL(_vfs_nfsrv); -SYSCTL_DECL(_vfs_nfsrv_fha); - -/* Static sysctl node for the fha from the top-level vfs_nfsrv node. */ -SYSCTL_NODE(_vfs_nfsrv, OID_AUTO, fha, CTLFLAG_RD, 0, "fha node"); - -/* This is the global structure that represents the state of the fha system. */ -static struct fha_global { - struct fha_hash_entry_list *hashtable; - u_long hashmask; -} g_fha; - /* - * These are the entries in the filehandle hash. They talk about a specific - * file, requests against which are being handled by one or more nfsds. We - * keep a chain of nfsds against the file. We only have more than one if reads - * are ongoing, and then only if the reads affect disparate regions of the - * file. - * - * In general, we want to assign a new request to an existing nfsd if it is - * going to contend with work happening already on that nfsd, or if the - * operation is a read and the nfsd is already handling a proximate read. We - * do this to avoid jumping around in the read stream unnecessarily, and to - * avoid contention between threads over single files. + * XXX need to commonize definitions between old and new NFS code. Define + * this here so we don't include one nfsproto.h over the other. */ -struct fha_hash_entry { - LIST_ENTRY(fha_hash_entry) link; - u_int64_t fh; - u_int16_t num_reads; - u_int16_t num_writes; - u_int8_t num_threads; - struct svcthread_list threads; -}; -LIST_HEAD(fha_hash_entry_list, fha_hash_entry); - -/* A structure used for passing around data internally. */ -struct fha_info { - u_int64_t fh; - off_t offset; - int locktype; -}; - -static int fhe_stats_sysctl(SYSCTL_HANDLER_ARGS); +#define NFS_PROG 100003 -static void -nfs_fha_init(void *foo) +void +fha_init(struct fha_params *softc) { + char tmpstr[128]; /* * A small hash table to map filehandles to fha_hash_entry * structures. */ - g_fha.hashtable = hashinit(256, M_NFS_FHA, &g_fha.hashmask); + softc->g_fha.hashtable = hashinit(256, M_NFS_FHA, + &softc->g_fha.hashmask); /* - * Initialize the sysctl context list for the fha module. + * Set the default tuning parameters. */ - sysctl_ctx_init(&fha_clist); + softc->ctls.enable = FHA_DEF_ENABLE; + softc->ctls.bin_shift = FHA_DEF_BIN_SHIFT; + softc->ctls.max_nfsds_per_fh = FHA_DEF_MAX_NFSDS_PER_FH; + softc->ctls.max_reqs_per_nfsd = FHA_DEF_MAX_REQS_PER_NFSD; - fha_ctls.bin_shift = DEF_BIN_SHIFT; - fha_ctls.max_nfsds_per_fh = DEF_MAX_NFSDS_PER_FH; - fha_ctls.max_reqs_per_nfsd = DEF_MAX_REQS_PER_NFSD; + /* + * Allow the user to override the defaults at boot time with + * tunables. + */ + snprintf(tmpstr, sizeof(tmpstr), "vfs.%s.fha.enable", + softc->server_name); + TUNABLE_INT_FETCH(tmpstr, &softc->ctls.enable); + snprintf(tmpstr, sizeof(tmpstr), "vfs.%s.fha.bin_shift", + softc->server_name); + TUNABLE_INT_FETCH(tmpstr, &softc->ctls.bin_shift); + snprintf(tmpstr, sizeof(tmpstr), "vfs.%s.fha.max_nfsds_per_fh", + softc->server_name); + TUNABLE_INT_FETCH(tmpstr, &softc->ctls.max_nfsds_per_fh); + snprintf(tmpstr, sizeof(tmpstr), "vfs.%s.fha.max_reqs_per_nfsd", + softc->server_name); + TUNABLE_INT_FETCH(tmpstr, &softc->ctls.max_reqs_per_nfsd); + + /* + * Add sysctls so the user can change the tuning parameters at + * runtime. + */ + SYSCTL_ADD_UINT(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), + OID_AUTO, "enable", CTLFLAG_RW, + &softc->ctls.enable, 0, "Enable NFS File Handle Affinity (FHA)"); - SYSCTL_ADD_UINT(&fha_clist, SYSCTL_STATIC_CHILDREN(_vfs_nfsrv_fha), + SYSCTL_ADD_UINT(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), OID_AUTO, "bin_shift", CTLFLAG_RW, - &fha_ctls.bin_shift, 0, "For FHA reads, no two requests will " + &softc->ctls.bin_shift, 0, "For FHA reads, no two requests will " "contend if they're 2^(bin_shift) bytes apart"); - SYSCTL_ADD_UINT(&fha_clist, SYSCTL_STATIC_CHILDREN(_vfs_nfsrv_fha), + SYSCTL_ADD_UINT(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), OID_AUTO, "max_nfsds_per_fh", CTLFLAG_RW, - &fha_ctls.max_nfsds_per_fh, 0, "Maximum nfsd threads that " + &softc->ctls.max_nfsds_per_fh, 0, "Maximum nfsd threads that " "should be working on requests for the same file handle"); - SYSCTL_ADD_UINT(&fha_clist, SYSCTL_STATIC_CHILDREN(_vfs_nfsrv_fha), + SYSCTL_ADD_UINT(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), OID_AUTO, "max_reqs_per_nfsd", CTLFLAG_RW, - &fha_ctls.max_reqs_per_nfsd, 0, "Maximum requests that " + &softc->ctls.max_reqs_per_nfsd, 0, "Maximum requests that " "single nfsd thread should be working on at any time"); - SYSCTL_ADD_OID(&fha_clist, SYSCTL_STATIC_CHILDREN(_vfs_nfsrv_fha), + SYSCTL_ADD_OID(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), OID_AUTO, "fhe_stats", CTLTYPE_STRING | CTLFLAG_RD, 0, 0, - fhe_stats_sysctl, "A", ""); + softc->callbacks.fhe_stats_sysctl, "A", ""); + } -static void -nfs_fha_uninit(void *foo) +void +fha_uninit(struct fha_params *softc) { - - hashdestroy(g_fha.hashtable, M_NFS_FHA, g_fha.hashmask); + sysctl_ctx_free(&softc->sysctl_ctx); + hashdestroy(softc->g_fha.hashtable, M_NFS_FHA, softc->g_fha.hashmask); } -SYSINIT(nfs_fha, SI_SUB_ROOT_CONF, SI_ORDER_ANY, nfs_fha_init, NULL); -SYSUNINIT(nfs_fha, SI_SUB_ROOT_CONF, SI_ORDER_ANY, nfs_fha_uninit, NULL); - /* * This just specifies that offsets should obey affinity when within * the same 1Mbyte (1<<20) chunk for the file (reads only for now). */ static void -fha_extract_info(struct svc_req *req, struct fha_info *i) +fha_extract_info(struct svc_req *req, struct fha_info *i, + struct fha_callbacks *cb) { struct mbuf *md; - nfsfh_t fh; + fhandle_t fh; caddr_t dpos; static u_int64_t random_fh = 0; int error; int v3 = (req->rq_vers == 3); - u_int32_t *tl; rpcproc_t procnum; /* @@ -184,9 +153,12 @@ fha_extract_info(struct svc_req *req, st */ procnum = req->rq_proc; if (!v3) { - if (procnum > NFSV2PROC_STATFS) + rpcproc_t tmp_procnum; + + tmp_procnum = cb->get_procnum(procnum); + if (tmp_procnum == -1) goto out; - procnum = nfsrv_nfsv3_procid[procnum]; + procnum = tmp_procnum; } /* @@ -195,71 +167,28 @@ fha_extract_info(struct svc_req *req, st * only do this for reads today, but this may change when IFS supports * efficient concurrent writes. */ - if (procnum == NFSPROC_FSSTAT || - procnum == NFSPROC_FSINFO || - procnum == NFSPROC_PATHCONF || - procnum == NFSPROC_NOOP || - procnum == NFSPROC_NULL) + if (cb->no_offset(procnum)) goto out; - error = nfs_realign(&req->rq_args, M_NOWAIT); + error = cb->realign(&req->rq_args, M_NOWAIT); if (error) goto out; md = req->rq_args; dpos = mtod(md, caddr_t); /* Grab the filehandle. */ - error = nfsm_srvmtofh_xx(&fh.fh_generic, v3, &md, &dpos); + error = cb->get_fh(&fh, v3, &md, &dpos); if (error) goto out; - bcopy(fh.fh_generic.fh_fid.fid_data, &i->fh, sizeof(i->fh)); + bcopy(fh.fh_fid.fid_data, &i->fh, sizeof(i->fh)); /* Content ourselves with zero offset for all but reads. */ - if (procnum != NFSPROC_READ) - goto out; + if (cb->is_read(procnum) || cb->is_write(procnum)) + cb->get_offset(&md, &dpos, v3, i); - if (v3) { - tl = nfsm_dissect_xx_nonblock(2 * NFSX_UNSIGNED, &md, &dpos); - if (tl == NULL) - goto out; - i->offset = fxdr_hyper(tl); - } else { - tl = nfsm_dissect_xx_nonblock(NFSX_UNSIGNED, &md, &dpos); - if (tl == NULL) - goto out; - i->offset = fxdr_unsigned(u_int32_t, *tl); - } - out: - switch (procnum) { - case NFSPROC_NULL: - case NFSPROC_GETATTR: - case NFSPROC_LOOKUP: - case NFSPROC_ACCESS: - case NFSPROC_READLINK: - case NFSPROC_READ: - case NFSPROC_READDIR: - case NFSPROC_READDIRPLUS: - i->locktype = LK_SHARED; - break; - case NFSPROC_SETATTR: - case NFSPROC_WRITE: - case NFSPROC_CREATE: - case NFSPROC_MKDIR: - case NFSPROC_SYMLINK: - case NFSPROC_MKNOD: - case NFSPROC_REMOVE: - case NFSPROC_RMDIR: - case NFSPROC_RENAME: - case NFSPROC_LINK: - case NFSPROC_FSSTAT: - case NFSPROC_FSINFO: - case NFSPROC_PATHCONF: - case NFSPROC_COMMIT: - case NFSPROC_NOOP: - i->locktype = LK_EXCLUSIVE; - break; - } +out: + cb->set_locktype(procnum, i); } static struct fha_hash_entry * @@ -269,8 +198,8 @@ fha_hash_entry_new(u_int64_t fh) e = malloc(sizeof(*e), M_NFS_FHA, M_WAITOK); e->fh = fh; - e->num_reads = 0; - e->num_writes = 0; + e->num_rw = 0; + e->num_exclusive = 0; e->num_threads = 0; LIST_INIT(&e->threads); @@ -281,7 +210,7 @@ static void fha_hash_entry_destroy(struct fha_hash_entry *e) { - if (e->num_reads + e->num_writes) + if (e->num_rw + e->num_exclusive) panic("nonempty fhe"); free(e, M_NFS_FHA); } @@ -295,11 +224,16 @@ fha_hash_entry_remove(struct fha_hash_en } static struct fha_hash_entry * -fha_hash_entry_lookup(SVCPOOL *pool, u_int64_t fh) +fha_hash_entry_lookup(struct fha_params *softc, u_int64_t fh) { + SVCPOOL *pool; + + pool = *softc->pool; + struct fha_hash_entry *fhe, *new_fhe; - LIST_FOREACH(fhe, &g_fha.hashtable[fh % g_fha.hashmask], link) + LIST_FOREACH(fhe, &softc->g_fha.hashtable[fh % softc->g_fha.hashmask], + link) if (fhe->fh == fh) break; @@ -310,12 +244,14 @@ fha_hash_entry_lookup(SVCPOOL *pool, u_i mtx_lock(&pool->sp_lock); /* Double-check to make sure we still need the new entry. */ - LIST_FOREACH(fhe, &g_fha.hashtable[fh % g_fha.hashmask], link) + LIST_FOREACH(fhe, + &softc->g_fha.hashtable[fh % softc->g_fha.hashmask], link) if (fhe->fh == fh) break; if (!fhe) { fhe = new_fhe; - LIST_INSERT_HEAD(&g_fha.hashtable[fh % g_fha.hashmask], + LIST_INSERT_HEAD( + &softc->g_fha.hashtable[fh % softc->g_fha.hashmask], fhe, link); } else fha_hash_entry_destroy(new_fhe); @@ -348,9 +284,9 @@ fha_hash_entry_add_op(struct fha_hash_en { if (LK_EXCLUSIVE == locktype) - fhe->num_writes += count; + fhe->num_exclusive += count; else - fhe->num_reads += count; + fhe->num_rw += count; } static SVCTHREAD * @@ -371,22 +307,25 @@ get_idle_thread(SVCPOOL *pool) * appropriate to handle this operation. */ SVCTHREAD * -fha_hash_entry_choose_thread(SVCPOOL *pool, struct fha_hash_entry *fhe, - struct fha_info *i, SVCTHREAD *this_thread); +fha_hash_entry_choose_thread(struct fha_params *softc, + struct fha_hash_entry *fhe, struct fha_info *i, SVCTHREAD *this_thread); SVCTHREAD * -fha_hash_entry_choose_thread(SVCPOOL *pool, struct fha_hash_entry *fhe, - struct fha_info *i, SVCTHREAD *this_thread) +fha_hash_entry_choose_thread(struct fha_params *softc, + struct fha_hash_entry *fhe, struct fha_info *i, SVCTHREAD *this_thread) { SVCTHREAD *thread, *min_thread = NULL; + SVCPOOL *pool; int req_count, min_count = 0; off_t offset1, offset2; + pool = *softc->pool; + LIST_FOREACH(thread, &fhe->threads, st_alink) { req_count = thread->st_reqcount; /* If there are any writes in progress, use the first thread. */ - if (fhe->num_writes) { + if (fhe->num_exclusive) { #if 0 ITRACE_CURPROC(ITRACE_NFS, ITRACE_INFO, "fha: %p(%d)w", thread, req_count); @@ -398,12 +337,15 @@ fha_hash_entry_choose_thread(SVCPOOL *po * Check for read locality, making sure that we won't * exceed our per-thread load limit in the process. */ - offset1 = i->offset >> fha_ctls.bin_shift; - offset2 = STAILQ_FIRST(&thread->st_reqs)->rq_p3 - >> fha_ctls.bin_shift; - if (offset1 == offset2) { - if ((fha_ctls.max_reqs_per_nfsd == 0) || - (req_count < fha_ctls.max_reqs_per_nfsd)) { + offset1 = i->offset; + offset2 = STAILQ_FIRST(&thread->st_reqs)->rq_p3; + + if (((offset1 >= offset2) + && ((offset1 - offset2) < (1 << softc->ctls.bin_shift))) + || ((offset2 > offset1) + && ((offset2 - offset1) < (1 << softc->ctls.bin_shift)))) { + if ((softc->ctls.max_reqs_per_nfsd == 0) || + (req_count < softc->ctls.max_reqs_per_nfsd)) { #if 0 ITRACE_CURPROC(ITRACE_NFS, ITRACE_INFO, "fha: %p(%d)r", thread, req_count); @@ -432,8 +374,8 @@ fha_hash_entry_choose_thread(SVCPOOL *po * We didn't find a good match yet. See if we can add * a new thread to this file handle entry's thread list. */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Apr 17 21:08:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7B9BD97A; Wed, 17 Apr 2013 21:08:16 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6E7757CA; Wed, 17 Apr 2013 21:08:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3HL8GnZ056576; Wed, 17 Apr 2013 21:08:16 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3HL8Gwx056575; Wed, 17 Apr 2013 21:08:16 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201304172108.r3HL8Gwx056575@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 17 Apr 2013 21:08:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249593 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2013 21:08:16 -0000 Author: jilles Date: Wed Apr 17 21:08:15 2013 New Revision: 249593 URL: http://svnweb.freebsd.org/changeset/base/249593 Log: pututxline: Don't set errno=0 in subfunctions. The functions utx_active_add(), utx_active_remove(), utx_lastlogin_add() and utx_log_add() set errno to 0 if they are successful. This not only violates POSIX if pututxline() is successful, but may also overwrite a valid error with 0 if, for example, utx_lastlogin_add() fails while utx_log_add() succeeds. Reviewed by: ed Modified: head/lib/libc/gen/pututxline.c Modified: head/lib/libc/gen/pututxline.c ============================================================================== --- head/lib/libc/gen/pututxline.c Wed Apr 17 21:00:22 2013 (r249592) +++ head/lib/libc/gen/pututxline.c Wed Apr 17 21:08:15 2013 (r249593) @@ -131,7 +131,8 @@ exact: else error = 0; fclose(fp); - errno = error; + if (error != 0) + errno = error; return (error == 0 ? 0 : 1); } @@ -169,7 +170,8 @@ utx_active_remove(struct futx *fu) } fclose(fp); - errno = error; + if (ret != 0) + errno = error; return (ret); } @@ -225,7 +227,8 @@ utx_lastlogin_add(const struct futx *fu) ret = -1; } fclose(fp); - errno = error; + if (ret == -1) + errno = error; return (ret); } @@ -277,7 +280,8 @@ utx_log_add(const struct futx *fu) else error = 0; _close(fd); - errno = error; + if (error != 0) + errno = error; return (error == 0 ? 0 : 1); } From owner-svn-src-all@FreeBSD.ORG Wed Apr 17 21:08:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 2204197B; Wed, 17 Apr 2013 21:08:19 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 143697CB; Wed, 17 Apr 2013 21:08:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3HL8IU2056619; Wed, 17 Apr 2013 21:08:18 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3HL8Ir3056618; Wed, 17 Apr 2013 21:08:18 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201304172108.r3HL8Ir3056618@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 17 Apr 2013 21:08:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249594 - head/tools/regression/pjdfstest X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2013 21:08:19 -0000 Author: pjd Date: Wed Apr 17 21:08:18 2013 New Revision: 249594 URL: http://svnweb.freebsd.org/changeset/base/249594 Log: Style cleanups. Modified: head/tools/regression/pjdfstest/pjdfstest.c Modified: head/tools/regression/pjdfstest/pjdfstest.c ============================================================================== --- head/tools/regression/pjdfstest/pjdfstest.c Wed Apr 17 21:08:15 2013 (r249593) +++ head/tools/regression/pjdfstest/pjdfstest.c Wed Apr 17 21:08:18 2013 (r249594) @@ -581,13 +581,18 @@ call_syscall(struct syscall_desc *scall, args[i].str = (void *)0xdeadc0de; else args[i].str = argv[i]; - } else if ((scall->sd_args[i] & TYPE_MASK) == TYPE_NUMBER) { + } else if ((scall->sd_args[i] & TYPE_MASK) == + TYPE_NUMBER) { args[i].num = strtoll(argv[i], &endp, 0); - if (*endp != '\0' && !isspace((unsigned char)*endp)) { - fprintf(stderr, "invalid argument %u, number expected [%s]\n", i, endp); + if (*endp != '\0' && + !isspace((unsigned char)*endp)) { + fprintf(stderr, + "invalid argument %u, number expected [%s]\n", + i, endp); exit(1); } - } else if ((scall->sd_args[i] & TYPE_MASK) == TYPE_DESCRIPTOR) { + } else if ((scall->sd_args[i] & TYPE_MASK) == + TYPE_DESCRIPTOR) { if (strcmp(argv[i], "AT_FDCWD") == 0) { args[i].num = AT_FDCWD; } else if (strcmp(argv[i], "BADFD") == 0) { @@ -600,8 +605,11 @@ call_syscall(struct syscall_desc *scall, int pos; pos = strtoll(argv[i], &endp, 0); - if (*endp != '\0' && !isspace((unsigned char)*endp)) { - fprintf(stderr, "invalid argument %u, number expected [%s]\n", i, endp); + if (*endp != '\0' && + !isspace((unsigned char)*endp)) { + fprintf(stderr, + "invalid argument %u, number expected [%s]\n", + i, endp); exit(1); } args[i].num = descriptor_get(pos); @@ -640,7 +648,8 @@ call_syscall(struct syscall_desc *scall, fprintf(stderr, "too few arguments\n"); exit(1); } - rval = openat(NUM(0), STR(1), (int)flags, (mode_t)NUM(3)); + rval = openat(NUM(0), STR(1), (int)flags, + (mode_t)NUM(3)); } else { if (i == 4) { fprintf(stderr, "too many arguments\n"); @@ -716,7 +725,7 @@ call_syscall(struct syscall_desc *scall, } dev = makedev(NUM(fa + 3), NUM(fa + 4)); - if (strcmp(STR(fa + 1), "c") == 0) /* character device */ + if (strcmp(STR(fa + 1), "c") == 0) /* character device */ ntype = S_IFCHR; else if (strcmp(STR(fa + 1), "b") == 0) /* block device */ ntype = S_IFBLK; @@ -988,7 +997,8 @@ set_gids(char *gids) assert(ngroups > 0); gidset = malloc(sizeof(*gidset) * ngroups); assert(gidset != NULL); - for (i = 0, g = strtok(gids, ","); g != NULL; g = strtok(NULL, ","), i++) { + for (i = 0, g = strtok(gids, ","); g != NULL; + g = strtok(NULL, ","), i++) { if (i >= ngroups) { fprintf(stderr, "too many gids\n"); exit(1); @@ -1005,7 +1015,8 @@ set_gids(char *gids) exit(1); } if (setegid(gidset[0]) < 0) { - fprintf(stderr, "cannot change effective gid: %s\n", strerror(errno)); + fprintf(stderr, "cannot change effective gid: %s\n", + strerror(errno)); exit(1); } free(gidset); @@ -1075,7 +1086,8 @@ main(int argc, char *argv[]) for (;;) { scall = find_syscall(argv[0]); if (scall == NULL) { - fprintf(stderr, "syscall '%s' not supported\n", argv[0]); + fprintf(stderr, "syscall '%s' not supported\n", + argv[0]); exit(1); } argc++; From owner-svn-src-all@FreeBSD.ORG Wed Apr 17 21:11:07 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BED46CED; Wed, 17 Apr 2013 21:11:07 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (lor.one-eyed-alien.net [69.66.77.232]) by mx1.freebsd.org (Postfix) with ESMTP id 161EC7FB; Wed, 17 Apr 2013 21:11:05 +0000 (UTC) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.5/8.14.5) with ESMTP id r3HLBAHg031188; Wed, 17 Apr 2013 16:11:10 -0500 (CDT) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.5/8.14.5/Submit) id r3HLBA63031187; Wed, 17 Apr 2013 16:11:10 -0500 (CDT) (envelope-from brooks) Date: Wed, 17 Apr 2013 16:11:10 -0500 From: Brooks Davis To: Brooks Davis , Jeremy Chadwick , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-stable@FreeBSD.org, svn-src-stable-9@FreeBSD.org Subject: Re: svn commit: r249549 - in stable/9/sys: amd64/conf i386/conf Message-ID: <20130417211110.GA31145@lor.one-eyed-alien.net> References: <201304161609.r3GG9SID009937@svn.freebsd.org> <20130416161919.GA80626@icarus.home.lan> <20130417125433.GC30222@caravan.chchile.org> <20130417193538.GB9331@icarus.home.lan> <20130417194706.GA30583@lor.one-eyed-alien.net> <20130417210011.GD30222@caravan.chchile.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="DocE+STaALJfprDB" Content-Disposition: inline In-Reply-To: <20130417210011.GD30222@caravan.chchile.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2013 21:11:07 -0000 --DocE+STaALJfprDB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Apr 17, 2013 at 11:00:11PM +0200, Jeremie Le Hen wrote: > On Wed, Apr 17, 2013 at 02:47:06PM -0500, Brooks Davis wrote: > >=20 > > > I will spend some time to figure out exactly how to reproduce this. > > >=20 > > > Going from recent memory (~2 weeks ago), I encountered it on my VPS b= ox > > > (which does run ntpd, just FYI): > > >=20 > > > 1. Initially installed with 9.1-RELEASE, > > > 2. Upgraded to stable/9 (using svn), > > > 3. WITHOUT_CDDL=3Dtrue and WITHOUT_ZFS=3Dtrue added to /etc/src.conf > > > 4. world/kernel rebuilt/reinstalled/etc. (this includes make delete-o= ld, > > > as per instructions in src/Makefile -- which would delete > > > /usr/bin/ctfconvert) > > > 5. Fast forward many months > > > 6. Removed WITHOUT_CDDL=3Dtrue from src.conf > > > 7. Encountered the above issue ("ctfconvert: not found") during > > > buildkernel > > > 8. Rebuilt kernel again -- same error > > > 9. Removed WITHOUT_ZFS=3Dtrue from src.conf > > > 10. Rebuilt kernel again -- worked > > >=20 > > > This could mean WITHOUT_ZFS=3Dtrue has some bearing on this situation= , but > > > I don't see how/why, as WITHOUT_CDDL is supposed to be the "trigger" = for > > > ctf* utilities. I did poke around the Makefiles and framework a bit > > > but didn't have any epiphanies. > > >=20 > > > Like I said -- I'll try to reproduce the exact scenario. > >=20 > > Looking at Makefile.inc1 around line 1164 (on HEAD), ctfconvert and > > cftmerge are bootstrap tools only when they don't exist at all on the > > host. The code there should be expanded to bootstrap for cases where > > the installed ones are known to be broken (virtually all prior versions > > given recent fixes) as well as when they aren't present on the host > > system. >=20 > Do you have an idea how we can identify whether the installed > ctfconvert(1) is broken or not? I think in Jeremy's case we cannot rely > on OSRELDATE given that right before he built and installed world with > WITHOUT_CDDL, so ctfconvert and OSRELDATE are not in sync. I think we should be able to come up with a fairly reliable set values where it's broken. We can also add a exists(/usr/bin/ctfconvert) to catch the case were the user caused it to not be there. > Why not just always add ctfconvert to bootstrap tools when it is needed? > I don't know how long it takes to build though, but it is probably > nothing compared to LLVM ;-). It's probably not too bad to add, but I don't think it's changing all that quickly so as long as people remember to update Makefile.inc1 it shouldn't too bad. -- Brooks --DocE+STaALJfprDB Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iD8DBQFRbw/tXY6L6fI4GtQRAgMJAKDGORBqUjaCUN+C7GP1WVqaLNQN8ACgyXl5 x4JVIqBpHCL3OIpwC/AbizE= =dKfW -----END PGP SIGNATURE----- --DocE+STaALJfprDB-- From owner-svn-src-all@FreeBSD.ORG Wed Apr 17 21:21:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 987B2CA; Wed, 17 Apr 2013 21:21:28 +0000 (UTC) (envelope-from hiren@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8AC8485F; Wed, 17 Apr 2013 21:21:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3HLLRvo061954; Wed, 17 Apr 2013 21:21:27 GMT (envelope-from hiren@svn.freebsd.org) Received: (from hiren@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3HLLRWq061952; Wed, 17 Apr 2013 21:21:27 GMT (envelope-from hiren@svn.freebsd.org) Message-Id: <201304172121.r3HLLRWq061952@svn.freebsd.org> From: Hiren Panchasara Date: Wed, 17 Apr 2013 21:21:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249595 - head/sys/dev/ips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2013 21:21:28 -0000 Author: hiren Date: Wed Apr 17 21:21:27 2013 New Revision: 249595 URL: http://svnweb.freebsd.org/changeset/base/249595 Log: Improving r249461 by providing a better way to handle the clang warning. PR: kern/177164 Reviewed by: jhb Approved by: sbruno (mentor) Modified: head/sys/dev/ips/ips.c Modified: head/sys/dev/ips/ips.c ============================================================================== --- head/sys/dev/ips/ips.c Wed Apr 17 21:08:18 2013 (r249594) +++ head/sys/dev/ips/ips.c Wed Apr 17 21:21:27 2013 (r249595) @@ -578,7 +578,7 @@ static int ips_copperhead_queue_init(ips { int error; bus_dma_tag_t dmatag; - bus_dmamap_t dmamap = NULL; + bus_dmamap_t dmamap; if (bus_dma_tag_create( /* parent */ sc->adapter_dmatag, /* alignemnt */ 1, /* boundary */ 0, @@ -595,7 +595,7 @@ static int ips_copperhead_queue_init(ips &dmatag) != 0) { device_printf(sc->dev, "can't alloc dma tag for statue queue\n"); error = ENOMEM; - goto exit; + return error; } if(bus_dmamem_alloc(dmatag, (void *)&(sc->copper_queue), BUS_DMA_NOWAIT, &dmamap)){ @@ -623,7 +623,8 @@ static int ips_copperhead_queue_init(ips return 0; exit: - bus_dmamem_free(dmatag, sc->copper_queue, dmamap); + if (sc->copper_queue != NULL) + bus_dmamem_free(dmatag, sc->copper_queue, dmamap); bus_dma_tag_destroy(dmatag); return error; } From owner-svn-src-all@FreeBSD.ORG Wed Apr 17 21:26:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0C6FC35F; Wed, 17 Apr 2013 21:26:46 +0000 (UTC) (envelope-from hiren.panchasara@gmail.com) Received: from mail-ee0-f43.google.com (mail-ee0-f43.google.com [74.125.83.43]) by mx1.freebsd.org (Postfix) with ESMTP id 32802889; Wed, 17 Apr 2013 21:26:44 +0000 (UTC) Received: by mail-ee0-f43.google.com with SMTP id e50so992100eek.16 for ; Wed, 17 Apr 2013 14:26:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=loM0lOWaTXndQ7PWxK+vHBavbGNqnA9ceDE8qaWzjKU=; b=ZDofhuBi0d6goWBqYHc/aR4SO8XP3/3BlE9ValX7ePK8ujoAkSnU+RM6/R0pPNpZMs YT6y2sgCZjtOr90fpMyBeKlvk0yWbPjUc8+O7nzwjrOkqY+z8oOZnKw7d1wLy4qxbFKk yEFZ7Vy9jiMSalxRWDeZNOC/YbLGvDpAytozp6GdQDQ+sDXSw80hnpHqVwSS2BxbN2xz VKu7713dL5OV4GbeX4pfo6yoceGDhRscfWOF0KIP1DiN4YV9eHNe2NBlh3Bp7v0WTM4o X6rzkLcFXns3LuY/I6iDHnn4WtHtrdGr+BEgafToo4eJBV/ijUoF8MqUimadx/iF57Ga VSkw== MIME-Version: 1.0 X-Received: by 10.14.5.137 with SMTP id 9mr22327293eel.30.1366233997155; Wed, 17 Apr 2013 14:26:37 -0700 (PDT) Sender: hiren.panchasara@gmail.com Received: by 10.15.91.72 with HTTP; Wed, 17 Apr 2013 14:26:37 -0700 (PDT) In-Reply-To: <201304171451.45400.jhb@freebsd.org> References: <201304140242.r3E2geSq094403@svn.freebsd.org> <201304171319.26560.jhb@freebsd.org> <201304171451.45400.jhb@freebsd.org> Date: Wed, 17 Apr 2013 14:26:37 -0700 X-Google-Sender-Auth: 7cmsF--Rx3H7IQK1lglWMFWsm8g Message-ID: Subject: Re: svn commit: r249461 - head/sys/dev/ips From: hiren panchasara To: John Baldwin Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head , svn-src-all , src-committers X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2013 21:26:46 -0000 On Wed, Apr 17, 2013 at 11:51 AM, John Baldwin wrote: > On Wednesday, April 17, 2013 2:36:48 pm hiren panchasara wrote: >> On Wed, Apr 17, 2013 at 10:19 AM, John Baldwin wrote: >> > On Wednesday, April 17, 2013 1:15:11 pm hiren panchasara wrote: >> >> On Tue, Apr 16, 2013 at 9:10 AM, John Baldwin wrote: >> >> > On Saturday, April 13, 2013 10:42:40 pm Hiren Panchasara wrote: >> >> >> Author: hiren >> >> >> Date: Sun Apr 14 02:42:40 2013 >> >> >> New Revision: 249461 >> >> >> URL: http://svnweb.freebsd.org/changeset/base/249461 >> >> >> >> >> >> Log: >> >> >> Fixing a clang warning indicating uninitialized variable usage. >> >> >> >> >> >> PR: kern/177164 >> >> >> Approved by: sbruno (mentor) >> >> > >> >> > Hmm, I always thought that dmatags and maps were opaque types and not >> >> > necessarily "known" in consumers to be pointers. (Some drivers do > check tehm >> >> > against NULL implicitly via 'if (map)' or 'if (tag)', but well-behaved > drivers >> >> > use other means (flags, etc.) to know if they are valid.) >> >> >> >> Hi John, >> >> >> >> Would this be a better fix? We do not need to do any clean up if we >> >> fail to create the tag: >> >> >> >> Index: ips.c >> >> =================================================================== >> >> --- ips.c (revision 249588) >> >> +++ ips.c (working copy) >> >> @@ -578,7 +578,7 @@ >> >> { >> >> int error; >> >> bus_dma_tag_t dmatag; >> >> - bus_dmamap_t dmamap = NULL; >> >> + bus_dmamap_t dmamap; >> >> if (bus_dma_tag_create( /* parent */ sc- >>adapter_dmatag, >> >> /* alignemnt */ 1, >> >> /* boundary */ 0, >> >> @@ -595,7 +595,7 @@ >> >> &dmatag) != 0) { >> >> device_printf(sc->dev, "can't alloc dma tag for >> >> statue queue\n"); >> >> error = ENOMEM; >> >> - goto exit; >> >> + return error; >> >> } >> >> if(bus_dmamem_alloc(dmatag, (void *)&(sc->copper_queue), >> >> BUS_DMA_NOWAIT, &dmamap)){ >> > >> > That would be fine. I would actually prefer though that this only >> > call bus_dmamem_free() if the alloc succeeds, so in addition I would >> > make the call to bus_dmammem_free() conditional on sc->copper_queue != > NULL. >> > >> >> Makes sense, final patch looks like this: >> >> Index: ips.c >> =================================================================== >> --- ips.c (revision 249588) >> +++ ips.c (working copy) >> @@ -578,7 +578,7 @@ >> { >> int error; >> bus_dma_tag_t dmatag; >> - bus_dmamap_t dmamap = NULL; >> + bus_dmamap_t dmamap; >> if (bus_dma_tag_create( /* parent */ sc->adapter_dmatag, >> /* alignemnt */ 1, >> /* boundary */ 0, >> @@ -595,7 +595,7 @@ >> &dmatag) != 0) { >> device_printf(sc->dev, "can't alloc dma tag for >> statue queue\n"); >> error = ENOMEM; >> - goto exit; >> + return error; > > One more suggestion: just use 'return (ENOMEM)' directly perhaps. > >> } >> if(bus_dmamem_alloc(dmatag, (void *)&(sc->copper_queue), >> BUS_DMA_NOWAIT, &dmamap)){ >> @@ -623,7 +623,8 @@ >> >> return 0; >> exit: >> - bus_dmamem_free(dmatag, sc->copper_queue, dmamap); >> + if (sc->copper_queue != NULL) >> + bus_dmamem_free(dmatag, sc->copper_queue, dmamap); >> bus_dma_tag_destroy(dmatag); >> return error; >> } >> >> Thanks, >> Hiren > > Looks ok to me with or without the suggestion above. Committed in r249595. Thanks for all the help. Hiren > > -- > John Baldwin From owner-svn-src-all@FreeBSD.ORG Wed Apr 17 22:42:45 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E5650519; Wed, 17 Apr 2013 22:42:45 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D68FEB31; Wed, 17 Apr 2013 22:42:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3HMgj9T087001; Wed, 17 Apr 2013 22:42:45 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3HMgipH086988; Wed, 17 Apr 2013 22:42:44 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201304172242.r3HMgipH086988@svn.freebsd.org> From: "Kenneth D. Merry" Date: Wed, 17 Apr 2013 22:42:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249596 - in head/sys: conf fs/nfsserver modules/nfsd modules/nfsserver nfs nfsserver X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2013 22:42:46 -0000 Author: ken Date: Wed Apr 17 22:42:43 2013 New Revision: 249596 URL: http://svnweb.freebsd.org/changeset/base/249596 Log: Move the NFS FHA (File Handle Affinity) code from sys/nfsserver to sys/nfs, since it is now shared by the two NFS servers. Suggested by: rmacklem Sponsored by: Spectra Logic MFC after: 2 weeks Added: head/sys/nfs/nfs_fha.c - copied, changed from r249595, head/sys/nfsserver/nfs_fha.c head/sys/nfs/nfs_fha.h - copied unchanged from r249595, head/sys/nfsserver/nfs_fha.h Deleted: head/sys/nfsserver/nfs_fha.c head/sys/nfsserver/nfs_fha.h Modified: head/sys/conf/files head/sys/fs/nfsserver/nfs_fha_new.c head/sys/fs/nfsserver/nfs_nfsdkrpc.c head/sys/modules/nfsd/Makefile head/sys/modules/nfsserver/Makefile head/sys/nfsserver/nfs_fha_old.c head/sys/nfsserver/nfs_srvkrpc.c Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Apr 17 21:21:27 2013 (r249595) +++ head/sys/conf/files Wed Apr 17 22:42:43 2013 (r249596) @@ -3203,6 +3203,7 @@ nfs/bootp_subr.c optional bootp nfsclie nfs/krpc_subr.c optional bootp nfsclient | bootp nfscl nfs/nfs_common.c optional nfsclient | nfsserver nfs/nfs_diskless.c optional nfsclient nfs_root | nfscl nfs_root +nfs/nfs_fha.c optional nfsserver | nfsd nfs/nfs_lock.c optional nfsclient | nfscl | nfslockd | nfsd nfsclient/nfs_bio.c optional nfsclient nfsclient/nfs_node.c optional nfsclient @@ -3211,7 +3212,6 @@ nfsclient/nfs_subs.c optional nfsclient nfsclient/nfs_nfsiod.c optional nfsclient nfsclient/nfs_vfsops.c optional nfsclient nfsclient/nfs_vnops.c optional nfsclient -nfsserver/nfs_fha.c optional nfsserver | nfsd nfsserver/nfs_fha_old.c optional nfsserver nfsserver/nfs_serv.c optional nfsserver nfsserver/nfs_srvkrpc.c optional nfsserver Modified: head/sys/fs/nfsserver/nfs_fha_new.c ============================================================================== --- head/sys/fs/nfsserver/nfs_fha_new.c Wed Apr 17 21:21:27 2013 (r249595) +++ head/sys/fs/nfsserver/nfs_fha_new.c Wed Apr 17 22:42:43 2013 (r249596) @@ -30,11 +30,11 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include #include -#include #include static void fhanew_init(void *foo); Modified: head/sys/fs/nfsserver/nfs_nfsdkrpc.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdkrpc.c Wed Apr 17 21:21:27 2013 (r249595) +++ head/sys/fs/nfsserver/nfs_nfsdkrpc.c Wed Apr 17 22:42:43 2013 (r249596) @@ -42,7 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include Modified: head/sys/modules/nfsd/Makefile ============================================================================== --- head/sys/modules/nfsd/Makefile Wed Apr 17 21:21:27 2013 (r249595) +++ head/sys/modules/nfsd/Makefile Wed Apr 17 22:42:43 2013 (r249596) @@ -1,6 +1,6 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../fs/nfsserver ${.CURDIR}/../../nfsserver +.PATH: ${.CURDIR}/../../fs/nfsserver ${.CURDIR}/../../nfs KMOD= nfsd SRCS= vnode_if.h \ nfs_fha.c \ Modified: head/sys/modules/nfsserver/Makefile ============================================================================== --- head/sys/modules/nfsserver/Makefile Wed Apr 17 21:21:27 2013 (r249595) +++ head/sys/modules/nfsserver/Makefile Wed Apr 17 22:42:43 2013 (r249596) @@ -1,6 +1,6 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../nfsserver +.PATH: ${.CURDIR}/../../nfsserver ${.CURDIR}/../../nfs KMOD= nfsserver SRCS= vnode_if.h \ nfs_fha.c nfs_fha_old.c nfs_serv.c nfs_srvkrpc.c nfs_srvsubs.c \ Copied and modified: head/sys/nfs/nfs_fha.c (from r249595, head/sys/nfsserver/nfs_fha.c) ============================================================================== --- head/sys/nfsserver/nfs_fha.c Wed Apr 17 21:21:27 2013 (r249595, copy source) +++ head/sys/nfs/nfs_fha.c Wed Apr 17 22:42:43 2013 (r249596) @@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include static MALLOC_DEFINE(M_NFS_FHA, "NFS FHA", "NFS FHA"); Copied: head/sys/nfs/nfs_fha.h (from r249595, head/sys/nfsserver/nfs_fha.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/nfs/nfs_fha.h Wed Apr 17 22:42:43 2013 (r249596, copy of r249595, head/sys/nfsserver/nfs_fha.h) @@ -0,0 +1,112 @@ +/*- + * Copyright (c) 2008 Isilon Inc http://www.isilon.com/ + * + * 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 _NFS_FHA_H +#define _NFS_FHA_H 1 + +#ifdef _KERNEL + +/* Sysctl defaults. */ +#define FHA_DEF_ENABLE 1 +#define FHA_DEF_BIN_SHIFT 22 /* 4MB */ +#define FHA_DEF_MAX_NFSDS_PER_FH 8 +#define FHA_DEF_MAX_REQS_PER_NFSD 0 /* Unlimited */ + +/* This is the global structure that represents the state of the fha system. */ +struct fha_global { + struct fha_hash_entry_list *hashtable; + u_long hashmask; +}; + +struct fha_ctls { + int enable; + uint32_t bin_shift; + uint32_t max_nfsds_per_fh; + uint32_t max_reqs_per_nfsd; +}; + +/* + * These are the entries in the filehandle hash. They talk about a specific + * file, requests against which are being handled by one or more nfsds. We + * keep a chain of nfsds against the file. We only have more than one if reads + * are ongoing, and then only if the reads affect disparate regions of the + * file. + * + * In general, we want to assign a new request to an existing nfsd if it is + * going to contend with work happening already on that nfsd, or if the + * operation is a read and the nfsd is already handling a proximate read. We + * do this to avoid jumping around in the read stream unnecessarily, and to + * avoid contention between threads over single files. + */ +struct fha_hash_entry { + LIST_ENTRY(fha_hash_entry) link; + u_int64_t fh; + u_int32_t num_rw; + u_int32_t num_exclusive; + u_int8_t num_threads; + struct svcthread_list threads; +}; + +LIST_HEAD(fha_hash_entry_list, fha_hash_entry); + +/* A structure used for passing around data internally. */ +struct fha_info { + u_int64_t fh; + off_t offset; + int locktype; +}; + +struct fha_callbacks { + rpcproc_t (*get_procnum)(rpcproc_t procnum); + int (*realign)(struct mbuf **mb, int malloc_flags); + int (*get_fh)(fhandle_t *fh, int v3, struct mbuf **md, caddr_t *dpos); + int (*is_read)(rpcproc_t procnum); + int (*is_write)(rpcproc_t procnum); + int (*get_offset)(struct mbuf **md, caddr_t *dpos, int v3, struct + fha_info *info); + int (*no_offset)(rpcproc_t procnum); + void (*set_locktype)(rpcproc_t procnum, struct fha_info *info); + int (*fhe_stats_sysctl)(SYSCTL_HANDLER_ARGS); +}; + +struct fha_params { + struct fha_global g_fha; + struct sysctl_ctx_list sysctl_ctx; + struct sysctl_oid *sysctl_tree; + struct fha_ctls ctls; + struct fha_callbacks callbacks; + char server_name[32]; + SVCPOOL **pool; +}; + +void fha_nd_complete(SVCTHREAD *, struct svc_req *); +SVCTHREAD *fha_assign(SVCTHREAD *, struct svc_req *, struct fha_params *); +void fha_init(struct fha_params *softc); +void fha_uninit(struct fha_params *softc); +int fhe_stats_sysctl(SYSCTL_HANDLER_ARGS, struct fha_params *softc); + +#endif /* _KERNEL */ +#endif /* _NFS_FHA_H_ */ Modified: head/sys/nfsserver/nfs_fha_old.c ============================================================================== --- head/sys/nfsserver/nfs_fha_old.c Wed Apr 17 21:21:27 2013 (r249595) +++ head/sys/nfsserver/nfs_fha_old.c Wed Apr 17 22:42:43 2013 (r249596) @@ -40,9 +40,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include -#include #include static void fhaold_init(void *foo); Modified: head/sys/nfsserver/nfs_srvkrpc.c ============================================================================== --- head/sys/nfsserver/nfs_srvkrpc.c Wed Apr 17 21:21:27 2013 (r249595) +++ head/sys/nfsserver/nfs_srvkrpc.c Wed Apr 17 22:42:43 2013 (r249596) @@ -77,10 +77,10 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include -#include #include #include From owner-svn-src-all@FreeBSD.ORG Wed Apr 17 22:56:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8C73980E for ; Wed, 17 Apr 2013 22:56:05 +0000 (UTC) (envelope-from jdc@koitsu.org) Received: from qmta14.emeryville.ca.mail.comcast.net (qmta14.emeryville.ca.mail.comcast.net [IPv6:2001:558:fe2d:44:76:96:27:212]) by mx1.freebsd.org (Postfix) with ESMTP id 6F97DC01 for ; Wed, 17 Apr 2013 22:56:05 +0000 (UTC) Received: from omta01.emeryville.ca.mail.comcast.net ([76.96.30.11]) by qmta14.emeryville.ca.mail.comcast.net with comcast id RALe1l0030EPchoAEAw4o8; Wed, 17 Apr 2013 22:56:04 +0000 Received: from koitsu.strangled.net ([67.180.84.87]) by omta01.emeryville.ca.mail.comcast.net with comcast id RAw31l0091t3BNj8MAw3LH; Wed, 17 Apr 2013 22:56:03 +0000 Received: by icarus.home.lan (Postfix, from userid 1000) id 23F7F73A33; Wed, 17 Apr 2013 15:56:03 -0700 (PDT) Date: Wed, 17 Apr 2013 15:56:03 -0700 From: Jeremy Chadwick To: Brooks Davis Subject: Re: svn commit: r249549 - in stable/9/sys: amd64/conf i386/conf Message-ID: <20130417225603.GA13720@icarus.home.lan> References: <201304161609.r3GG9SID009937@svn.freebsd.org> <20130416161919.GA80626@icarus.home.lan> <20130417125433.GC30222@caravan.chchile.org> <20130417193538.GB9331@icarus.home.lan> <20130417194706.GA30583@lor.one-eyed-alien.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130417194706.GA30583@lor.one-eyed-alien.net> User-Agent: Mutt/1.5.21 (2010-09-15) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20121106; t=1366239364; bh=ZeHXzdu8OY2MCVfYNFD7Ik/+zkN74q4BnTFlKqjjY98=; h=Received:Received:Received:Date:From:To:Subject:Message-ID: MIME-Version:Content-Type; b=UNPEUqPL58FfK52iw2ChchgFHzTep/edx9wVXRHrRkNFITLEOwb5cDAy/2e0Z/5f0 wpqoJ1531Co0ih8h9WIbFPWcBicuhdqp9thQJzNKfDQdXVs/m6zplNoBcCXn1WYuis OfS5tgrNdvn/0+ROcVVHs+etPLY5HAfY6ZytywDJW48Ocaq19KOg5Ufsg08tSDqfPz 8KfXgrsmfTpXPu28N33wfDBLvYdAcSoRNsPhAPrhslsEGZ7bNwhgFS1DE3KpDwfUYY rfoWWydyRXy8ykPHEOAm5YqRPvn4oLSzJ4584YUwhiawcrtxVi3ALd2Kb+gM42y2ZF DX0plt0ZRaGyQ== Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-9@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2013 22:56:05 -0000 On Wed, Apr 17, 2013 at 02:47:06PM -0500, Brooks Davis wrote: > On Wed, Apr 17, 2013 at 12:35:38PM -0700, Jeremy Chadwick wrote: > > On Wed, Apr 17, 2013 at 02:54:33PM +0200, Jeremie Le Hen wrote: > > > Hi Jeremy, > > > > > > On Tue, Apr 16, 2013 at 09:19:19AM -0700, Jeremy Chadwick wrote: > > > > > > > > Now that this has been enabled by default, I should warn folks of a > > > > caveat that I found in the buildworld/buildkernel framework. It's > > > > easiest to explain like this: > > > > > > > > 1. Install FreeBSD 9.x, svn checkout of stable/9, etc... > > > > 2. Add WITHOUT_CDDL=true to /etc/src.conf > > > > 3. Rebuild + install kernel/world per src/Makefile procedure > > > > 4. Remove WITHOUT_CDDL=true from /etc/src.conf > > > > 5. rm -fr /usr/obj/* > > > > 6. Rebuild world > > > > 7. Rebuild kernel -- fails, stating "ctfconvert: not found". > > > > > > > > For whatever reason the buildkernel bits make the assumption that > > > > ctfconvert exists on the system (presumably in $PATH or possibly a > > > > hard-coded), when ideally it should try to use the recently-built > > > > version in /usr/obj first. > > > > > > I've tested this is a freshly installed 9.1-RELEASE jail and I haven't > > > been biten by the bug you describe. > > > > > > ctfconvert(1) seems to be installed by default in 9.1-RELEASE, this is > > > probably there problem didn't occur. I can easily verify this in the > > > jail: > > > > > > % root@test9:/usr/src # ls -l /usr/bin/ctfconvert /usr/bin/vi /usr/bin/tail > > > % -r-xr-xr-x 1 root wheel 371536 Dec 4 09:33 /usr/bin/ctfconvert > > > % -r-xr-xr-x 1 root wheel 19848 Apr 17 06:28 /usr/bin/tail > > > % -r-xr-xr-x 6 root wheel 346432 Apr 17 06:28 /usr/bin/vi > > > > > > > > > Do you have a theory about why you've got the problem while I haven't? > > > FYI, it seems 9.0-RELEASE also has ctfconvert(1): > > > http://svnweb.freebsd.org/base/release/9.0.0/cddl/usr.bin/ctfconvert/ > > > > > > My guess is tha this might happen if you don't have /usr/bin/ctfconvert. > > > I've just removed it and trying to build kernel again. > > > > I will spend some time to figure out exactly how to reproduce this. > > > > Going from recent memory (~2 weeks ago), I encountered it on my VPS box > > (which does run ntpd, just FYI): > > > > 1. Initially installed with 9.1-RELEASE, > > 2. Upgraded to stable/9 (using svn), > > 3. WITHOUT_CDDL=true and WITHOUT_ZFS=true added to /etc/src.conf > > 4. world/kernel rebuilt/reinstalled/etc. (this includes make delete-old, > > as per instructions in src/Makefile -- which would delete > > /usr/bin/ctfconvert) > > 5. Fast forward many months > > 6. Removed WITHOUT_CDDL=true from src.conf > > 7. Encountered the above issue ("ctfconvert: not found") during > > buildkernel > > 8. Rebuilt kernel again -- same error > > 9. Removed WITHOUT_ZFS=true from src.conf > > 10. Rebuilt kernel again -- worked > > > > This could mean WITHOUT_ZFS=true has some bearing on this situation, but > > I don't see how/why, as WITHOUT_CDDL is supposed to be the "trigger" for > > ctf* utilities. I did poke around the Makefiles and framework a bit > > but didn't have any epiphanies. > > > > Like I said -- I'll try to reproduce the exact scenario. > > Looking at Makefile.inc1 around line 1164 (on HEAD), ctfconvert and > cftmerge are bootstrap tools only when they don't exist at all on the > host. The code there should be expanded to bootstrap for cases where > the installed ones are known to be broken (virtually all prior versions > given recent fixes) as well as when they aren't present on the host > system. I'm able to reproduce the issue I speak of with 100% reliability. Jeremie, I'm not sure why you're not able to reproduce this, because I can do so reliably/consistently. Below are my notes. This was done on a VMware Workstation VM instance, and I took VM snapshots along the way, so I can "roll back" to almost any phase/step listed below (in case someone wants me to verify what's on the filesystem or use "script" to save a log somewhere or run "make -DA" or something along those lines). 1. Installed 9.1-RELEASE. 2. Added ntpdate_enable and ntpd_enable to /etc/rc.conf, and ran /etc/rc.d/ntpdate start ; /etc/rc.d/ntpd start. 3. Added following to /etc/src.conf: WITHOUT_CDDL=true WITHOUT_CLANG=true WITHOUT_INET6=true WITHOUT_IPFILTER=true WITHOUT_LIB32=true WITHOUT_KERBEROS=true WITHOUT_PAM_SUPPORT=true WITHOUT_SENDMAIL=true WITHOUT_ZFS=true WITH_OPENSSH_NONE_CIPHER=true 4. Installed subversion via ports/pkg_add -r and pulled down a fresh copy of stable/9 (src, r249561) and ports. 5. Verified that /usr/bin/ctfconvert and other CTF utilities exist on system (obviously part of 9.1-RELEASE). 6. Followed instructions in src/Makefile. Shown here: # 1. `cd /usr/src' (or to the directory containing your source tree). # 2. `make buildworld' # 3. `make buildkernel KERNCONF=YOUR_KERNEL_HERE' (default is GENERIC). # 4. `make installkernel KERNCONF=YOUR_KERNEL_HERE' (default is GENERIC). # [steps 3. & 4. can be combined by using the "kernel" target] # 5. `reboot' (in single user mode: boot -s from the loader prompt). # 6. `mergemaster -p' # 7. `make installworld' # 8. `make delete-old' # 9. `mergemaster' (you may wish to use -i, along with -U or -F). # 10. `reboot' # 11. `make delete-old-libs' (in case no 3rd party program uses them anymore) Had to do "mergemaster -p" prior to installkernel, but Brooks knows about this and it's not relevant to the issue. 7. Verified the "make delete-old" phase deleted /usr/bin/ctfconvert and other CTF utilities; this is normal. 8. Removed WITHOUT_CDDL=true from /etc/src.conf 9. rm -fr /usr/obj/* && cd /usr/src && make -j2 buildworld. 10. Verification of everything at this point -- ctf* utilities are clearly in /usr/obj, but are not in /usr/bin (because of delete-old): root@testbox:/usr/src # find /usr/obj -name "ctf*" -type f -perm 0755 -ls 1783448 728 -rwxr-xr-x 1 root wheel 371738 Apr 17 15:29 /usr/obj/usr/src/cddl/usr.bin/ctfconvert/ctfconvert 1783453 64 -rwxr-xr-x 1 root wheel 28706 Apr 17 15:29 /usr/obj/usr/src/cddl/usr.bin/ctfdump/ctfdump 1783472 168 -rwxr-xr-x 1 root wheel 82711 Apr 17 15:29 /usr/obj/usr/src/cddl/usr.bin/ctfmerge/ctfmerge root@testbox:/usr/src # find /usr/bin -name "ctf*" -type f -perm 0755 -ls root@testbox:/usr/src # 11. make -j2 buildkernel fails: *** [aac_disk.o] Error code 127 cc -c -O2 -frename-registers -pipe -fno-strict-aliasing -std=c99 -g -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -Wmissing-include-dirs -fdiagnostics-show-option -nostdinc -I. -I/usr/src/sys -I/usr/src/sys/contrib/altq -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common -finline-limit=8000 --param inline-unit-growth=100 --param large-function-growth=1000 -fno-omit-frame-pointer -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector -Werror /usr/src/sys/cam/cam.c ctfconvert -L VERSION -g cam.o ctfconvert: not found *** [cam.o] Error code 127 ctfconvert -L VERSION -g aac_cam.o ctfconvert: not found *** [aac_cam.o] Error code 127 2 errors *** [all] Error code 2 1 error *** [modules-all] Error code 2 2 errors *** [buildkernel] Error code 2 1 error *** [buildkernel] Error code 2 1 error I'll be doing the following to see where exactly the failure happens since as we know parallel make causes confusing output sometimes, rm -fr /usr/obj/* && make -j2 buildworld && make buildkernel I doubt the parallelism has anything to do with the issue, however -- it seems very clear cut to me that the issue is that buildkernel assumes ctfconvert is in one's $PATH, which is not true if you have an active system with WITHOUT_CDDL=true which you're trying to move *to* have CDDL. -- | Jeremy Chadwick jdc@koitsu.org | | UNIX Systems Administrator http://jdc.koitsu.org/ | | Mountain View, CA, US | | Making life hard for others since 1977. PGP 4BD6C0CB | From owner-svn-src-all@FreeBSD.ORG Wed Apr 17 23:56:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9F5CC326 for ; Wed, 17 Apr 2013 23:56:38 +0000 (UTC) (envelope-from jdc@koitsu.org) Received: from qmta13.emeryville.ca.mail.comcast.net (qmta13.emeryville.ca.mail.comcast.net [IPv6:2001:558:fe2d:44:76:96:27:243]) by mx1.freebsd.org (Postfix) with ESMTP id 7E43DE6F for ; Wed, 17 Apr 2013 23:56:38 +0000 (UTC) Received: from omta13.emeryville.ca.mail.comcast.net ([76.96.30.52]) by qmta13.emeryville.ca.mail.comcast.net with comcast id R8P21l00517UAYkADBwevt; Wed, 17 Apr 2013 23:56:38 +0000 Received: from koitsu.strangled.net ([67.180.84.87]) by omta13.emeryville.ca.mail.comcast.net with comcast id RBwd1l0061t3BNj8ZBwdHy; Wed, 17 Apr 2013 23:56:37 +0000 Received: by icarus.home.lan (Postfix, from userid 1000) id 09CF373A33; Wed, 17 Apr 2013 16:56:37 -0700 (PDT) Date: Wed, 17 Apr 2013 16:56:37 -0700 From: Jeremy Chadwick To: Brooks Davis Subject: Re: svn commit: r249549 - in stable/9/sys: amd64/conf i386/conf Message-ID: <20130417235636.GA14262@icarus.home.lan> References: <201304161609.r3GG9SID009937@svn.freebsd.org> <20130416161919.GA80626@icarus.home.lan> <20130417125433.GC30222@caravan.chchile.org> <20130417193538.GB9331@icarus.home.lan> <20130417194706.GA30583@lor.one-eyed-alien.net> <20130417225603.GA13720@icarus.home.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130417225603.GA13720@icarus.home.lan> User-Agent: Mutt/1.5.21 (2010-09-15) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20121106; t=1366242998; bh=syt4+XY6nuiQyBsKv0iTzcNrJneSLy721Szf+JV+l8A=; h=Received:Received:Received:Date:From:To:Subject:Message-ID: MIME-Version:Content-Type; b=Z1lbimAbQrgkbQMXgEcXIpWEa/zWpXY7dfpRIc1N1EmS+o09LcZ3SHnD+jJmgNz/N 5aSwBEdMVxOvXj5SxX7y8QXET7T/D7rNkQ9eduMNvmDTmnPVc24Vd58ibM+XONjzWJ 4RVV+Uol76YwaWQ2ZYShDYLR0uLTaC2Nr/snZ5Fjy2Loxkzi0rQTVIaj+88nsh7Snk zTNCo08K1al5I+kY0nX7c76wfkROlJ2yIZtZ14DAcmmKZ34t2ZgGa5zQy75VmioBIz uzir034uD58lKLos1sIJuArDBB1tRQSX1ahBgprteL9ETTK/SLMT1NLo4M7GT0+E5u ob3wtk0mpKyzQ== Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-9@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2013 23:56:38 -0000 On Wed, Apr 17, 2013 at 03:56:03PM -0700, Jeremy Chadwick wrote: > {snipping for brevity; thread reference is below } > { http://lists.freebsd.org/pipermail/svn-src-stable-9/2013-April/004258.html } > > I'll be doing the following to see where exactly the failure happens > since as we know parallel make causes confusing output sometimes, > > rm -fr /usr/obj/* && make -j2 buildworld && make buildkernel > > I doubt the parallelism has anything to do with the issue, however -- it > seems very clear cut to me that the issue is that buildkernel assumes > ctfconvert is in one's $PATH, which is not true if you have an active > system with WITHOUT_CDDL=true which you're trying to move *to* have > CDDL. Made no difference as I expected. Here's the result: -------------------------------------------------------------- >>> stage 3.2: building everything -------------------------------------------------------------- cd /usr/obj/usr/src/sys/GENERIC; MAKEOBJDIRPREFIX=/usr/obj MACHINE_ARCH=amd64 MACHINE=amd64 CPUTYPE= GROFF_BIN_PATH=/usr/obj/usr/src/tmp/legacy/usr/bin GROFF_FONT_PATH=/usr/obj/usr/src/tmp/legacy/usr/share/groff_font GROFF_TMAC_PATH=/usr/obj/usr/src/tmp/legacy/usr/share/tmac _SHLIBDIRPREFIX=/usr/obj/usr/src/tmp _LDSCRIPTROOT= VERSION="FreeBSD 9.1-STABLE amd64 901504" INSTALL="sh /usr/src/tools/install.sh" PATH=/usr/obj/usr/src/tmp/legacy/usr/sbin:/usr/obj/usr/src/tmp/legacy/usr/bin:/usr/obj/usr/src/tmp/legacy/usr/games:/usr/obj/usr/src/tmp/usr/sbin:/usr/obj/usr/src/tmp/usr/bin:/usr/obj/usr/src/tmp/usr/games:/sbin:/bin:/usr/sbin:/usr/bin COMPILER_TYPE=gcc make KERNEL=kernel all -DNO_MODULES_OBJ cc -c -x assembler-with-cpp -DLOCORE -O2 -frename-registers -pipe -fno-strict-aliasing -std=c99 -g -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -Wmissing-include-dirs -fdiagnostics-show-option -nostdinc -I. -I/usr/src/sys -I/usr/src/sys/contrib/altq -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common -finline-limit=8000 --param inline-unit-growth=100 --param large-function-growth=1000 -fno-omit-frame-pointer -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector -Werror /usr/src/sys/amd64/amd64/locore.S cc -c -O2 -frename-registers -pipe -fno-strict-aliasing -std=c99 -g -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -Wmissing-include-dirs -fdiagnostics-show-option -nostdinc -I. -I/usr/src/sys -I/usr/src/sys/contrib/altq -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common -finline-limit=8000 --param inline-unit-growth=100 --param large-function-growth=1000 -fno-omit-frame-pointer -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector -Werror aic7xxx_reg_print.c ctfconvert -L VERSION -g aic7xxx_reg_print.o ctfconvert: No such file or directory *** [aic7xxx_reg_print.o] Error code 1 Stop in /usr/obj/usr/src/sys/GENERIC. *** [buildkernel] Error code 1 Stop in /usr/src. *** [buildkernel] Error code 1 Stop in /usr/src. Apologies for the long paths and verbosity here, but... I started digging through Makefile.inc1, as my first inclination was to figure out why /usr/obj/usr/src/cddl/usr.bin (and usr.sbin) were missing from the PATH definition. I then realised that's not the proper solution, since all of those paths refer to /usr/obj/usr/src/tmp (note the "tmp/" part), and there are no cddl/CTF binaries in there anywhere. All the "tmp" stuff is referred to as $WORLDTMP. To me it looks like whatever populates ${WORLDTMP}/usr/bin and ${WORLDTMP}/usr/sbin is not properly handling (copying) binaries from the /usr/obj/usr/src/cddl/usr.bin and /usr/obj/usr/src/cddl/usr.sbin directory trees into the proper ${WORLDTMP} locations. Confused yet? :-) I'm not even sure where to begin looking for this, nor am I even sure doing that is the proper solution. As an example/test, I've been trying to figure out how addr2line makes it (gets copied**) from one tree/place to another: root@testbox:/usr/src # find /usr/obj -type f -perm 0755 -name "addr2line" -ls 2409648 2112 -rwxr-xr-x 1 root wheel 1033062 Apr 17 15:58 /usr/obj/usr/src/tmp/usr/bin/addr2line 321764 2112 -rwxr-xr-x 1 root wheel 1033062 Apr 17 15:58 /usr/obj/usr/src/tmp/usr/src/gnu/usr.bin/binutils/addr2line/addr2line 2422033 1472 -rwxr-xr-x 1 root wheel 705589 Apr 17 16:08 /usr/obj/usr/src/gnu/usr.bin/binutils/addr2line/addr2line And none of these are what's in /usr/bin (understandably), root@testbox:/usr/src # md5 `find /usr/obj -type f -perm 0755 -name "addr2line" -print` MD5 (/usr/obj/usr/src/tmp/usr/bin/addr2line) = 28d665ae81813d5e2a520498f7f03509 MD5 (/usr/obj/usr/src/tmp/usr/src/gnu/usr.bin/binutils/addr2line/addr2line) = 28d665ae81813d5e2a520498f7f03509 MD5 (/usr/obj/usr/src/gnu/usr.bin/binutils/addr2line/addr2line) = 71b2fde11947153c512617b496a65780 root@testbox:/usr/src # file `find /usr/obj -type f -perm 0755 -name "addr2line" -print` /usr/obj/usr/src/tmp/usr/bin/addr2line: ELF 64-bit LSB executable, x86-64, version 1 (FreeBSD), statically linked, for FreeBSD 9.1 (901504), not stripped /usr/obj/usr/src/tmp/usr/src/gnu/usr.bin/binutils/addr2line/addr2line: ELF 64-bit LSB executable, x86-64, version 1 (FreeBSD), statically linked, for FreeBSD 9.1 (901504), not stripped /usr/obj/usr/src/gnu/usr.bin/binutils/addr2line/addr2line: ELF 64-bit LSB executable, x86-64, version 1 (FreeBSD), dynamically linked (uses shared libs), for FreeBSD 9.1 (901504), not stripped ** -- Footnote question: does anyone know why hardlinks aren't used for the identical files? Yes, I'm aware hardlinks can't cross filesystems, but for the first 2 addr2line files I listed above I don't see that being a problem. That could save a lot of disk space, to be honest. -- | Jeremy Chadwick jdc@koitsu.org | | UNIX Systems Administrator http://jdc.koitsu.org/ | | Mountain View, CA, US | | Making life hard for others since 1977. PGP 4BD6C0CB | From owner-svn-src-all@FreeBSD.ORG Thu Apr 18 00:12:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1328E783; Thu, 18 Apr 2013 00:12:33 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0517EF13; Thu, 18 Apr 2013 00:12:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3I0CWcL015381; Thu, 18 Apr 2013 00:12:32 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3I0CW20015380; Thu, 18 Apr 2013 00:12:32 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201304180012.r3I0CW20015380@svn.freebsd.org> From: Kirk McKusick Date: Thu, 18 Apr 2013 00:12:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249597 - stable/9/sys/ufs/ffs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Apr 2013 00:12:33 -0000 Author: mckusick Date: Thu Apr 18 00:12:32 2013 New Revision: 249597 URL: http://svnweb.freebsd.org/changeset/base/249597 Log: MFC of 249064: The code in clear_remove() and clear_inodedeps() skips one entry in the pagedep and inodedep hash tables. An entry in the table is skipped because 'pagedep_hash' and 'inodedep_hash' hold the size of the hash tables - 1. The chance that this would have any operational failure is extremely unlikely. These funtions only need to find a single entry and are only called when there are too many entries. The chance that they would fail because all the entries are on the single skipped hash chain are remote. Submitted by: Pedro Martelletto Reviewed by: kib Modified: stable/9/sys/ufs/ffs/ffs_softdep.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- stable/9/sys/ufs/ffs/ffs_softdep.c Wed Apr 17 22:42:43 2013 (r249596) +++ stable/9/sys/ufs/ffs/ffs_softdep.c Thu Apr 18 00:12:32 2013 (r249597) @@ -13026,9 +13026,9 @@ clear_remove(td) mtx_assert(&lk, MA_OWNED); - for (cnt = 0; cnt < pagedep_hash; cnt++) { + for (cnt = 0; cnt <= pagedep_hash; cnt++) { pagedephd = &pagedep_hashtbl[next++]; - if (next >= pagedep_hash) + if (next > pagedep_hash) next = 0; LIST_FOREACH(pagedep, pagedephd, pd_hash) { if (LIST_EMPTY(&pagedep->pd_dirremhd)) @@ -13090,9 +13090,9 @@ clear_inodedeps(td) * We will then gather up all the inodes in its block * that have dependencies and flush them out. */ - for (cnt = 0; cnt < inodedep_hash; cnt++) { + for (cnt = 0; cnt <= inodedep_hash; cnt++) { inodedephd = &inodedep_hashtbl[next++]; - if (next >= inodedep_hash) + if (next > inodedep_hash) next = 0; if ((inodedep = LIST_FIRST(inodedephd)) != NULL) break; From owner-svn-src-all@FreeBSD.ORG Thu Apr 18 00:14:51 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CEA1A905; Thu, 18 Apr 2013 00:14:51 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BFD9EF23; Thu, 18 Apr 2013 00:14:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3I0EpcF015861; Thu, 18 Apr 2013 00:14:51 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3I0EpPG015860; Thu, 18 Apr 2013 00:14:51 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201304180014.r3I0EpPG015860@svn.freebsd.org> From: Kirk McKusick Date: Thu, 18 Apr 2013 00:14:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r249598 - stable/8/sys/ufs/ffs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Apr 2013 00:14:51 -0000 Author: mckusick Date: Thu Apr 18 00:14:51 2013 New Revision: 249598 URL: http://svnweb.freebsd.org/changeset/base/249598 Log: MFC of 249064: The code in clear_remove() and clear_inodedeps() skips one entry in the pagedep and inodedep hash tables. An entry in the table is skipped because 'pagedep_hash' and 'inodedep_hash' hold the size of the hash tables - 1. The chance that this would have any operational failure is extremely unlikely. These funtions only need to find a single entry and are only called when there are too many entries. The chance that they would fail because all the entries are on the single skipped hash chain are remote. Submitted by: Pedro Martelletto Reviewed by: kib Modified: stable/8/sys/ufs/ffs/ffs_softdep.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/ufs/ (props changed) Modified: stable/8/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- stable/8/sys/ufs/ffs/ffs_softdep.c Thu Apr 18 00:12:32 2013 (r249597) +++ stable/8/sys/ufs/ffs/ffs_softdep.c Thu Apr 18 00:14:51 2013 (r249598) @@ -5965,9 +5965,9 @@ clear_remove(td) mtx_assert(&lk, MA_OWNED); - for (cnt = 0; cnt < pagedep_hash; cnt++) { + for (cnt = 0; cnt <= pagedep_hash; cnt++) { pagedephd = &pagedep_hashtbl[next++]; - if (next >= pagedep_hash) + if (next > pagedep_hash) next = 0; LIST_FOREACH(pagedep, pagedephd, pd_hash) { if (LIST_EMPTY(&pagedep->pd_dirremhd)) @@ -6029,9 +6029,9 @@ clear_inodedeps(td) * We will then gather up all the inodes in its block * that have dependencies and flush them out. */ - for (cnt = 0; cnt < inodedep_hash; cnt++) { + for (cnt = 0; cnt <= inodedep_hash; cnt++) { inodedephd = &inodedep_hashtbl[next++]; - if (next >= inodedep_hash) + if (next > inodedep_hash) next = 0; if ((inodedep = LIST_FIRST(inodedephd)) != NULL) break; From owner-svn-src-all@FreeBSD.ORG Thu Apr 18 00:53:48 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E90C5D0D; Thu, 18 Apr 2013 00:53:48 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CB33F7D; Thu, 18 Apr 2013 00:53:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3I0rm1a027701; Thu, 18 Apr 2013 00:53:48 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3I0rlOW027696; Thu, 18 Apr 2013 00:53:47 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201304180053.r3I0rlOW027696@svn.freebsd.org> From: Kirk McKusick Date: Thu, 18 Apr 2013 00:53:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249599 - in stable/9/sys: kern sys ufs/ufs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Apr 2013 00:53:49 -0000 Author: mckusick Date: Thu Apr 18 00:53:47 2013 New Revision: 249599 URL: http://svnweb.freebsd.org/changeset/base/249599 Log: MFC of 248561: When renaming a directory from one parent directory to another, we need to call ufs_checkpath() to walk from our new location to the root of the filesystem to ensure that we do not encounter ourselves along the way. Until now, we accomplished this by reading the ".." entries of each directory in our path until we reached the root (or encountered an error). This change tries to avoid the I/O of reading the ".." entries by first looking them up in the name cache and only doing the I/O when the name cache lookup fails. Reviewed by: kib Tested by: Peter Holm Modified: stable/9/sys/kern/vfs_cache.c stable/9/sys/sys/vnode.h stable/9/sys/ufs/ufs/ufs_lookup.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/sys/kern/vfs_cache.c ============================================================================== --- stable/9/sys/kern/vfs_cache.c Thu Apr 18 00:14:51 2013 (r249598) +++ stable/9/sys/kern/vfs_cache.c Thu Apr 18 00:53:47 2013 (r249599) @@ -1387,6 +1387,28 @@ vn_fullpath1(struct thread *td, struct v return (0); } +struct vnode * +vn_dir_dd_ino(struct vnode *vp) +{ + struct namecache *ncp; + struct vnode *ddvp; + + ASSERT_VOP_LOCKED(vp, "vn_dir_dd_ino"); + CACHE_RLOCK(); + TAILQ_FOREACH(ncp, &(vp->v_cache_dst), nc_dst) { + if ((ncp->nc_flag & NCF_ISDOTDOT) != 0) + continue; + ddvp = ncp->nc_dvp; + VI_LOCK(ddvp); + CACHE_RUNLOCK(); + if (vget(ddvp, LK_INTERLOCK | LK_SHARED | LK_NOWAIT, curthread)) + return (NULL); + return (ddvp); + } + CACHE_RUNLOCK(); + return (NULL); +} + int vn_commname(struct vnode *vp, char *buf, u_int buflen) { Modified: stable/9/sys/sys/vnode.h ============================================================================== --- stable/9/sys/sys/vnode.h Thu Apr 18 00:14:51 2013 (r249598) +++ stable/9/sys/sys/vnode.h Thu Apr 18 00:53:47 2013 (r249599) @@ -621,6 +621,8 @@ int vn_fullpath(struct thread *td, struc char **retbuf, char **freebuf); int vn_fullpath_global(struct thread *td, struct vnode *vn, char **retbuf, char **freebuf); +struct vnode * + vn_dir_dd_ino(struct vnode *vp); int vn_commname(struct vnode *vn, char *buf, u_int buflen); int vn_path_to_global_path(struct thread *td, struct vnode *vp, char *path, u_int pathlen); Modified: stable/9/sys/ufs/ufs/ufs_lookup.c ============================================================================== --- stable/9/sys/ufs/ufs/ufs_lookup.c Thu Apr 18 00:14:51 2013 (r249598) +++ stable/9/sys/ufs/ufs/ufs_lookup.c Thu Apr 18 00:53:47 2013 (r249599) @@ -1385,13 +1385,29 @@ ufs_dirempty(ip, parentino, cred) } static int -ufs_dir_dd_ino(struct vnode *vp, struct ucred *cred, ino_t *dd_ino) +ufs_dir_dd_ino(struct vnode *vp, struct ucred *cred, ino_t *dd_ino, + struct vnode **dd_vp) { struct dirtemplate dirbuf; + struct vnode *ddvp; int error, namlen; + ASSERT_VOP_LOCKED(vp, "ufs_dir_dd_ino"); if (vp->v_type != VDIR) return (ENOTDIR); + /* + * First check to see if we have it in the name cache. + */ + if ((ddvp = vn_dir_dd_ino(vp)) != NULL) { + KASSERT(ddvp->v_mount == vp->v_mount, + ("ufs_dir_dd_ino: Unexpected mount point crossing")); + *dd_ino = VTOI(ddvp)->i_number; + *dd_vp = ddvp; + return (0); + } + /* + * Have to read the directory. + */ error = vn_rdwr(UIO_READ, vp, (caddr_t)&dirbuf, sizeof (struct dirtemplate), (off_t)0, UIO_SYSSPACE, IO_NODELOCKED | IO_NOMACCHECK, cred, NOCRED, NULL, NULL); @@ -1409,6 +1425,7 @@ ufs_dir_dd_ino(struct vnode *vp, struct dirbuf.dotdot_name[1] != '.') return (ENOTDIR); *dd_ino = dirbuf.dotdot_ino; + *dd_vp = NULL; return (0); } @@ -1433,7 +1450,7 @@ ufs_checkpath(ino_t source_ino, ino_t pa if (target->i_number == ROOTINO) return (0); for (;;) { - error = ufs_dir_dd_ino(vp, cred, &dd_ino); + error = ufs_dir_dd_ino(vp, cred, &dd_ino, &vp1); if (error != 0) break; if (dd_ino == source_ino) { @@ -1444,22 +1461,16 @@ ufs_checkpath(ino_t source_ino, ino_t pa break; if (dd_ino == parent_ino) break; - error = VFS_VGET(mp, dd_ino, LK_SHARED | LK_NOWAIT, &vp1); - if (error != 0) { - *wait_ino = dd_ino; - break; - } - /* Recheck that ".." still points to vp1 after relock of vp */ - error = ufs_dir_dd_ino(vp, cred, &dd_ino); - if (error != 0) { - vput(vp1); - break; - } - /* Redo the check of ".." if directory was reparented */ - if (dd_ino != VTOI(vp1)->i_number) { - vput(vp1); - continue; + if (vp1 == NULL) { + error = VFS_VGET(mp, dd_ino, LK_SHARED | LK_NOWAIT, + &vp1); + if (error != 0) { + *wait_ino = dd_ino; + break; + } } + KASSERT(dd_ino == VTOI(vp1)->i_number, + ("directory %d reparented\n", VTOI(vp1)->i_number)); if (vp != tvp) vput(vp); vp = vp1; @@ -1467,6 +1478,8 @@ ufs_checkpath(ino_t source_ino, ino_t pa if (error == ENOTDIR) panic("checkpath: .. not a directory\n"); + if (vp1 != NULL) + vput(vp1); if (vp != tvp) vput(vp); return (error); From owner-svn-src-all@FreeBSD.ORG Thu Apr 18 01:20:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1E7DD22C; Thu, 18 Apr 2013 01:20:09 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F3D7814F; Thu, 18 Apr 2013 01:20:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3I1K8Qf035476; Thu, 18 Apr 2013 01:20:08 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3I1K8fF035473; Thu, 18 Apr 2013 01:20:08 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201304180120.r3I1K8fF035473@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Thu, 18 Apr 2013 01:20:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249600 - head/cddl/lib/libdtrace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Apr 2013 01:20:09 -0000 Author: pfg Date: Thu Apr 18 01:20:08 2013 New Revision: 249600 URL: http://svnweb.freebsd.org/changeset/base/249600 Log: DTrace: NFS translators should be split into client/server pieces Belatedly update the provider with changes from OpenSolaris: PSARC 2008/050 DTrace NFS v3 Provider 6696397 NFS v3 provider reports all UDP clients as 0.0.0.0 6711844 assert: vp->v_shrlocks Obtained from: Illumos Modified: head/cddl/lib/libdtrace/nfs.d head/cddl/lib/libdtrace/nfssrv.d Modified: head/cddl/lib/libdtrace/nfs.d ============================================================================== --- head/cddl/lib/libdtrace/nfs.d Thu Apr 18 00:53:47 2013 (r249599) +++ head/cddl/lib/libdtrace/nfs.d Thu Apr 18 01:20:08 2013 (r249600) @@ -28,8 +28,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #pragma D depends_on library ip.d #pragma D depends_on library net.d #pragma D depends_on module nfs @@ -47,32 +45,62 @@ typedef struct nfsv4cbinfo { #pragma D binding "1.5" translator translator conninfo_t < struct svc_req *P > { ci_protocol = P->rq_xprt->xp_master->xp_netid == "tcp" ? "ipv4" : + P->rq_xprt->xp_master->xp_netid == "udp" ? "ipv4" : P->rq_xprt->xp_master->xp_netid == "tcp6" ? "ipv6" : + P->rq_xprt->xp_master->xp_netid == "udp6" ? "ipv6" : ""; - ci_local = inet_ntoa6(&((conn_t *)P->rq_xprt->xp_xpc. - xpc_wq->q_next->q_ptr)->connua_v6addr.connua_laddr); - - ci_remote = inet_ntoa6(&((conn_t *)P->rq_xprt->xp_xpc. - xpc_wq->q_next->q_ptr)->connua_v6addr.connua_faddr); + ci_local = (P->rq_xprt->xp_master->xp_netid == "tcp" || + P->rq_xprt->xp_master->xp_netid == "udp") ? + inet_ntoa(&((struct sockaddr_in *) + P->rq_xprt->xp_xpc.xpc_lcladdr.buf)->sin_addr.S_un.S_addr) : + (P->rq_xprt->xp_master->xp_netid == "tcp6" || + P->rq_xprt->xp_master->xp_netid == "udp6") ? + inet_ntoa6(&((struct sockaddr_in6 *) + P->rq_xprt->xp_xpc.xpc_lcladdr.buf)->sin6_addr) : + "unknown"; + + ci_remote = (P->rq_xprt->xp_master->xp_netid == "tcp" || + P->rq_xprt->xp_master->xp_netid == "udp") ? + inet_ntoa(&((struct sockaddr_in *) + P->rq_xprt->xp_xpc.xpc_rtaddr.buf)->sin_addr.S_un.S_addr) : + (P->rq_xprt->xp_master->xp_netid == "tcp6" || + P->rq_xprt->xp_master->xp_netid == "udp6") ? + inet_ntoa6(&((struct sockaddr_in6 *) + P->rq_xprt->xp_xpc.xpc_rtaddr.buf)->sin6_addr) : + "unknown"; }; #pragma D binding "1.5" translator -translator conninfo_t < struct compound_state *P > { - ci_protocol = P->req->rq_xprt->xp_master->xp_netid == "tcp" ? "ipv4" : - P->req->rq_xprt->xp_master->xp_netid == "tcp6" ? "ipv6" : - ""; +translator conninfo_t < rfs4_client_t *P > { + ci_protocol = (P->rc_addr.ss_family == AF_INET) ? "ipv4" : "ipv6"; - ci_local = inet_ntoa6(&((conn_t *)P->req->rq_xprt->xp_xpc. - xpc_wq->q_next->q_ptr)->connua_v6addr.connua_laddr); + ci_local = ""; - ci_remote = inet_ntoa6(&((conn_t *)P->req->rq_xprt->xp_xpc. - xpc_wq->q_next->q_ptr)->connua_v6addr.connua_faddr); + ci_remote = (P->rc_addr.ss_family == AF_INET) ? + inet_ntoa((ipaddr_t *) + &((struct sockaddr_in *)&P->rc_addr)->sin_addr) : + inet_ntoa6(&((struct sockaddr_in6 *)&P->rc_addr)->sin6_addr); +}; + +#pragma D binding "1.5" translator +translator nfsv4cbinfo_t < rfs4_deleg_state_t *P > { + nci_curpath = (P->rds_finfo->rf_vp == NULL) ? "" : + P->rds_finfo->rf_vp->v_path; }; +typedef struct nfsv3opinfo { + uint64_t noi_xid; /* unique transation ID */ + cred_t *noi_cred; /* credentials for operation */ + string noi_curpath; /* current file handle path (if any) */ +} nfsv3opinfo_t; + +typedef struct nfsv3oparg nfsv3oparg_t; + #pragma D binding "1.5" translator -translator nfsv4opinfo_t < struct compound_state *P > { - noi_xid = P->req->rq_xprt->xp_xid; - noi_cred = P->basecr; - noi_curpath = (P->vp == NULL) ? "" : P->vp->v_path; +translator nfsv3opinfo_t < nfsv3oparg_t *P > { + noi_xid = ((struct svc_req *)arg0)->rq_xprt->xp_xid; + noi_cred = (cred_t *)arg1; + noi_curpath = (arg2 == 0 || ((vnode_t *)arg2)->v_path == NULL) ? + "" : ((vnode_t *)arg2)->v_path; }; Modified: head/cddl/lib/libdtrace/nfssrv.d ============================================================================== --- head/cddl/lib/libdtrace/nfssrv.d Thu Apr 18 00:53:47 2013 (r249599) +++ head/cddl/lib/libdtrace/nfssrv.d Thu Apr 18 01:20:08 2013 (r249600) @@ -24,31 +24,31 @@ */ /* - * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #pragma D depends_on library ip.d #pragma D depends_on library net.d #pragma D depends_on module nfs.d #pragma D depends_on module nfssrv #pragma D binding "1.5" translator -translator conninfo_t < rfs4_client_t *P > { - ci_protocol = (P->cl_addr.ss_family == AF_INET) ? "ipv4" : "ipv6"; +translator conninfo_t < struct compound_state *P > { + ci_protocol = P->req->rq_xprt->xp_master->xp_netid == "tcp" ? "ipv4" : + P->req->rq_xprt->xp_master->xp_netid == "tcp6" ? "ipv6" : + ""; - ci_local = ""; + ci_local = inet_ntoa6(&((conn_t *)P->req->rq_xprt->xp_xpc. + xpc_wq->q_next->q_ptr)->connua_v6addr.connua_laddr); - ci_remote = (P->cl_addr.ss_family == AF_INET) ? - inet_ntoa((ipaddr_t *) - &((struct sockaddr_in *)&P->cl_addr)->sin_addr) : - inet_ntoa6(&((struct sockaddr_in6 *)&P->cl_addr)->sin6_addr); + ci_remote = inet_ntoa6(&((conn_t *)P->req->rq_xprt->xp_xpc. + xpc_wq->q_next->q_ptr)->connua_v6addr.connua_faddr); }; #pragma D binding "1.5" translator -translator nfsv4cbinfo_t < rfs4_deleg_state_t *P > { - nci_curpath = (P->finfo->vp == NULL) ? "" : - P->finfo->vp->v_path; +translator nfsv4opinfo_t < struct compound_state *P > { + noi_xid = P->req->rq_xprt->xp_xid; + noi_cred = P->basecr; + noi_curpath = (P->vp == NULL) ? "" : P->vp->v_path; }; From owner-svn-src-all@FreeBSD.ORG Thu Apr 18 01:21:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9BD7B3AC; Thu, 18 Apr 2013 01:21:44 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8F0AB15E; Thu, 18 Apr 2013 01:21:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3I1LiWf037291; Thu, 18 Apr 2013 01:21:44 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3I1LiJw037289; Thu, 18 Apr 2013 01:21:44 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201304180121.r3I1LiJw037289@svn.freebsd.org> From: Rui Paulo Date: Thu, 18 Apr 2013 01:21:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249601 - head/sys/amd64/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Apr 2013 01:21:44 -0000 Author: rpaulo Date: Thu Apr 18 01:21:44 2013 New Revision: 249601 URL: http://svnweb.freebsd.org/changeset/base/249601 Log: Print RDSEED, ADX, and SMAP. Pointed out by: kib Modified: head/sys/amd64/amd64/identcpu.c Modified: head/sys/amd64/amd64/identcpu.c ============================================================================== --- head/sys/amd64/amd64/identcpu.c Thu Apr 18 01:20:08 2013 (r249600) +++ head/sys/amd64/amd64/identcpu.c Thu Apr 18 01:21:44 2013 (r249601) @@ -406,6 +406,12 @@ printcpuinfo(void) "\013INVPCID" /* Restricted Transactional Memory */ "\014RTM" + /* Enhanced NRBG */ + "\022RDSEED" + /* ADCX + ADOX */ + "\023ADX" + /* Supervisor Mode Access Prevention */ + "\024SMAP" ); } From owner-svn-src-all@FreeBSD.ORG Thu Apr 18 01:30:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1CF74786; Thu, 18 Apr 2013 01:30:09 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 102471A1; Thu, 18 Apr 2013 01:30:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3I1U8Ls038835; Thu, 18 Apr 2013 01:30:08 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3I1U89k038834; Thu, 18 Apr 2013 01:30:08 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201304180130.r3I1U89k038834@svn.freebsd.org> From: Rui Paulo Date: Thu, 18 Apr 2013 01:30:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249602 - head/sys/x86/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Apr 2013 01:30:09 -0000 Author: rpaulo Date: Thu Apr 18 01:30:08 2013 New Revision: 249602 URL: http://svnweb.freebsd.org/changeset/base/249602 Log: Add the most current CPUID7_* definitions. Modified: head/sys/x86/include/specialreg.h Modified: head/sys/x86/include/specialreg.h ============================================================================== --- head/sys/x86/include/specialreg.h Thu Apr 18 01:21:44 2013 (r249601) +++ head/sys/x86/include/specialreg.h Thu Apr 18 01:30:08 2013 (r249602) @@ -172,6 +172,23 @@ #define CPUTPM2_EFFREQ 0x00000001 /* + * Structured Extended Features + */ +#define CPUID7_GSFSBASE 0x00000001 +#define CPUID7_TSCADJ 0x00000002 +#define CPUID7_BMI1 0x00000008 +#define CPUID7_HLE 0x00000010 +#define CPUID7_AVX2 0x00000020 +#define CPUID7_SMEP 0x00000080 +#define CPUID7_BMI2 0x00000100 +#define CPUID7_ENHMOVSB 0x00000200 +#define CPUID7_INVPCID 0x00000400 +#define CPUID7_RTM 0x00000800 +#define CPUID7_RDSEED 0x00040000 +#define CPUID7_ADX 0x00080000 +#define CPUID7_SMAP 0x00100000 + +/* * Important bits in the AMD extended cpuid flags */ #define AMDID_SYSCALL 0x00000800 From owner-svn-src-all@FreeBSD.ORG Thu Apr 18 02:20:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8B5B0C31; Thu, 18 Apr 2013 02:20:59 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7DFEB2B4; Thu, 18 Apr 2013 02:20:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3I2Kx31054681; Thu, 18 Apr 2013 02:20:59 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3I2KwoE054659; Thu, 18 Apr 2013 02:20:58 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201304180220.r3I2KwoE054659@svn.freebsd.org> From: Andrew Turner Date: Thu, 18 Apr 2013 02:20:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249603 - in head/contrib: binutils/include/elf gdb/gdb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Apr 2013 02:20:59 -0000 Author: andrew Date: Thu Apr 18 02:20:58 2013 New Revision: 249603 URL: http://svnweb.freebsd.org/changeset/base/249603 Log: Fix the value of NT_FREEBSD_TAG to be the same as ABI_NOTRTYPE in lib/csu. Add NT_FREEBSD_NOINIT_TAG for the value of CRT_NOINIT_NOTETYPE. Check for both of these when detecting a FreeBSD binary in gdb. Modified: head/contrib/binutils/include/elf/common.h head/contrib/gdb/gdb/osabi.c Modified: head/contrib/binutils/include/elf/common.h ============================================================================== --- head/contrib/binutils/include/elf/common.h Thu Apr 18 01:30:08 2013 (r249602) +++ head/contrib/binutils/include/elf/common.h Thu Apr 18 02:20:58 2013 (r249603) @@ -437,7 +437,8 @@ /* Values for FreeBSD .note.tag notes. Note name is "FreeBSD". */ -#define NT_FREEBSD_TAG 2 +#define NT_FREEBSD_TAG 1 +#define NT_FREEBSD_NOINIT_TAG 2 /* These three macros disassemble and assemble a symbol table st_info field, which contains the symbol binding and symbol type. The STB_ and STT_ Modified: head/contrib/gdb/gdb/osabi.c ============================================================================== --- head/contrib/gdb/gdb/osabi.c Thu Apr 18 01:30:08 2013 (r249602) +++ head/contrib/gdb/gdb/osabi.c Thu Apr 18 02:20:58 2013 (r249603) @@ -474,6 +474,12 @@ generic_elf_osabi_sniff_abi_tag_sections *osabi = GDB_OSABI_FREEBSD_ELF; return; } + if (check_note (abfd, sect, note, "FreeBSD", 4, NT_FREEBSD_NOINIT_TAG)) + { + /* There is no need to check the version yet. */ + *osabi = GDB_OSABI_FREEBSD_ELF; + return; + } return; } From owner-svn-src-all@FreeBSD.ORG Thu Apr 18 02:21:06 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 98D99D4E; Thu, 18 Apr 2013 02:21:06 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (lor.one-eyed-alien.net [69.66.77.232]) by mx1.freebsd.org (Postfix) with ESMTP id D20482B5; Thu, 18 Apr 2013 02:21:03 +0000 (UTC) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.5/8.14.5) with ESMTP id r3I2L3DV032377; Wed, 17 Apr 2013 21:21:03 -0500 (CDT) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.5/8.14.5/Submit) id r3I2L2R9032376; Wed, 17 Apr 2013 21:21:02 -0500 (CDT) (envelope-from brooks) Date: Wed, 17 Apr 2013 21:21:02 -0500 From: Brooks Davis To: Jeremy Chadwick Subject: Re: svn commit: r249549 - in stable/9/sys: amd64/conf i386/conf Message-ID: <20130418022102.GB31612@lor.one-eyed-alien.net> References: <201304161609.r3GG9SID009937@svn.freebsd.org> <20130416161919.GA80626@icarus.home.lan> <20130417125433.GC30222@caravan.chchile.org> <20130417193538.GB9331@icarus.home.lan> <20130417194706.GA30583@lor.one-eyed-alien.net> <20130417225603.GA13720@icarus.home.lan> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="u3/rZRmxL6MmkK24" Content-Disposition: inline In-Reply-To: <20130417225603.GA13720@icarus.home.lan> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-9@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Apr 2013 02:21:06 -0000 --u3/rZRmxL6MmkK24 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Apr 17, 2013 at 03:56:03PM -0700, Jeremy Chadwick wrote: > On Wed, Apr 17, 2013 at 02:47:06PM -0500, Brooks Davis wrote: > > On Wed, Apr 17, 2013 at 12:35:38PM -0700, Jeremy Chadwick wrote: > > > On Wed, Apr 17, 2013 at 02:54:33PM +0200, Jeremie Le Hen wrote: > > > > Hi Jeremy, > > > >=20 > > > > On Tue, Apr 16, 2013 at 09:19:19AM -0700, Jeremy Chadwick wrote: > > > > >=20 > > > > > Now that this has been enabled by default, I should warn folks of= a > > > > > caveat that I found in the buildworld/buildkernel framework. It's > > > > > easiest to explain like this: > > > > >=20 > > > > > 1. Install FreeBSD 9.x, svn checkout of stable/9, etc... > > > > > 2. Add WITHOUT_CDDL=3Dtrue to /etc/src.conf > > > > > 3. Rebuild + install kernel/world per src/Makefile procedure > > > > > 4. Remove WITHOUT_CDDL=3Dtrue from /etc/src.conf > > > > > 5. rm -fr /usr/obj/* > > > > > 6. Rebuild world > > > > > 7. Rebuild kernel -- fails, stating "ctfconvert: not found". > > > > >=20 > > > > > For whatever reason the buildkernel bits make the assumption that > > > > > ctfconvert exists on the system (presumably in $PATH or possibly a > > > > > hard-coded), when ideally it should try to use the recently-built > > > > > version in /usr/obj first. > > > >=20 > > > > I've tested this is a freshly installed 9.1-RELEASE jail and I have= n't > > > > been biten by the bug you describe. > > > >=20 > > > > ctfconvert(1) seems to be installed by default in 9.1-RELEASE, this= is > > > > probably there problem didn't occur. I can easily verify this in t= he > > > > jail: > > > >=20 > > > > % root@test9:/usr/src # ls -l /usr/bin/ctfconvert /usr/bin/vi /usr/= bin/tail=20 > > > > % -r-xr-xr-x 1 root wheel 371536 Dec 4 09:33 /usr/bin/ctfconvert > > > > % -r-xr-xr-x 1 root wheel 19848 Apr 17 06:28 /usr/bin/tail > > > > % -r-xr-xr-x 6 root wheel 346432 Apr 17 06:28 /usr/bin/vi > > > >=20 > > > >=20 > > > > Do you have a theory about why you've got the problem while I haven= 't? > > > > FYI, it seems 9.0-RELEASE also has ctfconvert(1): > > > > http://svnweb.freebsd.org/base/release/9.0.0/cddl/usr.bin/ctfconver= t/ > > > >=20 > > > > My guess is tha this might happen if you don't have /usr/bin/ctfcon= vert. > > > > I've just removed it and trying to build kernel again. > > >=20 > > > I will spend some time to figure out exactly how to reproduce this. > > >=20 > > > Going from recent memory (~2 weeks ago), I encountered it on my VPS b= ox > > > (which does run ntpd, just FYI): > > >=20 > > > 1. Initially installed with 9.1-RELEASE, > > > 2. Upgraded to stable/9 (using svn), > > > 3. WITHOUT_CDDL=3Dtrue and WITHOUT_ZFS=3Dtrue added to /etc/src.conf > > > 4. world/kernel rebuilt/reinstalled/etc. (this includes make delete-o= ld, > > > as per instructions in src/Makefile -- which would delete > > > /usr/bin/ctfconvert) > > > 5. Fast forward many months > > > 6. Removed WITHOUT_CDDL=3Dtrue from src.conf > > > 7. Encountered the above issue ("ctfconvert: not found") during > > > buildkernel > > > 8. Rebuilt kernel again -- same error > > > 9. Removed WITHOUT_ZFS=3Dtrue from src.conf > > > 10. Rebuilt kernel again -- worked > > >=20 > > > This could mean WITHOUT_ZFS=3Dtrue has some bearing on this situation= , but > > > I don't see how/why, as WITHOUT_CDDL is supposed to be the "trigger" = for > > > ctf* utilities. I did poke around the Makefiles and framework a bit > > > but didn't have any epiphanies. > > >=20 > > > Like I said -- I'll try to reproduce the exact scenario. > >=20 > > Looking at Makefile.inc1 around line 1164 (on HEAD), ctfconvert and > > cftmerge are bootstrap tools only when they don't exist at all on the > > host. The code there should be expanded to bootstrap for cases where > > the installed ones are known to be broken (virtually all prior versions > > given recent fixes) as well as when they aren't present on the host > > system. >=20 > I'm able to reproduce the issue I speak of with 100% reliability. > Jeremie, I'm not sure why you're not able to reproduce this, because I > can do so reliably/consistently. The following patch will probably fix the problem. Index: Makefile.inc1 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- Makefile.inc1 (revision 249590) +++ Makefile.inc1 (working copy) @@ -1114,9 +1114,7 @@ usr.bin/clang/clang-tblgen .endif =20 -.if ${MK_CDDL} !=3D "no" && \ - ${BOOTSTRAPPING} < 800038 && \ - !(${BOOTSTRAPPING} >=3D 700112 && ${BOOTSTRAPPING} < 799999) +.if ${MK_CDDL} !=3D "no" _dtrace_tools=3D cddl/usr.bin/sgsmsg cddl/lib/libctf lib/libelf \ lib/libdwarf cddl/usr.bin/ctfconvert cddl/usr.bin/ctfmerge .endif This patch unconditionally bootstraps ctfconvert and ctfmerge unless WITHOUT_CDDL is set. >=20 > 10. Verification of everything at this point -- ctf* utilities are > clearly in /usr/obj, but are not in /usr/bin (because of delete-old): >=20 > root@testbox:/usr/src # find /usr/obj -name "ctf*" -type f -perm 0755 -ls > 1783448 728 -rwxr-xr-x 1 root wheel 3717= 38 Apr 17 15:29 /usr/obj/usr/src/cddl/usr.bin/ctfconvert/ctfconvert > 1783453 64 -rwxr-xr-x 1 root wheel 287= 06 Apr 17 15:29 /usr/obj/usr/src/cddl/usr.bin/ctfdump/ctfdump > 1783472 168 -rwxr-xr-x 1 root wheel 827= 11 Apr 17 15:29 /usr/obj/usr/src/cddl/usr.bin/ctfmerge/ctfmerge > root@testbox:/usr/src # find /usr/bin -name "ctf*" -type f -perm 0755 -ls > root@testbox:/usr/src # The presence of these files is irrelevent. The files we use for bootstrapping or cross compiling live under /usr/obj/usr/src/tmp or equivalent. -- Brooks --u3/rZRmxL6MmkK24 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iD8DBQFRb1iOXY6L6fI4GtQRArR3AJ0fUQmpj7QiJbTGiOfpEkYd9iokEwCfU+N/ Rjf2AMp0L1UdwBmUNFsfqyc= =Veam -----END PGP SIGNATURE----- --u3/rZRmxL6MmkK24-- From owner-svn-src-all@FreeBSD.ORG Thu Apr 18 05:12:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4D37E7A3; Thu, 18 Apr 2013 05:12:12 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 404D3AF3; Thu, 18 Apr 2013 05:12:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3I5CBdg009228; Thu, 18 Apr 2013 05:12:11 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3I5CBBn009227; Thu, 18 Apr 2013 05:12:11 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201304180512.r3I5CBBn009227@svn.freebsd.org> From: David Xu Date: Thu, 18 Apr 2013 05:12:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249604 - head/lib/libthr/thread X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Apr 2013 05:12:12 -0000 Author: davidxu Date: Thu Apr 18 05:12:11 2013 New Revision: 249604 URL: http://svnweb.freebsd.org/changeset/base/249604 Log: Revert revision 249323, the PR/177624 is confusing, that bug is caused by using buggy getcontext/setcontext on same stack, while swapcontext normally works on different stack, there is no such a problem. Modified: head/lib/libthr/thread/thr_sig.c Modified: head/lib/libthr/thread/thr_sig.c ============================================================================== --- head/lib/libthr/thread/thr_sig.c Thu Apr 18 02:20:58 2013 (r249603) +++ head/lib/libthr/thread/thr_sig.c Thu Apr 18 05:12:11 2013 (r249604) @@ -737,4 +737,13 @@ _setcontext(const ucontext_t *ucp) return __sys_setcontext(&uc); } -__weak_reference(__sys_swapcontext, swapcontext); +__weak_reference(_swapcontext, swapcontext); +int +_swapcontext(ucontext_t *oucp, const ucontext_t *ucp) +{ + ucontext_t uc; + + (void) memcpy(&uc, ucp, sizeof(uc)); + remove_thr_signals(&uc.uc_sigmask); + return __sys_swapcontext(oucp, &uc); +} From owner-svn-src-all@FreeBSD.ORG Thu Apr 18 05:34:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BFE71A9A; Thu, 18 Apr 2013 05:34:33 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B3530BD5; Thu, 18 Apr 2013 05:34:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3I5YXO0015578; Thu, 18 Apr 2013 05:34:33 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3I5YXK4015577; Thu, 18 Apr 2013 05:34:33 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201304180534.r3I5YXK4015577@svn.freebsd.org> From: Alan Cox Date: Thu, 18 Apr 2013 05:34:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249605 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Apr 2013 05:34:33 -0000 Author: alc Date: Thu Apr 18 05:34:33 2013 New Revision: 249605 URL: http://svnweb.freebsd.org/changeset/base/249605 Log: When calculating the number of reserved nodes, discount the pages that will be used to store the nodes. Sponsored by: EMC / Isilon Storage Division Modified: head/sys/vm/vm_radix.c Modified: head/sys/vm/vm_radix.c ============================================================================== --- head/sys/vm/vm_radix.c Thu Apr 18 05:12:11 2013 (r249604) +++ head/sys/vm/vm_radix.c Thu Apr 18 05:34:33 2013 (r249605) @@ -360,10 +360,17 @@ vm_radix_node_zone_init(void *mem, int s static void vm_radix_prealloc(void *arg __unused) { + int nodes; - if (!uma_zone_reserve_kva(vm_radix_node_zone, cnt.v_page_count)) + /* + * Calculate the number of reserved nodes, discounting the pages that + * are needed to store them. + */ + nodes = ((vm_paddr_t)cnt.v_page_count * PAGE_SIZE) / (PAGE_SIZE + + sizeof(struct vm_radix_node)); + if (!uma_zone_reserve_kva(vm_radix_node_zone, nodes)) panic("%s: unable to create new zone", __func__); - uma_prealloc(vm_radix_node_zone, cnt.v_page_count); + uma_prealloc(vm_radix_node_zone, nodes); } SYSINIT(vm_radix_prealloc, SI_SUB_KMEM, SI_ORDER_SECOND, vm_radix_prealloc, NULL); From owner-svn-src-all@FreeBSD.ORG Thu Apr 18 05:46:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 47815D96; Thu, 18 Apr 2013 05:46:17 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id DF959C2F; Thu, 18 Apr 2013 05:46:16 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.6/8.14.6) with ESMTP id r3I5kDgq058968; Thu, 18 Apr 2013 08:46:13 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.2 kib.kiev.ua r3I5kDgq058968 Received: (from kostik@localhost) by tom.home (8.14.6/8.14.6/Submit) id r3I5kDgh058967; Thu, 18 Apr 2013 08:46:13 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 18 Apr 2013 08:46:13 +0300 From: Konstantin Belousov To: Rui Paulo Subject: Re: svn commit: r249602 - head/sys/x86/include Message-ID: <20130418054613.GG85148@kib.kiev.ua> References: <201304180130.r3I1U89k038834@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="MiFvc8Vo6wRSORdP" Content-Disposition: inline In-Reply-To: <201304180130.r3I1U89k038834@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Apr 2013 05:46:17 -0000 --MiFvc8Vo6wRSORdP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Apr 18, 2013 at 01:30:08AM +0000, Rui Paulo wrote: > Author: rpaulo > Date: Thu Apr 18 01:30:08 2013 > New Revision: 249602 > URL: http://svnweb.freebsd.org/changeset/base/249602 >=20 > Log: > Add the most current CPUID7_* definitions. >=20 > Modified: > head/sys/x86/include/specialreg.h >=20 > Modified: head/sys/x86/include/specialreg.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/x86/include/specialreg.h Thu Apr 18 01:21:44 2013 (r249601) > +++ head/sys/x86/include/specialreg.h Thu Apr 18 01:30:08 2013 (r249602) > @@ -172,6 +172,23 @@ > #define CPUTPM2_EFFREQ 0x00000001 > =20 > /* > + * Structured Extended Features > + */ > +#define CPUID7_GSFSBASE 0x00000001 > +#define CPUID7_TSCADJ 0x00000002 > +#define CPUID7_BMI1 0x00000008 > +#define CPUID7_HLE 0x00000010 > +#define CPUID7_AVX2 0x00000020 > +#define CPUID7_SMEP 0x00000080 > +#define CPUID7_BMI2 0x00000100 > +#define CPUID7_ENHMOVSB 0x00000200 > +#define CPUID7_INVPCID 0x00000400 > +#define CPUID7_RTM 0x00000800 > +#define CPUID7_RDSEED 0x00040000 > +#define CPUID7_ADX 0x00080000 > +#define CPUID7_SMAP 0x00100000 > + > +/* The set of the bits already exists as CPUID_STDEXT_* in the same file, and they are already utilized by the kernel. Please move new definitions to CPUID_STDEXT namespace and block, and remove CPUID7*. --MiFvc8Vo6wRSORdP Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQIcBAEBAgAGBQJRb4ikAAoJEJDCuSvBvK1BZ4wP/Rokq1EjJz2iZt4FEIu5G+B2 ScFQS4gy+qcsDCp8I1GdzaHyO4Kq049K8QIsafvcgUSAD80QyXKgl4M5WzzXp1eM 53Wye+PpvBAF7yYF7hPJn03hcYGS+sILqqUmlKwWZgSD3f7c2LYSe9Oaw+p/J54v 9Q3iJBhv5htYFUA7T/o9/D4xTrH1BsoGjzXs0rTH/ofzp0OXChZqR3IKSgsz4OZj Ps3wbhFWszk6bTH89y9Ns4S0aQsLYZPcPUbVYkufmUGbfUVpvLfnTwCTaOWOX1Dv Le2kFjD8jW7llxNepB12b5iQAbTa8soCvYgLkjKJl/XHfnQCd7AiUUVgcX6OsgBJ 4+BtiUQDla4W1H81UMMf6BugNpNYpSF5Xy1IPg4MvGaQFuQsD6UakxA3Se7LVSfG AsSREapPmJnwAyxQFBEB14XU9vhu2RYQRHTJteOeiq4iCWDOYD1YRnzNy8XxeU6s sCPOAts80XFG5YxEqHNS02PeaANa8amWMv2bGYaDSEf6uY+PIusyvp/HAB17C7SP CYqqAFsUpDBJr1or+T/Gm7F7ClTkfgPcg0wyr+DhMaODuChgtQt/1/cuio/yDtEV NE0ksScwHFbL8KCU2j4oQtL2W9VYJhvEZ9kI0bae9WFxQoliL8prcUd3L1eXVT/W h2Ip+kS9BQAJgWnbhrRc =2vyo -----END PGP SIGNATURE----- --MiFvc8Vo6wRSORdP-- From owner-svn-src-all@FreeBSD.ORG Thu Apr 18 05:56:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 44CA19B; Thu, 18 Apr 2013 05:56:01 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 37F56CDF; Thu, 18 Apr 2013 05:56:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3I5u1IJ021810; Thu, 18 Apr 2013 05:56:01 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3I5u1Yd021809; Thu, 18 Apr 2013 05:56:01 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201304180556.r3I5u1Yd021809@svn.freebsd.org> From: David Xu Date: Thu, 18 Apr 2013 05:56:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249606 - head/lib/libthr/thread X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Apr 2013 05:56:01 -0000 Author: davidxu Date: Thu Apr 18 05:56:00 2013 New Revision: 249606 URL: http://svnweb.freebsd.org/changeset/base/249606 Log: Avoid copying memory if SIGCANCEL is not masked. Modified: head/lib/libthr/thread/thr_sig.c Modified: head/lib/libthr/thread/thr_sig.c ============================================================================== --- head/lib/libthr/thread/thr_sig.c Thu Apr 18 05:34:33 2013 (r249605) +++ head/lib/libthr/thread/thr_sig.c Thu Apr 18 05:56:00 2013 (r249606) @@ -732,8 +732,12 @@ _setcontext(const ucontext_t *ucp) { ucontext_t uc; + if (ucp == NULL) + return (EINVAL); + if (!SIGISMEMBER(uc.uc_sigmask, SIGCANCEL)) + return __sys_setcontext(ucp); (void) memcpy(&uc, ucp, sizeof(uc)); - remove_thr_signals(&uc.uc_sigmask); + SIGDELSET(uc.uc_sigmask, SIGCANCEL); return __sys_setcontext(&uc); } @@ -743,7 +747,13 @@ _swapcontext(ucontext_t *oucp, const uco { ucontext_t uc; - (void) memcpy(&uc, ucp, sizeof(uc)); - remove_thr_signals(&uc.uc_sigmask); - return __sys_swapcontext(oucp, &uc); + if (oucp == NULL || ucp == NULL) + return (EINVAL); + if (SIGISMEMBER(ucp->uc_sigmask, SIGCANCEL)) { + stdout_debug("remove SIGCANCEL\n"); + (void) memcpy(&uc, ucp, sizeof(uc)); + SIGDELSET(uc.uc_sigmask, SIGCANCEL); + ucp = &uc; + } + return __sys_swapcontext(oucp, ucp); } From owner-svn-src-all@FreeBSD.ORG Thu Apr 18 05:58:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B3FDC239; Thu, 18 Apr 2013 05:58:07 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A6D7CCEC; Thu, 18 Apr 2013 05:58:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3I5w7le022122; Thu, 18 Apr 2013 05:58:07 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3I5w7W8022121; Thu, 18 Apr 2013 05:58:07 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201304180558.r3I5w7W8022121@svn.freebsd.org> From: David Xu Date: Thu, 18 Apr 2013 05:58:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249607 - head/lib/libthr/thread X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Apr 2013 05:58:07 -0000 Author: davidxu Date: Thu Apr 18 05:58:07 2013 New Revision: 249607 URL: http://svnweb.freebsd.org/changeset/base/249607 Log: Remove debug code. Modified: head/lib/libthr/thread/thr_sig.c Modified: head/lib/libthr/thread/thr_sig.c ============================================================================== --- head/lib/libthr/thread/thr_sig.c Thu Apr 18 05:56:00 2013 (r249606) +++ head/lib/libthr/thread/thr_sig.c Thu Apr 18 05:58:07 2013 (r249607) @@ -750,7 +750,6 @@ _swapcontext(ucontext_t *oucp, const uco if (oucp == NULL || ucp == NULL) return (EINVAL); if (SIGISMEMBER(ucp->uc_sigmask, SIGCANCEL)) { - stdout_debug("remove SIGCANCEL\n"); (void) memcpy(&uc, ucp, sizeof(uc)); SIGDELSET(uc.uc_sigmask, SIGCANCEL); ucp = &uc; From owner-svn-src-all@FreeBSD.ORG Thu Apr 18 07:09:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 28DDC3F1; Thu, 18 Apr 2013 07:09:28 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1C081F33; Thu, 18 Apr 2013 07:09:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3I79RCQ044699; Thu, 18 Apr 2013 07:09:27 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3I79RiW044698; Thu, 18 Apr 2013 07:09:27 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201304180709.r3I79RiW044698@svn.freebsd.org> From: Rui Paulo Date: Thu, 18 Apr 2013 07:09:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249608 - head/sys/x86/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Apr 2013 07:09:28 -0000 Author: rpaulo Date: Thu Apr 18 07:09:27 2013 New Revision: 249608 URL: http://svnweb.freebsd.org/changeset/base/249608 Log: Move the previously added CPUID7 macros to CPUID_STDEXT. Modified: head/sys/x86/include/specialreg.h Modified: head/sys/x86/include/specialreg.h ============================================================================== --- head/sys/x86/include/specialreg.h Thu Apr 18 05:58:07 2013 (r249607) +++ head/sys/x86/include/specialreg.h Thu Apr 18 07:09:27 2013 (r249608) @@ -172,23 +172,6 @@ #define CPUTPM2_EFFREQ 0x00000001 /* - * Structured Extended Features - */ -#define CPUID7_GSFSBASE 0x00000001 -#define CPUID7_TSCADJ 0x00000002 -#define CPUID7_BMI1 0x00000008 -#define CPUID7_HLE 0x00000010 -#define CPUID7_AVX2 0x00000020 -#define CPUID7_SMEP 0x00000080 -#define CPUID7_BMI2 0x00000100 -#define CPUID7_ENHMOVSB 0x00000200 -#define CPUID7_INVPCID 0x00000400 -#define CPUID7_RTM 0x00000800 -#define CPUID7_RDSEED 0x00040000 -#define CPUID7_ADX 0x00080000 -#define CPUID7_SMAP 0x00100000 - -/* * Important bits in the AMD extended cpuid flags */ #define AMDID_SYSCALL 0x00000800 @@ -295,11 +278,22 @@ #define AMDID_COREID_SIZE 0x0000f000 #define AMDID_COREID_SIZE_SHIFT 12 +/* + * Structured Extended Features + */ #define CPUID_STDEXT_FSGSBASE 0x00000001 #define CPUID_STDEXT_TSC_ADJUST 0x00000002 +#define CPUID_STDEXT_BMI1 0x00000008 +#define CPUID_STDEXT_HLE 0x00000010 +#define CPUID_STDEXT_AVX2 0x00000020 #define CPUID_STDEXT_SMEP 0x00000080 +#define CPUID_STDEXT_BMI2 0x00000100 #define CPUID_STDEXT_ENH_MOVSB 0x00000200 +#define CPUID_STDEXT_RTM 0x00000800 #define CPUID_STDEXT_INVPCID 0x00000400 +#define CPUID_STDEXT_RDSEED 0x00040000 +#define CPUID_STDEXT_ADX 0x00080000 +#define CPUID_STDEXT_SMAP 0x00100000 /* * CPUID manufacturers identifiers From owner-svn-src-all@FreeBSD.ORG Thu Apr 18 09:03:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 634451AF; Thu, 18 Apr 2013 09:03:07 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 55669688; Thu, 18 Apr 2013 09:03:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3I937xm081223; Thu, 18 Apr 2013 09:03:07 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3I937kn081222; Thu, 18 Apr 2013 09:03:07 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201304180903.r3I937kn081222@svn.freebsd.org> From: Alexander Motin Date: Thu, 18 Apr 2013 09:03:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249609 - stable/9/sys/cam/ata X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Apr 2013 09:03:07 -0000 Author: mav Date: Thu Apr 18 09:03:06 2013 New Revision: 249609 URL: http://svnweb.freebsd.org/changeset/base/249609 Log: MFC r248695: Remove two bzero()s that are erasing only few more bytes then set later. Modified: stable/9/sys/cam/ata/ata_all.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ata/ata_all.c ============================================================================== --- stable/9/sys/cam/ata/ata_all.c Thu Apr 18 07:09:27 2013 (r249608) +++ stable/9/sys/cam/ata/ata_all.c Thu Apr 18 09:03:06 2013 (r249609) @@ -367,7 +367,7 @@ void ata_48bit_cmd(struct ccb_ataio *ataio, uint8_t cmd, uint16_t features, uint64_t lba, uint16_t sector_count) { - bzero(&ataio->cmd, sizeof(ataio->cmd)); + ataio->cmd.flags = CAM_ATAIO_48BIT; if (cmd == ATA_READ_DMA48 || cmd == ATA_READ_DMA_QUEUED48 || @@ -391,13 +391,14 @@ ata_48bit_cmd(struct ccb_ataio *ataio, u ataio->cmd.features_exp = features >> 8; ataio->cmd.sector_count = sector_count; ataio->cmd.sector_count_exp = sector_count >> 8; + ataio->cmd.control = 0; } void ata_ncq_cmd(struct ccb_ataio *ataio, uint8_t cmd, uint64_t lba, uint16_t sector_count) { - bzero(&ataio->cmd, sizeof(ataio->cmd)); + ataio->cmd.flags = CAM_ATAIO_48BIT | CAM_ATAIO_FPDMA; ataio->cmd.command = cmd; ataio->cmd.features = sector_count; @@ -409,6 +410,9 @@ ata_ncq_cmd(struct ccb_ataio *ataio, uin ataio->cmd.lba_mid_exp = lba >> 32; ataio->cmd.lba_high_exp = lba >> 40; ataio->cmd.features_exp = sector_count >> 8; + ataio->cmd.sector_count = 0; + ataio->cmd.sector_count_exp = 0; + ataio->cmd.control = 0; } void From owner-svn-src-all@FreeBSD.ORG Thu Apr 18 09:40:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D259595F; Thu, 18 Apr 2013 09:40:35 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C3D2D8B5; Thu, 18 Apr 2013 09:40:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3I9eZIM093265; Thu, 18 Apr 2013 09:40:35 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3I9eZW0093262; Thu, 18 Apr 2013 09:40:35 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201304180940.r3I9eZW0093262@svn.freebsd.org> From: Alexander Motin Date: Thu, 18 Apr 2013 09:40:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249610 - in stable/9/sys/cam: . ata scsi X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Apr 2013 09:40:36 -0000 Author: mav Date: Thu Apr 18 09:40:34 2013 New Revision: 249610 URL: http://svnweb.freebsd.org/changeset/base/249610 Log: MFC r248868, r248874: Implement CAM_PERIPH_FOREACH() macro, safely iterating over the list of driver's periphs, acquiring and releaseing periph references while doing it. Use it to iterate over the lists of ada and da periphs when flushing caches and putting devices to sleep on shutdown and suspend. Previous code could panic in theory if some device disappear in the middle of the process. Modified: stable/9/sys/cam/ata/ata_da.c stable/9/sys/cam/cam_periph.h stable/9/sys/cam/scsi/scsi_da.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ata/ata_da.c ============================================================================== --- stable/9/sys/cam/ata/ata_da.c Thu Apr 18 09:03:06 2013 (r249609) +++ stable/9/sys/cam/ata/ata_da.c Thu Apr 18 09:40:34 2013 (r249610) @@ -1827,7 +1827,7 @@ adaflush(void) struct ada_softc *softc; int error; - TAILQ_FOREACH(periph, &adadriver.units, unit_links) { + CAM_PERIPH_FOREACH(periph, &adadriver) { union ccb ccb; /* If we paniced with lock held - not recurse here. */ @@ -1881,7 +1881,7 @@ adaspindown(uint8_t cmd, int flags) struct ada_softc *softc; int error; - TAILQ_FOREACH(periph, &adadriver.units, unit_links) { + CAM_PERIPH_FOREACH(periph, &adadriver) { union ccb ccb; /* If we paniced with lock held - not recurse here. */ @@ -1954,7 +1954,7 @@ adaresume(void *arg) if (ada_spindown_suspend == 0) return; - TAILQ_FOREACH(periph, &adadriver.units, unit_links) { + CAM_PERIPH_FOREACH(periph, &adadriver) { cam_periph_lock(periph); softc = (struct ada_softc *)periph->softc; /* Modified: stable/9/sys/cam/cam_periph.h ============================================================================== --- stable/9/sys/cam/cam_periph.h Thu Apr 18 09:03:06 2013 (r249609) +++ stable/9/sys/cam/cam_periph.h Thu Apr 18 09:40:34 2013 (r249610) @@ -36,6 +36,8 @@ #ifdef _KERNEL +#include + struct devstat; extern struct cam_periph *xpt_periph; @@ -209,5 +211,42 @@ cam_periph_sleep(struct cam_periph *peri return (msleep(chan, periph->sim->mtx, priority, wmesg, timo)); } +static inline struct cam_periph * +cam_periph_acquire_first(struct periph_driver *driver) +{ + struct cam_periph *periph; + + xpt_lock_buses(); + periph = TAILQ_FIRST(&driver->units); + while (periph != NULL && (periph->flags & CAM_PERIPH_INVALID) != 0) + periph = TAILQ_NEXT(periph, unit_links); + if (periph != NULL) + periph->refcount++; + xpt_unlock_buses(); + return (periph); +} + +static inline struct cam_periph * +cam_periph_acquire_next(struct cam_periph *pperiph) +{ + struct cam_periph *periph = pperiph; + + mtx_assert(pperiph->sim->mtx, MA_NOTOWNED); + xpt_lock_buses(); + do { + periph = TAILQ_NEXT(periph, unit_links); + } while (periph != NULL && (periph->flags & CAM_PERIPH_INVALID) != 0); + if (periph != NULL) + periph->refcount++; + xpt_unlock_buses(); + cam_periph_release(pperiph); + return (periph); +} + +#define CAM_PERIPH_FOREACH(periph, driver) \ + for ((periph) = cam_periph_acquire_first(driver); \ + (periph) != NULL; \ + (periph) = cam_periph_acquire_next(periph)) + #endif /* _KERNEL */ #endif /* _CAM_CAM_PERIPH_H */ Modified: stable/9/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_da.c Thu Apr 18 09:03:06 2013 (r249609) +++ stable/9/sys/cam/scsi/scsi_da.c Thu Apr 18 09:40:34 2013 (r249610) @@ -2836,7 +2836,7 @@ dashutdown(void * arg, int howto) struct da_softc *softc; int error; - TAILQ_FOREACH(periph, &dadriver.units, unit_links) { + CAM_PERIPH_FOREACH(periph, &dadriver) { union ccb ccb; cam_periph_lock(periph); From owner-svn-src-all@FreeBSD.ORG Thu Apr 18 09:44:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1B945B3F; Thu, 18 Apr 2013 09:44:01 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F25418FB; Thu, 18 Apr 2013 09:44:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3I9i0Dn093970; Thu, 18 Apr 2013 09:44:00 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3I9i05t093967; Thu, 18 Apr 2013 09:44:00 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201304180944.r3I9i05t093967@svn.freebsd.org> From: Alexander Motin Date: Thu, 18 Apr 2013 09:44:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249611 - in stable/9/sys/cam: ata scsi X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Apr 2013 09:44:01 -0000 Author: mav Date: Thu Apr 18 09:44:00 2013 New Revision: 249611 URL: http://svnweb.freebsd.org/changeset/base/249611 Log: MFC r248872, r249048: Make pre-shutdown flush and spindown routines to not use xpt_polled_action(), but execute the commands in regular way. There is no any reason to cook CPU while the system is still fully operational. After this change polling in CAM is used only for kernel dumping. Modified: stable/9/sys/cam/ata/ata_da.c stable/9/sys/cam/scsi/scsi_da.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ata/ata_da.c ============================================================================== --- stable/9/sys/cam/ata/ata_da.c Thu Apr 18 09:40:34 2013 (r249610) +++ stable/9/sys/cam/ata/ata_da.c Thu Apr 18 09:44:00 2013 (r249611) @@ -1825,11 +1825,10 @@ adaflush(void) { struct cam_periph *periph; struct ada_softc *softc; + union ccb *ccb; int error; CAM_PERIPH_FOREACH(periph, &adadriver) { - union ccb ccb; - /* If we paniced with lock held - not recurse here. */ if (cam_periph_owned(periph)) continue; @@ -1845,10 +1844,8 @@ adaflush(void) continue; } - xpt_setup_ccb(&ccb.ccb_h, periph->path, CAM_PRIORITY_NORMAL); - - ccb.ccb_h.ccb_state = ADA_CCB_DUMP; - cam_fill_ataio(&ccb.ataio, + ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL); + cam_fill_ataio(&ccb->ataio, 0, adadone, CAM_DIR_NONE, @@ -1856,20 +1853,17 @@ adaflush(void) NULL, 0, ada_default_timeout*1000); - if (softc->flags & ADA_FLAG_CAN_48BIT) - ata_48bit_cmd(&ccb.ataio, ATA_FLUSHCACHE48, 0, 0, 0); + ata_48bit_cmd(&ccb->ataio, ATA_FLUSHCACHE48, 0, 0, 0); else - ata_28bit_cmd(&ccb.ataio, ATA_FLUSHCACHE, 0, 0, 0); - xpt_polled_action(&ccb); + ata_28bit_cmd(&ccb->ataio, ATA_FLUSHCACHE, 0, 0, 0); - error = cam_periph_error(&ccb, - 0, SF_NO_RECOVERY | SF_NO_RETRY, NULL); - if ((ccb.ccb_h.status & CAM_DEV_QFRZN) != 0) - cam_release_devq(ccb.ccb_h.path, /*relsim_flags*/0, - /*reduction*/0, /*timeout*/0, /*getcount_only*/0); + error = cam_periph_runccb(ccb, adaerror, /*cam_flags*/0, + /*sense_flags*/ SF_NO_RECOVERY | SF_NO_RETRY, + softc->disk->d_devstat); if (error != 0) xpt_print(periph->path, "Synchronize cache failed\n"); + xpt_release_ccb(ccb); cam_periph_unlock(periph); } } @@ -1879,11 +1873,10 @@ adaspindown(uint8_t cmd, int flags) { struct cam_periph *periph; struct ada_softc *softc; + union ccb *ccb; int error; CAM_PERIPH_FOREACH(periph, &adadriver) { - union ccb ccb; - /* If we paniced with lock held - not recurse here. */ if (cam_periph_owned(periph)) continue; @@ -1900,10 +1893,8 @@ adaspindown(uint8_t cmd, int flags) if (bootverbose) xpt_print(periph->path, "spin-down\n"); - xpt_setup_ccb(&ccb.ccb_h, periph->path, CAM_PRIORITY_NORMAL); - - ccb.ccb_h.ccb_state = ADA_CCB_DUMP; - cam_fill_ataio(&ccb.ataio, + ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL); + cam_fill_ataio(&ccb->ataio, 0, adadone, CAM_DIR_NONE | flags, @@ -1911,17 +1902,14 @@ adaspindown(uint8_t cmd, int flags) NULL, 0, ada_default_timeout*1000); + ata_28bit_cmd(&ccb->ataio, cmd, 0, 0, 0); - ata_28bit_cmd(&ccb.ataio, cmd, 0, 0, 0); - xpt_polled_action(&ccb); - - error = cam_periph_error(&ccb, - 0, SF_NO_RECOVERY | SF_NO_RETRY, NULL); - if ((ccb.ccb_h.status & CAM_DEV_QFRZN) != 0) - cam_release_devq(ccb.ccb_h.path, /*relsim_flags*/0, - /*reduction*/0, /*timeout*/0, /*getcount_only*/0); + error = cam_periph_runccb(ccb, adaerror, /*cam_flags*/0, + /*sense_flags*/ SF_NO_RECOVERY | SF_NO_RETRY, + softc->disk->d_devstat); if (error != 0) xpt_print(periph->path, "Spin-down disk failed\n"); + xpt_release_ccb(ccb); cam_periph_unlock(periph); } } Modified: stable/9/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_da.c Thu Apr 18 09:40:34 2013 (r249610) +++ stable/9/sys/cam/scsi/scsi_da.c Thu Apr 18 09:44:00 2013 (r249611) @@ -2834,11 +2834,10 @@ dashutdown(void * arg, int howto) { struct cam_periph *periph; struct da_softc *softc; + union ccb *ccb; int error; CAM_PERIPH_FOREACH(periph, &dadriver) { - union ccb ccb; - cam_periph_lock(periph); softc = (struct da_softc *)periph->softc; @@ -2852,10 +2851,8 @@ dashutdown(void * arg, int howto) continue; } - xpt_setup_ccb(&ccb.ccb_h, periph->path, CAM_PRIORITY_NORMAL); - - ccb.ccb_h.ccb_state = DA_CCB_DUMP; - scsi_synchronize_cache(&ccb.csio, + ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL); + scsi_synchronize_cache(&ccb->csio, /*retries*/0, /*cbfcnp*/dadone, MSG_SIMPLE_Q_TAG, @@ -2864,15 +2861,12 @@ dashutdown(void * arg, int howto) SSD_FULL_SIZE, 60 * 60 * 1000); - xpt_polled_action(&ccb); - - error = cam_periph_error(&ccb, - 0, SF_NO_RECOVERY | SF_NO_RETRY | SF_QUIET_IR, NULL); - if ((ccb.ccb_h.status & CAM_DEV_QFRZN) != 0) - cam_release_devq(ccb.ccb_h.path, /*relsim_flags*/0, - /*reduction*/0, /*timeout*/0, /*getcount_only*/0); + error = cam_periph_runccb(ccb, daerror, /*cam_flags*/0, + /*sense_flags*/ SF_NO_RECOVERY | SF_NO_RETRY | SF_QUIET_IR, + softc->disk->d_devstat); if (error != 0) xpt_print(periph->path, "Synchronize cache failed\n"); + xpt_release_ccb(ccb); cam_periph_unlock(periph); } } From owner-svn-src-all@FreeBSD.ORG Thu Apr 18 09:58:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6DA3EFC1; Thu, 18 Apr 2013 09:58:31 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5F68D990; Thu, 18 Apr 2013 09:58:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3I9wVSv097722; Thu, 18 Apr 2013 09:58:31 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3I9wVwR097721; Thu, 18 Apr 2013 09:58:31 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201304180958.r3I9wVwR097721@svn.freebsd.org> From: Alexander Motin Date: Thu, 18 Apr 2013 09:58:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249612 - stable/9/sys/cam X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Apr 2013 09:58:31 -0000 Author: mav Date: Thu Apr 18 09:58:30 2013 New Revision: 249612 URL: http://svnweb.freebsd.org/changeset/base/249612 Log: MFC r249091: Use xpt_lock_buses() instead of equivalent mtx_lock(&xsoftc.xpt_topo_lock) to unify the code. Modified: stable/9/sys/cam/cam_xpt.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/cam_xpt.c ============================================================================== --- stable/9/sys/cam/cam_xpt.c Thu Apr 18 09:44:00 2013 (r249611) +++ stable/9/sys/cam/cam_xpt.c Thu Apr 18 09:58:30 2013 (r249612) @@ -653,7 +653,7 @@ xptioctl(struct cdev *dev, u_long cmd, c } /* Keep the list from changing while we traverse it */ - mtx_lock(&xsoftc.xpt_topo_lock); + xpt_lock_buses(); ptstartover: cur_generation = xsoftc.xpt_generation; @@ -663,7 +663,7 @@ ptstartover: break; if (*p_drv == NULL) { - mtx_unlock(&xsoftc.xpt_topo_lock); + xpt_unlock_buses(); ccb->ccb_h.status = CAM_REQ_CMP_ERR; ccb->cgdl.status = CAM_GDEVLIST_ERROR; *ccb->cgdl.periph_name = '\0'; @@ -685,8 +685,8 @@ ptstartover: if (periph->unit_number == unit) { break; } else if (--splbreaknum == 0) { - mtx_unlock(&xsoftc.xpt_topo_lock); - mtx_lock(&xsoftc.xpt_topo_lock); + xpt_unlock_buses(); + xpt_lock_buses(); splbreaknum = 100; if (cur_generation != xsoftc.xpt_generation) goto ptstartover; @@ -775,7 +775,7 @@ ptstartover: "your kernel config file\n"); } } - mtx_unlock(&xsoftc.xpt_topo_lock); + xpt_unlock_buses(); break; } default: @@ -1023,9 +1023,9 @@ xpt_add_periph(struct cam_periph *periph SLIST_INSERT_HEAD(periph_head, periph, periph_links); } - mtx_lock(&xsoftc.xpt_topo_lock); + xpt_lock_buses(); xsoftc.xpt_generation++; - mtx_unlock(&xsoftc.xpt_topo_lock); + xpt_unlock_buses(); return (status); } @@ -1053,12 +1053,12 @@ xpt_remove_periph(struct cam_periph *per } if (topology_lock_held == 0) - mtx_lock(&xsoftc.xpt_topo_lock); + xpt_lock_buses(); xsoftc.xpt_generation++; if (topology_lock_held == 0) - mtx_unlock(&xsoftc.xpt_topo_lock); + xpt_unlock_buses(); } @@ -2030,7 +2030,7 @@ xptbustraverse(struct cam_eb *start_bus, retval = 1; - mtx_lock(&xsoftc.xpt_topo_lock); + xpt_lock_buses(); for (bus = (start_bus ? start_bus : TAILQ_FIRST(&xsoftc.xpt_busses)); bus != NULL; bus = next_bus) { @@ -2041,22 +2041,22 @@ xptbustraverse(struct cam_eb *start_bus, * XXX The locking here is obviously very complex. We * should work to simplify it. */ - mtx_unlock(&xsoftc.xpt_topo_lock); + xpt_unlock_buses(); CAM_SIM_LOCK(bus->sim); retval = tr_func(bus, arg); CAM_SIM_UNLOCK(bus->sim); - mtx_lock(&xsoftc.xpt_topo_lock); + xpt_lock_buses(); next_bus = TAILQ_NEXT(bus, links); - mtx_unlock(&xsoftc.xpt_topo_lock); + xpt_unlock_buses(); xpt_release_bus(bus); if (retval == 0) return(retval); - mtx_lock(&xsoftc.xpt_topo_lock); + xpt_lock_buses(); } - mtx_unlock(&xsoftc.xpt_topo_lock); + xpt_unlock_buses(); return(retval); } @@ -2072,7 +2072,7 @@ xpt_sim_opened(struct cam_sim *sim) KASSERT(sim->refcount >= 1, ("sim->refcount >= 1")); mtx_assert(sim->mtx, MA_OWNED); - mtx_lock(&xsoftc.xpt_topo_lock); + xpt_lock_buses(); TAILQ_FOREACH(bus, &xsoftc.xpt_busses, links) { if (bus->sim != sim) continue; @@ -2082,7 +2082,7 @@ xpt_sim_opened(struct cam_sim *sim) SLIST_FOREACH(periph, &device->periphs, periph_links) { if (periph->refcount > 0) { - mtx_unlock(&xsoftc.xpt_topo_lock); + xpt_unlock_buses(); return (1); } } @@ -2090,7 +2090,7 @@ xpt_sim_opened(struct cam_sim *sim) } } - mtx_unlock(&xsoftc.xpt_topo_lock); + xpt_unlock_buses(); return (0); } @@ -3549,14 +3549,14 @@ xpt_path_counts(struct cam_path *path, u uint32_t *periph_ref, uint32_t *target_ref, uint32_t *device_ref) { - mtx_lock(&xsoftc.xpt_topo_lock); + xpt_lock_buses(); if (bus_ref) { if (path->bus) *bus_ref = path->bus->refcount; else *bus_ref = 0; } - mtx_unlock(&xsoftc.xpt_topo_lock); + xpt_unlock_buses(); if (periph_ref) { if (path->periph) *periph_ref = path->periph->refcount; @@ -3872,7 +3872,7 @@ xpt_bus_register(struct cam_sim *sim, de new_bus->refcount = 1; /* Held until a bus_deregister event */ new_bus->generation = 0; - mtx_lock(&xsoftc.xpt_topo_lock); + xpt_lock_buses(); old_bus = TAILQ_FIRST(&xsoftc.xpt_busses); while (old_bus != NULL && old_bus->path_id < new_bus->path_id) @@ -3882,7 +3882,7 @@ xpt_bus_register(struct cam_sim *sim, de else TAILQ_INSERT_TAIL(&xsoftc.xpt_busses, new_bus, links); xsoftc.bus_generation++; - mtx_unlock(&xsoftc.xpt_topo_lock); + xpt_unlock_buses(); /* * Set a default transport so that a PATH_INQ can be issued to @@ -3968,7 +3968,7 @@ xptnextfreepathid(void) const char *strval; pathid = 0; - mtx_lock(&xsoftc.xpt_topo_lock); + xpt_lock_buses(); bus = TAILQ_FIRST(&xsoftc.xpt_busses); retry: /* Find an unoccupied pathid */ @@ -3977,7 +3977,7 @@ retry: pathid++; bus = TAILQ_NEXT(bus, links); } - mtx_unlock(&xsoftc.xpt_topo_lock); + xpt_unlock_buses(); /* * Ensure that this pathid is not reserved for @@ -3986,7 +3986,7 @@ retry: if (resource_string_value("scbus", pathid, "at", &strval) == 0) { ++pathid; /* Start the search over */ - mtx_lock(&xsoftc.xpt_topo_lock); + xpt_lock_buses(); goto retry; } return (pathid); @@ -4435,17 +4435,17 @@ static void xpt_release_bus(struct cam_eb *bus) { - mtx_lock(&xsoftc.xpt_topo_lock); + xpt_lock_buses(); KASSERT(bus->refcount >= 1, ("bus->refcount >= 1")); if ((--bus->refcount == 0) && (TAILQ_FIRST(&bus->et_entries) == NULL)) { TAILQ_REMOVE(&xsoftc.xpt_busses, bus, links); xsoftc.bus_generation++; - mtx_unlock(&xsoftc.xpt_topo_lock); + xpt_unlock_buses(); cam_sim_release(bus->sim); free(bus, M_CAMXPT); } else - mtx_unlock(&xsoftc.xpt_topo_lock); + xpt_unlock_buses(); } static struct cam_et * @@ -4469,9 +4469,9 @@ xpt_alloc_target(struct cam_eb *bus, tar * Hold a reference to our parent bus so it * will not go away before we do. */ - mtx_lock(&xsoftc.xpt_topo_lock); + xpt_lock_buses(); bus->refcount++; - mtx_unlock(&xsoftc.xpt_topo_lock); + xpt_unlock_buses(); /* Insertion sort into our bus's target list */ cur_target = TAILQ_FIRST(&bus->et_entries); @@ -4661,7 +4661,7 @@ xpt_find_bus(path_id_t path_id) { struct cam_eb *bus; - mtx_lock(&xsoftc.xpt_topo_lock); + xpt_lock_buses(); for (bus = TAILQ_FIRST(&xsoftc.xpt_busses); bus != NULL; bus = TAILQ_NEXT(bus, links)) { @@ -4670,7 +4670,7 @@ xpt_find_bus(path_id_t path_id) break; } } - mtx_unlock(&xsoftc.xpt_topo_lock); + xpt_unlock_buses(); return (bus); } From owner-svn-src-all@FreeBSD.ORG Thu Apr 18 10:01:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8D2491EA; Thu, 18 Apr 2013 10:01:44 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 640209A6; Thu, 18 Apr 2013 10:01:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3IA1iwv099991; Thu, 18 Apr 2013 10:01:44 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3IA1i77099990; Thu, 18 Apr 2013 10:01:44 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201304181001.r3IA1i77099990@svn.freebsd.org> From: Alexander Motin Date: Thu, 18 Apr 2013 10:01:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249613 - stable/9/sys/cam X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Apr 2013 10:01:44 -0000 Author: mav Date: Thu Apr 18 10:01:43 2013 New Revision: 249613 URL: http://svnweb.freebsd.org/changeset/base/249613 Log: MFC r249104: Move CAM_DEBUG_CDB messages from the point of queuing to the point of sending to SIM. That allows to inspect real requests execution order, respecting priorities, freezing, etc. Modified: stable/9/sys/cam/cam_xpt.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/cam_xpt.c ============================================================================== --- stable/9/sys/cam/cam_xpt.c Thu Apr 18 09:58:30 2013 (r249612) +++ stable/9/sys/cam/cam_xpt.c Thu Apr 18 10:01:43 2013 (r249613) @@ -2462,7 +2462,6 @@ xpt_action(union ccb *start_ccb) void xpt_action_default(union ccb *start_ccb) { - char cdb_str[(SCSI_MAX_CDBLEN * 3) + 1]; struct cam_path *path; path = start_ccb->ccb_h.path; @@ -2498,11 +2497,6 @@ xpt_action_default(union ccb *start_ccb) start_ccb->ccb_h.target_lun << 5; } start_ccb->csio.scsi_status = SCSI_STATUS_OK; - CAM_DEBUG(path, CAM_DEBUG_CDB,("%s. CDB: %s\n", - scsi_op_desc(start_ccb->csio.cdb_io.cdb_bytes[0], - &path->device->inq_data), - scsi_cdb_string(start_ccb->csio.cdb_io.cdb_bytes, - cdb_str, sizeof(cdb_str)))); } /* FALLTHROUGH */ case XPT_TARGET_IO: @@ -2511,13 +2505,8 @@ xpt_action_default(union ccb *start_ccb) start_ccb->csio.resid = 0; /* FALLTHROUGH */ case XPT_ATA_IO: - if (start_ccb->ccb_h.func_code == XPT_ATA_IO) { + if (start_ccb->ccb_h.func_code == XPT_ATA_IO) start_ccb->ataio.resid = 0; - CAM_DEBUG(path, CAM_DEBUG_CDB,("%s. ACB: %s\n", - ata_op_string(&start_ccb->ataio.cmd), - ata_cmd_string(&start_ccb->ataio.cmd, - cdb_str, sizeof(cdb_str)))); - } /* FALLTHROUGH */ case XPT_RESET_DEV: case XPT_ENG_EXEC: @@ -3260,6 +3249,7 @@ static void xpt_run_dev_sendq(struct cam_eb *bus) { struct cam_devq *devq; + char cdb_str[(SCSI_MAX_CDBLEN * 3) + 1]; CAM_DEBUG_PRINT(CAM_DEBUG_XPT, ("xpt_run_dev_sendq\n")); @@ -3341,6 +3331,26 @@ xpt_run_dev_sendq(struct cam_eb *bus) work_ccb->ccb_h.flags &= ~CAM_TAG_ACTION_VALID; } + switch (work_ccb->ccb_h.func_code) { + case XPT_SCSI_IO: + CAM_DEBUG(work_ccb->ccb_h.path, + CAM_DEBUG_CDB,("%s. CDB: %s\n", + scsi_op_desc(work_ccb->csio.cdb_io.cdb_bytes[0], + &device->inq_data), + scsi_cdb_string(work_ccb->csio.cdb_io.cdb_bytes, + cdb_str, sizeof(cdb_str)))); + break; + case XPT_ATA_IO: + CAM_DEBUG(work_ccb->ccb_h.path, + CAM_DEBUG_CDB,("%s. ACB: %s\n", + ata_op_string(&work_ccb->ataio.cmd), + ata_cmd_string(&work_ccb->ataio.cmd, + cdb_str, sizeof(cdb_str)))); + break; + default: + break; + } + /* * Device queues can be shared among multiple sim instances * that reside on different busses. Use the SIM in the queue From owner-svn-src-all@FreeBSD.ORG Thu Apr 18 10:03:45 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E965737D; Thu, 18 Apr 2013 10:03:45 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CBC349BE; Thu, 18 Apr 2013 10:03:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3IA3jS4000501; Thu, 18 Apr 2013 10:03:45 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3IA3iP4000498; Thu, 18 Apr 2013 10:03:44 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201304181003.r3IA3iP4000498@svn.freebsd.org> From: Alexander Motin Date: Thu, 18 Apr 2013 10:03:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249614 - in stable/9/sys/cam: ata scsi X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Apr 2013 10:03:46 -0000 Author: mav Date: Thu Apr 18 10:03:44 2013 New Revision: 249614 URL: http://svnweb.freebsd.org/changeset/base/249614 Log: MFC r249105: Remove extra NULL checks. d_drv1 can never be NULL during periph life cycle. Modified: stable/9/sys/cam/ata/ata_da.c stable/9/sys/cam/scsi/scsi_cd.c stable/9/sys/cam/scsi/scsi_da.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ata/ata_da.c ============================================================================== --- stable/9/sys/cam/ata/ata_da.c Thu Apr 18 10:01:43 2013 (r249613) +++ stable/9/sys/cam/ata/ata_da.c Thu Apr 18 10:03:44 2013 (r249614) @@ -528,10 +528,6 @@ adaopen(struct disk *dp) int error; periph = (struct cam_periph *)dp->d_drv1; - if (periph == NULL) { - return (ENXIO); - } - if (cam_periph_acquire(periph) != CAM_REQ_CMP) { return(ENXIO); } @@ -567,9 +563,6 @@ adaclose(struct disk *dp) union ccb *ccb; periph = (struct cam_periph *)dp->d_drv1; - if (periph == NULL) - return (ENXIO); - cam_periph_lock(periph); if (cam_periph_hold(periph, PRIBIO) != 0) { cam_periph_unlock(periph); @@ -647,10 +640,6 @@ adastrategy(struct bio *bp) struct ada_softc *softc; periph = (struct cam_periph *)bp->bio_disk->d_drv1; - if (periph == NULL) { - biofinish(bp, NULL, ENXIO); - return; - } softc = (struct ada_softc *)periph->softc; cam_periph_lock(periph); @@ -698,8 +687,6 @@ adadump(void *arg, void *virtual, vm_off dp = arg; periph = dp->d_drv1; - if (periph == NULL) - return (ENXIO); softc = (struct ada_softc *)periph->softc; cam_periph_lock(periph); secsize = softc->params.secsize; @@ -1028,9 +1015,6 @@ adagetattr(struct bio *bp) struct cam_periph *periph; periph = (struct cam_periph *)bp->bio_disk->d_drv1; - if (periph == NULL) - return (ENXIO); - cam_periph_lock(periph); ret = xpt_getattr(bp->bio_data, bp->bio_length, bp->bio_attribute, periph->path); Modified: stable/9/sys/cam/scsi/scsi_cd.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_cd.c Thu Apr 18 10:01:43 2013 (r249613) +++ stable/9/sys/cam/scsi/scsi_cd.c Thu Apr 18 10:03:44 2013 (r249614) @@ -386,7 +386,6 @@ cddiskgonecb(struct disk *dp) struct cam_periph *periph; periph = (struct cam_periph *)dp->d_drv1; - cam_periph_release(periph); } @@ -1073,9 +1072,6 @@ cdopen(struct disk *dp) int error; periph = (struct cam_periph *)dp->d_drv1; - if (periph == NULL) - return (ENXIO); - softc = (struct cd_softc *)periph->softc; if (cam_periph_acquire(periph) != CAM_REQ_CMP) @@ -1120,9 +1116,6 @@ cdclose(struct disk *dp) struct cd_softc *softc; periph = (struct cam_periph *)dp->d_drv1; - if (periph == NULL) - return (ENXIO); - softc = (struct cd_softc *)periph->softc; cam_periph_lock(periph); @@ -1473,11 +1466,6 @@ cdstrategy(struct bio *bp) struct cd_softc *softc; periph = (struct cam_periph *)bp->bio_disk->d_drv1; - if (periph == NULL) { - biofinish(bp, NULL, ENXIO); - return; - } - cam_periph_lock(periph); CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("cdstrategy(%p)\n", bp)); @@ -1971,9 +1959,6 @@ cdioctl(struct disk *dp, u_long cmd, voi int nocopyout, error = 0; periph = (struct cam_periph *)dp->d_drv1; - if (periph == NULL) - return(ENXIO); - cam_periph_lock(periph); softc = (struct cd_softc *)periph->softc; Modified: stable/9/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_da.c Thu Apr 18 10:01:43 2013 (r249613) +++ stable/9/sys/cam/scsi/scsi_da.c Thu Apr 18 10:03:44 2013 (r249614) @@ -959,10 +959,6 @@ daopen(struct disk *dp) int error; periph = (struct cam_periph *)dp->d_drv1; - if (periph == NULL) { - return (ENXIO); - } - if (cam_periph_acquire(periph) != CAM_REQ_CMP) { return (ENXIO); } @@ -1024,9 +1020,6 @@ daclose(struct disk *dp) struct da_softc *softc; periph = (struct cam_periph *)dp->d_drv1; - if (periph == NULL) - return (0); - cam_periph_lock(periph); if (cam_periph_hold(periph, PRIBIO) != 0) { cam_periph_unlock(periph); @@ -1115,10 +1108,6 @@ dastrategy(struct bio *bp) struct da_softc *softc; periph = (struct cam_periph *)bp->bio_disk->d_drv1; - if (periph == NULL) { - biofinish(bp, NULL, ENXIO); - return; - } softc = (struct da_softc *)periph->softc; cam_periph_lock(periph); @@ -1166,8 +1155,6 @@ dadump(void *arg, void *virtual, vm_offs dp = arg; periph = dp->d_drv1; - if (periph == NULL) - return (ENXIO); softc = (struct da_softc *)periph->softc; cam_periph_lock(periph); secsize = softc->params.secsize; @@ -1242,9 +1229,6 @@ dagetattr(struct bio *bp) struct cam_periph *periph; periph = (struct cam_periph *)bp->bio_disk->d_drv1; - if (periph == NULL) - return (ENXIO); - cam_periph_lock(periph); ret = xpt_getattr(bp->bio_data, bp->bio_length, bp->bio_attribute, periph->path); @@ -1287,7 +1271,6 @@ dadiskgonecb(struct disk *dp) struct cam_periph *periph; periph = (struct cam_periph *)dp->d_drv1; - cam_periph_release(periph); } From owner-svn-src-all@FreeBSD.ORG Thu Apr 18 10:06:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BF8505ED; Thu, 18 Apr 2013 10:06:53 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B16AB9DB; Thu, 18 Apr 2013 10:06:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3IA6rJY001231; Thu, 18 Apr 2013 10:06:53 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3IA6qHu001227; Thu, 18 Apr 2013 10:06:52 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201304181006.r3IA6qHu001227@svn.freebsd.org> From: Alexander Motin Date: Thu, 18 Apr 2013 10:06:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249615 - in stable/9/sys/cam: ata scsi X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Apr 2013 10:06:53 -0000 Author: mav Date: Thu Apr 18 10:06:52 2013 New Revision: 249615 URL: http://svnweb.freebsd.org/changeset/base/249615 Log: MFC r249106: Replace some direct mutex operations with wrappers. Modified: stable/9/sys/cam/ata/ata_da.c stable/9/sys/cam/scsi/scsi_cd.c stable/9/sys/cam/scsi/scsi_da.c stable/9/sys/cam/scsi/scsi_pass.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ata/ata_da.c ============================================================================== --- stable/9/sys/cam/ata/ata_da.c Thu Apr 18 10:03:44 2013 (r249614) +++ stable/9/sys/cam/ata/ata_da.c Thu Apr 18 10:06:52 2013 (r249615) @@ -1104,7 +1104,7 @@ adaregister(struct cam_periph *periph, v * Register this media as a disk */ (void)cam_periph_hold(periph, PRIBIO); - mtx_unlock(periph->sim->mtx); + cam_periph_unlock(periph); snprintf(announce_buf, sizeof(announce_buf), "kern.cam.ada.%d.quirks", periph->unit_number); quirks = softc->quirks; @@ -1195,7 +1195,7 @@ adaregister(struct cam_periph *periph, v } else legacy_id = -1; disk_create(softc->disk, DISK_VERSION); - mtx_lock(periph->sim->mtx); + cam_periph_lock(periph); cam_periph_unhold(periph); dp = &softc->params; Modified: stable/9/sys/cam/scsi/scsi_cd.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_cd.c Thu Apr 18 10:03:44 2013 (r249614) +++ stable/9/sys/cam/scsi/scsi_cd.c Thu Apr 18 10:06:52 2013 (r249615) @@ -1446,7 +1446,7 @@ cdgetccb(struct cam_periph *periph, u_in softc->changer->flags |= CHANGER_MANUAL_CALL; cdrunchangerqueue(softc->changer); } else - msleep(&softc->changer, periph->sim->mtx, + cam_periph_sleep(periph, &softc->changer, PRIBIO, "cgticb", 0); } } Modified: stable/9/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_da.c Thu Apr 18 10:03:44 2013 (r249614) +++ stable/9/sys/cam/scsi/scsi_da.c Thu Apr 18 10:06:52 2013 (r249615) @@ -985,7 +985,7 @@ daopen(struct disk *dp) dareprobe(periph); /* Wait for the disk size update. */ - error = msleep(&softc->disk->d_mediasize, periph->sim->mtx, PRIBIO, + error = cam_periph_sleep(periph, &softc->disk->d_mediasize, PRIBIO, "dareprobe", 0); if (error != 0) xpt_print(periph->path, "unable to retrieve capacity data"); @@ -1676,7 +1676,7 @@ daregister(struct cam_periph *periph, vo (da_default_timeout * hz) / DA_ORDEREDTAG_INTERVAL, dasendorderedtag, softc); - mtx_unlock(periph->sim->mtx); + cam_periph_unlock(periph); /* * RBC devices don't have to support READ(6), only READ(10). */ @@ -1759,12 +1759,12 @@ daregister(struct cam_periph *periph, vo if (cam_periph_acquire(periph) != CAM_REQ_CMP) { xpt_print(periph->path, "%s: lost periph during " "registration!\n", __func__); - mtx_lock(periph->sim->mtx); + cam_periph_lock(periph); return (CAM_REQ_CMP_ERR); } disk_create(softc->disk, DISK_VERSION); - mtx_lock(periph->sim->mtx); + cam_periph_lock(periph); /* * Add async callbacks for events of interest. Modified: stable/9/sys/cam/scsi/scsi_pass.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_pass.c Thu Apr 18 10:03:44 2013 (r249614) +++ stable/9/sys/cam/scsi/scsi_pass.c Thu Apr 18 10:06:52 2013 (r249615) @@ -381,7 +381,7 @@ passregister(struct cam_periph *periph, * know what the blocksize of this device is, if * it even has a blocksize. */ - mtx_unlock(periph->sim->mtx); + cam_periph_unlock(periph); no_tags = (cgd->inq_data.flags & SID_CmdQue) == 0; softc->device_stats = devstat_new_entry("pass", periph->unit_number, 0, @@ -417,7 +417,7 @@ passregister(struct cam_periph *periph, */ dev_ref(softc->dev); - mtx_lock(periph->sim->mtx); + cam_periph_lock(periph); softc->dev->si_drv1 = periph; TASK_INIT(&softc->add_physpath_task, /*priority*/0, From owner-svn-src-all@FreeBSD.ORG Thu Apr 18 10:08:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8EAE076F; Thu, 18 Apr 2013 10:08:27 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 819CF9E9; Thu, 18 Apr 2013 10:08:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3IA8Rrc001552; Thu, 18 Apr 2013 10:08:27 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3IA8RUT001551; Thu, 18 Apr 2013 10:08:27 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201304181008.r3IA8RUT001551@svn.freebsd.org> From: Joel Dahl Date: Thu, 18 Apr 2013 10:08:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249616 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Apr 2013 10:08:27 -0000 Author: joel (doc committer) Date: Thu Apr 18 10:08:27 2013 New Revision: 249616 URL: http://svnweb.freebsd.org/changeset/base/249616 Log: Remove EOL whitespace. Modified: head/share/man/man5/rc.conf.5 Modified: head/share/man/man5/rc.conf.5 ============================================================================== --- head/share/man/man5/rc.conf.5 Thu Apr 18 10:06:52 2013 (r249615) +++ head/share/man/man5/rc.conf.5 Thu Apr 18 10:08:27 2013 (r249616) @@ -3987,7 +3987,7 @@ Set to the fully qualified domain name ( Unset by default. Set extra parameters for jail .Va jname , -such as +such as .Dq Li allow.chflags or .Dq Li children.max . @@ -4001,7 +4001,7 @@ script out of their corresponding variables: .Bl -tag -width "host.hostname" -offset indent .It Li path -set from +set from .Va jail_ Ns Ao Ar jname Ac Ns Va _rootdir .It Li host.hostname set from From owner-svn-src-all@FreeBSD.ORG Thu Apr 18 10:40:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9A3FEE10; Thu, 18 Apr 2013 10:40:41 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8AB02B38; Thu, 18 Apr 2013 10:40:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3IAefBM012738; Thu, 18 Apr 2013 10:40:41 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3IAeeJP012733; Thu, 18 Apr 2013 10:40:40 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201304181040.r3IAeeJP012733@svn.freebsd.org> From: Alexander Motin Date: Thu, 18 Apr 2013 10:40:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249617 - in stable/9/sys/cam: . ata scsi X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Apr 2013 10:40:41 -0000 Author: mav Date: Thu Apr 18 10:40:40 2013 New Revision: 249617 URL: http://svnweb.freebsd.org/changeset/base/249617 Log: MFC r249108: - Unify device to target insertion inside xpt_alloc_device() instead of duplicating it three times. - Reformat code to reduce indentation. - Add lock assertions to every point where reference counters are modified. - When reference counters are reaching zero, add assertions that there are no children items left. - Add a bit more locking to the xptpdperiphtraverse(). Modified: stable/9/sys/cam/ata/ata_xpt.c stable/9/sys/cam/cam_periph.c stable/9/sys/cam/cam_sim.c stable/9/sys/cam/cam_xpt.c stable/9/sys/cam/scsi/scsi_xpt.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ata/ata_xpt.c ============================================================================== --- stable/9/sys/cam/ata/ata_xpt.c Thu Apr 18 10:08:27 2013 (r249616) +++ stable/9/sys/cam/ata/ata_xpt.c Thu Apr 18 10:40:40 2013 (r249617) @@ -1534,7 +1534,6 @@ ata_alloc_device(struct cam_eb *bus, str struct cam_path path; struct ata_quirk_entry *quirk; struct cam_ed *device; - struct cam_ed *cur_device; device = xpt_alloc_device(bus, target, lun_id); if (device == NULL) @@ -1559,16 +1558,6 @@ ata_alloc_device(struct cam_eb *bus, str * do. */ bus->sim->max_ccbs += device->ccbq.devq_openings; - /* Insertion sort into our target's device list */ - cur_device = TAILQ_FIRST(&target->ed_entries); - while (cur_device != NULL && cur_device->lun_id < lun_id) - cur_device = TAILQ_NEXT(cur_device, links); - if (cur_device != NULL) { - TAILQ_INSERT_BEFORE(cur_device, device, links); - } else { - TAILQ_INSERT_TAIL(&target->ed_entries, device, links); - } - target->generation++; if (lun_id != CAM_LUN_WILDCARD) { xpt_compile_path(&path, NULL, Modified: stable/9/sys/cam/cam_periph.c ============================================================================== --- stable/9/sys/cam/cam_periph.c Thu Apr 18 10:08:27 2013 (r249616) +++ stable/9/sys/cam/cam_periph.c Thu Apr 18 10:40:40 2013 (r249617) @@ -378,13 +378,10 @@ cam_periph_acquire(struct cam_periph *pe void cam_periph_release_locked_buses(struct cam_periph *periph) { - if (periph->refcount != 0) { - periph->refcount--; - } else { - panic("%s: release of %p when refcount is zero\n ", __func__, - periph); - } - if (periph->refcount == 0 + + mtx_assert(periph->sim->mtx, MA_OWNED); + KASSERT(periph->refcount >= 1, ("periph->refcount >= 1")); + if (--periph->refcount == 0 && (periph->flags & CAM_PERIPH_INVALID)) { camperiphfree(periph); } @@ -583,6 +580,7 @@ cam_periph_invalidate(struct cam_periph { CAM_DEBUG(periph->path, CAM_DEBUG_INFO, ("Periph invalidated\n")); + mtx_assert(periph->sim->mtx, MA_OWNED); /* * We only call this routine the first time a peripheral is * invalidated. @@ -605,6 +603,7 @@ camperiphfree(struct cam_periph *periph) { struct periph_driver **p_drv; + mtx_assert(periph->sim->mtx, MA_OWNED); for (p_drv = periph_drivers; *p_drv != NULL; p_drv++) { if (strcmp((*p_drv)->driver_name, periph->periph_name) == 0) break; Modified: stable/9/sys/cam/cam_sim.c ============================================================================== --- stable/9/sys/cam/cam_sim.c Thu Apr 18 10:08:27 2013 (r249616) +++ stable/9/sys/cam/cam_sim.c Thu Apr 18 10:40:40 2013 (r249617) @@ -109,6 +109,7 @@ cam_sim_free(struct cam_sim *sim, int fr union ccb *ccb; int error; + mtx_assert(sim->mtx, MA_OWNED); sim->refcount--; if (sim->refcount > 0) { error = msleep(sim, sim->mtx, PRIBIO, "simfree", 0); Modified: stable/9/sys/cam/cam_xpt.c ============================================================================== --- stable/9/sys/cam/cam_xpt.c Thu Apr 18 10:08:27 2013 (r249616) +++ stable/9/sys/cam/cam_xpt.c Thu Apr 18 10:40:40 2013 (r249617) @@ -2101,6 +2101,7 @@ xpttargettraverse(struct cam_eb *bus, st struct cam_et *target, *next_target; int retval; + mtx_assert(bus->sim->mtx, MA_OWNED); retval = 1; for (target = (start_target ? start_target : TAILQ_FIRST(&bus->et_entries)); @@ -2128,6 +2129,7 @@ xptdevicetraverse(struct cam_et *target, struct cam_ed *device, *next_device; int retval; + mtx_assert(target->bus->sim->mtx, MA_OWNED); retval = 1; for (device = (start_device ? start_device : TAILQ_FIRST(&target->ed_entries)); @@ -2166,6 +2168,7 @@ xptperiphtraverse(struct cam_ed *device, retval = 1; + mtx_assert(device->sim->mtx, MA_OWNED); xpt_lock_buses(); for (periph = (start_periph ? start_periph : SLIST_FIRST(&device->periphs)); @@ -2247,6 +2250,7 @@ xptpdperiphtraverse(struct periph_driver xpt_periphfunc_t *tr_func, void *arg) { struct cam_periph *periph, *next_periph; + struct cam_sim *sim; int retval; retval = 1; @@ -2275,7 +2279,10 @@ xptpdperiphtraverse(struct periph_driver * traversal function, so it can't go away. */ periph->refcount++; - + sim = periph->sim; + xpt_unlock_buses(); + CAM_SIM_LOCK(sim); + xpt_lock_buses(); retval = tr_func(periph, arg); /* @@ -2285,6 +2292,7 @@ xptpdperiphtraverse(struct periph_driver next_periph = TAILQ_NEXT(periph, unit_links); cam_periph_release_locked_buses(periph); + CAM_SIM_UNLOCK(sim); if (retval == 0) goto bailout_done; @@ -3566,13 +3574,13 @@ xpt_path_counts(struct cam_path *path, u else *bus_ref = 0; } - xpt_unlock_buses(); if (periph_ref) { if (path->periph) *periph_ref = path->periph->refcount; else *periph_ref = 0; } + xpt_unlock_buses(); if (target_ref) { if (path->target) *target_ref = path->target->refcount; @@ -4447,54 +4455,55 @@ xpt_release_bus(struct cam_eb *bus) xpt_lock_buses(); KASSERT(bus->refcount >= 1, ("bus->refcount >= 1")); - if ((--bus->refcount == 0) - && (TAILQ_FIRST(&bus->et_entries) == NULL)) { - TAILQ_REMOVE(&xsoftc.xpt_busses, bus, links); - xsoftc.bus_generation++; - xpt_unlock_buses(); - cam_sim_release(bus->sim); - free(bus, M_CAMXPT); - } else + if (--bus->refcount > 0) { xpt_unlock_buses(); + return; + } + KASSERT(TAILQ_EMPTY(&bus->et_entries), + ("refcount is zero, but target list is not empty")); + TAILQ_REMOVE(&xsoftc.xpt_busses, bus, links); + xsoftc.bus_generation++; + xpt_unlock_buses(); + cam_sim_release(bus->sim); + free(bus, M_CAMXPT); } static struct cam_et * xpt_alloc_target(struct cam_eb *bus, target_id_t target_id) { - struct cam_et *target; + struct cam_et *cur_target, *target; + mtx_assert(bus->sim->mtx, MA_OWNED); target = (struct cam_et *)malloc(sizeof(*target), M_CAMXPT, M_NOWAIT|M_ZERO); - if (target != NULL) { - struct cam_et *cur_target; - - TAILQ_INIT(&target->ed_entries); - target->bus = bus; - target->target_id = target_id; - target->refcount = 1; - target->generation = 0; - target->luns = NULL; - timevalclear(&target->last_reset); - /* - * Hold a reference to our parent bus so it - * will not go away before we do. - */ - xpt_lock_buses(); - bus->refcount++; - xpt_unlock_buses(); + if (target == NULL) + return (NULL); - /* Insertion sort into our bus's target list */ - cur_target = TAILQ_FIRST(&bus->et_entries); - while (cur_target != NULL && cur_target->target_id < target_id) - cur_target = TAILQ_NEXT(cur_target, links); + TAILQ_INIT(&target->ed_entries); + target->bus = bus; + target->target_id = target_id; + target->refcount = 1; + target->generation = 0; + target->luns = NULL; + timevalclear(&target->last_reset); + /* + * Hold a reference to our parent bus so it + * will not go away before we do. + */ + xpt_lock_buses(); + bus->refcount++; + xpt_unlock_buses(); - if (cur_target != NULL) { - TAILQ_INSERT_BEFORE(cur_target, target, links); - } else { - TAILQ_INSERT_TAIL(&bus->et_entries, target, links); - } - bus->generation++; + /* Insertion sort into our bus's target list */ + cur_target = TAILQ_FIRST(&bus->et_entries); + while (cur_target != NULL && cur_target->target_id < target_id) + cur_target = TAILQ_NEXT(cur_target, links); + if (cur_target != NULL) { + TAILQ_INSERT_BEFORE(cur_target, target, links); + } else { + TAILQ_INSERT_TAIL(&bus->et_entries, target, links); } + bus->generation++; return (target); } @@ -4502,24 +4511,24 @@ static void xpt_release_target(struct cam_et *target) { - if (target->refcount == 1) { - if (TAILQ_FIRST(&target->ed_entries) == NULL) { - TAILQ_REMOVE(&target->bus->et_entries, target, links); - target->bus->generation++; - xpt_release_bus(target->bus); - if (target->luns) - free(target->luns, M_CAMXPT); - free(target, M_CAMXPT); - } - } else - target->refcount--; + mtx_assert(target->bus->sim->mtx, MA_OWNED); + if (--target->refcount > 0) + return; + KASSERT(TAILQ_EMPTY(&target->ed_entries), + ("refcount is zero, but device list is not empty")); + TAILQ_REMOVE(&target->bus->et_entries, target, links); + target->bus->generation++; + xpt_release_bus(target->bus); + if (target->luns) + free(target->luns, M_CAMXPT); + free(target, M_CAMXPT); } static struct cam_ed * xpt_alloc_device_default(struct cam_eb *bus, struct cam_et *target, lun_id_t lun_id) { - struct cam_ed *device, *cur_device; + struct cam_ed *device; device = xpt_alloc_device(bus, target, lun_id); if (device == NULL) @@ -4528,73 +4537,65 @@ xpt_alloc_device_default(struct cam_eb * device->mintags = 1; device->maxtags = 1; bus->sim->max_ccbs += device->ccbq.devq_openings; - cur_device = TAILQ_FIRST(&target->ed_entries); - while (cur_device != NULL && cur_device->lun_id < lun_id) - cur_device = TAILQ_NEXT(cur_device, links); - if (cur_device != NULL) { - TAILQ_INSERT_BEFORE(cur_device, device, links); - } else { - TAILQ_INSERT_TAIL(&target->ed_entries, device, links); - } - target->generation++; - return (device); } struct cam_ed * xpt_alloc_device(struct cam_eb *bus, struct cam_et *target, lun_id_t lun_id) { - struct cam_ed *device; - struct cam_devq *devq; + struct cam_ed *cur_device, *device; + struct cam_devq *devq; cam_status status; + mtx_assert(target->bus->sim->mtx, MA_OWNED); /* Make space for us in the device queue on our bus */ devq = bus->sim->devq; status = cam_devq_resize(devq, devq->alloc_queue.array_size + 1); + if (status != CAM_REQ_CMP) + return (NULL); - if (status != CAM_REQ_CMP) { - device = NULL; - } else { - device = (struct cam_ed *)malloc(sizeof(*device), - M_CAMDEV, M_NOWAIT|M_ZERO); - } - - if (device != NULL) { - cam_init_pinfo(&device->alloc_ccb_entry.pinfo); - device->alloc_ccb_entry.device = device; - cam_init_pinfo(&device->send_ccb_entry.pinfo); - device->send_ccb_entry.device = device; - device->target = target; - device->lun_id = lun_id; - device->sim = bus->sim; - /* Initialize our queues */ - if (camq_init(&device->drvq, 0) != 0) { - free(device, M_CAMDEV); - return (NULL); - } - if (cam_ccbq_init(&device->ccbq, - bus->sim->max_dev_openings) != 0) { - camq_fini(&device->drvq); - free(device, M_CAMDEV); - return (NULL); - } - SLIST_INIT(&device->asyncs); - SLIST_INIT(&device->periphs); - device->generation = 0; - device->owner = NULL; - device->flags = CAM_DEV_UNCONFIGURED; - device->tag_delay_count = 0; - device->tag_saved_openings = 0; - device->refcount = 1; - callout_init_mtx(&device->callout, bus->sim->mtx, 0); - - /* - * Hold a reference to our parent target so it - * will not go away before we do. - */ - target->refcount++; + device = (struct cam_ed *)malloc(sizeof(*device), + M_CAMDEV, M_NOWAIT|M_ZERO); + if (device == NULL) + return (NULL); + cam_init_pinfo(&device->alloc_ccb_entry.pinfo); + device->alloc_ccb_entry.device = device; + cam_init_pinfo(&device->send_ccb_entry.pinfo); + device->send_ccb_entry.device = device; + device->target = target; + device->lun_id = lun_id; + device->sim = bus->sim; + /* Initialize our queues */ + if (camq_init(&device->drvq, 0) != 0) { + free(device, M_CAMDEV); + return (NULL); + } + if (cam_ccbq_init(&device->ccbq, + bus->sim->max_dev_openings) != 0) { + camq_fini(&device->drvq); + free(device, M_CAMDEV); + return (NULL); } + SLIST_INIT(&device->asyncs); + SLIST_INIT(&device->periphs); + device->generation = 0; + device->owner = NULL; + device->flags = CAM_DEV_UNCONFIGURED; + device->tag_delay_count = 0; + device->tag_saved_openings = 0; + device->refcount = 1; + callout_init_mtx(&device->callout, bus->sim->mtx, 0); + + cur_device = TAILQ_FIRST(&target->ed_entries); + while (cur_device != NULL && cur_device->lun_id < lun_id) + cur_device = TAILQ_NEXT(cur_device, links); + if (cur_device != NULL) + TAILQ_INSERT_BEFORE(cur_device, device, links); + else + TAILQ_INSERT_TAIL(&target->ed_entries, device, links); + target->refcount++; + target->generation++; return (device); } @@ -4602,46 +4603,49 @@ void xpt_acquire_device(struct cam_ed *device) { + mtx_assert(device->sim->mtx, MA_OWNED); device->refcount++; } void xpt_release_device(struct cam_ed *device) { + struct cam_devq *devq; - if (device->refcount == 1) { - struct cam_devq *devq; + mtx_assert(device->sim->mtx, MA_OWNED); + if (--device->refcount > 0) + return; - if (device->alloc_ccb_entry.pinfo.index != CAM_UNQUEUED_INDEX - || device->send_ccb_entry.pinfo.index != CAM_UNQUEUED_INDEX) - panic("Removing device while still queued for ccbs"); - - if ((device->flags & CAM_DEV_REL_TIMEOUT_PENDING) != 0) - callout_stop(&device->callout); - - TAILQ_REMOVE(&device->target->ed_entries, device,links); - device->target->generation++; - device->target->bus->sim->max_ccbs -= device->ccbq.devq_openings; - /* Release our slot in the devq */ - devq = device->target->bus->sim->devq; - cam_devq_resize(devq, devq->alloc_queue.array_size - 1); - camq_fini(&device->drvq); - cam_ccbq_fini(&device->ccbq); - /* - * Free allocated memory. free(9) does nothing if the - * supplied pointer is NULL, so it is safe to call without - * checking. - */ - free(device->supported_vpds, M_CAMXPT); - free(device->device_id, M_CAMXPT); - free(device->physpath, M_CAMXPT); - free(device->rcap_buf, M_CAMXPT); - free(device->serial_num, M_CAMXPT); + KASSERT(SLIST_EMPTY(&device->periphs), + ("refcount is zero, but periphs list is not empty")); + if (device->alloc_ccb_entry.pinfo.index != CAM_UNQUEUED_INDEX + || device->send_ccb_entry.pinfo.index != CAM_UNQUEUED_INDEX) + panic("Removing device while still queued for ccbs"); + + if ((device->flags & CAM_DEV_REL_TIMEOUT_PENDING) != 0) + callout_stop(&device->callout); + + TAILQ_REMOVE(&device->target->ed_entries, device,links); + device->target->generation++; + device->target->bus->sim->max_ccbs -= device->ccbq.devq_openings; + /* Release our slot in the devq */ + devq = device->target->bus->sim->devq; + cam_devq_resize(devq, devq->alloc_queue.array_size - 1); + camq_fini(&device->drvq); + cam_ccbq_fini(&device->ccbq); + /* + * Free allocated memory. free(9) does nothing if the + * supplied pointer is NULL, so it is safe to call without + * checking. + */ + free(device->supported_vpds, M_CAMXPT); + free(device->device_id, M_CAMXPT); + free(device->physpath, M_CAMXPT); + free(device->rcap_buf, M_CAMXPT); + free(device->serial_num, M_CAMXPT); - xpt_release_target(device->target); - free(device, M_CAMDEV); - } else - device->refcount--; + xpt_release_target(device->target); + free(device, M_CAMDEV); } u_int32_t @@ -4689,6 +4693,7 @@ xpt_find_target(struct cam_eb *bus, targ { struct cam_et *target; + mtx_assert(bus->sim->mtx, MA_OWNED); for (target = TAILQ_FIRST(&bus->et_entries); target != NULL; target = TAILQ_NEXT(target, links)) { @@ -4705,6 +4710,7 @@ xpt_find_device(struct cam_et *target, l { struct cam_ed *device; + mtx_assert(target->bus->sim->mtx, MA_OWNED); for (device = TAILQ_FIRST(&target->ed_entries); device != NULL; device = TAILQ_NEXT(device, links)) { Modified: stable/9/sys/cam/scsi/scsi_xpt.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_xpt.c Thu Apr 18 10:08:27 2013 (r249616) +++ stable/9/sys/cam/scsi/scsi_xpt.c Thu Apr 18 10:40:40 2013 (r249617) @@ -2306,7 +2306,6 @@ scsi_alloc_device(struct cam_eb *bus, st struct cam_path path; struct scsi_quirk_entry *quirk; struct cam_ed *device; - struct cam_ed *cur_device; device = xpt_alloc_device(bus, target, lun_id); if (device == NULL) @@ -2335,16 +2334,6 @@ scsi_alloc_device(struct cam_eb *bus, st * do. */ bus->sim->max_ccbs += device->ccbq.devq_openings; - /* Insertion sort into our target's device list */ - cur_device = TAILQ_FIRST(&target->ed_entries); - while (cur_device != NULL && cur_device->lun_id < lun_id) - cur_device = TAILQ_NEXT(cur_device, links); - if (cur_device != NULL) { - TAILQ_INSERT_BEFORE(cur_device, device, links); - } else { - TAILQ_INSERT_TAIL(&target->ed_entries, device, links); - } - target->generation++; if (lun_id != CAM_LUN_WILDCARD) { xpt_compile_path(&path, NULL, From owner-svn-src-all@FreeBSD.ORG Thu Apr 18 10:42:49 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 800DA198; Thu, 18 Apr 2013 10:42:49 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 727E5B61; Thu, 18 Apr 2013 10:42:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3IAgnBv013091; Thu, 18 Apr 2013 10:42:49 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3IAgncj013090; Thu, 18 Apr 2013 10:42:49 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201304181042.r3IAgncj013090@svn.freebsd.org> From: Alexander Motin Date: Thu, 18 Apr 2013 10:42:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249618 - stable/9/sys/cam X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Apr 2013 10:42:49 -0000 Author: mav Date: Thu Apr 18 10:42:48 2013 New Revision: 249618 URL: http://svnweb.freebsd.org/changeset/base/249618 Log: MFC r249224: Remove extra semicolons from CAM_SIM_[UN]LOCK() macros. Modified: stable/9/sys/cam/cam_sim.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/cam_sim.h ============================================================================== --- stable/9/sys/cam/cam_sim.h Thu Apr 18 10:40:40 2013 (r249617) +++ stable/9/sys/cam/cam_sim.h Thu Apr 18 10:42:48 2013 (r249618) @@ -123,8 +123,8 @@ struct cam_sim { }; -#define CAM_SIM_LOCK(sim) mtx_lock((sim)->mtx); -#define CAM_SIM_UNLOCK(sim) mtx_unlock((sim)->mtx); +#define CAM_SIM_LOCK(sim) mtx_lock((sim)->mtx) +#define CAM_SIM_UNLOCK(sim) mtx_unlock((sim)->mtx) static __inline u_int32_t cam_sim_path(struct cam_sim *sim) From owner-svn-src-all@FreeBSD.ORG Thu Apr 18 10:49:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 520A88ED; Thu, 18 Apr 2013 10:49:53 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 44338F38; Thu, 18 Apr 2013 10:49:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3IAnrTj014295; Thu, 18 Apr 2013 10:49:53 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3IAnqxg014292; Thu, 18 Apr 2013 10:49:52 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201304181049.r3IAnqxg014292@svn.freebsd.org> From: Alexander Motin Date: Thu, 18 Apr 2013 10:49:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249619 - stable/9/sys/geom X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Apr 2013 10:49:53 -0000 Author: mav Date: Thu Apr 18 10:49:52 2013 New Revision: 249619 URL: http://svnweb.freebsd.org/changeset/base/249619 Log: MFC r248674: Make g_wither_washer() to not loop by itself, but only when there was some more topology change done that may require its attention. Add few missing g_do_wither() calls in respective places to signal it. This fixes potential infinite loop here when some provider is withered, but still opened or connected for some reason and so can not be destroyed. For example, see r227009 and r227510. Modified: stable/9/sys/geom/geom_event.c stable/9/sys/geom/geom_int.h stable/9/sys/geom/geom_subr.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/geom_event.c ============================================================================== --- stable/9/sys/geom/geom_event.c Thu Apr 18 10:42:48 2013 (r249618) +++ stable/9/sys/geom/geom_event.c Thu Apr 18 10:49:52 2013 (r249619) @@ -273,21 +273,16 @@ one_event(void) void g_run_events() { - int i; for (;;) { g_topology_lock(); while (one_event()) ; mtx_assert(&g_eventlock, MA_OWNED); - i = g_wither_work; - if (i) { + if (g_wither_work) { + g_wither_work = 0; mtx_unlock(&g_eventlock); - while (i) { - i = g_wither_washer(); - g_wither_work = i & 1; - i &= 2; - } + g_wither_washer(); g_topology_unlock(); } else { g_topology_unlock(); Modified: stable/9/sys/geom/geom_int.h ============================================================================== --- stable/9/sys/geom/geom_int.h Thu Apr 18 10:42:48 2013 (r249618) +++ stable/9/sys/geom/geom_int.h Thu Apr 18 10:49:52 2013 (r249619) @@ -65,7 +65,7 @@ void g_do_wither(void); /* geom_subr.c */ extern struct class_list_head g_classes; extern char *g_wait_event, *g_wait_sim, *g_wait_up, *g_wait_down; -int g_wither_washer(void); +void g_wither_washer(void); /* geom_io.c */ void g_io_init(void); Modified: stable/9/sys/geom/geom_subr.c ============================================================================== --- stable/9/sys/geom/geom_subr.c Thu Apr 18 10:42:48 2013 (r249618) +++ stable/9/sys/geom/geom_subr.c Thu Apr 18 10:49:52 2013 (r249619) @@ -434,20 +434,16 @@ g_wither_geom_close(struct g_geom *gp, i /* * This function is called (repeatedly) until we cant wash away more - * withered bits at present. Return value contains two bits. Bit 0 - * set means "withering stuff we can't wash now", bit 1 means "call - * me again, there may be stuff I didn't get the first time around. + * withered bits at present. */ -int +void g_wither_washer() { struct g_class *mp; struct g_geom *gp, *gp2; struct g_provider *pp, *pp2; struct g_consumer *cp, *cp2; - int result; - result = 0; g_topology_assert(); LIST_FOREACH(mp, &g_classes, class) { LIST_FOREACH_SAFE(gp, &mp->geom, geom, gp2) { @@ -456,35 +452,25 @@ g_wither_washer() continue; if (LIST_EMPTY(&pp->consumers)) g_destroy_provider(pp); - else - result |= 1; } if (!(gp->flags & G_GEOM_WITHER)) continue; LIST_FOREACH_SAFE(pp, &gp->provider, provider, pp2) { if (LIST_EMPTY(&pp->consumers)) g_destroy_provider(pp); - else - result |= 1; } LIST_FOREACH_SAFE(cp, &gp->consumer, consumer, cp2) { - if (cp->acr || cp->acw || cp->ace) { - result |= 1; + if (cp->acr || cp->acw || cp->ace) continue; - } if (cp->provider != NULL) g_detach(cp); g_destroy_consumer(cp); - result |= 2; } if (LIST_EMPTY(&gp->provider) && LIST_EMPTY(&gp->consumer)) g_destroy_geom(gp); - else - result |= 1; } } - return (result); } struct g_consumer * @@ -772,9 +758,9 @@ g_detach(struct g_consumer *cp) pp = cp->provider; LIST_REMOVE(cp, consumers); cp->provider = NULL; - if (pp->geom->flags & G_GEOM_WITHER) - g_do_wither(); - else if (pp->flags & G_PF_WITHER) + if ((cp->geom->flags & G_GEOM_WITHER) || + (pp->geom->flags & G_GEOM_WITHER) || + (pp->flags & G_PF_WITHER)) g_do_wither(); redo_rank(cp->geom); } @@ -873,6 +859,9 @@ g_access(struct g_consumer *cp, int dcr, if (pp->acr != 0 || pp->acw != 0 || pp->ace != 0) KASSERT(pp->sectorsize > 0, ("Provider %s lacks sectorsize", pp->name)); + if ((cp->geom->flags & G_GEOM_WITHER) && + cp->acr == 0 && cp->acw == 0 && cp->ace == 0) + g_do_wither(); } return (error); } From owner-svn-src-all@FreeBSD.ORG Thu Apr 18 10:57:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 71DCFC09; Thu, 18 Apr 2013 10:57:57 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 54345F8E; Thu, 18 Apr 2013 10:57:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3IAvveP017118; Thu, 18 Apr 2013 10:57:57 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3IAvvTP017117; Thu, 18 Apr 2013 10:57:57 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201304181057.r3IAvvTP017117@svn.freebsd.org> From: Alexander Motin Date: Thu, 18 Apr 2013 10:57:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249620 - stable/9/sys/geom X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Apr 2013 10:57:57 -0000 Author: mav Date: Thu Apr 18 10:57:56 2013 New Revision: 249620 URL: http://svnweb.freebsd.org/changeset/base/249620 Log: MFC r238171, r248679: Fix long known deadlock between geom dev destruction and d_close() call. Use destroy_dev_sched_cb() to not wait for device destruction while holding GEOM topology lock (that actually caused deadlock). Use request counting protected by mutex to properly wait for outstanding requests completion in cases of device closing and geom destruction. Unlike r227009, this code does not block taskqueue thread for indefinite time, waiting for completion. Modified: stable/9/sys/geom/geom_dev.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/geom_dev.c ============================================================================== --- stable/9/sys/geom/geom_dev.c Thu Apr 18 10:49:52 2013 (r249619) +++ stable/9/sys/geom/geom_dev.c Thu Apr 18 10:57:56 2013 (r249620) @@ -56,10 +56,13 @@ __FBSDID("$FreeBSD$"); #include #include -/* - * Use the consumer private field to reference a physdev alias (if any). - */ -#define cp_alias_dev private +struct g_dev_softc { + struct mtx sc_mtx; + struct cdev *sc_dev; + struct cdev *sc_alias; + int sc_open; + int sc_active; +}; static d_open_t g_dev_open; static d_close_t g_dev_close; @@ -90,6 +93,27 @@ static struct g_class g_dev_class = { .attrchanged = g_dev_attrchanged }; +static void +g_dev_destroy(void *arg, int flags __unused) +{ + struct g_consumer *cp; + struct g_geom *gp; + struct g_dev_softc *sc; + + g_topology_assert(); + cp = arg; + gp = cp->geom; + sc = cp->private; + g_trace(G_T_TOPOLOGY, "g_dev_destroy(%p(%s))", cp, gp->name); + 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); + mtx_destroy(&sc->sc_mtx); + g_free(sc); +} + void g_dev_print(void) { @@ -106,14 +130,16 @@ g_dev_print(void) static void g_dev_attrchanged(struct g_consumer *cp, const char *attr) { + struct g_dev_softc *sc; struct cdev *dev; char buf[SPECNAMELEN + 6]; + sc = cp->private; if (strcmp(attr, "GEOM::media") == 0) { - dev = cp->geom->softc; + dev = sc->sc_dev; snprintf(buf, sizeof(buf), "cdev=%s", dev->si_name); devctl_notify_f("DEVFS", "CDEV", "MEDIACHANGE", buf, M_WAITOK); - dev = cp->cp_alias_dev; + dev = sc->sc_alias; if (dev != NULL) { snprintf(buf, sizeof(buf), "cdev=%s", dev->si_name); devctl_notify_f("DEVFS", "CDEV", "MEDIACHANGE", buf, @@ -138,14 +164,14 @@ g_dev_attrchanged(struct g_consumer *cp, struct cdev *old_alias_dev; struct cdev **alias_devp; - dev = cp->geom->softc; - old_alias_dev = cp->cp_alias_dev; - alias_devp = (struct cdev **)&cp->cp_alias_dev; + dev = sc->sc_dev; + old_alias_dev = sc->sc_alias; + alias_devp = (struct cdev **)&sc->sc_alias; make_dev_physpath_alias(MAKEDEV_WAITOK, alias_devp, dev, old_alias_dev, physpath); - } else if (cp->cp_alias_dev) { - destroy_dev((struct cdev *)cp->cp_alias_dev); - cp->cp_alias_dev = NULL; + } else if (sc->sc_alias) { + destroy_dev((struct cdev *)sc->sc_alias); + sc->sc_alias = NULL; } g_free(physpath); } @@ -170,6 +196,7 @@ g_dev_taste(struct g_class *mp, struct g { struct g_geom *gp; struct g_consumer *cp; + struct g_dev_softc *sc; int error, len; struct cdev *dev, *adev; char buf[64], *val; @@ -177,7 +204,10 @@ g_dev_taste(struct g_class *mp, struct g g_trace(G_T_TOPOLOGY, "dev_taste(%s,%s)", mp->name, pp->name); g_topology_assert(); gp = g_new_geomf(mp, "%s", pp->name); + sc = g_malloc(sizeof(*sc), M_WAITOK | M_ZERO); + mtx_init(&sc->sc_mtx, "g_dev", NULL, MTX_DEF); cp = g_new_consumer(gp); + cp->private = sc; error = g_attach(cp, pp); KASSERT(error == 0, ("g_dev_taste(%s) failed to g_attach, err=%d", pp->name, error)); @@ -189,8 +219,11 @@ g_dev_taste(struct g_class *mp, struct g g_detach(cp); g_destroy_consumer(cp); g_destroy_geom(gp); + mtx_destroy(&sc->sc_mtx); + g_free(sc); return (NULL); } + sc->sc_dev = dev; /* Search for device alias name and create it if found. */ adev = NULL; @@ -211,14 +244,11 @@ g_dev_taste(struct g_class *mp, struct g if (pp->flags & G_PF_CANDELETE) dev->si_flags |= SI_CANDELETE; dev->si_iosize_max = MAXPHYS; - gp->softc = dev; - dev->si_drv1 = gp; dev->si_drv2 = cp; if (adev != NULL) { if (pp->flags & G_PF_CANDELETE) adev->si_flags |= SI_CANDELETE; adev->si_iosize_max = MAXPHYS; - adev->si_drv1 = gp; adev->si_drv2 = cp; } @@ -230,17 +260,15 @@ g_dev_taste(struct g_class *mp, struct g static int g_dev_open(struct cdev *dev, int flags, int fmt, struct thread *td) { - struct g_geom *gp; struct g_consumer *cp; + struct g_dev_softc *sc; int error, r, w, e; - gp = dev->si_drv1; cp = dev->si_drv2; - if (gp == NULL || cp == NULL || gp->softc != dev) + if (cp == NULL) return(ENXIO); /* g_dev_taste() not done yet */ - g_trace(G_T_ACCESS, "g_dev_open(%s, %d, %d, %p)", - gp->name, flags, fmt, td); + cp->geom->name, flags, fmt, td); r = flags & FREAD ? 1 : 0; w = flags & FWRITE ? 1 : 0; @@ -259,27 +287,32 @@ g_dev_open(struct cdev *dev, int flags, return (error); } g_topology_lock(); - if (dev->si_devsw == NULL) - error = ENXIO; /* We were orphaned */ - else - error = g_access(cp, r, w, e); + error = g_access(cp, r, w, e); g_topology_unlock(); + if (error == 0) { + sc = cp->private; + mtx_lock(&sc->sc_mtx); + if (sc->sc_open == 0 && sc->sc_active != 0) + wakeup(&sc->sc_active); + sc->sc_open += r + w + e; + mtx_unlock(&sc->sc_mtx); + } return(error); } static int g_dev_close(struct cdev *dev, int flags, int fmt, struct thread *td) { - struct g_geom *gp; struct g_consumer *cp; - int error, r, w, e, i; + struct g_dev_softc *sc; + int error, r, w, e; - gp = dev->si_drv1; cp = dev->si_drv2; - if (gp == NULL || cp == NULL) + if (cp == NULL) return(ENXIO); g_trace(G_T_ACCESS, "g_dev_close(%s, %d, %d, %p)", - gp->name, flags, fmt, td); + cp->geom->name, flags, fmt, td); + r = flags & FREAD ? -1 : 0; w = flags & FWRITE ? -1 : 0; #ifdef notyet @@ -287,25 +320,14 @@ g_dev_close(struct cdev *dev, int flags, #else e = 0; #endif + sc = cp->private; + mtx_lock(&sc->sc_mtx); + sc->sc_open += r + w + e; + while (sc->sc_open == 0 && sc->sc_active != 0) + msleep(&sc->sc_active, &sc->sc_mtx, 0, "PRIBIO", 0); + mtx_unlock(&sc->sc_mtx); g_topology_lock(); - if (dev->si_devsw == NULL) - error = ENXIO; /* We were orphaned */ - else - error = g_access(cp, r, w, e); - for (i = 0; i < 10 * hz;) { - if (cp->acr != 0 || cp->acw != 0) - break; - if (cp->nstart == cp->nend) - break; - pause("gdevwclose", hz / 10); - i += hz / 10; - } - if (cp->acr == 0 && cp->acw == 0 && cp->nstart != cp->nend) { - printf("WARNING: Final close of geom_dev(%s) %s %s\n", - gp->name, - "still has outstanding I/O after 10 seconds.", - "Completing close anyway, panic may happen later."); - } + error = g_access(cp, r, w, e); g_topology_unlock(); return (error); } @@ -319,7 +341,6 @@ g_dev_close(struct cdev *dev, int flags, static int g_dev_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, struct thread *td) { - struct g_geom *gp; struct g_consumer *cp; struct g_provider *pp; struct g_kerneldump kd; @@ -327,7 +348,6 @@ g_dev_ioctl(struct cdev *dev, u_long cmd int i, error; u_int u; - gp = dev->si_drv1; cp = dev->si_drv2; pp = cp->provider; @@ -441,8 +461,13 @@ g_dev_ioctl(struct cdev *dev, u_long cmd static void g_dev_done(struct bio *bp2) { + struct g_consumer *cp; + struct g_dev_softc *sc; struct bio *bp; + int destroy; + cp = bp2->bio_from; + sc = cp->private; bp = bp2->bio_parent; bp->bio_error = bp2->bio_error; if (bp->bio_error != 0) { @@ -456,6 +481,17 @@ g_dev_done(struct bio *bp2) bp->bio_resid = bp->bio_length - bp2->bio_completed; bp->bio_completed = bp2->bio_completed; g_destroy_bio(bp2); + destroy = 0; + mtx_lock(&sc->sc_mtx); + if ((--sc->sc_active) == 0) { + if (sc->sc_open == 0) + wakeup(&sc->sc_active); + if (sc->sc_dev == NULL) + destroy = 1; + } + mtx_unlock(&sc->sc_mtx); + if (destroy) + g_post_event(g_dev_destroy, cp, M_WAITOK, NULL); biodone(bp); } @@ -465,6 +501,7 @@ g_dev_strategy(struct bio *bp) struct g_consumer *cp; struct bio *bp2; struct cdev *dev; + struct g_dev_softc *sc; KASSERT(bp->bio_cmd == BIO_READ || bp->bio_cmd == BIO_WRITE || @@ -472,6 +509,7 @@ g_dev_strategy(struct bio *bp) ("Wrong bio_cmd bio=%p cmd=%d", bp, bp->bio_cmd)); dev = bp->bio_dev; cp = dev->si_drv2; + sc = cp->private; KASSERT(cp->acr || cp->acw, ("Consumer with zero access count in g_dev_strategy")); #ifdef INVARIANTS @@ -482,6 +520,11 @@ g_dev_strategy(struct bio *bp) return; } #endif + mtx_lock(&sc->sc_mtx); + KASSERT(sc->sc_open > 0, ("Closed device in g_dev_strategy")); + sc->sc_active++; + mtx_unlock(&sc->sc_mtx); + for (;;) { /* * XXX: This is not an ideal solution, but I belive it to @@ -505,46 +548,61 @@ g_dev_strategy(struct bio *bp) } /* + * g_dev_callback() + * + * Called by devfs when asynchronous device destruction is completed. + * - Mark that we have no attached device any more. + * - If there are no outstanding requests, schedule geom destruction. + * Otherwise destruction will be scheduled later by g_dev_done(). + */ + +static void +g_dev_callback(void *arg) +{ + struct g_consumer *cp; + struct g_dev_softc *sc; + int destroy; + + cp = arg; + sc = cp->private; + g_trace(G_T_TOPOLOGY, "g_dev_callback(%p(%s))", cp, cp->geom->name); + + mtx_lock(&sc->sc_mtx); + sc->sc_dev = NULL; + sc->sc_alias = NULL; + destroy = (sc->sc_active == 0); + mtx_unlock(&sc->sc_mtx); + if (destroy) + g_post_event(g_dev_destroy, cp, M_WAITOK, NULL); +} + +/* * g_dev_orphan() * * Called from below when the provider orphaned us. * - Clear any dump settings. - * - Destroy the struct cdev *to prevent any more request from coming in. The - * provider is already marked with an error, so anything which comes in - * in the interrim will be returned immediately. - * - Wait for any outstanding I/O to finish. - * - Set our access counts to zero, whatever they were. - * - Detach and self-destruct. + * - Request asynchronous device destruction to prevent any more requests + * from coming in. The provider is already marked with an error, so + * anything which comes in in the interrim will be returned immediately. */ static void g_dev_orphan(struct g_consumer *cp) { - struct g_geom *gp; struct cdev *dev; + struct g_dev_softc *sc; g_topology_assert(); - gp = cp->geom; - dev = gp->softc; - g_trace(G_T_TOPOLOGY, "g_dev_orphan(%p(%s))", cp, gp->name); + sc = cp->private; + dev = sc->sc_dev; + g_trace(G_T_TOPOLOGY, "g_dev_orphan(%p(%s))", cp, cp->geom->name); /* Reset any dump-area set on this device */ if (dev->si_flags & SI_DUMPDEV) set_dumper(NULL); /* Destroy the struct cdev *so we get no more requests */ - 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); + destroy_dev_sched_cb(dev, g_dev_callback, cp); } DECLARE_GEOM_CLASS(g_dev_class, g_dev); From owner-svn-src-all@FreeBSD.ORG Thu Apr 18 11:13:48 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E51C9F5E; Thu, 18 Apr 2013 11:13:48 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C80219F; Thu, 18 Apr 2013 11:13:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3IBDmT9023318; Thu, 18 Apr 2013 11:13:48 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3IBDm11023317; Thu, 18 Apr 2013 11:13:48 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201304181113.r3IBDm11023317@svn.freebsd.org> From: Alexander Motin Date: Thu, 18 Apr 2013 11:13:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249621 - stable/9/sys/geom X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Apr 2013 11:13:49 -0000 Author: mav Date: Thu Apr 18 11:13:48 2013 New Revision: 249621 URL: http://svnweb.freebsd.org/changeset/base/249621 Log: MFC r248694: In GEOM DISK: - Replace single done mutex with per-disk ones. On system with several disks on several HBAs that removes small, but measurable lock congestion. - Modify disk destruction process to not destroy the mutex prematurely. - Remove some extra pointer derefences. Modified: stable/9/sys/geom/geom_disk.c Modified: stable/9/sys/geom/geom_disk.c ============================================================================== --- stable/9/sys/geom/geom_disk.c Thu Apr 18 10:57:56 2013 (r249620) +++ stable/9/sys/geom/geom_disk.c Thu Apr 18 11:13:48 2013 (r249621) @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #include struct g_disk_softc { + struct mtx done_mtx; struct disk *dp; struct sysctl_ctx_list sysctl_ctx; struct sysctl_oid *sysctl_tree; @@ -67,11 +68,7 @@ struct g_disk_softc { uint32_t state; }; -static struct mtx g_disk_done_mtx; - static g_access_t g_disk_access; -static g_init_t g_disk_init; -static g_fini_t g_disk_fini; static g_start_t g_disk_start; static g_ioctl_t g_disk_ioctl; static g_dumpconf_t g_disk_dumpconf; @@ -80,8 +77,6 @@ static g_provgone_t g_disk_providergone; static struct g_class g_disk_class = { .name = "DISK", .version = G_VERSION, - .init = g_disk_init, - .fini = g_disk_fini, .start = g_disk_start, .access = g_disk_access, .ioctl = g_disk_ioctl, @@ -93,20 +88,6 @@ SYSCTL_DECL(_kern_geom); static SYSCTL_NODE(_kern_geom, OID_AUTO, disk, CTLFLAG_RW, 0, "GEOM_DISK stuff"); -static void -g_disk_init(struct g_class *mp __unused) -{ - - mtx_init(&g_disk_done_mtx, "g_disk_done", NULL, MTX_DEF); -} - -static void -g_disk_fini(struct g_class *mp __unused) -{ - - mtx_destroy(&g_disk_done_mtx); -} - DECLARE_GEOM_CLASS(g_disk_class, g_disk); static void __inline @@ -135,7 +116,7 @@ g_disk_access(struct g_provider *pp, int g_trace(G_T_ACCESS, "g_disk_access(%s, %d, %d, %d)", pp->name, r, w, e); g_topology_assert(); - sc = pp->geom->softc; + sc = pp->private; if (sc == NULL || (dp = sc->dp) == NULL || dp->d_destroyed) { /* * Allow decreasing access count even if disk is not @@ -244,42 +225,36 @@ static void g_disk_done(struct bio *bp) { struct bio *bp2; - struct disk *dp; struct g_disk_softc *sc; /* See "notes" for why we need a mutex here */ /* XXX: will witness accept a mix of Giant/unGiant drivers here ? */ - mtx_lock(&g_disk_done_mtx); - bp->bio_completed = bp->bio_length - bp->bio_resid; - bp2 = bp->bio_parent; + sc = bp2->bio_to->private; + bp->bio_completed = bp->bio_length - bp->bio_resid; + mtx_lock(&sc->done_mtx); if (bp2->bio_error == 0) bp2->bio_error = bp->bio_error; bp2->bio_completed += bp->bio_completed; - if ((bp->bio_cmd & (BIO_READ|BIO_WRITE|BIO_DELETE)) != 0 && - (sc = bp2->bio_to->geom->softc) != NULL && - (dp = sc->dp) != NULL) { - devstat_end_transaction_bio(dp->d_devstat, bp); - } + if ((bp->bio_cmd & (BIO_READ|BIO_WRITE|BIO_DELETE)) != 0) + devstat_end_transaction_bio(sc->dp->d_devstat, bp); g_destroy_bio(bp); bp2->bio_inbed++; if (bp2->bio_children == bp2->bio_inbed) { bp2->bio_resid = bp2->bio_bcount - bp2->bio_completed; g_io_deliver(bp2, bp2->bio_error); } - mtx_unlock(&g_disk_done_mtx); + mtx_unlock(&sc->done_mtx); } static int g_disk_ioctl(struct g_provider *pp, u_long cmd, void * data, int fflag, struct thread *td) { - struct g_geom *gp; struct disk *dp; struct g_disk_softc *sc; int error; - gp = pp->geom; - sc = gp->softc; + sc = pp->private; dp = sc->dp; if (dp->d_ioctl == NULL) @@ -299,7 +274,7 @@ g_disk_start(struct bio *bp) int error; off_t off; - sc = bp->bio_to->geom->softc; + sc = bp->bio_to->private; if (sc == NULL || (dp = sc->dp) == NULL || dp->d_destroyed) { g_io_deliver(bp, ENXIO); return; @@ -458,6 +433,7 @@ g_disk_create(void *arg, int flag) g_topology_assert(); dp = arg; sc = g_malloc(sizeof(*sc), M_WAITOK | M_ZERO); + mtx_init(&sc->done_mtx, "g_disk_done", NULL, MTX_DEF); sc->dp = dp; gp = g_new_geomf(&g_disk_class, "%s%d", dp->d_name, dp->d_unit); gp->softc = sc; @@ -501,15 +477,7 @@ g_disk_providergone(struct g_provider *p struct disk *dp; struct g_disk_softc *sc; - sc = (struct g_disk_softc *)pp->geom->softc; - - /* - * If the softc is already NULL, then we've probably been through - * g_disk_destroy already; there is nothing for us to do anyway. - */ - if (sc == NULL) - return; - + sc = (struct g_disk_softc *)pp->private; dp = sc->dp; /* @@ -519,8 +487,21 @@ g_disk_providergone(struct g_provider *p * in g_disk_create for VERSION_01 and avoid touching the d_gone * field for old consumers. */ - if (!(dp->d_flags & DISKFLAG_LACKS_GONE) && dp->d_gone != NULL) + if (dp != NULL && (dp->d_flags & DISKFLAG_LACKS_GONE) == 0 && + dp->d_gone != NULL) dp->d_gone(dp); + if (sc->sysctl_tree != NULL) { + sysctl_ctx_free(&sc->sysctl_ctx); + sc->sysctl_tree = NULL; + } + if (sc->led[0] != 0) { + led_set(sc->led, "0"); + sc->led[0] = 0; + } + pp->private = NULL; + pp->geom->softc = NULL; + mtx_destroy(&sc->done_mtx); + g_free(sc); } static void @@ -535,16 +516,9 @@ g_disk_destroy(void *ptr, int flag) gp = dp->d_geom; if (gp != NULL) { sc = gp->softc; - if (sc->sysctl_tree != NULL) { - sysctl_ctx_free(&sc->sysctl_ctx); - sc->sysctl_tree = NULL; - } - if (sc->led[0] != 0) { - led_set(sc->led, "0"); - sc->led[0] = 0; - } - g_free(sc); - gp->softc = NULL; + if (sc != NULL) + sc->dp = NULL; + dp->d_geom = NULL; g_wither_geom(gp, ENXIO); } g_free(dp); From owner-svn-src-all@FreeBSD.ORG Thu Apr 18 12:43:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E86E5DDC; Thu, 18 Apr 2013 12:43:07 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CA285A5D; Thu, 18 Apr 2013 12:43:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3ICh7HQ050875; Thu, 18 Apr 2013 12:43:07 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3ICh78x050872; Thu, 18 Apr 2013 12:43:07 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201304181243.r3ICh78x050872@svn.freebsd.org> From: Alexander Motin Date: Thu, 18 Apr 2013 12:43:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249622 - in head/sys/dev: mvs siis X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Apr 2013 12:43:08 -0000 Author: mav Date: Thu Apr 18 12:43:06 2013 New Revision: 249622 URL: http://svnweb.freebsd.org/changeset/base/249622 Log: Make siis(4) and mvs(4) send bus_get_dma_tag() requests to parent buses passing real bus' child pointers instead of grandchilds. Requested by: kib Modified: head/sys/dev/mvs/mvs_pci.c head/sys/dev/mvs/mvs_soc.c head/sys/dev/siis/siis.c Modified: head/sys/dev/mvs/mvs_pci.c ============================================================================== --- head/sys/dev/mvs/mvs_pci.c Thu Apr 18 11:13:48 2013 (r249621) +++ head/sys/dev/mvs/mvs_pci.c Thu Apr 18 12:43:06 2013 (r249622) @@ -488,6 +488,13 @@ mvs_child_location_str(device_t dev, dev return (0); } +static bus_dma_tag_t +mvs_get_dma_tag(device_t bus, device_t child) +{ + + return (bus_get_dma_tag(bus)); +} + static device_method_t mvs_methods[] = { DEVMETHOD(device_probe, mvs_probe), DEVMETHOD(device_attach, mvs_attach), @@ -500,6 +507,7 @@ static device_method_t mvs_methods[] = { DEVMETHOD(bus_setup_intr, mvs_setup_intr), DEVMETHOD(bus_teardown_intr,mvs_teardown_intr), DEVMETHOD(bus_child_location_str, mvs_child_location_str), + DEVMETHOD(bus_get_dma_tag, mvs_get_dma_tag), DEVMETHOD(mvs_edma, mvs_edma), { 0, 0 } }; Modified: head/sys/dev/mvs/mvs_soc.c ============================================================================== --- head/sys/dev/mvs/mvs_soc.c Thu Apr 18 11:13:48 2013 (r249621) +++ head/sys/dev/mvs/mvs_soc.c Thu Apr 18 12:43:06 2013 (r249622) @@ -430,6 +430,13 @@ mvs_child_location_str(device_t dev, dev return (0); } +static bus_dma_tag_t +mvs_get_dma_tag(device_t bus, device_t child) +{ + + return (bus_get_dma_tag(bus)); +} + static device_method_t mvs_methods[] = { DEVMETHOD(device_probe, mvs_probe), DEVMETHOD(device_attach, mvs_attach), @@ -441,8 +448,9 @@ static device_method_t mvs_methods[] = { DEVMETHOD(bus_release_resource, mvs_release_resource), DEVMETHOD(bus_setup_intr, mvs_setup_intr), DEVMETHOD(bus_teardown_intr,mvs_teardown_intr), - DEVMETHOD(mvs_edma, mvs_edma), DEVMETHOD(bus_child_location_str, mvs_child_location_str), + DEVMETHOD(bus_get_dma_tag, mvs_get_dma_tag), + DEVMETHOD(mvs_edma, mvs_edma), { 0, 0 } }; static driver_t mvs_driver = { Modified: head/sys/dev/siis/siis.c ============================================================================== --- head/sys/dev/siis/siis.c Thu Apr 18 11:13:48 2013 (r249621) +++ head/sys/dev/siis/siis.c Thu Apr 18 12:43:06 2013 (r249622) @@ -414,6 +414,13 @@ siis_child_location_str(device_t dev, de return (0); } +static bus_dma_tag_t +siis_get_dma_tag(device_t bus, device_t child) +{ + + return (bus_get_dma_tag(bus)); +} + devclass_t siis_devclass; static device_method_t siis_methods[] = { DEVMETHOD(device_probe, siis_probe), @@ -427,6 +434,7 @@ static device_method_t siis_methods[] = DEVMETHOD(bus_setup_intr, siis_setup_intr), DEVMETHOD(bus_teardown_intr,siis_teardown_intr), DEVMETHOD(bus_child_location_str, siis_child_location_str), + DEVMETHOD(bus_get_dma_tag, siis_get_dma_tag), { 0, 0 } }; static driver_t siis_driver = { From owner-svn-src-all@FreeBSD.ORG Thu Apr 18 13:09:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 180C78CB; Thu, 18 Apr 2013 13:09:05 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0B618CF9; Thu, 18 Apr 2013 13:09:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3ID94Ef058143; Thu, 18 Apr 2013 13:09:04 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3ID947b058138; Thu, 18 Apr 2013 13:09:04 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201304181309.r3ID947b058138@svn.freebsd.org> From: Rick Macklem Date: Thu, 18 Apr 2013 13:09:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249623 - in head/sys: fs/nfsclient nfsclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Apr 2013 13:09:05 -0000 Author: rmacklem Date: Thu Apr 18 13:09:04 2013 New Revision: 249623 URL: http://svnweb.freebsd.org/changeset/base/249623 Log: Both NFS clients can deadlock when using the "rdirplus" mount option. This can occur when an nfsiod thread that already holds a buffer lock attempts to acquire a vnode lock on an entry in the directory (a LOR) when another thread holding the vnode lock is waiting on an nfsiod thread. This patch avoids the deadlock by disabling readahead for this case, so the nfsiod threads never do readdirplus. Since readaheads for directories need the directory offset cookie from the previous read, they cannot normally happen in parallel. As such, testing by jhb@ and myself didn't find any performance degredation when this patch is applied. If there is a case where this results in a significant performance degradation, mounting without the "rdirplus" option can be done to re-enable readahead for directories. Reported and tested by: jhb Reviewed by: jhb MFC after: 2 weeks Modified: head/sys/fs/nfsclient/nfs_clbio.c head/sys/nfsclient/nfs_bio.c Modified: head/sys/fs/nfsclient/nfs_clbio.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clbio.c Thu Apr 18 12:43:06 2013 (r249622) +++ head/sys/fs/nfsclient/nfs_clbio.c Thu Apr 18 13:09:04 2013 (r249623) @@ -1404,10 +1404,18 @@ ncl_asyncio(struct nfsmount *nmp, struct * Commits are usually short and sweet so lets save some cpu and * leave the async daemons for more important rpc's (such as reads * and writes). + * + * Readdirplus RPCs do vget()s to acquire the vnodes for entries + * in the directory in order to update attributes. This can deadlock + * with another thread that is waiting for async I/O to be done by + * an nfsiod thread while holding a lock on one of these vnodes. + * To avoid this deadlock, don't allow the async nfsiod threads to + * perform Readdirplus RPCs. */ mtx_lock(&ncl_iod_mutex); - if (bp->b_iocmd == BIO_WRITE && (bp->b_flags & B_NEEDCOMMIT) && - (nmp->nm_bufqiods > ncl_numasync / 2)) { + if ((bp->b_iocmd == BIO_WRITE && (bp->b_flags & B_NEEDCOMMIT) && + (nmp->nm_bufqiods > ncl_numasync / 2)) || + (bp->b_vp->v_type == VDIR && (nmp->nm_flag & NFSMNT_RDIRPLUS))) { mtx_unlock(&ncl_iod_mutex); return(EIO); } Modified: head/sys/nfsclient/nfs_bio.c ============================================================================== --- head/sys/nfsclient/nfs_bio.c Thu Apr 18 12:43:06 2013 (r249622) +++ head/sys/nfsclient/nfs_bio.c Thu Apr 18 13:09:04 2013 (r249623) @@ -1345,10 +1345,18 @@ nfs_asyncio(struct nfsmount *nmp, struct * Commits are usually short and sweet so lets save some cpu and * leave the async daemons for more important rpc's (such as reads * and writes). + * + * Readdirplus RPCs do vget()s to acquire the vnodes for entries + * in the directory in order to update attributes. This can deadlock + * with another thread that is waiting for async I/O to be done by + * an nfsiod thread while holding a lock on one of these vnodes. + * To avoid this deadlock, don't allow the async nfsiod threads to + * perform Readdirplus RPCs. */ mtx_lock(&nfs_iod_mtx); - if (bp->b_iocmd == BIO_WRITE && (bp->b_flags & B_NEEDCOMMIT) && - (nmp->nm_bufqiods > nfs_numasync / 2)) { + if ((bp->b_iocmd == BIO_WRITE && (bp->b_flags & B_NEEDCOMMIT) && + (nmp->nm_bufqiods > nfs_numasync / 2)) || + (bp->b_vp->v_type == VDIR && (nmp->nm_flag & NFSMNT_RDIRPLUS))) { mtx_unlock(&nfs_iod_mtx); return(EIO); } From owner-svn-src-all@FreeBSD.ORG Thu Apr 18 13:19:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 947EEC01; Thu, 18 Apr 2013 13:19:41 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 85D75D88; Thu, 18 Apr 2013 13:19:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3IDJf9P061420; Thu, 18 Apr 2013 13:19:41 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3IDJfts061419; Thu, 18 Apr 2013 13:19:41 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201304181319.r3IDJfts061419@svn.freebsd.org> From: Alexander Motin Date: Thu, 18 Apr 2013 13:19:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249624 - stable/9/sys/dev/usb/controller X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Apr 2013 13:19:41 -0000 Author: mav Date: Thu Apr 18 13:19:41 2013 New Revision: 249624 URL: http://svnweb.freebsd.org/changeset/base/249624 Log: MFC r249336: Add ID for ASMedia ASM1042 USB 3.0 controller. Modified: stable/9/sys/dev/usb/controller/xhci_pci.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/controller/xhci_pci.c ============================================================================== --- stable/9/sys/dev/usb/controller/xhci_pci.c Thu Apr 18 13:09:04 2013 (r249623) +++ stable/9/sys/dev/usb/controller/xhci_pci.c Thu Apr 18 13:19:41 2013 (r249624) @@ -99,6 +99,9 @@ xhci_pci_match(device_t self) case 0x01941033: return ("NEC uPD720200 USB 3.0 controller"); + case 0x10421b21: + return ("ASMedia ASM1042 USB 3.0 controller"); + case 0x1e318086: return ("Intel Panther Point USB 3.0 controller"); case 0x8c318086: From owner-svn-src-all@FreeBSD.ORG Thu Apr 18 17:07:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 548ECE02; Thu, 18 Apr 2013 17:07:05 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 36D7FD32; Thu, 18 Apr 2013 17:07:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3IH75si032785; Thu, 18 Apr 2013 17:07:05 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3IH756J032784; Thu, 18 Apr 2013 17:07:05 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201304181707.r3IH756J032784@svn.freebsd.org> From: Alexander Motin Date: Thu, 18 Apr 2013 17:07:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249625 - head/sys/x86/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Apr 2013 17:07:05 -0000 Author: mav Date: Thu Apr 18 17:07:04 2013 New Revision: 249625 URL: http://svnweb.freebsd.org/changeset/base/249625 Log: Introduce kern.timecounter.smp_tsc_adjust tunable (disabled by default) and respective functionality, allowing to synchronize TSC on APs to match BSP's during boot. It may be unsafe in general case due to theoretical chance of later drift if CPUs are using different clock rate or source, but it allows to use TSC in some cases when difference caused by some initialization bug, while TSCs are known to increment synchronously. Reviewed by: jimharris, kib MFC after: 1 month Modified: head/sys/x86/x86/tsc.c Modified: head/sys/x86/x86/tsc.c ============================================================================== --- head/sys/x86/x86/tsc.c Thu Apr 18 13:19:41 2013 (r249624) +++ head/sys/x86/x86/tsc.c Thu Apr 18 17:07:04 2013 (r249625) @@ -65,6 +65,11 @@ int smp_tsc; SYSCTL_INT(_kern_timecounter, OID_AUTO, smp_tsc, CTLFLAG_RDTUN, &smp_tsc, 0, "Indicates whether the TSC is safe to use in SMP mode"); TUNABLE_INT("kern.timecounter.smp_tsc", &smp_tsc); + +int smp_tsc_adjust = 0; +SYSCTL_INT(_kern_timecounter, OID_AUTO, smp_tsc_adjust, CTLFLAG_RDTUN, + &smp_tsc_adjust, 0, "Try to adjust TSC on APs to match BSP"); +TUNABLE_INT("kern.timecounter.smp_tsc_adjust", &smp_tsc_adjust); #endif static int tsc_shift = 1; @@ -403,25 +408,77 @@ comp_smp_tsc(void *arg) } } +static void +adj_smp_tsc(void *arg) +{ + uint64_t *tsc; + int64_t d, min, max; + u_int cpu = PCPU_GET(cpuid); + u_int first, i, size; + + first = CPU_FIRST(); + if (cpu == first) + return; + min = INT64_MIN; + max = INT64_MAX; + size = (mp_maxid + 1) * 3; + for (i = 0, tsc = arg; i < N; i++, tsc += size) { + d = tsc[first * 3] - tsc[cpu * 3 + 1]; + if (d > min) + min = d; + d = tsc[first * 3 + 1] - tsc[cpu * 3 + 2]; + if (d > min) + min = d; + d = tsc[first * 3 + 1] - tsc[cpu * 3]; + if (d < max) + max = d; + d = tsc[first * 3 + 2] - tsc[cpu * 3 + 1]; + if (d < max) + max = d; + } + if (min > max) + return; + d = min / 2 + max / 2; + __asm __volatile ( + "movl $0x10, %%ecx\n\t" + "rdmsr\n\t" + "addl %%edi, %%eax\n\t" + "adcl %%esi, %%edx\n\t" + "wrmsr\n" + : /* No output */ + : "D" ((uint32_t)d), "S" ((uint32_t)(d >> 32)) + : "ax", "cx", "dx", "cc" + ); +} + static int test_tsc(void) { uint64_t *data, *tsc; - u_int i, size; + u_int i, size, adj; if ((!smp_tsc && !tsc_is_invariant) || vm_guest) return (-100); size = (mp_maxid + 1) * 3; data = malloc(sizeof(*data) * size * N, M_TEMP, M_WAITOK); + adj = 0; +retry: for (i = 0, tsc = data; i < N; i++, tsc += size) smp_rendezvous(tsc_read_0, tsc_read_1, tsc_read_2, tsc); smp_tsc = 1; /* XXX */ smp_rendezvous(smp_no_rendevous_barrier, comp_smp_tsc, smp_no_rendevous_barrier, data); + if (!smp_tsc && adj < smp_tsc_adjust) { + adj++; + smp_rendezvous(smp_no_rendevous_barrier, adj_smp_tsc, + smp_no_rendevous_barrier, data); + goto retry; + } free(data, M_TEMP); if (bootverbose) - printf("SMP: %sed TSC synchronization test\n", - smp_tsc ? "pass" : "fail"); + printf("SMP: %sed TSC synchronization test%s\n", + smp_tsc ? "pass" : "fail", + adj > 0 ? " after adjustment" : ""); if (smp_tsc && tsc_is_invariant) { switch (cpu_vendor_id) { case CPU_VENDOR_AMD: From owner-svn-src-all@FreeBSD.ORG Thu Apr 18 19:52:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 64C7D128; Thu, 18 Apr 2013 19:52:12 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 569A318B4; Thu, 18 Apr 2013 19:52:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3IJqC1a085470; Thu, 18 Apr 2013 19:52:12 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3IJqCr6085467; Thu, 18 Apr 2013 19:52:12 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201304181952.r3IJqCr6085467@svn.freebsd.org> From: Navdeep Parhar Date: Thu, 18 Apr 2013 19:52:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249627 - head/sys/dev/cxgbe/tom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Apr 2013 19:52:12 -0000 Author: np Date: Thu Apr 18 19:52:11 2013 New Revision: 249627 URL: http://svnweb.freebsd.org/changeset/base/249627 Log: cxgbe/tom: Update the CLIP table on the chip when there are changes to the list of IPv6 addresses on the system. The table is used for TOE+IPv6 only. Modified: head/sys/dev/cxgbe/tom/t4_tom.c head/sys/dev/cxgbe/tom/t4_tom.h Modified: head/sys/dev/cxgbe/tom/t4_tom.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.c Thu Apr 18 18:11:30 2013 (r249626) +++ head/sys/dev/cxgbe/tom/t4_tom.c Thu Apr 18 19:52:11 2013 (r249627) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -89,9 +90,16 @@ static int add_lip(struct adapter *, str static int delete_lip(struct adapter *, struct in6_addr *); static struct clip_entry *search_lip(struct tom_data *, struct in6_addr *); static void init_clip_table(struct adapter *, struct tom_data *); +static void update_clip(struct adapter *, void *); +static void t4_clip_task(void *, int); +static void update_clip_table(struct adapter *, struct tom_data *); static void destroy_clip_table(struct adapter *, struct tom_data *); static void free_tom_data(struct adapter *, struct tom_data *); +static int in6_ifaddr_gen; +static eventhandler_tag ifaddr_evhandler; +static struct timeout_task clip_task; + struct toepcb * alloc_toepcb(struct port_info *pi, int txqid, int rxqid, int flags) { @@ -626,7 +634,7 @@ add_lip(struct adapter *sc, struct in6_a c.ip_hi = *(uint64_t *)&lip->s6_addr[0]; c.ip_lo = *(uint64_t *)&lip->s6_addr[8]; - return (t4_wr_mbox_ns(sc, sc->mbox, &c, sizeof(c), &c)); + return (-t4_wr_mbox_ns(sc, sc->mbox, &c, sizeof(c), &c)); } static int @@ -644,7 +652,7 @@ delete_lip(struct adapter *sc, struct in c.ip_hi = *(uint64_t *)&lip->s6_addr[0]; c.ip_lo = *(uint64_t *)&lip->s6_addr[8]; - return (t4_wr_mbox_ns(sc, sc->mbox, &c, sizeof(c), &c)); + return (-t4_wr_mbox_ns(sc, sc->mbox, &c, sizeof(c), &c)); } static struct clip_entry * @@ -692,16 +700,56 @@ release_lip(struct tom_data *td, struct static void init_clip_table(struct adapter *sc, struct tom_data *td) { - struct in6_ifaddr *ia; - struct in6_addr *lip, tlip; - struct clip_entry *ce; ASSERT_SYNCHRONIZED_OP(sc); mtx_init(&td->clip_table_lock, "CLIP table lock", NULL, MTX_DEF); TAILQ_INIT(&td->clip_table); + td->clip_gen = -1; + + update_clip_table(sc, td); +} + +static void +update_clip(struct adapter *sc, void *arg __unused) +{ + + if (begin_synchronized_op(sc, NULL, HOLD_LOCK, "t4tomuc")) + return; + + if (sc->flags & TOM_INIT_DONE) + update_clip_table(sc, sc->tom_softc); + + end_synchronized_op(sc, LOCK_HELD); +} + +static void +t4_clip_task(void *arg, int count) +{ + + t4_iterate(update_clip, NULL); +} + +static void +update_clip_table(struct adapter *sc, struct tom_data *td) +{ + struct in6_ifaddr *ia; + struct in6_addr *lip, tlip; + struct clip_head stale; + struct clip_entry *ce, *ce_temp; + int rc, gen = atomic_load_acq_int(&in6_ifaddr_gen); + + ASSERT_SYNCHRONIZED_OP(sc); IN6_IFADDR_RLOCK(); + mtx_lock(&td->clip_table_lock); + + if (gen == td->clip_gen) + goto done; + + TAILQ_INIT(&stale); + TAILQ_CONCAT(&stale, &td->clip_table, link); + TAILQ_FOREACH(ia, &V_in6_ifaddrhead, ia_link) { lip = &ia->ia_addr.sin6_addr; @@ -721,18 +769,70 @@ init_clip_table(struct adapter *sc, stru * interface? It's fe80::1 usually (always?). */ - mtx_lock(&td->clip_table_lock); - if (search_lip(td, lip) == NULL) { - ce = malloc(sizeof(*ce), M_CXGBE, M_NOWAIT); - memcpy(&ce->lip, lip, sizeof(ce->lip)); - ce->refcount = 0; - if (add_lip(sc, lip) == 0) + /* + * If it's in the main list then we already know it's not stale. + */ + TAILQ_FOREACH(ce, &td->clip_table, link) { + if (IN6_ARE_ADDR_EQUAL(&ce->lip, lip)) + goto next; + } + + /* + * If it's in the stale list we should move it to the main list. + */ + TAILQ_FOREACH(ce, &stale, link) { + if (IN6_ARE_ADDR_EQUAL(&ce->lip, lip)) { + TAILQ_REMOVE(&stale, ce, link); TAILQ_INSERT_TAIL(&td->clip_table, ce, link); - else + goto next; + } + } + + /* A new IP6 address; add it to the CLIP table */ + ce = malloc(sizeof(*ce), M_CXGBE, M_NOWAIT); + memcpy(&ce->lip, lip, sizeof(ce->lip)); + ce->refcount = 0; + rc = add_lip(sc, lip); + if (rc == 0) + TAILQ_INSERT_TAIL(&td->clip_table, ce, link); + else { + char ip[INET6_ADDRSTRLEN]; + + inet_ntop(AF_INET6, &ce->lip, &ip[0], sizeof(ip)); + log(LOG_ERR, "%s: could not add %s (%d)\n", + __func__, ip, rc); + free(ce, M_CXGBE); + } +next: + continue; + } + + /* + * Remove stale addresses (those no longer in V_in6_ifaddrhead) that are + * no longer referenced by the driver. + */ + TAILQ_FOREACH_SAFE(ce, &stale, link, ce_temp) { + if (ce->refcount == 0) { + rc = delete_lip(sc, &ce->lip); + if (rc == 0) { + TAILQ_REMOVE(&stale, ce, link); free(ce, M_CXGBE); + } else { + char ip[INET6_ADDRSTRLEN]; + + inet_ntop(AF_INET6, &ce->lip, &ip[0], + sizeof(ip)); + log(LOG_ERR, "%s: could not delete %s (%d)\n", + __func__, ip, rc); + } } - mtx_unlock(&td->clip_table_lock); } + /* The ones that are still referenced need to stay in the CLIP table */ + TAILQ_CONCAT(&td->clip_table, &stale, link); + + td->clip_gen = gen; +done: + mtx_unlock(&td->clip_table_lock); IN6_IFADDR_RUNLOCK(); } @@ -893,6 +993,14 @@ t4_tom_deactivate(struct adapter *sc) return (rc); } +static void +t4_tom_ifaddr_event(void *arg __unused, struct ifnet *ifp) +{ + + atomic_add_rel_int(&in6_ifaddr_gen, 1); + taskqueue_enqueue_timeout(taskqueue_thread, &clip_task, -hz / 4); +} + static int t4_tom_mod_load(void) { @@ -915,6 +1023,10 @@ t4_tom_mod_load(void) ddp6_usrreqs.pru_soreceive = t4_soreceive_ddp; ddp6_protosw.pr_usrreqs = &ddp6_usrreqs; + TIMEOUT_TASK_INIT(taskqueue_thread, &clip_task, 0, t4_clip_task, NULL); + ifaddr_evhandler = EVENTHANDLER_REGISTER(ifaddr_event, + t4_tom_ifaddr_event, NULL, EVENTHANDLER_PRI_ANY); + rc = t4_register_uld(&tom_uld_info); if (rc != 0) t4_tom_mod_unload(); @@ -943,6 +1055,11 @@ t4_tom_mod_unload(void) if (t4_unregister_uld(&tom_uld_info) == EBUSY) return (EBUSY); + if (ifaddr_evhandler) { + EVENTHANDLER_DEREGISTER(ifaddr_event, ifaddr_evhandler); + taskqueue_cancel_timeout(taskqueue_thread, &clip_task, NULL); + } + return (0); } #endif /* TCP_OFFLOAD */ Modified: head/sys/dev/cxgbe/tom/t4_tom.h ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.h Thu Apr 18 18:11:30 2013 (r249626) +++ head/sys/dev/cxgbe/tom/t4_tom.h Thu Apr 18 19:52:11 2013 (r249627) @@ -182,6 +182,7 @@ struct clip_entry { u_int refcount; }; +TAILQ_HEAD(clip_head, clip_entry); struct tom_data { struct toedev tod; @@ -201,7 +202,8 @@ struct tom_data { struct ppod_head ppods; struct mtx clip_table_lock; - TAILQ_HEAD(, clip_entry) clip_table; + struct clip_head clip_table; + int clip_gen; }; static inline struct tom_data * From owner-svn-src-all@FreeBSD.ORG Thu Apr 18 20:13:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D4482723; Thu, 18 Apr 2013 20:13:33 +0000 (UTC) (envelope-from oleg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C68371B46; Thu, 18 Apr 2013 20:13:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3IKDXiR092400; Thu, 18 Apr 2013 20:13:33 GMT (envelope-from oleg@svn.freebsd.org) Received: (from oleg@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3IKDX6E092399; Thu, 18 Apr 2013 20:13:33 GMT (envelope-from oleg@svn.freebsd.org) Message-Id: <201304182013.r3IKDX6E092399@svn.freebsd.org> From: Oleg Bulyzhin Date: Thu, 18 Apr 2013 20:13:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249628 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Apr 2013 20:13:33 -0000 Author: oleg Date: Thu Apr 18 20:13:33 2013 New Revision: 249628 URL: http://svnweb.freebsd.org/changeset/base/249628 Log: Recover missing arp_ifinit() call. MFC after: 2 weeks Modified: head/sys/net/if_vlan.c Modified: head/sys/net/if_vlan.c ============================================================================== --- head/sys/net/if_vlan.c Thu Apr 18 19:52:11 2013 (r249627) +++ head/sys/net/if_vlan.c Thu Apr 18 20:13:33 2013 (r249628) @@ -41,6 +41,7 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_inet.h" #include "opt_vlan.h" #include @@ -66,6 +67,11 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef INET +#include +#include +#endif + #define VLAN_DEF_HWIDTH 4 #define VLAN_IFFLAGS (IFF_BROADCAST | IFF_MULTICAST) From owner-svn-src-all@FreeBSD.ORG Thu Apr 18 22:54:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 65CB5DC3; Thu, 18 Apr 2013 22:54:42 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 58AAC893; Thu, 18 Apr 2013 22:54:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3IMsgpI041610; Thu, 18 Apr 2013 22:54:42 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3IMsgHt041609; Thu, 18 Apr 2013 22:54:42 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201304182254.r3IMsgHt041609@svn.freebsd.org> From: Navdeep Parhar Date: Thu, 18 Apr 2013 22:54:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249629 - head/sys/dev/cxgbe/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Apr 2013 22:54:42 -0000 Author: np Date: Thu Apr 18 22:54:41 2013 New Revision: 249629 URL: http://svnweb.freebsd.org/changeset/base/249629 Log: cxgbe(4): Refuse to install T5 firmwares on a T4 card (and vice versa). MFC after: 1 week Modified: head/sys/dev/cxgbe/common/t4_hw.c Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Thu Apr 18 20:13:33 2013 (r249628) +++ head/sys/dev/cxgbe/common/t4_hw.c Thu Apr 18 22:54:41 2013 (r249629) @@ -1136,6 +1136,13 @@ int t4_load_fw(struct adapter *adap, con FLASH_FW_MAX_SIZE); return -EFBIG; } + if ((is_t4(adap) && hdr->chip != FW_HDR_CHIP_T4) || + (is_t5(adap) && hdr->chip != FW_HDR_CHIP_T5)) { + CH_ERR(adap, + "FW image (%d) is not suitable for this adapter (%d)\n", + hdr->chip, chip_id(adap)); + return -EINVAL; + } for (csum = 0, i = 0; i < size / sizeof(csum); i++) csum += ntohl(p[i]); From owner-svn-src-all@FreeBSD.ORG Thu Apr 18 23:20:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id F25EB490; Thu, 18 Apr 2013 23:20:17 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D3B93996; Thu, 18 Apr 2013 23:20:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3INKHhu049045; Thu, 18 Apr 2013 23:20:17 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3INKGG6049041; Thu, 18 Apr 2013 23:20:16 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201304182320.r3INKGG6049041@svn.freebsd.org> From: Rick Macklem Date: Thu, 18 Apr 2013 23:20:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249630 - in head/sys: fs/nfsclient nfsclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Apr 2013 23:20:18 -0000 Author: rmacklem Date: Thu Apr 18 23:20:16 2013 New Revision: 249630 URL: http://svnweb.freebsd.org/changeset/base/249630 Log: When an NFS unmount occurs, once vflush() writes the last dirty buffer for the last vnode on the mount back to the server, it returns. At that point, the code continues with the unmount, including freeing up the nfs specific part of the mount structure. It is possible that an nfsiod thread will try to check for an empty I/O queue in the nfs specific part of the mount structure after it has been free'd by the unmount. This patch avoids this problem by setting the iodmount entries for the mount back to NULL while holding the mutex in the unmount and checking the appropriate entry is non-NULL after acquiring the mutex in the nfsiod thread. Reported and tested by: pho Reviewed by: kib MFC after: 2 weeks Modified: head/sys/fs/nfsclient/nfs_clnfsiod.c head/sys/fs/nfsclient/nfs_clvfsops.c head/sys/nfsclient/nfs_nfsiod.c head/sys/nfsclient/nfs_vfsops.c Modified: head/sys/fs/nfsclient/nfs_clnfsiod.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clnfsiod.c Thu Apr 18 22:54:41 2013 (r249629) +++ head/sys/fs/nfsclient/nfs_clnfsiod.c Thu Apr 18 23:20:16 2013 (r249630) @@ -304,6 +304,14 @@ nfssvc_iod(void *instance) } mtx_lock(&ncl_iod_mutex); /* + * Make sure the nmp hasn't been dismounted as soon as + * ncl_doio() completes for the last buffer. + */ + nmp = ncl_iodmount[myiod]; + if (nmp == NULL) + break; + + /* * If there are more than one iod on this mount, then defect * so that the iods can be shared out fairly between the mounts */ Modified: head/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvfsops.c Thu Apr 18 22:54:41 2013 (r249629) +++ head/sys/fs/nfsclient/nfs_clvfsops.c Thu Apr 18 23:20:16 2013 (r249630) @@ -81,6 +81,9 @@ extern struct timeval nfsboottime; extern struct nfsstats newnfsstats; extern int nfsrv_useacl; extern int nfscl_debuglevel; +extern enum nfsiod_state ncl_iodwant[NFS_MAXASYNCDAEMON]; +extern struct nfsmount *ncl_iodmount[NFS_MAXASYNCDAEMON]; +extern struct mtx ncl_iod_mutex; NFSCLSTATEMUTEX; MALLOC_DEFINE(M_NEWNFSREQ, "newnfsclient_req", "New NFS request header"); @@ -1472,7 +1475,7 @@ nfs_unmount(struct mount *mp, int mntfla { struct thread *td; struct nfsmount *nmp; - int error, flags = 0, trycnt = 0; + int error, flags = 0, i, trycnt = 0; struct nfsclds *dsp, *tdsp; td = curthread; @@ -1508,6 +1511,14 @@ nfs_unmount(struct mount *mp, int mntfla */ if ((mntflags & MNT_FORCE) == 0) nfscl_umount(nmp, td); + /* Make sure no nfsiods are assigned to this mount. */ + mtx_lock(&ncl_iod_mutex); + for (i = 0; i < NFS_MAXASYNCDAEMON; i++) + if (ncl_iodmount[i] == nmp) { + ncl_iodwant[i] = NFSIOD_AVAILABLE; + ncl_iodmount[i] = NULL; + } + mtx_unlock(&ncl_iod_mutex); newnfs_disconnect(&nmp->nm_sockreq); crfree(nmp->nm_sockreq.nr_cred); FREE(nmp->nm_nam, M_SONAME); Modified: head/sys/nfsclient/nfs_nfsiod.c ============================================================================== --- head/sys/nfsclient/nfs_nfsiod.c Thu Apr 18 22:54:41 2013 (r249629) +++ head/sys/nfsclient/nfs_nfsiod.c Thu Apr 18 23:20:16 2013 (r249630) @@ -308,6 +308,14 @@ nfssvc_iod(void *instance) mtx_unlock(&Giant); mtx_lock(&nfs_iod_mtx); /* + * Make sure the nmp hasn't been dismounted as soon as + * nfs_doio() completes for the last buffer. + */ + nmp = nfs_iodmount[myiod]; + if (nmp == NULL) + break; + + /* * If there are more than one iod on this mount, then defect * so that the iods can be shared out fairly between the mounts */ Modified: head/sys/nfsclient/nfs_vfsops.c ============================================================================== --- head/sys/nfsclient/nfs_vfsops.c Thu Apr 18 22:54:41 2013 (r249629) +++ head/sys/nfsclient/nfs_vfsops.c Thu Apr 18 23:20:16 2013 (r249630) @@ -1362,7 +1362,7 @@ static int nfs_unmount(struct mount *mp, int mntflags) { struct nfsmount *nmp; - int error, flags = 0; + int error, flags = 0, i; if (mntflags & MNT_FORCE) flags |= FORCECLOSE; @@ -1387,6 +1387,14 @@ nfs_unmount(struct mount *mp, int mntfla /* * We are now committed to the unmount. */ + /* Make sure no nfsiods are assigned to this mount. */ + mtx_lock(&nfs_iod_mtx); + for (i = 0; i < NFS_MAXASYNCDAEMON; i++) + if (nfs_iodmount[i] == nmp) { + nfs_iodwant[i] = NFSIOD_AVAILABLE; + nfs_iodmount[i] = NULL; + } + mtx_unlock(&nfs_iod_mtx); nfs_disconnect(nmp); free(nmp->nm_nam, M_SONAME); From owner-svn-src-all@FreeBSD.ORG Fri Apr 19 00:30:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D00FD24D; Fri, 19 Apr 2013 00:30:53 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A81E1D44; Fri, 19 Apr 2013 00:30:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3J0Ur0j070950; Fri, 19 Apr 2013 00:30:53 GMT (envelope-from ache@svn.freebsd.org) Received: (from ache@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3J0Uq5Z070946; Fri, 19 Apr 2013 00:30:52 GMT (envelope-from ache@svn.freebsd.org) Message-Id: <201304190030.r3J0Uq5Z070946@svn.freebsd.org> From: "Andrey A. Chernov" Date: Fri, 19 Apr 2013 00:30:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249631 - in head/sys: dev/random libkern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Apr 2013 00:30:53 -0000 Author: ache Date: Fri Apr 19 00:30:52 2013 New Revision: 249631 URL: http://svnweb.freebsd.org/changeset/base/249631 Log: Attempt to mitigate poor initialization of arc4 by one-shot reinitialization from yarrow right after good entropy is harvested. Approved by: secteam (delphij) MFC after: 1 week Modified: head/sys/dev/random/randomdev_soft.c head/sys/libkern/arc4random.c head/sys/sys/libkern.h Modified: head/sys/dev/random/randomdev_soft.c ============================================================================== --- head/sys/dev/random/randomdev_soft.c Thu Apr 18 23:20:16 2013 (r249630) +++ head/sys/dev/random/randomdev_soft.c Fri Apr 19 00:30:52 2013 (r249631) @@ -367,6 +367,8 @@ random_yarrow_unblock(void) selwakeuppri(&random_systat.rsel, PUSER); wakeup(&random_systat); } + (void)atomic_cmpset_int(&arc4rand_iniseed_state, ARC4_ENTR_NONE, + ARC4_ENTR_HAVE); } static int Modified: head/sys/libkern/arc4random.c ============================================================================== --- head/sys/libkern/arc4random.c Thu Apr 18 23:20:16 2013 (r249630) +++ head/sys/libkern/arc4random.c Fri Apr 19 00:30:52 2013 (r249631) @@ -24,6 +24,8 @@ __FBSDID("$FreeBSD$"); #define ARC4_RESEED_SECONDS 300 #define ARC4_KEYBYTES (256 / 8) +int arc4rand_iniseed_state = ARC4_ENTR_NONE; + static u_int8_t arc4_i, arc4_j; static int arc4_numruns = 0; static u_int8_t arc4_sbox[256]; @@ -130,7 +132,8 @@ arc4rand(void *ptr, u_int len, int resee struct timeval tv; getmicrouptime(&tv); - if (reseed || + if (atomic_cmpset_int(&arc4rand_iniseed_state, ARC4_ENTR_HAVE, + ARC4_ENTR_SEED) || reseed || (arc4_numruns > ARC4_RESEED_BYTES) || (tv.tv_sec > arc4_t_reseed)) arc4_randomstir(); Modified: head/sys/sys/libkern.h ============================================================================== --- head/sys/sys/libkern.h Thu Apr 18 23:20:16 2013 (r249630) +++ head/sys/sys/libkern.h Fri Apr 19 00:30:52 2013 (r249631) @@ -70,6 +70,11 @@ static __inline int abs(int a) { return static __inline long labs(long a) { return (a < 0 ? -a : a); } static __inline quad_t qabs(quad_t a) { return (a < 0 ? -a : a); } +#define ARC4_ENTR_NONE 0 /* Don't have entropy yet. */ +#define ARC4_ENTR_HAVE 1 /* Have entropy. */ +#define ARC4_ENTR_SEED 2 /* Reseeding. */ +extern int arc4rand_iniseed_state; + /* Prototypes for non-quad routines. */ struct malloc_type; uint32_t arc4random(void); From owner-svn-src-all@FreeBSD.ORG Fri Apr 19 00:47:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5D8A657F for ; Fri, 19 Apr 2013 00:47:19 +0000 (UTC) (envelope-from jdc@koitsu.org) Received: from qmta02.emeryville.ca.mail.comcast.net (qmta02.emeryville.ca.mail.comcast.net [IPv6:2001:558:fe2d:43:76:96:30:24]) by mx1.freebsd.org (Postfix) with ESMTP id 3E6DEDE5 for ; Fri, 19 Apr 2013 00:47:19 +0000 (UTC) Received: from omta09.emeryville.ca.mail.comcast.net ([76.96.30.20]) by qmta02.emeryville.ca.mail.comcast.net with comcast id Rc6f1l0010S2fkCA2cnKFf; Fri, 19 Apr 2013 00:47:19 +0000 Received: from koitsu.strangled.net ([67.180.84.87]) by omta09.emeryville.ca.mail.comcast.net with comcast id RcnJ1l00J1t3BNj8VcnJev; Fri, 19 Apr 2013 00:47:18 +0000 Received: by icarus.home.lan (Postfix, from userid 1000) id 35FBF73A33; Thu, 18 Apr 2013 17:47:18 -0700 (PDT) Date: Thu, 18 Apr 2013 17:47:18 -0700 From: Jeremy Chadwick To: Brooks Davis Subject: Re: svn commit: r249549 - in stable/9/sys: amd64/conf i386/conf Message-ID: <20130419004718.GA40897@icarus.home.lan> References: <201304161609.r3GG9SID009937@svn.freebsd.org> <20130416161919.GA80626@icarus.home.lan> <20130417125433.GC30222@caravan.chchile.org> <20130417193538.GB9331@icarus.home.lan> <20130417194706.GA30583@lor.one-eyed-alien.net> <20130417225603.GA13720@icarus.home.lan> <20130418022102.GB31612@lor.one-eyed-alien.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130418022102.GB31612@lor.one-eyed-alien.net> User-Agent: Mutt/1.5.21 (2010-09-15) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20121106; t=1366332439; bh=vvZYee3haJkv/dBfhSULzfRkjrLbC/oASS4Wi7Ned2s=; h=Received:Received:Received:Date:From:To:Subject:Message-ID: MIME-Version:Content-Type; b=LEGo6i+8Tn1PoRnSphADkyNZSbqJ6nNcO9c6PkZf23BSN0XrHGMA5ggaUFUpaUQVm u68Zhi7YZXX9ZjPHWC8uyRyTsabtfYcrR3CcDGn9o8Sq++9srbNOil28AVef4TMfBA i12Wcj32BAJTpaG1biYJxvMOspXfQjgnuSFbzt69AIjaedDh1+sxNsbafhVZDxIHR7 1XWAPnnueQdxPFS5RhVKnNTZ8/IkLiPQzCmja9F0s4NnN8oZnv40Nxdj7ueMjPCUdo YJqYVzvSNzOTSJqX0npOqvMrKe4HdBVJlmv6+Q2x1ZpjD/FW33RotQUF32rFYnGke1 OcmJCDUZV/Yzw== Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-9@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Apr 2013 00:47:19 -0000 On Wed, Apr 17, 2013 at 09:21:02PM -0500, Brooks Davis wrote: > On Wed, Apr 17, 2013 at 03:56:03PM -0700, Jeremy Chadwick wrote: > > On Wed, Apr 17, 2013 at 02:47:06PM -0500, Brooks Davis wrote: > > > On Wed, Apr 17, 2013 at 12:35:38PM -0700, Jeremy Chadwick wrote: > > > > On Wed, Apr 17, 2013 at 02:54:33PM +0200, Jeremie Le Hen wrote: > > > > > Hi Jeremy, > > > > > > > > > > On Tue, Apr 16, 2013 at 09:19:19AM -0700, Jeremy Chadwick wrote: > > > > > > > > > > > > Now that this has been enabled by default, I should warn folks of a > > > > > > caveat that I found in the buildworld/buildkernel framework. It's > > > > > > easiest to explain like this: > > > > > > > > > > > > 1. Install FreeBSD 9.x, svn checkout of stable/9, etc... > > > > > > 2. Add WITHOUT_CDDL=true to /etc/src.conf > > > > > > 3. Rebuild + install kernel/world per src/Makefile procedure > > > > > > 4. Remove WITHOUT_CDDL=true from /etc/src.conf > > > > > > 5. rm -fr /usr/obj/* > > > > > > 6. Rebuild world > > > > > > 7. Rebuild kernel -- fails, stating "ctfconvert: not found". > > > > > > > > > > > > For whatever reason the buildkernel bits make the assumption that > > > > > > ctfconvert exists on the system (presumably in $PATH or possibly a > > > > > > hard-coded), when ideally it should try to use the recently-built > > > > > > version in /usr/obj first. > > > > > > > > > > I've tested this is a freshly installed 9.1-RELEASE jail and I haven't > > > > > been biten by the bug you describe. > > > > > > > > > > ctfconvert(1) seems to be installed by default in 9.1-RELEASE, this is > > > > > probably there problem didn't occur. I can easily verify this in the > > > > > jail: > > > > > > > > > > % root@test9:/usr/src # ls -l /usr/bin/ctfconvert /usr/bin/vi /usr/bin/tail > > > > > % -r-xr-xr-x 1 root wheel 371536 Dec 4 09:33 /usr/bin/ctfconvert > > > > > % -r-xr-xr-x 1 root wheel 19848 Apr 17 06:28 /usr/bin/tail > > > > > % -r-xr-xr-x 6 root wheel 346432 Apr 17 06:28 /usr/bin/vi > > > > > > > > > > > > > > > Do you have a theory about why you've got the problem while I haven't? > > > > > FYI, it seems 9.0-RELEASE also has ctfconvert(1): > > > > > http://svnweb.freebsd.org/base/release/9.0.0/cddl/usr.bin/ctfconvert/ > > > > > > > > > > My guess is tha this might happen if you don't have /usr/bin/ctfconvert. > > > > > I've just removed it and trying to build kernel again. > > > > > > > > I will spend some time to figure out exactly how to reproduce this. > > > > > > > > Going from recent memory (~2 weeks ago), I encountered it on my VPS box > > > > (which does run ntpd, just FYI): > > > > > > > > 1. Initially installed with 9.1-RELEASE, > > > > 2. Upgraded to stable/9 (using svn), > > > > 3. WITHOUT_CDDL=true and WITHOUT_ZFS=true added to /etc/src.conf > > > > 4. world/kernel rebuilt/reinstalled/etc. (this includes make delete-old, > > > > as per instructions in src/Makefile -- which would delete > > > > /usr/bin/ctfconvert) > > > > 5. Fast forward many months > > > > 6. Removed WITHOUT_CDDL=true from src.conf > > > > 7. Encountered the above issue ("ctfconvert: not found") during > > > > buildkernel > > > > 8. Rebuilt kernel again -- same error > > > > 9. Removed WITHOUT_ZFS=true from src.conf > > > > 10. Rebuilt kernel again -- worked > > > > > > > > This could mean WITHOUT_ZFS=true has some bearing on this situation, but > > > > I don't see how/why, as WITHOUT_CDDL is supposed to be the "trigger" for > > > > ctf* utilities. I did poke around the Makefiles and framework a bit > > > > but didn't have any epiphanies. > > > > > > > > Like I said -- I'll try to reproduce the exact scenario. > > > > > > Looking at Makefile.inc1 around line 1164 (on HEAD), ctfconvert and > > > cftmerge are bootstrap tools only when they don't exist at all on the > > > host. The code there should be expanded to bootstrap for cases where > > > the installed ones are known to be broken (virtually all prior versions > > > given recent fixes) as well as when they aren't present on the host > > > system. > > > > I'm able to reproduce the issue I speak of with 100% reliability. > > Jeremie, I'm not sure why you're not able to reproduce this, because I > > can do so reliably/consistently. > > The following patch will probably fix the problem. > > Index: Makefile.inc1 > =================================================================== > --- Makefile.inc1 (revision 249590) > +++ Makefile.inc1 (working copy) > @@ -1114,9 +1114,7 @@ > usr.bin/clang/clang-tblgen > .endif > > -.if ${MK_CDDL} != "no" && \ > - ${BOOTSTRAPPING} < 800038 && \ > - !(${BOOTSTRAPPING} >= 700112 && ${BOOTSTRAPPING} < 799999) > +.if ${MK_CDDL} != "no" > _dtrace_tools= cddl/usr.bin/sgsmsg cddl/lib/libctf lib/libelf \ > lib/libdwarf cddl/usr.bin/ctfconvert cddl/usr.bin/ctfmerge > .endif > > This patch unconditionally bootstraps ctfconvert and ctfmerge unless > WITHOUT_CDDL is set. The above patch now breaks buildworld (not buildkernel) when WITHOUT_CDDL=true **is not** defined: cc -O2 -pipe -I/usr/src/cddl/usr.bin/ctfconvert/../../../sys/cddl/compat/opensolaris -I/usr/src/cddl/usr.bin/ctfconvert/../../../cddl/compat/opensolaris/include -I/usr/src/cddl/usr.bin/ctfconvert/../../../cddl/contrib/opensolaris -I/usr/src/cddl/usr.bin/ctfconvert/../../../sys/cddl/contrib/opensolaris -I/usr/src/cddl/usr.bin/ctfconvert/../../../cddl/contrib/opensolaris/head -I/usr/src/cddl/usr.bin/ctfconvert/../../../cddl/contrib/opensolaris/tools/ctf/common -I/usr/src/cddl/usr.bin/ctfconvert/../../../cddl/contrib/opensolaris/tools/ctf/cvt -I/usr/src/cddl/usr.bin/ctfconvert/../../../sys/cddl/contrib/opensolaris/uts/common -DNEED_SOLARIS_BOOLEAN -g -std=gnu89 -Wno-unknown-pragmas -I/usr/obj/usr/src/tmp/legacy/usr/include -c /usr/src/cddl/usr.bin/ctfconvert/../../../cddl/contrib/opensolaris/tools/ctf/cvt/util.c make: don't know how to make /usr/lib/libctf.a. Stop *** [bootstrap-tools] Error code 2 Stop in /usr/src. *** [_bootstrap-tools] Error code 1 Stop in /usr/src. *** [buildworld] Error code 1 Stop in /usr/src. By the way, the lines relevant to the _dtrace_tools assignment contain spaces, not tabs, which is generally considered bad. Fixing this doesn't fix the above buildworld failure. -- | Jeremy Chadwick jdc@koitsu.org | | UNIX Systems Administrator http://jdc.koitsu.org/ | | Mountain View, CA, US | | Making life hard for others since 1977. PGP 4BD6C0CB | From owner-svn-src-all@FreeBSD.ORG Fri Apr 19 03:55:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 71F9959F; Fri, 19 Apr 2013 03:55:55 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4867378A; Fri, 19 Apr 2013 03:55:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3J3tsPJ035800; Fri, 19 Apr 2013 03:55:54 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3J3tsMb035799; Fri, 19 Apr 2013 03:55:54 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201304190355.r3J3tsMb035799@svn.freebsd.org> From: "Kenneth D. Merry" Date: Fri, 19 Apr 2013 03:55:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249632 - stable/9/usr.bin/ctlstat X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Apr 2013 03:55:55 -0000 Author: ken Date: Fri Apr 19 03:55:54 2013 New Revision: 249632 URL: http://svnweb.freebsd.org/changeset/base/249632 Log: MFC r249334 and r249384: ------------------------------------------------------------------------ r249334 | ken | 2013-04-10 10:01:45 -0600 (Wed, 10 Apr 2013) | 11 lines Fix a time calculation error in ctlstat_standard(). ctlstat.c: When converting a timeval to a floating point number in ctlstat_standard(), cast the nanoseconds calculation to a long double, so we don't lose precision. Without the cast, we wind up with a time in whole seconds only. Sponsored by: Spectra Logic ------------------------------------------------------------------------ r249384 | ken | 2013-04-11 15:18:04 -0600 (Thu, 11 Apr 2013) | 17 lines Fix bugs in the elapsed time calculation in ctlstat_standard() pointed out by bde: - Casting to long double isn't needed. - The division isn't needed, multiplication can be used. "When 1 nanosecond is in a floating point literal, the whole expression is automatically promoted correctly." - non-KNF indentation (1 tab) for the newly split line - different non-KNF indentation (5 spaces) for the previously split line - exessive parentheses around the division operation - bogus blank line which splits up the etime initialization - general verboseness from the above. Submitted by: bde Sponsored by: Spectra Logic Modified: stable/9/usr.bin/ctlstat/ctlstat.c Directory Properties: stable/9/usr.bin/ctlstat/ (props changed) Modified: stable/9/usr.bin/ctlstat/ctlstat.c ============================================================================== --- stable/9/usr.bin/ctlstat/ctlstat.c Fri Apr 19 00:30:52 2013 (r249631) +++ stable/9/usr.bin/ctlstat/ctlstat.c Fri Apr 19 03:55:54 2013 (r249632) @@ -404,7 +404,7 @@ ctlstat_json(struct ctlstat_context *ctx static void ctlstat_standard(struct ctlstat_context *ctx) { - long double cur_secs, prev_secs, etime; + long double etime; uint64_t delta_jiffies, delta_idle; uint32_t port; long double cpu_percentage; @@ -416,11 +416,8 @@ ctlstat_standard(struct ctlstat_context if (F_CPU(ctx) && (getcpu(&ctx->cur_cpu) != 0)) errx(1, "error returned from getcpu()"); - cur_secs = ctx->cur_time.tv_sec + (ctx->cur_time.tv_nsec / 1000000000); - prev_secs = ctx->prev_time.tv_sec + - (ctx->prev_time.tv_nsec / 1000000000); - - etime = cur_secs - prev_secs; + etime = ctx->cur_time.tv_sec - ctx->prev_time.tv_sec + + (ctx->prev_time.tv_nsec - ctx->cur_time.tv_nsec) * 1e-9; if (F_CPU(ctx)) { ctx->prev_total_jiffies = ctx->cur_total_jiffies; From owner-svn-src-all@FreeBSD.ORG Fri Apr 19 05:01:15 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 87C66B47; Fri, 19 Apr 2013 05:01:15 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7AEA68C4; Fri, 19 Apr 2013 05:01:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3J51EiY056808; Fri, 19 Apr 2013 05:01:14 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3J51Eo5056807; Fri, 19 Apr 2013 05:01:14 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201304190501.r3J51Eo5056807@svn.freebsd.org> From: Tim Kientzle Date: Fri, 19 Apr 2013 05:01:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249633 - head/lib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Apr 2013 05:01:15 -0000 Author: kientzle Date: Fri Apr 19 05:01:14 2013 New Revision: 249633 URL: http://svnweb.freebsd.org/changeset/base/249633 Log: Fix the symlink creation from r249484 so that repeated installs work correctly. Suggested by Tijl Coosemans. Modified: head/lib/Makefile Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Fri Apr 19 03:55:54 2013 (r249632) +++ head/lib/Makefile Fri Apr 19 05:01:14 2013 (r249633) @@ -253,6 +253,6 @@ _libusb= libusb .endif afterinstall: - ln -fs ../include ${DESTDIR}/usr/lib/include + ln -fs ../include ${DESTDIR}/usr/lib/ .include From owner-svn-src-all@FreeBSD.ORG Fri Apr 19 05:13:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5B76FD6D; Fri, 19 Apr 2013 05:13:58 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4D648905; Fri, 19 Apr 2013 05:13:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3J5DwrI060632; Fri, 19 Apr 2013 05:13:58 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3J5DwFc060631; Fri, 19 Apr 2013 05:13:58 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201304190513.r3J5DwFc060631@svn.freebsd.org> From: Tim Kientzle Date: Fri, 19 Apr 2013 05:13:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249634 - head/lib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Apr 2013 05:13:58 -0000 Author: kientzle Date: Fri Apr 19 05:13:57 2013 New Revision: 249634 URL: http://svnweb.freebsd.org/changeset/base/249634 Log: An even more refined version of r249484, until we can come up with a good fix for the -print-file-name=include breakage. As suggested by Andrey Chernov. Modified: head/lib/Makefile Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Fri Apr 19 05:01:14 2013 (r249633) +++ head/lib/Makefile Fri Apr 19 05:13:57 2013 (r249634) @@ -253,6 +253,6 @@ _libusb= libusb .endif afterinstall: - ln -fs ../include ${DESTDIR}/usr/lib/ + ln -hfs ../include ${DESTDIR}/usr/lib/include .include From owner-svn-src-all@FreeBSD.ORG Fri Apr 19 05:28:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C917FF7B; Fri, 19 Apr 2013 05:28:08 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BB51793D; Fri, 19 Apr 2013 05:28:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3J5S8K6064248; Fri, 19 Apr 2013 05:28:08 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3J5S8Sa064247; Fri, 19 Apr 2013 05:28:08 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201304190528.r3J5S8Sa064247@svn.freebsd.org> From: Sean Bruno Date: Fri, 19 Apr 2013 05:28:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249635 - stable/9/sys/dev/ciss X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Apr 2013 05:28:08 -0000 Author: sbruno Date: Fri Apr 19 05:28:08 2013 New Revision: 249635 URL: http://svnweb.freebsd.org/changeset/base/249635 Log: MFC r249170 Notify CAM on state* change to a logical volume not status. This resolves the issues reported regarding camcontrol devlist not showing the rebuild states of volumes unless an explicit camcontrol rescan was executed. Modified: stable/9/sys/dev/ciss/ciss.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/ciss/ciss.c ============================================================================== --- stable/9/sys/dev/ciss/ciss.c Fri Apr 19 05:13:57 2013 (r249634) +++ stable/9/sys/dev/ciss/ciss.c Fri Apr 19 05:28:08 2013 (r249635) @@ -3965,7 +3965,8 @@ static void ciss_notify_logical(struct ciss_softc *sc, struct ciss_notify *cn) { struct ciss_ldrive *ld; - int ostatus, bus, target; + int bus, target; + int rescan_ld; debug_called(2); @@ -3988,7 +3989,6 @@ ciss_notify_logical(struct ciss_softc *s /* * Update our idea of the drive's status. */ - ostatus = ciss_decode_ldrive_status(cn->data.logical_status.previous_state); ld->cl_status = ciss_decode_ldrive_status(cn->data.logical_status.new_state); if (ld->cl_lstatus != NULL) ld->cl_lstatus->status = cn->data.logical_status.new_state; @@ -3996,7 +3996,9 @@ ciss_notify_logical(struct ciss_softc *s /* * Have CAM rescan the drive if its status has changed. */ - if (ostatus != ld->cl_status) { + rescan_ld = (cn->data.logical_status.previous_state != + cn->data.logical_status.new_state) ? 1 : 0; + if (rescan_ld) { ld->cl_update = 1; ciss_notify_rescan_logical(sc); } From owner-svn-src-all@FreeBSD.ORG Fri Apr 19 05:46:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 82208416; Fri, 19 Apr 2013 05:46:17 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 73B259B8; Fri, 19 Apr 2013 05:46:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3J5kHFm070050; Fri, 19 Apr 2013 05:46:17 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3J5kH7O070049; Fri, 19 Apr 2013 05:46:17 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201304190546.r3J5kH7O070049@svn.freebsd.org> From: Justin Hibbits Date: Fri, 19 Apr 2013 05:46:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249636 - head/sys/modules/uart X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Apr 2013 05:46:17 -0000 Author: jhibbits Date: Fri Apr 19 05:46:16 2013 New Revision: 249636 URL: http://svnweb.freebsd.org/changeset/base/249636 Log: Fix the uart(4) module build. Without uart_dev_lpc the module cannot be loaded. Modified: head/sys/modules/uart/Makefile Modified: head/sys/modules/uart/Makefile ============================================================================== --- head/sys/modules/uart/Makefile Fri Apr 19 05:28:08 2013 (r249635) +++ head/sys/modules/uart/Makefile Fri Apr 19 05:46:16 2013 (r249636) @@ -23,7 +23,7 @@ KMOD= uart SRCS= uart_bus_acpi.c ${uart_bus_ebus} uart_bus_isa.c uart_bus_pccard.c \ uart_bus_pci.c uart_bus_puc.c uart_bus_scc.c \ uart_core.c ${uart_cpu_machine} uart_dbg.c \ - uart_dev_ns8250.c uart_dev_quicc.c uart_dev_sab82532.c \ + uart_dev_lpc.c uart_dev_ns8250.c uart_dev_quicc.c uart_dev_sab82532.c \ uart_dev_z8530.c \ uart_if.c uart_if.h uart_subr.c uart_tty.c From owner-svn-src-all@FreeBSD.ORG Fri Apr 19 05:49:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 10A2A763; Fri, 19 Apr 2013 05:49:57 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0074A9C8; Fri, 19 Apr 2013 05:49:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3J5nuRC070578; Fri, 19 Apr 2013 05:49:56 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3J5nsIC070560; Fri, 19 Apr 2013 05:49:54 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201304190549.r3J5nsIC070560@svn.freebsd.org> From: Jung-uk Kim Date: Fri, 19 Apr 2013 05:49:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r249637 - in vendor-sys/acpica/dist: . generate/unix generate/unix/acpiexec source/compiler source/components/debugger source/components/events source/components/executer source/compone... X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Apr 2013 05:49:57 -0000 Author: jkim Date: Fri Apr 19 05:49:53 2013 New Revision: 249637 URL: http://svnweb.freebsd.org/changeset/base/249637 Log: Import ACPICA 20130418. Added: vendor-sys/acpica/dist/source/components/namespace/nsarguments.c (contents, props changed) Modified: vendor-sys/acpica/dist/changes.txt vendor-sys/acpica/dist/generate/unix/Makefile.config vendor-sys/acpica/dist/generate/unix/acpiexec/Makefile vendor-sys/acpica/dist/source/compiler/aslpredef.c vendor-sys/acpica/dist/source/compiler/aslprepkg.c vendor-sys/acpica/dist/source/components/debugger/dbdisply.c vendor-sys/acpica/dist/source/components/debugger/dbexec.c vendor-sys/acpica/dist/source/components/debugger/dbmethod.c vendor-sys/acpica/dist/source/components/debugger/dbnames.c vendor-sys/acpica/dist/source/components/events/evgpe.c vendor-sys/acpica/dist/source/components/events/evregion.c vendor-sys/acpica/dist/source/components/executer/exconfig.c vendor-sys/acpica/dist/source/components/executer/exfldio.c vendor-sys/acpica/dist/source/components/hardware/hwxface.c vendor-sys/acpica/dist/source/components/namespace/nseval.c vendor-sys/acpica/dist/source/components/namespace/nsinit.c vendor-sys/acpica/dist/source/components/namespace/nspredef.c vendor-sys/acpica/dist/source/components/namespace/nsprepkg.c vendor-sys/acpica/dist/source/components/namespace/nsrepair.c vendor-sys/acpica/dist/source/components/namespace/nsrepair2.c vendor-sys/acpica/dist/source/components/namespace/nsxfeval.c vendor-sys/acpica/dist/source/components/parser/psxface.c vendor-sys/acpica/dist/source/components/resources/rsutils.c vendor-sys/acpica/dist/source/components/utilities/uteval.c vendor-sys/acpica/dist/source/components/utilities/utosi.c vendor-sys/acpica/dist/source/components/utilities/utpredef.c vendor-sys/acpica/dist/source/components/utilities/utxferror.c vendor-sys/acpica/dist/source/include/acconfig.h vendor-sys/acpica/dist/source/include/aclocal.h vendor-sys/acpica/dist/source/include/acmacros.h vendor-sys/acpica/dist/source/include/acnamesp.h vendor-sys/acpica/dist/source/include/acoutput.h vendor-sys/acpica/dist/source/include/acpixf.h vendor-sys/acpica/dist/source/include/acpredef.h vendor-sys/acpica/dist/source/include/acstruct.h vendor-sys/acpica/dist/source/include/acutils.h vendor-sys/acpica/dist/source/os_specific/service_layers/oswinxf.c vendor-sys/acpica/dist/source/tools/acpiexec/aehandlers.c vendor-sys/acpica/dist/source/tools/acpiexec/aemain.c Modified: vendor-sys/acpica/dist/changes.txt ============================================================================== --- vendor-sys/acpica/dist/changes.txt Fri Apr 19 05:46:16 2013 (r249636) +++ vendor-sys/acpica/dist/changes.txt Fri Apr 19 05:49:53 2013 (r249637) @@ -1,4 +1,91 @@ ---------------------------------------- +18 April 2013. Summary of changes for version 20130418: + +This release is available at https://acpica.org/downloads + + +1) ACPICA kernel-resident subsystem: + +Fixed a possible buffer overrun during some rare but specific field unit +read operations. This overrun can only happen if the DSDT version is 1 -- +meaning that all AML integers are 32 bits -- and the field length is +between 33 and 55 bits long. During the read, an internal buffer object is +created for the field unit because the field is larger than an integer (32 +bits). However, in this case, the buffer will be incorrectly written +beyond the end because the buffer length is less than the internal minimum +of 64 bits (8 bytes) long. The buffer will be either 5, 6, or 7 bytes +long, but a full 8 bytes will be written. + +Updated the Embedded Controller "orphan" _REG method support. This refers +to _REG methods under the EC device that have no corresponding operation +region. This is allowed by the ACPI specification. This update removes a +dependency on the existence an ECDT table. It will execute an orphan _REG +method as long as the operation region handler for the EC is installed at +the EC device node and not the namespace root. Rui Zhang (original +update), Bob Moore (update/integrate). + +Implemented run-time argument typechecking for all predefined ACPI names +(_STA, _BIF, etc.) This change performs object typechecking on all +incoming arguments for all predefined names executed via +AcpiEvaluateObject. This ensures that ACPI-related device drivers are +passing correct object types as well as the correct number of arguments +(therefore identifying any issues immediately). Also, the ASL/namespace +definition of the predefined name is checked against the ACPI +specification for the proper argument count. Adds one new file, +nsarguments.c + +Changed an exception code for the ASL UnLoad() operator. Changed the +exception code for the case where the input DdbHandle is invalid, from +AE_BAD_PARAMETER to the more appropriate AE_AML_OPERAND_TYPE. + +Unix/Linux makefiles: Removed the use of the -O2 optimization flag in the +global makefile. The use of this flag causes compiler errors on earlier +versions of GCC, so it has been removed for compatibility. + +Miscellaneous cleanup: +1) Removed some unused/obsolete macros +2) Fixed a possible memory leak in the _OSI support +3) Removed an unused variable in the predefined name support +4) Windows OSL: remove obsolete reference to a memory list field + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and +has a much larger code and data size. + + Current Release: + Non-Debug Version: 95.2K Code, 26.4K Data, 121.6K Total + Debug Version: 183.0K Code, 76.0K Data, 259.0K Total + Previous Release: + Non-Debug Version: 95.6K Code, 26.8K Data, 122.4K Total + Debug Version: 183.5K Code, 76.6K Data, 260.1K Total + + +2) iASL Compiler/Disassembler and Tools: + +AcpiExec: Added installation of a handler for the SystemCMOS address +space. This prevents control method abort if a method accesses this space. + +AcpiExec: Added support for multiple EC devices, and now install EC +operation region handler(s) at the actual EC device instead of the +namespace root. This reflects the typical behavior of host operating +systems. + +AcpiExec: Updated to ensure that all operation region handlers are +installed before the _REG methods are executed. This prevents a _REG +method from aborting if it accesses an address space has no handler. +AcpiExec installs a handler for every possible address space. + +Debugger: Enhanced the "handlers" command to display non-root handlers. +This change enhances the handlers command to display handlers associated +with individual devices throughout the namespace, in addition to the +currently supported display of handlers associated with the root namespace +node. + +ASL Test Suite: Several test suite errors have been identified and +resolved, reducing the total error count during execution. Chao Guan. + +---------------------------------------- 28 March 2013. Summary of changes for version 20130328: 1) ACPICA kernel-resident subsystem: Modified: vendor-sys/acpica/dist/generate/unix/Makefile.config ============================================================================== --- vendor-sys/acpica/dist/generate/unix/Makefile.config Fri Apr 19 05:46:16 2013 (r249636) +++ vendor-sys/acpica/dist/generate/unix/Makefile.config Fri Apr 19 05:49:53 2013 (r249637) @@ -27,9 +27,6 @@ # $(BITS) must be set to either 32 or 64 # gcc should be version 4 or greater, otherwise some of the options # used will not be recognized. -# Global optimization flags (such as -O2, -Os) may cause issues on -# some compilers. -# The _GNU_SOURCE symbol is required for many hosts. # .SUFFIXES : PROGS = acpibin acpiexec acpihelp acpinames acpisrc acpixtract iasl @@ -106,9 +103,13 @@ ACPICA_HEADERS = \ # # Common compiler flags # +# Flags/option notes: +# Global optimization flags (such as -O2, -Os) are not used, +# since they cause issues on some compilers (such as gcc 4.4) +# The _GNU_SOURCE symbol is required for many hosts. +# OPT_CFLAGS ?= \ -D_FORTIFY_SOURCE=2\ - -O2\ $(CWARNINGFLAGS) CFLAGS += \ Modified: vendor-sys/acpica/dist/generate/unix/acpiexec/Makefile ============================================================================== --- vendor-sys/acpica/dist/generate/unix/acpiexec/Makefile Fri Apr 19 05:46:16 2013 (r249636) +++ vendor-sys/acpica/dist/generate/unix/acpiexec/Makefile Fri Apr 19 05:49:53 2013 (r249637) @@ -131,6 +131,7 @@ OBJECTS = \ $(OBJDIR)/hwxfsleep.o\ $(OBJDIR)/nsaccess.o\ $(OBJDIR)/nsalloc.o\ + $(OBJDIR)/nsarguments.o\ $(OBJDIR)/nsconvert.o\ $(OBJDIR)/nsdump.o\ $(OBJDIR)/nsdumpdv.o\ Modified: vendor-sys/acpica/dist/source/compiler/aslpredef.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslpredef.c Fri Apr 19 05:46:16 2013 (r249636) +++ vendor-sys/acpica/dist/source/compiler/aslpredef.c Fri Apr 19 05:49:53 2013 (r249637) @@ -124,29 +124,30 @@ ApCheckForPredefinedMethod ( default: /* - * Matched a predefined method name + * Matched a predefined method name - validate the ASL-defined + * argument count against the ACPI specification. * - * Validate the ASL-defined argument count. Allow two different legal - * arg counts. + * Some methods are allowed to have a "minimum" number of args + * (_SCP) because their definition in ACPI has changed over time. */ Gbl_ReservedMethods++; ThisName = &AcpiGbl_PredefinedMethods[Index]; - RequiredArgCount = ThisName->Info.ArgumentList & METHOD_ARG_MASK; + RequiredArgCount = METHOD_GET_ARG_COUNT (ThisName->Info.ArgumentList); if (MethodInfo->NumArguments != RequiredArgCount) { sprintf (MsgBuffer, "%4.4s requires %u", ThisName->Info.Name, RequiredArgCount); - if ((MethodInfo->NumArguments > RequiredArgCount) && - !(ThisName->Info.ArgumentList & ARG_COUNT_IS_MINIMUM)) + if (MethodInfo->NumArguments < RequiredArgCount) { - AslError (ASL_WARNING, ASL_MSG_RESERVED_ARG_COUNT_HI, Op, + AslError (ASL_WARNING, ASL_MSG_RESERVED_ARG_COUNT_LO, Op, MsgBuffer); } - else + else if ((MethodInfo->NumArguments > RequiredArgCount) && + !(ThisName->Info.ArgumentList & ARG_COUNT_IS_MINIMUM)) { - AslError (ASL_WARNING, ASL_MSG_RESERVED_ARG_COUNT_LO, Op, + AslError (ASL_WARNING, ASL_MSG_RESERVED_ARG_COUNT_HI, Op, MsgBuffer); } } @@ -388,7 +389,7 @@ ApCheckForPredefinedObject ( * it must be implemented as a control method */ ThisName = &AcpiGbl_PredefinedMethods[Index]; - if ((ThisName->Info.ArgumentList & METHOD_ARG_MASK) > 0) + if (METHOD_GET_ARG_COUNT (ThisName->Info.ArgumentList) > 0) { AslError (ASL_ERROR, ASL_MSG_RESERVED_METHOD, Op, "with arguments"); Modified: vendor-sys/acpica/dist/source/compiler/aslprepkg.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslprepkg.c Fri Apr 19 05:46:16 2013 (r249636) +++ vendor-sys/acpica/dist/source/compiler/aslprepkg.c Fri Apr 19 05:49:53 2013 (r249637) @@ -54,12 +54,12 @@ static void ApCheckPackageElements ( - const char *PredefinedName, - ACPI_PARSE_OBJECT *Op, - UINT8 Type1, - UINT32 Count1, - UINT8 Type2, - UINT32 Count2); + const char *PredefinedName, + ACPI_PARSE_OBJECT *Op, + UINT8 Type1, + UINT32 Count1, + UINT8 Type2, + UINT32 Count2); static void ApCheckPackageList ( @@ -93,8 +93,9 @@ ApPackageTooLarge ( * * FUNCTION: ApCheckPackage * - * PARAMETERS: ParentOp - Parser op for the package - * Predefined - Pointer to package-specific info for method + * PARAMETERS: ParentOp - Parser op for the package + * Predefined - Pointer to package-specific info for + * the method * * RETURN: None * @@ -193,8 +194,8 @@ ApCheckPackage ( case ACPI_PTYPE1_VAR: /* - * The package count is variable, there are no sub-packages, and all - * elements must be of the same type + * The package count is variable, there are no sub-packages, + * and all elements must be of the same type */ for (i = 0; i < Count; i++) { @@ -206,9 +207,9 @@ ApCheckPackage ( case ACPI_PTYPE1_OPTION: /* - * The package count is variable, there are no sub-packages. There are - * a fixed number of required elements, and a variable number of - * optional elements. + * The package count is variable, there are no sub-packages. + * There are a fixed number of required elements, and a variable + * number of optional elements. * * Check if package is at least as large as the minimum required */ @@ -268,8 +269,8 @@ ApCheckPackage ( if (ACPI_SUCCESS (Status)) { /* - * Count cannot be larger than the parent package length, but allow it - * to be smaller. The >= accounts for the Integer above. + * Count cannot be larger than the parent package length, but + * allow it to be smaller. The >= accounts for the Integer above. */ ExpectedCount = (UINT32) Op->Asl.Value.Integer; if (ExpectedCount >= Count) @@ -320,12 +321,12 @@ PackageTooSmall: * * FUNCTION: ApCheckPackageElements * - * PARAMETERS: PredefinedName - Pointer to validation data structure - * Op - Parser op for the package - * Type1 - Object type for first group - * Count1 - Count for first group - * Type2 - Object type for second group - * Count2 - Count for second group + * PARAMETERS: PredefinedName - Name of the predefined object + * Op - Parser op for the package + * Type1 - Object type for first group + * Count1 - Count for first group + * Type2 - Object type for second group + * Count2 - Count for second group * * RETURN: None * Modified: vendor-sys/acpica/dist/source/components/debugger/dbdisply.c ============================================================================== --- vendor-sys/acpica/dist/source/components/debugger/dbdisply.c Fri Apr 19 05:46:16 2013 (r249636) +++ vendor-sys/acpica/dist/source/components/debugger/dbdisply.c Fri Apr 19 05:49:53 2013 (r249637) @@ -68,6 +68,12 @@ static void * AcpiDbGetPointer ( void *Target); +static ACPI_STATUS +AcpiDbDisplayNonRootHandlers ( + ACPI_HANDLE ObjHandle, + UINT32 NestingLevel, + void *Context, + void **ReturnValue); /* * System handler information. @@ -76,6 +82,7 @@ AcpiDbGetPointer ( #define ACPI_PREDEFINED_PREFIX "%25s (%.2X) : " #define ACPI_HANDLER_NAME_STRING "%30s : " #define ACPI_HANDLER_PRESENT_STRING "%-9s (%p)\n" +#define ACPI_HANDLER_PRESENT_STRING2 "%-9s (%p)" #define ACPI_HANDLER_NOT_PRESENT_STRING "%-9s\n" /* All predefined Address Space IDs */ @@ -984,7 +991,7 @@ AcpiDbDisplayHandlers ( /* Operation region handlers */ - AcpiOsPrintf ("\nOperation Region Handlers:\n"); + AcpiOsPrintf ("\nOperation Region Handlers at the namespace root:\n"); ObjDesc = AcpiNsGetAttachedObject (AcpiGbl_RootNode); if (ObjDesc) @@ -1076,6 +1083,77 @@ AcpiDbDisplayHandlers ( AcpiOsPrintf (ACPI_HANDLER_NOT_PRESENT_STRING, "None"); } } + + + /* Other handlers that are installed throughout the namespace */ + + AcpiOsPrintf ("\nOperation Region Handlers for specific devices:\n"); + + (void) AcpiWalkNamespace (ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, + ACPI_UINT32_MAX, AcpiDbDisplayNonRootHandlers, + NULL, NULL, NULL); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiDbDisplayNonRootHandlers + * + * PARAMETERS: ACPI_WALK_CALLBACK + * + * RETURN: Status + * + * DESCRIPTION: Display information about all handlers installed for a + * device object. + * + ******************************************************************************/ + +static ACPI_STATUS +AcpiDbDisplayNonRootHandlers ( + ACPI_HANDLE ObjHandle, + UINT32 NestingLevel, + void *Context, + void **ReturnValue) +{ + ACPI_NAMESPACE_NODE *Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, ObjHandle); + ACPI_OPERAND_OBJECT *ObjDesc; + ACPI_OPERAND_OBJECT *HandlerObj; + char *Pathname; + + + ObjDesc = AcpiNsGetAttachedObject (Node); + if (!ObjDesc) + { + return (AE_OK); + } + + Pathname = AcpiNsGetExternalPathname (Node); + if (!Pathname) + { + return (AE_OK); + } + + /* Display all handlers associated with this device */ + + HandlerObj = ObjDesc->Device.Handler; + while (HandlerObj) + { + AcpiOsPrintf (ACPI_PREDEFINED_PREFIX, + AcpiUtGetRegionName ((UINT8) HandlerObj->AddressSpace.SpaceId), + HandlerObj->AddressSpace.SpaceId); + + AcpiOsPrintf (ACPI_HANDLER_PRESENT_STRING2, + (HandlerObj->AddressSpace.HandlerFlags & + ACPI_ADDR_HANDLER_DEFAULT_INSTALLED) ? "Default" : "User", + HandlerObj->AddressSpace.Handler); + + AcpiOsPrintf (" Device Name: %s (%p)\n", Pathname, Node); + + HandlerObj = HandlerObj->AddressSpace.Next; + } + + ACPI_FREE (Pathname); + return (AE_OK); } #endif /* ACPI_DEBUGGER */ Modified: vendor-sys/acpica/dist/source/components/debugger/dbexec.c ============================================================================== --- vendor-sys/acpica/dist/source/components/debugger/dbexec.c Fri Apr 19 05:46:16 2013 (r249636) +++ vendor-sys/acpica/dist/source/components/debugger/dbexec.c Fri Apr 19 05:49:53 2013 (r249637) @@ -151,8 +151,7 @@ AcpiDbExecuteMethod ( { ACPI_STATUS Status; ACPI_OBJECT_LIST ParamObjects; - ACPI_OBJECT Params[ACPI_METHOD_NUM_ARGS]; - ACPI_DEVICE_INFO *ObjInfo; + ACPI_OBJECT Params[ACPI_DEBUGGER_MAX_ARGS + 1]; UINT32 i; @@ -164,78 +163,30 @@ AcpiDbExecuteMethod ( AcpiOsPrintf ("Warning: debug output is not enabled!\n"); } - /* Get the object info for number of method parameters */ - - Status = AcpiGetObjectInfo (Info->Method, &ObjInfo); - if (ACPI_FAILURE (Status)) - { - return_ACPI_STATUS (Status); - } - + ParamObjects.Count = 0; ParamObjects.Pointer = NULL; - ParamObjects.Count = 0; - - if (ObjInfo->Type == ACPI_TYPE_METHOD) - { - /* Are there arguments to the method? */ - i = 0; - if (Info->Args && Info->Args[0]) - { - /* Get arguments passed on the command line */ + /* Pass through any command-line arguments */ - for (; Info->Args[i] && - (i < ACPI_METHOD_NUM_ARGS) && - (i < ObjInfo->ParamCount); - i++) - { - /* Convert input string (token) to an actual ACPI_OBJECT */ - - Status = AcpiDbConvertToObject (Info->Types[i], - Info->Args[i], &Params[i]); - if (ACPI_FAILURE (Status)) - { - ACPI_EXCEPTION ((AE_INFO, Status, - "While parsing method arguments")); - goto Cleanup; - } - } - } - - /* Create additional "default" parameters as needed */ + if (Info->Args && Info->Args[0]) + { + /* Get arguments passed on the command line */ - if (i < ObjInfo->ParamCount) + for (i = 0; (Info->Args[i] && *(Info->Args[i])); i++) { - AcpiOsPrintf ("Adding %u arguments containing default values\n", - ObjInfo->ParamCount - i); + /* Convert input string (token) to an actual ACPI_OBJECT */ - for (; i < ObjInfo->ParamCount; i++) + Status = AcpiDbConvertToObject (Info->Types[i], + Info->Args[i], &Params[i]); + if (ACPI_FAILURE (Status)) { - switch (i) - { - case 0: - - Params[0].Type = ACPI_TYPE_INTEGER; - Params[0].Integer.Value = 0x01020304; - break; - - case 1: - - Params[1].Type = ACPI_TYPE_STRING; - Params[1].String.Length = 12; - Params[1].String.Pointer = "AML Debugger"; - break; - - default: - - Params[i].Type = ACPI_TYPE_INTEGER; - Params[i].Integer.Value = i * (UINT64) 0x1000; - break; - } + ACPI_EXCEPTION ((AE_INFO, Status, + "While parsing method arguments")); + goto Cleanup; } } - ParamObjects.Count = ObjInfo->ParamCount; + ParamObjects.Count = i; ParamObjects.Pointer = Params; } @@ -247,8 +198,8 @@ AcpiDbExecuteMethod ( /* Do the actual method execution */ AcpiGbl_MethodExecuting = TRUE; - Status = AcpiEvaluateObject (NULL, - Info->Pathname, &ParamObjects, ReturnObj); + Status = AcpiEvaluateObject (NULL, Info->Pathname, + &ParamObjects, ReturnObj); AcpiGbl_CmSingleStep = FALSE; AcpiGbl_MethodExecuting = FALSE; @@ -267,9 +218,7 @@ AcpiDbExecuteMethod ( } Cleanup: - AcpiDbDeleteObjects (ObjInfo->ParamCount, Params); - ACPI_FREE (ObjInfo); - + AcpiDbDeleteObjects (ParamObjects.Count, Params); return_ACPI_STATUS (Status); } Modified: vendor-sys/acpica/dist/source/components/debugger/dbmethod.c ============================================================================== --- vendor-sys/acpica/dist/source/components/debugger/dbmethod.c Fri Apr 19 05:46:16 2013 (r249636) +++ vendor-sys/acpica/dist/source/components/debugger/dbmethod.c Fri Apr 19 05:49:53 2013 (r249637) @@ -49,6 +49,7 @@ #include "acdebug.h" #include "acdisasm.h" #include "acparser.h" +#include "acpredef.h" #ifdef ACPI_DEBUGGER @@ -433,17 +434,23 @@ AcpiDbWalkForExecute ( void *Context, void **ReturnValue) { - ACPI_NAMESPACE_NODE *Node = (ACPI_NAMESPACE_NODE *) ObjHandle; - ACPI_DB_EXECUTE_WALK *Info = (ACPI_DB_EXECUTE_WALK *) Context; - ACPI_BUFFER ReturnObj; - ACPI_STATUS Status; - char *Pathname; - UINT32 i; - ACPI_DEVICE_INFO *ObjInfo; - ACPI_OBJECT_LIST ParamObjects; - ACPI_OBJECT Params[ACPI_METHOD_NUM_ARGS]; - const ACPI_PREDEFINED_INFO *Predefined; + ACPI_NAMESPACE_NODE *Node = (ACPI_NAMESPACE_NODE *) ObjHandle; + ACPI_DB_EXECUTE_WALK *Info = (ACPI_DB_EXECUTE_WALK *) Context; + char *Pathname; + const ACPI_PREDEFINED_INFO *Predefined; + ACPI_DEVICE_INFO *ObjInfo; + ACPI_OBJECT_LIST ParamObjects; + ACPI_OBJECT Params[ACPI_METHOD_NUM_ARGS]; + ACPI_OBJECT *ThisParam; + ACPI_BUFFER ReturnObj; + ACPI_STATUS Status; + UINT16 ArgTypeList; + UINT8 ArgCount; + UINT8 ArgType; + UINT32 i; + + /* The name must be a predefined ACPI name */ Predefined = AcpiUtMatchPredefinedMethod (Node->Name.Ascii); if (!Predefined) @@ -470,21 +477,59 @@ AcpiDbWalkForExecute ( return (Status); } + ParamObjects.Count = 0; ParamObjects.Pointer = NULL; - ParamObjects.Count = 0; if (ObjInfo->Type == ACPI_TYPE_METHOD) { - /* Setup default parameters */ + /* Setup default parameters (with proper types) */ + + ArgTypeList = Predefined->Info.ArgumentList; + ArgCount = METHOD_GET_ARG_COUNT (ArgTypeList); - for (i = 0; i < ObjInfo->ParamCount; i++) + /* + * Setup the ACPI-required number of arguments, regardless of what + * the actual method defines. If there is a difference, then the + * method is wrong and a warning will be issued during execution. + */ + ThisParam = Params; + for (i = 0; i < ArgCount; i++) { - Params[i].Type = ACPI_TYPE_INTEGER; - Params[i].Integer.Value = 1; + ArgType = METHOD_GET_NEXT_TYPE (ArgTypeList); + ThisParam->Type = ArgType; + + switch (ArgType) + { + case ACPI_TYPE_INTEGER: + ThisParam->Integer.Value = 1; + break; + + case ACPI_TYPE_STRING: + ThisParam->String.Pointer = "This is the default argument string"; + ThisParam->String.Length = ACPI_STRLEN (ThisParam->String.Pointer); + break; + + case ACPI_TYPE_BUFFER: + ThisParam->Buffer.Pointer = (UINT8 *) Params; /* just a garbage buffer */ + ThisParam->Buffer.Length = 48; + break; + + case ACPI_TYPE_PACKAGE: + ThisParam->Package.Elements = NULL; + ThisParam->Package.Count = 0; + break; + + default: + AcpiOsPrintf ("%s: Unsupported argument type: %u\n", + Pathname, ArgType); + break; + } + + ThisParam++; } - ParamObjects.Pointer = Params; - ParamObjects.Count = ObjInfo->ParamCount; + ParamObjects.Count = ArgCount; + ParamObjects.Pointer = Params; } ACPI_FREE (ObjInfo); Modified: vendor-sys/acpica/dist/source/components/debugger/dbnames.c ============================================================================== --- vendor-sys/acpica/dist/source/components/debugger/dbnames.c Fri Apr 19 05:46:16 2013 (r249636) +++ vendor-sys/acpica/dist/source/components/debugger/dbnames.c Fri Apr 19 05:49:53 2013 (r249637) @@ -435,6 +435,7 @@ AcpiDbWalkForPredefinedNames ( const ACPI_PREDEFINED_INFO *Predefined; const ACPI_PREDEFINED_INFO *Package = NULL; char *Pathname; + char StringBuffer[48]; Predefined = AcpiUtMatchPredefinedMethod (Node->Name.Ascii); @@ -456,23 +457,28 @@ AcpiDbWalkForPredefinedNames ( Package = Predefined + 1; } - AcpiOsPrintf ("%-32s arg %X ret %2.2X", Pathname, - (Predefined->Info.ArgumentList & METHOD_ARG_MASK), + AcpiUtGetExpectedReturnTypes (StringBuffer, Predefined->Info.ExpectedBtypes); + AcpiOsPrintf ("%-32s Arguments %X, Return Types: %s", Pathname, + METHOD_GET_ARG_COUNT (Predefined->Info.ArgumentList), + StringBuffer); + if (Package) { - AcpiOsPrintf (" PkgType %2.2X ObjType %2.2X Count %2.2X", + AcpiOsPrintf (" (PkgType %2.2X, ObjType %2.2X, Count %2.2X)", Package->RetInfo.Type, Package->RetInfo.ObjectType1, Package->RetInfo.Count1); } AcpiOsPrintf("\n"); - AcpiNsCheckParameterCount (Pathname, Node, ACPI_UINT32_MAX, Predefined); + /* Check that the declared argument count matches the ACPI spec */ + + AcpiNsCheckAcpiCompliance (Pathname, Node, Predefined); + ACPI_FREE (Pathname); (*Count)++; - return (AE_OK); } Modified: vendor-sys/acpica/dist/source/components/events/evgpe.c ============================================================================== --- vendor-sys/acpica/dist/source/components/events/evgpe.c Fri Apr 19 05:46:16 2013 (r249636) +++ vendor-sys/acpica/dist/source/components/events/evgpe.c Fri Apr 19 05:49:53 2013 (r249637) @@ -628,7 +628,6 @@ AcpiEvAsynchExecuteGpeMethod ( "while evaluating GPE method [%4.4s]", AcpiUtGetNodeName (LocalGpeEventInfo->Dispatch.MethodNode))); } - break; default: Modified: vendor-sys/acpica/dist/source/components/events/evregion.c ============================================================================== --- vendor-sys/acpica/dist/source/components/events/evregion.c Fri Apr 19 05:46:16 2013 (r249636) +++ vendor-sys/acpica/dist/source/components/events/evregion.c Fri Apr 19 05:49:53 2013 (r249637) @@ -60,7 +60,7 @@ extern UINT8 AcpiGbl_DefaultAddre static void AcpiEvOrphanEcRegMethod ( - void); + ACPI_NAMESPACE_NODE *EcDeviceNode); static ACPI_STATUS AcpiEvRegRun ( @@ -564,7 +564,7 @@ AcpiEvExecuteRegMethod ( } Info->PrefixNode = RegionObj2->Extra.Method_REG; - Info->Pathname = NULL; + Info->RelativePathname = NULL; Info->Parameters = Args; Info->Flags = ACPI_IGNORE_RETURN_VALUE; @@ -650,7 +650,7 @@ AcpiEvExecuteRegMethods ( if (SpaceId == ACPI_ADR_SPACE_EC) { - AcpiEvOrphanEcRegMethod (); + AcpiEvOrphanEcRegMethod (Node); } return_ACPI_STATUS (Status); @@ -728,7 +728,7 @@ AcpiEvRegRun ( * * FUNCTION: AcpiEvOrphanEcRegMethod * - * PARAMETERS: None + * PARAMETERS: EcDeviceNode - Namespace node for an EC device * * RETURN: None * @@ -740,41 +740,30 @@ AcpiEvRegRun ( * detected by providing a _REG method object underneath the * Embedded Controller device." * - * To quickly access the EC device, we use the EC_ID that appears - * within the ECDT. Otherwise, we would need to perform a time- - * consuming namespace walk, executing _HID methods to find the - * EC device. + * To quickly access the EC device, we use the EcDeviceNode used + * during EC handler installation. Otherwise, we would need to + * perform a time consuming namespace walk, executing _HID + * methods to find the EC device. + * + * MUTEX: Assumes the namespace is locked * ******************************************************************************/ static void AcpiEvOrphanEcRegMethod ( - void) + ACPI_NAMESPACE_NODE *EcDeviceNode) { - ACPI_TABLE_ECDT *Table; + ACPI_HANDLE RegMethod; + ACPI_NAMESPACE_NODE *NextNode; ACPI_STATUS Status; ACPI_OBJECT_LIST Args; ACPI_OBJECT Objects[2]; - ACPI_NAMESPACE_NODE *EcDeviceNode; - ACPI_NAMESPACE_NODE *RegMethod; - ACPI_NAMESPACE_NODE *NextNode; ACPI_FUNCTION_TRACE (EvOrphanEcRegMethod); - /* Get the ECDT (if present in system) */ - - Status = AcpiGetTable (ACPI_SIG_ECDT, 0, - ACPI_CAST_INDIRECT_PTR (ACPI_TABLE_HEADER, &Table)); - if (ACPI_FAILURE (Status)) - { - return_VOID; - } - - /* We need a valid EC_ID string */ - - if (!(*Table->Id)) + if (!EcDeviceNode) { return_VOID; } @@ -783,23 +772,12 @@ AcpiEvOrphanEcRegMethod ( (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); - /* Get a handle to the EC device referenced in the ECDT */ - - Status = AcpiGetHandle (NULL, - ACPI_CAST_PTR (char, Table->Id), - ACPI_CAST_PTR (ACPI_HANDLE, &EcDeviceNode)); - if (ACPI_FAILURE (Status)) - { - goto Exit; - } - /* Get a handle to a _REG method immediately under the EC device */ - Status = AcpiGetHandle (EcDeviceNode, - METHOD_NAME__REG, ACPI_CAST_PTR (ACPI_HANDLE, &RegMethod)); + Status = AcpiGetHandle (EcDeviceNode, METHOD_NAME__REG, &RegMethod); if (ACPI_FAILURE (Status)) { - goto Exit; + goto Exit; /* There is no _REG method present */ } /* @@ -807,7 +785,7 @@ AcpiEvOrphanEcRegMethod ( * this scope with the Embedded Controller space ID. Otherwise, it * will already have been executed. Note, this allows for Regions * with other space IDs to be present; but the code below will then - * execute the _REG method with the EC space ID argument. + * execute the _REG method with the EmbeddedControl SpaceID argument. */ NextNode = AcpiNsGetNextNode (EcDeviceNode, NULL); while (NextNode) @@ -816,12 +794,13 @@ AcpiEvOrphanEcRegMethod ( (NextNode->Object) && (NextNode->Object->Region.SpaceId == ACPI_ADR_SPACE_EC)) { - goto Exit; /* Do not execute _REG */ + goto Exit; /* Do not execute the _REG */ } + NextNode = AcpiNsGetNextNode (EcDeviceNode, NextNode); } - /* Evaluate the _REG(EC,Connect) method */ + /* Evaluate the _REG(EmbeddedControl,Connect) method */ Args.Count = 2; Args.Pointer = Objects; Modified: vendor-sys/acpica/dist/source/components/executer/exconfig.c ============================================================================== --- vendor-sys/acpica/dist/source/components/executer/exconfig.c Fri Apr 19 05:46:16 2013 (r249636) +++ vendor-sys/acpica/dist/source/components/executer/exconfig.c Fri Apr 19 05:49:53 2013 (r249637) @@ -643,7 +643,7 @@ AcpiExUnloadTable ( (DdbHandle->Common.Type != ACPI_TYPE_LOCAL_REFERENCE) || (!(DdbHandle->Common.Flags & AOPOBJ_DATA_VALID))) { - return_ACPI_STATUS (AE_BAD_PARAMETER); + return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } /* Get the table index from the DdbHandle */ Modified: vendor-sys/acpica/dist/source/components/executer/exfldio.c ============================================================================== --- vendor-sys/acpica/dist/source/components/executer/exfldio.c Fri Apr 19 05:46:16 2013 (r249636) +++ vendor-sys/acpica/dist/source/components/executer/exfldio.c Fri Apr 19 05:49:53 2013 (r249637) @@ -766,7 +766,18 @@ AcpiExExtractFromField ( if ((ObjDesc->CommonField.StartFieldBitOffset == 0) && (ObjDesc->CommonField.BitLength == AccessBitWidth)) { - Status = AcpiExFieldDatumIo (ObjDesc, 0, Buffer, ACPI_READ); + if (BufferLength >= sizeof (UINT64)) + { + Status = AcpiExFieldDatumIo (ObjDesc, 0, Buffer, ACPI_READ); + } + else + { + /* Use RawDatum (UINT64) to handle buffers < 64 bits */ + + Status = AcpiExFieldDatumIo (ObjDesc, 0, &RawDatum, ACPI_READ); + ACPI_MEMCPY (Buffer, &RawDatum, BufferLength); + } + return_ACPI_STATUS (Status); } Modified: vendor-sys/acpica/dist/source/components/hardware/hwxface.c ============================================================================== --- vendor-sys/acpica/dist/source/components/hardware/hwxface.c Fri Apr 19 05:46:16 2013 (r249636) +++ vendor-sys/acpica/dist/source/components/hardware/hwxface.c Fri Apr 19 05:49:53 2013 (r249637) @@ -556,7 +556,8 @@ AcpiGetSleepTypeData ( * Evaluate the \_Sx namespace object containing the register values * for this state */ - Info->Pathname = ACPI_CAST_PTR (char, AcpiGbl_SleepStateNames[SleepState]); + Info->RelativePathname = ACPI_CAST_PTR ( + char, AcpiGbl_SleepStateNames[SleepState]); Status = AcpiNsEvaluate (Info); if (ACPI_FAILURE (Status)) { @@ -568,7 +569,7 @@ AcpiGetSleepTypeData ( if (!Info->ReturnObject) { ACPI_ERROR ((AE_INFO, "No Sleep State object returned from [%s]", - Info->Pathname)); + Info->RelativePathname)); Status = AE_AML_NO_RETURN_VALUE; goto Cleanup; } @@ -630,7 +631,7 @@ Cleanup: if (ACPI_FAILURE (Status)) { ACPI_EXCEPTION ((AE_INFO, Status, - "While evaluating Sleep State [%s]", Info->Pathname)); + "While evaluating Sleep State [%s]", Info->RelativePathname)); } ACPI_FREE (Info); Added: vendor-sys/acpica/dist/source/components/namespace/nsarguments.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor-sys/acpica/dist/source/components/namespace/nsarguments.c Fri Apr 19 05:49:53 2013 (r249637) @@ -0,0 +1,303 @@ +/****************************************************************************** + * + * Module Name: nsarguments - Validation of args for ACPI predefined methods + * + *****************************************************************************/ + +/* + * Copyright (C) 2000 - 2013, Intel Corp. + * 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, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * substantially similar to the "NO WARRANTY" disclaimer below + * ("Disclaimer") and any redistribution must be conditioned upon + * including a substantially similar Disclaimer requirement for further + * binary redistribution. + * 3. Neither the names of the above-listed copyright holders nor the names + * of any 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") version 2 as published by the Free + * Software Foundation. + * + * NO WARRANTY + * 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 MERCHANTIBILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES. + */ + +#include "acpi.h" +#include "accommon.h" +#include "acnamesp.h" +#include "acpredef.h" + + +#define _COMPONENT ACPI_NAMESPACE + ACPI_MODULE_NAME ("nsarguments") + + +/******************************************************************************* + * + * FUNCTION: AcpiNsCheckArgumentTypes + * + * PARAMETERS: Info - Method execution information block + * + * RETURN: None + * + * DESCRIPTION: Check the incoming argument count and all argument types + * against the argument type list for a predefined name. + * + ******************************************************************************/ + +void +AcpiNsCheckArgumentTypes ( + ACPI_EVALUATE_INFO *Info) +{ + UINT16 ArgTypeList; + UINT8 ArgCount; + UINT8 ArgType; + UINT8 UserArgType; + UINT32 i; + + + /* If not a predefined name, cannot typecheck args */ + + if (!Info->Predefined) + { + return; + } + + ArgTypeList = Info->Predefined->Info.ArgumentList; + ArgCount = METHOD_GET_ARG_COUNT (ArgTypeList); + + /* Typecheck all arguments */ + + for (i = 0; ((i < ArgCount) && (i < Info->ParamCount)); i++) + { + ArgType = METHOD_GET_NEXT_TYPE (ArgTypeList); + UserArgType = Info->Parameters[i]->Common.Type; + + if (UserArgType != ArgType) + { + ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname, ACPI_WARN_ALWAYS, + "Argument #%u type mismatch - " + "Found [%s], ACPI requires [%s]", (i + 1), + AcpiUtGetTypeName (UserArgType), + AcpiUtGetTypeName (ArgType))); + } + } +} + + +/******************************************************************************* + * + * FUNCTION: AcpiNsCheckAcpiCompliance + * + * PARAMETERS: Pathname - Full pathname to the node (for error msgs) + * Node - Namespace node for the method/object + * Predefined - Pointer to entry in predefined name table + * + * RETURN: None + * + * DESCRIPTION: Check that the declared parameter count (in ASL/AML) for a + * predefined name is what is expected (matches what is defined in + * the ACPI specification for this predefined name.) + * + ******************************************************************************/ + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Apr 19 05:50:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6AFF98D8; Fri, 19 Apr 2013 05:50:58 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 43F749D4; Fri, 19 Apr 2013 05:50:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3J5owcg072353; Fri, 19 Apr 2013 05:50:58 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3J5owUP072352; Fri, 19 Apr 2013 05:50:58 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201304190550.r3J5owUP072352@svn.freebsd.org> From: Jung-uk Kim Date: Fri, 19 Apr 2013 05:50:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r249638 - vendor-sys/acpica/20130418 X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Apr 2013 05:50:58 -0000 Author: jkim Date: Fri Apr 19 05:50:57 2013 New Revision: 249638 URL: http://svnweb.freebsd.org/changeset/base/249638 Log: Tag ACPICA 20130418. Added: vendor-sys/acpica/20130418/ - copied from r249637, vendor-sys/acpica/dist/ From owner-svn-src-all@FreeBSD.ORG Fri Apr 19 06:59:11 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3AF4648D; Fri, 19 Apr 2013 06:59:11 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2C8D8C3C; Fri, 19 Apr 2013 06:59:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3J6xBHO091782; Fri, 19 Apr 2013 06:59:11 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3J6xABE091780; Fri, 19 Apr 2013 06:59:10 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201304190659.r3J6xABE091780@svn.freebsd.org> From: Adrian Chadd Date: Fri, 19 Apr 2013 06:59:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249639 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Apr 2013 06:59:11 -0000 Author: adrian Date: Fri Apr 19 06:59:10 2013 New Revision: 249639 URL: http://svnweb.freebsd.org/changeset/base/249639 Log: Use uint32_t for fields that are fetched via ath_hal_getcapability(). Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Fri Apr 19 05:50:57 2013 (r249638) +++ head/sys/dev/ath/if_ath.c Fri Apr 19 06:59:10 2013 (r249639) @@ -739,7 +739,7 @@ ath_attach(u_int16_t devid, struct ath_s */ if (ath_hal_getcapability(ah, HAL_CAP_HT, 0, NULL) == HAL_OK && (wmodes & (HAL_MODE_HT20 | HAL_MODE_HT40))) { - int rxs, txs; + uint32_t rxs, txs; device_printf(sc->sc_dev, "[HT] enabling HT modes\n"); Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Fri Apr 19 05:50:57 2013 (r249638) +++ head/sys/dev/ath/if_athvar.h Fri Apr 19 06:59:10 2013 (r249639) @@ -772,11 +772,11 @@ struct ath_softc { u_int32_t sc_avgtsfdeltap;/* TDMA slot adjust (+) */ u_int32_t sc_avgtsfdeltam;/* TDMA slot adjust (-) */ uint16_t *sc_eepromdata; /* Local eeprom data, if AR9100 */ - int sc_txchainmask; /* hardware TX chainmask */ - int sc_rxchainmask; /* hardware RX chainmask */ - int sc_cur_txchainmask; /* currently configured TX chainmask */ - int sc_cur_rxchainmask; /* currently configured RX chainmask */ - int sc_rts_aggr_limit; /* TX limit on RTS aggregates */ + uint32_t sc_txchainmask; /* hardware TX chainmask */ + uint32_t sc_rxchainmask; /* hardware RX chainmask */ + uint32_t sc_cur_txchainmask; /* currently configured TX chainmask */ + uint32_t sc_cur_rxchainmask; /* currently configured RX chainmask */ + uint32_t sc_rts_aggr_limit; /* TX limit on RTS aggregates */ int sc_aggr_limit; /* TX limit on all aggregates */ int sc_delim_min_pad; /* Minimum delimiter count */ From owner-svn-src-all@FreeBSD.ORG Fri Apr 19 07:56:23 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 50A34113; Fri, 19 Apr 2013 07:56:23 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 43409F97; Fri, 19 Apr 2013 07:56:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3J7uN4Z010148; Fri, 19 Apr 2013 07:56:23 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3J7uNXd010147; Fri, 19 Apr 2013 07:56:23 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201304190756.r3J7uNXd010147@svn.freebsd.org> From: Adrian Chadd Date: Fri, 19 Apr 2013 07:56:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249640 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Apr 2013 07:56:23 -0000 Author: adrian Date: Fri Apr 19 07:56:22 2013 New Revision: 249640 URL: http://svnweb.freebsd.org/changeset/base/249640 Log: Print out the chainmask configuration. Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Fri Apr 19 06:59:10 2013 (r249639) +++ head/sys/dev/ath/if_ath.c Fri Apr 19 07:56:22 2013 (r249640) @@ -781,6 +781,11 @@ ath_attach(u_int16_t devid, struct ath_s ath_hal_getrxchainmask(ah, &sc->sc_rxchainmask); ath_hal_gettxchainmask(ah, &sc->sc_txchainmask); + device_printf(sc->sc_dev, "Chainmasks: TX=0x%x; RX=0x%x\n", + __func__, + sc->sc_txchainmask, + sc->sc_rxchainmask); + ic->ic_txstream = txs; ic->ic_rxstream = rxs; From owner-svn-src-all@FreeBSD.ORG Fri Apr 19 08:01:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 57B2D546; Fri, 19 Apr 2013 08:01:35 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4B123FF7; Fri, 19 Apr 2013 08:01:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3J81ZJl012741; Fri, 19 Apr 2013 08:01:35 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3J81Zhm012740; Fri, 19 Apr 2013 08:01:35 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201304190801.r3J81Zhm012740@svn.freebsd.org> From: Adrian Chadd Date: Fri, 19 Apr 2013 08:01:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249641 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Apr 2013 08:01:35 -0000 Author: adrian Date: Fri Apr 19 08:01:34 2013 New Revision: 249641 URL: http://svnweb.freebsd.org/changeset/base/249641 Log: .. don't know how this snuck into this commit. Sorry. Fix compile build before anyone notices. Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Fri Apr 19 07:56:22 2013 (r249640) +++ head/sys/dev/ath/if_ath.c Fri Apr 19 08:01:34 2013 (r249641) @@ -782,7 +782,6 @@ ath_attach(u_int16_t devid, struct ath_s ath_hal_gettxchainmask(ah, &sc->sc_txchainmask); device_printf(sc->sc_dev, "Chainmasks: TX=0x%x; RX=0x%x\n", - __func__, sc->sc_txchainmask, sc->sc_rxchainmask); From owner-svn-src-all@FreeBSD.ORG Fri Apr 19 08:06:45 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id ADA9F780; Fri, 19 Apr 2013 08:06:45 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A0B9DB0; Fri, 19 Apr 2013 08:06:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3J86joQ013668; Fri, 19 Apr 2013 08:06:45 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3J86jOa013667; Fri, 19 Apr 2013 08:06:45 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201304190806.r3J86jOa013667@svn.freebsd.org> From: Adrian Chadd Date: Fri, 19 Apr 2013 08:06:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249642 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Apr 2013 08:06:45 -0000 Author: adrian Date: Fri Apr 19 08:06:45 2013 New Revision: 249642 URL: http://svnweb.freebsd.org/changeset/base/249642 Log: Add a debug statement to log the currently chosen chainmask configuration. Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Fri Apr 19 08:01:34 2013 (r249641) +++ head/sys/dev/ath/if_ath.c Fri Apr 19 08:06:45 2013 (r249642) @@ -1529,6 +1529,12 @@ ath_update_chainmasks(struct ath_softc * } else { sc->sc_cur_txchainmask = 1; } + + DPRINTF(sc, ATH_DEBUG_RESET, + "%s: TX chainmask is now 0x%x, RX is now 0x%x\n", + __func__, + sc->sc_cur_txchainmask, + sc->sc_cur_rxchainmask); } void From owner-svn-src-all@FreeBSD.ORG Fri Apr 19 09:19:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0C11F866; Fri, 19 Apr 2013 09:19:12 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id ECE05697; Fri, 19 Apr 2013 09:19:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3J9JBdp035892; Fri, 19 Apr 2013 09:19:11 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3J9JA19035885; Fri, 19 Apr 2013 09:19:10 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201304190919.r3J9JA19035885@svn.freebsd.org> From: Martin Matuska Date: Fri, 19 Apr 2013 09:19:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249643 - in stable/9: . cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/cmd/zhack cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris... X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Apr 2013 09:19:12 -0000 Author: mm Date: Fri Apr 19 09:19:10 2013 New Revision: 249643 URL: http://svnweb.freebsd.org/changeset/base/249643 Log: MFC 248571,248976,249004,249042,249188,249195-249196,249206,249207,249319, 249326,249356-249357 Merge libzfs_core and other ZFS bugfixes and improvements. MFC r248571: MFV 238590, 238592: In the first zfs ioctl restructuring phase, the libzfs_core library was introduced. It is a new thin library that wraps around kernel ioctl's. The idea is to provide a forward-compatible way of dealing with new features. Arguments are passed in nvlists and not random zfs_cmd fields, new-style ioctls are logged to pool history using a new method of history logging. http://blog.delphix.com/matt/2012/01/17/the-future-of-libzfs/ MFV 247580 [1]: To address issues of several deadlocks and race conditions the locking code around dsl_dataset was rewritten and the interface to synctasks was changed. User-Visible Changes: "zfs snapshot" can create more arbitrary snapshots at once (atomically) "zfs destroy" destroys multiple snapshots at once "zfs recv" has improved performance Backward Compatibility: I have extended the compatibility layer to support full backward compatibility by remapping or rewriting the responsible ioctl arguments. Old utilities are fully supported by the new kernel module. Forward Compatibility: New utilities work with old kernels with the following restrictions: - creating, destroying, holding and releasing of multiple snapshots at once is not supported, this includes recursive (-r) commands Illumos ZFS issues: 2882 implement libzfs_core 2900 "zfs snapshot" should be able to create multiple, arbitrary snapshots at once 3464 zfs synctask code needs restructuring MFC r248976: Call dmu_snapshot_list_next() in zvol.c with dsl_pool_config lock held MFC r249004: Do not check against uninitialized rc and comment out vendor code MFC r249042: Fix possible pool hold leak in dmu_send_impl() Illumos ZFS issues: 3645 dmu_send_impl: possibilty of pool hold leak MFC r249188: Import vendor change to reduce diff, no effect on FreeBSD. Illumos ZFS issues: 3517 importing pool with autoreplace=on and "hole" vdevs crashes syseventd MFC r249195: Merge change from vendor to reduce diff only. ZFS dtrace probes are not supported on FreeBSD yet. Illumos ZFS issues: 3598 want to dtrace when errors are generated in zfs MFC r249196: Provide a fix for kernel panic if receiving recursive deduplicated streams. Problem reported to vendor. Illumos ZFS issues: 3692 Panic on zfs receive of a recursive deduplicated stream MFC r249206: Merge vendor change - modify time processing in deadman thread. Illumos ZFS issues: 3618 ::zio dcmd does not show timestamp data MFC r249207: Allow zdb to output a histogram of compressed block sizes. Illumos ZFS issues: 3641 want a histogram of compressed block sizes MFC r249319: ZFS expects a copyout of zfs_cmd_t on an ioctl error. Our sys_ioctl() doesn't copyout in this case. To solve this a new struct zfs_iocparm_t is introduced consisting of: - zfs_ioctl_version (future backwards compatibility purposes) - user space pointer to zfs_cmd_t (copyin and copyout) - size of zfs_cmd_t (verification purposes) The copyin and copyout of zfs_cmd_t is now done the illumos (vendor) way what makes porting of new changes easier and ensures correct behavior if returning an error. MFC r249326: Cast (void *)(uintptr_t) on copyout and copyin of zfs_iocparm_t.zfs_cmd MFC r249356: Merge bugfixes accepted and integrated by vendor. Underlying problems have been reported by us and fixed in r240942 and r249196. Illumos ZFS issues: 3645 dmu_send_impl: possibilty of pool hold leak 3692 Panic on zfs receive of a recursive deduplicated stream MFC r249357: Fix libzfs to report error instead of returning zero if trying to hold or release a non-existing snapshot of a existing dataset. In recursive case error is reported if no snapshots with the requested name have been found. Illumos ZFS issues: 3699 zfs hold or release of a non-existent snapshot does not output error Added: stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_compat.c - copied, changed from r248571, head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_compat.c stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_compat.h - copied unchanged from r248571, head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_compat.h stable/9/cddl/contrib/opensolaris/lib/libzfs_core/ - copied from r248571, head/cddl/contrib/opensolaris/lib/libzfs_core/ stable/9/cddl/contrib/opensolaris/lib/libzpool/common/zfs.d - copied unchanged from r249195, head/cddl/contrib/opensolaris/lib/libzpool/common/zfs.d stable/9/cddl/lib/libzfs_core/ - copied from r248571, head/cddl/lib/libzfs_core/ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c - copied, changed from r248571, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_userhold.c - copied, changed from r248571, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_userhold.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_send.h - copied unchanged from r248571, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_send.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_destroy.h - copied unchanged from r248571, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_destroy.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_userhold.h - copied unchanged from r248571, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_userhold.h Modified: stable/9/Makefile.inc1 (contents, props changed) stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs.8 stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c stable/9/cddl/contrib/opensolaris/cmd/zhack/zhack.c stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c stable/9/cddl/contrib/opensolaris/cmd/ztest/ztest.c stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl.h stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_iter.c stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c stable/9/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c stable/9/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h stable/9/cddl/lib/Makefile stable/9/cddl/lib/libzfs/Makefile stable/9/cddl/sbin/zfs/Makefile stable/9/cddl/sbin/zpool/Makefile stable/9/cddl/usr.bin/zinject/Makefile stable/9/cddl/usr.bin/ztest/Makefile stable/9/cddl/usr.sbin/zdb/Makefile stable/9/cddl/usr.sbin/zhack/Makefile stable/9/rescue/rescue/Makefile stable/9/share/mk/bsd.libnames.mk stable/9/sys/cddl/compat/opensolaris/sys/cred.h stable/9/sys/cddl/compat/opensolaris/sys/sdt.h stable/9/sys/cddl/contrib/opensolaris/common/nvpair/fnvpair.c stable/9/sys/cddl/contrib/opensolaris/common/zfs/zfs_comutil.c stable/9/sys/cddl/contrib/opensolaris/common/zfs/zfs_comutil.h stable/9/sys/cddl/contrib/opensolaris/common/zfs/zfs_ioctl_compat.c stable/9/sys/cddl/contrib/opensolaris/common/zfs/zfs_ioctl_compat.h stable/9/sys/cddl/contrib/opensolaris/common/zfs/zprop_common.c stable/9/sys/cddl/contrib/opensolaris/uts/common/Makefile.files stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bplist.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bpobj.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_diff.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_deleg.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_prop.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_synctask.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/refcount.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/rrwlock.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_errlog.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_history.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dbuf.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_tx.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_deleg.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dir.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_prop.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_synctask.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/refcount.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/rrwlock.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/space_map.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/txg.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfeature.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/uberblock.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_cache.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_missing.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_root.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_leaf.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfeature.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_onexit.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_replay.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_checksum.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_compress.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_inject.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/feature_tests.h stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/nvpair.h Directory Properties: stable/9/cddl/ (props changed) stable/9/cddl/contrib/opensolaris/ (props changed) stable/9/cddl/contrib/opensolaris/cmd/zfs/ (props changed) stable/9/cddl/contrib/opensolaris/lib/libzfs/ (props changed) stable/9/cddl/lib/ (props changed) stable/9/rescue/rescue/ (props changed) stable/9/share/mk/ (props changed) stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) Modified: stable/9/Makefile.inc1 ============================================================================== --- stable/9/Makefile.inc1 Fri Apr 19 08:06:45 2013 (r249642) +++ stable/9/Makefile.inc1 Fri Apr 19 09:19:10 2013 (r249643) @@ -1321,6 +1321,7 @@ _prebuild_libs= ${_kerberos5_lib_libasn1 lib/libopie lib/libpam ${_lib_libthr} \ lib/libradius lib/libsbuf lib/libtacplus \ ${_cddl_lib_libumem} ${_cddl_lib_libnvpair} \ + ${_cddl_lib_libzfs_core} \ lib/libutil ${_lib_libypclnt} lib/libz lib/msun \ ${_secure_lib_libcrypto} ${_secure_lib_libssh} \ ${_secure_lib_libssl} @@ -1340,7 +1341,9 @@ lib/libopie__L lib/libtacplus__L: lib/li .if ${MK_CDDL} != "no" _cddl_lib_libumem= cddl/lib/libumem _cddl_lib_libnvpair= cddl/lib/libnvpair +_cddl_lib_libzfs_core= cddl/lib/libzfs_core _cddl_lib= cddl/lib +cddl/lib/libzfs_core__L: cddl/lib/libnvpair__L .endif .if ${MK_CRYPT} != "no" Modified: stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c Fri Apr 19 08:06:45 2013 (r249642) +++ stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c Fri Apr 19 09:19:10 2013 (r249643) @@ -21,10 +21,11 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. */ #include +#include #include #include #include @@ -57,6 +58,7 @@ #include #include #include +#include #undef ZFS_MAXNAMELEN #undef verify #include @@ -206,6 +208,27 @@ dump_packed_nvlist(objset_t *os, uint64_ nvlist_free(nv); } +/* ARGSUSED */ +static void +dump_history_offsets(objset_t *os, uint64_t object, void *data, size_t size) +{ + spa_history_phys_t *shp = data; + + if (shp == NULL) + return; + + (void) printf("\t\tpool_create_len = %llu\n", + (u_longlong_t)shp->sh_pool_create_len); + (void) printf("\t\tphys_max_off = %llu\n", + (u_longlong_t)shp->sh_phys_max_off); + (void) printf("\t\tbof = %llu\n", + (u_longlong_t)shp->sh_bof); + (void) printf("\t\teof = %llu\n", + (u_longlong_t)shp->sh_eof); + (void) printf("\t\trecords_lost = %llu\n", + (u_longlong_t)shp->sh_records_lost); +} + static void zdb_nicenum(uint64_t num, char *buf) { @@ -215,18 +238,18 @@ zdb_nicenum(uint64_t num, char *buf) nicenum(num, buf); } -const char dump_zap_stars[] = "****************************************"; -const int dump_zap_width = sizeof (dump_zap_stars) - 1; +const char histo_stars[] = "****************************************"; +const int histo_width = sizeof (histo_stars) - 1; static void -dump_zap_histogram(uint64_t histo[ZAP_HISTOGRAM_SIZE]) +dump_histogram(const uint64_t *histo, int size) { int i; - int minidx = ZAP_HISTOGRAM_SIZE - 1; + int minidx = size - 1; int maxidx = 0; uint64_t max = 0; - for (i = 0; i < ZAP_HISTOGRAM_SIZE; i++) { + for (i = 0; i < size; i++) { if (histo[i] > max) max = histo[i]; if (histo[i] > 0 && i > maxidx) @@ -235,12 +258,14 @@ dump_zap_histogram(uint64_t histo[ZAP_HI minidx = i; } - if (max < dump_zap_width) - max = dump_zap_width; + if (max < histo_width) + max = histo_width; - for (i = minidx; i <= maxidx; i++) - (void) printf("\t\t\t%u: %6llu %s\n", i, (u_longlong_t)histo[i], - &dump_zap_stars[(max - histo[i]) * dump_zap_width / max]); + for (i = minidx; i <= maxidx; i++) { + (void) printf("\t\t\t%3u: %6llu %s\n", + i, (u_longlong_t)histo[i], + &histo_stars[(max - histo[i]) * histo_width / max]); + } } static void @@ -291,19 +316,19 @@ dump_zap_stats(objset_t *os, uint64_t ob (u_longlong_t)zs.zs_salt); (void) printf("\t\tLeafs with 2^n pointers:\n"); - dump_zap_histogram(zs.zs_leafs_with_2n_pointers); + dump_histogram(zs.zs_leafs_with_2n_pointers, ZAP_HISTOGRAM_SIZE); (void) printf("\t\tBlocks with n*5 entries:\n"); - dump_zap_histogram(zs.zs_blocks_with_n5_entries); + dump_histogram(zs.zs_blocks_with_n5_entries, ZAP_HISTOGRAM_SIZE); (void) printf("\t\tBlocks n/10 full:\n"); - dump_zap_histogram(zs.zs_blocks_n_tenths_full); + dump_histogram(zs.zs_blocks_n_tenths_full, ZAP_HISTOGRAM_SIZE); (void) printf("\t\tEntries with n chunks:\n"); - dump_zap_histogram(zs.zs_entries_using_n_chunks); + dump_histogram(zs.zs_entries_using_n_chunks, ZAP_HISTOGRAM_SIZE); (void) printf("\t\tBuckets with n entries:\n"); - dump_zap_histogram(zs.zs_buckets_with_n_entries); + dump_histogram(zs.zs_buckets_with_n_entries, ZAP_HISTOGRAM_SIZE); } /*ARGSUSED*/ @@ -857,21 +882,22 @@ dump_history(spa_t *spa) for (int i = 0; i < num; i++) { uint64_t time, txg, ievent; char *cmd, *intstr; + boolean_t printed = B_FALSE; if (nvlist_lookup_uint64(events[i], ZPOOL_HIST_TIME, &time) != 0) - continue; + goto next; if (nvlist_lookup_string(events[i], ZPOOL_HIST_CMD, &cmd) != 0) { if (nvlist_lookup_uint64(events[i], ZPOOL_HIST_INT_EVENT, &ievent) != 0) - continue; + goto next; verify(nvlist_lookup_uint64(events[i], ZPOOL_HIST_TXG, &txg) == 0); verify(nvlist_lookup_string(events[i], ZPOOL_HIST_INT_STR, &intstr) == 0); - if (ievent >= LOG_END) - continue; + if (ievent >= ZFS_NUM_LEGACY_HISTORY_EVENTS) + goto next; (void) snprintf(internalstr, sizeof (internalstr), @@ -884,6 +910,14 @@ dump_history(spa_t *spa) (void) localtime_r(&tsec, &t); (void) strftime(tbuf, sizeof (tbuf), "%F.%T", &t); (void) printf("%s %s\n", tbuf, cmd); + printed = B_TRUE; + +next: + if (dump_opt['h'] > 1) { + if (!printed) + (void) printf("unrecognized record:\n"); + dump_nvlist(events[i], 2); + } } } @@ -916,7 +950,7 @@ sprintf_blkptr_compact(char *blkbuf, con const dva_t *dva = bp->blk_dva; int ndvas = dump_opt['d'] > 5 ? BP_GET_NDVAS(bp) : 1; - if (dump_opt['b'] >= 5) { + if (dump_opt['b'] >= 6) { sprintf_blkptr(blkbuf, bp); return; } @@ -1496,7 +1530,7 @@ static object_viewer_t *object_viewer[DM dump_zap, /* other ZAP */ dump_zap, /* persistent error log */ dump_uint8, /* SPA history */ - dump_uint64, /* SPA history offsets */ + dump_history_offsets, /* SPA history offsets */ dump_zap, /* Pool properties */ dump_zap, /* DSL permissions */ dump_acl, /* ZFS ACL */ @@ -1661,7 +1695,9 @@ dump_dir(objset_t *os) int print_header = 1; int i, error; + dsl_pool_config_enter(dmu_objset_pool(os), FTAG); dmu_objset_fast_stat(os, &dds); + dsl_pool_config_exit(dmu_objset_pool(os), FTAG); if (dds.dds_type < DMU_OST_NUMTYPES) type = objset_types[dds.dds_type]; @@ -1953,11 +1989,13 @@ dump_one_dir(const char *dsname, void *a /* * Block statistics. */ +#define PSIZE_HISTO_SIZE (SPA_MAXBLOCKSIZE / SPA_MINBLOCKSIZE + 1) typedef struct zdb_blkstats { - uint64_t zb_asize; - uint64_t zb_lsize; - uint64_t zb_psize; - uint64_t zb_count; + uint64_t zb_asize; + uint64_t zb_lsize; + uint64_t zb_psize; + uint64_t zb_count; + uint64_t zb_psize_histogram[PSIZE_HISTO_SIZE]; } zdb_blkstats_t; /* @@ -1981,6 +2019,9 @@ typedef struct zdb_cb { zdb_blkstats_t zcb_type[ZB_TOTAL + 1][ZDB_OT_TOTAL + 1]; uint64_t zcb_dedup_asize; uint64_t zcb_dedup_blocks; + uint64_t zcb_start; + uint64_t zcb_lastprint; + uint64_t zcb_totalasize; uint64_t zcb_errors[256]; int zcb_readfails; int zcb_haderrors; @@ -2007,6 +2048,7 @@ zdb_count_block(zdb_cb_t *zcb, zilog_t * zb->zb_lsize += BP_GET_LSIZE(bp); zb->zb_psize += BP_GET_PSIZE(bp); zb->zb_count++; + zb->zb_psize_histogram[BP_GET_PSIZE(bp) >> SPA_MINBLOCKSHIFT]++; } if (dump_opt['L']) @@ -2070,7 +2112,6 @@ zdb_blkptr_cb(spa_t *spa, zilog_t *zilog NULL, NULL, ZIO_PRIORITY_ASYNC_READ, flags, zb)); free(data); - if (ioerr && !(flags & ZIO_FLAG_SPECULATIVE)) { zcb->zcb_haderrors = 1; zcb->zcb_errors[ioerr]++; @@ -2094,7 +2135,7 @@ zdb_blkptr_cb(spa_t *spa, zilog_t *zilog zcb->zcb_readfails = 0; - if (dump_opt['b'] >= 4) { + if (dump_opt['b'] >= 5) { sprintf_blkptr(blkbuf, bp); (void) printf("objset %llu object %llu " "level %lld offset 0x%llx %s\n", @@ -2105,6 +2146,28 @@ zdb_blkptr_cb(spa_t *spa, zilog_t *zilog blkbuf); } + if (dump_opt['b'] < 5 && isatty(STDERR_FILENO) && + gethrtime() > zcb->zcb_lastprint + NANOSEC) { + uint64_t now = gethrtime(); + char buf[10]; + uint64_t bytes = zcb->zcb_type[ZB_TOTAL][ZDB_OT_TOTAL].zb_asize; + int kb_per_sec = + 1 + bytes / (1 + ((now - zcb->zcb_start) / 1000 / 1000)); + int sec_remaining = + (zcb->zcb_totalasize - bytes) / 1024 / kb_per_sec; + + zfs_nicenum(bytes, buf, sizeof (buf)); + (void) fprintf(stderr, + "\r%5s completed (%4dMB/s) " + "estimated time remaining: %uhr %02umin %02usec ", + buf, kb_per_sec / 1024, + sec_remaining / 60 / 60, + sec_remaining / 60 % 60, + sec_remaining % 60); + + zcb->zcb_lastprint = now; + } + return (0); } @@ -2236,7 +2299,7 @@ count_block_cb(void *arg, const blkptr_t { zdb_cb_t *zcb = arg; - if (dump_opt['b'] >= 4) { + if (dump_opt['b'] >= 5) { char blkbuf[BP_SPRINTF_LEN]; sprintf_blkptr(blkbuf, bp); (void) printf("[%s] %s\n", @@ -2255,7 +2318,7 @@ dump_block_stats(spa_t *spa) int flags = TRAVERSE_PRE | TRAVERSE_PREFETCH_METADATA | TRAVERSE_HARD; int leaks = 0; - (void) printf("\nTraversing all blocks %s%s%s%s%s...\n", + (void) printf("\nTraversing all blocks %s%s%s%s%s...\n\n", (dump_opt['c'] || !dump_opt['L']) ? "to verify " : "", (dump_opt['c'] == 1) ? "metadata " : "", dump_opt['c'] ? "checksums " : "", @@ -2291,6 +2354,8 @@ dump_block_stats(spa_t *spa) if (dump_opt['c'] > 1) flags |= TRAVERSE_PREFETCH_DATA; + zcb.zcb_totalasize = metaslab_class_get_alloc(spa_normal_class(spa)); + zcb.zcb_start = zcb.zcb_lastprint = gethrtime(); zcb.zcb_haderrors |= traverse_pool(spa, 0, flags, zdb_blkptr_cb, &zcb); if (zcb.zcb_haderrors) { @@ -2418,6 +2483,14 @@ dump_block_stats(spa_t *spa) else (void) printf(" L%d %s\n", level, typename); + + if (dump_opt['b'] >= 4) { + (void) printf("psize " + "(in 512-byte sectors): " + "number of blocks\n"); + dump_histogram(zb->zb_psize_histogram, + PSIZE_HISTO_SIZE); + } } } } Modified: stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Fri Apr 19 08:06:45 2013 (r249642) +++ stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Fri Apr 19 09:19:10 2013 (r249643) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 1, 2013 +.Dd March 21, 2013 .Dt ZFS 8 .Os .Sh NAME @@ -65,6 +65,7 @@ .Op Fl r .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ... .Ar filesystem@snapname Ns | Ns Ar volume@snapname +.Ar filesystem@snapname Ns | Ns Ar volume@snapname Ns ... .Nm .Cm rollback .Op Fl rRf @@ -1609,7 +1610,11 @@ multiple snapshots. Destroy (or mark for deferred deletion) all snapshots with this name in descendent file systems. .It Fl R -Recursively destroy all dependents. +Recursively destroy all clones of these snapshots, including the clones, +snapshots, and children. +If this flag is specified, the +.Op fl d +flag will have no effect. .It Fl n Do a dry-run ("No-op") deletion. No data will be deleted. This is useful in conjunction with the @@ -1637,17 +1642,18 @@ behavior for mounted file systems in use .Op Fl r .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ... .Ar filesystem@snapname Ns | Ns volume@snapname +.Ar filesystem@snapname Ns | Ns volume@snapname Ns ... .Xc .Pp -Creates a snapshot with the given name. All previous modifications by -successful system calls to the file system are part of the snapshot. See the +Creates snapshots with the given names. All previous modifications by +successful system calls to the file system are part of the snapshots. +Snapshots are taken atomically, so that all snapshots correspond to the same +moment in time. See the .Qq Sx Snapshots section for details. .Bl -tag -width indent .It Fl r -Recursively create snapshots of all descendent datasets. Snapshots are taken -atomically, so that all recursive snapshots correspond to the same moment in -time. +Recursively create snapshots of all descendent datasets .It Fl o Ar property Ns = Ns Ar value Sets the specified property; see .Qq Nm Cm create Modified: stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Fri Apr 19 08:06:45 2013 (r249642) +++ stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Fri Apr 19 09:19:10 2013 (r249643) @@ -58,6 +58,7 @@ #include #include +#include #include #include #include @@ -74,6 +75,7 @@ libzfs_handle_t *g_zfs; static FILE *mnttab_file; static char history_str[HIS_MAX_RECORD_LEN]; +static boolean_t log_history = B_TRUE; static int zfs_do_clone(int argc, char **argv); static int zfs_do_create(int argc, char **argv); @@ -276,7 +278,7 @@ get_usage(zfs_help_t idx) return (gettext("\tshare <-a | filesystem>\n")); case HELP_SNAPSHOT: return (gettext("\tsnapshot [-r] [-o property=value] ... " - "\n")); + " ...\n")); case HELP_UNMOUNT: return (gettext("\tunmount [-f] " "<-a | filesystem|mountpoint>\n")); @@ -903,11 +905,12 @@ typedef struct destroy_cbdata { boolean_t cb_parsable; boolean_t cb_dryrun; nvlist_t *cb_nvl; + nvlist_t *cb_batchedsnaps; /* first snap in contiguous run */ - zfs_handle_t *cb_firstsnap; + char *cb_firstsnap; /* previous snap in contiguous run */ - zfs_handle_t *cb_prevsnap; + char *cb_prevsnap; int64_t cb_snapused; char *cb_snapspec; } destroy_cbdata_t; @@ -999,9 +1002,27 @@ destroy_callback(zfs_handle_t *zhp, void zfs_close(zhp); return (0); } + if (cb->cb_dryrun) { + zfs_close(zhp); + return (0); + } + + /* + * We batch up all contiguous snapshots (even of different + * filesystems) and destroy them with one ioctl. We can't + * simply do all snap deletions and then all fs deletions, + * because we must delete a clone before its origin. + */ + if (zfs_get_type(zhp) == ZFS_TYPE_SNAPSHOT) { + fnvlist_add_boolean(cb->cb_batchedsnaps, name); + } else { + int error = zfs_destroy_snaps_nvl(g_zfs, + cb->cb_batchedsnaps, B_FALSE); + fnvlist_free(cb->cb_batchedsnaps); + cb->cb_batchedsnaps = fnvlist_alloc(); - if (!cb->cb_dryrun) { - if (zfs_unmount(zhp, NULL, cb->cb_force ? MS_FORCE : 0) != 0 || + if (error != 0 || + zfs_unmount(zhp, NULL, cb->cb_force ? MS_FORCE : 0) != 0 || zfs_destroy(zhp, cb->cb_defer_destroy) != 0) { zfs_close(zhp); return (-1); @@ -1021,11 +1042,13 @@ destroy_print_cb(zfs_handle_t *zhp, void if (nvlist_exists(cb->cb_nvl, name)) { if (cb->cb_firstsnap == NULL) - cb->cb_firstsnap = zfs_handle_dup(zhp); + cb->cb_firstsnap = strdup(name); if (cb->cb_prevsnap != NULL) - zfs_close(cb->cb_prevsnap); + free(cb->cb_prevsnap); /* this snap continues the current range */ - cb->cb_prevsnap = zfs_handle_dup(zhp); + cb->cb_prevsnap = strdup(name); + if (cb->cb_firstsnap == NULL || cb->cb_prevsnap == NULL) + nomem(); if (cb->cb_verbose) { if (cb->cb_parsable) { (void) printf("destroy\t%s\n", name); @@ -1040,12 +1063,12 @@ destroy_print_cb(zfs_handle_t *zhp, void } else if (cb->cb_firstsnap != NULL) { /* end of this range */ uint64_t used = 0; - err = zfs_get_snapused_int(cb->cb_firstsnap, + err = lzc_snaprange_space(cb->cb_firstsnap, cb->cb_prevsnap, &used); cb->cb_snapused += used; - zfs_close(cb->cb_firstsnap); + free(cb->cb_firstsnap); cb->cb_firstsnap = NULL; - zfs_close(cb->cb_prevsnap); + free(cb->cb_prevsnap); cb->cb_prevsnap = NULL; } zfs_close(zhp); @@ -1062,13 +1085,13 @@ destroy_print_snapshots(zfs_handle_t *fs if (cb->cb_firstsnap != NULL) { uint64_t used = 0; if (err == 0) { - err = zfs_get_snapused_int(cb->cb_firstsnap, + err = lzc_snaprange_space(cb->cb_firstsnap, cb->cb_prevsnap, &used); } cb->cb_snapused += used; - zfs_close(cb->cb_firstsnap); + free(cb->cb_firstsnap); cb->cb_firstsnap = NULL; - zfs_close(cb->cb_prevsnap); + free(cb->cb_prevsnap); cb->cb_prevsnap = NULL; } return (err); @@ -1155,8 +1178,10 @@ static int zfs_do_destroy(int argc, char **argv) { destroy_cbdata_t cb = { 0 }; + int rv = 0; + int err = 0; int c; - zfs_handle_t *zhp; + zfs_handle_t *zhp = NULL; char *at; zfs_type_t type = ZFS_TYPE_DATASET; @@ -1210,11 +1235,9 @@ zfs_do_destroy(int argc, char **argv) at = strchr(argv[0], '@'); if (at != NULL) { - int err = 0; /* Build the list of snaps to destroy in cb_nvl. */ - if (nvlist_alloc(&cb.cb_nvl, NV_UNIQUE_NAME, 0) != 0) - nomem(); + cb.cb_nvl = fnvlist_alloc(); *at = '\0'; zhp = zfs_open(g_zfs, argv[0], @@ -1225,17 +1248,15 @@ zfs_do_destroy(int argc, char **argv) cb.cb_snapspec = at + 1; if (gather_snapshots(zfs_handle_dup(zhp), &cb) != 0 || cb.cb_error) { - zfs_close(zhp); - nvlist_free(cb.cb_nvl); - return (1); + rv = 1; + goto out; } if (nvlist_empty(cb.cb_nvl)) { (void) fprintf(stderr, gettext("could not find any " "snapshots to destroy; check snapshot names.\n")); - zfs_close(zhp); - nvlist_free(cb.cb_nvl); - return (1); + rv = 1; + goto out; } if (cb.cb_verbose) { @@ -1254,18 +1275,26 @@ zfs_do_destroy(int argc, char **argv) } if (!cb.cb_dryrun) { - if (cb.cb_doclones) + if (cb.cb_doclones) { + cb.cb_batchedsnaps = fnvlist_alloc(); err = destroy_clones(&cb); + if (err == 0) { + err = zfs_destroy_snaps_nvl(g_zfs, + cb.cb_batchedsnaps, B_FALSE); + } + if (err != 0) { + rv = 1; + goto out; + } + } if (err == 0) { - err = zfs_destroy_snaps_nvl(zhp, cb.cb_nvl, + err = zfs_destroy_snaps_nvl(g_zfs, cb.cb_nvl, cb.cb_defer_destroy); } } - zfs_close(zhp); - nvlist_free(cb.cb_nvl); if (err != 0) - return (1); + rv = 1; } else { /* Open the given dataset */ if ((zhp = zfs_open(g_zfs, argv[0], type)) == NULL) @@ -1286,8 +1315,8 @@ zfs_do_destroy(int argc, char **argv) zfs_get_name(zhp)); (void) fprintf(stderr, gettext("use 'zpool destroy %s' " "to destroy the pool itself\n"), zfs_get_name(zhp)); - zfs_close(zhp); - return (1); + rv = 1; + goto out; } /* @@ -1297,30 +1326,42 @@ zfs_do_destroy(int argc, char **argv) if (!cb.cb_doclones && zfs_iter_dependents(zhp, B_TRUE, destroy_check_dependent, &cb) != 0) { - zfs_close(zhp); - return (1); + rv = 1; + goto out; } if (cb.cb_error) { - zfs_close(zhp); - return (1); + rv = 1; + goto out; } + cb.cb_batchedsnaps = fnvlist_alloc(); if (zfs_iter_dependents(zhp, B_FALSE, destroy_callback, &cb) != 0) { - zfs_close(zhp); - return (1); + rv = 1; + goto out; } /* * Do the real thing. The callback will close the * handle regardless of whether it succeeds or not. */ - if (destroy_callback(zhp, &cb) != 0) - return (1); + err = destroy_callback(zhp, &cb); + zhp = NULL; + if (err == 0) { + err = zfs_destroy_snaps_nvl(g_zfs, + cb.cb_batchedsnaps, cb.cb_defer_destroy); + } + if (err != 0) + rv = 1; } - return (0); +out: + fnvlist_free(cb.cb_batchedsnaps); + fnvlist_free(cb.cb_nvl); + if (zhp != NULL) + zfs_close(zhp); + return (rv); } static boolean_t @@ -1921,9 +1962,11 @@ upgrade_set_callback(zfs_handle_t *zhp, /* * If they did "zfs upgrade -a", then we could * be doing ioctls to different pools. We need - * to log this history once to each pool. + * to log this history once to each pool, and bypass + * the normal history logging that happens in main(). */ - verify(zpool_stage_history(g_zfs, history_str) == 0); + (void) zpool_log_history(g_zfs, history_str); + log_history = B_FALSE; } if (zfs_prop_set(zhp, "version", verstr) == 0) cb->cb_numupgraded++; @@ -3461,6 +3504,32 @@ zfs_do_set(int argc, char **argv) return (ret); } +typedef struct snap_cbdata { + nvlist_t *sd_nvl; + boolean_t sd_recursive; + const char *sd_snapname; +} snap_cbdata_t; + +static int +zfs_snapshot_cb(zfs_handle_t *zhp, void *arg) +{ + snap_cbdata_t *sd = arg; + char *name; + int rv = 0; + int error; + + error = asprintf(&name, "%s@%s", zfs_get_name(zhp), sd->sd_snapname); + if (error == -1) + nomem(); + fnvlist_add_boolean(sd->sd_nvl, name); + free(name); + + if (sd->sd_recursive) + rv = zfs_iter_filesystems(zhp, zfs_snapshot_cb, sd); + zfs_close(zhp); + return (rv); +} + /* * zfs snapshot [-r] [-o prop=value] ... * @@ -3470,13 +3539,16 @@ zfs_do_set(int argc, char **argv) static int zfs_do_snapshot(int argc, char **argv) { - boolean_t recursive = B_FALSE; int ret = 0; char c; nvlist_t *props; + snap_cbdata_t sd = { 0 }; + boolean_t multiple_snaps = B_FALSE; if (nvlist_alloc(&props, NV_UNIQUE_NAME, 0) != 0) nomem(); + if (nvlist_alloc(&sd.sd_nvl, NV_UNIQUE_NAME, 0) != 0) + nomem(); /* check options */ while ((c = getopt(argc, argv, "ro:")) != -1) { @@ -3486,7 +3558,8 @@ zfs_do_snapshot(int argc, char **argv) return (1); break; case 'r': - recursive = B_TRUE; + sd.sd_recursive = B_TRUE; + multiple_snaps = B_TRUE; break; case '?': (void) fprintf(stderr, gettext("invalid option '%c'\n"), @@ -3503,18 +3576,35 @@ zfs_do_snapshot(int argc, char **argv) (void) fprintf(stderr, gettext("missing snapshot argument\n")); goto usage; } - if (argc > 1) { - (void) fprintf(stderr, gettext("too many arguments\n")); - goto usage; + + if (argc > 1) + multiple_snaps = B_TRUE; + for (; argc > 0; argc--, argv++) { + char *atp; + zfs_handle_t *zhp; + + atp = strchr(argv[0], '@'); + if (atp == NULL) + goto usage; + *atp = '\0'; + sd.sd_snapname = atp + 1; + zhp = zfs_open(g_zfs, argv[0], + ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME); + if (zhp == NULL) + goto usage; + if (zfs_snapshot_cb(zhp, &sd) != 0) + goto usage; } - ret = zfs_snapshot(g_zfs, argv[0], recursive, props); + ret = zfs_snapshot_nvl(g_zfs, sd.sd_nvl, props); + nvlist_free(sd.sd_nvl); nvlist_free(props); - if (ret && recursive) + if (ret != 0 && multiple_snaps) (void) fprintf(stderr, gettext("no snapshots were created\n")); return (ret != 0); usage: + nvlist_free(sd.sd_nvl); nvlist_free(props); usage(B_FALSE); return (-1); @@ -5057,28 +5147,12 @@ cleanup2: return (error); } -/* - * zfs allow [-r] [-t] ... - * - * -r Recursively hold - * -t Temporary hold (hidden option) - * - * Apply a user-hold with the given tag to the list of snapshots. - */ static int zfs_do_allow(int argc, char **argv) { return (zfs_do_allow_unallow_impl(argc, argv, B_FALSE)); } -/* - * zfs unallow [-r] [-t] ... - * - * -r Recursively hold - * -t Temporary hold (hidden option) - * - * Apply a user-hold with the given tag to the list of snapshots. - */ static int zfs_do_unallow(int argc, char **argv) { @@ -5092,7 +5166,6 @@ zfs_do_hold_rele_impl(int argc, char **a int i; const char *tag; boolean_t recursive = B_FALSE; - boolean_t temphold = B_FALSE; const char *opts = holding ? "rt" : "r"; int c; @@ -5102,9 +5175,6 @@ zfs_do_hold_rele_impl(int argc, char **a case 'r': recursive = B_TRUE; break; - case 't': - temphold = B_TRUE; - break; case '?': (void) fprintf(stderr, gettext("invalid option '%c'\n"), optopt); @@ -5153,7 +5223,7 @@ zfs_do_hold_rele_impl(int argc, char **a } if (holding) { if (zfs_hold(zhp, delim+1, tag, recursive, - temphold, B_FALSE, -1, 0, 0) != 0) + B_FALSE, -1) != 0) ++errors; } else { if (zfs_release(zhp, delim+1, tag, recursive) != 0) @@ -5169,7 +5239,6 @@ zfs_do_hold_rele_impl(int argc, char **a * zfs hold [-r] [-t] ... * * -r Recursively hold - * -t Temporary hold (hidden option) * * Apply a user-hold with the given tag to the list of snapshots. */ @@ -6591,8 +6660,7 @@ main(int argc, char **argv) return (1); } - zpool_set_history_str("zfs", argc, argv, history_str); - verify(zpool_stage_history(g_zfs, history_str) == 0); + zfs_save_arguments(argc, argv, history_str, sizeof (history_str)); libzfs_print_on_error(g_zfs, B_TRUE); @@ -6661,6 +6729,9 @@ main(int argc, char **argv) (void) fclose(mnttab_file); + if (ret == 0 && log_history) + (void) zpool_log_history(g_zfs, history_str); + libzfs_fini(g_zfs); /* Modified: stable/9/cddl/contrib/opensolaris/cmd/zhack/zhack.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/zhack/zhack.c Fri Apr 19 08:06:45 2013 (r249642) +++ stable/9/cddl/contrib/opensolaris/cmd/zhack/zhack.c Fri Apr 19 09:19:10 2013 (r249643) @@ -46,6 +46,7 @@ #include #include #include +#include #undef ZFS_MAXNAMELEN #undef verify #include @@ -273,12 +274,15 @@ zhack_do_feature_stat(int argc, char **a } static void -feature_enable_sync(void *arg1, void *arg2, dmu_tx_t *tx) +feature_enable_sync(void *arg, dmu_tx_t *tx) { - spa_t *spa = arg1; - zfeature_info_t *feature = arg2; + spa_t *spa = dmu_tx_pool(tx)->dp_spa; + zfeature_info_t *feature = arg; spa_feature_enable(spa, feature, tx); + spa_history_log_internal(spa, "zhack enable feature", tx, + "name=%s can_readonly=%u", + feature->fi_guid, feature->fi_can_readonly); } static void @@ -341,8 +345,8 @@ zhack_do_feature_enable(int argc, char * if (0 == zap_contains(mos, spa->spa_feat_desc_obj, feature.fi_guid)) fatal("feature already enabled: %s", feature.fi_guid); - VERIFY3U(0, ==, dsl_sync_task_do(spa->spa_dsl_pool, NULL, - feature_enable_sync, spa, &feature, 5)); + VERIFY0(dsl_sync_task(spa_name(spa), NULL, + feature_enable_sync, &feature, 5)); spa_close(spa, FTAG); @@ -350,21 +354,25 @@ zhack_do_feature_enable(int argc, char * } static void -feature_incr_sync(void *arg1, void *arg2, dmu_tx_t *tx) +feature_incr_sync(void *arg, dmu_tx_t *tx) { - spa_t *spa = arg1; - zfeature_info_t *feature = arg2; + spa_t *spa = dmu_tx_pool(tx)->dp_spa; + zfeature_info_t *feature = arg; spa_feature_incr(spa, feature, tx); + spa_history_log_internal(spa, "zhack feature incr", tx, + "name=%s", feature->fi_guid); } static void -feature_decr_sync(void *arg1, void *arg2, dmu_tx_t *tx) +feature_decr_sync(void *arg, dmu_tx_t *tx) { - spa_t *spa = arg1; - zfeature_info_t *feature = arg2; + spa_t *spa = dmu_tx_pool(tx)->dp_spa; + zfeature_info_t *feature = arg; spa_feature_decr(spa, feature, tx); + spa_history_log_internal(spa, "zhack feature decr", tx, + "name=%s", feature->fi_guid); } static void @@ -435,8 +443,8 @@ zhack_do_feature_ref(int argc, char **ar if (decr && !spa_feature_is_active(spa, &feature)) fatal("feature refcount already 0: %s", feature.fi_guid); - VERIFY3U(0, ==, dsl_sync_task_do(spa->spa_dsl_pool, NULL, - decr ? feature_decr_sync : feature_incr_sync, spa, &feature, 5)); + VERIFY0(dsl_sync_task(spa_name(spa), NULL, + decr ? feature_decr_sync : feature_incr_sync, &feature, 5)); spa_close(spa, FTAG); } Modified: stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Fri Apr 19 08:06:45 2013 (r249642) +++ stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Fri Apr 19 09:19:10 2013 (r249643) @@ -192,9 +192,9 @@ static zpool_command_t command_table[] = #define NCOMMAND (sizeof (command_table) / sizeof (command_table[0])) -zpool_command_t *current_command; +static zpool_command_t *current_command; static char history_str[HIS_MAX_RECORD_LEN]; - +static boolean_t log_history = B_TRUE; static uint_t timestamp_fmt = NODATE; static const char * @@ -1092,7 +1092,10 @@ zpool_do_destroy(int argc, char **argv) return (1); } - ret = (zpool_destroy(zhp) != 0); + /* The history must be logged as part of the export */ + log_history = B_FALSE; + + ret = (zpool_destroy(zhp, history_str) != 0); zpool_close(zhp); @@ -1156,10 +1159,13 @@ zpool_do_export(int argc, char **argv) continue; } + /* The history must be logged as part of the export */ + log_history = B_FALSE; + if (hardforce) { - if (zpool_export_force(zhp) != 0) + if (zpool_export_force(zhp, history_str) != 0) ret = 1; - } else if (zpool_export(zhp, force) != 0) { + } else if (zpool_export(zhp, force, history_str) != 0) { ret = 1; } @@ -4562,6 +4568,14 @@ upgrade_cb(zpool_handle_t *zhp, void *ar if (count > 0) { cbp->cb_first = B_FALSE; printnl = B_TRUE; + /* + * If they did "zpool upgrade -a", then we could + * be doing ioctls to different pools. We need + * to log this history once to each pool, and bypass + * the normal history logging that happens in main(). + */ + (void) zpool_log_history(g_zfs, history_str); + log_history = B_FALSE; } } @@ -4923,8 +4937,8 @@ zpool_do_upgrade(int argc, char **argv) typedef struct hist_cbdata { boolean_t first; - int longfmt; - int internal; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Apr 19 10:16:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 154156CC; Fri, 19 Apr 2013 10:16:01 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E29849F3; Fri, 19 Apr 2013 10:16:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3JAG0HZ097655; Fri, 19 Apr 2013 10:16:00 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3JAG0wI097651; Fri, 19 Apr 2013 10:16:00 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201304191016.r3JAG0wI097651@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 19 Apr 2013 10:16:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249644 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Apr 2013 10:16:01 -0000 Author: jilles Date: Fri Apr 19 10:16:00 2013 New Revision: 249644 URL: http://svnweb.freebsd.org/changeset/base/249644 Log: sem: Restart the POSIX sem_* calls after signals with SA_RESTART set. Programs often do not expect an [EINTR] return from sem_wait() and POSIX only allows it if the signal was installed without SA_RESTART. The timeout in sem_timedwait() is absolute so it can be restarted normally. The umtx call can be invoked with a relative timeout and in that case [ERESTART] must be changed to [EINTR]. However, libc does not do this. The old POSIX semaphore implementation did this correctly (before r249566), unlike the new umtx one. It may be desirable to avoid [EINTR] completely, which matches the pthread functions and is explicitly permitted by POSIX. However, the kernel must return [EINTR] at least for signals with SA_RESTART clear, otherwise pthread cancellation will not abort a semaphore wait. In this commit, only restore the 8.x behaviour which is also permitted by POSIX. Discussed with: jhb MFC after: 1 week Modified: head/sys/kern/kern_umtx.c head/sys/kern/uipc_sem.c Modified: head/sys/kern/kern_umtx.c ============================================================================== --- head/sys/kern/kern_umtx.c Fri Apr 19 09:19:10 2013 (r249643) +++ head/sys/kern/kern_umtx.c Fri Apr 19 10:16:00 2013 (r249644) @@ -2980,7 +2980,9 @@ do_sem_wait(struct thread *td, struct _u error = 0; else { umtxq_remove(uq); - if (error == ERESTART) + /* A relative timeout cannot be restarted. */ + if (error == ERESTART && timeout != NULL && + (timeout->_flags & UMTX_ABSTIME) == 0) error = EINTR; } umtxq_unlock(&uq->uq_key); Modified: head/sys/kern/uipc_sem.c ============================================================================== --- head/sys/kern/uipc_sem.c Fri Apr 19 09:19:10 2013 (r249643) +++ head/sys/kern/uipc_sem.c Fri Apr 19 10:16:00 2013 (r249644) @@ -846,8 +846,6 @@ kern_sem_wait(struct thread *td, semid_t err: mtx_unlock(&sem_lock); fdrop(fp, td); - if (error == ERESTART) - error = EINTR; DP(("<<< kern_sem_wait leaving, pid=%d, error = %d\n", (int)td->td_proc->p_pid, error)); return (error); From owner-svn-src-all@FreeBSD.ORG Fri Apr 19 10:35:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8250FC8F; Fri, 19 Apr 2013 10:35:46 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6536EAE6; Fri, 19 Apr 2013 10:35:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3JAZkNm011485; Fri, 19 Apr 2013 10:35:46 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3JAZjTW011350; Fri, 19 Apr 2013 10:35:45 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201304191035.r3JAZjTW011350@svn.freebsd.org> From: Martin Matuska Date: Fri, 19 Apr 2013 10:35:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r249645 - in stable/8: cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/lib/libzfs/common sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Apr 2013 10:35:46 -0000 Author: mm Date: Fri Apr 19 10:35:45 2013 New Revision: 249645 URL: http://svnweb.freebsd.org/changeset/base/249645 Log: MFC r240870 (pjd): It is possible to recursively destroy snapshots even if the snapshot doesn't exist on a dataset we are starting from. For example if we have the following configuration: tank tank/foo tank/foo@snap tank/bar tank/bar@snap We can execute: # zfs destroy -t tank@snap eventhough tank@snap doesn't exit. Unfortunately it is not possible to do the same with recursive rename: # zfs rename -r tank@snap tank@pans cannot open 'tank@snap': dataset does not exist ...until now. This change allows to recursively rename snapshots even if snapshot doesn't exist on the starting dataset. Sponsored by: rsync.net Modified: stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Directory Properties: stable/8/cddl/contrib/opensolaris/ (props changed) stable/8/cddl/contrib/opensolaris/cmd/zfs/ (props changed) stable/8/cddl/contrib/opensolaris/lib/libzfs/ (props changed) stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Fri Apr 19 10:16:00 2013 (r249644) +++ stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Fri Apr 19 10:35:45 2013 (r249645) @@ -3070,6 +3070,7 @@ zfs_do_rename(int argc, char **argv) int ret = 0; int types; boolean_t parents = B_FALSE; + char *snapshot = NULL; /* check options */ while ((c = getopt(argc, argv, "fpru")) != -1) { @@ -3138,6 +3139,19 @@ zfs_do_rename(int argc, char **argv) else types = ZFS_TYPE_DATASET; + if (flags.recurse) { + /* + * When we do recursive rename we are fine when the given + * snapshot for the given dataset doesn't exist - it can + * still exists below. + */ + + snapshot = strchr(argv[0], '@'); + assert(snapshot != NULL); + *snapshot = '\0'; + snapshot++; + } + if ((zhp = zfs_open(g_zfs, argv[0], types)) == NULL) return (1); @@ -3148,7 +3162,7 @@ zfs_do_rename(int argc, char **argv) return (1); } - ret = (zfs_rename(zhp, argv[1], flags) != 0); + ret = (zfs_rename(zhp, snapshot, argv[1], flags) != 0); zfs_close(zhp); return (ret); Modified: stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h ============================================================================== --- stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Fri Apr 19 10:16:00 2013 (r249644) +++ stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Fri Apr 19 10:35:45 2013 (r249645) @@ -571,7 +571,8 @@ typedef struct renameflags { int forceunmount : 1; } renameflags_t; -extern int zfs_rename(zfs_handle_t *, const char *, renameflags_t flags); +extern int zfs_rename(zfs_handle_t *, const char *, const char *, + renameflags_t flags); typedef struct sendflags { /* print informational messages (ie, -v was specified) */ Modified: stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Fri Apr 19 10:16:00 2013 (r249644) +++ stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Fri Apr 19 10:35:45 2013 (r249645) @@ -611,6 +611,22 @@ zfs_open(libzfs_handle_t *hdl, const cha return (NULL); } + if (zhp == NULL) { + char *at = strchr(path, '@'); + + if (at != NULL) + *at = '\0'; + errno = 0; + if ((zhp = make_dataset_handle(hdl, path)) == NULL) { + (void) zfs_standard_error(hdl, errno, errbuf); + return (NULL); + } + if (at != NULL) + *at = '@'; + (void) strlcpy(zhp->zfs_name, path, sizeof (zhp->zfs_name)); + zhp->zfs_type = ZFS_TYPE_SNAPSHOT; + } + if (!(types & zhp->zfs_type)) { (void) zfs_error(hdl, EZFS_BADTYPE, errbuf); zfs_close(zhp); @@ -3614,7 +3630,8 @@ zfs_rollback(zfs_handle_t *zhp, zfs_hand * Renames the given dataset. */ int -zfs_rename(zfs_handle_t *zhp, const char *target, renameflags_t flags) +zfs_rename(zfs_handle_t *zhp, const char *source, const char *target, + renameflags_t flags) { int ret; zfs_cmd_t zc = { 0 }; @@ -3634,6 +3651,18 @@ zfs_rename(zfs_handle_t *zhp, const char (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN, "cannot rename to '%s'"), target); + if (source != NULL) { + /* + * This is recursive snapshots rename, put snapshot name + * (that might not exist) into zfs_name. + */ + assert(flags.recurse); + + (void) strlcat(zhp->zfs_name, "@", sizeof(zhp->zfs_name)); + (void) strlcat(zhp->zfs_name, source, sizeof(zhp->zfs_name)); + zhp->zfs_type = ZFS_TYPE_SNAPSHOT; + } + /* * Make sure the target name is valid */ Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Fri Apr 19 10:16:00 2013 (r249644) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Fri Apr 19 10:35:45 2013 (r249645) @@ -2520,6 +2520,7 @@ struct renamesnaparg { char failed[MAXPATHLEN]; char *oldsnap; char *newsnap; + int error; }; static int @@ -2557,6 +2558,9 @@ dsl_snapshot_rename_one(const char *name dsl_sync_task_create(ra->dstg, dsl_dataset_snapshot_rename_check, dsl_dataset_snapshot_rename_sync, ds, ra->newsnap, 0); + /* First successful rename clears the error. */ + ra->error = 0; + return (0); } @@ -2585,14 +2589,16 @@ dsl_recursive_rename(char *oldname, cons ra->oldsnap = strchr(oldname, '@') + 1; ra->newsnap = strchr(newname, '@') + 1; *ra->failed = '\0'; + ra->error = ENOENT; err = dmu_objset_find(fsname, dsl_snapshot_rename_one, ra, DS_FIND_CHILDREN); kmem_free(fsname, len); + if (err == 0) + err = ra->error; - if (err == 0) { + if (err == 0) err = dsl_sync_task_group_wait(ra->dstg); - } for (dst = list_head(&ra->dstg->dstg_tasks); dst; dst = list_next(&ra->dstg->dstg_tasks, dst)) { Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Apr 19 10:16:00 2013 (r249644) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Apr 19 10:35:45 2013 (r249645) @@ -780,7 +780,26 @@ zfs_secpolicy_rename_perms(const char *f static int zfs_secpolicy_rename(zfs_cmd_t *zc, cred_t *cr) { - return (zfs_secpolicy_rename_perms(zc->zc_name, zc->zc_value, cr)); + char *at = NULL; + int error; + + if ((zc->zc_cookie & 1) != 0) { + /* + * This is recursive rename, so the starting snapshot might + * not exist. Check file system or volume permission instead. + */ + at = strchr(zc->zc_name, '@'); + if (at == NULL) + return (EINVAL); + *at = '\0'; + } + + error = zfs_secpolicy_rename_perms(zc->zc_name, zc->zc_value, cr); + + if (at != NULL) + *at = '@'; + + return (error); } static int From owner-svn-src-all@FreeBSD.ORG Fri Apr 19 10:48:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 721DCFD7; Fri, 19 Apr 2013 10:48:39 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 63CADBF9; Fri, 19 Apr 2013 10:48:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3JAmdXK043951; Fri, 19 Apr 2013 10:48:39 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3JAmdMZ043947; Fri, 19 Apr 2013 10:48:39 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201304191048.r3JAmdMZ043947@svn.freebsd.org> From: Martin Matuska Date: Fri, 19 Apr 2013 10:48:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r249646 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Apr 2013 10:48:39 -0000 Author: mm Date: Fri Apr 19 10:48:38 2013 New Revision: 249646 URL: http://svnweb.freebsd.org/changeset/base/249646 Log: MFC r248493: Plug memory leak in dsl_check_snap_cb() This was unnoticed because the function is very rarely used. Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Fri Apr 19 10:35:45 2013 (r249645) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Fri Apr 19 10:48:38 2013 (r249646) @@ -922,7 +922,8 @@ dsl_check_snap_cb(const char *name, void char *dsname; dsname = kmem_asprintf("%s@%s", name, da->snapname); - VERIFY(nvlist_add_boolean(da->nvl, dsname) == 0); + fnvlist_add_boolean(da->nvl, dsname); + kmem_free(dsname, strlen(dsname) + 1); return (0); } From owner-svn-src-all@FreeBSD.ORG Fri Apr 19 13:40:13 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D5DA77D1; Fri, 19 Apr 2013 13:40:13 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C9440330; Fri, 19 Apr 2013 13:40:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3JDeDdD043470; Fri, 19 Apr 2013 13:40:13 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3JDeD9h043466; Fri, 19 Apr 2013 13:40:13 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201304191340.r3JDeD9h043466@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 19 Apr 2013 13:40:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249649 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Apr 2013 13:40:13 -0000 Author: glebius Date: Fri Apr 19 13:40:13 2013 New Revision: 249649 URL: http://svnweb.freebsd.org/changeset/base/249649 Log: Don't compare unsigned socklen_t against < 0. Reviewed by: jhb Modified: head/sys/kern/uipc_syscalls.c Modified: head/sys/kern/uipc_syscalls.c ============================================================================== --- head/sys/kern/uipc_syscalls.c Fri Apr 19 11:56:25 2013 (r249648) +++ head/sys/kern/uipc_syscalls.c Fri Apr 19 13:40:13 2013 (r249649) @@ -382,11 +382,8 @@ kern_accept(struct thread *td, int s, st pid_t pgid; int tmp; - if (name) { + if (name) *name = NULL; - if (*namelen < 0) - return (EINVAL); - } AUDIT_ARG_FD(s); fdp = td->td_proc->p_fd; @@ -1565,9 +1562,6 @@ kern_getsockname(struct thread *td, int socklen_t len; int error; - if (*alen < 0) - return (EINVAL); - AUDIT_ARG_FD(fd); error = getsock_cap(td->td_proc->p_fd, fd, CAP_GETSOCKNAME, &fp, NULL); if (error) @@ -1665,9 +1659,6 @@ kern_getpeername(struct thread *td, int socklen_t len; int error; - if (*alen < 0) - return (EINVAL); - AUDIT_ARG_FD(fd); error = getsock_cap(td->td_proc->p_fd, fd, CAP_GETPEERNAME, &fp, NULL); if (error) From owner-svn-src-all@FreeBSD.ORG Fri Apr 19 14:04:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 85475D29; Fri, 19 Apr 2013 14:04:02 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-wi0-x22b.google.com (mail-wi0-x22b.google.com [IPv6:2a00:1450:400c:c05::22b]) by mx1.freebsd.org (Postfix) with ESMTP id A18363A7; Fri, 19 Apr 2013 14:04:01 +0000 (UTC) Received: by mail-wi0-f171.google.com with SMTP id l13so863425wie.16 for ; Fri, 19 Apr 2013 07:04:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=H3Qk7cPOlsogNg+FEQX7Qc2rZ6xEjTKPEMs1kfdRkr4=; b=EnJ0XRbxnGTHgWO4szsYNWX4ukMU9BawAamT0P26xcUI5nPfGhmOovsJTFUQ+UuMoq iftcAhkWsJ8vlgziSBkDRL338PY2+jBq7sk/25uKjintxchGkOJ5Rs1wNTHZfz/2r2Db X6JMHq/AxVGZ0OJL5AUg5HCtBw6kkNAuTJLxp5uczFVJNRiKNzIXBgDoZvj7cqdxL/fQ xgMiWWUx45fiHfHA/6PLTVT0MjPk4Nf5GpGkLqyqPlLgtwcpcIy1kVy2oCQyasQKyvkI EnkDI1s/XtWqOfa9/IRMjkLd3s39INiCTLpd9TEQd0uiR2EaoCfFNldOkhrbG2fS8v5m YLJA== MIME-Version: 1.0 X-Received: by 10.180.103.65 with SMTP id fu1mr25606261wib.4.1366380240783; Fri, 19 Apr 2013 07:04:00 -0700 (PDT) Sender: pluknet@gmail.com Received: by 10.194.86.167 with HTTP; Fri, 19 Apr 2013 07:04:00 -0700 (PDT) In-Reply-To: <201304191340.r3JDeD9h043466@svn.freebsd.org> References: <201304191340.r3JDeD9h043466@svn.freebsd.org> Date: Fri, 19 Apr 2013 18:04:00 +0400 X-Google-Sender-Auth: R5HPs_uNXf1gZZ_4OJYNT75p7qc Message-ID: Subject: Re: svn commit: r249649 - head/sys/kern From: Sergey Kandaurov To: Gleb Smirnoff Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Apr 2013 14:04:02 -0000 On 19 April 2013 17:40, Gleb Smirnoff wrote: > Author: glebius > Date: Fri Apr 19 13:40:13 2013 > New Revision: 249649 > URL: http://svnweb.freebsd.org/changeset/base/249649 > > Log: > Don't compare unsigned socklen_t against < 0. > > Reviewed by: jhb > Thank you. This is long overdue since socklen_t. You may also want to update man page. Index: lib/libc/sys/accept.2 =================================================================== --- lib/libc/sys/accept.2 (revision 245745) +++ lib/libc/sys/accept.2 (working copy) @@ -28,7 +28,7 @@ .\" @(#)accept.2 8.2 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd December 11, 1993 +.Dd February 20, 2013 .Dt ACCEPT 2 .Os .Sh NAME @@ -154,10 +154,6 @@ The descriptor references a file, not a socket. .It Bq Er EINVAL .Xr listen 2 has not been called on the socket descriptor. -.It Bq Er EINVAL -The -.Fa addrlen -argument is negative. .It Bq Er EFAULT The .Fa addr -- wbr, pluknet From owner-svn-src-all@FreeBSD.ORG Fri Apr 19 15:19:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 09B119B7; Fri, 19 Apr 2013 15:19:30 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F0F2F78D; Fri, 19 Apr 2013 15:19:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3JFJTvP076104; Fri, 19 Apr 2013 15:19:29 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3JFJTXi076103; Fri, 19 Apr 2013 15:19:29 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201304191519.r3JFJTXi076103@svn.freebsd.org> From: Jaakko Heinonen Date: Fri, 19 Apr 2013 15:19:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249650 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Apr 2013 15:19:30 -0000 Author: jh Date: Fri Apr 19 15:19:29 2013 New Revision: 249650 URL: http://svnweb.freebsd.org/changeset/base/249650 Log: Include PID in the error message which is printed when the maxproc limit is exceeded. Improve formatting of the message while here. PR: kern/60550 Submitted by: Lowell Gilbert, bde Modified: head/sys/kern/kern_fork.c Modified: head/sys/kern/kern_fork.c ============================================================================== --- head/sys/kern/kern_fork.c Fri Apr 19 13:40:13 2013 (r249649) +++ head/sys/kern/kern_fork.c Fri Apr 19 15:19:29 2013 (r249650) @@ -930,8 +930,8 @@ fork1(struct thread *td, int flags, int fail: sx_sunlock(&proctree_lock); if (ppsratecheck(&lastfail, &curfail, 1)) - printf("maxproc limit exceeded by uid %i, please see tuning(7) and login.conf(5).\n", - td->td_ucred->cr_ruid); + printf("maxproc limit exceeded by uid %u (pid %d); see tuning(7) and login.conf(5)\n", + td->td_ucred->cr_ruid, p1->p_pid); sx_xunlock(&allproc_lock); #ifdef MAC mac_proc_destroy(newproc); From owner-svn-src-all@FreeBSD.ORG Fri Apr 19 15:42:23 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B3ADB5B8; Fri, 19 Apr 2013 15:42:23 +0000 (UTC) (envelope-from kientzle@freebsd.org) Received: from monday.kientzle.com (99-115-135-74.uvs.sntcca.sbcglobal.net [99.115.135.74]) by mx1.freebsd.org (Postfix) with ESMTP id 8D79DABD; Fri, 19 Apr 2013 15:42:23 +0000 (UTC) Received: (from root@localhost) by monday.kientzle.com (8.14.4/8.14.4) id r3J4oZmS084018; Fri, 19 Apr 2013 04:50:35 GMT (envelope-from kientzle@freebsd.org) Received: from [192.168.2.123] (CiscoE3000 [192.168.1.65]) by kientzle.com with SMTP id xdzbter7edbb8atavpcv2f8ygi; Fri, 19 Apr 2013 04:50:35 +0000 (UTC) (envelope-from kientzle@freebsd.org) Subject: Re: svn commit: r249484 - head/lib Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: text/plain; charset=iso-8859-1 From: Tim Kientzle In-Reply-To: <1FEABB1B-ADDE-412A-9D40-F9FB2822B654@freebsd.org> Date: Thu, 18 Apr 2013 21:50:33 -0700 Content-Transfer-Encoding: 7bit Message-Id: <647B67E8-152A-47A8-89E4-E15075D20992@freebsd.org> References: <201304141913.r3EJDqPI095965@svn.freebsd.org> <516D54F5.4010501@FreeBSD.org> <2A0FC59F-E043-4B4E-BABE-E16C6A1FBF5C@freebsd.org> <475555FA-DF6A-42FA-990D-4224ECAEAE52@FreeBSD.org> <516E900B.9090300@FreeBSD.org> <1FEABB1B-ADDE-412A-9D40-F9FB2822B654@freebsd.org> To: Dimitry Andric X-Mailer: Apple Mail (2.1283) Cc: Ed Schouten , src-committers@freebsd.org, Juli Mallett , svn-src-all@freebsd.org, Brooks Davis , svn-src-head@freebsd.org, Tijl Coosemans X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Apr 2013 15:42:23 -0000 On Apr 17, 2013, at 10:33 AM, Dimitry Andric wrote: > In any case, the layout has been like this since the initial clangbsd > import, and I never saw any reason to change it. Maybe Ed can tell a > bit more, since he seems to have done the initial infrastructure setup. FreeBSD/ARM just switched from GCC to Clang, which is why this just got noticed. U-Boot is used quite heavily for FreeBSD/ARM (and MIPS and PowerPC as well, I believe). Here are the options I see for getting cc -print-file-name=include to work again: * Hack clang to handle -print-file-name=include specially. I did this for GCC already, but I'm not thrilled about it. * Configure clang differently so that this option works. * Symlink /usr/include to appear somewhere that clang expects. * Rearrange our directory layout slightly to match clang's expectations. Tim From owner-svn-src-all@FreeBSD.ORG Fri Apr 19 17:43:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 79593ECB; Fri, 19 Apr 2013 17:43:53 +0000 (UTC) (envelope-from dim@freebsd.org) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:7b8:3a7:1:2d0:b7ff:fea0:8c26]) by mx1.freebsd.org (Postfix) with ESMTP id 235305EB; Fri, 19 Apr 2013 15:57:37 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7::a412:6300:63d9:cff8] (unknown [IPv6:2001:7b8:3a7:0:a412:6300:63d9:cff8]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id A48015C44; Fri, 19 Apr 2013 17:57:34 +0200 (CEST) Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Mac OS X Mail 6.3 \(1503\)) Subject: Re: svn commit: r249484 - head/lib From: Dimitry Andric In-Reply-To: <647B67E8-152A-47A8-89E4-E15075D20992@freebsd.org> Date: Fri, 19 Apr 2013 17:57:11 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201304141913.r3EJDqPI095965@svn.freebsd.org> <516D54F5.4010501@FreeBSD.org> <2A0FC59F-E043-4B4E-BABE-E16C6A1FBF5C@freebsd.org> <475555FA-DF6A-42FA-990D-4224ECAEAE52@FreeBSD.org> <516E900B.9090300@FreeBSD.org> <1FEABB1B-ADDE-412A-9D40-F9FB2822B654@freebsd.org> <647B67E8-152A-47A8-89E4-E15075D20992@freebsd.org> To: Tim Kientzle X-Mailer: Apple Mail (2.1503) Cc: Ed Schouten , src-committers@freebsd.org, Juli Mallett , svn-src-all@freebsd.org, Brooks Davis , svn-src-head@freebsd.org, Tijl Coosemans X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Apr 2013 17:43:53 -0000 On Apr 19, 2013, at 06:50, Tim Kientzle wrote: > On Apr 17, 2013, at 10:33 AM, Dimitry Andric wrote: >=20 >> In any case, the layout has been like this since the initial clangbsd >> import, and I never saw any reason to change it. Maybe Ed can tell a >> bit more, since he seems to have done the initial infrastructure = setup. >=20 > FreeBSD/ARM just switched from GCC to Clang, which is > why this just got noticed. U-Boot is used quite heavily for > FreeBSD/ARM (and MIPS and PowerPC as well, I believe). >=20 > Here are the options I see for getting > cc -print-file-name=3Dinclude > to work again: >=20 > * Hack clang to handle -print-file-name=3Dinclude specially. > I did this for GCC already, but I'm not thrilled about it. >=20 > * Configure clang differently so that this option works. >=20 > * Symlink /usr/include to appear somewhere that clang expects. >=20 > * Rearrange our directory layout slightly to match clang's = expectations. You seem to have left out the most obvious one: * Fixing U-Boot's configuration script(s) so they don't depend on = undocumented compiler options. I don't understand why we would want to go through all this trouble, = just for telling U-Boot where a bunch of headers are located? What = happened to configure scripts with options, they did not disappear = overnight, I hope? From owner-svn-src-all@FreeBSD.ORG Fri Apr 19 17:50:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9810FDAE; Fri, 19 Apr 2013 17:50:39 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 868E5967; Fri, 19 Apr 2013 17:50:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3JHodKp079541; Fri, 19 Apr 2013 17:50:39 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3JHodn4079533; Fri, 19 Apr 2013 17:50:39 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201304191750.r3JHodn4079533@svn.freebsd.org> From: Adrian Chadd Date: Fri, 19 Apr 2013 17:50:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249651 - in head/sys: conf dev/etherswitch/ukswitch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Apr 2013 17:50:39 -0000 Author: adrian Date: Fri Apr 19 17:50:38 2013 New Revision: 249651 URL: http://svnweb.freebsd.org/changeset/base/249651 Log: Implement a very basic multi-PHY aware switch device. This is intended to be used as a stop-gap for switch devices which expose multiple ethernet PHYs but we don't have a driver for - here, etherswitchcfg and the general switch configuration API can be used to interface to said PHYs. Submitted by: Luiz Otavio O Souza Added: head/sys/dev/etherswitch/ukswitch/ head/sys/dev/etherswitch/ukswitch/ukswitch.c (contents, props changed) Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Apr 19 15:19:29 2013 (r249650) +++ head/sys/conf/files Fri Apr 19 17:50:38 2013 (r249651) @@ -1284,6 +1284,7 @@ dev/etherswitch/mdio_if.m optional miip dev/etherswitch/mdio.c optional miiproxy dev/etherswitch/miiproxy.c optional miiproxy dev/etherswitch/rtl8366/rtl8366rb.c optional rtl8366rb +dev/etherswitch/ukswitch/ukswitch.c optional ukswitch dev/ex/if_ex.c optional ex dev/ex/if_ex_isa.c optional ex isa dev/ex/if_ex_pccard.c optional ex pccard Added: head/sys/dev/etherswitch/ukswitch/ukswitch.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/etherswitch/ukswitch/ukswitch.c Fri Apr 19 17:50:38 2013 (r249651) @@ -0,0 +1,570 @@ +/*- + * Copyright (c) 2013 Luiz Otavio O Souza. + * Copyright (c) 2011-2012 Stefan Bethke. + * Copyright (c) 2012 Adrian Chadd. + * 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 +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +#include "mdio_if.h" +#include "miibus_if.h" +#include "etherswitch_if.h" + +MALLOC_DECLARE(M_UKSWITCH); +MALLOC_DEFINE(M_UKSWITCH, "ukswitch", "ukswitch data structures"); + +struct ukswitch_softc { + struct mtx sc_mtx; /* serialize access to softc */ + device_t sc_dev; + int media; /* cpu port media */ + int cpuport; /* which PHY is connected to the CPU */ + int phymask; /* PHYs we manage */ + int numports; /* number of ports */ + int ifpport[MII_NPHY]; + int *portphy; + char **ifname; + device_t **miibus; + struct ifnet **ifp; + struct callout callout_tick; + etherswitch_info_t info; +}; + +#define UKSWITCH_LOCK(_sc) \ + mtx_lock(&(_sc)->sc_mtx) +#define UKSWITCH_UNLOCK(_sc) \ + mtx_unlock(&(_sc)->sc_mtx) +#define UKSWITCH_LOCK_ASSERT(_sc, _what) \ + mtx_assert(&(_sc)->sc_mtx, (_what)) +#define UKSWITCH_TRYLOCK(_sc) \ + mtx_trylock(&(_sc)->sc_mtx) + +#if defined(DEBUG) +#define DPRINTF(dev, args...) device_printf(dev, args) +#else +#define DPRINTF(dev, args...) +#endif + +static inline int ukswitch_portforphy(struct ukswitch_softc *, int); +static void ukswitch_tick(void *); +static int ukswitch_ifmedia_upd(struct ifnet *); +static void ukswitch_ifmedia_sts(struct ifnet *, struct ifmediareq *); + +static int +ukswitch_probe(device_t dev) +{ + struct ukswitch_softc *sc; + + sc = device_get_softc(dev); + bzero(sc, sizeof(*sc)); + + device_set_desc_copy(dev, "Generic MDIO switch driver"); + return (BUS_PROBE_DEFAULT); +} + +static int +ukswitch_attach_phys(struct ukswitch_softc *sc) +{ + int phy, port = 0, err = 0; + char name[IFNAMSIZ]; + + /* PHYs need an interface, so we generate a dummy one */ + snprintf(name, IFNAMSIZ, "%sport", device_get_nameunit(sc->sc_dev)); + for (phy = 0; phy < MII_NPHY; phy++) { + if (((1 << phy) & sc->phymask) == 0) + continue; + sc->ifpport[phy] = port; + sc->portphy[port] = phy; +// if (phy == sc->cpuport) +// sc->info.es_cpuport = port; + sc->ifp[port] = if_alloc(IFT_ETHER); + sc->ifp[port]->if_softc = sc; + sc->ifp[port]->if_flags |= IFF_UP | IFF_BROADCAST | + IFF_DRV_RUNNING | IFF_SIMPLEX; + sc->ifname[port] = malloc(strlen(name)+1, M_UKSWITCH, M_WAITOK); + bcopy(name, sc->ifname[port], strlen(name)+1); + if_initname(sc->ifp[port], sc->ifname[port], port); + sc->miibus[port] = malloc(sizeof(device_t), M_UKSWITCH, + M_WAITOK | M_ZERO); + err = mii_attach(sc->sc_dev, sc->miibus[port], sc->ifp[port], + ukswitch_ifmedia_upd, ukswitch_ifmedia_sts, \ + BMSR_DEFCAPMASK, phy, MII_OFFSET_ANY, 0); + DPRINTF(sc->sc_dev, "%s attached to pseudo interface %s\n", + device_get_nameunit(*sc->miibus[port]), + sc->ifp[port]->if_xname); + if (err != 0) { + device_printf(sc->sc_dev, + "attaching PHY %d failed\n", + phy); + break; + } + sc->info.es_nports = port + 1; + if (++port >= sc->numports) + break; + } + return (err); +} + +static int +ukswitch_attach(device_t dev) +{ + struct ukswitch_softc *sc; + int err = 0; + + sc = device_get_softc(dev); + + sc->sc_dev = dev; + mtx_init(&sc->sc_mtx, "ukswitch", NULL, MTX_DEF); + strlcpy(sc->info.es_name, device_get_desc(dev), + sizeof(sc->info.es_name)); + + /* XXX Defaults */ + sc->numports = 6; + sc->phymask = 0x0f; + sc->cpuport = 5; + sc->media = 100; + + (void) resource_int_value(device_get_name(dev), device_get_unit(dev), + "numports", &sc->numports); + (void) resource_int_value(device_get_name(dev), device_get_unit(dev), + "phymask", &sc->phymask); + (void) resource_int_value(device_get_name(dev), device_get_unit(dev), + "cpuport", &sc->cpuport); + (void) resource_int_value(device_get_name(dev), device_get_unit(dev), + "media", &sc->media); + + /* Support only fast and giga ethernet. */ + if (sc->media != 100 && sc->media != 1000) + sc->media = 100; + + /* Always attach the cpu port. */ + sc->phymask |= (1 << sc->cpuport); +// sc->info.es_cpuport = sc->cpuport; + + /* We do not support any vlan groups. */ + sc->info.es_nvlangroups = 0; + + sc->ifp = malloc(sizeof(struct ifnet *) * sc->numports, M_UKSWITCH, + M_WAITOK | M_ZERO); + sc->ifname = malloc(sizeof(char *) * sc->numports, M_UKSWITCH, + M_WAITOK | M_ZERO); + sc->miibus = malloc(sizeof(device_t *) * sc->numports, M_UKSWITCH, + M_WAITOK | M_ZERO); + sc->portphy = malloc(sizeof(int) * sc->numports, M_UKSWITCH, + M_WAITOK | M_ZERO); + + /* + * Attach the PHYs and complete the bus enumeration. + */ + err = ukswitch_attach_phys(sc); + if (err != 0) + return (err); + + bus_generic_probe(dev); + bus_enumerate_hinted_children(dev); + err = bus_generic_attach(dev); + if (err != 0) + return (err); + + callout_init(&sc->callout_tick, 0); + + ukswitch_tick(sc); + + return (err); +} + +static int +ukswitch_detach(device_t dev) +{ + struct ukswitch_softc *sc = device_get_softc(dev); + int i, port; + + callout_drain(&sc->callout_tick); + + for (i=0; i < MII_NPHY; i++) { + if (((1 << i) & sc->phymask) == 0) + continue; + port = ukswitch_portforphy(sc, i); + if (sc->miibus[port] != NULL) + device_delete_child(dev, (*sc->miibus[port])); + if (sc->ifp[port] != NULL) + if_free(sc->ifp[port]); + free(sc->ifname[port], M_UKSWITCH); + free(sc->miibus[port], M_UKSWITCH); + } + + free(sc->portphy, M_UKSWITCH); + free(sc->miibus, M_UKSWITCH); + free(sc->ifname, M_UKSWITCH); + free(sc->ifp, M_UKSWITCH); + + bus_generic_detach(dev); + mtx_destroy(&sc->sc_mtx); + + return (0); +} + +/* + * Convert PHY number to port number. + */ +static inline int +ukswitch_portforphy(struct ukswitch_softc *sc, int phy) +{ + + return (sc->ifpport[phy]); +} + +static inline struct mii_data * +ukswitch_miiforport(struct ukswitch_softc *sc, int port) +{ + + if (port < 0 || port > sc->numports) + return (NULL); + return (device_get_softc(*sc->miibus[port])); +} + +static inline struct ifnet * +ukswitch_ifpforport(struct ukswitch_softc *sc, int port) +{ + + if (port < 0 || port > sc->numports) + return (NULL); + return (sc->ifp[port]); +} + +/* + * Poll the status for all PHYs. + */ +static void +ukswitch_miipollstat(struct ukswitch_softc *sc) +{ + int i, port; + struct mii_data *mii; + struct mii_softc *miisc; + + UKSWITCH_LOCK_ASSERT(sc, MA_NOTOWNED); + + for (i = 0; i < MII_NPHY; i++) { + if (((1 << i) & sc->phymask) == 0) + continue; + port = ukswitch_portforphy(sc, i); + if ((*sc->miibus[port]) == NULL) + continue; + mii = device_get_softc(*sc->miibus[port]); + LIST_FOREACH(miisc, &mii->mii_phys, mii_list) { + if (IFM_INST(mii->mii_media.ifm_cur->ifm_media) != + miisc->mii_inst) + continue; + ukphy_status(miisc); + mii_phy_update(miisc, MII_POLLSTAT); + } + } +} + +static void +ukswitch_tick(void *arg) +{ + struct ukswitch_softc *sc = arg; + + ukswitch_miipollstat(sc); + callout_reset(&sc->callout_tick, hz, ukswitch_tick, sc); +} + +static void +ukswitch_lock(device_t dev) +{ + struct ukswitch_softc *sc = device_get_softc(dev); + + UKSWITCH_LOCK_ASSERT(sc, MA_NOTOWNED); + UKSWITCH_LOCK(sc); +} + +static void +ukswitch_unlock(device_t dev) +{ + struct ukswitch_softc *sc = device_get_softc(dev); + + UKSWITCH_LOCK_ASSERT(sc, MA_OWNED); + UKSWITCH_UNLOCK(sc); +} + +static etherswitch_info_t * +ukswitch_getinfo(device_t dev) +{ + struct ukswitch_softc *sc = device_get_softc(dev); + + return (&sc->info); +} + +static int +ukswitch_getport(device_t dev, etherswitch_port_t *p) +{ + struct ukswitch_softc *sc = device_get_softc(dev); + struct mii_data *mii; + struct ifmediareq *ifmr = &p->es_ifmr; + int err; + + if (p->es_port < 0 || p->es_port >= sc->numports) + return (ENXIO); + p->es_vlangroup = 0; + + mii = ukswitch_miiforport(sc, p->es_port); + if (sc->portphy[p->es_port] == sc->cpuport) { + /* fill in fixed values for CPU port */ + ifmr->ifm_count = 0; + if (sc->media == 100) + ifmr->ifm_current = ifmr->ifm_active = + IFM_ETHER | IFM_100_TX | IFM_FDX; + else + ifmr->ifm_current = ifmr->ifm_active = + IFM_ETHER | IFM_1000_T | IFM_FDX; + ifmr->ifm_mask = 0; + ifmr->ifm_status = IFM_ACTIVE | IFM_AVALID; + } else if (mii != NULL) { + err = ifmedia_ioctl(mii->mii_ifp, &p->es_ifr, + &mii->mii_media, SIOCGIFMEDIA); + if (err) + return (err); + } else { + return (ENXIO); + } + return (0); +} + +static int +ukswitch_setport(device_t dev, etherswitch_port_t *p) +{ + struct ukswitch_softc *sc = device_get_softc(dev); + struct ifmedia *ifm; + struct mii_data *mii; + struct ifnet *ifp; + int err; + + if (p->es_port < 0 || p->es_port >= sc->numports) + return (ENXIO); + + if (sc->portphy[p->es_port] == sc->cpuport) + return (ENXIO); + + mii = ukswitch_miiforport(sc, p->es_port); + if (mii == NULL) + return (ENXIO); + + ifp = ukswitch_ifpforport(sc, p->es_port); + + ifm = &mii->mii_media; + err = ifmedia_ioctl(ifp, &p->es_ifr, ifm, SIOCSIFMEDIA); + return (err); +} + +static int +ukswitch_getvgroup(device_t dev, etherswitch_vlangroup_t *vg) +{ + + /* Not supported. */ + vg->es_vid = 0; + vg->es_member_ports = 0; + vg->es_untagged_ports = 0; + vg->es_fid = 0; + return (0); +} + +static int +ukswitch_setvgroup(device_t dev, etherswitch_vlangroup_t *vg) +{ + + /* Not supported. */ + return (0); +} + +static void +ukswitch_statchg(device_t dev) +{ + + DPRINTF(dev, "%s\n", __func__); +} + +static int +ukswitch_ifmedia_upd(struct ifnet *ifp) +{ + struct ukswitch_softc *sc = ifp->if_softc; + struct mii_data *mii = ukswitch_miiforport(sc, ifp->if_dunit); + + DPRINTF(sc->sc_dev, "%s\n", __func__); + if (mii == NULL) + return (ENXIO); + mii_mediachg(mii); + return (0); +} + +static void +ukswitch_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr) +{ + struct ukswitch_softc *sc = ifp->if_softc; + struct mii_data *mii = ukswitch_miiforport(sc, ifp->if_dunit); + + DPRINTF(sc->sc_dev, "%s\n", __func__); + + if (mii == NULL) + return; + mii_pollstat(mii); + ifmr->ifm_active = mii->mii_media_active; + ifmr->ifm_status = mii->mii_media_status; +} + +static int +ukswitch_readphy(device_t dev, int phy, int reg) +{ + struct ukswitch_softc *sc; + int data; + + sc = device_get_softc(dev); + UKSWITCH_LOCK_ASSERT(sc, MA_NOTOWNED); + + if (phy < 0 || phy >= 32) + return (ENXIO); + if (reg < 0 || reg >= 32) + return (ENXIO); + + UKSWITCH_LOCK(sc); + data = MDIO_READREG(device_get_parent(dev), phy, reg); + UKSWITCH_UNLOCK(sc); + + return (data); +} + +static int +ukswitch_writephy(device_t dev, int phy, int reg, int data) +{ + struct ukswitch_softc *sc; + int err; + + sc = device_get_softc(dev); + UKSWITCH_LOCK_ASSERT(sc, MA_NOTOWNED); + + if (phy < 0 || phy >= 32) + return (ENXIO); + if (reg < 0 || reg >= 32) + return (ENXIO); + + UKSWITCH_LOCK(sc); + err = MDIO_WRITEREG(device_get_parent(dev), phy, reg, data); + UKSWITCH_UNLOCK(sc); + + return (err); +} + +static int +ukswitch_readreg(device_t dev, int addr) +{ + struct ukswitch_softc *sc; + + sc = device_get_softc(dev); + UKSWITCH_LOCK_ASSERT(sc, MA_OWNED); + + /* Not supported. */ + return (0); +} + +static int +ukswitch_writereg(device_t dev, int addr, int value) +{ + struct ukswitch_softc *sc; + + sc = device_get_softc(dev); + UKSWITCH_LOCK_ASSERT(sc, MA_OWNED); + + /* Not supported. */ + return (0); +} + +static device_method_t ukswitch_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, ukswitch_probe), + DEVMETHOD(device_attach, ukswitch_attach), + DEVMETHOD(device_detach, ukswitch_detach), + + /* bus interface */ + DEVMETHOD(bus_add_child, device_add_child_ordered), + + /* MII interface */ + DEVMETHOD(miibus_readreg, ukswitch_readphy), + DEVMETHOD(miibus_writereg, ukswitch_writephy), + DEVMETHOD(miibus_statchg, ukswitch_statchg), + + /* MDIO interface */ + DEVMETHOD(mdio_readreg, ukswitch_readphy), + DEVMETHOD(mdio_writereg, ukswitch_writephy), + + /* etherswitch interface */ + DEVMETHOD(etherswitch_lock, ukswitch_lock), + DEVMETHOD(etherswitch_unlock, ukswitch_unlock), + DEVMETHOD(etherswitch_getinfo, ukswitch_getinfo), + DEVMETHOD(etherswitch_readreg, ukswitch_readreg), + DEVMETHOD(etherswitch_writereg, ukswitch_writereg), + DEVMETHOD(etherswitch_readphyreg, ukswitch_readphy), + DEVMETHOD(etherswitch_writephyreg, ukswitch_writephy), + DEVMETHOD(etherswitch_getport, ukswitch_getport), + DEVMETHOD(etherswitch_setport, ukswitch_setport), + DEVMETHOD(etherswitch_getvgroup, ukswitch_getvgroup), + DEVMETHOD(etherswitch_setvgroup, ukswitch_setvgroup), + + DEVMETHOD_END +}; + +DEFINE_CLASS_0(ukswitch, ukswitch_driver, ukswitch_methods, + sizeof(struct ukswitch_softc)); +static devclass_t ukswitch_devclass; + +DRIVER_MODULE(ukswitch, mdio, ukswitch_driver, ukswitch_devclass, 0, 0); +DRIVER_MODULE(miibus, ukswitch, miibus_driver, miibus_devclass, 0, 0); +DRIVER_MODULE(mdio, ukswitch, mdio_driver, mdio_devclass, 0, 0); +DRIVER_MODULE(etherswitch, ukswitch, etherswitch_driver, etherswitch_devclass, 0, 0); +MODULE_VERSION(ukswitch, 1); +MODULE_DEPEND(ukswitch, miibus, 1, 1, 1); /* XXX which versions? */ +MODULE_DEPEND(ukswitch, etherswitch, 1, 1, 1); /* XXX which versions? */ From owner-svn-src-all@FreeBSD.ORG Fri Apr 19 18:37:50 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 71C7DBE1; Fri, 19 Apr 2013 18:37:50 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 63BA21396; Fri, 19 Apr 2013 18:37:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3JIbo0V065125; Fri, 19 Apr 2013 18:37:50 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3JIbois065123; Fri, 19 Apr 2013 18:37:50 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201304191837.r3JIbois065123@svn.freebsd.org> From: Sean Bruno Date: Fri, 19 Apr 2013 18: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 Subject: svn commit: r249652 - stable/8/sys/dev/ciss X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Apr 2013 18:37:50 -0000 Author: sbruno Date: Fri Apr 19 18:37:49 2013 New Revision: 249652 URL: http://svnweb.freebsd.org/changeset/base/249652 Log: MFC r249170 Notify CAM on state* change to a logical volume not status. This resolves the issues reported regarding camcontrol devlist not showing the rebuild states of volumes unless an explicit camcontrol rescan was executed. Modified: stable/8/sys/dev/ciss/ciss.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/ciss/ (props changed) Modified: stable/8/sys/dev/ciss/ciss.c ============================================================================== --- stable/8/sys/dev/ciss/ciss.c Fri Apr 19 17:50:38 2013 (r249651) +++ stable/8/sys/dev/ciss/ciss.c Fri Apr 19 18:37:49 2013 (r249652) @@ -3960,7 +3960,8 @@ static void ciss_notify_logical(struct ciss_softc *sc, struct ciss_notify *cn) { struct ciss_ldrive *ld; - int ostatus, bus, target; + int bus, target; + int rescan_ld; debug_called(2); @@ -3983,7 +3984,6 @@ ciss_notify_logical(struct ciss_softc *s /* * Update our idea of the drive's status. */ - ostatus = ciss_decode_ldrive_status(cn->data.logical_status.previous_state); ld->cl_status = ciss_decode_ldrive_status(cn->data.logical_status.new_state); if (ld->cl_lstatus != NULL) ld->cl_lstatus->status = cn->data.logical_status.new_state; @@ -3991,7 +3991,9 @@ ciss_notify_logical(struct ciss_softc *s /* * Have CAM rescan the drive if its status has changed. */ - if (ostatus != ld->cl_status) { + rescan_ld = (cn->data.logical_status.previous_state != + cn->data.logical_status.new_state) ? 1 : 0; + if (rescan_ld) { ld->cl_update = 1; ciss_notify_rescan_logical(sc); } From owner-svn-src-all@FreeBSD.ORG Fri Apr 19 18:39:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 31B9BE87; Fri, 19 Apr 2013 18:39:18 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 237CB148A; Fri, 19 Apr 2013 18:39:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3JIdIeu067548; Fri, 19 Apr 2013 18:39:18 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3JIdIFm067546; Fri, 19 Apr 2013 18:39:18 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201304191839.r3JIdIFm067546@svn.freebsd.org> From: Sean Bruno Date: Fri, 19 Apr 2013 18:39:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r249653 - stable/7/sys/dev/ciss X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Apr 2013 18:39:18 -0000 Author: sbruno Date: Fri Apr 19 18:39:17 2013 New Revision: 249653 URL: http://svnweb.freebsd.org/changeset/base/249653 Log: MFC r249170 Notify CAM on state* change to a logical volume not status. This resolves the issues reported regarding camcontrol devlist not showing the rebuild states of volumes unless an explicit camcontrol rescan was executed. Modified: stable/7/sys/dev/ciss/ciss.c Directory Properties: stable/7/sys/ (props changed) Modified: stable/7/sys/dev/ciss/ciss.c ============================================================================== --- stable/7/sys/dev/ciss/ciss.c Fri Apr 19 18:37:49 2013 (r249652) +++ stable/7/sys/dev/ciss/ciss.c Fri Apr 19 18:39:17 2013 (r249653) @@ -3661,7 +3661,8 @@ static void ciss_notify_logical(struct ciss_softc *sc, struct ciss_notify *cn) { struct ciss_ldrive *ld; - int ostatus, bus, target; + int bus, target; + int rescan_ld; debug_called(2); @@ -3684,7 +3685,6 @@ ciss_notify_logical(struct ciss_softc *s /* * Update our idea of the drive's status. */ - ostatus = ciss_decode_ldrive_status(cn->data.logical_status.previous_state); ld->cl_status = ciss_decode_ldrive_status(cn->data.logical_status.new_state); if (ld->cl_lstatus != NULL) ld->cl_lstatus->status = cn->data.logical_status.new_state; @@ -3692,7 +3692,9 @@ ciss_notify_logical(struct ciss_softc *s /* * Have CAM rescan the drive if its status has changed. */ - if (ostatus != ld->cl_status) { + rescan_ld = (cn->data.logical_status.previous_state != + cn->data.logical_status.new_state) ? 1 : 0; + if (rescan_ld) { ld->cl_update = 1; ciss_notify_rescan_logical(sc); } From owner-svn-src-all@FreeBSD.ORG Fri Apr 19 19:28:49 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8DB8C1B5; Fri, 19 Apr 2013 19:28:49 +0000 (UTC) (envelope-from hiren@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7C58F18AB; Fri, 19 Apr 2013 19:28:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3JJSn37053762; Fri, 19 Apr 2013 19:28:49 GMT (envelope-from hiren@svn.freebsd.org) Received: (from hiren@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3JJSn2f053749; Fri, 19 Apr 2013 19:28:49 GMT (envelope-from hiren@svn.freebsd.org) Message-Id: <201304191928.r3JJSn2f053749@svn.freebsd.org> From: Hiren Panchasara Date: Fri, 19 Apr 2013 19:28:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249655 - in stable/9: lib/libpmc sys/dev/hwpmc sys/sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Apr 2013 19:28:49 -0000 Author: hiren Date: Fri Apr 19 19:28:48 2013 New Revision: 249655 URL: http://svnweb.freebsd.org/changeset/base/249655 Log: MFC: r248842 Update hwpmc to support Haswell class processors. 0x3C: /* Per Intel document 325462-045US 01/2013. */ Add manpage to document all the goodness that is available in this processor model. Approved by: sbruno (mentor) Added: stable/9/lib/libpmc/pmc.haswell.3 (contents, props changed) stable/9/lib/libpmc/pmc.haswelluc.3 (contents, props changed) Modified: stable/9/lib/libpmc/Makefile stable/9/lib/libpmc/libpmc.c stable/9/sys/dev/hwpmc/hwpmc_core.c stable/9/sys/dev/hwpmc/hwpmc_intel.c stable/9/sys/dev/hwpmc/hwpmc_uncore.c stable/9/sys/dev/hwpmc/pmc_events.h stable/9/sys/sys/pmc.h Directory Properties: stable/9/lib/libpmc/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/lib/libpmc/Makefile ============================================================================== --- stable/9/lib/libpmc/Makefile Fri Apr 19 18:45:03 2013 (r249654) +++ stable/9/lib/libpmc/Makefile Fri Apr 19 19:28:48 2013 (r249655) @@ -27,6 +27,8 @@ MAN+= pmc.soft.3 MAN+= pmc.atom.3 MAN+= pmc.core.3 MAN+= pmc.core2.3 +MAN+= pmc.haswell.3 +MAN+= pmc.haswelluc.3 MAN+= pmc.iaf.3 MAN+= pmc.ivybridge.3 MAN+= pmc.ivybridgexeon.3 Modified: stable/9/lib/libpmc/libpmc.c ============================================================================== --- stable/9/lib/libpmc/libpmc.c Fri Apr 19 18:45:03 2013 (r249654) +++ stable/9/lib/libpmc/libpmc.c Fri Apr 19 19:28:48 2013 (r249655) @@ -182,6 +182,11 @@ static const struct pmc_event_descr core __PMC_EV_ALIAS_COREI7() }; +static const struct pmc_event_descr haswell_event_table[] = +{ + __PMC_EV_ALIAS_HASWELL() +}; + static const struct pmc_event_descr ivybridge_event_table[] = { __PMC_EV_ALIAS_IVYBRIDGE() @@ -212,6 +217,11 @@ static const struct pmc_event_descr core __PMC_EV_ALIAS_COREI7UC() }; +static const struct pmc_event_descr haswelluc_event_table[] = +{ + __PMC_EV_ALIAS_HASWELLUC() +}; + static const struct pmc_event_descr sandybridgeuc_event_table[] = { __PMC_EV_ALIAS_SANDYBRIDGEUC() @@ -236,6 +246,7 @@ PMC_MDEP_TABLE(atom, IAP, PMC_CLASS_SOFT PMC_MDEP_TABLE(core, IAP, PMC_CLASS_SOFT, PMC_CLASS_TSC); PMC_MDEP_TABLE(core2, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC); PMC_MDEP_TABLE(corei7, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC, PMC_CLASS_UCF, PMC_CLASS_UCP); +PMC_MDEP_TABLE(haswell, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC, PMC_CLASS_UCF, PMC_CLASS_UCP); PMC_MDEP_TABLE(ivybridge, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC); PMC_MDEP_TABLE(ivybridge_xeon, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC); PMC_MDEP_TABLE(sandybridge, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC, PMC_CLASS_UCF, PMC_CLASS_UCP); @@ -275,6 +286,7 @@ PMC_CLASS_TABLE_DESC(atom, IAP, atom, ia PMC_CLASS_TABLE_DESC(core, IAP, core, iap); PMC_CLASS_TABLE_DESC(core2, IAP, core2, iap); PMC_CLASS_TABLE_DESC(corei7, IAP, corei7, iap); +PMC_CLASS_TABLE_DESC(haswell, IAP, haswell, iap); PMC_CLASS_TABLE_DESC(ivybridge, IAP, ivybridge, iap); PMC_CLASS_TABLE_DESC(ivybridge_xeon, IAP, ivybridge_xeon, iap); PMC_CLASS_TABLE_DESC(sandybridge, IAP, sandybridge, iap); @@ -282,6 +294,7 @@ PMC_CLASS_TABLE_DESC(sandybridge_xeon, I PMC_CLASS_TABLE_DESC(westmere, IAP, westmere, iap); PMC_CLASS_TABLE_DESC(ucf, UCF, ucf, ucf); PMC_CLASS_TABLE_DESC(corei7uc, UCP, corei7uc, ucp); +PMC_CLASS_TABLE_DESC(haswelluc, UCP, haswelluc, ucp); PMC_CLASS_TABLE_DESC(sandybridgeuc, UCP, sandybridgeuc, ucp); PMC_CLASS_TABLE_DESC(westmereuc, UCP, westmereuc, ucp); #endif @@ -579,6 +592,8 @@ static struct pmc_event_alias core2_alia #define atom_aliases_without_iaf core2_aliases_without_iaf #define corei7_aliases core2_aliases #define corei7_aliases_without_iaf core2_aliases_without_iaf +#define haswell_aliases core2_aliases +#define haswell_aliases_without_iaf core2_aliases_without_iaf #define ivybridge_aliases core2_aliases #define ivybridge_aliases_without_iaf core2_aliases_without_iaf #define ivybridge_xeon_aliases core2_aliases @@ -737,6 +752,31 @@ static struct pmc_masks iap_rsp_mask_sb_ NULLMASK }; +static struct pmc_masks iap_rsp_mask_haswell[] = { + PMCMASK(REQ_DMND_DATA_RD, (1ULL << 0)), + PMCMASK(REQ_DMND_RFO, (1ULL << 1)), + PMCMASK(REQ_DMND_IFETCH, (1ULL << 2)), + PMCMASK(REQ_PF_DATA_RD, (1ULL << 4)), + PMCMASK(REQ_PF_RFO, (1ULL << 5)), + PMCMASK(REQ_PF_IFETCH, (1ULL << 6)), + PMCMASK(REQ_OTHER, (1ULL << 15)), + PMCMASK(RES_ANY, (1ULL << 16)), + PMCMASK(RES_SUPPLIER_SUPP, (1ULL << 17)), + PMCMASK(RES_SUPPLIER_LLC_HITM, (1ULL << 18)), + PMCMASK(RES_SUPPLIER_LLC_HITE, (1ULL << 19)), + PMCMASK(RES_SUPPLIER_LLC_HITS, (1ULL << 20)), + PMCMASK(RES_SUPPLIER_LLC_HITF, (1ULL << 21)), + PMCMASK(RES_SUPPLIER_LOCAL, (1ULL << 22)), + PMCMASK(RES_SNOOP_SNP_NONE, (1ULL << 31)), + PMCMASK(RES_SNOOP_SNP_NO_NEEDED,(1ULL << 32)), + PMCMASK(RES_SNOOP_SNP_MISS, (1ULL << 33)), + PMCMASK(RES_SNOOP_HIT_NO_FWD, (1ULL << 34)), + PMCMASK(RES_SNOOP_HIT_FWD, (1ULL << 35)), + PMCMASK(RES_SNOOP_HITM, (1ULL << 36)), + PMCMASK(RES_NON_DRAM, (1ULL << 37)), + NULLMASK +}; + static int iap_allocate_pmc(enum pmc_event pe, char *ctrspec, struct pmc_op_pmcallocate *pmc_config) @@ -819,6 +859,11 @@ iap_allocate_pmc(enum pmc_event pe, char n = pmc_parse_mask(iap_rsp_mask_sb_sbx_ib, p, &rsp); } else return (-1); + } else if (cpu_info.pm_cputype == PMC_CPU_INTEL_HASWELL) { + if (KWPREFIXMATCH(p, IAP_KW_RSP "=")) { + n = pmc_parse_mask(iap_rsp_mask_haswell, p, &rsp); + } else + return (-1); } else return (-1); @@ -2679,6 +2724,10 @@ pmc_event_names_of_class(enum pmc_class ev = corei7_event_table; count = PMC_EVENT_TABLE_SIZE(corei7); break; + case PMC_CPU_INTEL_HASWELL: + ev = haswell_event_table; + count = PMC_EVENT_TABLE_SIZE(haswell); + break; case PMC_CPU_INTEL_IVYBRIDGE: ev = ivybridge_event_table; count = PMC_EVENT_TABLE_SIZE(ivybridge); @@ -2716,6 +2765,10 @@ pmc_event_names_of_class(enum pmc_class ev = corei7uc_event_table; count = PMC_EVENT_TABLE_SIZE(corei7uc); break; + case PMC_CPU_INTEL_HASWELL: + ev = haswelluc_event_table; + count = PMC_EVENT_TABLE_SIZE(haswelluc); + break; case PMC_CPU_INTEL_SANDYBRIDGE: ev = sandybridgeuc_event_table; count = PMC_EVENT_TABLE_SIZE(sandybridgeuc); @@ -2979,6 +3032,11 @@ pmc_init(void) pmc_class_table[n++] = &corei7uc_class_table_descr; PMC_MDEP_INIT_INTEL_V2(corei7); break; + case PMC_CPU_INTEL_HASWELL: + pmc_class_table[n++] = &ucf_class_table_descr; + pmc_class_table[n++] = &haswelluc_class_table_descr; + PMC_MDEP_INIT_INTEL_V2(haswell); + break; case PMC_CPU_INTEL_IVYBRIDGE: PMC_MDEP_INIT_INTEL_V2(ivybridge); break; @@ -3119,6 +3177,10 @@ _pmc_name_of_event(enum pmc_event pe, en ev = corei7_event_table; evfence = corei7_event_table + PMC_EVENT_TABLE_SIZE(corei7); break; + case PMC_CPU_INTEL_HASWELL: + ev = haswell_event_table; + evfence = haswell_event_table + PMC_EVENT_TABLE_SIZE(haswell); + break; case PMC_CPU_INTEL_IVYBRIDGE: ev = ivybridge_event_table; evfence = ivybridge_event_table + PMC_EVENT_TABLE_SIZE(ivybridge); Added: stable/9/lib/libpmc/pmc.haswell.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/lib/libpmc/pmc.haswell.3 Fri Apr 19 19:28:48 2013 (r249655) @@ -0,0 +1,975 @@ +.\" Copyright (c) 2013 Hiren Panchasara +.\" 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 March 22, 2013 +.Dt PMC.HASWELL 3 +.Os +.Sh NAME +.Nm pmc.haswell +.Nd measurement events for +.Tn Intel +.Tn Haswsell +family CPUs +.Sh LIBRARY +.Lb libpmc +.Sh SYNOPSIS +.In pmc.h +.Sh DESCRIPTION +.Tn Intel +.Tn "Haswell" +CPUs contain PMCs conforming to version 2 of the +.Tn Intel +performance measurement architecture. +These CPUs may contain up to two classes of PMCs: +.Bl -tag -width "Li PMC_CLASS_IAP" +.It Li PMC_CLASS_IAF +Fixed-function counters that count only one hardware event per counter. +.It Li PMC_CLASS_IAP +Programmable counters that may be configured to count one of a defined +set of hardware events. +.El +.Pp +The number of PMCs available in each class and their widths need to be +determined at run time by calling +.Xr pmc_cpuinfo 3 . +.Pp +Intel Haswell PMCs are documented in +.Rs +.%B "Intel(R) 64 and IA-32 Architectures Software Developer's Manual" +.%T "Combined Volumes: 1, 2A, 2B, 2C, 3A, 3B and 3C" +.%N "Order Number: 325462-045US" +.%D January 2013 +.%Q "Intel Corporation" +.Re +.Ss HASWELL FIXED FUNCTION PMCS +These PMCs and their supported events are documented in +.Xr pmc.iaf 3 . +.Ss HASWELL PROGRAMMABLE PMCS +The programmable PMCs support the following capabilities: +.Bl -column "PMC_CAP_INTERRUPT" "Support" +.It Em Capability Ta Em Support +.It PMC_CAP_CASCADE Ta \&No +.It PMC_CAP_EDGE Ta Yes +.It PMC_CAP_INTERRUPT Ta Yes +.It PMC_CAP_INVERT Ta Yes +.It PMC_CAP_READ Ta Yes +.It PMC_CAP_PRECISE Ta \&No +.It PMC_CAP_SYSTEM Ta Yes +.It PMC_CAP_TAGGING Ta \&No +.It PMC_CAP_THRESHOLD Ta Yes +.It PMC_CAP_USER Ta Yes +.It PMC_CAP_WRITE Ta Yes +.El +.Ss Event Qualifiers +Event specifiers for these PMCs support the following common +qualifiers: +.Bl -tag -width indent +.It Li rsp= Ns Ar value +Configure the Off-core Response bits. +.Bl -tag -width indent +.It Li DMND_DATA_RD +Counts the number of demand and DCU prefetch data reads of full +and partial cachelines as well as demand data page table entry +cacheline reads. Does not count L2 data read prefetches or +instruction fetches. +.It Li REQ_DMND_RFO +Counts the number of demand and DCU prefetch reads for ownership (RFO) +requests generated by a write to data cacheline. Does not count L2 RFO +prefetches. +.It Li REQ_DMND_IFETCH +Counts the number of demand and DCU prefetch instruction cacheline reads. +Does not count L2 code read prefetches. +.It Li REQ_WB +Counts the number of writeback (modified to exclusive) transactions. +.It Li REQ_PF_DATA_RD +Counts the number of data cacheline reads generated by L2 prefetchers. +.It Li REQ_PF_RFO +Counts the number of RFO requests generated by L2 prefetchers. +.It Li REQ_PF_IFETCH +Counts the number of code reads generated by L2 prefetchers. +.It Li REQ_PF_LLC_DATA_RD +L2 prefetcher to L3 for loads. +.It Li REQ_PF_LLC_RFO +RFO requests generated by L2 prefetcher +.It Li REQ_PF_LLC_IFETCH +L2 prefetcher to L3 for instruction fetches. +.It Li REQ_BUS_LOCKS +Bus lock and split lock requests. +.It Li REQ_STRM_ST +Streaming store requests. +.It Li REQ_OTHER +Any other request that crosses IDI, including I/O. +.It Li RES_ANY +Catch all value for any response types. +.It Li RES_SUPPLIER_NO_SUPP +No Supplier Information available. +.It Li RES_SUPPLIER_LLC_HITM +M-state initial lookup stat in L3. +.It Li RES_SUPPLIER_LLC_HITE +E-state. +.It Li RES_SUPPLIER_LLC_HITS +S-state. +.It Li RES_SUPPLIER_LLC_HITF +F-state. +.It Li RES_SUPPLIER_LOCAL +Local DRAM Controller. +.It Li RES_SNOOP_SNP_NONE +No details on snoop-related information. +.It Li RES_SNOOP_SNP_NO_NEEDED +No snoop was needed to satisfy the request. +.It Li RES_SNOOP_SNP_MISS +A snoop was needed and it missed all snooped caches: +-For LLC Hit, ReslHitl was returned by all cores +-For LLC Miss, Rspl was returned by all sockets and data was returned from +DRAM. +.It Li RES_SNOOP_HIT_NO_FWD +A snoop was needed and it hits in at least one snooped cache. Hit denotes a +cache-line was valid before snoop effect. This includes: +-Snoop Hit w/ Invalidation (LLC Hit, RFO) +-Snoop Hit, Left Shared (LLC Hit/Miss, IFetch/Data_RD) +-Snoop Hit w/ Invalidation and No Forward (LLC Miss, RFO Hit S) +In the LLC Miss case, data is returned from DRAM. +.It Li RES_SNOOP_HIT_FWD +A snoop was needed and data was forwarded from a remote socket. +This includes: +-Snoop Forward Clean, Left Shared (LLC Hit/Miss, IFetch/Data_RD/RFT). +.It Li RES_SNOOP_HITM +A snoop was needed and it HitM-ed in local or remote cache. HitM denotes a +cache-line was in modified state before effect as a results of snoop. This +includes: +-Snoop HitM w/ WB (LLC miss, IFetch/Data_RD) +-Snoop Forward Modified w/ Invalidation (LLC Hit/Miss, RFO) +-Snoop MtoS (LLC Hit, IFetch/Data_RD). +.It Li RES_NON_DRAM +Target was non-DRAM system address. This includes MMIO transactions. +.El +.It Li cmask= Ns Ar value +Configure the PMC to increment only if the number of configured +events measured in a cycle is greater than or equal to +.Ar value . +.It Li edge +Configure the PMC to count the number of de-asserted to asserted +transitions of the conditions expressed by the other qualifiers. +If specified, the counter will increment only once whenever a +condition becomes true, irrespective of the number of clocks during +which the condition remains true. +.It Li inv +Invert the sense of comparison when the +.Dq Li cmask +qualifier is present, making the counter increment when the number of +events per cycle is less than the value specified by the +.Dq Li cmask +qualifier. +.It Li os +Configure the PMC to count events happening at processor privilege +level 0. +.It Li usr +Configure the PMC to count events occurring at privilege levels 1, 2 +or 3. +.El +.Pp +If neither of the +.Dq Li os +or +.Dq Li usr +qualifiers are specified, the default is to enable both. +.Ss Event Specifiers (Programmable PMCs) +Haswell programmable PMCs support the following events: +.Bl -tag -width indent +.It Li LD_BLOCKS.STORE_FORWARD +.Pq Event 03H , Umask 02H +Loads blocked by overlapping with store buffer that +cannot be forwarded. +.It Li MISALIGN_MEM_REF.LOADS +.Pq Event 05H , Umask 01H +Speculative cache-line split load uops dispatched to +L1D. +.It Li MISALIGN_MEM_REF.STORES +.Pq Event 05H , Umask 02H +Speculative cache-line split Store-address uops +dispatched to L1D. +.It Li LD_BLOCKS_PARTIAL.ADDRESS_ALIAS +.Pq Event 07H , Umask 01H +False dependencies in MOB due to partial compare +on address. +.It Li DTLB_LOAD_MISSES.MISS_CAUSES_A_WALK +.Pq Event 08H , Umask 01H +Misses in all TLB levels that cause a page walk of any +page size. +.It Li DTLB_LOAD_MISSES.WALK_COMPLETED_4K +.Pq Event 08H , Umask 02H +Completed page walks due to demand load misses +that caused 4K page walks in any TLB levels. +.It Li DTLB_LOAD_MISSES.WALK_COMPLETED_2M_4K +.Pq Event 08H , Umask 02H +Completed page walks due to demand load misses +that caused 2M/4M page walks in any TLB levels. +.It Li DTLB_LOAD_MISSES.WALK_COMPLETED +.Pq Event 08H , Umask 0EH +Completed page walks in any TLB of any page size +due to demand load misses +.It Li DTLB_LOAD_MISSES.WALK_DURATION +.Pq Event 08H , Umask 10H +Cycle PMH is busy with a walk. +.It Li DTLB_LOAD_MISSES.STLB_HIT_4K +.Pq Event 08H , Umask 20H +Load misses that missed DTLB but hit STLB (4K). +.It Li DTLB_LOAD_MISSES.STLB_HIT_2M +.Pq Event 08H , Umask 40H +Load misses that missed DTLB but hit STLB (2M). +.It Li DTLB_LOAD_MISSES.STLB_HIT +.Pq Event 08H , Umask 60H +Number of cache load STLB hits. No page walk. +.It Li DTLB_LOAD_MISSES.PDE_CACHE_MISS +.Pq Event 08H , Umask 80H +DTLB demand load misses with low part of linear-to- +physical address translation missed +.It Li INT_MISC.RECOVERY_CYCLES +.Pq Event 0DH , Umask 03H +Cycles waiting to recover after Machine Clears +except JEClear. Set Cmask= 1. +.It Li UOPS_ISSUED.ANY +.Pq Event 0EH , Umask 01H +ncrements each cycle the # of Uops issued by the +RAT to RS. +Set Cmask = 1, Inv = 1, Any= 1to count stalled cycles +of this core. +.It Li UOPS_ISSUED.FLAGS_MERGE +.Pq Event 0EH , Umask 10H +Number of flags-merge uops allocated. Such uops +adds delay. +.It Li UOPS_ISSUED.SLOW_LEA +.Pq Event 0EH , Umask 20H +Number of slow LEA or similar uops allocated. Such +uop has 3 sources (e.g. 2 sources + immediate) +regardless if as a result of LEA instruction or not. +.It Li UOPS_ISSUED.SiNGLE_MUL +.Pq Event 0EH , Umask 40H +Number of multiply packed/scalar single precision +uops allocated. +.It Li L2_RQSTS.DEMAND_DATA_RD_MISS +.Pq Event 24H , Umask 21H +Demand Data Read requests that missed L2, no +rejects. +.It Li L2_RQSTS.DEMAND_DATA_RD_HIT +.Pq Event 24H , Umask 41H +Demand Data Read requests that hit L2 cache. +.It Li L2_RQSTS.ALL_DEMAND_DATA_RD +.Pq Event 24H , Umask E1H +Counts any demand and L1 HW prefetch data load +requests to L2. +.It Li L2_RQSTS.RFO_HIT +.Pq Event 24H , Umask 42H +Counts the number of store RFO requests that hit +the L2 cache. +.It Li L2_RQSTS.RFO_MISS +.Pq Event 24H , Umask 22H +Counts the number of store RFO requests that miss +the L2 cache. +.It Li L2_RQSTS.ALL_RFO +.Pq Event 24H , Umask E2H +Counts all L2 store RFO requests. +.It Li L2_RQSTS.CODE_RD_HIT +.Pq Event 24H , Umask 44H +Number of instruction fetches that hit the L2 cache. +.It Li L2_RQSTS.CODE_RD_MISS +.Pq Event 24H , Umask 24H +Number of instruction fetches that missed the L2 +cache. +.It Li L2_RQSTS.ALL_DEMAND_MISS +.Pq Event 24H , Umask 27H +Demand requests that miss L2 cache. +.It Li L2_RQSTS.ALL_DEMAND_REFERENCES +.Pq Event 24H , Umask E7H +Demand requests to L2 cache. +.It Li L2_RQSTS.ALL_CODE_RD +.Pq Event 24H , Umask E4H +Counts all L2 code requests. +.It Li L2_RQSTS.L2_PF_HIT +.Pq Event 24H , Umask 50H +Counts all L2 HW prefetcher requests that hit L2. +.It Li L2_RQSTS.L2_PF_MISS +.Pq Event 24H , Umask 30H +Counts all L2 HW prefetcher requests that missed +L2. +.It Li L2_RQSTS.ALL_PF +.Pq Event 24H , Umask F8H +Counts all L2 HW prefetcher requests. +.It Li L2_RQSTS.MISS +.Pq Event 24H , Umask 3FH +All requests that missed L2. +.It Li L2_RQSTS.REFERENCES +.Pq Event 24H , Umask FFH +All requests to L2 cache. +.It Li L2_DEMAND_RQSTS.WB_HIT +.Pq Event 27H , Umask 50H +Not rejected writebacks that hit L2 cache +.It Li LONGEST_LAT_CACHE.REFERENCE +.Pq Event 2EH , Umask 4FH +This event counts requests originating from the core +that reference a cache line in the last level cache. +.It Li LONGEST_LAT_CACHE.MISS +.Pq Event 2EH , Umask 41H +This event counts each cache miss condition for +references to the last level cache. +.It Li CPU_CLK_UNHALTED.THREAD_P +.Pq Event 3CH , Umask 00H +Counts the number of thread cycles while the thread +is not in a halt state. The thread enters the halt state +when it is running the HLT instruction. The core +frequency may change from time to time due to +power or thermal throttling. +.It Li CPU_CLK_THREAD_UNHALTED.REF_XCLK +.Pq Event 3CH , Umask 01H +Increments at the frequency of XCLK (100 MHz) +when not halted. +.It Li L1D_PEND_MISS.PENDING +.Pq Event 48H , Umask 01H +Increments the number of outstanding L1D misses +every cycle. Set Cmaks = 1 and Edge =1 to count +occurrences. +.It Li DTLB_STORE_MISSES.MISS_CAUSES_A_WALK +.Pq Event 49H , Umask 01H +Miss in all TLB levels causes an page walk of any +page size (4K/2M/4M/1G). +.It Li DTLB_STORE_MISSES.WALK_COMPLETED_4K +.Pq Event 49H , Umask 02H +Completed page walks due to store misses in one or +more TLB levels of 4K page structure. +.It Li DTLB_STORE_MISSES.WALK_COMPLETED_2M_4M +.Pq Event 49H , Umask 04H +Completed page walks due to store misses in one or +more TLB levels of 2M/4M page structure. +.It Li DTLB_STORE_MISSES.WALK_COMPLETED +.Pq Event 49H , Umask 0EH +Completed page walks due to store miss in any TLB +levels of any page size (4K/2M/4M/1G). +.It Li DTLB_STORE_MISSES.WALK_DURATION +.Pq Event 49H , Umask 10H +Cycles PMH is busy with this walk. +.It Li DTLB_STORE_MISSES.STLB_HIT_4K +.Pq Event 49H , Umask 20H +Store misses that missed DTLB but hit STLB (4K). +.It Li DTLB_STORE_MISSES.STLB_HIT_2M +.Pq Event 49H , Umask 40H +Store misses that missed DTLB but hit STLB (2M). +.It Li DTLB_STORE_MISSES.STLB_HIT +.Pq Event 49H , Umask 60H +Store operations that miss the first TLB level but hit +the second and do not cause page walks. +.It Li DTLB_STORE_MISSES.PDE_CACHE_MISS +.Pq Event 49H , Umask 80H +DTLB store misses with low part of linear-to-physical +address translation missed. +.It Li LOAD_HIT_PRE.SW_PF +.Pq Event 4CH , Umask 01H +Non-SW-prefetch load dispatches that hit fill buffer +allocated for S/W prefetch. +.It Li LOAD_HIT_PRE.HW_PF +.Pq Event 4CH , Umask 02H +Non-SW-prefetch load dispatches that hit fill buffer +allocated for H/W prefetch. +.It Li L1D.REPLACEMENT +.Pq Event 51H , Umask 01H +Counts the number of lines brought into the L1 data +cache. +.It Li MOVE_ELIMINATION.INT_NOT_ELIMINATED +.Pq Event 58H , Umask 04H +Number of integer Move Elimination candidate uops +that were not eliminated. +.It Li MOVE_ELIMINATION.SMID_NOT_ELIMINATED +.Pq Event 58H , Umask 08H +Number of SIMD Move Elimination candidate uops +that were not eliminated. +.It Li MOVE_ELIMINATION.INT_ELIMINATED +.Pq Event 58H , Umask 01H +Unhalted core cycles when the thread is in ring 0. +.It Li MOVE_ELIMINATION.SMID_ELIMINATED +.Pq Event 58H , Umask 02H +Number of SIMD Move Elimination candidate uops +that were eliminated. +.It Li CPL_CYCLES.RING0 +.Pq Event 5CH , Umask 02H +Unhalted core cycles when the thread is in ring 0. +.It Li CPL_CYCLES.RING123 +.Pq Event 5CH , Umask 01H +Unhalted core cycles when the thread is not in ring 0. +.It Li RS_EVENTS.EMPTY_CYCLES +.Pq Event 5EH , Umask 01H +Cycles the RS is empty for the thread. +.It Li OFFCORE_REQUESTS_OUTSTANDING.DEMAND_DATA_RD +.Pq Event 60H , Umask 01H +Offcore outstanding Demand Data Read transactions +in SQ to uncore. Set Cmask=1 to count cycles. +.It Li OFFCORE_REQUESTS_OUTSTANDING.DEMAND_CORE_RD +.Pq Event 60H , Umask 02H +Offcore outstanding Demand code Read transactions +in SQ to uncore. Set Cmask=1 to count cycles. +.It Li OFFCORE_REQUESTS_OUTSTANDING.DEMAND_RFO +.Pq Event 60H , Umask 04H +Offcore outstanding RFO store transactions in SQ to +uncore. Set Cmask=1 to count cycles. +.It Li OFFCORE_REQUESTS_OUTSTANDING.ALL_DATA_RD +.Pq Event 60H , Umask 08H +Offcore outstanding cacheable data read +transactions in SQ to uncore. Set Cmask=1 to count +cycles. +.It Li LOCK_CYCLES.SPLIT_LOCK_UC_LOCK_DURATION +.Pq Event 63H , Umask 01H +Cycles in which the L1D and L2 are locked, due to a +UC lock or split lock. +.It Li LOCK_CYCLES.CACHE_LOCK_DURATION +.Pq Event 63H , Umask 02H +Cycles in which the L1D is locked. +.It Li IDQ.EMPTY +.Pq Event 79H , Umask 02H +Counts cycles the IDQ is empty. +.It Li IDQ.MITE_UOPS +.Pq Event 79H , Umask 04H +Increment each cycle # of uops delivered to IDQ from +MITE path. +Set Cmask = 1 to count cycles. +.It Li IDQ.DSB_UOPS +.Pq Event 79H , Umask 08H +Increment each cycle. # of uops delivered to IDQ +from DSB path. +Set Cmask = 1 to count cycles. +.It Li IDQ.MS_DSB_UOPS +.Pq Event 79H , Umask 10H +Increment each cycle # of uops delivered to IDQ +when MS_busy by DSB. Set Cmask = 1 to count +cycles. Add Edge=1 to count # of delivery. +.It Li IDQ.MS_MITE_UOPS +.Pq Event 79H , Umask 20H +ncrement each cycle # of uops delivered to IDQ +when MS_busy by MITE. Set Cmask = 1 to count +cycles. +.It Li IDQ.MS_UOPS +.Pq Event 79H , Umask 30H +Increment each cycle # of uops delivered to IDQ from +MS by either DSB or MITE. Set Cmask = 1 to count +cycles. +.It Li IDQ.ALL_DSB_CYCLES_ANY_UOPS +.Pq Event 79H , Umask 18H +Counts cycles DSB is delivered at least one uops. Set +Cmask = 1. +.It Li IDQ.ALL_DSB_CYCLES_4_UOPS +.Pq Event 79H , Umask 18H +Counts cycles DSB is delivered four uops. Set Cmask +=4. +.It Li IDQ.ALL_MITE_CYCLES_ANY_UOPS +.Pq Event 79H , Umask 24H +Counts cycles MITE is delivered at least one uops. Set +Cmask = 1. +.It Li IDQ.ALL_MITE_CYCLES_4_UOPS +.Pq Event 79H , Umask 24H +Counts cycles MITE is delivered four uops. Set Cmask +=4. +.It Li IDQ.MITE_ALL_UOPS +.Pq Event 79H , Umask 3CH +# of uops delivered to IDQ from any path. +.It Li ICACHE.MISSES +.Pq Event 80H , Umask 02H +Number of Instruction Cache, Streaming Buffer and +Victim Cache Misses. Includes UC accesses. +.It Li ITLB_MISSES.MISS_CAUSES_A_WALK +.Pq Event 85H , Umask 01H +Misses in ITLB that causes a page walk of any page +size. +.It Li ITLB_MISSES.WALK_COMPLETED_4K +.Pq Event 85H , Umask 02H +Completed page walks due to misses in ITLB 4K page +entries. +.It Li TLB_MISSES.WALK_COMPLETED_2M_4M +.Pq Event 85H , Umask 04H +Completed page walks due to misses in ITLB 2M/4M +page entries. +.It Li ITLB_MISSES.WALK_COMPLETED +.Pq Event 85H , Umask 0EH +Completed page walks in ITLB of any page size. +.It Li ITLB_MISSES.WALK_DURATION +.Pq Event 85H , Umask 10H +Cycle PMH is busy with a walk. +.It Li ITLB_MISSES.STLB_HIT_4K +.Pq Event 85H , Umask 20H +ITLB misses that hit STLB (4K). +.It Li ITLB_MISSES.STLB_HIT_2M +.Pq Event 85H , Umask 40H +ITLB misses that hit STLB (2K). +.It Li ITLB_MISSES.STLB_HIT +.Pq Event 85H , Umask 60H +TLB misses that hit STLB. No page walk. +.It Li ILD_STALL.LCP +.Pq Event 87H , Umask 01H +Stalls caused by changing prefix length of the +instruction. +.It Li ILD_STALL.IQ_FULL +.Pq Event 87H , Umask 04H +Stall cycles due to IQ is full. +.It Li BR_INST_EXEC.COND +.Pq Event 88H , Umask 01H +Qualify conditional near branch instructions +executed, but not necessarily retired. +.It Li BR_INST_EXEC.DIRECT_JMP +.Pq Event 88H , Umask 02H +Qualify all unconditional near branch instructions +excluding calls and indirect branches. +.It Li BR_INST_EXEC.INDIRECT_JMP_NON_CALL_RET +.Pq Event 88H , Umask 04H +Qualify executed indirect near branch instructions +that are not calls nor returns. +.It Li BR_INST_EXEC.RETURN_NEAR +.Pq Event 88H , Umask 08H +Qualify indirect near branches that have a return +mnemonic. +.It Li BR_INST_EXEC.DIRECT_NEAR_CALL +.Pq Event 88H , Umask 10H +Qualify unconditional near call branch instructions, +excluding non call branch, executed. +.It Li BR_INST_EXEC.INDIRECT_NEAR_CALL +.Pq Event 88H , Umask 20H +Qualify indirect near calls, including both register and +memory indirect, executed. +.It Li BR_INST_EXEC.NONTAKEN +.Pq Event 88H , Umask 40H +Qualify non-taken near branches executed. +.It Li BR_INST_EXEC.TAKEN +.Pq Event 88H , Umask 80H +Qualify taken near branches executed. Must combine +with 01H,02H, 04H, 08H, 10H, 20H. +.It Li BR_INST_EXEC.ALL_BRANCHES +.Pq Event 88H , Umask FFH +Counts all near executed branches (not necessarily +retired). +.It Li BR_MISP_EXEC.COND +.Pq Event 89H , Umask 01H +Qualify conditional near branch instructions +mispredicted. +.It Li BR_MISP_EXEC.INDIRECT_JMP_NON_CALL_RET +.Pq Event 89H , Umask 04H +Qualify mispredicted indirect near branch +instructions that are not calls nor returns. +.It Li BR_MISP_EXEC.RETURN_NEAR +.Pq Event 89H , Umask 08H +Qualify mispredicted indirect near branches that +have a return mnemonic. +.It Li BR_MISP_EXEC.DIRECT_NEAR_CALL +.Pq Event 89H , Umask 10H +Qualify mispredicted unconditional near call branch +instructions, excluding non call branch, executed. +.It Li BR_MISP_EXEC.INDIRECT_NEAR_CALL +.Pq Event 89H , Umask 20H +Qualify mispredicted indirect near calls, including +both register and memory indirect, executed. +.It Li BR_MISP_EXEC.NONTAKEN +.Pq Event 89H , Umask 40H +Qualify mispredicted non-taken near branches +executed. +.It Li BR_MISP_EXEC.TAKEN +.Pq Event 89H , Umask 80H +Qualify mispredicted taken near branches executed. +Must combine with 01H,02H, 04H, 08H, 10H, 20H. +.It Li BR_MISP_EXEC.ALL_BRANCHES +.Pq Event 89H , Umask FFH +Counts all near executed branches (not necessarily +retired). +.It Li IDQ_UOPS_NOT_DELIVERED.CORE +.Pq Event 9CH , Umask 01H +Count number of non-delivered uops to RAT per +thread. +.It Li UOPS_EXECUTED_PORT.PORT_0 +.Pq Event A1H , Umask 01H +Cycles which a Uop is dispatched on port 0 in this +thread. +.It Li UOPS_EXECUTED_PORT.PORT_1 +.Pq Event A1H , Umask 02H +Cycles which a Uop is dispatched on port 1 in this +thread. +.It Li UOPS_EXECUTED_PORT.PORT_2 +.Pq Event A1H , Umask 04H +Cycles which a Uop is dispatched on port 2 in this +thread. +.It Li UOPS_EXECUTED_PORT.PORT_3 +.Pq Event A1H , Umask 08H +Cycles which a Uop is dispatched on port 3 in this +thread. +.It Li UOPS_EXECUTED_PORT.PORT_4 +.Pq Event A1H , Umask 10H +Cycles which a Uop is dispatched on port 4 in this +thread. +.It Li UOPS_EXECUTED_PORT.PORT_5 +.Pq Event A1H , Umask 20H +Cycles which a Uop is dispatched on port 5 in this +thread. +.It Li UOPS_EXECUTED_PORT.PORT_6 +.Pq Event A1H , Umask 40H +Cycles which a Uop is dispatched on port 6 in this +thread. +.It Li UOPS_EXECUTED_PORT.PORT_7 +.Pq Event A1H , Umask 80H +Cycles which a Uop is dispatched on port 7 in this +thread. +.It Li RESOURCE_STALLS.ANY +.Pq Event A2H , Umask 01H +Cycles Allocation is stalled due to Resource Related +reason. +.It Li RESOURCE_STALLS.RS +.Pq Event A2H , Umask 04H +Cycles stalled due to no eligible RS entry available. +.It Li RESOURCE_STALLS.SB +.Pq Event A2H , Umask 08H +Cycles stalled due to no store buffers available (not +including draining form sync). +.It Li RESOURCE_STALLS.ROB +.Pq Event A2H , Umask 10H +Cycles stalled due to re-order buffer full. +.It Li CYCLE_ACTIVITY.CYCLES_L2_PENDING +.Pq Event A3H , Umask 01H +Cycles with pending L2 miss loads. Set Cmask=2 to +count cycle. +.It Li CYCLE_ACTIVITY.CYCLES_LDM_PENDING +.Pq Event A3H , Umask 02H +Cycles with pending memory loads. Set Cmask=2 to +count cycle. +.It Li CYCLE_ACTIVITY.STALLS_L2_PENDING +.Pq Event A3H , Umask 05H +Number of loads missed L2. +.It Li CYCLE_ACTIVITY.CYCLES_L1D_PENDING +.Pq Event A3H , Umask 08H +Cycles with pending L1 cache miss loads. Set +Cmask=8 to count cycle. +.It Li ITLB.ITLB_FLUSH +.Pq Event AEH , Umask 01H +Counts the number of ITLB flushes, includes +4k/2M/4M pages. +.It Li OFFCORE_REQUESTS.DEMAND_DATA_RD +.Pq Event B0H , Umask 01H +Demand data read requests sent to uncore. +.It Li OFFCORE_REQUESTS.DEMAND_CODE_RD +.Pq Event B0H , Umask 02H +Demand code read requests sent to uncore. +.It Li OFFCORE_REQUESTS.DEMAND_RFO +.Pq Event B0H , Umask 04H +Demand RFO read requests sent to uncore, including +regular RFOs, locks, ItoM. +.It Li OFFCORE_REQUESTS.ALL_DATA_RD +.Pq Event B0H , Umask 08H +Data read requests sent to uncore (demand and +prefetch). +.It Li UOPS_EXECUTED.CORE +.Pq Event B1H , Umask 02H +Counts total number of uops to be executed per-core +each cycle. +.It Li OFF_CORE_RESPONSE_0 +.Pq Event B7H , Umask 01H +Requires MSR 01A6H +.It Li OFF_CORE_RESPONSE_1 +.Pq Event BBH , Umask 01H +Requires MSR 01A7H +.It Li PAGE_WALKER_LOADS.DTLB_L1 +.Pq Event BCH , Umask 11H +Number of DTLB page walker loads that hit in the +L1+FB. +.It Li PAGE_WALKER_LOADS.ITLB_L1 +.Pq Event BCH , Umask 21H +Number of ITLB page walker loads that hit in the +L1+FB. +.It Li PAGE_WALKER_LOADS.DTLB_L2 +.Pq Event BCH , Umask 12H +Number of DTLB page walker loads that hit in the L2. +.It Li PAGE_WALKER_LOADS.ITLB_L2 +.Pq Event BCH , Umask 22H +Number of ITLB page walker loads that hit in the L2. +.It Li PAGE_WALKER_LOADS.DTLB_L3 +.Pq Event BCH , Umask 14H +Number of DTLB page walker loads that hit in the L3. +.It Li PAGE_WALKER_LOADS.ITLB_L3 +.Pq Event BCH , Umask 24H +Number of ITLB page walker loads that hit in the L3. +.It Li PAGE_WALKER_LOADS.DTLB_MEMORY +.Pq Event BCH , Umask 18H +Number of DTLB page walker loads from memory. +.It Li PAGE_WALKER_LOADS.ITLB_MEMORY +.Pq Event BCH , Umask 28H +Number of ITLB page walker loads from memory. +.It Li TLB_FLUSH.DTLB_THREAD +.Pq Event BDH , Umask 01H +DTLB flush attempts of the thread-specific entries. +.It Li TLB_FLUSH.STLB_ANY +.Pq Event BDH , Umask 20H +Count number of STLB flush attempts. +.It Li INST_RETIRED.ANY_P +.Pq Event C0H , Umask 00H +Number of instructions at retirement. +.It Li INST_RETIRED.ALL +.Pq Event C0H , Umask 01H +Precise instruction retired event with HW to reduce +effect of PEBS shadow in IP distribution. +.It Li OTHER_ASSISTS.AVX_TO_SSE +.Pq Event C1H , Umask 08H +Number of transitions from AVX-256 to legacy SSE +when penalty applicable. +.It Li OTHER_ASSISTS.SSE_TO_AVX +.Pq Event C1H , Umask 10H +Number of transitions from SSE to AVX-256 when +penalty applicable. +.It Li OTHER_ASSISTS.ANY_WB_ASSIST +.Pq Event C1H , Umask 40H +Number of microcode assists invoked by HW upon +uop writeback. +.It Li UOPS_RETIRED.ALL +.Pq Event C2H , Umask 01H +Counts the number of micro-ops retired, Use +cmask=1 and invert to count active cycles or stalled +cycles. +.It Li UOPS_RETIRED.RETIRE_SLOTS +.Pq Event C2H , Umask 02H +Counts the number of retirement slots used each +cycle. +.It Li MACHINE_CLEARS.MEMORY_ORDERING +.Pq Event C3H , Umask 02H +Counts the number of machine clears due to memory +order conflicts. +.It Li MACHINE_CLEARS.SMC +.Pq Event C3H , Umask 04H +Number of self-modifying-code machine clears +detected. +.It Li MACHINE_CLEARS.MASKMOV +.Pq Event C3H , Umask 20H +Counts the number of executed AVX masked load +operations that refer to an illegal address range with +the mask bits set to 0. +.It Li BR_INST_RETIRED.ALL_BRANCHES +.Pq Event C4H , Umask 00H +Branch instructions at retirement. +.It Li BR_INST_RETIRED.CONDITIONAL +.Pq Event C4H , Umask 01H +Counts the number of conditional branch instructions Supports PEBS +retired. +.It Li BR_INST_RETIRED.NEAR_CALL +.Pq Event C4H , Umask 02H +Direct and indirect near call instructions retired. +.It Li BR_INST_RETIRED.ALL_BRANCHES +.Pq Event C4H , Umask 04H +Counts the number of branch instructions retired. +.It Li BR_INST_RETIRED.NEAR_RETURN +.Pq Event C4H , Umask 08H +Counts the number of near return instructions +retired. +.It Li BR_INST_RETIRED.NOT_TAKEN +.Pq Event C4H , Umask 10H +Counts the number of not taken branch instructions +retired. + It Li BR_INST_RETIRED.NEAR_TAKEN +.Pq Event C4H , Umask 20H +Number of near taken branches retired. +.It Li BR_INST_RETIRED.FAR_BRANCH +.Pq Event C4H , Umask 40H +Number of far branches retired. +.It Li BR_MISP_RETIRED.ALL_BRANCHES +.Pq Event C5H , Umask 00H +Mispredicted branch instructions at retirement +.It Li BR_MISP_RETIRED.CONDITIONAL +.Pq Event C5H , Umask 01H +Mispredicted conditional branch instructions retired. +.It Li BR_MISP_RETIRED.CONDITIONAL +.Pq Event C5H , Umask 04H +Mispredicted macro branch instructions retired. +.It Li FP_ASSIST.X87_OUTPUT +.Pq Event CAH , Umask 02H +Number of X87 FP assists due to Output values. +.It Li FP_ASSIST.X87_INPUT +.Pq Event CAH , Umask 04H +Number of X87 FP assists due to input values. +.It Li FP_ASSIST.SIMD_OUTPUT +.Pq Event CAH , Umask 08H +Number of SIMD FP assists due to Output values. +.It Li FP_ASSIST.SIMD_INPUT +.Pq Event CAH , Umask 10H +Number of SIMD FP assists due to input values. +.It Li FP_ASSIST.ANY +.Pq Event CAH , Umask 1EH +Cycles with any input/output SSE* or FP assists. +.It Li ROB_MISC_EVENTS.LBR_INSERTS +.Pq Event CCH , Umask 20H +Count cases of saving new LBR records by hardware. +.It Li MEM_TRANS_RETIRED.LOAD_LATENCY +.Pq Event CDH , Umask 01H +Randomly sampled loads whose latency is above a +user defined threshold. A small fraction of the overall +loads are sampled due to randomization. +.It Li MEM_UOP_RETIRED.LOADS +.Pq Event D0H , Umask 01H +Qualify retired memory uops that are loads. Combine Supports PEBS and +with umask 10H, 20H, 40H, 80H. +.It Li MEM_UOP_RETIRED.STORES +.Pq Event D0H , Umask 02H +Qualify retired memory uops that are stores. +Combine with umask 10H, 20H, 40H, 80H. +.It Li MEM_UOP_RETIRED.STLB_MISS +.Pq Event D0H , Umask 10H +Qualify retired memory uops with STLB miss. Must +combine with umask 01H, 02H, to produce counts. +.It Li MEM_UOP_RETIRED.LOCK +.Pq Event D0H , Umask 20H +Qualify retired memory uops with lock. Must combine Supports PEBS and *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Apr 19 19:38:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 031644A5; Fri, 19 Apr 2013 19:38:41 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D8AB61A5C; Fri, 19 Apr 2013 19:38:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3JJceBC070550; Fri, 19 Apr 2013 19:38:40 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3JJcekZ070531; Fri, 19 Apr 2013 19:38:40 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201304191938.r3JJcekZ070531@svn.freebsd.org> From: Ed Schouten Date: Fri, 19 Apr 2013 19:38:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249656 - head/cddl/contrib/opensolaris/tools/ctf/cvt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Apr 2013 19:38:41 -0000 Author: ed Date: Fri Apr 19 19:38:39 2013 New Revision: 249656 URL: http://svnweb.freebsd.org/changeset/base/249656 Log: Fix -Wmissing-variable-declarations compiler warnings. References: https://www.illumos.org/issues/3700 Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/ctf.c head/cddl/contrib/opensolaris/tools/ctf/cvt/st_parse.c head/cddl/contrib/opensolaris/tools/ctf/cvt/traverse.c head/cddl/contrib/opensolaris/tools/ctf/cvt/util.c Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/ctf.c ============================================================================== --- head/cddl/contrib/opensolaris/tools/ctf/cvt/ctf.c Fri Apr 19 19:28:48 2013 (r249655) +++ head/cddl/contrib/opensolaris/tools/ctf/cvt/ctf.c Fri Apr 19 19:38:39 2013 (r249656) @@ -47,7 +47,7 @@ * * The value is only valid during a call to ctf_load. */ -char *curfile; +static char *curfile; #define CTF_BUF_CHUNK_SIZE (64 * 1024) #define RES_BUF_CHUNK_SIZE (64 * 1024) Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/st_parse.c ============================================================================== --- head/cddl/contrib/opensolaris/tools/ctf/cvt/st_parse.c Fri Apr 19 19:28:48 2013 (r249655) +++ head/cddl/contrib/opensolaris/tools/ctf/cvt/st_parse.c Fri Apr 19 19:38:39 2013 (r249656) @@ -54,7 +54,7 @@ static int faketypenumber = 100000000; static tdesc_t *hash_table[BUCKETS]; static tdesc_t *name_table[BUCKETS]; -list_t *typedbitfldmems; +static list_t *typedbitfldmems; static void reset(void); static jmp_buf resetbuf; Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/traverse.c ============================================================================== --- head/cddl/contrib/opensolaris/tools/ctf/cvt/traverse.c Fri Apr 19 19:28:48 2013 (r249655) +++ head/cddl/contrib/opensolaris/tools/ctf/cvt/traverse.c Fri Apr 19 19:38:39 2013 (r249656) @@ -37,8 +37,8 @@ #include "traverse.h" #include "memory.h" -int (*tddescenders[])(tdesc_t *, tdtrav_data_t *); -tdtrav_cb_f tdnops[]; +static int (*tddescenders[])(tdesc_t *, tdtrav_data_t *); +static tdtrav_cb_f tdnops[]; void tdtrav_init(tdtrav_data_t *tdtd, int *vgenp, tdtrav_cb_f *firstops, @@ -111,7 +111,7 @@ tdtrav_assert(tdesc_t *node __unused, td return (-1); } -tdtrav_cb_f tdnops[] = { +static tdtrav_cb_f tdnops[] = { NULL, NULL, /* intrinsic */ NULL, /* pointer */ @@ -128,7 +128,7 @@ tdtrav_cb_f tdnops[] = { NULL /* restrict */ }; -int (*tddescenders[])(tdesc_t *, tdtrav_data_t *) = { +static int (*tddescenders[])(tdesc_t *, tdtrav_data_t *) = { NULL, NULL, /* intrinsic */ tdtrav_plain, /* pointer */ Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/util.c ============================================================================== --- head/cddl/contrib/opensolaris/tools/ctf/cvt/util.c Fri Apr 19 19:28:48 2013 (r249655) +++ head/cddl/contrib/opensolaris/tools/ctf/cvt/util.c Fri Apr 19 19:38:39 2013 (r249656) @@ -249,8 +249,8 @@ tdesc_name(tdesc_t *tdp) return (tdp->t_name == NULL ? "(anon)" : tdp->t_name); } -char *watch_address = NULL; -int watch_length = 0; +static char *watch_address = NULL; +static int watch_length = 0; void watch_set(void *addr, int len) From owner-svn-src-all@FreeBSD.ORG Fri Apr 19 19:45:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 08CC48D5; Fri, 19 Apr 2013 19:45:05 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E03001ACF; Fri, 19 Apr 2013 19:45:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3JJj4xd081850; Fri, 19 Apr 2013 19:45:04 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3JJj0Cv081691; Fri, 19 Apr 2013 19:45:00 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201304191945.r3JJj0Cv081691@svn.freebsd.org> From: Ed Schouten Date: Fri, 19 Apr 2013 19:45:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249657 - in head: bin/expr lib/csu sbin/gbde sbin/geom/class sbin/hastctl sbin/hastd sbin/md5 share/mk usr.bin/ar usr.bin/bc usr.bin/bzip2recover usr.bin/find usr.bin/indent usr.bin/m4... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Apr 2013 19:45:05 -0000 Author: ed Date: Fri Apr 19 19:45:00 2013 New Revision: 249657 URL: http://svnweb.freebsd.org/changeset/base/249657 Log: Add the Clang specific -Wmissing-variable-declarations to WARNS=6. This compiler flag enforces that that people either mark variables static or use an external declarations for the variable, similar to how -Wmissing-prototypes works for functions. Due to the fact that Yacc/Lex generate code that cannot trivially be changed to not warn because of this (lots of yy* variables), add a NO_WMISSING_VARIABLE_DECLARATIONS that can be used to turn off this specific compiler warning. Announced on: toolchain@ Modified: head/bin/expr/Makefile head/lib/csu/Makefile.inc head/sbin/gbde/Makefile head/sbin/geom/class/Makefile.inc head/sbin/hastctl/Makefile head/sbin/hastd/Makefile head/sbin/md5/Makefile head/share/mk/bsd.sys.mk head/usr.bin/ar/Makefile head/usr.bin/bc/Makefile head/usr.bin/bzip2recover/Makefile head/usr.bin/find/Makefile head/usr.bin/indent/Makefile head/usr.bin/m4/Makefile head/usr.bin/mklocale/Makefile head/usr.sbin/auditdistd/Makefile head/usr.sbin/bluetooth/bthidd/Makefile head/usr.sbin/bsnmpd/modules/Makefile.inc head/usr.sbin/config/Makefile head/usr.sbin/fifolog/lib/Makefile head/usr.sbin/jail/Makefile Modified: head/bin/expr/Makefile ============================================================================== --- head/bin/expr/Makefile Fri Apr 19 19:38:39 2013 (r249656) +++ head/bin/expr/Makefile Fri Apr 19 19:45:00 2013 (r249657) @@ -4,4 +4,6 @@ PROG= expr SRCS= expr.y YFLAGS= +NO_WMISSING_VARIABLE_DECLARATIONS= + .include Modified: head/lib/csu/Makefile.inc ============================================================================== --- head/lib/csu/Makefile.inc Fri Apr 19 19:38:39 2013 (r249656) +++ head/lib/csu/Makefile.inc Fri Apr 19 19:45:00 2013 (r249657) @@ -4,4 +4,6 @@ SSP_CFLAGS= SED_FIX_NOTE = -i "" -e '/\.note\.tag/s/progbits/note/' +NO_WMISSING_VARIABLE_DECLARATIONS= + .include "../Makefile.inc" Modified: head/sbin/gbde/Makefile ============================================================================== --- head/sbin/gbde/Makefile Fri Apr 19 19:38:39 2013 (r249656) +++ head/sbin/gbde/Makefile Fri Apr 19 19:45:00 2013 (r249657) @@ -10,6 +10,7 @@ SRCS+= g_bde_lock.c # rijndael-fst.c does evil casting things which can results in warnings, # the test-vectors check out however, so it works right. NO_WCAST_ALIGN= +NO_WMISSING_VARIABLE_DECLARATIONS= CFLAGS+= -I${.CURDIR}/../../sys .PATH: ${.CURDIR}/../../sys/geom/bde \ Modified: head/sbin/geom/class/Makefile.inc ============================================================================== --- head/sbin/geom/class/Makefile.inc Fri Apr 19 19:38:39 2013 (r249656) +++ head/sbin/geom/class/Makefile.inc Fri Apr 19 19:45:00 2013 (r249657) @@ -6,6 +6,8 @@ LINKS= ${BINDIR}/geom ${BINDIR}/g${GEOM_ MAN= g${GEOM_CLASS}.8 SRCS+= geom_${GEOM_CLASS}.c subr.c +NO_WMISSING_VARIABLE_DECLARATIONS= + CFLAGS+= -I${.CURDIR}/../.. .include "../Makefile.inc" Modified: head/sbin/hastctl/Makefile ============================================================================== --- head/sbin/hastctl/Makefile Fri Apr 19 19:38:39 2013 (r249656) +++ head/sbin/hastctl/Makefile Fri Apr 19 19:45:00 2013 (r249657) @@ -21,6 +21,7 @@ MAN= hastctl.8 NO_WFORMAT= NO_WCAST_ALIGN= +NO_WMISSING_VARIABLE_DECLARATIONS= CFLAGS+=-I${.CURDIR}/../hastd CFLAGS+=-DHAVE_CAPSICUM CFLAGS+=-DINET Modified: head/sbin/hastd/Makefile ============================================================================== --- head/sbin/hastd/Makefile Fri Apr 19 19:38:39 2013 (r249656) +++ head/sbin/hastd/Makefile Fri Apr 19 19:45:00 2013 (r249657) @@ -21,6 +21,7 @@ MAN= hastd.8 hast.conf.5 NO_WFORMAT= NO_WCAST_ALIGN= +NO_WMISSING_VARIABLE_DECLARATIONS= CFLAGS+=-I${.CURDIR} CFLAGS+=-DHAVE_CAPSICUM CFLAGS+=-DPROTO_TCP_DEFAULT_PORT=8457 Modified: head/sbin/md5/Makefile ============================================================================== --- head/sbin/md5/Makefile Fri Apr 19 19:38:39 2013 (r249656) +++ head/sbin/md5/Makefile Fri Apr 19 19:45:00 2013 (r249657) @@ -13,6 +13,7 @@ MLINKS= md5.1 rmd160.1 \ md5.1 sha256.1 \ md5.1 sha512.1 +NO_WMISSING_VARIABLE_DECLARATIONS= WFORMAT?= 1 DPADD= ${LIBMD} Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Fri Apr 19 19:38:39 2013 (r249656) +++ head/share/mk/bsd.sys.mk Fri Apr 19 19:45:00 2013 (r249657) @@ -54,6 +54,10 @@ CWARNFLAGS+= -Wcast-align .if ${WARNS} >= 6 CWARNFLAGS+= -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls\ -Wold-style-definition +.if ${COMPILER_TYPE} == "clang" && !defined(EARLY_BUILD) && \ + !defined(NO_WMISSING_VARIABLE_DECLARATIONS) +CWARNFLAGS+= -Wmissing-variable-declarations +.endif .endif # WARNS >= 6 .if ${WARNS} >= 2 && ${WARNS} <= 4 # XXX Delete -Wuninitialized by default for now -- the compiler doesn't Modified: head/usr.bin/ar/Makefile ============================================================================== --- head/usr.bin/ar/Makefile Fri Apr 19 19:38:39 2013 (r249656) +++ head/usr.bin/ar/Makefile Fri Apr 19 19:45:00 2013 (r249657) @@ -8,6 +8,8 @@ SRCS= ar.c acplex.l acpyacc.y read.c uti DPADD= ${LIBARCHIVE} ${LIBELF} ${LIBZ} LDADD= -larchive -lelf -lz +NO_WMISSING_VARIABLE_DECLARATIONS= + CFLAGS+=-I. -I${.CURDIR} .if ${MK_SHARED_TOOLCHAIN} == "no" Modified: head/usr.bin/bc/Makefile ============================================================================== --- head/usr.bin/bc/Makefile Fri Apr 19 19:38:39 2013 (r249656) +++ head/usr.bin/bc/Makefile Fri Apr 19 19:45:00 2013 (r249657) @@ -8,6 +8,8 @@ CFLAGS+= -I. -I${.CURDIR} DPADD= ${LIBEDIT} ${LIBTERMCAP} LDADD= -ledit -ltermcap +NO_WMISSING_VARIABLE_DECLARATIONS= + FILES+= bc.library FILESDIR=${SHAREDIR}/misc Modified: head/usr.bin/bzip2recover/Makefile ============================================================================== --- head/usr.bin/bzip2recover/Makefile Fri Apr 19 19:38:39 2013 (r249656) +++ head/usr.bin/bzip2recover/Makefile Fri Apr 19 19:45:00 2013 (r249657) @@ -6,4 +6,6 @@ BZ2DIR= ${.CURDIR}/../../contrib/bzip2 PROG= bzip2recover NO_MAN= +NO_WMISSING_VARIABLE_DECLARATIONS= + .include Modified: head/usr.bin/find/Makefile ============================================================================== --- head/usr.bin/find/Makefile Fri Apr 19 19:38:39 2013 (r249656) +++ head/usr.bin/find/Makefile Fri Apr 19 19:45:00 2013 (r249657) @@ -6,4 +6,6 @@ SRCS= find.c function.c ls.c main.c misc getdate.y YFLAGS= +NO_WMISSING_VARIABLE_DECLARATIONS= + .include Modified: head/usr.bin/indent/Makefile ============================================================================== --- head/usr.bin/indent/Makefile Fri Apr 19 19:38:39 2013 (r249656) +++ head/usr.bin/indent/Makefile Fri Apr 19 19:45:00 2013 (r249657) @@ -1,6 +1,9 @@ # @(#)Makefile 8.1 (Berkeley) 6/6/93 +# $FreeBSD$ PROG= indent SRCS= indent.c io.c lexi.c parse.c pr_comment.c args.c +NO_WMISSING_VARIABLE_DECLARATIONS= + .include Modified: head/usr.bin/m4/Makefile ============================================================================== --- head/usr.bin/m4/Makefile Fri Apr 19 19:38:39 2013 (r249656) +++ head/usr.bin/m4/Makefile Fri Apr 19 19:45:00 2013 (r249657) @@ -8,8 +8,8 @@ PROG= m4 CFLAGS+=-DEXTENDED -I${.CURDIR} -I${.CURDIR}/lib DPADD= ${LIBY} ${LIBL} ${LIBM} LDADD= -ly -ll -lm -# clang needs 1 while with gcc we can use 2 -#WARNS= 1 + +NO_WMISSING_VARIABLE_DECLARATIONS= SRCS= eval.c expr.c look.c main.c misc.c gnum4.c trace.c parser.y tokenizer.l .PATH: ${.CURDIR}/lib Modified: head/usr.bin/mklocale/Makefile ============================================================================== --- head/usr.bin/mklocale/Makefile Fri Apr 19 19:38:39 2013 (r249656) +++ head/usr.bin/mklocale/Makefile Fri Apr 19 19:45:00 2013 (r249657) @@ -5,4 +5,6 @@ PROG= mklocale SRCS= yacc.y lex.l y.tab.h CFLAGS+= -I. -I${.CURDIR} -I${.CURDIR}/../../lib/libc/locale +NO_WMISSING_VARIABLE_DECLARATIONS= + .include Modified: head/usr.sbin/auditdistd/Makefile ============================================================================== --- head/usr.sbin/auditdistd/Makefile Fri Apr 19 19:38:39 2013 (r249656) +++ head/usr.sbin/auditdistd/Makefile Fri Apr 19 19:45:00 2013 (r249657) @@ -10,6 +10,7 @@ OPENBSMDIR=${.CURDIR}/../../contrib/open CFLAGS+=-I${OPENBSMDIR} -I${OPENBSMDIR}/bin/auditdistd NO_WFORMAT= +NO_WMISSING_VARIABLE_DECLARATIONS= PROG= auditdistd SRCS= auditdistd.c Modified: head/usr.sbin/bluetooth/bthidd/Makefile ============================================================================== --- head/usr.sbin/bluetooth/bthidd/Makefile Fri Apr 19 19:38:39 2013 (r249656) +++ head/usr.sbin/bluetooth/bthidd/Makefile Fri Apr 19 19:45:00 2013 (r249657) @@ -13,4 +13,6 @@ DEBUG_FLAGS= -g DPADD= ${LIBBLUETOOTH} ${LIBUSBHID} LDADD= -lbluetooth -lusbhid +NO_WMISSING_VARIABLE_DECLARATIONS= + .include Modified: head/usr.sbin/bsnmpd/modules/Makefile.inc ============================================================================== --- head/usr.sbin/bsnmpd/modules/Makefile.inc Fri Apr 19 19:38:39 2013 (r249656) +++ head/usr.sbin/bsnmpd/modules/Makefile.inc Fri Apr 19 19:45:00 2013 (r249657) @@ -6,4 +6,6 @@ MANFILTER= sed -e 's%@MODPATH@%${LIBDIR} -e 's%@DEFPATH@%${DEFSDIR}/%g' \ -e 's%@MIBSPATH@%${BMIBSDIR}/%g' +NO_WMISSING_VARIABLE_DECLARATIONS= + .include "../Makefile.inc" Modified: head/usr.sbin/config/Makefile ============================================================================== --- head/usr.sbin/config/Makefile Fri Apr 19 19:38:39 2013 (r249656) +++ head/usr.sbin/config/Makefile Fri Apr 19 19:45:00 2013 (r249657) @@ -11,6 +11,8 @@ kernconf.c: kernconf.tmpl CFLAGS+= -I. -I${.CURDIR} +NO_WMISSING_VARIABLE_DECLARATIONS= + DPADD= ${LIBL} ${LIBSBUF} LDADD= -ll -lsbuf Modified: head/usr.sbin/fifolog/lib/Makefile ============================================================================== --- head/usr.sbin/fifolog/lib/Makefile Fri Apr 19 19:38:39 2013 (r249656) +++ head/usr.sbin/fifolog/lib/Makefile Fri Apr 19 19:45:00 2013 (r249657) @@ -8,4 +8,6 @@ SRCS+= getdate.y CFLAGS+= -I${.CURDIR} +NO_WMISSING_VARIABLE_DECLARATIONS= + .include Modified: head/usr.sbin/jail/Makefile ============================================================================== --- head/usr.sbin/jail/Makefile Fri Apr 19 19:38:39 2013 (r249656) +++ head/usr.sbin/jail/Makefile Fri Apr 19 19:45:00 2013 (r249657) @@ -9,6 +9,8 @@ SRCS= jail.c command.c config.c state.c DPADD= ${LIBJAIL} ${LIBKVM} ${LIBUTIL} ${LIBL} LDADD= -ljail -lkvm -lutil -ll +NO_WMISSING_VARIABLE_DECLARATIONS= + YFLAGS+=-v CFLAGS+=-I. -I${.CURDIR} From owner-svn-src-all@FreeBSD.ORG Fri Apr 19 20:03:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 13750E83; Fri, 19 Apr 2013 20:03:53 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E82BC1BBE; Fri, 19 Apr 2013 20:03:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3JK3qwY013484; Fri, 19 Apr 2013 20:03:52 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3JK3qFB013463; Fri, 19 Apr 2013 20:03:52 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201304192003.r3JK3qFB013463@svn.freebsd.org> From: "Kenneth D. Merry" Date: Fri, 19 Apr 2013 20:03:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249658 - in head: bin/chio sys/cam/scsi sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Apr 2013 20:03:53 -0000 Author: ken Date: Fri Apr 19 20:03:51 2013 New Revision: 249658 URL: http://svnweb.freebsd.org/changeset/base/249658 Log: Update chio(1) and ch(4) to support reporting element designators. This allows mapping a tape drive in a changer (as reported by 'chio status') to a sa(4) driver instance by comparing the serial numbers. The designators can be ASCII (which is printed out directly), binary (which is printed in hex format) or UTF-8, which is printed in either native UTF-8 format if the terminal can support it, or in %XX notation for non-ASCII characters. Thanks to Hiroki Sato for the explaining UTF-8 printing and example UTF-8 printing code. chio.h: Modify the changer_element_status structure to add new fields and definitions from the SMC3r16 spec. Rename the original CHIOGSTATUS ioctl to OCHIOGTATUS and define a new CHIOGSTATUS ioctl. Clean up some tab/space issues. chio.c: For the 'status' subcommand, print the designator field if it is supplied by a device. scsi_ch.h: Add new flags for DVCID and CURDATA to the READ ELEMENT STATUS command structure. Add a read_element_status_device_id structure for the data fields in the new standard. Add new unions, dt_or_obsolete and voltage_devid, to hold and address data from either SCSI-2 or newer devices. scsi_ch.c: Implement support for fetching device IDs with READ ELEMENT STATUS data. Add new arguments to scsi_read_element_status() to allow the user to request the DVCID and CURDATA bits. This isn't compiled into libcam (it's only an internal kernel interface), so we don't need any special handling for the API change. If the user issues the new CHIOGSTATUS ioctl, copy all of the available element status data out. If he issues the OCHIOGSTATUS ioctl, we don't copy the new fields in the structure. Fix a bug in chopen() that would result in the peripheral never getting unheld if chgetparams() failed. Sponsored by: Spectra Logic Submitted by: Po-Li Soong MFC After: 1 week Modified: head/bin/chio/chio.c head/sys/cam/scsi/scsi_ch.c head/sys/cam/scsi/scsi_ch.h head/sys/sys/chio.h Modified: head/bin/chio/chio.c ============================================================================== --- head/bin/chio/chio.c Fri Apr 19 19:45:00 2013 (r249657) +++ head/bin/chio/chio.c Fri Apr 19 20:03:51 2013 (r249658) @@ -54,6 +54,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include "defs.h" #include "pathnames.h" @@ -81,6 +83,7 @@ static int do_status(const char *, int, static int do_ielem(const char *, int, char **); static int do_return(const char *, int, char **); static int do_voltag(const char *, int, char **); +static void print_designator(const char *, u_int8_t, u_int8_t); #ifndef CHET_VT #define CHET_VT 10 /* Completely Arbitrary */ @@ -723,6 +726,10 @@ do_status(const char *cname, int argc, c putchar('?'); putchar('>'); } + if (ces->ces_designator_length > 0) + print_designator(ces->ces_designator, + ces->ces_code_set, + ces->ces_designator_length); putchar('\n'); } @@ -1177,3 +1184,66 @@ usage(void) "arg1 arg2 [arg3 [...]]\n", getprogname()); exit(1); } + +#define UTF8CODESET "UTF-8" + +static void +print_designator(const char *designator, u_int8_t code_set, + u_int8_t designator_length) +{ + printf(" serial number: <"); + switch (code_set) { + case CES_CODE_SET_ASCII: { + /* + * The driver insures that the string is always NUL terminated. + */ + printf("%s", designator); + break; + } + case CES_CODE_SET_UTF_8: { + char *cs_native; + + setlocale(LC_ALL, ""); + cs_native = nl_langinfo(CODESET); + + /* See if we can natively print UTF-8 */ + if (strcmp(cs_native, UTF8CODESET) == 0) + cs_native = NULL; + + if (cs_native == NULL) { + /* We can natively print UTF-8, so use printf. */ + printf("%s", designator); + } else { + int i; + + /* + * We can't natively print UTF-8. We should + * convert it to the terminal's codeset, but that + * requires iconv(3) and FreeBSD doesn't have + * iconv(3) in the base system yet. So we use %XX + * notation for non US-ASCII characters instead. + */ + for (i = 0; i < designator_length && + designator[i] != '\0'; i++) { + if ((unsigned char)designator[i] < 0x80) + printf("%c", designator[i]); + else + printf("%%%02x", + (unsigned char)designator[i]); + } + } + break; + } + case CES_CODE_SET_BINARY: { + int i; + + for (i = 0; i < designator_length; i++) + printf("%02X%s", designator[i], + (i == designator_length - 1) ? "" : " "); + break; + } + default: + break; + } + printf(">"); +} Modified: head/sys/cam/scsi/scsi_ch.c ============================================================================== --- head/sys/cam/scsi/scsi_ch.c Fri Apr 19 19:45:00 2013 (r249657) +++ head/sys/cam/scsi/scsi_ch.c Fri Apr 19 20:03:51 2013 (r249658) @@ -194,12 +194,14 @@ static int chexchange(struct cam_periph static int chposition(struct cam_periph *periph, struct changer_position *cp); static int chgetelemstatus(struct cam_periph *periph, + int scsi_version, u_long cmd, struct changer_element_status_request *csr); static int chsetvoltag(struct cam_periph *periph, struct changer_set_voltag_request *csvr); static int chielem(struct cam_periph *periph, unsigned int timeout); static int chgetparams(struct cam_periph *periph); +static int chscsiversion(struct cam_periph *periph); static struct periph_driver chdriver = { @@ -474,6 +476,7 @@ chopen(struct cdev *dev, int flags, int * Load information about this changer device into the softc. */ if ((error = chgetparams(periph)) != 0) { + cam_periph_unhold(periph); cam_periph_release_locked(periph); cam_periph_unlock(periph); return(error); @@ -772,6 +775,7 @@ chioctl(struct cdev *dev, u_long cmd, ca switch (cmd) { case CHIOGPICKER: case CHIOGPARAMS: + case OCHIOGSTATUS: case CHIOGSTATUS: break; @@ -824,10 +828,26 @@ chioctl(struct cdev *dev, u_long cmd, ca error = chielem(periph, *(unsigned int *)addr); break; + case OCHIOGSTATUS: + { + error = chgetelemstatus(periph, SCSI_REV_2, cmd, + (struct changer_element_status_request *)addr); + break; + } + case CHIOGSTATUS: { - error = chgetelemstatus(periph, - (struct changer_element_status_request *) addr); + int scsi_version; + + scsi_version = chscsiversion(periph); + if (scsi_version >= SCSI_REV_0) { + error = chgetelemstatus(periph, scsi_version, cmd, + (struct changer_element_status_request *)addr); + } + else { /* unable to determine the SCSI version */ + cam_periph_unlock(periph); + return (ENXIO); + } break; } @@ -1034,18 +1054,20 @@ copy_voltag(struct changer_voltag *uvolt } /* - * Copy an an element status descriptor to a user-mode + * Copy an element status descriptor to a user-mode * changer_element_status structure. */ - -static void +static void copy_element_status(struct ch_softc *softc, u_int16_t flags, struct read_element_status_descriptor *desc, - struct changer_element_status *ces) + struct changer_element_status *ces, + int scsi_version) { u_int16_t eaddr = scsi_2btoul(desc->eaddr); u_int16_t et; + struct volume_tag *pvol_tag = NULL, *avol_tag = NULL; + struct read_element_status_device_id *devid = NULL; ces->ces_int_addr = eaddr; /* set up logical address in element status */ @@ -1076,7 +1098,7 @@ copy_element_status(struct ch_softc *sof if ((softc->sc_firsts[et] <= eaddr) && ((softc->sc_firsts[et] + softc->sc_counts[et]) > eaddr)) { - ces->ces_source_addr = + ces->ces_source_addr = eaddr - softc->sc_firsts[et]; ces->ces_source_type = et; ces->ces_flags |= CES_SOURCE_VALID; @@ -1089,27 +1111,92 @@ copy_element_status(struct ch_softc *sof "address %ud to a valid element type\n", eaddr); } - + /* + * pvoltag and avoltag are common between SCSI-2 and later versions + */ if (flags & READ_ELEMENT_STATUS_PVOLTAG) - copy_voltag(&(ces->ces_pvoltag), &(desc->pvoltag)); + pvol_tag = &desc->voltag_devid.pvoltag; if (flags & READ_ELEMENT_STATUS_AVOLTAG) - copy_voltag(&(ces->ces_avoltag), &(desc->avoltag)); - - if (desc->dt_scsi_flags & READ_ELEMENT_STATUS_DT_IDVALID) { - ces->ces_flags |= CES_SCSIID_VALID; - ces->ces_scsi_id = desc->dt_scsi_addr; - } + avol_tag = (flags & READ_ELEMENT_STATUS_PVOLTAG) ? + &desc->voltag_devid.voltag[1] :&desc->voltag_devid.pvoltag; + /* + * For SCSI-3 and later, element status can carry designator and + * other information. + */ + if (scsi_version >= SCSI_REV_SPC) { + if ((flags & READ_ELEMENT_STATUS_PVOLTAG) ^ + (flags & READ_ELEMENT_STATUS_AVOLTAG)) + devid = &desc->voltag_devid.pvol_and_devid.devid; + else if (!(flags & READ_ELEMENT_STATUS_PVOLTAG) && + !(flags & READ_ELEMENT_STATUS_AVOLTAG)) + devid = &desc->voltag_devid.devid; + else /* Have both PVOLTAG and AVOLTAG */ + devid = &desc->voltag_devid.vol_tags_and_devid.devid; + } + + if (pvol_tag) + copy_voltag(&(ces->ces_pvoltag), pvol_tag); + if (avol_tag) + copy_voltag(&(ces->ces_pvoltag), avol_tag); + if (devid != NULL) { + if (devid->designator_length > 0) { + bcopy((void *)devid->designator, + (void *)ces->ces_designator, + devid->designator_length); + ces->ces_designator_length = devid->designator_length; + /* + * Make sure we are always NUL terminated. The + * buffer should be sized for the maximum + * designator length plus 1, but this will make sure + * there is always a NUL at the end. This won't + * matter for the binary code set, since the user + * will only pay attention to the length field. + */ + ces->ces_designator[ + MIN(sizeof(ces->ces_designator) - 1, + devid->designator_length)]= '\0'; + } + if (devid->piv_assoc_designator_type & + READ_ELEMENT_STATUS_PIV_SET) { + ces->ces_flags |= CES_PIV; + ces->ces_protocol_id = + READ_ELEMENT_STATUS_PROTOCOL_ID( + devid->prot_code_set); + } + ces->ces_code_set = + READ_ELEMENT_STATUS_CODE_SET(devid->prot_code_set); + ces->ces_assoc = READ_ELEMENT_STATUS_ASSOCIATION( + devid->piv_assoc_designator_type); + ces->ces_designator_type = READ_ELEMENT_STATUS_DESIGNATOR_TYPE( + devid->piv_assoc_designator_type); + } else if (scsi_version > SCSI_REV_2) { + /* SCSI-SPC and No devid, no designator */ + ces->ces_designator_length = 0; + ces->ces_designator[0] = '\0'; + ces->ces_protocol_id = CES_PROTOCOL_ID_FCP_4; + } + + if (scsi_version <= SCSI_REV_2) { + if (desc->dt_or_obsolete.scsi_2.dt_scsi_flags & + READ_ELEMENT_STATUS_DT_IDVALID) { + ces->ces_flags |= CES_SCSIID_VALID; + ces->ces_scsi_id = + desc->dt_or_obsolete.scsi_2.dt_scsi_addr; + } - if (desc->dt_scsi_addr & READ_ELEMENT_STATUS_DT_LUVALID) { - ces->ces_flags |= CES_LUN_VALID; - ces->ces_scsi_lun = - desc->dt_scsi_flags & READ_ELEMENT_STATUS_DT_LUNMASK; + if (desc->dt_or_obsolete.scsi_2.dt_scsi_addr & + READ_ELEMENT_STATUS_DT_LUVALID) { + ces->ces_flags |= CES_LUN_VALID; + ces->ces_scsi_lun = + desc->dt_or_obsolete.scsi_2.dt_scsi_flags & + READ_ELEMENT_STATUS_DT_LUNMASK; + } } } static int -chgetelemstatus(struct cam_periph *periph, +chgetelemstatus(struct cam_periph *periph, int scsi_version, u_long cmd, struct changer_element_status_request *cesr) { struct read_element_status_header *st_hdr; @@ -1155,6 +1242,8 @@ chgetelemstatus(struct cam_periph *perip /* tag_action */ MSG_SIMPLE_Q_TAG, /* voltag */ want_voltags, /* sea */ softc->sc_firsts[chet], + /* dvcid */ 1, + /* curdata */ 1, /* count */ 1, /* data_ptr */ data, /* dxfer_len */ 1024, @@ -1177,7 +1266,6 @@ chgetelemstatus(struct cam_periph *perip size = sizeof(struct read_element_status_header) + sizeof(struct read_element_status_page_header) + (desclen * cesr->cesr_element_count); - /* * Reallocate storage for descriptors and get them from the * device. @@ -1193,12 +1281,14 @@ chgetelemstatus(struct cam_periph *perip /* voltag */ want_voltags, /* sea */ softc->sc_firsts[chet] + cesr->cesr_element_base, + /* dvcid */ 1, + /* curdata */ 1, /* count */ cesr->cesr_element_count, /* data_ptr */ data, /* dxfer_len */ size, /* sense_len */ SSD_FULL_SIZE, /* timeout */ CH_TIMEOUT_READ_ELEMENT_STATUS); - + error = cam_periph_runccb(ccb, cherror, /*cam_flags*/ CAM_RETRY_SELTO, /*sense_flags*/ SF_RETRY_UA, softc->device_stats); @@ -1231,18 +1321,41 @@ chgetelemstatus(struct cam_periph *perip * Set up the individual element status structures */ for (i = 0; i < avail; ++i) { - struct changer_element_status *ces = &(user_data[i]); + struct changer_element_status *ces; - copy_element_status(softc, pg_hdr->flags, desc, ces); + /* + * In the changer_element_status structure, fields from + * the beginning to the field of ces_scsi_lun are common + * between SCSI-2 and SCSI-3, while all the rest are new + * from SCSI-3. In order to maintain backward compatibility + * of the chio command, the ces pointer, below, is computed + * such that it lines up with the structure boundary + * corresponding to the SCSI version. + */ + ces = cmd == OCHIOGSTATUS ? + (struct changer_element_status *) + ((unsigned char *)user_data + i * + (offsetof(struct changer_element_status,ces_scsi_lun)+1)): + &user_data[i]; + + copy_element_status(softc, pg_hdr->flags, desc, + ces, scsi_version); desc = (struct read_element_status_descriptor *) - ((uintptr_t)desc + desclen); + ((unsigned char *)desc + desclen); } /* Copy element status structures out to userspace. */ - error = copyout(user_data, - cesr->cesr_element_status, - avail * sizeof(struct changer_element_status)); + if (cmd == OCHIOGSTATUS) + error = copyout(user_data, + cesr->cesr_element_status, + avail* (offsetof(struct changer_element_status, + ces_scsi_lun) + 1)); + else + error = copyout(user_data, + cesr->cesr_element_status, + avail * sizeof(struct changer_element_status)); + cam_periph_lock(periph); done: @@ -1549,6 +1662,39 @@ chgetparams(struct cam_periph *periph) return(error); } +static int +chscsiversion(struct cam_periph *periph) +{ + struct scsi_inquiry_data *inq_data; + struct ccb_getdev *cgd; + int dev_scsi_version; + struct cam_sim *sim; + + sim = xpt_path_sim(periph->path); + mtx_assert(sim->mtx, MA_OWNED); + if ((cgd = (struct ccb_getdev *)xpt_alloc_ccb_nowait()) == NULL) + return (-1); + /* + * Get the device information. + */ + xpt_setup_ccb(&cgd->ccb_h, + periph->path, + CAM_PRIORITY_NORMAL); + cgd->ccb_h.func_code = XPT_GDEV_TYPE; + xpt_action((union ccb *)cgd); + + if (cgd->ccb_h.status != CAM_REQ_CMP) { + xpt_free_ccb((union ccb *)cgd); + return -1; + } + + inq_data = &cgd->inq_data; + dev_scsi_version = inq_data->version; + xpt_free_ccb((union ccb *)cgd); + + return dev_scsi_version; +} + void scsi_move_medium(struct ccb_scsiio *csio, u_int32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb *), @@ -1654,6 +1800,7 @@ void scsi_read_element_status(struct ccb_scsiio *csio, u_int32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb *), u_int8_t tag_action, int voltag, u_int32_t sea, + int curdata, int dvcid, u_int32_t count, u_int8_t *data_ptr, u_int32_t dxfer_len, u_int8_t sense_len, u_int32_t timeout) @@ -1668,6 +1815,10 @@ scsi_read_element_status(struct ccb_scsi scsi_ulto2b(sea, scsi_cmd->sea); scsi_ulto2b(count, scsi_cmd->count); scsi_ulto3b(dxfer_len, scsi_cmd->len); + if (dvcid) + scsi_cmd->flags |= READ_ELEMENT_STATUS_DVCID; + if (curdata) + scsi_cmd->flags |= READ_ELEMENT_STATUS_CURDATA; if (voltag) scsi_cmd->byte2 |= READ_ELEMENT_STATUS_VOLTAG; Modified: head/sys/cam/scsi/scsi_ch.h ============================================================================== --- head/sys/cam/scsi/scsi_ch.h Fri Apr 19 19:45:00 2013 (r249657) +++ head/sys/cam/scsi/scsi_ch.h Fri Apr 19 20:03:51 2013 (r249658) @@ -136,11 +136,14 @@ struct scsi_position_to_element { struct scsi_read_element_status { u_int8_t opcode; u_int8_t byte2; -#define READ_ELEMENT_STATUS_VOLTAG 0x10 /* report volume tag info */ +#define READ_ELEMENT_STATUS_VOLTAG 0x10 /* report volume tag info */ /* ...next 4 bits are an element type code... */ u_int8_t sea[2]; /* starting element address */ u_int8_t count[2]; /* number of elements */ - u_int8_t reserved0; + u_int8_t flags; +#define READ_ELEMENT_STATUS_DVCID 0x01 /* report device serial number */ +#define READ_ELEMENT_STATUS_CURDATA 0x02 /* allow motion during command */ + u_int8_t len[3]; /* length of data buffer */ u_int8_t reserved1; u_int8_t control; @@ -149,7 +152,7 @@ struct scsi_read_element_status { struct scsi_request_volume_element_address { u_int8_t opcode; u_int8_t byte2; -#define REQUEST_VOLUME_ELEMENT_ADDRESS_VOLTAG 0x10 +#define REQUEST_VOLUME_ELEMENT_ADDRESS_VOLTAG 0x10 /* ...next 4 bits are an element type code... */ u_int8_t eaddr[2]; /* element address */ u_int8_t count[2]; /* number of elements */ @@ -182,8 +185,8 @@ struct read_element_status_header { struct read_element_status_page_header { u_int8_t type; /* element type code; see type codes below */ u_int8_t flags; -#define READ_ELEMENT_STATUS_AVOLTAG 0x40 -#define READ_ELEMENT_STATUS_PVOLTAG 0x80 +#define READ_ELEMENT_STATUS_AVOLTAG 0x40 +#define READ_ELEMENT_STATUS_PVOLTAG 0x80 u_int8_t edl[2]; /* element descriptor length */ u_int8_t reserved; u_int8_t nbytes[3]; /* byte count of all descriptors */ @@ -199,50 +202,79 @@ struct volume_tag { u_int8_t vsn[2]; /* volume sequence number */ }; +struct read_element_status_device_id { + u_int8_t prot_code_set; +#define READ_ELEMENT_STATUS_CODE_SET(p) ((p) & 0x0F) +#define READ_ELEMENT_STATUS_PROTOCOL_ID(p) ((p) >> 4) + + u_int8_t piv_assoc_designator_type; +#define READ_ELEMENT_STATUS_PIV_SET 0x80 +#define READ_ELEMENT_STATUS_ASSOCIATION(p) ((p) >> 4) +#define READ_ELEMENT_STATUS_DESIGNATOR_TYPE(p) ((p) & 0x0F) + + u_int8_t reserved2; + u_int8_t designator_length; + u_int8_t designator[256]; /* Allocate max length */ +}; + struct read_element_status_descriptor { u_int8_t eaddr[2]; /* element address */ u_int8_t flags1; -#define READ_ELEMENT_STATUS_FULL 0x01 -#define READ_ELEMENT_STATUS_IMPEXP 0x02 -#define READ_ELEMENT_STATUS_EXCEPT 0x04 -#define READ_ELEMENT_STATUS_ACCESS 0x08 -#define READ_ELEMENT_STATUS_EXENAB 0x10 -#define READ_ELEMENT_STATUS_INENAB 0x20 - -#define READ_ELEMENT_STATUS_MT_MASK1 0x05 -#define READ_ELEMENT_STATUS_ST_MASK1 0x0c -#define READ_ELEMENT_STATUS_IE_MASK1 0x3f -#define READ_ELEMENT_STATUS_DT_MASK1 0x0c +#define READ_ELEMENT_STATUS_FULL 0x01 +#define READ_ELEMENT_STATUS_IMPEXP 0x02 +#define READ_ELEMENT_STATUS_EXCEPT 0x04 +#define READ_ELEMENT_STATUS_ACCESS 0x08 +#define READ_ELEMENT_STATUS_EXENAB 0x10 +#define READ_ELEMENT_STATUS_INENAB 0x20 + +#define READ_ELEMENT_STATUS_MT_MASK1 0x05 +#define READ_ELEMENT_STATUS_ST_MASK1 0x0c +#define READ_ELEMENT_STATUS_IE_MASK1 0x3f +#define READ_ELEMENT_STATUS_DT_MASK1 0x0c u_int8_t reserved0; u_int8_t sense_code; u_int8_t sense_qual; - /* - * dt_scsi_flags and dt_scsi_addr are valid only on data transport - * elements. These bytes are undefined for all other element types. - */ - u_int8_t dt_scsi_flags; - -#define READ_ELEMENT_STATUS_DT_LUNMASK 0x07 -#define READ_ELEMENT_STATUS_DT_LUVALID 0x10 -#define READ_ELEMENT_STATUS_DT_IDVALID 0x20 -#define READ_ELEMENT_STATUS_DT_NOTBUS 0x80 - - u_int8_t dt_scsi_addr; - - u_int8_t reserved1; + union { + struct { + u_int8_t dt_scsi_flags; + +#define READ_ELEMENT_STATUS_DT_LUNMASK 0x07 +#define READ_ELEMENT_STATUS_DT_LUVALID 0x10 +#define READ_ELEMENT_STATUS_DT_IDVALID 0x20 +#define READ_ELEMENT_STATUS_DT_NOTBUS 0x80 + + u_int8_t dt_scsi_addr; + u_int8_t reserved1; + } scsi_2; + + /* reserved and obsolete (as of SCSI-3) fields */ + u_int8_t reserved_or_obsolete[3]; + } dt_or_obsolete; u_int8_t flags2; -#define READ_ELEMENT_STATUS_INVERT 0x40 -#define READ_ELEMENT_STATUS_SVALID 0x80 - u_int8_t ssea[2]; /* source storage element address */ +#define READ_ELEMENT_STATUS_INVERT 0x40 +#define READ_ELEMENT_STATUS_SVALID 0x80 +#define READ_ELEMENT_STATUS_ED 0x80 +#define READ_ELEMENT_STATUS_MEDIA_TYPE_MASK 0x07 - struct volume_tag pvoltag; /* omitted if PVOLTAG == 0 */ - struct volume_tag avoltag; /* omitted if AVOLTAG == 0 */ + u_int8_t ssea[2]; /* source storage element address */ - /* Other data may follow */ + union { + struct volume_tag pvoltag; + struct volume_tag voltag[2]; + struct read_element_status_device_id devid; + struct { + struct volume_tag pvoltag; + struct read_element_status_device_id devid; + } pvol_and_devid; + struct { + struct volume_tag voltag[2]; + struct read_element_status_device_id devid; + } vol_tags_and_devid; + } voltag_devid; }; /* XXX add data returned by REQUEST VOLUME ELEMENT ADDRESS */ @@ -457,6 +489,7 @@ void scsi_position_to_element(struct ccb void scsi_read_element_status(struct ccb_scsiio *csio, u_int32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb *), u_int8_t tag_action, int voltag, u_int32_t sea, + int curdata, int dvcid, u_int32_t count, u_int8_t *data_ptr, u_int32_t dxfer_len, u_int8_t sense_len, u_int32_t timeout); Modified: head/sys/sys/chio.h ============================================================================== --- head/sys/sys/chio.h Fri Apr 19 19:45:00 2013 (r249657) +++ head/sys/sys/chio.h Fri Apr 19 20:03:51 2013 (r249658) @@ -152,7 +152,8 @@ typedef enum { CES_INVERT = 0x040, /* invert bit */ CES_SOURCE_VALID = 0x080, /* source address (ces_source) valid */ CES_SCSIID_VALID = 0x100, /* ces_scsi_id is valid */ - CES_LUN_VALID = 0x200 /* ces_scsi_lun is valid */ + CES_LUN_VALID = 0x200, /* ces_scsi_lun is valid */ + CES_PIV = 0x400 /* ces_protocol_id is valid */ } ces_status_flags; struct changer_element_status { @@ -181,6 +182,55 @@ struct changer_element_status { changer_voltag_t ces_avoltag; /* alternate volume tag */ u_int8_t ces_scsi_id; /* SCSI id of element */ u_int8_t ces_scsi_lun; /* SCSI lun of element */ + + /* + * Data members for SMC3 and later versions + */ + u_int8_t ces_medium_type; +#define CES_MEDIUM_TYPE_UNKNOWN 0 /* Medium type unspecified */ +#define CES_MEDIUM_TYPE_DATA 1 /* Data medium */ +#define CES_MEDIUM_TYPE_CLEANING 2 /* Cleaning medium */ +#define CES_MEDIUM_TYPE_DIAGNOSTIC 3 /* Diagnostic medium */ +#define CES_MEDIUM_TYPE_WORM 4 /* WORM medium */ +#define CES_MEDIUM_TYPE_MICROCODE 5 /* Microcode image medium */ + + u_int8_t ces_protocol_id; +#define CES_PROTOCOL_ID_FCP_4 0 /* Fiber channel */ +#define CES_PROTOCOL_ID_SPI_5 1 /* Parallel SCSI */ +#define CES_PROTOCOL_ID_SSA_S3P 2 /* SSA */ +#define CES_PROTOCOL_ID_SBP_3 3 /* IEEE 1394 */ +#define CES_PROTOCOL_ID_SRP 4 /* SCSI Remote DMA */ +#define CES_PROTOCOL_ID_ISCSI 5 /* iSCSI */ +#define CES_PROTOCOL_ID_SPL 6 /* SAS */ +#define CES_PROTOCOL_ID_ADT_2 7 /* Automation/Drive Interface */ +#define CES_PROTOCOL_ID_ACS_2 8 /* ATA */ + + u_int8_t ces_assoc; +#define CES_ASSOC_LOGICAL_UNIT 0 +#define CES_ASSOC_TARGET_PORT 1 +#define CES_ASSOC_TARGET_DEVICE 2 + + u_int8_t ces_designator_type; +#define CES_DESIGNATOR_TYPE_VENDOR_SPECIFIC 0 +#define CES_DESIGNATOR_TYPE_T10_VENDOR_ID 1 +#define CES_DESIGNATOR_TYPE_EUI_64 2 +#define CES_DESIGNATOR_TYPE_NAA 3 +#define CES_DESIGNATOR_TYPE_TARGET_PORT_ID 4 +#define CES_DESIGNATOR_TYPE_TARGET_PORT_GRP 5 +#define CES_DESIGNATOR_TYPE_LOGICAL_UNIT_GRP 6 +#define CES_DESIGNATOR_TYPE_MD5_LOGICAL_UNIT_ID 7 +#define CES_DESIGNATOR_TYPE_SCSI_NAME_STRING 8 + + u_int8_t ces_code_set; +#define CES_CODE_SET_RESERVED 0 +#define CES_CODE_SET_BINARY 1 +#define CES_CODE_SET_ASCII 2 +#define CES_CODE_SET_UTF_8 3 + + u_int8_t ces_designator_length; + +#define CES_MAX_DESIGNATOR_LENGTH (1 << 8) + u_int8_t ces_designator[CES_MAX_DESIGNATOR_LENGTH + 1]; }; struct changer_element_status_request { @@ -189,7 +239,7 @@ struct changer_element_status_request { u_int16_t cesr_element_count; u_int16_t cesr_flags; -#define CESR_VOLTAGS 0x01 +#define CESR_VOLTAGS 0x01 struct changer_element_status *cesr_element_status; }; @@ -200,28 +250,29 @@ struct changer_set_voltag_request { u_int16_t csvr_addr; u_int16_t csvr_flags; -#define CSVR_MODE_MASK 0x0f /* mode mask, acceptable modes below: */ +#define CSVR_MODE_MASK 0x0f /* mode mask, acceptable modes below: */ #define CSVR_MODE_SET 0x00 /* set volume tag if not set */ -#define CSVR_MODE_REPLACE 0x01 /* unconditionally replace volume tag */ -#define CSVR_MODE_CLEAR 0x02 /* clear volume tag */ +#define CSVR_MODE_REPLACE 0x01 /* unconditionally replace volume tag */ +#define CSVR_MODE_CLEAR 0x02 /* clear volume tag */ -#define CSVR_ALTERNATE 0x10 /* set to work with alternate voltag */ +#define CSVR_ALTERNATE 0x10 /* set to work with alternate voltag */ changer_voltag_t csvr_voltag; }; -#define CESTATUS_BITS \ +#define CESTATUS_BITS \ "\20\6INEAB\5EXENAB\4ACCESS\3EXCEPT\2IMPEXP\1FULL" -#define CHIOMOVE _IOW('c', 0x01, struct changer_move) -#define CHIOEXCHANGE _IOW('c', 0x02, struct changer_exchange) -#define CHIOPOSITION _IOW('c', 0x03, struct changer_position) -#define CHIOGPICKER _IOR('c', 0x04, int) -#define CHIOSPICKER _IOW('c', 0x05, int) -#define CHIOGPARAMS _IOR('c', 0x06, struct changer_params) -#define CHIOIELEM _IOW('c', 0x07, u_int32_t) -#define CHIOGSTATUS _IOW('c', 0x08, struct changer_element_status_request) -#define CHIOSETVOLTAG _IOW('c', 0x09, struct changer_set_voltag_request) +#define CHIOMOVE _IOW('c', 0x01, struct changer_move) +#define CHIOEXCHANGE _IOW('c', 0x02, struct changer_exchange) +#define CHIOPOSITION _IOW('c', 0x03, struct changer_position) +#define CHIOGPICKER _IOR('c', 0x04, int) +#define CHIOSPICKER _IOW('c', 0x05, int) +#define CHIOGPARAMS _IOR('c', 0x06, struct changer_params) +#define CHIOIELEM _IOW('c', 0x07, u_int32_t) +#define OCHIOGSTATUS _IOW('c', 0x08, struct changer_element_status_request) +#define CHIOSETVOLTAG _IOW('c', 0x09, struct changer_set_voltag_request) +#define CHIOGSTATUS _IOW('c', 0x0A, struct changer_element_status_request) #endif /* !_SYS_CHIO_H_ */ From owner-svn-src-all@FreeBSD.ORG Fri Apr 19 21:08:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CD580A49; Fri, 19 Apr 2013 21:08:22 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BF5221EB0; Fri, 19 Apr 2013 21:08:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3JL8Mqc017668; Fri, 19 Apr 2013 21:08:22 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3JL8LW8017654; Fri, 19 Apr 2013 21:08:21 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201304192108.r3JL8LW8017654@svn.freebsd.org> From: Luigi Rizzo Date: Fri, 19 Apr 2013 21:08:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249659 - head/sys/dev/netmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Apr 2013 21:08:22 -0000 Author: luigi Date: Fri Apr 19 21:08:21 2013 New Revision: 249659 URL: http://svnweb.freebsd.org/changeset/base/249659 Log: mostly whitespace changes: - remove vestiges of the old memory allocator - clean up some comments Modified: head/sys/dev/netmap/netmap.c head/sys/dev/netmap/netmap_kern.h head/sys/dev/netmap/netmap_mem2.c Modified: head/sys/dev/netmap/netmap.c ============================================================================== --- head/sys/dev/netmap/netmap.c Fri Apr 19 20:03:51 2013 (r249658) +++ head/sys/dev/netmap/netmap.c Fri Apr 19 21:08:21 2013 (r249659) @@ -324,11 +324,7 @@ netmap_update_config(struct netmap_adapt } /*------------- memory allocator -----------------*/ -#ifdef NETMAP_MEM2 #include "netmap_mem2.c" -#else /* !NETMAP_MEM2 */ -#include "netmap_mem1.c" -#endif /* !NETMAP_MEM2 */ /*------------ end of memory allocator ----------*/ @@ -498,16 +494,16 @@ netmap_dtor(void *data) { struct netmap_priv_d *priv = data; struct ifnet *ifp = priv->np_ifp; - struct netmap_adapter *na; NMA_LOCK(); if (ifp) { - na = NA(ifp); + struct netmap_adapter *na = NA(ifp); + na->nm_lock(ifp, NETMAP_REG_LOCK, 0); netmap_dtor_locked(data); na->nm_lock(ifp, NETMAP_REG_UNLOCK, 0); - nm_if_rele(ifp); + nm_if_rele(ifp); /* might also destroy *na */ } if (priv->ref_done) { netmap_memory_deref(); Modified: head/sys/dev/netmap/netmap_kern.h ============================================================================== --- head/sys/dev/netmap/netmap_kern.h Fri Apr 19 20:03:51 2013 (r249658) +++ head/sys/dev/netmap/netmap_kern.h Fri Apr 19 21:08:21 2013 (r249659) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011-2012 Matteo Landi, Luigi Rizzo. All rights reserved. + * Copyright (C) 2011-2013 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 @@ -34,8 +34,6 @@ #ifndef _NET_NETMAP_KERN_H_ #define _NET_NETMAP_KERN_H_ -#define NETMAP_MEM2 // use the new memory allocator - #if defined(__FreeBSD__) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) @@ -45,7 +43,7 @@ #define MBUF_LEN(m) ((m)->m_pkthdr.len) #define NM_SEND_UP(ifp, m) ((ifp)->if_input)(ifp, m) #elif defined (linux) -#define NM_LOCK_T spinlock_t +#define NM_LOCK_T safe_spinlock_t // see bsd_glue.h #define NM_SELINFO_T wait_queue_head_t #define MBUF_LEN(m) ((m)->len) #define NM_SEND_UP(ifp, m) netif_rx(m) @@ -431,7 +429,6 @@ netmap_idx_k2n(struct netmap_kring *kr, } -#ifdef NETMAP_MEM2 /* Entries of the look-up table. */ struct lut_entry { void *vaddr; /* virtual address. */ @@ -442,9 +439,6 @@ struct netmap_obj_pool; extern struct lut_entry *netmap_buffer_lut; #define NMB_VA(i) (netmap_buffer_lut[i].vaddr) #define NMB_PA(i) (netmap_buffer_lut[i].paddr) -#else /* NETMAP_MEM1 */ -#define NMB_VA(i) (netmap_buffer_base + (i * NETMAP_BUF_SIZE) ) -#endif /* NETMAP_MEM2 */ /* * NMB return the virtual address of a buffer (buffer 0 on bad index) @@ -462,11 +456,8 @@ PNMB(struct netmap_slot *slot, uint64_t { uint32_t i = slot->buf_idx; void *ret = (i >= netmap_total_buffers) ? NMB_VA(0) : NMB_VA(i); -#ifdef NETMAP_MEM2 + *pp = (i >= netmap_total_buffers) ? NMB_PA(0) : NMB_PA(i); -#else - *pp = vtophys(ret); -#endif return ret; } @@ -474,5 +465,6 @@ PNMB(struct netmap_slot *slot, uint64_t int netmap_rx_irq(struct ifnet *, int, int *); #define netmap_tx_irq(_n, _q) netmap_rx_irq(_n, _q, NULL) + extern int netmap_copy; #endif /* _NET_NETMAP_KERN_H_ */ Modified: head/sys/dev/netmap/netmap_mem2.c ============================================================================== --- head/sys/dev/netmap/netmap_mem2.c Fri Apr 19 20:03:51 2013 (r249658) +++ head/sys/dev/netmap/netmap_mem2.c Fri Apr 19 21:08:21 2013 (r249659) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012 Matteo Landi, Luigi Rizzo, Giuseppe Lettieri. All rights reserved. + * Copyright (C) 2012-2013 Matteo Landi, Luigi Rizzo, Giuseppe Lettieri. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -31,16 +31,18 @@ */ /* - * This allocator creates three memory regions: + * This allocator creates three memory pools: * nm_if_pool for the struct netmap_if * nm_ring_pool for the struct netmap_ring * nm_buf_pool for the packet buffers. * - * All regions need to be multiple of a page size as we export them to - * userspace through mmap. Only the latter needs to be dma-able, + * that contain netmap objects. Each pool is made of a number of clusters, + * multiple of a page size, each containing an integer number of objects. + * The clusters are contiguous in user space but not in the kernel. + * Only nm_buf_pool needs to be dma-able, * but for convenience use the same type of allocator for all. * - * Once mapped, the three regions are exported to userspace + * Once mapped, the three pools are exported to userspace * as a contiguous block, starting from nm_if_pool. Each * cluster (and pool) is an integral number of pages. * [ . . . ][ . . . . . .][ . . . . . . . . . .] @@ -56,7 +58,7 @@ * The pool is split into smaller clusters, whose size is a * multiple of the page size. The cluster size is chosen * to minimize the waste for a given max cluster size - * (we do it by brute force, as we have relatively few object + * (we do it by brute force, as we have relatively few objects * per cluster). * * Objects are aligned to the cache line (64 bytes) rounding up object @@ -80,7 +82,7 @@ * In the worst case we have one netmap_if per ring in the system. * * struct netmap_ring - * variable too, 8 byte per slot plus some fixed amount. + * variable size, 8 byte per slot plus some fixed amount. * Rings can be large (e.g. 4k slots, or >32Kbytes). * We default to 36 KB (9 pages), and a few hundred rings. * @@ -93,11 +95,7 @@ * the size to multiple of 1K or so. Default to 2K */ -#ifndef CONSERVATIVE #define NETMAP_BUF_MAX_NUM 20*4096*2 /* large machine */ -#else /* CONSERVATIVE */ -#define NETMAP_BUF_MAX_NUM 20000 /* 40MB */ -#endif #ifdef linux #define NMA_LOCK_T struct semaphore @@ -178,7 +176,11 @@ struct netmap_mem_d { struct netmap_obj_pool pools[NETMAP_POOLS_NR]; }; - +/* + * nm_mem is the memory allocator used for all physical interfaces + * running in netmap mode. + * Virtual (VALE) ports will have each its own allocator. + */ static struct netmap_mem_d nm_mem = { /* Our memory allocator. */ .pools = { [NETMAP_IF_POOL] = { @@ -205,6 +207,7 @@ static struct netmap_mem_d nm_mem = { /* }, }; +// XXX logically belongs to nm_mem struct lut_entry *netmap_buffer_lut; /* exported */ /* memory allocator related sysctls */ @@ -212,12 +215,10 @@ struct lut_entry *netmap_buffer_lut; /* #define STRINGIFY(x) #x #define DECLARE_SYSCTLS(id, name) \ - /* TUNABLE_INT("hw.netmap." STRINGIFY(name) "_size", &netmap_params[id].size); */ \ SYSCTL_INT(_dev_netmap, OID_AUTO, name##_size, \ CTLFLAG_RW, &netmap_params[id].size, 0, "Requested size of netmap " STRINGIFY(name) "s"); \ SYSCTL_INT(_dev_netmap, OID_AUTO, name##_curr_size, \ CTLFLAG_RD, &nm_mem.pools[id]._objsize, 0, "Current size of netmap " STRINGIFY(name) "s"); \ - /* TUNABLE_INT("hw.netmap." STRINGIFY(name) "_num", &netmap_params[id].num); */ \ SYSCTL_INT(_dev_netmap, OID_AUTO, name##_num, \ CTLFLAG_RW, &netmap_params[id].num, 0, "Requested number of netmap " STRINGIFY(name) "s"); \ SYSCTL_INT(_dev_netmap, OID_AUTO, name##_curr_num, \ @@ -228,14 +229,12 @@ DECLARE_SYSCTLS(NETMAP_RING_POOL, ring); DECLARE_SYSCTLS(NETMAP_BUF_POOL, buf); /* - * Convert a userspace offset to a phisical address. - * XXX re-do in a simpler way. + * Convert a userspace offset to a physical address. + * XXX only called in the FreeBSD's netmap_mmap() + * because in linux we map everything at once. * - * The idea here is to hide userspace applications the fact that pre-allocated - * memory is not contiguous, but fragmented across different clusters and - * smaller memory allocators. Consequently, first of all we need to find which - * allocator is owning provided offset, then we need to find out the physical - * address associated to target page (this is done using the look-up table. + * First, find the allocator that contains the requested offset, + * then locate the cluster through a lookup table. */ static inline vm_paddr_t netmap_ofstophys(vm_offset_t offset) @@ -247,7 +246,7 @@ netmap_ofstophys(vm_offset_t offset) for (i = 0; i < NETMAP_POOLS_NR; offset -= p[i]._memtotal, i++) { if (offset >= p[i]._memtotal) continue; - // XXX now scan the clusters + // now lookup the cluster's address return p[i].lut[offset / p[i]._objsize].paddr + offset % p[i]._objsize; } @@ -296,12 +295,12 @@ netmap_obj_offset(struct netmap_obj_pool netmap_obj_offset(&nm_mem.pools[NETMAP_IF_POOL], (v)) #define netmap_ring_offset(v) \ - (nm_mem.pools[NETMAP_IF_POOL]._memtotal + \ + (nm_mem.pools[NETMAP_IF_POOL]._memtotal + \ netmap_obj_offset(&nm_mem.pools[NETMAP_RING_POOL], (v))) #define netmap_buf_offset(v) \ - (nm_mem.pools[NETMAP_IF_POOL]._memtotal + \ - nm_mem.pools[NETMAP_RING_POOL]._memtotal + \ + (nm_mem.pools[NETMAP_IF_POOL]._memtotal + \ + nm_mem.pools[NETMAP_RING_POOL]._memtotal + \ netmap_obj_offset(&nm_mem.pools[NETMAP_BUF_POOL], (v))) @@ -356,7 +355,8 @@ netmap_obj_malloc(struct netmap_obj_pool /* - * free by index, not by address + * free by index, not by address. This is slow, but is only used + * for a small number of objects (rings, nifp) */ static void netmap_obj_free(struct netmap_obj_pool *p, uint32_t j) @@ -428,7 +428,7 @@ netmap_new_bufs(struct netmap_if *nifp, * in the NIC ring. This is a hack that hides missing * initializations in the drivers, and should go away. */ - slot[i].flags = NS_BUF_CHANGED; + // slot[i].flags = NS_BUF_CHANGED; } ND("allocated %d buffers, %d available, first at %d", n, p->objfree, pos); @@ -683,7 +683,6 @@ netmap_memory_config(void) { int i; - if (!netmap_memory_config_changed()) goto out; From owner-svn-src-all@FreeBSD.ORG Fri Apr 19 21:08:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 30799BC0; Fri, 19 Apr 2013 21:08:57 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 22F9E1EBA; Fri, 19 Apr 2013 21:08:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3JL8v5f018543; Fri, 19 Apr 2013 21:08:57 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3JL8uZF018536; Fri, 19 Apr 2013 21:08:56 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201304192108.r3JL8uZF018536@svn.freebsd.org> From: Robert Watson Date: Fri, 19 Apr 2013 21:08:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r249660 - in releng/8.4/sys: netinet netinet6 X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Apr 2013 21:08:57 -0000 Author: rwatson Date: Fri Apr 19 21:08:56 2013 New Revision: 249660 URL: http://svnweb.freebsd.org/changeset/base/249660 Log: Merge r249478 from stable/8 to releng/8.4: FreeBSD 8.0 introduced inpcb reference counting, and FreeBSD 8.1 began using that reference count to protect inpcb stability in udp_pcblist() and other monitoring functions, preventing the inpcb from being garbage collected across potentially sleeping copyout() operations despite the inpcb zone becoming shrinkable. However, this introduced a race condition in which inp->inp_socket() might become NULL as a result of the socket being freed, but before the inpcb we removed from the global list of connections, allowing it to be exposed to a third thread invoking udp_input() or udp6_input() which would try to indirect through inp_socket without testing it for NULL. This might occur with particular regularity on systems that frequently run netstat, or which use SNMP for connection monitoring. Later FreeBSD releases use a different reference/destruction model, but stable/8 remained affected in FreeBSD 8.2 and 8.3; the problem could be spotted on very high-load UDP services, such as top-level name servers. An Errata Note for 8.x branches under continuing support might be appropriate. Regardless, this fix should be merged to releng/8.4 prior to 8.4-RELEASE. PR: 172963 Submitted by: Vincent Miller Submitted by: Julien Charbon Submitted by: Marc De La Gueronniere Approved by: re (rodrigc) Modified: releng/8.4/sys/netinet/udp_usrreq.c releng/8.4/sys/netinet6/udp6_usrreq.c Directory Properties: releng/8.4/sys/ (props changed) releng/8.4/sys/netinet/ (props changed) releng/8.4/sys/netinet6/ (props changed) Modified: releng/8.4/sys/netinet/udp_usrreq.c ============================================================================== --- releng/8.4/sys/netinet/udp_usrreq.c Fri Apr 19 21:08:21 2013 (r249659) +++ releng/8.4/sys/netinet/udp_usrreq.c Fri Apr 19 21:08:56 2013 (r249660) @@ -495,6 +495,15 @@ udp_input(struct mbuf *m, int off) INP_RLOCK(inp); /* + * Detached PCBs can linger in the list if someone + * holds a reference. (e.g. udp_pcblist) + */ + if (inp->inp_socket == NULL) { + INP_RUNLOCK(inp); + continue; + } + + /* * Handle socket delivery policy for any-source * and source-specific multicast. [RFC3678] */ @@ -620,6 +629,15 @@ udp_input(struct mbuf *m, int off) */ INP_RLOCK(inp); INP_INFO_RUNLOCK(&V_udbinfo); + + /* + * Detached PCBs can linger in the hash table if someone holds a + * reference. (e.g. udp_pcblist) + */ + if (inp->inp_socket == NULL) { + INP_RUNLOCK(inp); + goto badunlocked; + } if (inp->inp_ip_minttl && inp->inp_ip_minttl > ip->ip_ttl) { INP_RUNLOCK(inp); goto badunlocked; Modified: releng/8.4/sys/netinet6/udp6_usrreq.c ============================================================================== --- releng/8.4/sys/netinet6/udp6_usrreq.c Fri Apr 19 21:08:21 2013 (r249659) +++ releng/8.4/sys/netinet6/udp6_usrreq.c Fri Apr 19 21:08:56 2013 (r249660) @@ -273,6 +273,13 @@ udp6_input(struct mbuf **mp, int *offp, } /* + * Detached PCBs can linger in the list if someone + * holds a reference. (e.g. udp_pcblist) + */ + if (inp->inp_socket == NULL) + continue; + + /* * Handle socket delivery policy for any-source * and source-specific multicast. [RFC3678] */ @@ -396,6 +403,15 @@ udp6_input(struct mbuf **mp, int *offp, } INP_RLOCK(inp); INP_INFO_RUNLOCK(&V_udbinfo); + + /* + * Detached PCBs can linger in the hash table if someone holds a + * reference. (e.g. udp_pcblist) + */ + if (inp->inp_socket == NULL) { + INP_RUNLOCK(inp); + goto badunlocked; + } up = intoudpcb(inp); if (up->u_tun_func == NULL) { udp6_append(inp, m, off, &fromsa); From owner-svn-src-all@FreeBSD.ORG Fri Apr 19 21:09:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BF181D3A; Fri, 19 Apr 2013 21:09:27 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 979821ECA; Fri, 19 Apr 2013 21:09:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3JL9RcZ019340; Fri, 19 Apr 2013 21:09:27 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3JL9RXI019339; Fri, 19 Apr 2013 21:09:27 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201304192109.r3JL9RXI019339@svn.freebsd.org> From: "Kenneth D. Merry" Date: Fri, 19 Apr 2013 21:09:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249661 - stable/9/sys/cam/ata X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Apr 2013 21:09:27 -0000 Author: ken Date: Fri Apr 19 21:09:27 2013 New Revision: 249661 URL: http://svnweb.freebsd.org/changeset/base/249661 Log: MFC r249347: ------------------------------------------------------------------------ r249347 | ken | 2013-04-10 16:12:21 -0600 (Wed, 10 Apr 2013) | 22 lines Add a callback to the ada(4) driver so that it knows when GEOM has released references to it. This is the functional equivalent to change r237518, which added this functionality to the cd(4) and da(4) drivers. This fix prevents a panic caused by GEOM calling adaopen() while the device is going away. We now keep the device around until GEOM has finished cleaning up its state. ata_da.c: In adaregister(), add a d_gone callback to the GEOM disk structure registered for the ada driver. Increment the peripheral reference count for GEOM. Add a new callback, adadiskgonecb(), that GEOM calls when it is done with its resources. This callback releases the reference acquired in adaregister(). Submitted by: Po-Li Soong Sponsored by: Spectra Logic Modified: stable/9/sys/cam/ata/ata_da.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ata/ata_da.c ============================================================================== --- stable/9/sys/cam/ata/ata_da.c Fri Apr 19 21:08:56 2013 (r249660) +++ stable/9/sys/cam/ata/ata_da.c Fri Apr 19 21:09:27 2013 (r249661) @@ -792,6 +792,20 @@ adainit(void) } } +/* + * Callback from GEOM, called when it has finished cleaning up its + * resources. + */ +static void +adadiskgonecb(struct disk *dp) +{ + struct cam_periph *periph; + + periph = (struct cam_periph *)dp->d_drv1; + + cam_periph_release(periph); +} + static void adaoninvalidate(struct cam_periph *periph) { @@ -1131,6 +1145,7 @@ adaregister(struct cam_periph *periph, v softc->disk->d_strategy = adastrategy; softc->disk->d_getattr = adagetattr; softc->disk->d_dump = adadump; + softc->disk->d_gone = adadiskgonecb; softc->disk->d_name = "ada"; softc->disk->d_drv1 = periph; maxio = cpi.maxio; /* Honor max I/O size of SIM */ @@ -1194,6 +1209,17 @@ adaregister(struct cam_periph *periph, v } } else legacy_id = -1; + /* + * Acquire a reference to the periph before we register with GEOM. + * We'll release this reference once GEOM calls us back (via + * adadiskgonecb()) telling us that our provider has been freed. + */ + if (cam_periph_acquire(periph) != CAM_REQ_CMP) { + xpt_print(periph->path, "%s: lost periph during " + "registration!\n", __func__); + cam_periph_lock(periph); + return (CAM_REQ_CMP_ERR); + } disk_create(softc->disk, DISK_VERSION); cam_periph_lock(periph); cam_periph_unhold(periph); From owner-svn-src-all@FreeBSD.ORG Fri Apr 19 21:49:11 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B0AA5703; Fri, 19 Apr 2013 21:49:11 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A28EBE6; Fri, 19 Apr 2013 21:49:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3JLnBRM081140; Fri, 19 Apr 2013 21:49:11 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3JLnBMV081139; Fri, 19 Apr 2013 21:49:11 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201304192149.r3JLnBMV081139@svn.freebsd.org> From: Adrian Chadd Date: Fri, 19 Apr 2013 21:49:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249662 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Apr 2013 21:49:11 -0000 Author: adrian Date: Fri Apr 19 21:49:11 2013 New Revision: 249662 URL: http://svnweb.freebsd.org/changeset/base/249662 Log: Initialise the chainmask fields regardless of whether 11n support is compiled in or not. This fixes issues with people running -HEAD but who build modules without doing a "make buildkernel KERNCONF=XXX", thus picking up opt_*.h. The resulting module wouldn't have 11n enabled and the chainmask configuration would just be plain wrong. Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Fri Apr 19 21:09:27 2013 (r249661) +++ head/sys/dev/ath/if_ath.c Fri Apr 19 21:49:11 2013 (r249662) @@ -721,6 +721,14 @@ ath_attach(u_int16_t devid, struct ath_s } /* + * Query the TX/RX chainmask configuration. + * + * This is only relevant for 11n devices. + */ + ath_hal_getrxchainmask(ah, &sc->sc_rxchainmask); + ath_hal_gettxchainmask(ah, &sc->sc_txchainmask); + + /* * Disable MRR with protected frames by default. * Only 802.11n series NICs can handle this. */ @@ -777,14 +785,6 @@ ath_attach(u_int16_t devid, struct ath_s */ (void) ath_hal_getcapability(ah, HAL_CAP_STREAMS, 0, &txs); (void) ath_hal_getcapability(ah, HAL_CAP_STREAMS, 1, &rxs); - - ath_hal_getrxchainmask(ah, &sc->sc_rxchainmask); - ath_hal_gettxchainmask(ah, &sc->sc_txchainmask); - - device_printf(sc->sc_dev, "Chainmasks: TX=0x%x; RX=0x%x\n", - sc->sc_txchainmask, - sc->sc_rxchainmask); - ic->ic_txstream = txs; ic->ic_rxstream = rxs; From owner-svn-src-all@FreeBSD.ORG Fri Apr 19 23:49:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1961FDC6; Fri, 19 Apr 2013 23:49:38 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0954866C; Fri, 19 Apr 2013 23:49:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3JNncWC061135; Fri, 19 Apr 2013 23:49:38 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3JNnYgB061052; Fri, 19 Apr 2013 23:49:34 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201304192349.r3JNnYgB061052@svn.freebsd.org> From: Jung-uk Kim Date: Fri, 19 Apr 2013 23:49:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249663 - in head: sys/conf sys/contrib/dev/acpica sys/contrib/dev/acpica/compiler sys/contrib/dev/acpica/components/debugger sys/contrib/dev/acpica/components/events sys/contrib/dev/ac... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Apr 2013 23:49:38 -0000 Author: jkim Date: Fri Apr 19 23:49:34 2013 New Revision: 249663 URL: http://svnweb.freebsd.org/changeset/base/249663 Log: Merge ACPICA 20130418. Added: head/sys/contrib/dev/acpica/components/namespace/nsarguments.c - copied, changed from r249661, vendor-sys/acpica/dist/source/components/namespace/nsarguments.c Modified: head/sys/conf/files head/sys/contrib/dev/acpica/changes.txt (contents, props changed) head/sys/contrib/dev/acpica/compiler/aslpredef.c head/sys/contrib/dev/acpica/compiler/aslprepkg.c head/sys/contrib/dev/acpica/components/debugger/dbdisply.c head/sys/contrib/dev/acpica/components/debugger/dbexec.c head/sys/contrib/dev/acpica/components/debugger/dbmethod.c head/sys/contrib/dev/acpica/components/debugger/dbnames.c head/sys/contrib/dev/acpica/components/events/evgpe.c head/sys/contrib/dev/acpica/components/events/evregion.c head/sys/contrib/dev/acpica/components/executer/exconfig.c head/sys/contrib/dev/acpica/components/executer/exfldio.c head/sys/contrib/dev/acpica/components/hardware/hwxface.c head/sys/contrib/dev/acpica/components/namespace/nseval.c head/sys/contrib/dev/acpica/components/namespace/nsinit.c head/sys/contrib/dev/acpica/components/namespace/nspredef.c head/sys/contrib/dev/acpica/components/namespace/nsprepkg.c head/sys/contrib/dev/acpica/components/namespace/nsrepair.c head/sys/contrib/dev/acpica/components/namespace/nsrepair2.c head/sys/contrib/dev/acpica/components/namespace/nsxfeval.c head/sys/contrib/dev/acpica/components/parser/psxface.c head/sys/contrib/dev/acpica/components/resources/rsutils.c head/sys/contrib/dev/acpica/components/utilities/uteval.c head/sys/contrib/dev/acpica/components/utilities/utosi.c head/sys/contrib/dev/acpica/components/utilities/utpredef.c head/sys/contrib/dev/acpica/components/utilities/utxferror.c head/sys/contrib/dev/acpica/include/acconfig.h head/sys/contrib/dev/acpica/include/aclocal.h head/sys/contrib/dev/acpica/include/acmacros.h head/sys/contrib/dev/acpica/include/acnamesp.h head/sys/contrib/dev/acpica/include/acoutput.h head/sys/contrib/dev/acpica/include/acpixf.h head/sys/contrib/dev/acpica/include/acpredef.h head/sys/contrib/dev/acpica/include/acstruct.h head/sys/contrib/dev/acpica/include/acutils.h head/sys/modules/acpi/acpi/Makefile head/usr.sbin/acpi/acpidb/Makefile Directory Properties: head/sys/contrib/dev/acpica/ (props changed) head/sys/contrib/dev/acpica/compiler/ (props changed) head/sys/contrib/dev/acpica/components/debugger/ (props changed) head/sys/contrib/dev/acpica/components/events/ (props changed) head/sys/contrib/dev/acpica/components/executer/ (props changed) head/sys/contrib/dev/acpica/components/hardware/ (props changed) head/sys/contrib/dev/acpica/components/namespace/ (props changed) head/sys/contrib/dev/acpica/components/parser/ (props changed) head/sys/contrib/dev/acpica/components/resources/ (props changed) head/sys/contrib/dev/acpica/components/utilities/ (props changed) head/sys/contrib/dev/acpica/include/ (props changed) head/sys/contrib/dev/acpica/os_specific/ (props changed) Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Apr 19 21:49:11 2013 (r249662) +++ head/sys/conf/files Fri Apr 19 23:49:34 2013 (r249663) @@ -374,6 +374,7 @@ contrib/dev/acpica/components/hardware/h contrib/dev/acpica/components/hardware/hwxfsleep.c optional acpi contrib/dev/acpica/components/namespace/nsaccess.c optional acpi contrib/dev/acpica/components/namespace/nsalloc.c optional acpi +contrib/dev/acpica/components/namespace/nsarguments.c optional acpi contrib/dev/acpica/components/namespace/nsconvert.c optional acpi contrib/dev/acpica/components/namespace/nsdump.c optional acpi contrib/dev/acpica/components/namespace/nseval.c optional acpi Modified: head/sys/contrib/dev/acpica/changes.txt ============================================================================== --- head/sys/contrib/dev/acpica/changes.txt Fri Apr 19 21:49:11 2013 (r249662) +++ head/sys/contrib/dev/acpica/changes.txt Fri Apr 19 23:49:34 2013 (r249663) @@ -1,4 +1,91 @@ ---------------------------------------- +18 April 2013. Summary of changes for version 20130418: + +This release is available at https://acpica.org/downloads + + +1) ACPICA kernel-resident subsystem: + +Fixed a possible buffer overrun during some rare but specific field unit +read operations. This overrun can only happen if the DSDT version is 1 -- +meaning that all AML integers are 32 bits -- and the field length is +between 33 and 55 bits long. During the read, an internal buffer object is +created for the field unit because the field is larger than an integer (32 +bits). However, in this case, the buffer will be incorrectly written +beyond the end because the buffer length is less than the internal minimum +of 64 bits (8 bytes) long. The buffer will be either 5, 6, or 7 bytes +long, but a full 8 bytes will be written. + +Updated the Embedded Controller "orphan" _REG method support. This refers +to _REG methods under the EC device that have no corresponding operation +region. This is allowed by the ACPI specification. This update removes a +dependency on the existence an ECDT table. It will execute an orphan _REG +method as long as the operation region handler for the EC is installed at +the EC device node and not the namespace root. Rui Zhang (original +update), Bob Moore (update/integrate). + +Implemented run-time argument typechecking for all predefined ACPI names +(_STA, _BIF, etc.) This change performs object typechecking on all +incoming arguments for all predefined names executed via +AcpiEvaluateObject. This ensures that ACPI-related device drivers are +passing correct object types as well as the correct number of arguments +(therefore identifying any issues immediately). Also, the ASL/namespace +definition of the predefined name is checked against the ACPI +specification for the proper argument count. Adds one new file, +nsarguments.c + +Changed an exception code for the ASL UnLoad() operator. Changed the +exception code for the case where the input DdbHandle is invalid, from +AE_BAD_PARAMETER to the more appropriate AE_AML_OPERAND_TYPE. + +Unix/Linux makefiles: Removed the use of the -O2 optimization flag in the +global makefile. The use of this flag causes compiler errors on earlier +versions of GCC, so it has been removed for compatibility. + +Miscellaneous cleanup: +1) Removed some unused/obsolete macros +2) Fixed a possible memory leak in the _OSI support +3) Removed an unused variable in the predefined name support +4) Windows OSL: remove obsolete reference to a memory list field + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and +has a much larger code and data size. + + Current Release: + Non-Debug Version: 95.2K Code, 26.4K Data, 121.6K Total + Debug Version: 183.0K Code, 76.0K Data, 259.0K Total + Previous Release: + Non-Debug Version: 95.6K Code, 26.8K Data, 122.4K Total + Debug Version: 183.5K Code, 76.6K Data, 260.1K Total + + +2) iASL Compiler/Disassembler and Tools: + +AcpiExec: Added installation of a handler for the SystemCMOS address +space. This prevents control method abort if a method accesses this space. + +AcpiExec: Added support for multiple EC devices, and now install EC +operation region handler(s) at the actual EC device instead of the +namespace root. This reflects the typical behavior of host operating +systems. + +AcpiExec: Updated to ensure that all operation region handlers are +installed before the _REG methods are executed. This prevents a _REG +method from aborting if it accesses an address space has no handler. +AcpiExec installs a handler for every possible address space. + +Debugger: Enhanced the "handlers" command to display non-root handlers. +This change enhances the handlers command to display handlers associated +with individual devices throughout the namespace, in addition to the +currently supported display of handlers associated with the root namespace +node. + +ASL Test Suite: Several test suite errors have been identified and +resolved, reducing the total error count during execution. Chao Guan. + +---------------------------------------- 28 March 2013. Summary of changes for version 20130328: 1) ACPICA kernel-resident subsystem: Modified: head/sys/contrib/dev/acpica/compiler/aslpredef.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslpredef.c Fri Apr 19 21:49:11 2013 (r249662) +++ head/sys/contrib/dev/acpica/compiler/aslpredef.c Fri Apr 19 23:49:34 2013 (r249663) @@ -124,29 +124,30 @@ ApCheckForPredefinedMethod ( default: /* - * Matched a predefined method name + * Matched a predefined method name - validate the ASL-defined + * argument count against the ACPI specification. * - * Validate the ASL-defined argument count. Allow two different legal - * arg counts. + * Some methods are allowed to have a "minimum" number of args + * (_SCP) because their definition in ACPI has changed over time. */ Gbl_ReservedMethods++; ThisName = &AcpiGbl_PredefinedMethods[Index]; - RequiredArgCount = ThisName->Info.ArgumentList & METHOD_ARG_MASK; + RequiredArgCount = METHOD_GET_ARG_COUNT (ThisName->Info.ArgumentList); if (MethodInfo->NumArguments != RequiredArgCount) { sprintf (MsgBuffer, "%4.4s requires %u", ThisName->Info.Name, RequiredArgCount); - if ((MethodInfo->NumArguments > RequiredArgCount) && - !(ThisName->Info.ArgumentList & ARG_COUNT_IS_MINIMUM)) + if (MethodInfo->NumArguments < RequiredArgCount) { - AslError (ASL_WARNING, ASL_MSG_RESERVED_ARG_COUNT_HI, Op, + AslError (ASL_WARNING, ASL_MSG_RESERVED_ARG_COUNT_LO, Op, MsgBuffer); } - else + else if ((MethodInfo->NumArguments > RequiredArgCount) && + !(ThisName->Info.ArgumentList & ARG_COUNT_IS_MINIMUM)) { - AslError (ASL_WARNING, ASL_MSG_RESERVED_ARG_COUNT_LO, Op, + AslError (ASL_WARNING, ASL_MSG_RESERVED_ARG_COUNT_HI, Op, MsgBuffer); } } @@ -388,7 +389,7 @@ ApCheckForPredefinedObject ( * it must be implemented as a control method */ ThisName = &AcpiGbl_PredefinedMethods[Index]; - if ((ThisName->Info.ArgumentList & METHOD_ARG_MASK) > 0) + if (METHOD_GET_ARG_COUNT (ThisName->Info.ArgumentList) > 0) { AslError (ASL_ERROR, ASL_MSG_RESERVED_METHOD, Op, "with arguments"); Modified: head/sys/contrib/dev/acpica/compiler/aslprepkg.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslprepkg.c Fri Apr 19 21:49:11 2013 (r249662) +++ head/sys/contrib/dev/acpica/compiler/aslprepkg.c Fri Apr 19 23:49:34 2013 (r249663) @@ -54,12 +54,12 @@ static void ApCheckPackageElements ( - const char *PredefinedName, - ACPI_PARSE_OBJECT *Op, - UINT8 Type1, - UINT32 Count1, - UINT8 Type2, - UINT32 Count2); + const char *PredefinedName, + ACPI_PARSE_OBJECT *Op, + UINT8 Type1, + UINT32 Count1, + UINT8 Type2, + UINT32 Count2); static void ApCheckPackageList ( @@ -93,8 +93,9 @@ ApPackageTooLarge ( * * FUNCTION: ApCheckPackage * - * PARAMETERS: ParentOp - Parser op for the package - * Predefined - Pointer to package-specific info for method + * PARAMETERS: ParentOp - Parser op for the package + * Predefined - Pointer to package-specific info for + * the method * * RETURN: None * @@ -193,8 +194,8 @@ ApCheckPackage ( case ACPI_PTYPE1_VAR: /* - * The package count is variable, there are no sub-packages, and all - * elements must be of the same type + * The package count is variable, there are no sub-packages, + * and all elements must be of the same type */ for (i = 0; i < Count; i++) { @@ -206,9 +207,9 @@ ApCheckPackage ( case ACPI_PTYPE1_OPTION: /* - * The package count is variable, there are no sub-packages. There are - * a fixed number of required elements, and a variable number of - * optional elements. + * The package count is variable, there are no sub-packages. + * There are a fixed number of required elements, and a variable + * number of optional elements. * * Check if package is at least as large as the minimum required */ @@ -268,8 +269,8 @@ ApCheckPackage ( if (ACPI_SUCCESS (Status)) { /* - * Count cannot be larger than the parent package length, but allow it - * to be smaller. The >= accounts for the Integer above. + * Count cannot be larger than the parent package length, but + * allow it to be smaller. The >= accounts for the Integer above. */ ExpectedCount = (UINT32) Op->Asl.Value.Integer; if (ExpectedCount >= Count) @@ -320,12 +321,12 @@ PackageTooSmall: * * FUNCTION: ApCheckPackageElements * - * PARAMETERS: PredefinedName - Pointer to validation data structure - * Op - Parser op for the package - * Type1 - Object type for first group - * Count1 - Count for first group - * Type2 - Object type for second group - * Count2 - Count for second group + * PARAMETERS: PredefinedName - Name of the predefined object + * Op - Parser op for the package + * Type1 - Object type for first group + * Count1 - Count for first group + * Type2 - Object type for second group + * Count2 - Count for second group * * RETURN: None * Modified: head/sys/contrib/dev/acpica/components/debugger/dbdisply.c ============================================================================== --- head/sys/contrib/dev/acpica/components/debugger/dbdisply.c Fri Apr 19 21:49:11 2013 (r249662) +++ head/sys/contrib/dev/acpica/components/debugger/dbdisply.c Fri Apr 19 23:49:34 2013 (r249663) @@ -68,6 +68,12 @@ static void * AcpiDbGetPointer ( void *Target); +static ACPI_STATUS +AcpiDbDisplayNonRootHandlers ( + ACPI_HANDLE ObjHandle, + UINT32 NestingLevel, + void *Context, + void **ReturnValue); /* * System handler information. @@ -76,6 +82,7 @@ AcpiDbGetPointer ( #define ACPI_PREDEFINED_PREFIX "%25s (%.2X) : " #define ACPI_HANDLER_NAME_STRING "%30s : " #define ACPI_HANDLER_PRESENT_STRING "%-9s (%p)\n" +#define ACPI_HANDLER_PRESENT_STRING2 "%-9s (%p)" #define ACPI_HANDLER_NOT_PRESENT_STRING "%-9s\n" /* All predefined Address Space IDs */ @@ -984,7 +991,7 @@ AcpiDbDisplayHandlers ( /* Operation region handlers */ - AcpiOsPrintf ("\nOperation Region Handlers:\n"); + AcpiOsPrintf ("\nOperation Region Handlers at the namespace root:\n"); ObjDesc = AcpiNsGetAttachedObject (AcpiGbl_RootNode); if (ObjDesc) @@ -1076,6 +1083,77 @@ AcpiDbDisplayHandlers ( AcpiOsPrintf (ACPI_HANDLER_NOT_PRESENT_STRING, "None"); } } + + + /* Other handlers that are installed throughout the namespace */ + + AcpiOsPrintf ("\nOperation Region Handlers for specific devices:\n"); + + (void) AcpiWalkNamespace (ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, + ACPI_UINT32_MAX, AcpiDbDisplayNonRootHandlers, + NULL, NULL, NULL); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiDbDisplayNonRootHandlers + * + * PARAMETERS: ACPI_WALK_CALLBACK + * + * RETURN: Status + * + * DESCRIPTION: Display information about all handlers installed for a + * device object. + * + ******************************************************************************/ + +static ACPI_STATUS +AcpiDbDisplayNonRootHandlers ( + ACPI_HANDLE ObjHandle, + UINT32 NestingLevel, + void *Context, + void **ReturnValue) +{ + ACPI_NAMESPACE_NODE *Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, ObjHandle); + ACPI_OPERAND_OBJECT *ObjDesc; + ACPI_OPERAND_OBJECT *HandlerObj; + char *Pathname; + + + ObjDesc = AcpiNsGetAttachedObject (Node); + if (!ObjDesc) + { + return (AE_OK); + } + + Pathname = AcpiNsGetExternalPathname (Node); + if (!Pathname) + { + return (AE_OK); + } + + /* Display all handlers associated with this device */ + + HandlerObj = ObjDesc->Device.Handler; + while (HandlerObj) + { + AcpiOsPrintf (ACPI_PREDEFINED_PREFIX, + AcpiUtGetRegionName ((UINT8) HandlerObj->AddressSpace.SpaceId), + HandlerObj->AddressSpace.SpaceId); + + AcpiOsPrintf (ACPI_HANDLER_PRESENT_STRING2, + (HandlerObj->AddressSpace.HandlerFlags & + ACPI_ADDR_HANDLER_DEFAULT_INSTALLED) ? "Default" : "User", + HandlerObj->AddressSpace.Handler); + + AcpiOsPrintf (" Device Name: %s (%p)\n", Pathname, Node); + + HandlerObj = HandlerObj->AddressSpace.Next; + } + + ACPI_FREE (Pathname); + return (AE_OK); } #endif /* ACPI_DEBUGGER */ Modified: head/sys/contrib/dev/acpica/components/debugger/dbexec.c ============================================================================== --- head/sys/contrib/dev/acpica/components/debugger/dbexec.c Fri Apr 19 21:49:11 2013 (r249662) +++ head/sys/contrib/dev/acpica/components/debugger/dbexec.c Fri Apr 19 23:49:34 2013 (r249663) @@ -151,8 +151,7 @@ AcpiDbExecuteMethod ( { ACPI_STATUS Status; ACPI_OBJECT_LIST ParamObjects; - ACPI_OBJECT Params[ACPI_METHOD_NUM_ARGS]; - ACPI_DEVICE_INFO *ObjInfo; + ACPI_OBJECT Params[ACPI_DEBUGGER_MAX_ARGS + 1]; UINT32 i; @@ -164,78 +163,30 @@ AcpiDbExecuteMethod ( AcpiOsPrintf ("Warning: debug output is not enabled!\n"); } - /* Get the object info for number of method parameters */ - - Status = AcpiGetObjectInfo (Info->Method, &ObjInfo); - if (ACPI_FAILURE (Status)) - { - return_ACPI_STATUS (Status); - } - + ParamObjects.Count = 0; ParamObjects.Pointer = NULL; - ParamObjects.Count = 0; - - if (ObjInfo->Type == ACPI_TYPE_METHOD) - { - /* Are there arguments to the method? */ - i = 0; - if (Info->Args && Info->Args[0]) - { - /* Get arguments passed on the command line */ + /* Pass through any command-line arguments */ - for (; Info->Args[i] && - (i < ACPI_METHOD_NUM_ARGS) && - (i < ObjInfo->ParamCount); - i++) - { - /* Convert input string (token) to an actual ACPI_OBJECT */ - - Status = AcpiDbConvertToObject (Info->Types[i], - Info->Args[i], &Params[i]); - if (ACPI_FAILURE (Status)) - { - ACPI_EXCEPTION ((AE_INFO, Status, - "While parsing method arguments")); - goto Cleanup; - } - } - } - - /* Create additional "default" parameters as needed */ + if (Info->Args && Info->Args[0]) + { + /* Get arguments passed on the command line */ - if (i < ObjInfo->ParamCount) + for (i = 0; (Info->Args[i] && *(Info->Args[i])); i++) { - AcpiOsPrintf ("Adding %u arguments containing default values\n", - ObjInfo->ParamCount - i); + /* Convert input string (token) to an actual ACPI_OBJECT */ - for (; i < ObjInfo->ParamCount; i++) + Status = AcpiDbConvertToObject (Info->Types[i], + Info->Args[i], &Params[i]); + if (ACPI_FAILURE (Status)) { - switch (i) - { - case 0: - - Params[0].Type = ACPI_TYPE_INTEGER; - Params[0].Integer.Value = 0x01020304; - break; - - case 1: - - Params[1].Type = ACPI_TYPE_STRING; - Params[1].String.Length = 12; - Params[1].String.Pointer = "AML Debugger"; - break; - - default: - - Params[i].Type = ACPI_TYPE_INTEGER; - Params[i].Integer.Value = i * (UINT64) 0x1000; - break; - } + ACPI_EXCEPTION ((AE_INFO, Status, + "While parsing method arguments")); + goto Cleanup; } } - ParamObjects.Count = ObjInfo->ParamCount; + ParamObjects.Count = i; ParamObjects.Pointer = Params; } @@ -247,8 +198,8 @@ AcpiDbExecuteMethod ( /* Do the actual method execution */ AcpiGbl_MethodExecuting = TRUE; - Status = AcpiEvaluateObject (NULL, - Info->Pathname, &ParamObjects, ReturnObj); + Status = AcpiEvaluateObject (NULL, Info->Pathname, + &ParamObjects, ReturnObj); AcpiGbl_CmSingleStep = FALSE; AcpiGbl_MethodExecuting = FALSE; @@ -267,9 +218,7 @@ AcpiDbExecuteMethod ( } Cleanup: - AcpiDbDeleteObjects (ObjInfo->ParamCount, Params); - ACPI_FREE (ObjInfo); - + AcpiDbDeleteObjects (ParamObjects.Count, Params); return_ACPI_STATUS (Status); } Modified: head/sys/contrib/dev/acpica/components/debugger/dbmethod.c ============================================================================== --- head/sys/contrib/dev/acpica/components/debugger/dbmethod.c Fri Apr 19 21:49:11 2013 (r249662) +++ head/sys/contrib/dev/acpica/components/debugger/dbmethod.c Fri Apr 19 23:49:34 2013 (r249663) @@ -49,6 +49,7 @@ #include #include #include +#include #ifdef ACPI_DEBUGGER @@ -437,17 +438,23 @@ AcpiDbWalkForExecute ( void *Context, void **ReturnValue) { - ACPI_NAMESPACE_NODE *Node = (ACPI_NAMESPACE_NODE *) ObjHandle; - ACPI_DB_EXECUTE_WALK *Info = (ACPI_DB_EXECUTE_WALK *) Context; - ACPI_BUFFER ReturnObj; - ACPI_STATUS Status; - char *Pathname; - UINT32 i; - ACPI_DEVICE_INFO *ObjInfo; - ACPI_OBJECT_LIST ParamObjects; - ACPI_OBJECT Params[ACPI_METHOD_NUM_ARGS]; - const ACPI_PREDEFINED_INFO *Predefined; + ACPI_NAMESPACE_NODE *Node = (ACPI_NAMESPACE_NODE *) ObjHandle; + ACPI_DB_EXECUTE_WALK *Info = (ACPI_DB_EXECUTE_WALK *) Context; + char *Pathname; + const ACPI_PREDEFINED_INFO *Predefined; + ACPI_DEVICE_INFO *ObjInfo; + ACPI_OBJECT_LIST ParamObjects; + ACPI_OBJECT Params[ACPI_METHOD_NUM_ARGS]; + ACPI_OBJECT *ThisParam; + ACPI_BUFFER ReturnObj; + ACPI_STATUS Status; + UINT16 ArgTypeList; + UINT8 ArgCount; + UINT8 ArgType; + UINT32 i; + + /* The name must be a predefined ACPI name */ Predefined = AcpiUtMatchPredefinedMethod (Node->Name.Ascii); if (!Predefined) @@ -474,21 +481,59 @@ AcpiDbWalkForExecute ( return (Status); } + ParamObjects.Count = 0; ParamObjects.Pointer = NULL; - ParamObjects.Count = 0; if (ObjInfo->Type == ACPI_TYPE_METHOD) { - /* Setup default parameters */ + /* Setup default parameters (with proper types) */ + + ArgTypeList = Predefined->Info.ArgumentList; + ArgCount = METHOD_GET_ARG_COUNT (ArgTypeList); - for (i = 0; i < ObjInfo->ParamCount; i++) + /* + * Setup the ACPI-required number of arguments, regardless of what + * the actual method defines. If there is a difference, then the + * method is wrong and a warning will be issued during execution. + */ + ThisParam = Params; + for (i = 0; i < ArgCount; i++) { - Params[i].Type = ACPI_TYPE_INTEGER; - Params[i].Integer.Value = 1; + ArgType = METHOD_GET_NEXT_TYPE (ArgTypeList); + ThisParam->Type = ArgType; + + switch (ArgType) + { + case ACPI_TYPE_INTEGER: + ThisParam->Integer.Value = 1; + break; + + case ACPI_TYPE_STRING: + ThisParam->String.Pointer = "This is the default argument string"; + ThisParam->String.Length = ACPI_STRLEN (ThisParam->String.Pointer); + break; + + case ACPI_TYPE_BUFFER: + ThisParam->Buffer.Pointer = (UINT8 *) Params; /* just a garbage buffer */ + ThisParam->Buffer.Length = 48; + break; + + case ACPI_TYPE_PACKAGE: + ThisParam->Package.Elements = NULL; + ThisParam->Package.Count = 0; + break; + + default: + AcpiOsPrintf ("%s: Unsupported argument type: %u\n", + Pathname, ArgType); + break; + } + + ThisParam++; } - ParamObjects.Pointer = Params; - ParamObjects.Count = ObjInfo->ParamCount; + ParamObjects.Count = ArgCount; + ParamObjects.Pointer = Params; } ACPI_FREE (ObjInfo); Modified: head/sys/contrib/dev/acpica/components/debugger/dbnames.c ============================================================================== --- head/sys/contrib/dev/acpica/components/debugger/dbnames.c Fri Apr 19 21:49:11 2013 (r249662) +++ head/sys/contrib/dev/acpica/components/debugger/dbnames.c Fri Apr 19 23:49:34 2013 (r249663) @@ -435,6 +435,7 @@ AcpiDbWalkForPredefinedNames ( const ACPI_PREDEFINED_INFO *Predefined; const ACPI_PREDEFINED_INFO *Package = NULL; char *Pathname; + char StringBuffer[48]; Predefined = AcpiUtMatchPredefinedMethod (Node->Name.Ascii); @@ -456,23 +457,28 @@ AcpiDbWalkForPredefinedNames ( Package = Predefined + 1; } - AcpiOsPrintf ("%-32s arg %X ret %2.2X", Pathname, - (Predefined->Info.ArgumentList & METHOD_ARG_MASK), + AcpiUtGetExpectedReturnTypes (StringBuffer, Predefined->Info.ExpectedBtypes); + AcpiOsPrintf ("%-32s Arguments %X, Return Types: %s", Pathname, + METHOD_GET_ARG_COUNT (Predefined->Info.ArgumentList), + StringBuffer); + if (Package) { - AcpiOsPrintf (" PkgType %2.2X ObjType %2.2X Count %2.2X", + AcpiOsPrintf (" (PkgType %2.2X, ObjType %2.2X, Count %2.2X)", Package->RetInfo.Type, Package->RetInfo.ObjectType1, Package->RetInfo.Count1); } AcpiOsPrintf("\n"); - AcpiNsCheckParameterCount (Pathname, Node, ACPI_UINT32_MAX, Predefined); + /* Check that the declared argument count matches the ACPI spec */ + + AcpiNsCheckAcpiCompliance (Pathname, Node, Predefined); + ACPI_FREE (Pathname); (*Count)++; - return (AE_OK); } Modified: head/sys/contrib/dev/acpica/components/events/evgpe.c ============================================================================== --- head/sys/contrib/dev/acpica/components/events/evgpe.c Fri Apr 19 21:49:11 2013 (r249662) +++ head/sys/contrib/dev/acpica/components/events/evgpe.c Fri Apr 19 23:49:34 2013 (r249663) @@ -628,7 +628,6 @@ AcpiEvAsynchExecuteGpeMethod ( "while evaluating GPE method [%4.4s]", AcpiUtGetNodeName (LocalGpeEventInfo->Dispatch.MethodNode))); } - break; default: Modified: head/sys/contrib/dev/acpica/components/events/evregion.c ============================================================================== --- head/sys/contrib/dev/acpica/components/events/evregion.c Fri Apr 19 21:49:11 2013 (r249662) +++ head/sys/contrib/dev/acpica/components/events/evregion.c Fri Apr 19 23:49:34 2013 (r249663) @@ -60,7 +60,7 @@ extern UINT8 AcpiGbl_DefaultAddre static void AcpiEvOrphanEcRegMethod ( - void); + ACPI_NAMESPACE_NODE *EcDeviceNode); static ACPI_STATUS AcpiEvRegRun ( @@ -564,7 +564,7 @@ AcpiEvExecuteRegMethod ( } Info->PrefixNode = RegionObj2->Extra.Method_REG; - Info->Pathname = NULL; + Info->RelativePathname = NULL; Info->Parameters = Args; Info->Flags = ACPI_IGNORE_RETURN_VALUE; @@ -650,7 +650,7 @@ AcpiEvExecuteRegMethods ( if (SpaceId == ACPI_ADR_SPACE_EC) { - AcpiEvOrphanEcRegMethod (); + AcpiEvOrphanEcRegMethod (Node); } return_ACPI_STATUS (Status); @@ -728,7 +728,7 @@ AcpiEvRegRun ( * * FUNCTION: AcpiEvOrphanEcRegMethod * - * PARAMETERS: None + * PARAMETERS: EcDeviceNode - Namespace node for an EC device * * RETURN: None * @@ -740,41 +740,30 @@ AcpiEvRegRun ( * detected by providing a _REG method object underneath the * Embedded Controller device." * - * To quickly access the EC device, we use the EC_ID that appears - * within the ECDT. Otherwise, we would need to perform a time- - * consuming namespace walk, executing _HID methods to find the - * EC device. + * To quickly access the EC device, we use the EcDeviceNode used + * during EC handler installation. Otherwise, we would need to + * perform a time consuming namespace walk, executing _HID + * methods to find the EC device. + * + * MUTEX: Assumes the namespace is locked * ******************************************************************************/ static void AcpiEvOrphanEcRegMethod ( - void) + ACPI_NAMESPACE_NODE *EcDeviceNode) { - ACPI_TABLE_ECDT *Table; + ACPI_HANDLE RegMethod; + ACPI_NAMESPACE_NODE *NextNode; ACPI_STATUS Status; ACPI_OBJECT_LIST Args; ACPI_OBJECT Objects[2]; - ACPI_NAMESPACE_NODE *EcDeviceNode; - ACPI_NAMESPACE_NODE *RegMethod; - ACPI_NAMESPACE_NODE *NextNode; ACPI_FUNCTION_TRACE (EvOrphanEcRegMethod); - /* Get the ECDT (if present in system) */ - - Status = AcpiGetTable (ACPI_SIG_ECDT, 0, - ACPI_CAST_INDIRECT_PTR (ACPI_TABLE_HEADER, &Table)); - if (ACPI_FAILURE (Status)) - { - return_VOID; - } - - /* We need a valid EC_ID string */ - - if (!(*Table->Id)) + if (!EcDeviceNode) { return_VOID; } @@ -783,23 +772,12 @@ AcpiEvOrphanEcRegMethod ( (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); - /* Get a handle to the EC device referenced in the ECDT */ - - Status = AcpiGetHandle (NULL, - ACPI_CAST_PTR (char, Table->Id), - ACPI_CAST_PTR (ACPI_HANDLE, &EcDeviceNode)); - if (ACPI_FAILURE (Status)) - { - goto Exit; - } - /* Get a handle to a _REG method immediately under the EC device */ - Status = AcpiGetHandle (EcDeviceNode, - METHOD_NAME__REG, ACPI_CAST_PTR (ACPI_HANDLE, &RegMethod)); + Status = AcpiGetHandle (EcDeviceNode, METHOD_NAME__REG, &RegMethod); if (ACPI_FAILURE (Status)) { - goto Exit; + goto Exit; /* There is no _REG method present */ } /* @@ -807,7 +785,7 @@ AcpiEvOrphanEcRegMethod ( * this scope with the Embedded Controller space ID. Otherwise, it * will already have been executed. Note, this allows for Regions * with other space IDs to be present; but the code below will then - * execute the _REG method with the EC space ID argument. + * execute the _REG method with the EmbeddedControl SpaceID argument. */ NextNode = AcpiNsGetNextNode (EcDeviceNode, NULL); while (NextNode) @@ -816,12 +794,13 @@ AcpiEvOrphanEcRegMethod ( (NextNode->Object) && (NextNode->Object->Region.SpaceId == ACPI_ADR_SPACE_EC)) { - goto Exit; /* Do not execute _REG */ + goto Exit; /* Do not execute the _REG */ } + NextNode = AcpiNsGetNextNode (EcDeviceNode, NextNode); } - /* Evaluate the _REG(EC,Connect) method */ + /* Evaluate the _REG(EmbeddedControl,Connect) method */ Args.Count = 2; Args.Pointer = Objects; Modified: head/sys/contrib/dev/acpica/components/executer/exconfig.c ============================================================================== --- head/sys/contrib/dev/acpica/components/executer/exconfig.c Fri Apr 19 21:49:11 2013 (r249662) +++ head/sys/contrib/dev/acpica/components/executer/exconfig.c Fri Apr 19 23:49:34 2013 (r249663) @@ -643,7 +643,7 @@ AcpiExUnloadTable ( (DdbHandle->Common.Type != ACPI_TYPE_LOCAL_REFERENCE) || (!(DdbHandle->Common.Flags & AOPOBJ_DATA_VALID))) { - return_ACPI_STATUS (AE_BAD_PARAMETER); + return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } /* Get the table index from the DdbHandle */ Modified: head/sys/contrib/dev/acpica/components/executer/exfldio.c ============================================================================== --- head/sys/contrib/dev/acpica/components/executer/exfldio.c Fri Apr 19 21:49:11 2013 (r249662) +++ head/sys/contrib/dev/acpica/components/executer/exfldio.c Fri Apr 19 23:49:34 2013 (r249663) @@ -766,7 +766,18 @@ AcpiExExtractFromField ( if ((ObjDesc->CommonField.StartFieldBitOffset == 0) && (ObjDesc->CommonField.BitLength == AccessBitWidth)) { - Status = AcpiExFieldDatumIo (ObjDesc, 0, Buffer, ACPI_READ); + if (BufferLength >= sizeof (UINT64)) + { + Status = AcpiExFieldDatumIo (ObjDesc, 0, Buffer, ACPI_READ); + } + else + { + /* Use RawDatum (UINT64) to handle buffers < 64 bits */ + + Status = AcpiExFieldDatumIo (ObjDesc, 0, &RawDatum, ACPI_READ); + ACPI_MEMCPY (Buffer, &RawDatum, BufferLength); + } + return_ACPI_STATUS (Status); } Modified: head/sys/contrib/dev/acpica/components/hardware/hwxface.c ============================================================================== --- head/sys/contrib/dev/acpica/components/hardware/hwxface.c Fri Apr 19 21:49:11 2013 (r249662) +++ head/sys/contrib/dev/acpica/components/hardware/hwxface.c Fri Apr 19 23:49:34 2013 (r249663) @@ -556,7 +556,8 @@ AcpiGetSleepTypeData ( * Evaluate the \_Sx namespace object containing the register values * for this state */ - Info->Pathname = ACPI_CAST_PTR (char, AcpiGbl_SleepStateNames[SleepState]); + Info->RelativePathname = ACPI_CAST_PTR ( + char, AcpiGbl_SleepStateNames[SleepState]); Status = AcpiNsEvaluate (Info); if (ACPI_FAILURE (Status)) { @@ -568,7 +569,7 @@ AcpiGetSleepTypeData ( if (!Info->ReturnObject) { ACPI_ERROR ((AE_INFO, "No Sleep State object returned from [%s]", - Info->Pathname)); + Info->RelativePathname)); Status = AE_AML_NO_RETURN_VALUE; goto Cleanup; } @@ -630,7 +631,7 @@ Cleanup: if (ACPI_FAILURE (Status)) { ACPI_EXCEPTION ((AE_INFO, Status, - "While evaluating Sleep State [%s]", Info->Pathname)); + "While evaluating Sleep State [%s]", Info->RelativePathname)); } ACPI_FREE (Info); Copied and modified: head/sys/contrib/dev/acpica/components/namespace/nsarguments.c (from r249661, vendor-sys/acpica/dist/source/components/namespace/nsarguments.c) ============================================================================== --- vendor-sys/acpica/dist/source/components/namespace/nsarguments.c Fri Apr 19 21:09:27 2013 (r249661, copy source) +++ head/sys/contrib/dev/acpica/components/namespace/nsarguments.c Fri Apr 19 23:49:34 2013 (r249663) @@ -41,10 +41,10 @@ * POSSIBILITY OF SUCH DAMAGES. */ -#include "acpi.h" -#include "accommon.h" -#include "acnamesp.h" -#include "acpredef.h" +#include +#include +#include +#include #define _COMPONENT ACPI_NAMESPACE Modified: head/sys/contrib/dev/acpica/components/namespace/nseval.c ============================================================================== --- head/sys/contrib/dev/acpica/components/namespace/nseval.c Fri Apr 19 21:49:11 2013 (r249662) +++ head/sys/contrib/dev/acpica/components/namespace/nseval.c Fri Apr 19 23:49:34 2013 (r249663) @@ -67,7 +67,7 @@ AcpiNsExecModuleCode ( * * PARAMETERS: Info - Evaluation info block, contains: * PrefixNode - Prefix or Method/Object Node to execute - * Pathname - Name of method to execute, If NULL, the + * RelativePath - Name of method to execute, If NULL, the * Node is the object to execute * Parameters - List of parameters to pass to the method, * terminated by NULL. Params itself may be @@ -93,7 +93,6 @@ AcpiNsEvaluate ( ACPI_EVALUATE_INFO *Info) { ACPI_STATUS Status; - ACPI_NAMESPACE_NODE *Node; ACPI_FUNCTION_TRACE (NsEvaluate); @@ -104,23 +103,18 @@ AcpiNsEvaluate ( return_ACPI_STATUS (AE_BAD_PARAMETER); } - /* Initialize the return value to an invalid object */ - - Info->ReturnObject = NULL; - Info->ParamCount = 0; - - if (!Info->ResolvedNode) + if (!Info->Node) { /* - * Get the actual namespace node for the target object if we need to. - * Handles these cases: + * Get the actual namespace node for the target object if we + * need to. Handles these cases: * - * 1) Null node, Pathname (absolute path) - * 2) Node, Pathname (path relative to Node) - * 3) Node, Null Pathname + * 1) Null node, valid pathname from root (absolute path) + * 2) Node and valid pathname (path relative to Node) + * 3) Node, Null pathname */ - Status = AcpiNsGetNode (Info->PrefixNode, Info->Pathname, - ACPI_NS_NO_UPSEARCH, &Info->ResolvedNode); + Status = AcpiNsGetNode (Info->PrefixNode, Info->RelativePathname, + ACPI_NS_NO_UPSEARCH, &Info->Node); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); @@ -128,60 +122,122 @@ AcpiNsEvaluate ( } /* - * For a method alias, we must grab the actual method node so that proper - * scoping context will be established before execution. + * For a method alias, we must grab the actual method node so that + * proper scoping context will be established before execution. */ - if (AcpiNsGetType (Info->ResolvedNode) == ACPI_TYPE_LOCAL_METHOD_ALIAS) + if (AcpiNsGetType (Info->Node) == ACPI_TYPE_LOCAL_METHOD_ALIAS) + { + Info->Node = ACPI_CAST_PTR ( + ACPI_NAMESPACE_NODE, Info->Node->Object); + } + + /* Complete the info block initialization */ + + Info->ReturnObject = NULL; + Info->NodeFlags = Info->Node->Flags; + Info->ObjDesc = AcpiNsGetAttachedObject (Info->Node); + + ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "%s [%p] Value %p\n", + Info->RelativePathname, Info->Node, + AcpiNsGetAttachedObject (Info->Node))); + + /* Get info if we have a predefined name (_HID, etc.) */ + + Info->Predefined = AcpiUtMatchPredefinedMethod (Info->Node->Name.Ascii); + + /* Get the full pathname to the object, for use in warning messages */ + + Info->FullPathname = AcpiNsGetExternalPathname (Info->Node); + if (!Info->FullPathname) { - Info->ResolvedNode = - ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, Info->ResolvedNode->Object); + return_ACPI_STATUS (AE_NO_MEMORY); } - ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "%s [%p] Value %p\n", Info->Pathname, - Info->ResolvedNode, AcpiNsGetAttachedObject (Info->ResolvedNode))); + /* Count the number of arguments being passed in */ + + Info->ParamCount = 0; + if (Info->Parameters) + { + while (Info->Parameters[Info->ParamCount]) + { + Info->ParamCount++; + } + + /* Warn on impossible argument count */ + + if (Info->ParamCount > ACPI_METHOD_NUM_ARGS) + { + ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname, ACPI_WARN_ALWAYS, + "Excess arguments (%u) - using only %u", + Info->ParamCount, ACPI_METHOD_NUM_ARGS)); + + Info->ParamCount = ACPI_METHOD_NUM_ARGS; + } + } + + /* + * For predefined names: Check that the declared argument count + * matches the ACPI spec -- otherwise this is a BIOS error. + */ + AcpiNsCheckAcpiCompliance (Info->FullPathname, Info->Node, + Info->Predefined); + + /* + * For all names: Check that the incoming argument count for + * this method/object matches the actual ASL/AML definition. + */ + AcpiNsCheckArgumentCount (Info->FullPathname, Info->Node, + Info->ParamCount, Info->Predefined); + + /* For predefined names: Typecheck all incoming arguments */ - Node = Info->ResolvedNode; + AcpiNsCheckArgumentTypes (Info); /* *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Apr 20 00:33:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 656C1537; Sat, 20 Apr 2013 00:33:38 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 570A97CF; Sat, 20 Apr 2013 00:33:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3K0Xb2M025898; Sat, 20 Apr 2013 00:33:37 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3K0XbG1025892; Sat, 20 Apr 2013 00:33:37 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201304200033.r3K0XbG1025892@svn.freebsd.org> From: Sean Bruno Date: Sat, 20 Apr 2013 00:33:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249664 - in head/sys: cam conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Apr 2013 00:33:38 -0000 Author: sbruno Date: Sat Apr 20 00:33:37 2013 New Revision: 249664 URL: http://svnweb.freebsd.org/changeset/base/249664 Log: Expose CAM_BOOT_DELAY as a kernel conf item now. This allows users who boot without loader to adjust their environments around slightly buggy or slow hardware. PR: kern/161809 Submitted by: rozhuk.im@gmail.com MFC after: 2 weeks Modified: head/sys/cam/cam_xpt.c head/sys/conf/options Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Fri Apr 19 23:49:34 2013 (r249663) +++ head/sys/cam/cam_xpt.c Sat Apr 20 00:33:37 2013 (r249664) @@ -878,6 +878,13 @@ xpt_init(void *dummy) mtx_init(&xsoftc.xpt_lock, "XPT lock", NULL, MTX_DEF); mtx_init(&xsoftc.xpt_topo_lock, "XPT topology lock", NULL, MTX_DEF); +#ifdef CAM_BOOT_DELAY + /* + * Override this value at compile time to assist our users + * who don't use loader to boot a kernel. + */ + xsoftc.boot_delay = CAM_BOOT_DELAY; +#endif /* * The xpt layer is, itself, the equivelent of a SIM. * Allow 16 ccbs in the ccb pool for it. This should Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Fri Apr 19 23:49:34 2013 (r249663) +++ head/sys/conf/options Sat Apr 20 00:33:37 2013 (r249664) @@ -307,6 +307,7 @@ CAM_DEBUG_BUS opt_cam.h CAM_DEBUG_TARGET opt_cam.h CAM_DEBUG_LUN opt_cam.h CAM_DEBUG_FLAGS opt_cam.h +CAM_BOOT_DELAY opt_cam.h SCSI_DELAY opt_scsi.h SCSI_NO_SENSE_STRINGS opt_scsi.h SCSI_NO_OP_STRINGS opt_scsi.h From owner-svn-src-all@FreeBSD.ORG Sat Apr 20 01:12:23 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E5842872; Sat, 20 Apr 2013 01:12:23 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D78E888E; Sat, 20 Apr 2013 01:12:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3K1CNDC081183; Sat, 20 Apr 2013 01:12:23 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3K1CNqN081181; Sat, 20 Apr 2013 01:12:23 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201304200112.r3K1CNqN081181@svn.freebsd.org> From: Warner Losh Date: Sat, 20 Apr 2013 01:12:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249665 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Apr 2013 01:12:24 -0000 Author: imp Date: Sat Apr 20 01:12:23 2013 New Revision: 249665 URL: http://svnweb.freebsd.org/changeset/base/249665 Log: Add note about fagility of the clang upgrade process. Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Sat Apr 20 00:33:37 2013 (r249664) +++ head/UPDATING Sat Apr 20 01:12:23 2013 (r249665) @@ -11,6 +11,11 @@ handbook: Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before running portupgrade. +NOTE: FreeBSD has switched from gcc to clang. If you have trouble bootstrapping +from older versions of FreeBSD, try WITHOUT_CLANG and WITHOUT_CLANG_IS_CC to +bootstrap to tip of head, and then rebuild without those options. The bootstrap +process from older version of current is a bit fragile. + NOTE TO PEOPLE WHO THINK THAT FreeBSD 10.x IS SLOW: FreeBSD 10.x has many debugging features turned on, in both the kernel and userland. These features attempt to detect incorrect use of From owner-svn-src-all@FreeBSD.ORG Sat Apr 20 07:47:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 811316C6; Sat, 20 Apr 2013 07:47:28 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 64063118F; Sat, 20 Apr 2013 07:47:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3K7lSxe084624; Sat, 20 Apr 2013 07:47:28 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3K7lQov084588; Sat, 20 Apr 2013 07:47:26 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201304200747.r3K7lQov084588@svn.freebsd.org> From: Mikolaj Golub Date: Sat, 20 Apr 2013 07:47:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249666 - head/lib/libprocstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Apr 2013 07:47:28 -0000 Author: trociny Date: Sat Apr 20 07:47:26 2013 New Revision: 249666 URL: http://svnweb.freebsd.org/changeset/base/249666 Log: Make libprocstat(3) extract procstat notes from a process core file. PR: kern/173723 Suggested by: jhb Glanced by: kib MFC after: 1 month Added: head/lib/libprocstat/core.c (contents, props changed) head/lib/libprocstat/core.h (contents, props changed) Modified: head/lib/libprocstat/Makefile head/lib/libprocstat/Symbol.map head/lib/libprocstat/libprocstat.3 head/lib/libprocstat/libprocstat.c head/lib/libprocstat/libprocstat.h head/lib/libprocstat/libprocstat_internal.h Modified: head/lib/libprocstat/Makefile ============================================================================== --- head/lib/libprocstat/Makefile Sat Apr 20 01:12:23 2013 (r249665) +++ head/lib/libprocstat/Makefile Sat Apr 20 07:47:26 2013 (r249666) @@ -6,6 +6,7 @@ LIB= procstat SRCS= cd9660.c \ common_kvm.c \ + core.c \ libprocstat.c \ msdosfs.c \ udf.c @@ -17,8 +18,8 @@ INCS= libprocstat.h CFLAGS+= -I. -I${.CURDIR} -D_KVM_VNODE SHLIB_MAJOR= 1 -DPADD= ${LIBKVM} ${LIBUTIL} -LDADD= -lkvm -lutil +DPADD= ${LIBELF} ${LIBKVM} ${LIBUTIL} +LDADD= -lelf -lkvm -lutil MAN= libprocstat.3 Modified: head/lib/libprocstat/Symbol.map ============================================================================== --- head/lib/libprocstat/Symbol.map Sat Apr 20 01:12:23 2013 (r249665) +++ head/lib/libprocstat/Symbol.map Sat Apr 20 07:47:26 2013 (r249666) @@ -17,4 +17,5 @@ FBSD_1.2 { FBSD_1.3 { procstat_get_shm_info; + procstat_open_core; }; Added: head/lib/libprocstat/core.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libprocstat/core.c Sat Apr 20 07:47:26 2013 (r249666) @@ -0,0 +1,262 @@ +/*- + * Copyright (c) 2013 Mikolaj Golub + * 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 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. + * + * $FreeBSD$ + */ + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "core.h" + +#define PROCSTAT_CORE_MAGIC 0x012DADB8 +struct procstat_core +{ + int pc_magic; + int pc_fd; + Elf *pc_elf; + GElf_Ehdr pc_ehdr; + GElf_Phdr pc_phdr; +}; + +static bool core_offset(struct procstat_core *core, off_t offset); +static bool core_read(struct procstat_core *core, void *buf, size_t len); + +struct procstat_core * +procstat_core_open(const char *filename) +{ + struct procstat_core *core; + Elf *e; + GElf_Ehdr ehdr; + GElf_Phdr phdr; + size_t nph; + int fd, i; + + if (elf_version(EV_CURRENT) == EV_NONE) { + warnx("ELF library too old"); + return (NULL); + } + fd = open(filename, O_RDONLY, 0); + if (fd == -1) { + warn("open(%s)", filename); + return (NULL); + } + e = elf_begin(fd, ELF_C_READ, NULL); + if (e == NULL) { + warnx("elf_begin: %s", elf_errmsg(-1)); + goto fail; + } + if (elf_kind(e) != ELF_K_ELF) { + warnx("%s is not an ELF object", filename); + goto fail; + } + if (gelf_getehdr(e, &ehdr) == NULL) { + warnx("gelf_getehdr: %s", elf_errmsg(-1)); + goto fail; + } + if (ehdr.e_type != ET_CORE) { + warnx("%s is not a CORE file", filename); + goto fail; + } + if (elf_getphnum(e, &nph) == 0) { + warnx("program headers not found"); + goto fail; + } + for (i = 0; i < ehdr.e_phnum; i++) { + if (gelf_getphdr(e, i, &phdr) != &phdr) { + warnx("gelf_getphdr: %s", elf_errmsg(-1)); + goto fail; + } + if (phdr.p_type == PT_NOTE) + break; + } + if (i == ehdr.e_phnum) { + warnx("NOTE program header not found"); + goto fail; + } + core = malloc(sizeof(struct procstat_core)); + if (core == NULL) { + warn("malloc(%zu)", sizeof(struct procstat_core)); + goto fail; + } + core->pc_magic = PROCSTAT_CORE_MAGIC; + core->pc_fd = fd; + core->pc_elf = e; + core->pc_ehdr = ehdr; + core->pc_phdr = phdr; + + return (core); +fail: + if (e != NULL) + elf_end(e); + close(fd); + + return (NULL); +} + +void +procstat_core_close(struct procstat_core *core) +{ + + assert(core->pc_magic == PROCSTAT_CORE_MAGIC); + + elf_end(core->pc_elf); + close(core->pc_fd); + free(core); +} + +void * +procstat_core_get(struct procstat_core *core, enum psc_type type, void *buf, + size_t *lenp) +{ + Elf_Note nhdr; + off_t offset, eoffset; + void *freebuf; + size_t len; + u_int32_t n_type; + int cstructsize, structsize; + char nbuf[8]; + + assert(core->pc_magic == PROCSTAT_CORE_MAGIC); + + switch(type) { + case PSC_TYPE_PROC: + n_type = NT_PROCSTAT_PROC; + structsize = sizeof(struct kinfo_proc); + break; + case PSC_TYPE_FILES: + n_type = NT_PROCSTAT_FILES; + structsize = sizeof(struct kinfo_file); + break; + case PSC_TYPE_VMMAP: + n_type = NT_PROCSTAT_VMMAP; + structsize = sizeof(struct kinfo_vmentry); + break; + default: + warnx("unknown core stat type: %d", type); + return (NULL); + } + + offset = core->pc_phdr.p_offset; + eoffset = offset + core->pc_phdr.p_filesz; + + while (offset < eoffset) { + if (!core_offset(core, offset)) + return (NULL); + if (!core_read(core, &nhdr, sizeof(nhdr))) + return (NULL); + + offset += sizeof(nhdr) + + roundup2(nhdr.n_namesz, sizeof(Elf32_Size)) + + roundup2(nhdr.n_descsz, sizeof(Elf32_Size)); + + if (nhdr.n_namesz == 0 && nhdr.n_descsz == 0) + break; + if (nhdr.n_type != n_type) + continue; + if (nhdr.n_namesz != 8) + continue; + if (!core_read(core, nbuf, sizeof(nbuf))) + return (NULL); + if (strcmp(nbuf, "FreeBSD") != 0) + continue; + if (nhdr.n_descsz < sizeof(cstructsize)) { + warnx("corrupted core file"); + return (NULL); + } + if (!core_read(core, &cstructsize, sizeof(cstructsize))) + return (NULL); + if (cstructsize != structsize) { + warnx("version mismatch"); + return (NULL); + } + len = nhdr.n_descsz - sizeof(cstructsize); + if (len == 0) + return (NULL); + if (buf != NULL) { + len = MIN(len, *lenp); + freebuf = NULL; + } else { + freebuf = buf = malloc(len); + if (buf == NULL) { + warn("malloc(%zu)", len); + return (NULL); + } + } + if (!core_read(core, buf, len)) { + free(freebuf); + return (NULL); + } + *lenp = len; + return (buf); + } + + return (NULL); +} + +static bool +core_offset(struct procstat_core *core, off_t offset) +{ + + assert(core->pc_magic == PROCSTAT_CORE_MAGIC); + + if (lseek(core->pc_fd, offset, SEEK_SET) == -1) { + warn("core: lseek(%jd)", (intmax_t)offset); + return (false); + } + return (true); +} + +static bool +core_read(struct procstat_core *core, void *buf, size_t len) +{ + ssize_t n; + + assert(core->pc_magic == PROCSTAT_CORE_MAGIC); + + n = read(core->pc_fd, buf, len); + if (n == -1) { + warn("core: read"); + return (false); + } + if (n < (ssize_t)len) { + warnx("core: short read"); + return (false); + } + return (true); +} Added: head/lib/libprocstat/core.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libprocstat/core.h Sat Apr 20 07:47:26 2013 (r249666) @@ -0,0 +1,45 @@ +/*- + * Copyright (c) 2013 Mikolaj Golub + * 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 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. + * + * $FreeBSD$ + */ + +#ifndef _CORE_H +#define _CORE_H + +enum psc_type { + PSC_TYPE_PROC, + PSC_TYPE_FILES, + PSC_TYPE_VMMAP, +}; + +struct procstat_core; + +void procstat_core_close(struct procstat_core *core); +void *procstat_core_get(struct procstat_core *core, enum psc_type type, + void * buf, size_t *lenp); +struct procstat_core *procstat_core_open(const char *filename); + +#endif /* !_CORE_H_ */ Modified: head/lib/libprocstat/libprocstat.3 ============================================================================== --- head/lib/libprocstat/libprocstat.3 Sat Apr 20 01:12:23 2013 (r249665) +++ head/lib/libprocstat/libprocstat.3 Sat Apr 20 07:47:26 2013 (r249666) @@ -28,6 +28,7 @@ .Dt LIBPROCSTAT 3 .Os .Sh NAME +.Nm procstat_open_core , .Nm procstat_open_kvm , .Nm procstat_open_sysctl , .Nm procstat_close , @@ -105,6 +106,8 @@ .Fa "unsigned int *count" .Fc .Ft "struct procstat *" +.Fn procstat_open_core "const char *filename" +.Ft "struct procstat *" .Fn procstat_open_kvm "const char *nlistf" "const char *memf" .Ft "struct procstat *" .Fn procstat_open_sysctl void @@ -116,7 +119,11 @@ retrieval from the running kernel via th .Xr sysctl 3 library backend, and for post-mortem analysis via the .Xr kvm 3 -library backend. +library backend, or from the process +.Xr core 5 +file, searching for statistics in special +.Xr elf 3 +note sections. .Pp The .Fn procstat_open_kvm @@ -129,6 +136,16 @@ or library routines, respectively, to access kernel state information used to retrieve processes and files states. The +.Fn procstat_open_core +uses +.Xr elf 3 +routines to access statistics stored as a set of notes in a process +.Xr core 5 +file, written by the kernel at the moment of the process abnormal termination. +The +.Fa filename +argument is the process core file name. +The .Fa nlistf argument is the executable image of the kernel being examined. If this argument is @@ -145,7 +162,7 @@ is assumed. See .Xr kvm_open 3 for more details. -Both functions dynamically allocate and return a +The functions dynamically allocate and return a .Vt procstat structure pointer used in the rest of the .Nm libprocstat @@ -250,10 +267,12 @@ argument indicates an actual error messa .Xr pipe 2 , .Xr shm_open 2 , .Xr socket 2 , +.Xr elf 3 , .Xr kvm 3 , .Xr queue 3 , .Xr sysctl 3 , .Xr pts 4 , +.Xr core 5 , .Xr vnode 9 .Sh HISTORY The Modified: head/lib/libprocstat/libprocstat.c ============================================================================== --- head/lib/libprocstat/libprocstat.c Sat Apr 20 01:12:23 2013 (r249665) +++ head/lib/libprocstat/libprocstat.c Sat Apr 20 07:47:26 2013 (r249666) @@ -96,11 +96,13 @@ __FBSDID("$FreeBSD$"); #include #include "libprocstat_internal.h" #include "common_kvm.h" +#include "core.h" int statfs(const char *, struct statfs *); /* XXX */ #define PROCSTAT_KVM 1 #define PROCSTAT_SYSCTL 2 +#define PROCSTAT_CORE 3 static char *getmnton(kvm_t *kd, struct mount *m); static struct filestat_list *procstat_getfiles_kvm( @@ -137,6 +139,8 @@ procstat_close(struct procstat *procstat assert(procstat); if (procstat->type == PROCSTAT_KVM) kvm_close(procstat->kd); + else if (procstat->type == PROCSTAT_CORE) + procstat_core_close(procstat->core); free(procstat); } @@ -177,6 +181,27 @@ procstat_open_kvm(const char *nlistf, co return (procstat); } +struct procstat * +procstat_open_core(const char *filename) +{ + struct procstat *procstat; + struct procstat_core *core; + + procstat = calloc(1, sizeof(*procstat)); + if (procstat == NULL) { + warn("malloc()"); + return (NULL); + } + core = procstat_core_open(filename); + if (core == NULL) { + free(procstat); + return (NULL); + } + procstat->type = PROCSTAT_CORE; + procstat->core = core; + return (procstat); +} + struct kinfo_proc * procstat_getprocs(struct procstat *procstat, int what, int arg, unsigned int *count) @@ -231,6 +256,15 @@ procstat_getprocs(struct procstat *procs } /* Perform simple consistency checks. */ if ((len % sizeof(*p)) != 0 || p->ki_structsize != sizeof(*p)) { + warnx("kinfo_proc structure size mismatch (len = %zu)", len); + goto fail; + } + *count = len / sizeof(*p); + return (p); + } else if (procstat->type == PROCSTAT_CORE) { + p = procstat_core_get(procstat->core, PSC_TYPE_PROC, NULL, + &len); + if ((len % sizeof(*p)) != 0 || p->ki_structsize != sizeof(*p)) { warnx("kinfo_proc structure size mismatch"); goto fail; } @@ -258,13 +292,17 @@ procstat_freeprocs(struct procstat *proc struct filestat_list * procstat_getfiles(struct procstat *procstat, struct kinfo_proc *kp, int mmapped) { - - if (procstat->type == PROCSTAT_SYSCTL) - return (procstat_getfiles_sysctl(procstat, kp, mmapped)); - else if (procstat->type == PROCSTAT_KVM) + + switch(procstat->type) { + case PROCSTAT_KVM: return (procstat_getfiles_kvm(procstat, kp, mmapped)); - else + case PROCSTAT_SYSCTL: + case PROCSTAT_CORE: + return (procstat_getfiles_sysctl(procstat, kp, mmapped)); + default: + warnx("unknown access method: %d", procstat->type); return (NULL); + } } void @@ -646,8 +684,62 @@ kinfo_uflags2fst(int fd) return (0); } +static struct kinfo_file * +kinfo_getfile_core(struct procstat_core *core, int *cntp) +{ + int cnt; + size_t len; + char *buf, *bp, *eb; + struct kinfo_file *kif, *kp, *kf; + + buf = procstat_core_get(core, PSC_TYPE_FILES, NULL, &len); + if (buf == NULL) + return (NULL); + /* + * XXXMG: The code below is just copy&past from libutil. + * The code duplication can be avoided if libutil + * is extended to provide something like: + * struct kinfo_file *kinfo_getfile_from_buf(const char *buf, + * size_t len, int *cntp); + */ + + /* Pass 1: count items */ + cnt = 0; + bp = buf; + eb = buf + len; + while (bp < eb) { + kf = (struct kinfo_file *)(uintptr_t)bp; + bp += kf->kf_structsize; + cnt++; + } + + kif = calloc(cnt, sizeof(*kif)); + if (kif == NULL) { + free(buf); + return (NULL); + } + bp = buf; + eb = buf + len; + kp = kif; + /* Pass 2: unpack */ + while (bp < eb) { + kf = (struct kinfo_file *)(uintptr_t)bp; + /* Copy/expand into pre-zeroed buffer */ + memcpy(kp, kf, kf->kf_structsize); + /* Advance to next packed record */ + bp += kf->kf_structsize; + /* Set field size to fixed length, advance */ + kp->kf_structsize = sizeof(*kp); + kp++; + } + free(buf); + *cntp = cnt; + return (kif); /* Caller must free() return value */ +} + static struct filestat_list * -procstat_getfiles_sysctl(struct procstat *procstat, struct kinfo_proc *kp, int mmapped) +procstat_getfiles_sysctl(struct procstat *procstat, struct kinfo_proc *kp, + int mmapped) { struct kinfo_file *kif, *files; struct kinfo_vmentry *kve, *vmentries; @@ -663,8 +755,16 @@ procstat_getfiles_sysctl(struct procstat assert(kp); if (kp->ki_fd == NULL) return (NULL); - - files = kinfo_getfile(kp->ki_pid, &cnt); + switch(procstat->type) { + case PROCSTAT_SYSCTL: + files = kinfo_getfile(kp->ki_pid, &cnt); + break; + case PROCSTAT_CORE: + files = kinfo_getfile_core(procstat->core, &cnt); + break; + default: + assert(!"invalid type"); + } if (files == NULL && errno != EPERM) { warn("kinfo_getfile()"); return (NULL); @@ -742,7 +842,8 @@ procstat_get_pipe_info(struct procstat * if (procstat->type == PROCSTAT_KVM) { return (procstat_get_pipe_info_kvm(procstat->kd, fst, ps, errbuf)); - } else if (procstat->type == PROCSTAT_SYSCTL) { + } else if (procstat->type == PROCSTAT_SYSCTL || + procstat->type == PROCSTAT_CORE) { return (procstat_get_pipe_info_sysctl(fst, ps, errbuf)); } else { warnx("unknown access method: %d", procstat->type); @@ -806,7 +907,8 @@ procstat_get_pts_info(struct procstat *p if (procstat->type == PROCSTAT_KVM) { return (procstat_get_pts_info_kvm(procstat->kd, fst, pts, errbuf)); - } else if (procstat->type == PROCSTAT_SYSCTL) { + } else if (procstat->type == PROCSTAT_SYSCTL || + procstat->type == PROCSTAT_CORE) { return (procstat_get_pts_info_sysctl(fst, pts, errbuf)); } else { warnx("unknown access method: %d", procstat->type); @@ -868,7 +970,8 @@ procstat_get_shm_info(struct procstat *p if (procstat->type == PROCSTAT_KVM) { return (procstat_get_shm_info_kvm(procstat->kd, fst, shm, errbuf)); - } else if (procstat->type == PROCSTAT_SYSCTL) { + } else if (procstat->type == PROCSTAT_SYSCTL || + procstat->type == PROCSTAT_CORE) { return (procstat_get_shm_info_sysctl(fst, shm, errbuf)); } else { warnx("unknown access method: %d", procstat->type); @@ -948,7 +1051,8 @@ procstat_get_vnode_info(struct procstat if (procstat->type == PROCSTAT_KVM) { return (procstat_get_vnode_info_kvm(procstat->kd, fst, vn, errbuf)); - } else if (procstat->type == PROCSTAT_SYSCTL) { + } else if (procstat->type == PROCSTAT_SYSCTL || + procstat->type == PROCSTAT_CORE) { return (procstat_get_vnode_info_sysctl(fst, vn, errbuf)); } else { warnx("unknown access method: %d", procstat->type); @@ -1150,7 +1254,8 @@ procstat_get_socket_info(struct procstat if (procstat->type == PROCSTAT_KVM) { return (procstat_get_socket_info_kvm(procstat->kd, fst, sock, errbuf)); - } else if (procstat->type == PROCSTAT_SYSCTL) { + } else if (procstat->type == PROCSTAT_SYSCTL || + procstat->type == PROCSTAT_CORE) { return (procstat_get_socket_info_sysctl(fst, sock, errbuf)); } else { warnx("unknown access method: %d", procstat->type); @@ -1401,3 +1506,4 @@ getmnton(kvm_t *kd, struct mount *m) mhead = mt; return (mt->mntonname); } + Modified: head/lib/libprocstat/libprocstat.h ============================================================================== --- head/lib/libprocstat/libprocstat.h Sat Apr 20 01:12:23 2013 (r249665) +++ head/lib/libprocstat/libprocstat.h Sat Apr 20 07:47:26 2013 (r249666) @@ -162,6 +162,7 @@ int procstat_get_socket_info(struct proc struct sockstat *sock, char *errbuf); int procstat_get_vnode_info(struct procstat *procstat, struct filestat *fst, struct vnstat *vn, char *errbuf); +struct procstat *procstat_open_core(const char *filename); struct procstat *procstat_open_sysctl(void); struct procstat *procstat_open_kvm(const char *nlistf, const char *memf); __END_DECLS Modified: head/lib/libprocstat/libprocstat_internal.h ============================================================================== --- head/lib/libprocstat/libprocstat_internal.h Sat Apr 20 01:12:23 2013 (r249665) +++ head/lib/libprocstat/libprocstat_internal.h Sat Apr 20 07:47:26 2013 (r249666) @@ -34,6 +34,7 @@ struct procstat { kvm_t *kd; void *vmentries; void *files; + struct procstat_core *core; }; #endif /* !_LIBPROCSTAT_INTERNAL_H_ */ From owner-svn-src-all@FreeBSD.ORG Sat Apr 20 07:49:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2427C84F; Sat, 20 Apr 2013 07:49:37 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 16746119E; Sat, 20 Apr 2013 07:49:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3K7naIG086864; Sat, 20 Apr 2013 07:49:36 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3K7nacZ086850; Sat, 20 Apr 2013 07:49:36 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201304200749.r3K7nacZ086850@svn.freebsd.org> From: Mikolaj Golub Date: Sat, 20 Apr 2013 07:49:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249667 - head/lib/libprocstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Apr 2013 07:49:37 -0000 Author: trociny Date: Sat Apr 20 07:49:35 2013 New Revision: 249667 URL: http://svnweb.freebsd.org/changeset/base/249667 Log: Add procstat_getvmmap function to get VM layout of a process. MFC after: 1 month Modified: head/lib/libprocstat/Symbol.map head/lib/libprocstat/libprocstat.3 head/lib/libprocstat/libprocstat.c head/lib/libprocstat/libprocstat.h Modified: head/lib/libprocstat/Symbol.map ============================================================================== --- head/lib/libprocstat/Symbol.map Sat Apr 20 07:47:26 2013 (r249666) +++ head/lib/libprocstat/Symbol.map Sat Apr 20 07:49:35 2013 (r249667) @@ -16,6 +16,8 @@ FBSD_1.2 { }; FBSD_1.3 { + procstat_freevmmap; procstat_get_shm_info; + procstat_getvmmap; procstat_open_core; }; Modified: head/lib/libprocstat/libprocstat.3 ============================================================================== --- head/lib/libprocstat/libprocstat.3 Sat Apr 20 07:47:26 2013 (r249666) +++ head/lib/libprocstat/libprocstat.3 Sat Apr 20 07:49:35 2013 (r249667) @@ -34,8 +34,10 @@ .Nm procstat_close , .Nm procstat_getfiles , .Nm procstat_getprocs , +.Nm procstat_getvmmap , .Nm procstat_freefiles , .Nm procstat_freeprocs , +.Nm procstat_freevmmap , .Nm procstat_get_pipe_info , .Nm procstat_get_pts_info , .Nm procstat_get_shm_info , @@ -57,6 +59,11 @@ .Fc .Ft void .Fn procstat_freeprocs "struct procstat *procstat" "struct kinfo_proc *p" +.Ft void +.Fo procstat_freevmmap +.Fa "struct procstat *procstat" +.Fa "struct kinfo_vmentry *vmmap" +.Fc .Ft int .Fo procstat_get_pipe_info .Fa "struct procstat *procstat" @@ -105,6 +112,12 @@ .Fa "int arg" .Fa "unsigned int *count" .Fc +.Ft "struct kinfo_vmentry *" +.Fo procstat_getvmmap +.Fa "struct procstat *procstat" +.Fa "struct kinfo_proc *kp" +.Fa "unsigned int *count" +.Fc .Ft "struct procstat *" .Fn procstat_open_core "const char *filename" .Ft "struct procstat *" @@ -214,6 +227,22 @@ The caller is responsible to free the al function call. .Pp The +.Fn procstat_getvmmap +function gets a pointer to the +.Vt procstat +structure initialized with one of the +.Fn procstat_open_* +functions, a pointer to +.Vt kinfo_proc +structure, and returns VM layout of the process as a dynamically allocated +array of +.Vt kinfo_vmentry +structures. +The caller is responsible to free the allocated memory with a subsequent +.Fn procstat_freevmmap +function call. +.Pp +The .Fn procstat_get_pipe_info , .Fn procstat_get_pts_info , .Fn procstat_get_shm_info , Modified: head/lib/libprocstat/libprocstat.c ============================================================================== --- head/lib/libprocstat/libprocstat.c Sat Apr 20 07:47:26 2013 (r249666) +++ head/lib/libprocstat/libprocstat.c Sat Apr 20 07:49:35 2013 (r249667) @@ -105,6 +105,8 @@ int statfs(const char *, struct stat #define PROCSTAT_CORE 3 static char *getmnton(kvm_t *kd, struct mount *m); +static struct kinfo_vmentry * kinfo_getvmmap_core(struct procstat_core *core, + int *cntp); static struct filestat_list *procstat_getfiles_kvm( struct procstat *procstat, struct kinfo_proc *kp, int mmapped); static struct filestat_list *procstat_getfiles_sysctl( @@ -802,7 +804,7 @@ procstat_getfiles_sysctl(struct procstat STAILQ_INSERT_TAIL(head, entry, next); } if (mmapped != 0) { - vmentries = kinfo_getvmmap(kp->ki_pid, &cnt); + vmentries = procstat_getvmmap(procstat, kp, &cnt); procstat->vmentries = vmentries; if (vmentries == NULL || cnt == 0) goto fail; @@ -1507,3 +1509,82 @@ getmnton(kvm_t *kd, struct mount *m) return (mt->mntonname); } +static struct kinfo_vmentry * +kinfo_getvmmap_core(struct procstat_core *core, int *cntp) +{ + int cnt; + size_t len; + char *buf, *bp, *eb; + struct kinfo_vmentry *kiv, *kp, *kv; + + buf = procstat_core_get(core, PSC_TYPE_VMMAP, NULL, &len); + if (buf == NULL) + return (NULL); + + /* + * XXXMG: The code below is just copy&past from libutil. + * The code duplication can be avoided if libutil + * is extended to provide something like: + * struct kinfo_vmentry *kinfo_getvmmap_from_buf(const char *buf, + * size_t len, int *cntp); + */ + + /* Pass 1: count items */ + cnt = 0; + bp = buf; + eb = buf + len; + while (bp < eb) { + kv = (struct kinfo_vmentry *)(uintptr_t)bp; + bp += kv->kve_structsize; + cnt++; + } + + kiv = calloc(cnt, sizeof(*kiv)); + if (kiv == NULL) { + free(buf); + return (NULL); + } + bp = buf; + eb = buf + len; + kp = kiv; + /* Pass 2: unpack */ + while (bp < eb) { + kv = (struct kinfo_vmentry *)(uintptr_t)bp; + /* Copy/expand into pre-zeroed buffer */ + memcpy(kp, kv, kv->kve_structsize); + /* Advance to next packed record */ + bp += kv->kve_structsize; + /* Set field size to fixed length, advance */ + kp->kve_structsize = sizeof(*kp); + kp++; + } + free(buf); + *cntp = cnt; + return (kiv); /* Caller must free() return value */ +} + +struct kinfo_vmentry * +procstat_getvmmap(struct procstat *procstat, struct kinfo_proc *kp, + unsigned int *cntp) +{ + switch(procstat->type) { + case PROCSTAT_KVM: + warnx("kvm method is not supported"); + return (NULL); + case PROCSTAT_SYSCTL: + return (kinfo_getvmmap(kp->ki_pid, cntp)); + case PROCSTAT_CORE: + return (kinfo_getvmmap_core(procstat->core, cntp)); + default: + warnx("unknown access method: %d", procstat->type); + return (NULL); + } +} + +void +procstat_freevmmap(struct procstat *procstat __unused, + struct kinfo_vmentry *vmmap) +{ + + free(vmmap); +} Modified: head/lib/libprocstat/libprocstat.h ============================================================================== --- head/lib/libprocstat/libprocstat.h Sat Apr 20 07:47:26 2013 (r249666) +++ head/lib/libprocstat/libprocstat.h Sat Apr 20 07:49:35 2013 (r249667) @@ -89,6 +89,7 @@ #define PS_FST_FFLAG_EXEC 0x2000 #define PS_FST_FFLAG_HASLOCK 0x4000 +struct kinfo_vmentry; struct procstat; struct filestat { int fs_type; /* Descriptor type. */ @@ -148,6 +149,8 @@ void procstat_close(struct procstat *pro void procstat_freeprocs(struct procstat *procstat, struct kinfo_proc *p); void procstat_freefiles(struct procstat *procstat, struct filestat_list *head); +void procstat_freevmmap(struct procstat *procstat, + struct kinfo_vmentry *vmmap); struct filestat_list *procstat_getfiles(struct procstat *procstat, struct kinfo_proc *kp, int mmapped); struct kinfo_proc *procstat_getprocs(struct procstat *procstat, @@ -162,6 +165,8 @@ int procstat_get_socket_info(struct proc struct sockstat *sock, char *errbuf); int procstat_get_vnode_info(struct procstat *procstat, struct filestat *fst, struct vnstat *vn, char *errbuf); +struct kinfo_vmentry *procstat_getvmmap(struct procstat *procstat, + struct kinfo_proc *kp, unsigned int *count); struct procstat *procstat_open_core(const char *filename); struct procstat *procstat_open_sysctl(void); struct procstat *procstat_open_kvm(const char *nlistf, const char *memf); From owner-svn-src-all@FreeBSD.ORG Sat Apr 20 07:51:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7740EABE; Sat, 20 Apr 2013 07:51:01 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 59E3E11A9; Sat, 20 Apr 2013 07:51:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3K7p1Aq090061; Sat, 20 Apr 2013 07:51:01 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3K7p08m090039; Sat, 20 Apr 2013 07:51:00 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201304200751.r3K7p08m090039@svn.freebsd.org> From: Mikolaj Golub Date: Sat, 20 Apr 2013 07:51:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249668 - head/usr.bin/procstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Apr 2013 07:51:01 -0000 Author: trociny Date: Sat Apr 20 07:50:59 2013 New Revision: 249668 URL: http://svnweb.freebsd.org/changeset/base/249668 Log: Use procstat_getprocs(3) for retrieving thread information instead of direct sysctl calls. MFC after: 1 month Modified: head/usr.bin/procstat/procstat.c head/usr.bin/procstat/procstat.h head/usr.bin/procstat/procstat_sigs.c head/usr.bin/procstat/procstat_threads.c Modified: head/usr.bin/procstat/procstat.c ============================================================================== --- head/usr.bin/procstat/procstat.c Sat Apr 20 07:49:35 2013 (r249667) +++ head/usr.bin/procstat/procstat.c Sat Apr 20 07:50:59 2013 (r249668) @@ -77,7 +77,7 @@ procstat(struct procstat *prstat, struct else if (sflag) procstat_cred(kipp); else if (tflag) - procstat_threads(kipp); + procstat_threads(prstat, kipp); else if (vflag) procstat_vm(kipp); else if (xflag) Modified: head/usr.bin/procstat/procstat.h ============================================================================== --- head/usr.bin/procstat/procstat.h Sat Apr 20 07:49:35 2013 (r249667) +++ head/usr.bin/procstat/procstat.h Sat Apr 20 07:50:59 2013 (r249668) @@ -44,7 +44,7 @@ void procstat_files(struct procstat *prs void procstat_kstack(struct kinfo_proc *kipp, int kflag); void procstat_rlimit(struct kinfo_proc *kipp); void procstat_sigs(struct procstat *prstat, struct kinfo_proc *kipp); -void procstat_threads(struct kinfo_proc *kipp); +void procstat_threads(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_threads_sigs(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_vm(struct kinfo_proc *kipp); Modified: head/usr.bin/procstat/procstat_sigs.c ============================================================================== --- head/usr.bin/procstat/procstat_sigs.c Sat Apr 20 07:49:35 2013 (r249667) +++ head/usr.bin/procstat/procstat_sigs.c Sat Apr 20 07:50:59 2013 (r249668) @@ -86,48 +86,24 @@ procstat_sigs(struct procstat *prstat __ } void -procstat_threads_sigs(struct procstat *prstat __unused, struct kinfo_proc *kipp) +procstat_threads_sigs(struct procstat *procstat, struct kinfo_proc *kipp) { struct kinfo_proc *kip; pid_t pid; - int error, name[4], j; - unsigned int i; - size_t len; + int j; + unsigned int count, i; pid = kipp->ki_pid; if (!hflag) printf("%5s %6s %-16s %-7s %4s\n", "PID", "TID", "COMM", "SIG", "FLAGS"); - /* - * We need to re-query for thread information, so don't use *kipp. - */ - name[0] = CTL_KERN; - name[1] = KERN_PROC; - name[2] = KERN_PROC_PID | KERN_PROC_INC_THREAD; - name[3] = pid; - - len = 0; - error = sysctl(name, 4, NULL, &len, NULL, 0); - if (error < 0 && errno != ESRCH) { - warn("sysctl: kern.proc.pid: %d", pid); - return; - } - if (error < 0) - return; - - kip = malloc(len); + kip = procstat_getprocs(procstat, KERN_PROC_PID | KERN_PROC_INC_THREAD, + pid, &count); if (kip == NULL) - err(-1, "malloc"); - - if (sysctl(name, 4, kip, &len, NULL, 0) < 0) { - warn("sysctl: kern.proc.pid: %d", pid); - free(kip); return; - } - - kinfo_proc_sort(kip, len / sizeof(*kipp)); - for (i = 0; i < len / sizeof(*kipp); i++) { + kinfo_proc_sort(kip, count); + for (i = 0; i < count; i++) { kipp = &kip[i]; for (j = 1; j <= _SIG_MAXSIG; j++) { printf("%5d ", pid); @@ -140,5 +116,5 @@ procstat_threads_sigs(struct procstat *p printf("\n"); } } - free(kip); + procstat_freeprocs(procstat, kip); } Modified: head/usr.bin/procstat/procstat_threads.c ============================================================================== --- head/usr.bin/procstat/procstat_threads.c Sat Apr 20 07:49:35 2013 (r249667) +++ head/usr.bin/procstat/procstat_threads.c Sat Apr 20 07:50:59 2013 (r249668) @@ -40,47 +40,22 @@ #include "procstat.h" void -procstat_threads(struct kinfo_proc *kipp) +procstat_threads(struct procstat *procstat, struct kinfo_proc *kipp) { struct kinfo_proc *kip; - int error, name[4]; - unsigned int i; + unsigned int count, i; const char *str; - size_t len; if (!hflag) printf("%5s %6s %-16s %-16s %2s %4s %-7s %-9s\n", "PID", "TID", "COMM", "TDNAME", "CPU", "PRI", "STATE", "WCHAN"); - /* - * We need to re-query for thread information, so don't use *kipp. - */ - name[0] = CTL_KERN; - name[1] = KERN_PROC; - name[2] = KERN_PROC_PID | KERN_PROC_INC_THREAD; - name[3] = kipp->ki_pid; - - len = 0; - error = sysctl(name, 4, NULL, &len, NULL, 0); - if (error < 0 && errno != ESRCH) { - warn("sysctl: kern.proc.pid: %d", kipp->ki_pid); - return; - } - if (error < 0) - return; - - kip = malloc(len); + kip = procstat_getprocs(procstat, KERN_PROC_PID | KERN_PROC_INC_THREAD, + kipp->ki_pid, &count); if (kip == NULL) - err(-1, "malloc"); - - if (sysctl(name, 4, kip, &len, NULL, 0) < 0) { - warn("sysctl: kern.proc.pid: %d", kipp->ki_pid); - free(kip); return; - } - - kinfo_proc_sort(kip, len / sizeof(*kipp)); - for (i = 0; i < len / sizeof(*kipp); i++) { + kinfo_proc_sort(kip, count); + for (i = 0; i < count; i++) { kipp = &kip[i]; printf("%5d ", kipp->ki_pid); printf("%6d ", kipp->ki_tid); @@ -139,5 +114,5 @@ procstat_threads(struct kinfo_proc *kipp } printf("\n"); } - free(kip); + procstat_freeprocs(procstat, kip); } From owner-svn-src-all@FreeBSD.ORG Sat Apr 20 07:52:24 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 26E76C39; Sat, 20 Apr 2013 07:52:24 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F268111B2; Sat, 20 Apr 2013 07:52:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3K7qN3l091531; Sat, 20 Apr 2013 07:52:23 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3K7qN21091522; Sat, 20 Apr 2013 07:52:23 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201304200752.r3K7qN21091522@svn.freebsd.org> From: Mikolaj Golub Date: Sat, 20 Apr 2013 07:52:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249669 - head/usr.bin/procstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Apr 2013 07:52:24 -0000 Author: trociny Date: Sat Apr 20 07:52:23 2013 New Revision: 249669 URL: http://svnweb.freebsd.org/changeset/base/249669 Log: Use more generic procstat_getvmmap(3) for retrieving VM layout of a process. MFC after: 1 month Modified: head/usr.bin/procstat/procstat.c head/usr.bin/procstat/procstat.h head/usr.bin/procstat/procstat_vm.c Modified: head/usr.bin/procstat/procstat.c ============================================================================== --- head/usr.bin/procstat/procstat.c Sat Apr 20 07:50:59 2013 (r249668) +++ head/usr.bin/procstat/procstat.c Sat Apr 20 07:52:23 2013 (r249669) @@ -79,7 +79,7 @@ procstat(struct procstat *prstat, struct else if (tflag) procstat_threads(prstat, kipp); else if (vflag) - procstat_vm(kipp); + procstat_vm(prstat, kipp); else if (xflag) procstat_auxv(kipp); else Modified: head/usr.bin/procstat/procstat.h ============================================================================== --- head/usr.bin/procstat/procstat.h Sat Apr 20 07:50:59 2013 (r249668) +++ head/usr.bin/procstat/procstat.h Sat Apr 20 07:52:23 2013 (r249669) @@ -46,6 +46,6 @@ void procstat_rlimit(struct kinfo_proc * void procstat_sigs(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_threads(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_threads_sigs(struct procstat *prstat, struct kinfo_proc *kipp); -void procstat_vm(struct kinfo_proc *kipp); +void procstat_vm(struct procstat *prstat, struct kinfo_proc *kipp); #endif /* !PROCSTAT_H */ Modified: head/usr.bin/procstat/procstat_vm.c ============================================================================== --- head/usr.bin/procstat/procstat_vm.c Sat Apr 20 07:50:59 2013 (r249668) +++ head/usr.bin/procstat/procstat_vm.c Sat Apr 20 07:52:23 2013 (r249669) @@ -41,7 +41,7 @@ #include "procstat.h" void -procstat_vm(struct kinfo_proc *kipp) +procstat_vm(struct procstat *procstat, struct kinfo_proc *kipp) { struct kinfo_vmentry *freep, *kve; int ptrwidth; @@ -54,7 +54,7 @@ procstat_vm(struct kinfo_proc *kipp) "PID", ptrwidth, "START", ptrwidth, "END", "PRT", "RES", "PRES", "REF", "SHD", "FL", "TP", "PATH"); - freep = kinfo_getvmmap(kipp->ki_pid, &cnt); + freep = procstat_getvmmap(procstat, kipp, &cnt); if (freep == NULL) return; for (i = 0; i < cnt; i++) { From owner-svn-src-all@FreeBSD.ORG Sat Apr 20 07:54:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1836EE96; Sat, 20 Apr 2013 07:54:09 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 07DC911C3; Sat, 20 Apr 2013 07:54:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3K7s8nM093420; Sat, 20 Apr 2013 07:54:08 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3K7s79v093399; Sat, 20 Apr 2013 07:54:07 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201304200754.r3K7s79v093399@svn.freebsd.org> From: Mikolaj Golub Date: Sat, 20 Apr 2013 07:54:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249670 - head/lib/libprocstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Apr 2013 07:54:09 -0000 Author: trociny Date: Sat Apr 20 07:54:07 2013 New Revision: 249670 URL: http://svnweb.freebsd.org/changeset/base/249670 Log: Add procstat_getgroups function to retrieve process groups. MFC after: 1 month Modified: head/lib/libprocstat/Symbol.map head/lib/libprocstat/core.c head/lib/libprocstat/core.h head/lib/libprocstat/libprocstat.3 head/lib/libprocstat/libprocstat.c head/lib/libprocstat/libprocstat.h Modified: head/lib/libprocstat/Symbol.map ============================================================================== --- head/lib/libprocstat/Symbol.map Sat Apr 20 07:52:23 2013 (r249669) +++ head/lib/libprocstat/Symbol.map Sat Apr 20 07:54:07 2013 (r249670) @@ -16,8 +16,10 @@ FBSD_1.2 { }; FBSD_1.3 { + procstat_freegroups; procstat_freevmmap; procstat_get_shm_info; + procstat_getgroups; procstat_getvmmap; procstat_open_core; }; Modified: head/lib/libprocstat/core.c ============================================================================== --- head/lib/libprocstat/core.c Sat Apr 20 07:52:23 2013 (r249669) +++ head/lib/libprocstat/core.c Sat Apr 20 07:54:07 2013 (r249670) @@ -167,6 +167,10 @@ procstat_core_get(struct procstat_core * n_type = NT_PROCSTAT_VMMAP; structsize = sizeof(struct kinfo_vmentry); break; + case PSC_TYPE_GROUPS: + n_type = NT_PROCSTAT_GROUPS; + structsize = sizeof(gid_t); + break; default: warnx("unknown core stat type: %d", type); return (NULL); Modified: head/lib/libprocstat/core.h ============================================================================== --- head/lib/libprocstat/core.h Sat Apr 20 07:52:23 2013 (r249669) +++ head/lib/libprocstat/core.h Sat Apr 20 07:54:07 2013 (r249670) @@ -33,6 +33,7 @@ enum psc_type { PSC_TYPE_PROC, PSC_TYPE_FILES, PSC_TYPE_VMMAP, + PSC_TYPE_GROUPS, }; struct procstat_core; Modified: head/lib/libprocstat/libprocstat.3 ============================================================================== --- head/lib/libprocstat/libprocstat.3 Sat Apr 20 07:52:23 2013 (r249669) +++ head/lib/libprocstat/libprocstat.3 Sat Apr 20 07:54:07 2013 (r249670) @@ -33,9 +33,11 @@ .Nm procstat_open_sysctl , .Nm procstat_close , .Nm procstat_getfiles , +.Nm procstat_getgroups , .Nm procstat_getprocs , .Nm procstat_getvmmap , .Nm procstat_freefiles , +.Nm procstat_freegroups , .Nm procstat_freeprocs , .Nm procstat_freevmmap , .Nm procstat_get_pipe_info , @@ -52,12 +54,18 @@ .In libprocstat.h .Ft void .Fn procstat_close "struct procstat *procstat" +.Fc .Ft void .Fo procstat_freefiles .Fa "struct procstat *procstat" .Fa "struct filestat_list *head" .Fc .Ft void +.Fo procstat_freegroups +.Fa "struct procstat *procstat" +.Fa "gid_t *groups" +.Fc +.Ft void .Fn procstat_freeprocs "struct procstat *procstat" "struct kinfo_proc *p" .Ft void .Fo procstat_freevmmap @@ -105,6 +113,12 @@ .Fa "struct kinfo_proc *kp" .Fa "int mmapped" .Fc +.Ft "gid_t *" +.Fo procstat_getgroups +.Fa "struct procstat *procstat" +.Fa "struct kinfo_proc *kp" +.Fa "unsigned int *count" +.Fc .Ft "struct kinfo_proc *" .Fo procstat_getprocs .Fa "struct procstat *procstat" @@ -227,6 +241,19 @@ The caller is responsible to free the al function call. .Pp The +.Fn procstat_getgroups +function gets a pointer to the +.Vt procstat +structure, a pointer to +.Vt kinfo_proc +structure, and returns the process groups as a dynamically allocated array of +.Vt gid_t +elements. +The caller is responsible to free the allocated memory with a subsequent +.Fn procstat_freegroups +function call. +.Pp +The .Fn procstat_getvmmap function gets a pointer to the .Vt procstat Modified: head/lib/libprocstat/libprocstat.c ============================================================================== --- head/lib/libprocstat/libprocstat.c Sat Apr 20 07:52:23 2013 (r249669) +++ head/lib/libprocstat/libprocstat.c Sat Apr 20 07:54:07 2013 (r249670) @@ -132,6 +132,9 @@ static int procstat_get_vnode_info_kvm(k struct vnstat *vn, char *errbuf); static int procstat_get_vnode_info_sysctl(struct filestat *fst, struct vnstat *vn, char *errbuf); +static gid_t *procstat_getgroups_core(struct procstat_core *core, + unsigned int *count); +static gid_t *procstat_getgroups_sysctl(pid_t pid, unsigned int *count); static int vntype2psfsttype(int type); void @@ -1588,3 +1591,67 @@ procstat_freevmmap(struct procstat *proc free(vmmap); } + +static gid_t * +procstat_getgroups_sysctl(pid_t pid, unsigned int *cntp) +{ + int mib[4]; + size_t len; + gid_t *groups; + + mib[0] = CTL_KERN; + mib[1] = KERN_PROC; + mib[2] = KERN_PROC_GROUPS; + mib[3] = pid; + len = (sysconf(_SC_NGROUPS_MAX) + 1) * sizeof(gid_t); + groups = malloc(len); + if (groups == NULL) { + warn("malloc(%zu)", len); + return (NULL); + } + if (sysctl(mib, 4, groups, &len, NULL, 0) == -1) { + warn("sysctl: kern.proc.groups: %d", pid); + free(groups); + return (NULL); + } + *cntp = len / sizeof(gid_t); + return (groups); +} + +static gid_t * +procstat_getgroups_core(struct procstat_core *core, unsigned int *cntp) +{ + size_t len; + gid_t *groups; + + groups = procstat_core_get(core, PSC_TYPE_GROUPS, NULL, &len); + if (groups == NULL) + return (NULL); + *cntp = len / sizeof(gid_t); + return (groups); +} + +gid_t * +procstat_getgroups(struct procstat *procstat, struct kinfo_proc *kp, + unsigned int *cntp) +{ + switch(procstat->type) { + case PROCSTAT_KVM: + warnx("kvm method is not supported"); + return (NULL); + case PROCSTAT_SYSCTL: + return (procstat_getgroups_sysctl(kp->ki_pid, cntp)); + case PROCSTAT_CORE: + return (procstat_getgroups_core(procstat->core, cntp)); + default: + warnx("unknown access method: %d", procstat->type); + return (NULL); + } +} + +void +procstat_freegroups(struct procstat *procstat __unused, gid_t *groups) +{ + + free(groups); +} Modified: head/lib/libprocstat/libprocstat.h ============================================================================== --- head/lib/libprocstat/libprocstat.h Sat Apr 20 07:52:23 2013 (r249669) +++ head/lib/libprocstat/libprocstat.h Sat Apr 20 07:54:07 2013 (r249670) @@ -146,6 +146,7 @@ STAILQ_HEAD(filestat_list, filestat); __BEGIN_DECLS void procstat_close(struct procstat *procstat); +void procstat_freegroups(struct procstat *procstat, gid_t *groups); void procstat_freeprocs(struct procstat *procstat, struct kinfo_proc *p); void procstat_freefiles(struct procstat *procstat, struct filestat_list *head); @@ -165,6 +166,8 @@ int procstat_get_socket_info(struct proc struct sockstat *sock, char *errbuf); int procstat_get_vnode_info(struct procstat *procstat, struct filestat *fst, struct vnstat *vn, char *errbuf); +gid_t *procstat_getgroups(struct procstat *procstat, struct kinfo_proc *kp, + unsigned int *count); struct kinfo_vmentry *procstat_getvmmap(struct procstat *procstat, struct kinfo_proc *kp, unsigned int *count); struct procstat *procstat_open_core(const char *filename); From owner-svn-src-all@FreeBSD.ORG Sat Apr 20 07:55:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B27FA9C; Sat, 20 Apr 2013 07:55:32 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A4EFE11CF; Sat, 20 Apr 2013 07:55:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3K7tW9T094964; Sat, 20 Apr 2013 07:55:32 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3K7tW6J094952; Sat, 20 Apr 2013 07:55:32 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201304200755.r3K7tW6J094952@svn.freebsd.org> From: Mikolaj Golub Date: Sat, 20 Apr 2013 07:55:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249671 - head/usr.bin/procstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Apr 2013 07:55:32 -0000 Author: trociny Date: Sat Apr 20 07:55:31 2013 New Revision: 249671 URL: http://svnweb.freebsd.org/changeset/base/249671 Log: Use procstat_getgroups(3) for retrieving groups information instead of direct sysctl. MFC after: 1 month Modified: head/usr.bin/procstat/procstat.c head/usr.bin/procstat/procstat.h head/usr.bin/procstat/procstat_cred.c Modified: head/usr.bin/procstat/procstat.c ============================================================================== --- head/usr.bin/procstat/procstat.c Sat Apr 20 07:54:07 2013 (r249670) +++ head/usr.bin/procstat/procstat.c Sat Apr 20 07:55:31 2013 (r249671) @@ -75,7 +75,7 @@ procstat(struct procstat *prstat, struct else if (lflag) procstat_rlimit(kipp); else if (sflag) - procstat_cred(kipp); + procstat_cred(prstat, kipp); else if (tflag) procstat_threads(prstat, kipp); else if (vflag) Modified: head/usr.bin/procstat/procstat.h ============================================================================== --- head/usr.bin/procstat/procstat.h Sat Apr 20 07:54:07 2013 (r249670) +++ head/usr.bin/procstat/procstat.h Sat Apr 20 07:55:31 2013 (r249671) @@ -38,7 +38,7 @@ void procstat_args(struct kinfo_proc *ki void procstat_auxv(struct kinfo_proc *kipp); void procstat_basic(struct kinfo_proc *kipp); void procstat_bin(struct kinfo_proc *kipp); -void procstat_cred(struct kinfo_proc *kipp); +void procstat_cred(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_env(struct kinfo_proc *kipp); void procstat_files(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_kstack(struct kinfo_proc *kipp, int kflag); Modified: head/usr.bin/procstat/procstat_cred.c ============================================================================== --- head/usr.bin/procstat/procstat_cred.c Sat Apr 20 07:54:07 2013 (r249670) +++ head/usr.bin/procstat/procstat_cred.c Sat Apr 20 07:55:31 2013 (r249671) @@ -41,13 +41,10 @@ static const char *get_umask(struct kinfo_proc *kipp); void -procstat_cred(struct kinfo_proc *kipp) +procstat_cred(struct procstat *procstat, struct kinfo_proc *kipp) { - int i; - int mib[4]; - int ngroups; - size_t len; - gid_t *groups = NULL; + unsigned int i, ngroups; + gid_t *groups; if (!hflag) printf("%5s %-16s %5s %5s %5s %5s %5s %5s %5s %5s %-15s\n", @@ -66,30 +63,14 @@ procstat_cred(struct kinfo_proc *kipp) printf("%s", kipp->ki_cr_flags & CRED_FLAG_CAPMODE ? "C" : "-"); printf(" "); + groups = NULL; /* * We may have too many groups to fit in kinfo_proc's statically - * sized storage. If that occurs, attempt to retrieve them via - * sysctl. + * sized storage. If that occurs, attempt to retrieve them using + * libprocstat. */ - if (kipp->ki_cr_flags & KI_CRF_GRP_OVERFLOW) { - mib[0] = CTL_KERN; - mib[1] = KERN_PROC; - mib[2] = KERN_PROC_GROUPS; - mib[3] = kipp->ki_pid; - - ngroups = sysconf(_SC_NGROUPS_MAX) + 1; - len = ngroups * sizeof(gid_t); - if((groups = malloc(len)) == NULL) - err(-1, "malloc"); - - if (sysctl(mib, 4, groups, &len, NULL, 0) == -1) { - warn("sysctl: kern.proc.groups: %d " - "group list truncated", kipp->ki_pid); - free(groups); - groups = NULL; - } - ngroups = len / sizeof(gid_t); - } + if (kipp->ki_cr_flags & KI_CRF_GRP_OVERFLOW) + groups = procstat_getgroups(procstat, kipp, &ngroups); if (groups == NULL) { ngroups = kipp->ki_ngroups; groups = kipp->ki_groups; @@ -97,7 +78,7 @@ procstat_cred(struct kinfo_proc *kipp) for (i = 0; i < ngroups; i++) printf("%s%d", (i > 0) ? "," : "", groups[i]); if (groups != kipp->ki_groups) - free(groups); + procstat_freegroups(procstat, groups); printf("\n"); } From owner-svn-src-all@FreeBSD.ORG Sat Apr 20 07:57:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D0034225; Sat, 20 Apr 2013 07:57:09 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B3E0311DC; Sat, 20 Apr 2013 07:57:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3K7v9WQ096714; Sat, 20 Apr 2013 07:57:09 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3K7v84N096689; Sat, 20 Apr 2013 07:57:08 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201304200757.r3K7v84N096689@svn.freebsd.org> From: Mikolaj Golub Date: Sat, 20 Apr 2013 07:57:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249672 - head/lib/libprocstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Apr 2013 07:57:09 -0000 Author: trociny Date: Sat Apr 20 07:57:08 2013 New Revision: 249672 URL: http://svnweb.freebsd.org/changeset/base/249672 Log: Add procstat_getumask function to retrieve a process umask. MFC after: 1 month Modified: head/lib/libprocstat/Symbol.map head/lib/libprocstat/core.c head/lib/libprocstat/core.h head/lib/libprocstat/libprocstat.3 head/lib/libprocstat/libprocstat.c head/lib/libprocstat/libprocstat.h Modified: head/lib/libprocstat/Symbol.map ============================================================================== --- head/lib/libprocstat/Symbol.map Sat Apr 20 07:55:31 2013 (r249671) +++ head/lib/libprocstat/Symbol.map Sat Apr 20 07:57:08 2013 (r249672) @@ -20,6 +20,7 @@ FBSD_1.3 { procstat_freevmmap; procstat_get_shm_info; procstat_getgroups; + procstat_getumask; procstat_getvmmap; procstat_open_core; }; Modified: head/lib/libprocstat/core.c ============================================================================== --- head/lib/libprocstat/core.c Sat Apr 20 07:55:31 2013 (r249671) +++ head/lib/libprocstat/core.c Sat Apr 20 07:57:08 2013 (r249672) @@ -171,6 +171,10 @@ procstat_core_get(struct procstat_core * n_type = NT_PROCSTAT_GROUPS; structsize = sizeof(gid_t); break; + case PSC_TYPE_UMASK: + n_type = NT_PROCSTAT_UMASK; + structsize = sizeof(u_short); + break; default: warnx("unknown core stat type: %d", type); return (NULL); Modified: head/lib/libprocstat/core.h ============================================================================== --- head/lib/libprocstat/core.h Sat Apr 20 07:55:31 2013 (r249671) +++ head/lib/libprocstat/core.h Sat Apr 20 07:57:08 2013 (r249672) @@ -34,6 +34,7 @@ enum psc_type { PSC_TYPE_FILES, PSC_TYPE_VMMAP, PSC_TYPE_GROUPS, + PSC_TYPE_UMASK, }; struct procstat_core; Modified: head/lib/libprocstat/libprocstat.3 ============================================================================== --- head/lib/libprocstat/libprocstat.3 Sat Apr 20 07:55:31 2013 (r249671) +++ head/lib/libprocstat/libprocstat.3 Sat Apr 20 07:57:08 2013 (r249672) @@ -35,6 +35,7 @@ .Nm procstat_getfiles , .Nm procstat_getgroups , .Nm procstat_getprocs , +.Nm procstat_getumask , .Nm procstat_getvmmap , .Nm procstat_freefiles , .Nm procstat_freegroups , @@ -126,6 +127,12 @@ .Fa "int arg" .Fa "unsigned int *count" .Fc +.Ft "int" +.Fo procstat_getumask +.Fa "struct procstat *procstat" +.Fa "struct kinfo_proc *kp" +.Fa "unsigned short *maskp" +.Fc .Ft "struct kinfo_vmentry *" .Fo procstat_getvmmap .Fa "struct procstat *procstat" @@ -254,6 +261,14 @@ The caller is responsible to free the al function call. .Pp The +.Fn procstat_getumask +function gets a pointer to the +.Vt procstat +structure, a pointer to +.Vt kinfo_proc +structure, and returns the process umask in the 3rd reference parameter. +.Pp +The .Fn procstat_getvmmap function gets a pointer to the .Vt procstat Modified: head/lib/libprocstat/libprocstat.c ============================================================================== --- head/lib/libprocstat/libprocstat.c Sat Apr 20 07:55:31 2013 (r249671) +++ head/lib/libprocstat/libprocstat.c Sat Apr 20 07:57:08 2013 (r249672) @@ -135,6 +135,9 @@ static int procstat_get_vnode_info_sysct static gid_t *procstat_getgroups_core(struct procstat_core *core, unsigned int *count); static gid_t *procstat_getgroups_sysctl(pid_t pid, unsigned int *count); +static int procstat_getumask_core(struct procstat_core *core, + unsigned short *maskp); +static int procstat_getumask_sysctl(pid_t pid, unsigned short *maskp); static int vntype2psfsttype(int type); void @@ -1655,3 +1658,57 @@ procstat_freegroups(struct procstat *pro free(groups); } + +static int +procstat_getumask_sysctl(pid_t pid, unsigned short *maskp) +{ + int error; + int mib[4]; + size_t len; + + mib[0] = CTL_KERN; + mib[1] = KERN_PROC; + mib[2] = KERN_PROC_UMASK; + mib[3] = pid; + len = sizeof(*maskp); + error = sysctl(mib, 4, maskp, &len, NULL, 0); + if (error != 0 && errno != ESRCH) + warn("sysctl: kern.proc.umask: %d", pid); + return (error); +} + +static int +procstat_getumask_core(struct procstat_core *core, unsigned short *maskp) +{ + size_t len; + unsigned short *buf; + + buf = procstat_core_get(core, PSC_TYPE_UMASK, NULL, &len); + if (buf == NULL) + return (-1); + if (len < sizeof(*maskp)) { + free(buf); + return (-1); + } + *maskp = *buf; + free(buf); + return (0); +} + +int +procstat_getumask(struct procstat *procstat, struct kinfo_proc *kp, + unsigned short *maskp) +{ + switch(procstat->type) { + case PROCSTAT_KVM: + warnx("kvm method is not supported"); + return (-1); + case PROCSTAT_SYSCTL: + return (procstat_getumask_sysctl(kp->ki_pid, maskp)); + case PROCSTAT_CORE: + return (procstat_getumask_core(procstat->core, maskp)); + default: + warnx("unknown access method: %d", procstat->type); + return (-1); + } +} Modified: head/lib/libprocstat/libprocstat.h ============================================================================== --- head/lib/libprocstat/libprocstat.h Sat Apr 20 07:55:31 2013 (r249671) +++ head/lib/libprocstat/libprocstat.h Sat Apr 20 07:57:08 2013 (r249672) @@ -168,6 +168,8 @@ int procstat_get_vnode_info(struct procs struct vnstat *vn, char *errbuf); gid_t *procstat_getgroups(struct procstat *procstat, struct kinfo_proc *kp, unsigned int *count); +int procstat_getumask(struct procstat *procstat, struct kinfo_proc *kp, + unsigned short* umask); struct kinfo_vmentry *procstat_getvmmap(struct procstat *procstat, struct kinfo_proc *kp, unsigned int *count); struct procstat *procstat_open_core(const char *filename); From owner-svn-src-all@FreeBSD.ORG Sat Apr 20 07:58:21 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5BE0839A; Sat, 20 Apr 2013 07:58:21 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4EAA311E4; Sat, 20 Apr 2013 07:58:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3K7wL2a097963; Sat, 20 Apr 2013 07:58:21 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3K7wLia097962; Sat, 20 Apr 2013 07:58:21 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201304200758.r3K7wLia097962@svn.freebsd.org> From: Mikolaj Golub Date: Sat, 20 Apr 2013 07:58:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249673 - head/usr.bin/procstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Apr 2013 07:58:21 -0000 Author: trociny Date: Sat Apr 20 07:58:20 2013 New Revision: 249673 URL: http://svnweb.freebsd.org/changeset/base/249673 Log: Use procstat_getumask(3) for retrieving umaks information instead of direct sysctl. MFC after: 1 month Modified: head/usr.bin/procstat/procstat_cred.c Modified: head/usr.bin/procstat/procstat_cred.c ============================================================================== --- head/usr.bin/procstat/procstat_cred.c Sat Apr 20 07:57:08 2013 (r249672) +++ head/usr.bin/procstat/procstat_cred.c Sat Apr 20 07:58:20 2013 (r249673) @@ -38,7 +38,8 @@ #include "procstat.h" -static const char *get_umask(struct kinfo_proc *kipp); +static const char *get_umask(struct procstat *procstat, + struct kinfo_proc *kipp); void procstat_cred(struct procstat *procstat, struct kinfo_proc *kipp) @@ -59,7 +60,7 @@ procstat_cred(struct procstat *procstat, printf("%5d ", kipp->ki_groups[0]); printf("%5d ", kipp->ki_rgid); printf("%5d ", kipp->ki_svgid); - printf("%5s ", get_umask(kipp)); + printf("%5s ", get_umask(procstat, kipp)); printf("%s", kipp->ki_cr_flags & CRED_FLAG_CAPMODE ? "C" : "-"); printf(" "); @@ -84,21 +85,12 @@ procstat_cred(struct procstat *procstat, } static const char * -get_umask(struct kinfo_proc *kipp) +get_umask(struct procstat *procstat, struct kinfo_proc *kipp) { - int error; - int mib[4]; - size_t len; u_short fd_cmask; static char umask[4]; - mib[0] = CTL_KERN; - mib[1] = KERN_PROC; - mib[2] = KERN_PROC_UMASK; - mib[3] = kipp->ki_pid; - len = sizeof(fd_cmask); - error = sysctl(mib, 4, &fd_cmask, &len, NULL, 0); - if (error == 0) { + if (procstat_getumask(procstat, kipp, &fd_cmask) == 0) { snprintf(umask, 4, "%03o", fd_cmask); return (umask); } else { From owner-svn-src-all@FreeBSD.ORG Sat Apr 20 07:59:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 72C32514; Sat, 20 Apr 2013 07:59:46 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 654B611EA; Sat, 20 Apr 2013 07:59:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3K7xkD3099425; Sat, 20 Apr 2013 07:59:46 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3K7xjLc099398; Sat, 20 Apr 2013 07:59:45 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201304200759.r3K7xjLc099398@svn.freebsd.org> From: Mikolaj Golub Date: Sat, 20 Apr 2013 07:59:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249674 - head/lib/libprocstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Apr 2013 07:59:46 -0000 Author: trociny Date: Sat Apr 20 07:59:44 2013 New Revision: 249674 URL: http://svnweb.freebsd.org/changeset/base/249674 Log: Add procstat_getrlimit function to retrieve a process resource limits info. MFC after: 1 month Modified: head/lib/libprocstat/Symbol.map head/lib/libprocstat/core.c head/lib/libprocstat/core.h head/lib/libprocstat/libprocstat.3 head/lib/libprocstat/libprocstat.c head/lib/libprocstat/libprocstat.h Modified: head/lib/libprocstat/Symbol.map ============================================================================== --- head/lib/libprocstat/Symbol.map Sat Apr 20 07:58:20 2013 (r249673) +++ head/lib/libprocstat/Symbol.map Sat Apr 20 07:59:44 2013 (r249674) @@ -20,6 +20,7 @@ FBSD_1.3 { procstat_freevmmap; procstat_get_shm_info; procstat_getgroups; + procstat_getrlimit; procstat_getumask; procstat_getvmmap; procstat_open_core; Modified: head/lib/libprocstat/core.c ============================================================================== --- head/lib/libprocstat/core.c Sat Apr 20 07:58:20 2013 (r249673) +++ head/lib/libprocstat/core.c Sat Apr 20 07:59:44 2013 (r249674) @@ -175,6 +175,10 @@ procstat_core_get(struct procstat_core * n_type = NT_PROCSTAT_UMASK; structsize = sizeof(u_short); break; + case PSC_TYPE_RLIMIT: + n_type = NT_PROCSTAT_RLIMIT; + structsize = sizeof(struct rlimit) * RLIM_NLIMITS; + break; default: warnx("unknown core stat type: %d", type); return (NULL); Modified: head/lib/libprocstat/core.h ============================================================================== --- head/lib/libprocstat/core.h Sat Apr 20 07:58:20 2013 (r249673) +++ head/lib/libprocstat/core.h Sat Apr 20 07:59:44 2013 (r249674) @@ -35,6 +35,7 @@ enum psc_type { PSC_TYPE_VMMAP, PSC_TYPE_GROUPS, PSC_TYPE_UMASK, + PSC_TYPE_RLIMIT, }; struct procstat_core; Modified: head/lib/libprocstat/libprocstat.3 ============================================================================== --- head/lib/libprocstat/libprocstat.3 Sat Apr 20 07:58:20 2013 (r249673) +++ head/lib/libprocstat/libprocstat.3 Sat Apr 20 07:59:44 2013 (r249674) @@ -128,6 +128,13 @@ .Fa "unsigned int *count" .Fc .Ft "int" +.Fo procstat_getrlimit +.Fa "struct procstat *procstat" +.Fa "struct kinfo_proc *kp" +.Fa "int which" +.Fa "struct rlimit* rlimit" +.Fc +.Ft "int" .Fo procstat_getumask .Fa "struct procstat *procstat" .Fa "struct kinfo_proc *kp" @@ -261,6 +268,16 @@ The caller is responsible to free the al function call. .Pp The +.Fn procstat_getrlimit +function gets a pointer to the +.Vt procstat +structure, a pointer to +.Vt kinfo_proc +structure, resource index +.Fa which , +and returns the actual resource limit in the 4th reference parameter. +.Pp +The .Fn procstat_getumask function gets a pointer to the .Vt procstat Modified: head/lib/libprocstat/libprocstat.c ============================================================================== --- head/lib/libprocstat/libprocstat.c Sat Apr 20 07:58:20 2013 (r249673) +++ head/lib/libprocstat/libprocstat.c Sat Apr 20 07:59:44 2013 (r249674) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -135,6 +136,10 @@ static int procstat_get_vnode_info_sysct static gid_t *procstat_getgroups_core(struct procstat_core *core, unsigned int *count); static gid_t *procstat_getgroups_sysctl(pid_t pid, unsigned int *count); +static int procstat_getrlimit_core(struct procstat_core *core, int which, + struct rlimit* rlimit); +static int procstat_getrlimit_sysctl(pid_t pid, int which, + struct rlimit* rlimit); static int procstat_getumask_core(struct procstat_core *core, unsigned short *maskp); static int procstat_getumask_sysctl(pid_t pid, unsigned short *maskp); @@ -1712,3 +1717,66 @@ procstat_getumask(struct procstat *procs return (-1); } } + +static int +procstat_getrlimit_sysctl(pid_t pid, int which, struct rlimit* rlimit) +{ + int error, name[5]; + size_t len; + + name[0] = CTL_KERN; + name[1] = KERN_PROC; + name[2] = KERN_PROC_RLIMIT; + name[3] = pid; + name[4] = which; + len = sizeof(struct rlimit); + error = sysctl(name, 5, rlimit, &len, NULL, 0); + if (error < 0 && errno != ESRCH) { + warn("sysctl: kern.proc.rlimit: %d", pid); + return (-1); + } + if (error < 0 || len != sizeof(struct rlimit)) + return (-1); + return (0); +} + +static int +procstat_getrlimit_core(struct procstat_core *core, int which, + struct rlimit* rlimit) +{ + size_t len; + struct rlimit* rlimits; + + if (which < 0 || which >= RLIM_NLIMITS) { + errno = EINVAL; + warn("getrlimit: which"); + return (-1); + } + rlimits = procstat_core_get(core, PSC_TYPE_RLIMIT, NULL, &len); + if (rlimits == NULL) + return (-1); + if (len < sizeof(struct rlimit) * RLIM_NLIMITS) { + free(rlimits); + return (-1); + } + *rlimit = rlimits[which]; + return (0); +} + +int +procstat_getrlimit(struct procstat *procstat, struct kinfo_proc *kp, int which, + struct rlimit* rlimit) +{ + switch(procstat->type) { + case PROCSTAT_KVM: + warnx("kvm method is not supported"); + return (-1); + case PROCSTAT_SYSCTL: + return (procstat_getrlimit_sysctl(kp->ki_pid, which, rlimit)); + case PROCSTAT_CORE: + return (procstat_getrlimit_core(procstat->core, which, rlimit)); + default: + warnx("unknown access method: %d", procstat->type); + return (-1); + } +} Modified: head/lib/libprocstat/libprocstat.h ============================================================================== --- head/lib/libprocstat/libprocstat.h Sat Apr 20 07:58:20 2013 (r249673) +++ head/lib/libprocstat/libprocstat.h Sat Apr 20 07:59:44 2013 (r249674) @@ -91,6 +91,7 @@ struct kinfo_vmentry; struct procstat; +struct rlimit; struct filestat { int fs_type; /* Descriptor type. */ int fs_flags; /* filestat specific flags. */ @@ -170,6 +171,8 @@ gid_t *procstat_getgroups(struct procsta unsigned int *count); int procstat_getumask(struct procstat *procstat, struct kinfo_proc *kp, unsigned short* umask); +int procstat_getrlimit(struct procstat *procstat, struct kinfo_proc *kp, + int which, struct rlimit* rlimit); struct kinfo_vmentry *procstat_getvmmap(struct procstat *procstat, struct kinfo_proc *kp, unsigned int *count); struct procstat *procstat_open_core(const char *filename); From owner-svn-src-all@FreeBSD.ORG Sat Apr 20 08:01:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3EEFD6EC; Sat, 20 Apr 2013 08:01:01 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 17E2D11FC; Sat, 20 Apr 2013 08:01:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3K810ge002651; Sat, 20 Apr 2013 08:01:00 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3K810f1002635; Sat, 20 Apr 2013 08:01:00 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201304200801.r3K810f1002635@svn.freebsd.org> From: Mikolaj Golub Date: Sat, 20 Apr 2013 08:01:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249675 - head/usr.bin/procstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Apr 2013 08:01:01 -0000 Author: trociny Date: Sat Apr 20 08:01:00 2013 New Revision: 249675 URL: http://svnweb.freebsd.org/changeset/base/249675 Log: Use procstat_getrlimit(3) for retrieving rlimit information instead of direct sysctl calls. MFC after: 1 month Modified: head/usr.bin/procstat/procstat.c head/usr.bin/procstat/procstat.h head/usr.bin/procstat/procstat_rlimit.c Modified: head/usr.bin/procstat/procstat.c ============================================================================== --- head/usr.bin/procstat/procstat.c Sat Apr 20 07:59:44 2013 (r249674) +++ head/usr.bin/procstat/procstat.c Sat Apr 20 08:01:00 2013 (r249675) @@ -73,7 +73,7 @@ procstat(struct procstat *prstat, struct else if (kflag) procstat_kstack(kipp, kflag); else if (lflag) - procstat_rlimit(kipp); + procstat_rlimit(prstat, kipp); else if (sflag) procstat_cred(prstat, kipp); else if (tflag) Modified: head/usr.bin/procstat/procstat.h ============================================================================== --- head/usr.bin/procstat/procstat.h Sat Apr 20 07:59:44 2013 (r249674) +++ head/usr.bin/procstat/procstat.h Sat Apr 20 08:01:00 2013 (r249675) @@ -42,7 +42,7 @@ void procstat_cred(struct procstat *prst void procstat_env(struct kinfo_proc *kipp); void procstat_files(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_kstack(struct kinfo_proc *kipp, int kflag); -void procstat_rlimit(struct kinfo_proc *kipp); +void procstat_rlimit(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_sigs(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_threads(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_threads_sigs(struct procstat *prstat, struct kinfo_proc *kipp); Modified: head/usr.bin/procstat/procstat_rlimit.c ============================================================================== --- head/usr.bin/procstat/procstat_rlimit.c Sat Apr 20 07:59:44 2013 (r249674) +++ head/usr.bin/procstat/procstat_rlimit.c Sat Apr 20 08:01:00 2013 (r249675) @@ -86,31 +86,18 @@ humanize_rlimit(int indx, rlim_t limit) } void -procstat_rlimit(struct kinfo_proc *kipp) +procstat_rlimit(struct procstat *prstat, struct kinfo_proc *kipp) { struct rlimit rlimit; - int error, i, name[5]; - size_t len; + int i; if (!hflag) { printf("%5s %-16s %-16s %16s %16s\n", "PID", "COMM", "RLIMIT", "SOFT ", "HARD "); } - len = sizeof(struct rlimit); - name[0] = CTL_KERN; - name[1] = KERN_PROC; - name[2] = KERN_PROC_RLIMIT; - name[3] = kipp->ki_pid; for (i = 0; i < RLIM_NLIMITS; i++) { - name[4] = i; - error = sysctl(name, 5, &rlimit, &len, NULL, 0); - if (error < 0 && errno != ESRCH) { - warn("sysctl: kern.proc.rlimit: %d", kipp->ki_pid); + if (procstat_getrlimit(prstat, kipp, i, &rlimit) == -1) return; - } - if (error < 0 || len != sizeof(struct rlimit)) - return; - printf("%5d %-16s %-16s ", kipp->ki_pid, kipp->ki_comm, rlimit_param[i].name); printf("%16s ", humanize_rlimit(i, rlimit.rlim_cur)); From owner-svn-src-all@FreeBSD.ORG Sat Apr 20 08:02:45 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 133A0864; Sat, 20 Apr 2013 08:02:45 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EB5971203; Sat, 20 Apr 2013 08:02:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3K82iqE004531; Sat, 20 Apr 2013 08:02:44 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3K82iPO004517; Sat, 20 Apr 2013 08:02:44 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201304200802.r3K82iPO004517@svn.freebsd.org> From: Mikolaj Golub Date: Sat, 20 Apr 2013 08:02:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249676 - head/lib/libprocstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Apr 2013 08:02:45 -0000 Author: trociny Date: Sat Apr 20 08:02:43 2013 New Revision: 249676 URL: http://svnweb.freebsd.org/changeset/base/249676 Log: Add procstat_getpathname function to retrieve a process executable. MFC after: 1 month Modified: head/lib/libprocstat/Symbol.map head/lib/libprocstat/libprocstat.3 head/lib/libprocstat/libprocstat.c head/lib/libprocstat/libprocstat.h Modified: head/lib/libprocstat/Symbol.map ============================================================================== --- head/lib/libprocstat/Symbol.map Sat Apr 20 08:01:00 2013 (r249675) +++ head/lib/libprocstat/Symbol.map Sat Apr 20 08:02:43 2013 (r249676) @@ -20,6 +20,7 @@ FBSD_1.3 { procstat_freevmmap; procstat_get_shm_info; procstat_getgroups; + procstat_getpathname; procstat_getrlimit; procstat_getumask; procstat_getvmmap; Modified: head/lib/libprocstat/libprocstat.3 ============================================================================== --- head/lib/libprocstat/libprocstat.3 Sat Apr 20 08:01:00 2013 (r249675) +++ head/lib/libprocstat/libprocstat.3 Sat Apr 20 08:02:43 2013 (r249676) @@ -34,6 +34,7 @@ .Nm procstat_close , .Nm procstat_getfiles , .Nm procstat_getgroups , +.Nm procstat_getpathname , .Nm procstat_getprocs , .Nm procstat_getumask , .Nm procstat_getvmmap , @@ -128,6 +129,13 @@ .Fa "unsigned int *count" .Fc .Ft "int" +.Fo procstat_getpathname +.Fa "struct procstat *procstat" +.Fa "struct kinfo_proc *kp" +.Fa "char *pathname" +.Fa "size_t maxlen" +.Fc +.Ft "int" .Fo procstat_getrlimit .Fa "struct procstat *procstat" .Fa "struct kinfo_proc *kp" @@ -268,6 +276,18 @@ The caller is responsible to free the al function call. .Pp The +.Fn procstat_getpathname +function gets a pointer to the +.Vt procstat +structure, a pointer to +.Vt kinfo_proc +structure, and copies the path of the process executable to +.Fa pathname +buffer, limiting to +.Fa maxlen +characters. +.Pp +The .Fn procstat_getrlimit function gets a pointer to the .Vt procstat Modified: head/lib/libprocstat/libprocstat.c ============================================================================== --- head/lib/libprocstat/libprocstat.c Sat Apr 20 08:01:00 2013 (r249675) +++ head/lib/libprocstat/libprocstat.c Sat Apr 20 08:02:43 2013 (r249676) @@ -136,6 +136,10 @@ static int procstat_get_vnode_info_sysct static gid_t *procstat_getgroups_core(struct procstat_core *core, unsigned int *count); static gid_t *procstat_getgroups_sysctl(pid_t pid, unsigned int *count); +static int procstat_getpathname_core(struct procstat_core *core, + char *pathname, size_t maxlen); +static int procstat_getpathname_sysctl(pid_t pid, char *pathname, + size_t maxlen); static int procstat_getrlimit_core(struct procstat_core *core, int which, struct rlimit* rlimit); static int procstat_getrlimit_sysctl(pid_t pid, int which, @@ -1780,3 +1784,64 @@ procstat_getrlimit(struct procstat *proc return (-1); } } + +static int +procstat_getpathname_sysctl(pid_t pid, char *pathname, size_t maxlen) +{ + int error, name[4]; + size_t len; + + name[0] = CTL_KERN; + name[1] = KERN_PROC; + name[2] = KERN_PROC_PATHNAME; + name[3] = pid; + len = maxlen; + error = sysctl(name, 4, pathname, &len, NULL, 0); + if (error != 0 && errno != ESRCH) + warn("sysctl: kern.proc.pathname: %d", pid); + if (len == 0) + pathname[0] = '\0'; + return (error); +} + +static int +procstat_getpathname_core(struct procstat_core *core, char *pathname, + size_t maxlen) +{ + struct kinfo_file *files; + int cnt, i, result; + + files = kinfo_getfile_core(core, &cnt); + if (files == NULL) + return (-1); + result = -1; + for (i = 0; i < cnt; i++) { + if (files[i].kf_fd != KF_FD_TYPE_TEXT) + continue; + strncpy(pathname, files[i].kf_path, maxlen); + result = 0; + break; + } + free(files); + return (result); +} + +int +procstat_getpathname(struct procstat *procstat, struct kinfo_proc *kp, + char *pathname, size_t maxlen) +{ + switch(procstat->type) { + case PROCSTAT_KVM: + warnx("kvm method is not supported"); + return (-1); + case PROCSTAT_SYSCTL: + return (procstat_getpathname_sysctl(kp->ki_pid, pathname, + maxlen)); + case PROCSTAT_CORE: + return (procstat_getpathname_core(procstat->core, pathname, + maxlen)); + default: + warnx("unknown access method: %d", procstat->type); + return (-1); + } +} Modified: head/lib/libprocstat/libprocstat.h ============================================================================== --- head/lib/libprocstat/libprocstat.h Sat Apr 20 08:01:00 2013 (r249675) +++ head/lib/libprocstat/libprocstat.h Sat Apr 20 08:02:43 2013 (r249676) @@ -169,10 +169,12 @@ int procstat_get_vnode_info(struct procs struct vnstat *vn, char *errbuf); gid_t *procstat_getgroups(struct procstat *procstat, struct kinfo_proc *kp, unsigned int *count); -int procstat_getumask(struct procstat *procstat, struct kinfo_proc *kp, - unsigned short* umask); +int procstat_getpathname(struct procstat *procstat, struct kinfo_proc *kp, + char *pathname, size_t maxlen); int procstat_getrlimit(struct procstat *procstat, struct kinfo_proc *kp, int which, struct rlimit* rlimit); +int procstat_getumask(struct procstat *procstat, struct kinfo_proc *kp, + unsigned short* umask); struct kinfo_vmentry *procstat_getvmmap(struct procstat *procstat, struct kinfo_proc *kp, unsigned int *count); struct procstat *procstat_open_core(const char *filename); From owner-svn-src-all@FreeBSD.ORG Sat Apr 20 08:03:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id EC398BAD; Sat, 20 Apr 2013 08:03:57 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CF1C5120C; Sat, 20 Apr 2013 08:03:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3K83vfg005779; Sat, 20 Apr 2013 08:03:57 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3K83ugM005761; Sat, 20 Apr 2013 08:03:56 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201304200803.r3K83ugM005761@svn.freebsd.org> From: Mikolaj Golub Date: Sat, 20 Apr 2013 08:03:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249677 - head/lib/libprocstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Apr 2013 08:03:58 -0000 Author: trociny Date: Sat Apr 20 08:03:56 2013 New Revision: 249677 URL: http://svnweb.freebsd.org/changeset/base/249677 Log: Add procstat_getosrel function to retrieve a process osrel info. MFC after: 1 month Modified: head/lib/libprocstat/Symbol.map head/lib/libprocstat/core.c head/lib/libprocstat/core.h head/lib/libprocstat/libprocstat.3 head/lib/libprocstat/libprocstat.c head/lib/libprocstat/libprocstat.h Modified: head/lib/libprocstat/Symbol.map ============================================================================== --- head/lib/libprocstat/Symbol.map Sat Apr 20 08:02:43 2013 (r249676) +++ head/lib/libprocstat/Symbol.map Sat Apr 20 08:03:56 2013 (r249677) @@ -20,6 +20,7 @@ FBSD_1.3 { procstat_freevmmap; procstat_get_shm_info; procstat_getgroups; + procstat_getosrel; procstat_getpathname; procstat_getrlimit; procstat_getumask; Modified: head/lib/libprocstat/core.c ============================================================================== --- head/lib/libprocstat/core.c Sat Apr 20 08:02:43 2013 (r249676) +++ head/lib/libprocstat/core.c Sat Apr 20 08:03:56 2013 (r249677) @@ -179,6 +179,10 @@ procstat_core_get(struct procstat_core * n_type = NT_PROCSTAT_RLIMIT; structsize = sizeof(struct rlimit) * RLIM_NLIMITS; break; + case PSC_TYPE_OSREL: + n_type = NT_PROCSTAT_OSREL; + structsize = sizeof(int); + break; default: warnx("unknown core stat type: %d", type); return (NULL); Modified: head/lib/libprocstat/core.h ============================================================================== --- head/lib/libprocstat/core.h Sat Apr 20 08:02:43 2013 (r249676) +++ head/lib/libprocstat/core.h Sat Apr 20 08:03:56 2013 (r249677) @@ -36,6 +36,7 @@ enum psc_type { PSC_TYPE_GROUPS, PSC_TYPE_UMASK, PSC_TYPE_RLIMIT, + PSC_TYPE_OSREL, }; struct procstat_core; Modified: head/lib/libprocstat/libprocstat.3 ============================================================================== --- head/lib/libprocstat/libprocstat.3 Sat Apr 20 08:02:43 2013 (r249676) +++ head/lib/libprocstat/libprocstat.3 Sat Apr 20 08:03:56 2013 (r249677) @@ -34,6 +34,7 @@ .Nm procstat_close , .Nm procstat_getfiles , .Nm procstat_getgroups , +.Nm procstat_getosrel , .Nm procstat_getpathname , .Nm procstat_getprocs , .Nm procstat_getumask , @@ -120,6 +121,11 @@ .Fa "struct procstat *procstat" .Fa "struct kinfo_proc *kp" .Fa "unsigned int *count" +.Ft int +.Fo procstat_getosrel +.Fa "struct procstat *procstat" +.Fa "struct kinfo_proc *kp" +.Fa "int *osrelp" .Fc .Ft "struct kinfo_proc *" .Fo procstat_getprocs @@ -276,6 +282,14 @@ The caller is responsible to free the al function call. .Pp The +.Fn procstat_getosrel +function gets a pointer to the +.Vt procstat +structure, a pointer to +.Vt kinfo_proc +structure, and returns osrel date in the 3rd reference parameter. +.Pp +The .Fn procstat_getpathname function gets a pointer to the .Vt procstat Modified: head/lib/libprocstat/libprocstat.c ============================================================================== --- head/lib/libprocstat/libprocstat.c Sat Apr 20 08:02:43 2013 (r249676) +++ head/lib/libprocstat/libprocstat.c Sat Apr 20 08:03:56 2013 (r249677) @@ -1845,3 +1845,55 @@ procstat_getpathname(struct procstat *pr return (-1); } } + +static int +procstat_getosrel_sysctl(pid_t pid, int *osrelp) +{ + int error, name[4]; + size_t len; + + name[0] = CTL_KERN; + name[1] = KERN_PROC; + name[2] = KERN_PROC_OSREL; + name[3] = pid; + len = sizeof(*osrelp); + error = sysctl(name, 4, osrelp, &len, NULL, 0); + if (error != 0 && errno != ESRCH) + warn("sysctl: kern.proc.osrel: %d", pid); + return (error); +} + +static int +procstat_getosrel_core(struct procstat_core *core, int *osrelp) +{ + size_t len; + int *buf; + + buf = procstat_core_get(core, PSC_TYPE_OSREL, NULL, &len); + if (buf == NULL) + return (-1); + if (len < sizeof(*osrelp)) { + free(buf); + return (-1); + } + *osrelp = *buf; + free(buf); + return (0); +} + +int +procstat_getosrel(struct procstat *procstat, struct kinfo_proc *kp, int *osrelp) +{ + switch(procstat->type) { + case PROCSTAT_KVM: + warnx("kvm method is not supported"); + return (-1); + case PROCSTAT_SYSCTL: + return (procstat_getosrel_sysctl(kp->ki_pid, osrelp)); + case PROCSTAT_CORE: + return (procstat_getosrel_core(procstat->core, osrelp)); + default: + warnx("unknown access method: %d", procstat->type); + return (-1); + } +} Modified: head/lib/libprocstat/libprocstat.h ============================================================================== --- head/lib/libprocstat/libprocstat.h Sat Apr 20 08:02:43 2013 (r249676) +++ head/lib/libprocstat/libprocstat.h Sat Apr 20 08:03:56 2013 (r249677) @@ -169,6 +169,8 @@ int procstat_get_vnode_info(struct procs struct vnstat *vn, char *errbuf); gid_t *procstat_getgroups(struct procstat *procstat, struct kinfo_proc *kp, unsigned int *count); +int procstat_getosrel(struct procstat *procstat, struct kinfo_proc *kp, + int *osrelp); int procstat_getpathname(struct procstat *procstat, struct kinfo_proc *kp, char *pathname, size_t maxlen); int procstat_getrlimit(struct procstat *procstat, struct kinfo_proc *kp, From owner-svn-src-all@FreeBSD.ORG Sat Apr 20 08:05:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B882BD36; Sat, 20 Apr 2013 08:05:05 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 918A0121D; Sat, 20 Apr 2013 08:05:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3K855HM006821; Sat, 20 Apr 2013 08:05:05 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3K855l4006811; Sat, 20 Apr 2013 08:05:05 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201304200805.r3K855l4006811@svn.freebsd.org> From: Mikolaj Golub Date: Sat, 20 Apr 2013 08:05:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249678 - head/usr.bin/procstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Apr 2013 08:05:05 -0000 Author: trociny Date: Sat Apr 20 08:05:04 2013 New Revision: 249678 URL: http://svnweb.freebsd.org/changeset/base/249678 Log: Use libprocstat(3) when retrieving binary information for a process. MFC after: 1 month Modified: head/usr.bin/procstat/procstat.c head/usr.bin/procstat/procstat.h head/usr.bin/procstat/procstat_bin.c Modified: head/usr.bin/procstat/procstat.c ============================================================================== --- head/usr.bin/procstat/procstat.c Sat Apr 20 08:03:56 2013 (r249677) +++ head/usr.bin/procstat/procstat.c Sat Apr 20 08:05:04 2013 (r249678) @@ -59,7 +59,7 @@ procstat(struct procstat *prstat, struct { if (bflag) - procstat_bin(kipp); + procstat_bin(prstat, kipp); else if (cflag) procstat_args(kipp); else if (eflag) Modified: head/usr.bin/procstat/procstat.h ============================================================================== --- head/usr.bin/procstat/procstat.h Sat Apr 20 08:03:56 2013 (r249677) +++ head/usr.bin/procstat/procstat.h Sat Apr 20 08:05:04 2013 (r249678) @@ -37,7 +37,7 @@ void kinfo_proc_sort(struct kinfo_proc * void procstat_args(struct kinfo_proc *kipp); void procstat_auxv(struct kinfo_proc *kipp); void procstat_basic(struct kinfo_proc *kipp); -void procstat_bin(struct kinfo_proc *kipp); +void procstat_bin(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_cred(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_env(struct kinfo_proc *kipp); void procstat_files(struct procstat *prstat, struct kinfo_proc *kipp); Modified: head/usr.bin/procstat/procstat_bin.c ============================================================================== --- head/usr.bin/procstat/procstat_bin.c Sat Apr 20 08:03:56 2013 (r249677) +++ head/usr.bin/procstat/procstat_bin.c Sat Apr 20 08:05:04 2013 (r249678) @@ -40,40 +40,19 @@ #include "procstat.h" void -procstat_bin(struct kinfo_proc *kipp) +procstat_bin(struct procstat *prstat, struct kinfo_proc *kipp) { - char pathname[PATH_MAX]; - int error, osrel, name[4]; - size_t len; + int osrel; + static char pathname[PATH_MAX]; if (!hflag) printf("%5s %-16s %8s %s\n", "PID", "COMM", "OSREL", "PATH"); - name[0] = CTL_KERN; - name[1] = KERN_PROC; - name[2] = KERN_PROC_PATHNAME; - name[3] = kipp->ki_pid; - - len = sizeof(pathname); - error = sysctl(name, 4, pathname, &len, NULL, 0); - if (error < 0 && errno != ESRCH) { - warn("sysctl: kern.proc.pathname: %d", kipp->ki_pid); - return; - } - if (error < 0) + if (procstat_getpathname(prstat, kipp, pathname, sizeof(pathname)) != 0) return; - if (len == 0 || strlen(pathname) == 0) + if (strlen(pathname) == 0) strcpy(pathname, "-"); - - name[2] = KERN_PROC_OSREL; - - len = sizeof(osrel); - error = sysctl(name, 4, &osrel, &len, NULL, 0); - if (error < 0 && errno != ESRCH) { - warn("sysctl: kern.proc.osrel: %d", kipp->ki_pid); - return; - } - if (error < 0) + if (procstat_getosrel(prstat, kipp, &osrel) != 0) return; printf("%5d ", kipp->ki_pid); From owner-svn-src-all@FreeBSD.ORG Sat Apr 20 08:07:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 2E94EEC6; Sat, 20 Apr 2013 08:07:06 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1F3391232; Sat, 20 Apr 2013 08:07:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3K876Ze008923; Sat, 20 Apr 2013 08:07:06 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3K874GB008895; Sat, 20 Apr 2013 08:07:04 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201304200807.r3K874GB008895@svn.freebsd.org> From: Mikolaj Golub Date: Sat, 20 Apr 2013 08:07:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249679 - head/lib/libprocstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Apr 2013 08:07:06 -0000 Author: trociny Date: Sat Apr 20 08:07:04 2013 New Revision: 249679 URL: http://svnweb.freebsd.org/changeset/base/249679 Log: Extend libprocstat with functions to retrieve process command line arguments and environment variables. Suggested by: stas Reviewed by: jhb and stas (initial version) MFC after: 1 month Modified: head/lib/libprocstat/Symbol.map head/lib/libprocstat/core.c head/lib/libprocstat/core.h head/lib/libprocstat/libprocstat.3 head/lib/libprocstat/libprocstat.c head/lib/libprocstat/libprocstat.h head/lib/libprocstat/libprocstat_internal.h Modified: head/lib/libprocstat/Symbol.map ============================================================================== --- head/lib/libprocstat/Symbol.map Sat Apr 20 08:05:04 2013 (r249678) +++ head/lib/libprocstat/Symbol.map Sat Apr 20 08:07:04 2013 (r249679) @@ -16,9 +16,13 @@ FBSD_1.2 { }; FBSD_1.3 { + procstat_freeargv; + procstat_freeenvv; procstat_freegroups; procstat_freevmmap; procstat_get_shm_info; + procstat_getargv; + procstat_getenvv; procstat_getgroups; procstat_getosrel; procstat_getpathname; Modified: head/lib/libprocstat/core.c ============================================================================== --- head/lib/libprocstat/core.c Sat Apr 20 08:05:04 2013 (r249678) +++ head/lib/libprocstat/core.c Sat Apr 20 08:07:04 2013 (r249679) @@ -28,6 +28,7 @@ #include #include +#include #include #include @@ -56,6 +57,10 @@ struct procstat_core static bool core_offset(struct procstat_core *core, off_t offset); static bool core_read(struct procstat_core *core, void *buf, size_t len); +static ssize_t core_read_mem(struct procstat_core *core, void *buf, + size_t len, vm_offset_t addr, bool readall); +static void *get_args(struct procstat_core *core, vm_offset_t psstrings, + enum psc_type type, void *buf, size_t *lenp); struct procstat_core * procstat_core_open(const char *filename) @@ -146,6 +151,7 @@ procstat_core_get(struct procstat_core * { Elf_Note nhdr; off_t offset, eoffset; + vm_offset_t psstrings; void *freebuf; size_t len; u_int32_t n_type; @@ -183,6 +189,12 @@ procstat_core_get(struct procstat_core * n_type = NT_PROCSTAT_OSREL; structsize = sizeof(int); break; + case PSC_TYPE_PSSTRINGS: + case PSC_TYPE_ARGV: + case PSC_TYPE_ENVV: + n_type = NT_PROCSTAT_PSSTRINGS; + structsize = sizeof(vm_offset_t); + break; default: warnx("unknown core stat type: %d", type); return (NULL); @@ -238,6 +250,19 @@ procstat_core_get(struct procstat_core * free(freebuf); return (NULL); } + if (type == PSC_TYPE_ARGV || type == PSC_TYPE_ENVV) { + if (len < sizeof(psstrings)) { + free(freebuf); + return (NULL); + } + psstrings = *(vm_offset_t *)buf; + if (freebuf == NULL) + len = *lenp; + else + buf = NULL; + free(freebuf); + buf = get_args(core, psstrings, type, buf, &len); + } *lenp = len; return (buf); } @@ -276,3 +301,128 @@ core_read(struct procstat_core *core, vo } return (true); } + +static ssize_t +core_read_mem(struct procstat_core *core, void *buf, size_t len, + vm_offset_t addr, bool readall) +{ + GElf_Phdr phdr; + off_t offset; + int i; + + assert(core->pc_magic == PROCSTAT_CORE_MAGIC); + + for (i = 0; i < core->pc_ehdr.e_phnum; i++) { + if (gelf_getphdr(core->pc_elf, i, &phdr) != &phdr) { + warnx("gelf_getphdr: %s", elf_errmsg(-1)); + return (-1); + } + if (phdr.p_type != PT_LOAD) + continue; + if (addr < phdr.p_vaddr || addr > phdr.p_vaddr + phdr.p_memsz) + continue; + offset = phdr.p_offset + (addr - phdr.p_vaddr); + if ((phdr.p_vaddr + phdr.p_memsz) - addr < len) { + if (readall) { + warnx("format error: " + "attempt to read out of segment"); + return (-1); + } + len = (phdr.p_vaddr + phdr.p_memsz) - addr; + } + if (!core_offset(core, offset)) + return (-1); + if (!core_read(core, buf, len)) + return (-1); + return (len); + } + warnx("format error: address %ju not found", (uintmax_t)addr); + return (-1); +} + +#define ARGS_CHUNK_SZ 256 /* Chunk size (bytes) for get_args operations. */ + +static void * +get_args(struct procstat_core *core, vm_offset_t psstrings, enum psc_type type, + void *args, size_t *lenp) +{ + struct ps_strings pss; + void *freeargs; + vm_offset_t addr; + char **argv, *p; + size_t chunksz, done, len, nchr, size; + ssize_t n; + u_int i, nstr; + + assert(type == PSC_TYPE_ARGV || type == PSC_TYPE_ENVV); + + if (core_read_mem(core, &pss, sizeof(pss), psstrings, true) == -1) + return (NULL); + if (type == PSC_TYPE_ARGV) { + addr = (vm_offset_t)pss.ps_argvstr; + nstr = pss.ps_nargvstr; + } else /* type == PSC_TYPE_ENVV */ { + addr = (vm_offset_t)pss.ps_envstr; + nstr = pss.ps_nenvstr; + } + if (addr == 0 || nstr == 0) + return (NULL); + if (nstr > ARG_MAX) { + warnx("format error"); + return (NULL); + } + size = nstr * sizeof(char *); + argv = malloc(size); + if (argv == NULL) { + warn("malloc(%zu)", size); + return (NULL); + } + done = 0; + freeargs = NULL; + if (core_read_mem(core, argv, size, addr, true) == -1) + goto fail; + if (args != NULL) { + nchr = MIN(ARG_MAX, *lenp); + } else { + nchr = ARG_MAX; + freeargs = args = malloc(nchr); + if (args == NULL) { + warn("malloc(%zu)", nchr); + goto fail; + } + } + p = args; + for (i = 0; ; i++) { + if (i == nstr) + goto done; + /* + * The program may have scribbled into its argv array, e.g. to + * remove some arguments. If that has happened, break out + * before trying to read from NULL. + */ + if (argv[i] == NULL) + goto done; + for (addr = (vm_offset_t)argv[i]; ; addr += chunksz) { + chunksz = MIN(ARGS_CHUNK_SZ, nchr - 1 - done); + if (chunksz <= 0) + goto done; + n = core_read_mem(core, p, chunksz, addr, false); + if (n == -1) + goto fail; + len = strnlen(p, chunksz); + p += len; + done += len; + if (len != chunksz) + break; + } + *p++ = '\0'; + done++; + } +fail: + free(freeargs); + args = NULL; +done: + *lenp = done; + free(argv); + return (args); +} Modified: head/lib/libprocstat/core.h ============================================================================== --- head/lib/libprocstat/core.h Sat Apr 20 08:05:04 2013 (r249678) +++ head/lib/libprocstat/core.h Sat Apr 20 08:07:04 2013 (r249679) @@ -37,6 +37,9 @@ enum psc_type { PSC_TYPE_UMASK, PSC_TYPE_RLIMIT, PSC_TYPE_OSREL, + PSC_TYPE_PSSTRINGS, + PSC_TYPE_ARGV, + PSC_TYPE_ENVV, }; struct procstat_core; Modified: head/lib/libprocstat/libprocstat.3 ============================================================================== --- head/lib/libprocstat/libprocstat.3 Sat Apr 20 08:05:04 2013 (r249678) +++ head/lib/libprocstat/libprocstat.3 Sat Apr 20 08:07:04 2013 (r249679) @@ -32,6 +32,8 @@ .Nm procstat_open_kvm , .Nm procstat_open_sysctl , .Nm procstat_close , +.Nm procstat_getargv , +.Nm procstat_getenvv , .Nm procstat_getfiles , .Nm procstat_getgroups , .Nm procstat_getosrel , @@ -39,6 +41,8 @@ .Nm procstat_getprocs , .Nm procstat_getumask , .Nm procstat_getvmmap , +.Nm procstat_freeargv , +.Nm procstat_freeenvv , .Nm procstat_freefiles , .Nm procstat_freegroups , .Nm procstat_freeprocs , @@ -59,6 +63,14 @@ .Fn procstat_close "struct procstat *procstat" .Fc .Ft void +.Fo procstat_freeargv +.Fa "struct procstat *procstat" +.Fc +.Ft void +.Fo procstat_freeenvv +.Fa "struct procstat *procstat" +.Fc +.Ft void .Fo procstat_freefiles .Fa "struct procstat *procstat" .Fa "struct filestat_list *head" @@ -110,6 +122,20 @@ .Fa "struct vnstat *vn" .Fa "char *errbuf" .Fc +.Ft "char **" +.Fo procstat_getargv +.Fa "struct procstat *procstat" +.Fa "const struct kinfo_proc *kp" +.Fa "size_t nchr" +.Fa "char *errbuf" +.Fc +.Ft "char **" +.Fo procstat_getenvv +.Fa "struct procstat *procstat" +.Fa "const struct kinfo_proc *kp" +.Fa "size_t nchr" +.Fa "char *errbuf" +.Fc .Ft "struct filestat_list *" .Fo procstat_getfiles .Fa "struct procstat *procstat" @@ -251,6 +277,50 @@ The caller is responsible to free the al function call. .Pp The +.Fn procstat_getargv +function gets a pointer to the +.Vt procstat +structure from one of the +.Fn procstat_open_* +functions, a pointer to +.Vt kinfo_proc +structure from the array obtained from the +.Fn kvm_getprocs +function, and returns a null-terminated argument vector that corresponds to +the command line arguments passed to the process. +The +.Fa nchr +argument indicates the maximum number of characters, including null bytes, +to use in building the strings. +If this amount is exceeded, the string causing the overflow is truncated and +the partial result is returned. +This is handy for programs that print only a one line summary of a +command and should not copy out large amounts of text only to ignore it. +If +.Fa nchr +is zero, no limit is imposed and all argument strings are returned. +The values of the returned argument vector refer the strings stored +in the +.Vt procstat +internal buffer. +A subsequent call of the function with the same +.Vt procstat +argument will reuse the buffer. +To free the allocated memory +.Fn procstat_freeargv +function call can be used, or it will be released on +.Fn procstat_close . +.Pp +The +.Fn procstat_getenvv +function is similar to +.Fn procstat_getargv +but returns the vector of environment strings. +The caller may free the allocated memory with a subsequent +.Fn procstat_freeenv +function call. +.Pp +The .Fn procstat_getfiles function gets a pointer to the .Vt procstat Modified: head/lib/libprocstat/libprocstat.c ============================================================================== --- head/lib/libprocstat/libprocstat.c Sat Apr 20 08:05:04 2013 (r249678) +++ head/lib/libprocstat/libprocstat.c Sat Apr 20 08:07:04 2013 (r249679) @@ -105,6 +105,8 @@ int statfs(const char *, struct stat #define PROCSTAT_SYSCTL 2 #define PROCSTAT_CORE 3 +static char **getargv(struct procstat *procstat, struct kinfo_proc *kp, + size_t nchr, int env); static char *getmnton(kvm_t *kd, struct mount *m); static struct kinfo_vmentry * kinfo_getvmmap_core(struct procstat_core *core, int *cntp); @@ -158,6 +160,8 @@ procstat_close(struct procstat *procstat kvm_close(procstat->kd); else if (procstat->type == PROCSTAT_CORE) procstat_core_close(procstat->core); + procstat_freeargv(procstat); + procstat_freeenvv(procstat); free(procstat); } @@ -1524,6 +1528,180 @@ getmnton(kvm_t *kd, struct mount *m) return (mt->mntonname); } +/* + * Auxiliary structures and functions to get process environment or + * command line arguments. + */ +struct argvec { + char *buf; + size_t bufsize; + char **argv; + size_t argc; +}; + +static struct argvec * +argvec_alloc(size_t bufsize) +{ + struct argvec *av; + + av = malloc(sizeof(*av)); + if (av == NULL) + return (NULL); + av->bufsize = bufsize; + av->buf = malloc(av->bufsize); + if (av->buf == NULL) { + free(av); + return (NULL); + } + av->argc = 32; + av->argv = malloc(sizeof(char *) * av->argc); + if (av->argv == NULL) { + free(av->buf); + free(av); + return (NULL); + } + return av; +} + +static void +argvec_free(struct argvec * av) +{ + + free(av->argv); + free(av->buf); + free(av); +} + +static char ** +getargv(struct procstat *procstat, struct kinfo_proc *kp, size_t nchr, int env) +{ + int error, name[4], argc, i; + struct argvec *av, **avp; + enum psc_type type; + size_t len; + char *p, **argv; + + assert(procstat); + assert(kp); + if (procstat->type == PROCSTAT_KVM) { + warnx("can't use kvm access method"); + return (NULL); + } + if (procstat->type != PROCSTAT_SYSCTL && + procstat->type != PROCSTAT_CORE) { + warnx("unknown access method: %d", procstat->type); + return (NULL); + } + + if (nchr == 0 || nchr > ARG_MAX) + nchr = ARG_MAX; + + avp = (struct argvec **)(env ? &procstat->argv : &procstat->envv); + av = *avp; + + if (av == NULL) + { + av = argvec_alloc(nchr); + if (av == NULL) + { + warn("malloc(%zu)", nchr); + return (NULL); + } + *avp = av; + } else if (av->bufsize < nchr) { + av->buf = reallocf(av->buf, nchr); + if (av->buf == NULL) { + warn("malloc(%zu)", nchr); + return (NULL); + } + } + if (procstat->type == PROCSTAT_SYSCTL) { + name[0] = CTL_KERN; + name[1] = KERN_PROC; + name[2] = env ? KERN_PROC_ENV : KERN_PROC_ARGS; + name[3] = kp->ki_pid; + len = nchr; + error = sysctl(name, 4, av->buf, &len, NULL, 0); + if (error != 0 && errno != ESRCH && errno != EPERM) + warn("sysctl(kern.proc.%s)", env ? "env" : "args"); + if (error != 0 || len == 0) + return (NULL); + } else /* procstat->type == PROCSTAT_CORE */ { + type = env ? PSC_TYPE_ENVV : PSC_TYPE_ARGV; + len = nchr; + if (procstat_core_get(procstat->core, type, av->buf, &len) + == NULL) { + return (NULL); + } + } + + argv = av->argv; + argc = av->argc; + i = 0; + for (p = av->buf; p < av->buf + len; p += strlen(p) + 1) { + argv[i++] = p; + if (i < argc) + continue; + /* Grow argv. */ + argc += argc; + argv = realloc(argv, sizeof(char *) * argc); + if (argv == NULL) { + warn("malloc(%zu)", sizeof(char *) * argc); + return (NULL); + } + av->argv = argv; + av->argc = argc; + } + argv[i] = NULL; + + return (argv); +} + +/* + * Return process command line arguments. + */ +char ** +procstat_getargv(struct procstat *procstat, struct kinfo_proc *p, size_t nchr) +{ + + return (getargv(procstat, p, nchr, 0)); +} + +/* + * Free the buffer allocated by procstat_getargv(). + */ +void +procstat_freeargv(struct procstat *procstat) +{ + + if (procstat->argv != NULL) { + argvec_free(procstat->argv); + procstat->argv = NULL; + } +} + +/* + * Return process environment. + */ +char ** +procstat_getenvv(struct procstat *procstat, struct kinfo_proc *p, size_t nchr) +{ + + return (getargv(procstat, p, nchr, 1)); +} + +/* + * Free the buffer allocated by procstat_getenvv(). + */ +void +procstat_freeenvv(struct procstat *procstat) +{ + if (procstat->envv != NULL) { + argvec_free(procstat->envv); + procstat->envv = NULL; + } +} + static struct kinfo_vmentry * kinfo_getvmmap_core(struct procstat_core *core, int *cntp) { Modified: head/lib/libprocstat/libprocstat.h ============================================================================== --- head/lib/libprocstat/libprocstat.h Sat Apr 20 08:05:04 2013 (r249678) +++ head/lib/libprocstat/libprocstat.h Sat Apr 20 08:07:04 2013 (r249679) @@ -147,6 +147,8 @@ STAILQ_HEAD(filestat_list, filestat); __BEGIN_DECLS void procstat_close(struct procstat *procstat); +void procstat_freeargv(struct procstat *procstat); +void procstat_freeenvv(struct procstat *procstat); void procstat_freegroups(struct procstat *procstat, gid_t *groups); void procstat_freeprocs(struct procstat *procstat, struct kinfo_proc *p); void procstat_freefiles(struct procstat *procstat, @@ -167,6 +169,10 @@ int procstat_get_socket_info(struct proc struct sockstat *sock, char *errbuf); int procstat_get_vnode_info(struct procstat *procstat, struct filestat *fst, struct vnstat *vn, char *errbuf); +char **procstat_getargv(struct procstat *procstat, struct kinfo_proc *p, + size_t nchr); +char **procstat_getenvv(struct procstat *procstat, struct kinfo_proc *p, + size_t nchr); gid_t *procstat_getgroups(struct procstat *procstat, struct kinfo_proc *kp, unsigned int *count); int procstat_getosrel(struct procstat *procstat, struct kinfo_proc *kp, Modified: head/lib/libprocstat/libprocstat_internal.h ============================================================================== --- head/lib/libprocstat/libprocstat_internal.h Sat Apr 20 08:05:04 2013 (r249678) +++ head/lib/libprocstat/libprocstat_internal.h Sat Apr 20 08:07:04 2013 (r249679) @@ -34,6 +34,8 @@ struct procstat { kvm_t *kd; void *vmentries; void *files; + void *argv; + void *envv; struct procstat_core *core; }; From owner-svn-src-all@FreeBSD.ORG Sat Apr 20 08:08:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 2106DD6; Sat, 20 Apr 2013 08:08:30 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 13A561248; Sat, 20 Apr 2013 08:08:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3K88TGT010457; Sat, 20 Apr 2013 08:08:29 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3K88TX8010447; Sat, 20 Apr 2013 08:08:29 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201304200808.r3K88TX8010447@svn.freebsd.org> From: Mikolaj Golub Date: Sat, 20 Apr 2013 08:08:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249680 - head/usr.bin/procstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Apr 2013 08:08:30 -0000 Author: trociny Date: Sat Apr 20 08:08:29 2013 New Revision: 249680 URL: http://svnweb.freebsd.org/changeset/base/249680 Log: Use libprocstat(3) to retrieve process command line arguments and environment variables. MFC after: 1 month Modified: head/usr.bin/procstat/procstat.c head/usr.bin/procstat/procstat.h head/usr.bin/procstat/procstat_args.c Modified: head/usr.bin/procstat/procstat.c ============================================================================== --- head/usr.bin/procstat/procstat.c Sat Apr 20 08:07:04 2013 (r249679) +++ head/usr.bin/procstat/procstat.c Sat Apr 20 08:08:29 2013 (r249680) @@ -61,9 +61,9 @@ procstat(struct procstat *prstat, struct if (bflag) procstat_bin(prstat, kipp); else if (cflag) - procstat_args(kipp); + procstat_args(prstat, kipp); else if (eflag) - procstat_env(kipp); + procstat_env(prstat, kipp); else if (fflag) procstat_files(prstat, kipp); else if (iflag) Modified: head/usr.bin/procstat/procstat.h ============================================================================== --- head/usr.bin/procstat/procstat.h Sat Apr 20 08:07:04 2013 (r249679) +++ head/usr.bin/procstat/procstat.h Sat Apr 20 08:08:29 2013 (r249680) @@ -34,12 +34,12 @@ extern int hflag, nflag, Cflag; struct kinfo_proc; void kinfo_proc_sort(struct kinfo_proc *kipp, int count); -void procstat_args(struct kinfo_proc *kipp); +void procstat_args(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_auxv(struct kinfo_proc *kipp); void procstat_basic(struct kinfo_proc *kipp); void procstat_bin(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_cred(struct procstat *prstat, struct kinfo_proc *kipp); -void procstat_env(struct kinfo_proc *kipp); +void procstat_env(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_files(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_kstack(struct kinfo_proc *kipp, int kflag); void procstat_rlimit(struct procstat *prstat, struct kinfo_proc *kipp); Modified: head/usr.bin/procstat/procstat_args.c ============================================================================== --- head/usr.bin/procstat/procstat_args.c Sat Apr 20 08:07:04 2013 (r249679) +++ head/usr.bin/procstat/procstat_args.c Sat Apr 20 08:08:29 2013 (r249680) @@ -40,52 +40,40 @@ #include "procstat.h" -static char args[ARG_MAX]; - static void -do_args(struct kinfo_proc *kipp, int env) +do_args(struct procstat *procstat, struct kinfo_proc *kipp, int env) { - int error, name[4]; - size_t len; - char *cp; + int i; + char **args; - if (!hflag) + if (!hflag) { printf("%5s %-16s %-53s\n", "PID", "COMM", env ? "ENVIRONMENT" : "ARGS"); - - name[0] = CTL_KERN; - name[1] = KERN_PROC; - name[2] = env ? KERN_PROC_ENV : KERN_PROC_ARGS; - name[3] = kipp->ki_pid; - len = sizeof(args); - error = sysctl(name, 4, args, &len, NULL, 0); - if (error < 0 && errno != ESRCH && errno != EPERM) { - warn("sysctl: kern.proc.%s: %d: %d", env ? "env" : "args", - kipp->ki_pid, errno); - return; } - if (error < 0) + + args = env ? procstat_getenvv(procstat, kipp, 0) : + procstat_getargv(procstat, kipp, 0); + + printf("%5d %-16s", kipp->ki_pid, kipp->ki_comm); + + if (args == NULL) { + printf(" -\n"); return; - if (len == 0 || strlen(args) == 0) { - strcpy(args, "-"); - len = strlen(args) + 1; } - printf("%5d ", kipp->ki_pid); - printf("%-16s ", kipp->ki_comm); - for (cp = args; cp < args + len; cp += strlen(cp) + 1) - printf("%s%s", cp != args ? " " : "", cp); + for (i = 0; args[i] != NULL; i++) + printf(" %s", args[i]); printf("\n"); } void -procstat_args(struct kinfo_proc *kipp) +procstat_args(struct procstat *procstat, struct kinfo_proc *kipp) { - do_args(kipp, 0); + do_args(procstat, kipp, 0); } void -procstat_env(struct kinfo_proc *kipp) +procstat_env(struct procstat *procstat, struct kinfo_proc *kipp) { - do_args(kipp, 1); + do_args(procstat, kipp, 1); } From owner-svn-src-all@FreeBSD.ORG Sat Apr 20 08:10:48 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A8D0F33C; Sat, 20 Apr 2013 08:10:48 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9B9931259; Sat, 20 Apr 2013 08:10:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3K8Am3L014394; Sat, 20 Apr 2013 08:10:48 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3K8Alom014369; Sat, 20 Apr 2013 08:10:47 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201304200810.r3K8Alom014369@svn.freebsd.org> From: Mikolaj Golub Date: Sat, 20 Apr 2013 08:10:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249681 - head/lib/libprocstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Apr 2013 08:10:48 -0000 Author: trociny Date: Sat Apr 20 08:10:47 2013 New Revision: 249681 URL: http://svnweb.freebsd.org/changeset/base/249681 Log: Add procstat_getauxv function to retrieve a process auxiliary vector. MFC after: 1 month Modified: head/lib/libprocstat/Symbol.map head/lib/libprocstat/core.c head/lib/libprocstat/core.h head/lib/libprocstat/libprocstat.3 head/lib/libprocstat/libprocstat.c head/lib/libprocstat/libprocstat.h Modified: head/lib/libprocstat/Symbol.map ============================================================================== --- head/lib/libprocstat/Symbol.map Sat Apr 20 08:08:29 2013 (r249680) +++ head/lib/libprocstat/Symbol.map Sat Apr 20 08:10:47 2013 (r249681) @@ -17,11 +17,13 @@ FBSD_1.2 { FBSD_1.3 { procstat_freeargv; + procstat_freeauxv; procstat_freeenvv; procstat_freegroups; procstat_freevmmap; procstat_get_shm_info; procstat_getargv; + procstat_getauxv; procstat_getenvv; procstat_getgroups; procstat_getosrel; Modified: head/lib/libprocstat/core.c ============================================================================== --- head/lib/libprocstat/core.c Sat Apr 20 08:08:29 2013 (r249680) +++ head/lib/libprocstat/core.c Sat Apr 20 08:10:47 2013 (r249681) @@ -195,6 +195,10 @@ procstat_core_get(struct procstat_core * n_type = NT_PROCSTAT_PSSTRINGS; structsize = sizeof(vm_offset_t); break; + case PSC_TYPE_AUXV: + n_type = NT_PROCSTAT_AUXV; + structsize = sizeof(Elf_Auxinfo); + break; default: warnx("unknown core stat type: %d", type); return (NULL); Modified: head/lib/libprocstat/core.h ============================================================================== --- head/lib/libprocstat/core.h Sat Apr 20 08:08:29 2013 (r249680) +++ head/lib/libprocstat/core.h Sat Apr 20 08:10:47 2013 (r249681) @@ -40,6 +40,7 @@ enum psc_type { PSC_TYPE_PSSTRINGS, PSC_TYPE_ARGV, PSC_TYPE_ENVV, + PSC_TYPE_AUXV, }; struct procstat_core; Modified: head/lib/libprocstat/libprocstat.3 ============================================================================== --- head/lib/libprocstat/libprocstat.3 Sat Apr 20 08:08:29 2013 (r249680) +++ head/lib/libprocstat/libprocstat.3 Sat Apr 20 08:10:47 2013 (r249681) @@ -33,6 +33,7 @@ .Nm procstat_open_sysctl , .Nm procstat_close , .Nm procstat_getargv , +.Nm procstat_getauxv , .Nm procstat_getenvv , .Nm procstat_getfiles , .Nm procstat_getgroups , @@ -42,6 +43,7 @@ .Nm procstat_getumask , .Nm procstat_getvmmap , .Nm procstat_freeargv , +.Nm procstat_freeauxv , .Nm procstat_freeenvv , .Nm procstat_freefiles , .Nm procstat_freegroups , @@ -67,6 +69,11 @@ .Fa "struct procstat *procstat" .Fc .Ft void +.Fo procstat_freeauxv +.Fa "struct procstat *procstat" +.Fa "Elf_Auxinfo *auxv" +.Fc +.Ft void .Fo procstat_freeenvv .Fa "struct procstat *procstat" .Fc @@ -129,6 +136,12 @@ .Fa "size_t nchr" .Fa "char *errbuf" .Fc +.Ft "Elf_Auxinfo *" +.Fo procstat_getauxv +.Fa "struct procstat *procstat" +.Fa "struct kinfo_proc *kp" +.Fa "unsigned int *count" +.Fc .Ft "char **" .Fo procstat_getenvv .Fa "struct procstat *procstat" @@ -321,6 +334,19 @@ The caller may free the allocated memory function call. .Pp The +.Fn procstat_getauxv +function gets a pointer to the +.Vt procstat +structure, a pointer to +.Vt kinfo_proc +structure, and returns the auxiliary vector as a dynamically allocated array of +.Vt Elf_Auxinfo +elements. +The caller is responsible to free the allocated memory with a subsequent +.Fn procstat_freeauxv +function call. +.Pp +The .Fn procstat_getfiles function gets a pointer to the .Vt procstat Modified: head/lib/libprocstat/libprocstat.c ============================================================================== --- head/lib/libprocstat/libprocstat.c Sat Apr 20 08:08:29 2013 (r249680) +++ head/lib/libprocstat/libprocstat.c Sat Apr 20 08:10:47 2013 (r249681) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -110,6 +111,9 @@ static char **getargv(struct procstat *p static char *getmnton(kvm_t *kd, struct mount *m); static struct kinfo_vmentry * kinfo_getvmmap_core(struct procstat_core *core, int *cntp); +static Elf_Auxinfo *procstat_getauxv_core(struct procstat_core *core, + unsigned int *cntp); +static Elf_Auxinfo *procstat_getauxv_sysctl(pid_t pid, unsigned int *cntp); static struct filestat_list *procstat_getfiles_kvm( struct procstat *procstat, struct kinfo_proc *kp, int mmapped); static struct filestat_list *procstat_getfiles_sysctl( @@ -2075,3 +2079,151 @@ procstat_getosrel(struct procstat *procs return (-1); } } + +#define PROC_AUXV_MAX 256 + +#if __ELF_WORD_SIZE == 64 +static const char *elf32_sv_names[] = { + "Linux ELF32", + "FreeBSD ELF32", +}; + +static int +is_elf32_sysctl(pid_t pid) +{ + int error, name[4]; + size_t len, i; + static char sv_name[256]; + + name[0] = CTL_KERN; + name[1] = KERN_PROC; + name[2] = KERN_PROC_SV_NAME; + name[3] = pid; + len = sizeof(sv_name); + error = sysctl(name, 4, sv_name, &len, NULL, 0); + if (error != 0 || len == 0) + return (0); + for (i = 0; i < sizeof(elf32_sv_names) / sizeof(*elf32_sv_names); i++) { + if (strncmp(sv_name, elf32_sv_names[i], sizeof(sv_name)) == 0) + return (1); + } + return (0); +} + +static Elf_Auxinfo * +procstat_getauxv32_sysctl(pid_t pid, unsigned int *cntp) +{ + Elf_Auxinfo *auxv; + Elf32_Auxinfo *auxv32; + void *ptr; + size_t len; + unsigned int i, count; + int name[4]; + + name[0] = CTL_KERN; + name[1] = KERN_PROC; + name[2] = KERN_PROC_AUXV; + name[3] = pid; + len = PROC_AUXV_MAX * sizeof(Elf32_Auxinfo); + auxv = NULL; + auxv32 = malloc(len); + if (auxv32 == NULL) { + warn("malloc(%zu)", len); + goto out; + } + if (sysctl(name, 4, auxv32, &len, NULL, 0) == -1) { + if (errno != ESRCH && errno != EPERM) + warn("sysctl: kern.proc.auxv: %d: %d", pid, errno); + goto out; + } + count = len / sizeof(Elf_Auxinfo); + auxv = malloc(count * sizeof(Elf_Auxinfo)); + if (auxv == NULL) { + warn("malloc(%zu)", count * sizeof(Elf_Auxinfo)); + goto out; + } + for (i = 0; i < count; i++) { + /* + * XXX: We expect that values for a_type on a 32-bit platform + * are directly mapped to values on 64-bit one, which is not + * necessarily true. + */ + auxv[i].a_type = auxv32[i].a_type; + ptr = &auxv32[i].a_un; + auxv[i].a_un.a_val = *((uint32_t *)ptr); + } + *cntp = count; +out: + free(auxv32); + return (auxv); +} +#endif /* __ELF_WORD_SIZE == 64 */ + +static Elf_Auxinfo * +procstat_getauxv_sysctl(pid_t pid, unsigned int *cntp) +{ + Elf_Auxinfo *auxv; + int name[4]; + size_t len; + +#if __ELF_WORD_SIZE == 64 + if (is_elf32_sysctl(pid)) + return (procstat_getauxv32_sysctl(pid, cntp)); +#endif + name[0] = CTL_KERN; + name[1] = KERN_PROC; + name[2] = KERN_PROC_AUXV; + name[3] = pid; + len = PROC_AUXV_MAX * sizeof(Elf_Auxinfo); + auxv = malloc(len); + if (auxv == NULL) { + warn("malloc(%zu)", len); + return (NULL); + } + if (sysctl(name, 4, auxv, &len, NULL, 0) == -1) { + if (errno != ESRCH && errno != EPERM) + warn("sysctl: kern.proc.auxv: %d: %d", pid, errno); + free(auxv); + return (NULL); + } + *cntp = len / sizeof(Elf_Auxinfo); + return (auxv); +} + +static Elf_Auxinfo * +procstat_getauxv_core(struct procstat_core *core, unsigned int *cntp) +{ + Elf_Auxinfo *auxv; + size_t len; + + auxv = procstat_core_get(core, PSC_TYPE_AUXV, NULL, &len); + if (auxv == NULL) + return (NULL); + *cntp = len / sizeof(Elf_Auxinfo); + return (auxv); +} + +Elf_Auxinfo * +procstat_getauxv(struct procstat *procstat, struct kinfo_proc *kp, + unsigned int *cntp) +{ + switch(procstat->type) { + case PROCSTAT_KVM: + warnx("kvm method is not supported"); + return (NULL); + case PROCSTAT_SYSCTL: + return (procstat_getauxv_sysctl(kp->ki_pid, cntp)); + case PROCSTAT_CORE: + return (procstat_getauxv_core(procstat->core, cntp)); + default: + warnx("unknown access method: %d", procstat->type); + return (NULL); + } +} + +void +procstat_freeauxv(struct procstat *procstat __unused, Elf_Auxinfo *auxv) +{ + + free(auxv); +} Modified: head/lib/libprocstat/libprocstat.h ============================================================================== --- head/lib/libprocstat/libprocstat.h Sat Apr 20 08:08:29 2013 (r249680) +++ head/lib/libprocstat/libprocstat.h Sat Apr 20 08:10:47 2013 (r249681) @@ -30,6 +30,14 @@ #define _LIBPROCSTAT_H_ /* + * XXX: sys/elf.h conflicts with zfs_context.h. Workaround this by not + * including conflicting parts when building zfs code. + */ +#ifndef ZFS +#include +#endif + +/* * Vnode types. */ #define PS_FST_VTYPE_VNON 1 @@ -148,6 +156,9 @@ STAILQ_HEAD(filestat_list, filestat); __BEGIN_DECLS void procstat_close(struct procstat *procstat); void procstat_freeargv(struct procstat *procstat); +#ifndef ZFS +void procstat_freeauxv(struct procstat *procstat, Elf_Auxinfo *auxv); +#endif void procstat_freeenvv(struct procstat *procstat); void procstat_freegroups(struct procstat *procstat, gid_t *groups); void procstat_freeprocs(struct procstat *procstat, struct kinfo_proc *p); @@ -171,6 +182,10 @@ int procstat_get_vnode_info(struct procs struct vnstat *vn, char *errbuf); char **procstat_getargv(struct procstat *procstat, struct kinfo_proc *p, size_t nchr); +#ifndef ZFS +Elf_Auxinfo *procstat_getauxv(struct procstat *procstat, + struct kinfo_proc *kp, unsigned int *cntp); +#endif char **procstat_getenvv(struct procstat *procstat, struct kinfo_proc *p, size_t nchr); gid_t *procstat_getgroups(struct procstat *procstat, struct kinfo_proc *kp, From owner-svn-src-all@FreeBSD.ORG Sat Apr 20 08:13:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5C7844F0; Sat, 20 Apr 2013 08:13:36 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4DB281279; Sat, 20 Apr 2013 08:13:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3K8Damf017320; Sat, 20 Apr 2013 08:13:36 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3K8DaUT017318; Sat, 20 Apr 2013 08:13:36 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201304200813.r3K8DaUT017318@svn.freebsd.org> From: Mikolaj Golub Date: Sat, 20 Apr 2013 08:13:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249682 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Apr 2013 08:13:36 -0000 Author: trociny Date: Sat Apr 20 08:13:35 2013 New Revision: 249682 URL: http://svnweb.freebsd.org/changeset/base/249682 Log: This should have been committed in r249666. MFC after: 1 month Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sat Apr 20 08:10:47 2013 (r249681) +++ head/Makefile.inc1 Sat Apr 20 08:13:35 2013 (r249682) @@ -1382,7 +1382,7 @@ _prebuild_libs= ${_kerberos5_lib_libasn1 ${_kerberos5_lib_libwind} \ ${_lib_atf_libatf_c} \ lib/libbz2 ${_libcom_err} lib/libcrypt \ - lib/libexpat \ + lib/libelf lib/libexpat \ ${_lib_libgssapi} ${_lib_libipx} \ lib/libkiconv lib/libkvm lib/liblzma lib/libmd \ lib/ncurses/ncurses lib/ncurses/ncursesw \ From owner-svn-src-all@FreeBSD.ORG Sat Apr 20 08:15:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3465667C; Sat, 20 Apr 2013 08:15:44 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 16C391289; Sat, 20 Apr 2013 08:15:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3K8FhUV019583; Sat, 20 Apr 2013 08:15:43 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3K8Fhja019574; Sat, 20 Apr 2013 08:15:43 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201304200815.r3K8Fhja019574@svn.freebsd.org> From: Mikolaj Golub Date: Sat, 20 Apr 2013 08:15:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249683 - head/usr.bin/procstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Apr 2013 08:15:44 -0000 Author: trociny Date: Sat Apr 20 08:15:43 2013 New Revision: 249683 URL: http://svnweb.freebsd.org/changeset/base/249683 Log: Use libprocstat(3) to retrieve ELF auxiliary vector. MFC after: 1 month Modified: head/usr.bin/procstat/procstat.c head/usr.bin/procstat/procstat.h head/usr.bin/procstat/procstat_auxv.c Modified: head/usr.bin/procstat/procstat.c ============================================================================== --- head/usr.bin/procstat/procstat.c Sat Apr 20 08:13:35 2013 (r249682) +++ head/usr.bin/procstat/procstat.c Sat Apr 20 08:15:43 2013 (r249683) @@ -81,7 +81,7 @@ procstat(struct procstat *prstat, struct else if (vflag) procstat_vm(prstat, kipp); else if (xflag) - procstat_auxv(kipp); + procstat_auxv(prstat, kipp); else procstat_basic(kipp); } Modified: head/usr.bin/procstat/procstat.h ============================================================================== --- head/usr.bin/procstat/procstat.h Sat Apr 20 08:13:35 2013 (r249682) +++ head/usr.bin/procstat/procstat.h Sat Apr 20 08:15:43 2013 (r249683) @@ -35,7 +35,7 @@ struct kinfo_proc; void kinfo_proc_sort(struct kinfo_proc *kipp, int count); void procstat_args(struct procstat *prstat, struct kinfo_proc *kipp); -void procstat_auxv(struct kinfo_proc *kipp); +void procstat_auxv(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_basic(struct kinfo_proc *kipp); void procstat_bin(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_cred(struct procstat *prstat, struct kinfo_proc *kipp); Modified: head/usr.bin/procstat/procstat_auxv.c ============================================================================== --- head/usr.bin/procstat/procstat_auxv.c Sat Apr 20 08:13:35 2013 (r249682) +++ head/usr.bin/procstat/procstat_auxv.c Sat Apr 20 08:15:43 2013 (r249683) @@ -43,113 +43,26 @@ #include "procstat.h" -#define PROC_AUXV_MAX 256 - -static Elf_Auxinfo auxv[PROC_AUXV_MAX]; -static char prefix[256]; - -#if __ELF_WORD_SIZE == 64 -static Elf32_Auxinfo auxv32[PROC_AUXV_MAX]; - -static const char *elf32_sv_names[] = { - "Linux ELF32", - "FreeBSD ELF32", -}; - -static int -is_elf32(pid_t pid) -{ - int error, name[4]; - size_t len, i; - static char sv_name[256]; - - name[0] = CTL_KERN; - name[1] = KERN_PROC; - name[2] = KERN_PROC_SV_NAME; - name[3] = pid; - len = sizeof(sv_name); - error = sysctl(name, 4, sv_name, &len, NULL, 0); - if (error != 0 || len == 0) - return (0); - for (i = 0; i < sizeof(elf32_sv_names) / sizeof(*elf32_sv_names); i++) { - if (strncmp(sv_name, elf32_sv_names[i], sizeof(sv_name)) == 0) - return (1); - } - return (0); -} - -static size_t -retrieve_auxv32(pid_t pid) -{ - int name[4]; - size_t len, i; - void *ptr; - - name[0] = CTL_KERN; - name[1] = KERN_PROC; - name[2] = KERN_PROC_AUXV; - name[3] = pid; - len = sizeof(auxv32); - if (sysctl(name, 4, auxv32, &len, NULL, 0) == -1) { - if (errno != ESRCH && errno != EPERM) - warn("sysctl: kern.proc.auxv: %d: %d", pid, errno); - return (0); - } - for (i = 0; i < len; i++) { - /* - * XXX: We expect that values for a_type on a 32-bit platform - * are directly mapped to those on 64-bit one, which is not - * necessarily true. - */ - auxv[i].a_type = auxv32[i].a_type; - ptr = &auxv32[i].a_un; - auxv[i].a_un.a_val = *((uint32_t *)ptr); - } - return (len); -} -#endif /* __ELF_WORD_SIZE == 64 */ - #define PRINT(name, spec, val) \ printf("%s %-16s " #spec "\n", prefix, #name, (val)) #define PRINT_UNKNOWN(type, val) \ printf("%s %16ld %#lx\n", prefix, (long)type, (u_long)(val)) -static size_t -retrieve_auxv(pid_t pid) -{ - int name[4]; - size_t len; - -#if __ELF_WORD_SIZE == 64 - if (is_elf32(pid)) - return (retrieve_auxv32(pid)); -#endif - name[0] = CTL_KERN; - name[1] = KERN_PROC; - name[2] = KERN_PROC_AUXV; - name[3] = pid; - len = sizeof(auxv); - if (sysctl(name, 4, auxv, &len, NULL, 0) == -1) { - if (errno != ESRCH && errno != EPERM) - warn("sysctl: kern.proc.auxv: %d: %d", pid, errno); - return (0); - } - return (len); -} - void -procstat_auxv(struct kinfo_proc *kipp) +procstat_auxv(struct procstat *procstat, struct kinfo_proc *kipp) { - size_t len, i; + Elf_Auxinfo *auxv; + u_int count, i; + static char prefix[256]; if (!hflag) printf("%5s %-16s %-16s %-16s\n", "PID", "COMM", "AUXV", "VALUE"); - len = retrieve_auxv(kipp->ki_pid); - if (len == 0) + auxv = procstat_getauxv(procstat, kipp, &count); + if (auxv == NULL) return; snprintf(prefix, sizeof(prefix), "%5d %-16s", kipp->ki_pid, kipp->ki_comm); - for (i = 0; i < len; i++) { + for (i = 0; i < count; i++) { switch(auxv[i].a_type) { case AT_NULL: return; @@ -242,5 +155,6 @@ procstat_auxv(struct kinfo_proc *kipp) } } printf("\n"); + procstat_freeauxv(procstat, auxv); } From owner-svn-src-all@FreeBSD.ORG Sat Apr 20 08:17:21 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BC9AF7F8; Sat, 20 Apr 2013 08:17:21 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AEC151292; Sat, 20 Apr 2013 08:17:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3K8HL5h021057; Sat, 20 Apr 2013 08:17:21 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3K8HKWI021043; Sat, 20 Apr 2013 08:17:20 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201304200817.r3K8HKWI021043@svn.freebsd.org> From: Mikolaj Golub Date: Sat, 20 Apr 2013 08:17:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249684 - head/lib/libprocstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Apr 2013 08:17:21 -0000 Author: trociny Date: Sat Apr 20 08:17:20 2013 New Revision: 249684 URL: http://svnweb.freebsd.org/changeset/base/249684 Log: Add procstat_getkstack function to dump kernel stacks of a process. MFC after: 1 month Modified: head/lib/libprocstat/Symbol.map head/lib/libprocstat/libprocstat.3 head/lib/libprocstat/libprocstat.c head/lib/libprocstat/libprocstat.h Modified: head/lib/libprocstat/Symbol.map ============================================================================== --- head/lib/libprocstat/Symbol.map Sat Apr 20 08:15:43 2013 (r249683) +++ head/lib/libprocstat/Symbol.map Sat Apr 20 08:17:20 2013 (r249684) @@ -20,12 +20,14 @@ FBSD_1.3 { procstat_freeauxv; procstat_freeenvv; procstat_freegroups; + procstat_freekstack; procstat_freevmmap; procstat_get_shm_info; procstat_getargv; procstat_getauxv; procstat_getenvv; procstat_getgroups; + procstat_getkstack; procstat_getosrel; procstat_getpathname; procstat_getrlimit; Modified: head/lib/libprocstat/libprocstat.3 ============================================================================== --- head/lib/libprocstat/libprocstat.3 Sat Apr 20 08:15:43 2013 (r249683) +++ head/lib/libprocstat/libprocstat.3 Sat Apr 20 08:17:20 2013 (r249684) @@ -37,6 +37,7 @@ .Nm procstat_getenvv , .Nm procstat_getfiles , .Nm procstat_getgroups , +.Nm procstat_getkstack , .Nm procstat_getosrel , .Nm procstat_getpathname , .Nm procstat_getprocs , @@ -47,6 +48,7 @@ .Nm procstat_freeenvv , .Nm procstat_freefiles , .Nm procstat_freegroups , +.Nm procstat_freekstack , .Nm procstat_freeprocs , .Nm procstat_freevmmap , .Nm procstat_get_pipe_info , @@ -88,6 +90,11 @@ .Fa "gid_t *groups" .Fc .Ft void +.Fo procstat_freekstack +.Fa "struct procstat *procstat" +.Fa "struct kinfo_kstack *kkstp" +.Fc +.Ft void .Fn procstat_freeprocs "struct procstat *procstat" "struct kinfo_proc *p" .Ft void .Fo procstat_freevmmap @@ -166,6 +173,12 @@ .Fa "struct kinfo_proc *kp" .Fa "int *osrelp" .Fc +.Ft "struct kinfo_kstack *" +.Fo procstat_getkstack +.Fa "struct procstat *procstat" +.Fa "struct kinfo_proc *kp" +.Fa "unsigned int *count" +.Fc .Ft "struct kinfo_proc *" .Fo procstat_getprocs .Fa "struct procstat *procstat" @@ -378,6 +391,22 @@ The caller is responsible to free the al function call. .Pp The +.Fn procstat_getkstack +function gets a pointer to the +.Vt procstat +structure initialized with one of the +.Fn procstat_open_* +functions, a pointer to +.Vt kinfo_proc +structure, and returns kernel stacks of the process as a dynamically allocated +array of +.Vt kinfo_kstack +structures. +The caller is responsible to free the allocated memory with a subsequent +.Fn procstat_freekstack +function call. +.Pp +The .Fn procstat_getosrel function gets a pointer to the .Vt procstat Modified: head/lib/libprocstat/libprocstat.c ============================================================================== --- head/lib/libprocstat/libprocstat.c Sat Apr 20 08:15:43 2013 (r249683) +++ head/lib/libprocstat/libprocstat.c Sat Apr 20 08:17:20 2013 (r249684) @@ -142,6 +142,8 @@ static int procstat_get_vnode_info_sysct static gid_t *procstat_getgroups_core(struct procstat_core *core, unsigned int *count); static gid_t *procstat_getgroups_sysctl(pid_t pid, unsigned int *count); +static struct kinfo_kstack *procstat_getkstack_sysctl(pid_t pid, + int *cntp); static int procstat_getpathname_core(struct procstat_core *core, char *pathname, size_t maxlen); static int procstat_getpathname_sysctl(pid_t pid, char *pathname, @@ -1764,6 +1766,7 @@ struct kinfo_vmentry * procstat_getvmmap(struct procstat *procstat, struct kinfo_proc *kp, unsigned int *cntp) { + switch(procstat->type) { case PROCSTAT_KVM: warnx("kvm method is not supported"); @@ -2227,3 +2230,70 @@ procstat_freeauxv(struct procstat *procs free(auxv); } + +static struct kinfo_kstack * +procstat_getkstack_sysctl(pid_t pid, int *cntp) +{ + struct kinfo_kstack *kkstp; + int error, name[4]; + size_t len; + + name[0] = CTL_KERN; + name[1] = KERN_PROC; + name[2] = KERN_PROC_KSTACK; + name[3] = pid; + + len = 0; + error = sysctl(name, 4, NULL, &len, NULL, 0); + if (error < 0 && errno != ESRCH && errno != EPERM && errno != ENOENT) { + warn("sysctl: kern.proc.kstack: %d", pid); + return (NULL); + } + if (error == -1 && errno == ENOENT) { + warnx("sysctl: kern.proc.kstack unavailable" + " (options DDB or options STACK required in kernel)"); + return (NULL); + } + if (error == -1) + return (NULL); + kkstp = malloc(len); + if (kkstp == NULL) { + warn("malloc(%zu)", len); + return (NULL); + } + if (sysctl(name, 4, kkstp, &len, NULL, 0) == -1) { + warn("sysctl: kern.proc.pid: %d", pid); + free(kkstp); + return (NULL); + } + *cntp = len / sizeof(*kkstp); + + return (kkstp); +} + +struct kinfo_kstack * +procstat_getkstack(struct procstat *procstat, struct kinfo_proc *kp, + unsigned int *cntp) +{ + switch(procstat->type) { + case PROCSTAT_KVM: + warnx("kvm method is not supported"); + return (NULL); + case PROCSTAT_SYSCTL: + return (procstat_getkstack_sysctl(kp->ki_pid, cntp)); + case PROCSTAT_CORE: + warnx("core method is not supported"); + return (NULL); + default: + warnx("unknown access method: %d", procstat->type); + return (NULL); + } +} + +void +procstat_freekstack(struct procstat *procstat __unused, + struct kinfo_kstack *kkstp) +{ + + free(kkstp); +} Modified: head/lib/libprocstat/libprocstat.h ============================================================================== --- head/lib/libprocstat/libprocstat.h Sat Apr 20 08:15:43 2013 (r249683) +++ head/lib/libprocstat/libprocstat.h Sat Apr 20 08:17:20 2013 (r249684) @@ -97,6 +97,7 @@ #define PS_FST_FFLAG_EXEC 0x2000 #define PS_FST_FFLAG_HASLOCK 0x4000 +struct kinfo_kstack; struct kinfo_vmentry; struct procstat; struct rlimit; @@ -161,6 +162,8 @@ void procstat_freeauxv(struct procstat * #endif void procstat_freeenvv(struct procstat *procstat); void procstat_freegroups(struct procstat *procstat, gid_t *groups); +void procstat_freekstack(struct procstat *procstat, + struct kinfo_kstack *kkstp); void procstat_freeprocs(struct procstat *procstat, struct kinfo_proc *p); void procstat_freefiles(struct procstat *procstat, struct filestat_list *head); @@ -190,6 +193,8 @@ char **procstat_getenvv(struct procstat size_t nchr); gid_t *procstat_getgroups(struct procstat *procstat, struct kinfo_proc *kp, unsigned int *count); +struct kinfo_kstack *procstat_getkstack(struct procstat *procstat, + struct kinfo_proc *kp, unsigned int *count); int procstat_getosrel(struct procstat *procstat, struct kinfo_proc *kp, int *osrelp); int procstat_getpathname(struct procstat *procstat, struct kinfo_proc *kp, From owner-svn-src-all@FreeBSD.ORG Sat Apr 20 08:19:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 79B26979; Sat, 20 Apr 2013 08:19:07 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5CB05129D; Sat, 20 Apr 2013 08:19:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3K8J71r022803; Sat, 20 Apr 2013 08:19:07 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3K8J67M022794; Sat, 20 Apr 2013 08:19:06 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201304200819.r3K8J67M022794@svn.freebsd.org> From: Mikolaj Golub Date: Sat, 20 Apr 2013 08:19:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249685 - head/usr.bin/procstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Apr 2013 08:19:07 -0000 Author: trociny Date: Sat Apr 20 08:19:06 2013 New Revision: 249685 URL: http://svnweb.freebsd.org/changeset/base/249685 Log: Use procstat_getkstack(3) for retrieving process kernel stacks instead of direct sysctl calls. MFC after: 1 month Modified: head/usr.bin/procstat/procstat.c head/usr.bin/procstat/procstat.h head/usr.bin/procstat/procstat_kstack.c Modified: head/usr.bin/procstat/procstat.c ============================================================================== --- head/usr.bin/procstat/procstat.c Sat Apr 20 08:17:20 2013 (r249684) +++ head/usr.bin/procstat/procstat.c Sat Apr 20 08:19:06 2013 (r249685) @@ -71,7 +71,7 @@ procstat(struct procstat *prstat, struct else if (jflag) procstat_threads_sigs(prstat, kipp); else if (kflag) - procstat_kstack(kipp, kflag); + procstat_kstack(prstat, kipp, kflag); else if (lflag) procstat_rlimit(prstat, kipp); else if (sflag) Modified: head/usr.bin/procstat/procstat.h ============================================================================== --- head/usr.bin/procstat/procstat.h Sat Apr 20 08:17:20 2013 (r249684) +++ head/usr.bin/procstat/procstat.h Sat Apr 20 08:19:06 2013 (r249685) @@ -41,7 +41,8 @@ void procstat_bin(struct procstat *prsta void procstat_cred(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_env(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_files(struct procstat *prstat, struct kinfo_proc *kipp); -void procstat_kstack(struct kinfo_proc *kipp, int kflag); +void procstat_kstack(struct procstat *prstat, struct kinfo_proc *kipp, + int kflag); void procstat_rlimit(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_sigs(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_threads(struct procstat *prstat, struct kinfo_proc *kipp); Modified: head/usr.bin/procstat/procstat_kstack.c ============================================================================== --- head/usr.bin/procstat/procstat_kstack.c Sat Apr 20 08:17:20 2013 (r249684) +++ head/usr.bin/procstat/procstat_kstack.c Sat Apr 20 08:19:06 2013 (r249685) @@ -125,76 +125,35 @@ kinfo_kstack_sort(struct kinfo_kstack *k void -procstat_kstack(struct kinfo_proc *kipp, int kflag) +procstat_kstack(struct procstat *procstat, struct kinfo_proc *kipp, int kflag) { struct kinfo_kstack *kkstp, *kkstp_free; struct kinfo_proc *kip, *kip_free; char trace[KKST_MAXLEN]; - int error, name[4]; unsigned int i, j; - size_t kip_len, kstk_len; + unsigned int kip_count, kstk_count; if (!hflag) printf("%5s %6s %-16s %-16s %-29s\n", "PID", "TID", "COMM", "TDNAME", "KSTACK"); - name[0] = CTL_KERN; - name[1] = KERN_PROC; - name[2] = KERN_PROC_KSTACK; - name[3] = kipp->ki_pid; - - kstk_len = 0; - error = sysctl(name, 4, NULL, &kstk_len, NULL, 0); - if (error < 0 && errno != ESRCH && errno != EPERM && errno != ENOENT) { - warn("sysctl: kern.proc.kstack: %d", kipp->ki_pid); - return; - } - if (error < 0 && errno == ENOENT) { - warnx("sysctl: kern.proc.kstack unavailable"); - errx(-1, "options DDB or options STACK required in kernel"); - } - if (error < 0) - return; - - kkstp = kkstp_free = malloc(kstk_len); + kkstp = kkstp_free = procstat_getkstack(procstat, kipp, &kstk_count); if (kkstp == NULL) - err(-1, "malloc"); - - if (sysctl(name, 4, kkstp, &kstk_len, NULL, 0) < 0) { - warn("sysctl: kern.proc.pid: %d", kipp->ki_pid); - free(kkstp); return; - } /* * We need to re-query for thread information, so don't use *kipp. */ - name[0] = CTL_KERN; - name[1] = KERN_PROC; - name[2] = KERN_PROC_PID | KERN_PROC_INC_THREAD; - name[3] = kipp->ki_pid; - - kip_len = 0; - error = sysctl(name, 4, NULL, &kip_len, NULL, 0); - if (error < 0 && errno != ESRCH) { - warn("sysctl: kern.proc.pid: %d", kipp->ki_pid); - return; - } - if (error < 0) - return; + kip = kip_free = procstat_getprocs(procstat, + KERN_PROC_PID | KERN_PROC_INC_THREAD, kipp->ki_pid, &kip_count); - kip = kip_free = malloc(kip_len); - if (kip == NULL) - err(-1, "malloc"); - - if (sysctl(name, 4, kip, &kip_len, NULL, 0) < 0) { - warn("sysctl: kern.proc.pid: %d", kipp->ki_pid); - free(kip); + if (kip == NULL) { + procstat_freekstack(procstat, kkstp_free); return; } - kinfo_kstack_sort(kkstp, kstk_len / sizeof(*kkstp)); - for (i = 0; i < kstk_len / sizeof(*kkstp); i++) { + kinfo_kstack_sort(kkstp, kstk_count); + for (i = 0; i < kstk_count; i++) { kkstp = &kkstp_free[i]; /* @@ -202,7 +161,7 @@ procstat_kstack(struct kinfo_proc *kipp, * display the per-thread command line. */ kipp = NULL; - for (j = 0; j < kip_len / sizeof(*kipp); j++) { + for (j = 0; j < kip_count; j++) { kipp = &kip_free[j]; if (kkstp->kkst_tid == kipp->ki_tid) break; @@ -242,6 +201,6 @@ procstat_kstack(struct kinfo_proc *kipp, kstack_cleanup(kkstp->kkst_trace, trace, kflag); printf("%-29s\n", trace); } - free(kip_free); - free(kkstp_free); + procstat_freekstack(procstat, kkstp_free); + procstat_freeprocs(procstat, kip_free); } From owner-svn-src-all@FreeBSD.ORG Sat Apr 20 08:22:10 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BD153B8D; Sat, 20 Apr 2013 08:22:10 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AE9FE12BC; Sat, 20 Apr 2013 08:22:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3K8MAvn027605; Sat, 20 Apr 2013 08:22:10 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3K8MAf6027601; Sat, 20 Apr 2013 08:22:10 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201304200822.r3K8MAf6027601@svn.freebsd.org> From: Mikolaj Golub Date: Sat, 20 Apr 2013 08:22:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249686 - head/usr.bin/procstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Apr 2013 08:22:10 -0000 Author: trociny Date: Sat Apr 20 08:22:09 2013 New Revision: 249686 URL: http://svnweb.freebsd.org/changeset/base/249686 Log: Make use of newly added libprocstat(3) ability to extract procstat info from a process core file. So now one can run procstat(1) on a process core e.g. to get a list of files opened by a process when it crashed: root@lisa:/ # procstat -f /root/vi.core PID COMM FD T V FLAGS REF OFFSET PRO NAME 658 vi text v r r-------- - - - /usr/bin/vi 658 vi ctty v c rw------- - - - /dev/pts/0 658 vi cwd v d r-------- - - - /root 658 vi root v d r-------- - - - / 658 vi 0 v c rw------- 11 3208 - /dev/pts/0 658 vi 1 v c rw------- 11 3208 - /dev/pts/0 658 vi 2 v c rw------- 11 3208 - /dev/pts/0 658 vi 3 v r r----n-l- 1 0 - /tmp/vi.0AYKz3Lps7 658 vi 4 v r rw------- 1 0 - /var/tmp/vi.recover/vi.GaGYsz 658 vi 5 v r rw------- 1 0 - - PR: kern/173723 Suggested by: jhb MFC after: 1 month Modified: head/usr.bin/procstat/procstat.1 head/usr.bin/procstat/procstat.c Modified: head/usr.bin/procstat/procstat.1 ============================================================================== --- head/usr.bin/procstat/procstat.1 Sat Apr 20 08:19:06 2013 (r249685) +++ head/usr.bin/procstat/procstat.1 Sat Apr 20 08:22:09 2013 (r249686) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 11, 2012 +.Dd April 20, 2013 .Dt PROCSTAT 1 .Os .Sh NAME @@ -38,7 +38,7 @@ .Op Fl C .Op Fl w Ar interval .Op Fl b | c | e | f | i | j | k | l | s | t | v | x -.Op Fl a | Ar pid ... +.Op Fl a | Ar pid | Ar core ... .Sh DESCRIPTION The .Nm @@ -47,6 +47,8 @@ utility displays detailed information ab arguments, or if the .Fl a flag is used, all processes. +It can also display information extracted from a process core file, if +the core file is specified as the argument. .Pp By default, basic process statistics are printed; one of the following options may be specified in order to select more detailed process information Modified: head/usr.bin/procstat/procstat.c ============================================================================== --- head/usr.bin/procstat/procstat.c Sat Apr 20 08:19:06 2013 (r249685) +++ head/usr.bin/procstat/procstat.c Sat Apr 20 08:22:09 2013 (r249686) @@ -50,7 +50,7 @@ usage(void) fprintf(stderr, "usage: procstat [-h] [-C] [-M core] [-N system] " "[-w interval] \n"); fprintf(stderr, " [-b | -c | -e | -f | -i | -j | -k | " - "-l | -s | -t | -v | -x] [-a | pid ...]\n"); + "-l | -s | -t | -v | -x] [-a | pid | core ...]\n"); exit(EX_USAGE); } @@ -116,7 +116,7 @@ main(int argc, char *argv[]) int ch, interval, tmp; int i; struct kinfo_proc *p; - struct procstat *prstat; + struct procstat *prstat, *cprstat; long l; pid_t pid; char *dummy; @@ -255,19 +255,32 @@ main(int argc, char *argv[]) } for (i = 0; i < argc; i++) { l = strtol(argv[i], &dummy, 10); - if (*dummy != '\0') - usage(); - if (l < 0) - usage(); - pid = l; - - p = procstat_getprocs(prstat, KERN_PROC_PID, pid, &cnt); - if (p == NULL) - errx(1, "procstat_getprocs()"); - if (cnt != 0) - procstat(prstat, p); - procstat_freeprocs(prstat, p); - + if (*dummy == '\0') { + if (l < 0) + usage(); + pid = l; + + p = procstat_getprocs(prstat, KERN_PROC_PID, pid, &cnt); + if (p == NULL) + errx(1, "procstat_getprocs()"); + if (cnt != 0) + procstat(prstat, p); + procstat_freeprocs(prstat, p); + } else { + cprstat = procstat_open_core(argv[i]); + if (cprstat == NULL) { + warnx("procstat_open()"); + continue; + } + p = procstat_getprocs(cprstat, KERN_PROC_PID, + -1, &cnt); + if (p == NULL) + errx(1, "procstat_getprocs()"); + if (cnt != 0) + procstat(cprstat, p); + procstat_freeprocs(cprstat, p); + procstat_close(cprstat); + } /* Suppress header after first process. */ hflag = 1; } From owner-svn-src-all@FreeBSD.ORG Sat Apr 20 08:23:20 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 32013D00; Sat, 20 Apr 2013 08:23:20 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 245B312C2; Sat, 20 Apr 2013 08:23:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3K8NKsu028776; Sat, 20 Apr 2013 08:23:20 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3K8NJ27028770; Sat, 20 Apr 2013 08:23:19 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201304200823.r3K8NJ27028770@svn.freebsd.org> From: Mikolaj Golub Date: Sat, 20 Apr 2013 08:23:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249687 - head/usr.bin/gcore X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Apr 2013 08:23:20 -0000 Author: trociny Date: Sat Apr 20 08:23:19 2013 New Revision: 249687 URL: http://svnweb.freebsd.org/changeset/base/249687 Log: Sync gcore(1) with the recent changes in kernel code aimed at adding procstat notes to a process core file. Suggested by: jhb MFC after: 1 month Modified: head/usr.bin/gcore/Makefile head/usr.bin/gcore/elfcore.c Modified: head/usr.bin/gcore/Makefile ============================================================================== --- head/usr.bin/gcore/Makefile Sat Apr 20 08:22:09 2013 (r249686) +++ head/usr.bin/gcore/Makefile Sat Apr 20 08:23:19 2013 (r249687) @@ -4,7 +4,7 @@ PROG= gcore SRCS= elfcore.c gcore.c DPADD= ${LIBUTIL} -LDADD= -lutil +LDADD= -lsbuf -lutil WARNS?= 1 Modified: head/usr.bin/gcore/elfcore.c ============================================================================== --- head/usr.bin/gcore/elfcore.c Sat Apr 20 08:22:09 2013 (r249686) +++ head/usr.bin/gcore/elfcore.c Sat Apr 20 08:23:19 2013 (r249687) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -41,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -71,16 +73,33 @@ struct sseg_closure { size_t size; /* Total size of all writable segments. */ }; +typedef void* (*notefunc_t)(void *, size_t *); + static void cb_put_phdr(vm_map_entry_t, void *); static void cb_size_segment(vm_map_entry_t, void *); static void each_writable_segment(vm_map_entry_t, segment_callback, void *closure); static void elf_detach(void); /* atexit() handler. */ -static void elf_puthdr(pid_t, vm_map_entry_t, void *, size_t *, int numsegs); -static void elf_putnote(void *dst, size_t *off, const char *name, int type, - const void *desc, size_t descsz); +static void *elf_note_fpregset(void *, size_t *); +static void *elf_note_prpsinfo(void *, size_t *); +static void *elf_note_prstatus(void *, size_t *); +static void *elf_note_thrmisc(void *, size_t *); +static void *elf_note_procstat_auxv(void *, size_t *); +static void *elf_note_procstat_files(void *, size_t *); +static void *elf_note_procstat_groups(void *, size_t *); +static void *elf_note_procstat_osrel(void *, size_t *); +static void *elf_note_procstat_proc(void *, size_t *); +static void *elf_note_procstat_psstrings(void *, size_t *); +static void *elf_note_procstat_rlimit(void *, size_t *); +static void *elf_note_procstat_umask(void *, size_t *); +static void *elf_note_procstat_vmmap(void *, size_t *); +static void elf_puthdr(pid_t, vm_map_entry_t, void *, size_t, size_t, size_t, + int); +static void elf_putnote(int, notefunc_t, void *, struct sbuf *); +static void elf_putnotes(pid_t, struct sbuf *, size_t *); static void freemap(vm_map_entry_t); static vm_map_entry_t readmap(pid_t); +static void *procstat_sysctl(void *, int, size_t, size_t *sizep); static pid_t g_pid; /* Pid being dumped, global for elf_detach */ @@ -114,8 +133,10 @@ elf_coredump(int efd __unused, int fd, p { vm_map_entry_t map; struct sseg_closure seginfo; + struct sbuf *sb; void *hdr; - size_t hdrsize; + size_t hdrsize, notesz, segoff; + ssize_t n, old_len; Elf_Phdr *php; int i; @@ -139,27 +160,32 @@ elf_coredump(int efd __unused, int fd, p each_writable_segment(map, cb_size_segment, &seginfo); /* - * Calculate the size of the core file header area by making - * a dry run of generating it. Nothing is written, but the - * size is calculated. + * Build the header and the notes using sbuf and write to the file. */ - hdrsize = 0; - elf_puthdr(pid, map, NULL, &hdrsize, seginfo.count); - - /* - * Allocate memory for building the header, fill it up, - * and write it out. - */ - if ((hdr = calloc(1, hdrsize)) == NULL) - errx(1, "out of memory"); - + sb = sbuf_new_auto(); + hdrsize = sizeof(Elf_Ehdr) + sizeof(Elf_Phdr) * (1 + seginfo.count); + /* Start header + notes section. */ + sbuf_start_section(sb, NULL); + /* Make empty header subsection. */ + sbuf_start_section(sb, &old_len); + sbuf_putc(sb, 0); + sbuf_end_section(sb, old_len, hdrsize, 0); + /* Put notes. */ + elf_putnotes(pid, sb, ¬esz); + /* Align up to a page boundary for the program segments. */ + sbuf_end_section(sb, -1, PAGE_SIZE, 0); + if (sbuf_finish(sb) != 0) + err(1, "sbuf_finish"); + hdr = sbuf_data(sb); + segoff = sbuf_len(sb); /* Fill in the header. */ - hdrsize = 0; - elf_puthdr(pid, map, hdr, &hdrsize, seginfo.count); + elf_puthdr(pid, map, hdr, hdrsize, notesz, segoff, seginfo.count); - /* Write it to the core file. */ - if (write(fd, hdr, hdrsize) == -1) + n = write(fd, hdr, segoff); + if (n == -1) err(1, "write"); + if (n < segoff) + errx(1, "short write"); /* Write the contents of all of the writable segments. */ php = (Elf_Phdr *)((char *)hdr + sizeof(Elf_Ehdr)) + 1; @@ -195,7 +221,7 @@ elf_coredump(int efd __unused, int fd, p } php++; } - free(hdr); + sbuf_delete(sb); freemap(map); } @@ -257,209 +283,136 @@ each_writable_segment(vm_map_entry_t map } static void -elf_getstatus(pid_t pid, prpsinfo_t *psinfo) -{ - struct kinfo_proc kobj; - int name[4]; - size_t len; - - name[0] = CTL_KERN; - name[1] = KERN_PROC; - name[2] = KERN_PROC_PID; - name[3] = pid; - - len = sizeof(kobj); - if (sysctl(name, 4, &kobj, &len, NULL, 0) == -1) - err(1, "error accessing kern.proc.pid.%u sysctl", pid); - if (kobj.ki_pid != pid) - err(1, "error accessing kern.proc.pid.%u sysctl datas", pid); - strncpy(psinfo->pr_fname, kobj.ki_comm, MAXCOMLEN); - strncpy(psinfo->pr_psargs, psinfo->pr_fname, PRARGSZ); -} - -/* - * Generate the ELF coredump header into the buffer at "dst". "dst" may - * be NULL, in which case the header is sized but not actually generated. - */ -static void -elf_puthdr(pid_t pid, vm_map_entry_t map, void *dst, size_t *off, int numsegs) +elf_putnotes(pid_t pid, struct sbuf *sb, size_t *sizep) { - struct ptrace_lwpinfo lwpinfo; - struct { - prstatus_t status; - prfpregset_t fpregset; - prpsinfo_t psinfo; - thrmisc_t thrmisc; - } *tempdata; - size_t ehoff; - size_t phoff; - size_t noteoff; - size_t notesz; - size_t threads; lwpid_t *tids; + size_t threads, old_len; + ssize_t size; int i; - prstatus_t *status; - prfpregset_t *fpregset; - prpsinfo_t *psinfo; - thrmisc_t *thrmisc; - - ehoff = *off; - *off += sizeof(Elf_Ehdr); - - phoff = *off; - *off += (numsegs + 1) * sizeof(Elf_Phdr); - - noteoff = *off; - - if (dst != NULL) { - if ((tempdata = calloc(1, sizeof(*tempdata))) == NULL) - errx(1, "out of memory"); - status = &tempdata->status; - fpregset = &tempdata->fpregset; - psinfo = &tempdata->psinfo; - thrmisc = &tempdata->thrmisc; - } else { - tempdata = NULL; - status = NULL; - fpregset = NULL; - psinfo = NULL; - thrmisc = NULL; - } - errno = 0; threads = ptrace(PT_GETNUMLWPS, pid, NULL, 0); if (errno) err(1, "PT_GETNUMLWPS"); + tids = malloc(threads * sizeof(*tids)); + if (tids == NULL) + errx(1, "out of memory"); + errno = 0; + ptrace(PT_GETLWPLIST, pid, (void *)tids, threads); + if (errno) + err(1, "PT_GETLWPLIST"); - if (dst != NULL) { - psinfo->pr_version = PRPSINFO_VERSION; - psinfo->pr_psinfosz = sizeof(prpsinfo_t); - elf_getstatus(pid, psinfo); - - } - elf_putnote(dst, off, "FreeBSD", NT_PRPSINFO, psinfo, - sizeof *psinfo); + sbuf_start_section(sb, &old_len); + elf_putnote(NT_PRPSINFO, elf_note_prpsinfo, &pid, sb); - if (dst != NULL) { - tids = malloc(threads * sizeof(*tids)); - if (tids == NULL) - errx(1, "out of memory"); - errno = 0; - ptrace(PT_GETLWPLIST, pid, (void *)tids, threads); - if (errno) - err(1, "PT_GETLWPLIST"); - } for (i = 0; i < threads; ++i) { - if (dst != NULL) { - status->pr_version = PRSTATUS_VERSION; - status->pr_statussz = sizeof(prstatus_t); - status->pr_gregsetsz = sizeof(gregset_t); - status->pr_fpregsetsz = sizeof(fpregset_t); - status->pr_osreldate = __FreeBSD_version; - status->pr_pid = tids[i]; - - ptrace(PT_GETREGS, tids[i], (void *)&status->pr_reg, 0); - ptrace(PT_GETFPREGS, tids[i], (void *)fpregset, 0); - ptrace(PT_LWPINFO, tids[i], (void *)&lwpinfo, - sizeof(lwpinfo)); - memset(&thrmisc->_pad, 0, sizeof(thrmisc->_pad)); - strcpy(thrmisc->pr_tname, lwpinfo.pl_tdname); - } - elf_putnote(dst, off, "FreeBSD", NT_PRSTATUS, status, - sizeof *status); - elf_putnote(dst, off, "FreeBSD", NT_FPREGSET, fpregset, - sizeof *fpregset); - elf_putnote(dst, off, "FreeBSD", NT_THRMISC, thrmisc, - sizeof *thrmisc); - } - - notesz = *off - noteoff; - - if (dst != NULL) { - free(tids); - free(tempdata); + elf_putnote(NT_PRSTATUS, elf_note_prstatus, tids + i, sb); + elf_putnote(NT_FPREGSET, elf_note_fpregset, tids + i, sb); + elf_putnote(NT_THRMISC, elf_note_thrmisc, tids + i, sb); } - /* Align up to a page boundary for the program segments. */ - *off = round_page(*off); - - if (dst != NULL) { - Elf_Ehdr *ehdr; - Elf_Phdr *phdr; - struct phdr_closure phc; - - /* - * Fill in the ELF header. - */ - ehdr = (Elf_Ehdr *)((char *)dst + ehoff); - ehdr->e_ident[EI_MAG0] = ELFMAG0; - ehdr->e_ident[EI_MAG1] = ELFMAG1; - ehdr->e_ident[EI_MAG2] = ELFMAG2; - ehdr->e_ident[EI_MAG3] = ELFMAG3; - ehdr->e_ident[EI_CLASS] = ELF_CLASS; - ehdr->e_ident[EI_DATA] = ELF_DATA; - ehdr->e_ident[EI_VERSION] = EV_CURRENT; - ehdr->e_ident[EI_OSABI] = ELFOSABI_FREEBSD; - ehdr->e_ident[EI_ABIVERSION] = 0; - ehdr->e_ident[EI_PAD] = 0; - ehdr->e_type = ET_CORE; - ehdr->e_machine = ELF_ARCH; - ehdr->e_version = EV_CURRENT; - ehdr->e_entry = 0; - ehdr->e_phoff = phoff; - ehdr->e_flags = 0; - ehdr->e_ehsize = sizeof(Elf_Ehdr); - ehdr->e_phentsize = sizeof(Elf_Phdr); - ehdr->e_phnum = numsegs + 1; - ehdr->e_shentsize = sizeof(Elf_Shdr); - ehdr->e_shnum = 0; - ehdr->e_shstrndx = SHN_UNDEF; - - /* - * Fill in the program header entries. - */ - phdr = (Elf_Phdr *)((char *)dst + phoff); - - /* The note segment. */ - phdr->p_type = PT_NOTE; - phdr->p_offset = noteoff; - phdr->p_vaddr = 0; - phdr->p_paddr = 0; - phdr->p_filesz = notesz; - phdr->p_memsz = 0; - phdr->p_flags = 0; - phdr->p_align = 0; - phdr++; - - /* All the writable segments from the program. */ - phc.phdr = phdr; - phc.offset = *off; - each_writable_segment(map, cb_put_phdr, &phc); - } + elf_putnote(NT_PROCSTAT_PROC, elf_note_procstat_proc, &pid, sb); + elf_putnote(NT_PROCSTAT_FILES, elf_note_procstat_files, &pid, sb); + elf_putnote(NT_PROCSTAT_VMMAP, elf_note_procstat_vmmap, &pid, sb); + elf_putnote(NT_PROCSTAT_GROUPS, elf_note_procstat_groups, &pid, sb); + elf_putnote(NT_PROCSTAT_UMASK, elf_note_procstat_umask, &pid, sb); + elf_putnote(NT_PROCSTAT_RLIMIT, elf_note_procstat_rlimit, &pid, sb); + elf_putnote(NT_PROCSTAT_OSREL, elf_note_procstat_osrel, &pid, sb); + elf_putnote(NT_PROCSTAT_PSSTRINGS, elf_note_procstat_psstrings, &pid, + sb); + elf_putnote(NT_PROCSTAT_AUXV, elf_note_procstat_auxv, &pid, sb); + + size = sbuf_end_section(sb, old_len, 1, 0); + if (size == -1) + err(1, "sbuf_end_section"); + free(tids); + *sizep = size; } /* - * Emit one note section to "dst", or just size it if "dst" is NULL. + * Emit one note section to sbuf. */ static void -elf_putnote(void *dst, size_t *off, const char *name, int type, - const void *desc, size_t descsz) +elf_putnote(int type, notefunc_t notefunc, void *arg, struct sbuf *sb) { Elf_Note note; + size_t descsz; + ssize_t old_len; + void *desc; - note.n_namesz = strlen(name) + 1; + desc = notefunc(arg, &descsz); + note.n_namesz = 8; /* strlen("FreeBSD") + 1 */ note.n_descsz = descsz; note.n_type = type; - if (dst != NULL) - bcopy(¬e, (char *)dst + *off, sizeof note); - *off += sizeof note; - if (dst != NULL) - bcopy(name, (char *)dst + *off, note.n_namesz); - *off += roundup2(note.n_namesz, sizeof(Elf_Size)); - if (dst != NULL) - bcopy(desc, (char *)dst + *off, note.n_descsz); - *off += roundup2(note.n_descsz, sizeof(Elf_Size)); + + sbuf_bcat(sb, ¬e, sizeof(note)); + sbuf_start_section(sb, &old_len); + sbuf_bcat(sb, "FreeBSD", note.n_namesz); + sbuf_end_section(sb, old_len, sizeof(Elf32_Size), 0); + if (descsz == 0) + return; + sbuf_start_section(sb, &old_len); + sbuf_bcat(sb, desc, descsz); + sbuf_end_section(sb, old_len, sizeof(Elf32_Size), 0); + free(desc); +} + +/* + * Generate the ELF coredump header. + */ +static void +elf_puthdr(pid_t pid, vm_map_entry_t map, void *hdr, size_t hdrsize, + size_t notesz, size_t segoff, int numsegs) +{ + Elf_Ehdr *ehdr; + Elf_Phdr *phdr; + struct phdr_closure phc; + + ehdr = (Elf_Ehdr *)hdr; + phdr = (Elf_Phdr *)((char *)hdr + sizeof(Elf_Ehdr)); + + ehdr->e_ident[EI_MAG0] = ELFMAG0; + ehdr->e_ident[EI_MAG1] = ELFMAG1; + ehdr->e_ident[EI_MAG2] = ELFMAG2; + ehdr->e_ident[EI_MAG3] = ELFMAG3; + ehdr->e_ident[EI_CLASS] = ELF_CLASS; + ehdr->e_ident[EI_DATA] = ELF_DATA; + ehdr->e_ident[EI_VERSION] = EV_CURRENT; + ehdr->e_ident[EI_OSABI] = ELFOSABI_FREEBSD; + ehdr->e_ident[EI_ABIVERSION] = 0; + ehdr->e_ident[EI_PAD] = 0; + ehdr->e_type = ET_CORE; + ehdr->e_machine = ELF_ARCH; + ehdr->e_version = EV_CURRENT; + ehdr->e_entry = 0; + ehdr->e_phoff = sizeof(Elf_Ehdr); + ehdr->e_flags = 0; + ehdr->e_ehsize = sizeof(Elf_Ehdr); + ehdr->e_phentsize = sizeof(Elf_Phdr); + ehdr->e_phnum = numsegs + 1; + ehdr->e_shentsize = sizeof(Elf_Shdr); + ehdr->e_shnum = 0; + ehdr->e_shstrndx = SHN_UNDEF; + + /* + * Fill in the program header entries. + */ + + /* The note segement. */ + phdr->p_type = PT_NOTE; + phdr->p_offset = hdrsize; + phdr->p_vaddr = 0; + phdr->p_paddr = 0; + phdr->p_filesz = notesz; + phdr->p_memsz = 0; + phdr->p_flags = PF_R; + phdr->p_align = sizeof(Elf32_Size); + phdr++; + + /* All the writable segments from the program. */ + phc.phdr = phdr; + phc.offset = segoff; + each_writable_segment(map, cb_put_phdr, &phc); } /* @@ -530,5 +483,223 @@ readmap(pid_t pid) return (map); } +/* + * Miscellaneous note out functions. + */ + +static void * +elf_note_prpsinfo(void *arg, size_t *sizep) +{ + pid_t pid; + prpsinfo_t *psinfo; + struct kinfo_proc kip; + size_t len; + int name[4]; + + pid = *(pid_t *)arg; + psinfo = calloc(1, sizeof(*psinfo)); + if (psinfo == NULL) + errx(1, "out of memory"); + psinfo->pr_version = PRPSINFO_VERSION; + psinfo->pr_psinfosz = sizeof(prpsinfo_t); + + name[0] = CTL_KERN; + name[1] = KERN_PROC; + name[2] = KERN_PROC_PID; + name[3] = pid; + len = sizeof(kip); + if (sysctl(name, 4, &kip, &len, NULL, 0) == -1) + err(1, "kern.proc.pid.%u", pid); + if (kip.ki_pid != pid) + err(1, "kern.proc.pid.%u", pid); + strncpy(psinfo->pr_fname, kip.ki_comm, MAXCOMLEN); + strncpy(psinfo->pr_psargs, psinfo->pr_fname, PRARGSZ); + + *sizep = sizeof(*psinfo); + return (psinfo); +} + +static void * +elf_note_prstatus(void *arg, size_t *sizep) +{ + lwpid_t tid; + prstatus_t *status; + + tid = *(lwpid_t *)arg; + status = calloc(1, sizeof(*status)); + if (status == NULL) + errx(1, "out of memory"); + status->pr_version = PRSTATUS_VERSION; + status->pr_statussz = sizeof(prstatus_t); + status->pr_gregsetsz = sizeof(gregset_t); + status->pr_fpregsetsz = sizeof(fpregset_t); + status->pr_osreldate = __FreeBSD_version; + status->pr_pid = tid; + ptrace(PT_GETREGS, tid, (void *)&status->pr_reg, 0); + + *sizep = sizeof(*status); + return (status); +} + +static void * +elf_note_fpregset(void *arg, size_t *sizep) +{ + lwpid_t tid; + prfpregset_t *fpregset; + + tid = *(lwpid_t *)arg; + fpregset = calloc(1, sizeof(*fpregset)); + if (fpregset == NULL) + errx(1, "out of memory"); + ptrace(PT_GETFPREGS, tid, (void *)fpregset, 0); + + *sizep = sizeof(*fpregset); + return (fpregset); +} + +static void * +elf_note_thrmisc(void *arg, size_t *sizep) +{ + lwpid_t tid; + struct ptrace_lwpinfo lwpinfo; + thrmisc_t *thrmisc; + + tid = *(lwpid_t *)arg; + thrmisc = calloc(1, sizeof(*thrmisc)); + if (thrmisc == NULL) + errx(1, "out of memory"); + ptrace(PT_LWPINFO, tid, (void *)&lwpinfo, + sizeof(lwpinfo)); + memset(&thrmisc->_pad, 0, sizeof(thrmisc->_pad)); + strcpy(thrmisc->pr_tname, lwpinfo.pl_tdname); + + *sizep = sizeof(*thrmisc); + return (thrmisc); +} + +static void * +procstat_sysctl(void *arg, int what, size_t structsz, size_t *sizep) +{ + size_t len, oldlen; + pid_t pid; + int name[4], structsize; + void *buf, *p; + + pid = *(pid_t *)arg; + structsize = structsz; + name[0] = CTL_KERN; + name[1] = KERN_PROC; + name[2] = what; + name[3] = pid; + len = 0; + if (sysctl(name, 4, NULL, &len, NULL, 0) == -1) + err(1, "kern.proc.%d.%u", what, pid); + buf = calloc(1, sizeof(structsize) + len * 4 / 3); + if (buf == NULL) + errx(1, "out of memory"); + bcopy(&structsize, buf, sizeof(structsize)); + p = (char *)buf + sizeof(structsize); + if (sysctl(name, 4, p, &len, NULL, 0) == -1) + err(1, "kern.proc.%d.%u", what, pid); + + *sizep = sizeof(structsize) + len; + return (buf); +} + +static void * +elf_note_procstat_proc(void *arg, size_t *sizep) +{ + + return (procstat_sysctl(arg, KERN_PROC_PID | KERN_PROC_INC_THREAD, + sizeof(struct kinfo_proc), sizep)); +} + +static void * +elf_note_procstat_files(void *arg, size_t *sizep) +{ + + return (procstat_sysctl(arg, KERN_PROC_FILEDESC, + sizeof(struct kinfo_file), sizep)); +} + +static void * +elf_note_procstat_vmmap(void *arg, size_t *sizep) +{ + + return (procstat_sysctl(arg, KERN_PROC_VMMAP, + sizeof(struct kinfo_vmentry), sizep)); +} + +static void * +elf_note_procstat_groups(void *arg, size_t *sizep) +{ + + return (procstat_sysctl(arg, KERN_PROC_GROUPS, + (int)sizeof(gid_t), sizep)); +} + +static void * +elf_note_procstat_umask(void *arg, size_t *sizep) +{ + + return (procstat_sysctl(arg, KERN_PROC_UMASK, sizeof(u_short), sizep)); +} + +static void * +elf_note_procstat_osrel(void *arg, size_t *sizep) +{ + + return (procstat_sysctl(arg, KERN_PROC_OSREL, sizeof(int), sizep)); +} + +static void * +elf_note_procstat_psstrings(void *arg, size_t *sizep) +{ + + return (procstat_sysctl(arg, KERN_PROC_PS_STRINGS, + sizeof(vm_offset_t), sizep)); +} + +static void * +elf_note_procstat_auxv(void *arg, size_t *sizep) +{ + + return (procstat_sysctl(arg, KERN_PROC_AUXV, + sizeof(Elf_Auxinfo), sizep)); +} + +static void * +elf_note_procstat_rlimit(void *arg, size_t *sizep) +{ + pid_t pid; + size_t len; + int i, name[5], structsize; + void *buf, *p; + + pid = *(pid_t *)arg; + structsize = sizeof(struct rlimit) * RLIM_NLIMITS; + buf = calloc(1, sizeof(structsize) + structsize); + if (buf == NULL) + errx(1, "out of memory"); + bcopy(&structsize, buf, sizeof(structsize)); + p = (char *)buf + sizeof(structsize); + name[0] = CTL_KERN; + name[1] = KERN_PROC; + name[2] = KERN_PROC_RLIMIT; + name[3] = pid; + len = sizeof(struct rlimit); + for (i = 0; i < RLIM_NLIMITS; i++) { + name[4] = i; + if (sysctl(name, 5, p, &len, NULL, 0) == -1) + err(1, "kern.proc.rlimit.%u", pid); + if (len != sizeof(struct rlimit)) + errx(1, "kern.proc.rlimit.%u: short read", pid); + p += len; + } + + *sizep = sizeof(structsize) + structsize; + return (buf); +} + struct dumpers elfdump = { elf_ident, elf_coredump }; TEXT_SET(dumpset, elfdump); From owner-svn-src-all@FreeBSD.ORG Sat Apr 20 08:25:15 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A1E42EA1; Sat, 20 Apr 2013 08:25:15 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7A02F12D8; Sat, 20 Apr 2013 08:25:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3K8PFLm030826; Sat, 20 Apr 2013 08:25:15 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3K8PF9s030822; Sat, 20 Apr 2013 08:25:15 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201304200825.r3K8PF9s030822@svn.freebsd.org> From: Mikolaj Golub Date: Sat, 20 Apr 2013 08:25:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249688 - head/lib/libprocstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Apr 2013 08:25:15 -0000 Author: trociny Date: Sat Apr 20 08:25:14 2013 New Revision: 249688 URL: http://svnweb.freebsd.org/changeset/base/249688 Log: Bump date. Modified: head/lib/libprocstat/libprocstat.3 Modified: head/lib/libprocstat/libprocstat.3 ============================================================================== --- head/lib/libprocstat/libprocstat.3 Sat Apr 20 08:23:19 2013 (r249687) +++ head/lib/libprocstat/libprocstat.3 Sat Apr 20 08:25:14 2013 (r249688) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 1, 2012 +.Dd April 20, 2013 .Dt LIBPROCSTAT 3 .Os .Sh NAME From owner-svn-src-all@FreeBSD.ORG Sat Apr 20 09:25:25 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id AC4AA709; Sat, 20 Apr 2013 09:25:25 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9D5E3146E; Sat, 20 Apr 2013 09:25:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3K9PP1P001394; Sat, 20 Apr 2013 09:25:25 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3K9PPb9001392; Sat, 20 Apr 2013 09:25:25 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201304200925.r3K9PPb9001392@svn.freebsd.org> From: Martin Matuska Date: Sat, 20 Apr 2013 09:25:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249689 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Apr 2013 09:25:25 -0000 Author: mm Date: Sat Apr 20 09:25:25 2013 New Revision: 249689 URL: http://svnweb.freebsd.org/changeset/base/249689 Log: MFC r249047 (avg): spa_open_common: fix argument to zvol_create_minors Prior to r248571 spa_open was always called with a bare pool name, but now it is called with a dataset name instead (spa_lookup handles that). So, when a ZFS root is mounted spa_open is called with a name of a root dataset, which can very well be different from the pool name. But zvol_create_minors should be called with the pool name, because it performs a recursive traversal of all datasets under the name to find all those that are volumes. Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sat Apr 20 08:25:14 2013 (r249688) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sat Apr 20 09:25:25 2013 (r249689) @@ -2870,7 +2870,7 @@ spa_open_common(const char *pool, spa_t #ifdef __FreeBSD__ #ifdef _KERNEL if (firstopen) - zvol_create_minors(pool); + zvol_create_minors(spa->spa_name); #endif #endif } From owner-svn-src-all@FreeBSD.ORG Sat Apr 20 11:30:15 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BD40AE4A; Sat, 20 Apr 2013 11:30:15 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AF4AA17DD; Sat, 20 Apr 2013 11:30:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3KBUF8d040948; Sat, 20 Apr 2013 11:30:15 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3KBUEMd040932; Sat, 20 Apr 2013 11:30:14 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201304201130.r3KBUEMd040932@svn.freebsd.org> From: Edwin Groothuis Date: Sat, 20 Apr 2013 11:30:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r249690 - vendor/tzdata/dist X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Apr 2013 11:30:15 -0000 Author: edwin Date: Sat Apr 20 11:30:14 2013 New Revision: 249690 URL: http://svnweb.freebsd.org/changeset/base/249690 Log: Vendor import of tzdata2013c - antarctica: AusAQ and ATAQ have been removed. - Antarctica/Macquarie has been moved to australasia file and AU. - Asia/Hebron, Palestine updated for 2013. - Paraguay stays with DST for the whole year. Obtained from: ftp://ftp.iana.org/tz/releases/ Modified: vendor/tzdata/dist/antarctica vendor/tzdata/dist/asia vendor/tzdata/dist/australasia vendor/tzdata/dist/southamerica vendor/tzdata/dist/zone.tab Modified: vendor/tzdata/dist/antarctica ============================================================================== --- vendor/tzdata/dist/antarctica Sat Apr 20 09:25:25 2013 (r249689) +++ vendor/tzdata/dist/antarctica Sat Apr 20 11:30:14 2013 (r249690) @@ -53,34 +53,6 @@ Rule ChileAQ 2011 only - Aug Sun>=16 4:0 Rule ChileAQ 2012 max - Apr Sun>=23 3:00u 0 - Rule ChileAQ 2012 max - Sep Sun>=2 4:00u 1:00 S -# These rules are stolen from the `australasia' file. -Rule AusAQ 1917 only - Jan 1 0:01 1:00 - -Rule AusAQ 1917 only - Mar 25 2:00 0 - -Rule AusAQ 1942 only - Jan 1 2:00 1:00 - -Rule AusAQ 1942 only - Mar 29 2:00 0 - -Rule AusAQ 1942 only - Sep 27 2:00 1:00 - -Rule AusAQ 1943 1944 - Mar lastSun 2:00 0 - -Rule AusAQ 1943 only - Oct 3 2:00 1:00 - -Rule ATAQ 1967 only - Oct Sun>=1 2:00s 1:00 - -Rule ATAQ 1968 only - Mar lastSun 2:00s 0 - -Rule ATAQ 1968 1985 - Oct lastSun 2:00s 1:00 - -Rule ATAQ 1969 1971 - Mar Sun>=8 2:00s 0 - -Rule ATAQ 1972 only - Feb lastSun 2:00s 0 - -Rule ATAQ 1973 1981 - Mar Sun>=1 2:00s 0 - -Rule ATAQ 1982 1983 - Mar lastSun 2:00s 0 - -Rule ATAQ 1984 1986 - Mar Sun>=1 2:00s 0 - -Rule ATAQ 1986 only - Oct Sun>=15 2:00s 1:00 - -Rule ATAQ 1987 1990 - Mar Sun>=15 2:00s 0 - -Rule ATAQ 1987 only - Oct Sun>=22 2:00s 1:00 - -Rule ATAQ 1988 1990 - Oct lastSun 2:00s 1:00 - -Rule ATAQ 1991 1999 - Oct Sun>=1 2:00s 1:00 - -Rule ATAQ 1991 2005 - Mar lastSun 2:00s 0 - -Rule ATAQ 2000 only - Aug lastSun 2:00s 1:00 - -Rule ATAQ 2001 max - Oct Sun>=1 2:00s 1:00 - -Rule ATAQ 2006 only - Apr Sun>=1 2:00s 0 - -Rule ATAQ 2007 only - Mar lastSun 2:00s 0 - -Rule ATAQ 2008 max - Apr Sun>=1 2:00s 0 - - # Argentina - year-round bases # Belgrano II, Confin Coast, -770227-0343737, since 1972-02-05 # Esperanza, San Martin Land, -6323-05659, since 1952-12-17 @@ -122,10 +94,7 @@ Rule ATAQ 2008 max - Apr Sun>=1 2:00s 0 # # From Steffen Thorsen (2010-03-10): -# We got these changes from the Australian Antarctic Division: -# - Macquarie Island will stay on UTC+11 for winter and therefore not -# switch back from daylight savings time when other parts of Australia do -# on 4 April. +# We got these changes from the Australian Antarctic Division: ... # # - Casey station reverted to its normal time of UTC+8 on 5 March 2010. # The change to UTC+11 is being considered as a regular summer thing but @@ -136,9 +105,6 @@ Rule ATAQ 2008 max - Apr Sun>=1 2:00s 0 # # - Mawson station stays on UTC+5. # -# In addition to the Rule changes for Casey/Davis, it means that Macquarie -# will no longer be like Hobart and will have to have its own Zone created. -# # Background: # # http://www.timeanddate.com/news/time/antartica-time-changes-2010.html @@ -165,12 +131,6 @@ Zone Antarctica/Mawson 0 - zzz 1954 Feb 6:00 - MAWT 2009 Oct 18 2:00 # Mawson Time 5:00 - MAWT -Zone Antarctica/Macquarie 0 - zzz 1911 - 10:00 - EST 1916 Oct 1 2:00 - 10:00 1:00 EST 1917 Feb - 10:00 AusAQ EST 1967 - 10:00 ATAQ EST 2010 Apr 4 3:00 - 11:00 - MIST # Macquarie Island Time # References: # # Casey Weather (1998-02-26) Modified: vendor/tzdata/dist/asia ============================================================================== --- vendor/tzdata/dist/asia Sat Apr 20 09:25:25 2013 (r249689) +++ vendor/tzdata/dist/asia Sat Apr 20 11:30:14 2013 (r249690) @@ -2291,11 +2291,20 @@ Zone Asia/Karachi 4:28:12 - LMT 1907 # http://www.timeanddate.com/news/time/gaza-west-bank-dst-2012.html # -# From Arthur David Olson (2012-03-27): -# The timeanddate article for 2012 says that "the end date has not yet been -# announced" and that "Last year, both...paused daylight saving time during... -# Ramadan. It is not yet known [for] 2012." -# For now, assume both switch back on the last Friday in September. XXX +# From Steffen Thorsen (2013-03-26): +# The following news sources tells that Palestine will "start daylight saving +# time from midnight on Friday, March 29, 2013" (translated). +# [These are in Arabic and are for Gaza and for Ramallah, respectively.] +# http://www.samanews.com/index.php?act=Show&id=154120 +# http://safa.ps/details/news/99844/%D8%B1%D8%A7%D9%85-%D8%A7%D9%84%D9%84%D9%87-%D8%A8%D8%AF%D8%A1-%D8%A7%D9%84%D8%AA%D9%88%D9%82%D9%8A%D8%AA-%D8%A7%D9%84%D8%B5%D9%8A%D9%81%D9%8A-29-%D8%A7%D9%84%D8%AC%D8%A7%D8%B1%D9%8A.html + +# From Paul Eggert (2013-04-15): +# For future dates, guess the last Thursday in March at 24:00 through +# the first Friday on or after September 21 at 01:00. This is consistent with +# the predictions in today's editions of the following URLs, +# which are for Gaza and Hebron respectively: +# http://www.timeanddate.com/worldclock/timezone.html?n=702 +# http://www.timeanddate.com/worldclock/timezone.html?n=2364 # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule EgyptAsia 1957 only - May 10 0:00 1:00 S @@ -2309,19 +2318,20 @@ Rule Palestine 1999 2005 - Apr Fri>=15 0 Rule Palestine 1999 2003 - Oct Fri>=15 0:00 0 - Rule Palestine 2004 only - Oct 1 1:00 0 - Rule Palestine 2005 only - Oct 4 2:00 0 - -Rule Palestine 2006 2008 - Apr 1 0:00 1:00 S +Rule Palestine 2006 2007 - Apr 1 0:00 1:00 S Rule Palestine 2006 only - Sep 22 0:00 0 - Rule Palestine 2007 only - Sep Thu>=8 2:00 0 - -Rule Palestine 2008 only - Aug lastFri 0:00 0 - -Rule Palestine 2009 only - Mar lastFri 0:00 1:00 S -Rule Palestine 2009 only - Sep Fri>=1 2:00 0 - -Rule Palestine 2010 only - Mar lastSat 0:01 1:00 S +Rule Palestine 2008 2009 - Mar lastFri 0:00 1:00 S +Rule Palestine 2008 only - Sep 1 0:00 0 - +Rule Palestine 2009 only - Sep Fri>=1 1:00 0 - +Rule Palestine 2010 only - Mar 26 0:00 1:00 S Rule Palestine 2010 only - Aug 11 0:00 0 - - -# From Arthur David Olson (2011-09-20): -# 2011 transitions per http://www.timeanddate.com as of 2011-09-20. -# From Paul Eggert (2012-10-12): -# 2012 transitions per http://www.timeanddate.com as of 2012-10-12. +Rule Palestine 2011 only - Apr 1 0:01 1:00 S +Rule Palestine 2011 only - Aug 1 0:00 0 - +Rule Palestine 2011 only - Aug 30 0:00 1:00 S +Rule Palestine 2011 only - Sep 30 0:00 0 - +Rule Palestine 2012 max - Mar lastThu 24:00 1:00 S +Rule Palestine 2012 max - Sep Fri>=21 1:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Gaza 2:17:52 - LMT 1900 Oct @@ -2329,26 +2339,20 @@ Zone Asia/Gaza 2:17:52 - LMT 1900 Oct 2:00 EgyptAsia EE%sT 1967 Jun 5 2:00 Zion I%sT 1996 2:00 Jordan EE%sT 1999 - 2:00 Palestine EE%sT 2011 Apr 2 12:01 - 2:00 1:00 EEST 2011 Aug 1 - 2:00 - EET 2012 Mar 30 - 2:00 1:00 EEST 2012 Sep 21 1:00 - 2:00 - EET + 2:00 Palestine EE%sT 2008 Aug 29 0:00 + 2:00 - EET 2008 Sep + 2:00 Palestine EE%sT 2010 + 2:00 - EET 2010 Mar 27 0:01 + 2:00 Palestine EE%sT 2011 Aug 1 + 2:00 - EET 2012 + 2:00 Palestine EE%sT Zone Asia/Hebron 2:20:23 - LMT 1900 Oct 2:00 Zion EET 1948 May 15 2:00 EgyptAsia EE%sT 1967 Jun 5 2:00 Zion I%sT 1996 2:00 Jordan EE%sT 1999 - 2:00 Palestine EE%sT 2008 Aug - 2:00 1:00 EEST 2008 Sep - 2:00 Palestine EE%sT 2011 Apr 1 12:01 - 2:00 1:00 EEST 2011 Aug 1 - 2:00 - EET 2011 Aug 30 - 2:00 1:00 EEST 2011 Sep 30 3:00 - 2:00 - EET 2012 Mar 30 - 2:00 1:00 EEST 2012 Sep 21 1:00 - 2:00 - EET + 2:00 Palestine EE%sT # Paracel Is # no information Modified: vendor/tzdata/dist/australasia ============================================================================== --- vendor/tzdata/dist/australasia Sat Apr 20 09:25:25 2013 (r249689) +++ vendor/tzdata/dist/australasia Sat Apr 20 11:30:14 2013 (r249690) @@ -218,9 +218,26 @@ Zone Australia/Lord_Howe 10:36:20 - LMT # no times are set # # Macquarie -# permanent occupation (scientific station) since 1948; -# sealing and penguin oil station operated 1888/1917 -# like Australia/Hobart +# Permanent occupation (scientific station) 1911-1915 and since 25 March 1948; +# sealing and penguin oil station operated Nov 1899 to Apr 1919. See the +# Tasmania Parks & Wildlife Service history of sealing at Macquarie Island +# +# . +# Guess that it was like Australia/Hobart while inhabited before 2010. +# +# From Steffen Thorsen (2010-03-10): +# We got these changes from the Australian Antarctic Division: +# - Macquarie Island will stay on UTC+11 for winter and therefore not +# switch back from daylight savings time when other parts of Australia do +# on 4 April. +Zone Antarctica/Macquarie 0 - zzz 1899 Nov + 10:00 - EST 1916 Oct 1 2:00 + 10:00 1:00 EST 1917 Feb + 10:00 Aus EST 1919 Apr + 0 - zzz 1948 Mar 25 + 10:00 Aus EST 1967 + 10:00 AT EST 2010 Apr 4 3:00 + 11:00 - MIST # Macquarie I Standard Time # Christmas # Zone NAME GMTOFF RULES FORMAT [UNTIL] Modified: vendor/tzdata/dist/southamerica ============================================================================== --- vendor/tzdata/dist/southamerica Sat Apr 20 09:25:25 2013 (r249689) +++ vendor/tzdata/dist/southamerica Sat Apr 20 11:30:14 2013 (r249690) @@ -1566,16 +1566,16 @@ Rule Para 2005 2009 - Mar Sun>=8 0:00 0 # forward 60 minutes, in all the territory of the Paraguayan Republic. # ... Rule Para 2010 max - Oct Sun>=1 0:00 1:00 S -Rule Para 2010 max - Apr Sun>=8 0:00 0 - +Rule Para 2010 2012 - Apr Sun>=8 0:00 0 - # # From Steffen Thorsen (2013-03-07): # Paraguay will end DST on 2013-03-24 00:00.... -# They do not tell if this will be a permanent change or just this year.... # http://www.ande.gov.py/interna.php?id=1075 # -# From Paul Eggert (2013-03-07): -# For now, assume it's just this year. -Rule Para 2013 only - Mar 24 0:00 0 - +# From Carlos Raul Perasso (2013-03-15): +# The change in Paraguay is now final. Decree number 10780 +# http://www.presidencia.gov.py/uploads/pdf/presidencia-3b86ff4b691c79d4f5927ca964922ec74772ce857c02ca054a52a37b49afc7fb.pdf +Rule Para 2013 max - Mar Sun>=22 0:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone America/Asuncion -3:50:40 - LMT 1890 Modified: vendor/tzdata/dist/zone.tab ============================================================================== --- vendor/tzdata/dist/zone.tab Sat Apr 20 09:25:25 2013 (r249689) +++ vendor/tzdata/dist/zone.tab Sat Apr 20 11:30:14 2013 (r249690) @@ -42,7 +42,6 @@ AQ -6617+11031 Antarctica/Casey Casey St AQ -7824+10654 Antarctica/Vostok Vostok Station, Lake Vostok AQ -6640+14001 Antarctica/DumontDUrville Dumont-d'Urville Station, Terre Adelie AQ -690022+0393524 Antarctica/Syowa Syowa Station, E Ongul I -AQ -5430+15857 Antarctica/Macquarie Macquarie Island Station, Macquarie Island AR -3436-05827 America/Argentina/Buenos_Aires Buenos Aires (BA, CF) AR -3124-06411 America/Argentina/Cordoba most locations (CB, CC, CN, ER, FM, MN, SE, SF) AR -2447-06525 America/Argentina/Salta (SA, LP, NQ, RN) @@ -58,6 +57,7 @@ AR -5448-06818 America/Argentina/Ushuaia AS -1416-17042 Pacific/Pago_Pago AT +4813+01620 Europe/Vienna AU -3133+15905 Australia/Lord_Howe Lord Howe Island +AU -5430+15857 Antarctica/Macquarie Macquarie Island AU -4253+14719 Australia/Hobart Tasmania - most locations AU -3956+14352 Australia/Currie Tasmania - King Island AU -3749+14458 Australia/Melbourne Victoria From owner-svn-src-all@FreeBSD.ORG Sat Apr 20 11:35:25 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E4BBC126; Sat, 20 Apr 2013 11:35:25 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BE09517FF; Sat, 20 Apr 2013 11:35:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3KBZPQN047446; Sat, 20 Apr 2013 11:35:25 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3KBZPN2047444; Sat, 20 Apr 2013 11:35:25 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201304201135.r3KBZPN2047444@svn.freebsd.org> From: Edwin Groothuis Date: Sat, 20 Apr 2013 11:35:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r249691 - vendor/tzdata/tzdata2013c X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Apr 2013 11:35:26 -0000 Author: edwin Date: Sat Apr 20 11:35:25 2013 New Revision: 249691 URL: http://svnweb.freebsd.org/changeset/base/249691 Log: Tag of tzdata2013c Added: vendor/tzdata/tzdata2013c/ - copied from r249690, vendor/tzdata/dist/ From owner-svn-src-all@FreeBSD.ORG Sat Apr 20 11:42:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 098E64EF; Sat, 20 Apr 2013 11:42:12 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EFAFB1848; Sat, 20 Apr 2013 11:42:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3KBgB4f055380; Sat, 20 Apr 2013 11:42:11 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3KBgAxu055364; Sat, 20 Apr 2013 11:42:11 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201304201142.r3KBgAxu055364@svn.freebsd.org> From: Edwin Groothuis Date: Sat, 20 Apr 2013 11:42:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249692 - head/contrib/tzdata X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Apr 2013 11:42:12 -0000 Author: edwin Date: Sat Apr 20 11:42:10 2013 New Revision: 249692 URL: http://svnweb.freebsd.org/changeset/base/249692 Log: Merge of vendor of 249690, tzdata2013c - antarctica: AusAQ and ATAQ have been removed. - Antarctica/Macquarie has been moved to australasia file and AU. - Asia/Hebron, Palestine updated for 2013. - Paraguay stays with DST for the whole year. Modified: head/contrib/tzdata/antarctica head/contrib/tzdata/asia head/contrib/tzdata/australasia head/contrib/tzdata/southamerica head/contrib/tzdata/zone.tab Directory Properties: head/contrib/tzdata/ (props changed) Modified: head/contrib/tzdata/antarctica ============================================================================== --- head/contrib/tzdata/antarctica Sat Apr 20 11:35:25 2013 (r249691) +++ head/contrib/tzdata/antarctica Sat Apr 20 11:42:10 2013 (r249692) @@ -53,34 +53,6 @@ Rule ChileAQ 2011 only - Aug Sun>=16 4:0 Rule ChileAQ 2012 max - Apr Sun>=23 3:00u 0 - Rule ChileAQ 2012 max - Sep Sun>=2 4:00u 1:00 S -# These rules are stolen from the `australasia' file. -Rule AusAQ 1917 only - Jan 1 0:01 1:00 - -Rule AusAQ 1917 only - Mar 25 2:00 0 - -Rule AusAQ 1942 only - Jan 1 2:00 1:00 - -Rule AusAQ 1942 only - Mar 29 2:00 0 - -Rule AusAQ 1942 only - Sep 27 2:00 1:00 - -Rule AusAQ 1943 1944 - Mar lastSun 2:00 0 - -Rule AusAQ 1943 only - Oct 3 2:00 1:00 - -Rule ATAQ 1967 only - Oct Sun>=1 2:00s 1:00 - -Rule ATAQ 1968 only - Mar lastSun 2:00s 0 - -Rule ATAQ 1968 1985 - Oct lastSun 2:00s 1:00 - -Rule ATAQ 1969 1971 - Mar Sun>=8 2:00s 0 - -Rule ATAQ 1972 only - Feb lastSun 2:00s 0 - -Rule ATAQ 1973 1981 - Mar Sun>=1 2:00s 0 - -Rule ATAQ 1982 1983 - Mar lastSun 2:00s 0 - -Rule ATAQ 1984 1986 - Mar Sun>=1 2:00s 0 - -Rule ATAQ 1986 only - Oct Sun>=15 2:00s 1:00 - -Rule ATAQ 1987 1990 - Mar Sun>=15 2:00s 0 - -Rule ATAQ 1987 only - Oct Sun>=22 2:00s 1:00 - -Rule ATAQ 1988 1990 - Oct lastSun 2:00s 1:00 - -Rule ATAQ 1991 1999 - Oct Sun>=1 2:00s 1:00 - -Rule ATAQ 1991 2005 - Mar lastSun 2:00s 0 - -Rule ATAQ 2000 only - Aug lastSun 2:00s 1:00 - -Rule ATAQ 2001 max - Oct Sun>=1 2:00s 1:00 - -Rule ATAQ 2006 only - Apr Sun>=1 2:00s 0 - -Rule ATAQ 2007 only - Mar lastSun 2:00s 0 - -Rule ATAQ 2008 max - Apr Sun>=1 2:00s 0 - - # Argentina - year-round bases # Belgrano II, Confin Coast, -770227-0343737, since 1972-02-05 # Esperanza, San Martin Land, -6323-05659, since 1952-12-17 @@ -122,10 +94,7 @@ Rule ATAQ 2008 max - Apr Sun>=1 2:00s 0 # # From Steffen Thorsen (2010-03-10): -# We got these changes from the Australian Antarctic Division: -# - Macquarie Island will stay on UTC+11 for winter and therefore not -# switch back from daylight savings time when other parts of Australia do -# on 4 April. +# We got these changes from the Australian Antarctic Division: ... # # - Casey station reverted to its normal time of UTC+8 on 5 March 2010. # The change to UTC+11 is being considered as a regular summer thing but @@ -136,9 +105,6 @@ Rule ATAQ 2008 max - Apr Sun>=1 2:00s 0 # # - Mawson station stays on UTC+5. # -# In addition to the Rule changes for Casey/Davis, it means that Macquarie -# will no longer be like Hobart and will have to have its own Zone created. -# # Background: # # http://www.timeanddate.com/news/time/antartica-time-changes-2010.html @@ -165,12 +131,6 @@ Zone Antarctica/Mawson 0 - zzz 1954 Feb 6:00 - MAWT 2009 Oct 18 2:00 # Mawson Time 5:00 - MAWT -Zone Antarctica/Macquarie 0 - zzz 1911 - 10:00 - EST 1916 Oct 1 2:00 - 10:00 1:00 EST 1917 Feb - 10:00 AusAQ EST 1967 - 10:00 ATAQ EST 2010 Apr 4 3:00 - 11:00 - MIST # Macquarie Island Time # References: # # Casey Weather (1998-02-26) Modified: head/contrib/tzdata/asia ============================================================================== --- head/contrib/tzdata/asia Sat Apr 20 11:35:25 2013 (r249691) +++ head/contrib/tzdata/asia Sat Apr 20 11:42:10 2013 (r249692) @@ -2291,11 +2291,20 @@ Zone Asia/Karachi 4:28:12 - LMT 1907 # http://www.timeanddate.com/news/time/gaza-west-bank-dst-2012.html # -# From Arthur David Olson (2012-03-27): -# The timeanddate article for 2012 says that "the end date has not yet been -# announced" and that "Last year, both...paused daylight saving time during... -# Ramadan. It is not yet known [for] 2012." -# For now, assume both switch back on the last Friday in September. XXX +# From Steffen Thorsen (2013-03-26): +# The following news sources tells that Palestine will "start daylight saving +# time from midnight on Friday, March 29, 2013" (translated). +# [These are in Arabic and are for Gaza and for Ramallah, respectively.] +# http://www.samanews.com/index.php?act=Show&id=154120 +# http://safa.ps/details/news/99844/%D8%B1%D8%A7%D9%85-%D8%A7%D9%84%D9%84%D9%87-%D8%A8%D8%AF%D8%A1-%D8%A7%D9%84%D8%AA%D9%88%D9%82%D9%8A%D8%AA-%D8%A7%D9%84%D8%B5%D9%8A%D9%81%D9%8A-29-%D8%A7%D9%84%D8%AC%D8%A7%D8%B1%D9%8A.html + +# From Paul Eggert (2013-04-15): +# For future dates, guess the last Thursday in March at 24:00 through +# the first Friday on or after September 21 at 01:00. This is consistent with +# the predictions in today's editions of the following URLs, +# which are for Gaza and Hebron respectively: +# http://www.timeanddate.com/worldclock/timezone.html?n=702 +# http://www.timeanddate.com/worldclock/timezone.html?n=2364 # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule EgyptAsia 1957 only - May 10 0:00 1:00 S @@ -2309,19 +2318,20 @@ Rule Palestine 1999 2005 - Apr Fri>=15 0 Rule Palestine 1999 2003 - Oct Fri>=15 0:00 0 - Rule Palestine 2004 only - Oct 1 1:00 0 - Rule Palestine 2005 only - Oct 4 2:00 0 - -Rule Palestine 2006 2008 - Apr 1 0:00 1:00 S +Rule Palestine 2006 2007 - Apr 1 0:00 1:00 S Rule Palestine 2006 only - Sep 22 0:00 0 - Rule Palestine 2007 only - Sep Thu>=8 2:00 0 - -Rule Palestine 2008 only - Aug lastFri 0:00 0 - -Rule Palestine 2009 only - Mar lastFri 0:00 1:00 S -Rule Palestine 2009 only - Sep Fri>=1 2:00 0 - -Rule Palestine 2010 only - Mar lastSat 0:01 1:00 S +Rule Palestine 2008 2009 - Mar lastFri 0:00 1:00 S +Rule Palestine 2008 only - Sep 1 0:00 0 - +Rule Palestine 2009 only - Sep Fri>=1 1:00 0 - +Rule Palestine 2010 only - Mar 26 0:00 1:00 S Rule Palestine 2010 only - Aug 11 0:00 0 - - -# From Arthur David Olson (2011-09-20): -# 2011 transitions per http://www.timeanddate.com as of 2011-09-20. -# From Paul Eggert (2012-10-12): -# 2012 transitions per http://www.timeanddate.com as of 2012-10-12. +Rule Palestine 2011 only - Apr 1 0:01 1:00 S +Rule Palestine 2011 only - Aug 1 0:00 0 - +Rule Palestine 2011 only - Aug 30 0:00 1:00 S +Rule Palestine 2011 only - Sep 30 0:00 0 - +Rule Palestine 2012 max - Mar lastThu 24:00 1:00 S +Rule Palestine 2012 max - Sep Fri>=21 1:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Gaza 2:17:52 - LMT 1900 Oct @@ -2329,26 +2339,20 @@ Zone Asia/Gaza 2:17:52 - LMT 1900 Oct 2:00 EgyptAsia EE%sT 1967 Jun 5 2:00 Zion I%sT 1996 2:00 Jordan EE%sT 1999 - 2:00 Palestine EE%sT 2011 Apr 2 12:01 - 2:00 1:00 EEST 2011 Aug 1 - 2:00 - EET 2012 Mar 30 - 2:00 1:00 EEST 2012 Sep 21 1:00 - 2:00 - EET + 2:00 Palestine EE%sT 2008 Aug 29 0:00 + 2:00 - EET 2008 Sep + 2:00 Palestine EE%sT 2010 + 2:00 - EET 2010 Mar 27 0:01 + 2:00 Palestine EE%sT 2011 Aug 1 + 2:00 - EET 2012 + 2:00 Palestine EE%sT Zone Asia/Hebron 2:20:23 - LMT 1900 Oct 2:00 Zion EET 1948 May 15 2:00 EgyptAsia EE%sT 1967 Jun 5 2:00 Zion I%sT 1996 2:00 Jordan EE%sT 1999 - 2:00 Palestine EE%sT 2008 Aug - 2:00 1:00 EEST 2008 Sep - 2:00 Palestine EE%sT 2011 Apr 1 12:01 - 2:00 1:00 EEST 2011 Aug 1 - 2:00 - EET 2011 Aug 30 - 2:00 1:00 EEST 2011 Sep 30 3:00 - 2:00 - EET 2012 Mar 30 - 2:00 1:00 EEST 2012 Sep 21 1:00 - 2:00 - EET + 2:00 Palestine EE%sT # Paracel Is # no information Modified: head/contrib/tzdata/australasia ============================================================================== --- head/contrib/tzdata/australasia Sat Apr 20 11:35:25 2013 (r249691) +++ head/contrib/tzdata/australasia Sat Apr 20 11:42:10 2013 (r249692) @@ -218,9 +218,26 @@ Zone Australia/Lord_Howe 10:36:20 - LMT # no times are set # # Macquarie -# permanent occupation (scientific station) since 1948; -# sealing and penguin oil station operated 1888/1917 -# like Australia/Hobart +# Permanent occupation (scientific station) 1911-1915 and since 25 March 1948; +# sealing and penguin oil station operated Nov 1899 to Apr 1919. See the +# Tasmania Parks & Wildlife Service history of sealing at Macquarie Island +# +# . +# Guess that it was like Australia/Hobart while inhabited before 2010. +# +# From Steffen Thorsen (2010-03-10): +# We got these changes from the Australian Antarctic Division: +# - Macquarie Island will stay on UTC+11 for winter and therefore not +# switch back from daylight savings time when other parts of Australia do +# on 4 April. +Zone Antarctica/Macquarie 0 - zzz 1899 Nov + 10:00 - EST 1916 Oct 1 2:00 + 10:00 1:00 EST 1917 Feb + 10:00 Aus EST 1919 Apr + 0 - zzz 1948 Mar 25 + 10:00 Aus EST 1967 + 10:00 AT EST 2010 Apr 4 3:00 + 11:00 - MIST # Macquarie I Standard Time # Christmas # Zone NAME GMTOFF RULES FORMAT [UNTIL] Modified: head/contrib/tzdata/southamerica ============================================================================== --- head/contrib/tzdata/southamerica Sat Apr 20 11:35:25 2013 (r249691) +++ head/contrib/tzdata/southamerica Sat Apr 20 11:42:10 2013 (r249692) @@ -1566,16 +1566,16 @@ Rule Para 2005 2009 - Mar Sun>=8 0:00 0 # forward 60 minutes, in all the territory of the Paraguayan Republic. # ... Rule Para 2010 max - Oct Sun>=1 0:00 1:00 S -Rule Para 2010 max - Apr Sun>=8 0:00 0 - +Rule Para 2010 2012 - Apr Sun>=8 0:00 0 - # # From Steffen Thorsen (2013-03-07): # Paraguay will end DST on 2013-03-24 00:00.... -# They do not tell if this will be a permanent change or just this year.... # http://www.ande.gov.py/interna.php?id=1075 # -# From Paul Eggert (2013-03-07): -# For now, assume it's just this year. -Rule Para 2013 only - Mar 24 0:00 0 - +# From Carlos Raul Perasso (2013-03-15): +# The change in Paraguay is now final. Decree number 10780 +# http://www.presidencia.gov.py/uploads/pdf/presidencia-3b86ff4b691c79d4f5927ca964922ec74772ce857c02ca054a52a37b49afc7fb.pdf +Rule Para 2013 max - Mar Sun>=22 0:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone America/Asuncion -3:50:40 - LMT 1890 Modified: head/contrib/tzdata/zone.tab ============================================================================== --- head/contrib/tzdata/zone.tab Sat Apr 20 11:35:25 2013 (r249691) +++ head/contrib/tzdata/zone.tab Sat Apr 20 11:42:10 2013 (r249692) @@ -42,7 +42,6 @@ AQ -6617+11031 Antarctica/Casey Casey St AQ -7824+10654 Antarctica/Vostok Vostok Station, Lake Vostok AQ -6640+14001 Antarctica/DumontDUrville Dumont-d'Urville Station, Terre Adelie AQ -690022+0393524 Antarctica/Syowa Syowa Station, E Ongul I -AQ -5430+15857 Antarctica/Macquarie Macquarie Island Station, Macquarie Island AR -3436-05827 America/Argentina/Buenos_Aires Buenos Aires (BA, CF) AR -3124-06411 America/Argentina/Cordoba most locations (CB, CC, CN, ER, FM, MN, SE, SF) AR -2447-06525 America/Argentina/Salta (SA, LP, NQ, RN) @@ -58,6 +57,7 @@ AR -5448-06818 America/Argentina/Ushuaia AS -1416-17042 Pacific/Pago_Pago AT +4813+01620 Europe/Vienna AU -3133+15905 Australia/Lord_Howe Lord Howe Island +AU -5430+15857 Antarctica/Macquarie Macquarie Island AU -4253+14719 Australia/Hobart Tasmania - most locations AU -3956+14352 Australia/Currie Tasmania - King Island AU -3749+14458 Australia/Melbourne Victoria From owner-svn-src-all@FreeBSD.ORG Sat Apr 20 11:44:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9101866E; Sat, 20 Apr 2013 11:44:18 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 831C51855; Sat, 20 Apr 2013 11:44:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3KBiIig057455; Sat, 20 Apr 2013 11:44:18 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3KBiHKk057438; Sat, 20 Apr 2013 11:44:17 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201304201144.r3KBiHKk057438@svn.freebsd.org> From: Edwin Groothuis Date: Sat, 20 Apr 2013 11:44:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org Subject: svn commit: r249693 - stable/6/share/zoneinfo X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Apr 2013 11:44:18 -0000 Author: edwin Date: Sat Apr 20 11:44:17 2013 New Revision: 249693 URL: http://svnweb.freebsd.org/changeset/base/249693 Log: Merge of current from 249692, tzdata2013c: - antarctica: AusAQ and ATAQ have been removed. - Antarctica/Macquarie has been moved to australasia file and AU. - Asia/Hebron, Palestine updated for 2013. - Paraguay stays with DST for the whole year. Modified: stable/6/share/zoneinfo/antarctica stable/6/share/zoneinfo/asia stable/6/share/zoneinfo/australasia stable/6/share/zoneinfo/southamerica stable/6/share/zoneinfo/zone.tab Directory Properties: stable/6/share/zoneinfo/ (props changed) Modified: stable/6/share/zoneinfo/antarctica ============================================================================== --- stable/6/share/zoneinfo/antarctica Sat Apr 20 11:42:10 2013 (r249692) +++ stable/6/share/zoneinfo/antarctica Sat Apr 20 11:44:17 2013 (r249693) @@ -53,34 +53,6 @@ Rule ChileAQ 2011 only - Aug Sun>=16 4:0 Rule ChileAQ 2012 max - Apr Sun>=23 3:00u 0 - Rule ChileAQ 2012 max - Sep Sun>=2 4:00u 1:00 S -# These rules are stolen from the `australasia' file. -Rule AusAQ 1917 only - Jan 1 0:01 1:00 - -Rule AusAQ 1917 only - Mar 25 2:00 0 - -Rule AusAQ 1942 only - Jan 1 2:00 1:00 - -Rule AusAQ 1942 only - Mar 29 2:00 0 - -Rule AusAQ 1942 only - Sep 27 2:00 1:00 - -Rule AusAQ 1943 1944 - Mar lastSun 2:00 0 - -Rule AusAQ 1943 only - Oct 3 2:00 1:00 - -Rule ATAQ 1967 only - Oct Sun>=1 2:00s 1:00 - -Rule ATAQ 1968 only - Mar lastSun 2:00s 0 - -Rule ATAQ 1968 1985 - Oct lastSun 2:00s 1:00 - -Rule ATAQ 1969 1971 - Mar Sun>=8 2:00s 0 - -Rule ATAQ 1972 only - Feb lastSun 2:00s 0 - -Rule ATAQ 1973 1981 - Mar Sun>=1 2:00s 0 - -Rule ATAQ 1982 1983 - Mar lastSun 2:00s 0 - -Rule ATAQ 1984 1986 - Mar Sun>=1 2:00s 0 - -Rule ATAQ 1986 only - Oct Sun>=15 2:00s 1:00 - -Rule ATAQ 1987 1990 - Mar Sun>=15 2:00s 0 - -Rule ATAQ 1987 only - Oct Sun>=22 2:00s 1:00 - -Rule ATAQ 1988 1990 - Oct lastSun 2:00s 1:00 - -Rule ATAQ 1991 1999 - Oct Sun>=1 2:00s 1:00 - -Rule ATAQ 1991 2005 - Mar lastSun 2:00s 0 - -Rule ATAQ 2000 only - Aug lastSun 2:00s 1:00 - -Rule ATAQ 2001 max - Oct Sun>=1 2:00s 1:00 - -Rule ATAQ 2006 only - Apr Sun>=1 2:00s 0 - -Rule ATAQ 2007 only - Mar lastSun 2:00s 0 - -Rule ATAQ 2008 max - Apr Sun>=1 2:00s 0 - - # Argentina - year-round bases # Belgrano II, Confin Coast, -770227-0343737, since 1972-02-05 # Esperanza, San Martin Land, -6323-05659, since 1952-12-17 @@ -122,10 +94,7 @@ Rule ATAQ 2008 max - Apr Sun>=1 2:00s 0 # # From Steffen Thorsen (2010-03-10): -# We got these changes from the Australian Antarctic Division: -# - Macquarie Island will stay on UTC+11 for winter and therefore not -# switch back from daylight savings time when other parts of Australia do -# on 4 April. +# We got these changes from the Australian Antarctic Division: ... # # - Casey station reverted to its normal time of UTC+8 on 5 March 2010. # The change to UTC+11 is being considered as a regular summer thing but @@ -136,9 +105,6 @@ Rule ATAQ 2008 max - Apr Sun>=1 2:00s 0 # # - Mawson station stays on UTC+5. # -# In addition to the Rule changes for Casey/Davis, it means that Macquarie -# will no longer be like Hobart and will have to have its own Zone created. -# # Background: # # http://www.timeanddate.com/news/time/antartica-time-changes-2010.html @@ -165,12 +131,6 @@ Zone Antarctica/Mawson 0 - zzz 1954 Feb 6:00 - MAWT 2009 Oct 18 2:00 # Mawson Time 5:00 - MAWT -Zone Antarctica/Macquarie 0 - zzz 1911 - 10:00 - EST 1916 Oct 1 2:00 - 10:00 1:00 EST 1917 Feb - 10:00 AusAQ EST 1967 - 10:00 ATAQ EST 2010 Apr 4 3:00 - 11:00 - MIST # Macquarie Island Time # References: # # Casey Weather (1998-02-26) Modified: stable/6/share/zoneinfo/asia ============================================================================== --- stable/6/share/zoneinfo/asia Sat Apr 20 11:42:10 2013 (r249692) +++ stable/6/share/zoneinfo/asia Sat Apr 20 11:44:17 2013 (r249693) @@ -2291,11 +2291,20 @@ Zone Asia/Karachi 4:28:12 - LMT 1907 # http://www.timeanddate.com/news/time/gaza-west-bank-dst-2012.html # -# From Arthur David Olson (2012-03-27): -# The timeanddate article for 2012 says that "the end date has not yet been -# announced" and that "Last year, both...paused daylight saving time during... -# Ramadan. It is not yet known [for] 2012." -# For now, assume both switch back on the last Friday in September. XXX +# From Steffen Thorsen (2013-03-26): +# The following news sources tells that Palestine will "start daylight saving +# time from midnight on Friday, March 29, 2013" (translated). +# [These are in Arabic and are for Gaza and for Ramallah, respectively.] +# http://www.samanews.com/index.php?act=Show&id=154120 +# http://safa.ps/details/news/99844/%D8%B1%D8%A7%D9%85-%D8%A7%D9%84%D9%84%D9%87-%D8%A8%D8%AF%D8%A1-%D8%A7%D9%84%D8%AA%D9%88%D9%82%D9%8A%D8%AA-%D8%A7%D9%84%D8%B5%D9%8A%D9%81%D9%8A-29-%D8%A7%D9%84%D8%AC%D8%A7%D8%B1%D9%8A.html + +# From Paul Eggert (2013-04-15): +# For future dates, guess the last Thursday in March at 24:00 through +# the first Friday on or after September 21 at 01:00. This is consistent with +# the predictions in today's editions of the following URLs, +# which are for Gaza and Hebron respectively: +# http://www.timeanddate.com/worldclock/timezone.html?n=702 +# http://www.timeanddate.com/worldclock/timezone.html?n=2364 # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule EgyptAsia 1957 only - May 10 0:00 1:00 S @@ -2309,19 +2318,20 @@ Rule Palestine 1999 2005 - Apr Fri>=15 0 Rule Palestine 1999 2003 - Oct Fri>=15 0:00 0 - Rule Palestine 2004 only - Oct 1 1:00 0 - Rule Palestine 2005 only - Oct 4 2:00 0 - -Rule Palestine 2006 2008 - Apr 1 0:00 1:00 S +Rule Palestine 2006 2007 - Apr 1 0:00 1:00 S Rule Palestine 2006 only - Sep 22 0:00 0 - Rule Palestine 2007 only - Sep Thu>=8 2:00 0 - -Rule Palestine 2008 only - Aug lastFri 0:00 0 - -Rule Palestine 2009 only - Mar lastFri 0:00 1:00 S -Rule Palestine 2009 only - Sep Fri>=1 2:00 0 - -Rule Palestine 2010 only - Mar lastSat 0:01 1:00 S +Rule Palestine 2008 2009 - Mar lastFri 0:00 1:00 S +Rule Palestine 2008 only - Sep 1 0:00 0 - +Rule Palestine 2009 only - Sep Fri>=1 1:00 0 - +Rule Palestine 2010 only - Mar 26 0:00 1:00 S Rule Palestine 2010 only - Aug 11 0:00 0 - - -# From Arthur David Olson (2011-09-20): -# 2011 transitions per http://www.timeanddate.com as of 2011-09-20. -# From Paul Eggert (2012-10-12): -# 2012 transitions per http://www.timeanddate.com as of 2012-10-12. +Rule Palestine 2011 only - Apr 1 0:01 1:00 S +Rule Palestine 2011 only - Aug 1 0:00 0 - +Rule Palestine 2011 only - Aug 30 0:00 1:00 S +Rule Palestine 2011 only - Sep 30 0:00 0 - +Rule Palestine 2012 max - Mar lastThu 24:00 1:00 S +Rule Palestine 2012 max - Sep Fri>=21 1:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Gaza 2:17:52 - LMT 1900 Oct @@ -2329,26 +2339,20 @@ Zone Asia/Gaza 2:17:52 - LMT 1900 Oct 2:00 EgyptAsia EE%sT 1967 Jun 5 2:00 Zion I%sT 1996 2:00 Jordan EE%sT 1999 - 2:00 Palestine EE%sT 2011 Apr 2 12:01 - 2:00 1:00 EEST 2011 Aug 1 - 2:00 - EET 2012 Mar 30 - 2:00 1:00 EEST 2012 Sep 21 1:00 - 2:00 - EET + 2:00 Palestine EE%sT 2008 Aug 29 0:00 + 2:00 - EET 2008 Sep + 2:00 Palestine EE%sT 2010 + 2:00 - EET 2010 Mar 27 0:01 + 2:00 Palestine EE%sT 2011 Aug 1 + 2:00 - EET 2012 + 2:00 Palestine EE%sT Zone Asia/Hebron 2:20:23 - LMT 1900 Oct 2:00 Zion EET 1948 May 15 2:00 EgyptAsia EE%sT 1967 Jun 5 2:00 Zion I%sT 1996 2:00 Jordan EE%sT 1999 - 2:00 Palestine EE%sT 2008 Aug - 2:00 1:00 EEST 2008 Sep - 2:00 Palestine EE%sT 2011 Apr 1 12:01 - 2:00 1:00 EEST 2011 Aug 1 - 2:00 - EET 2011 Aug 30 - 2:00 1:00 EEST 2011 Sep 30 3:00 - 2:00 - EET 2012 Mar 30 - 2:00 1:00 EEST 2012 Sep 21 1:00 - 2:00 - EET + 2:00 Palestine EE%sT # Paracel Is # no information Modified: stable/6/share/zoneinfo/australasia ============================================================================== --- stable/6/share/zoneinfo/australasia Sat Apr 20 11:42:10 2013 (r249692) +++ stable/6/share/zoneinfo/australasia Sat Apr 20 11:44:17 2013 (r249693) @@ -218,9 +218,26 @@ Zone Australia/Lord_Howe 10:36:20 - LMT # no times are set # # Macquarie -# permanent occupation (scientific station) since 1948; -# sealing and penguin oil station operated 1888/1917 -# like Australia/Hobart +# Permanent occupation (scientific station) 1911-1915 and since 25 March 1948; +# sealing and penguin oil station operated Nov 1899 to Apr 1919. See the +# Tasmania Parks & Wildlife Service history of sealing at Macquarie Island +# +# . +# Guess that it was like Australia/Hobart while inhabited before 2010. +# +# From Steffen Thorsen (2010-03-10): +# We got these changes from the Australian Antarctic Division: +# - Macquarie Island will stay on UTC+11 for winter and therefore not +# switch back from daylight savings time when other parts of Australia do +# on 4 April. +Zone Antarctica/Macquarie 0 - zzz 1899 Nov + 10:00 - EST 1916 Oct 1 2:00 + 10:00 1:00 EST 1917 Feb + 10:00 Aus EST 1919 Apr + 0 - zzz 1948 Mar 25 + 10:00 Aus EST 1967 + 10:00 AT EST 2010 Apr 4 3:00 + 11:00 - MIST # Macquarie I Standard Time # Christmas # Zone NAME GMTOFF RULES FORMAT [UNTIL] Modified: stable/6/share/zoneinfo/southamerica ============================================================================== --- stable/6/share/zoneinfo/southamerica Sat Apr 20 11:42:10 2013 (r249692) +++ stable/6/share/zoneinfo/southamerica Sat Apr 20 11:44:17 2013 (r249693) @@ -1566,16 +1566,16 @@ Rule Para 2005 2009 - Mar Sun>=8 0:00 0 # forward 60 minutes, in all the territory of the Paraguayan Republic. # ... Rule Para 2010 max - Oct Sun>=1 0:00 1:00 S -Rule Para 2010 max - Apr Sun>=8 0:00 0 - +Rule Para 2010 2012 - Apr Sun>=8 0:00 0 - # # From Steffen Thorsen (2013-03-07): # Paraguay will end DST on 2013-03-24 00:00.... -# They do not tell if this will be a permanent change or just this year.... # http://www.ande.gov.py/interna.php?id=1075 # -# From Paul Eggert (2013-03-07): -# For now, assume it's just this year. -Rule Para 2013 only - Mar 24 0:00 0 - +# From Carlos Raul Perasso (2013-03-15): +# The change in Paraguay is now final. Decree number 10780 +# http://www.presidencia.gov.py/uploads/pdf/presidencia-3b86ff4b691c79d4f5927ca964922ec74772ce857c02ca054a52a37b49afc7fb.pdf +Rule Para 2013 max - Mar Sun>=22 0:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone America/Asuncion -3:50:40 - LMT 1890 Modified: stable/6/share/zoneinfo/zone.tab ============================================================================== --- stable/6/share/zoneinfo/zone.tab Sat Apr 20 11:42:10 2013 (r249692) +++ stable/6/share/zoneinfo/zone.tab Sat Apr 20 11:44:17 2013 (r249693) @@ -42,7 +42,6 @@ AQ -6617+11031 Antarctica/Casey Casey St AQ -7824+10654 Antarctica/Vostok Vostok Station, Lake Vostok AQ -6640+14001 Antarctica/DumontDUrville Dumont-d'Urville Station, Terre Adelie AQ -690022+0393524 Antarctica/Syowa Syowa Station, E Ongul I -AQ -5430+15857 Antarctica/Macquarie Macquarie Island Station, Macquarie Island AR -3436-05827 America/Argentina/Buenos_Aires Buenos Aires (BA, CF) AR -3124-06411 America/Argentina/Cordoba most locations (CB, CC, CN, ER, FM, MN, SE, SF) AR -2447-06525 America/Argentina/Salta (SA, LP, NQ, RN) @@ -58,6 +57,7 @@ AR -5448-06818 America/Argentina/Ushuaia AS -1416-17042 Pacific/Pago_Pago AT +4813+01620 Europe/Vienna AU -3133+15905 Australia/Lord_Howe Lord Howe Island +AU -5430+15857 Antarctica/Macquarie Macquarie Island AU -4253+14719 Australia/Hobart Tasmania - most locations AU -3956+14352 Australia/Currie Tasmania - King Island AU -3749+14458 Australia/Melbourne Victoria From owner-svn-src-all@FreeBSD.ORG Sat Apr 20 11:45:10 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 642CA7DD; Sat, 20 Apr 2013 11:45:10 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 53DC4185E; Sat, 20 Apr 2013 11:45:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3KBjAkT058373; Sat, 20 Apr 2013 11:45:10 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3KBj98G058350; Sat, 20 Apr 2013 11:45:09 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201304201145.r3KBj98G058350@svn.freebsd.org> From: Edwin Groothuis Date: Sat, 20 Apr 2013 11:45:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r249694 - stable/7/share/zoneinfo X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Apr 2013 11:45:10 -0000 Author: edwin Date: Sat Apr 20 11:45:08 2013 New Revision: 249694 URL: http://svnweb.freebsd.org/changeset/base/249694 Log: Merge of current from 249692, tzdata2013c: - antarctica: AusAQ and ATAQ have been removed. - Antarctica/Macquarie has been moved to australasia file and AU. - Asia/Hebron, Palestine updated for 2013. - Paraguay stays with DST for the whole year. Modified: stable/7/share/zoneinfo/antarctica stable/7/share/zoneinfo/asia stable/7/share/zoneinfo/australasia stable/7/share/zoneinfo/southamerica stable/7/share/zoneinfo/zone.tab Directory Properties: stable/7/share/zoneinfo/ (props changed) Modified: stable/7/share/zoneinfo/antarctica ============================================================================== --- stable/7/share/zoneinfo/antarctica Sat Apr 20 11:44:17 2013 (r249693) +++ stable/7/share/zoneinfo/antarctica Sat Apr 20 11:45:08 2013 (r249694) @@ -53,34 +53,6 @@ Rule ChileAQ 2011 only - Aug Sun>=16 4:0 Rule ChileAQ 2012 max - Apr Sun>=23 3:00u 0 - Rule ChileAQ 2012 max - Sep Sun>=2 4:00u 1:00 S -# These rules are stolen from the `australasia' file. -Rule AusAQ 1917 only - Jan 1 0:01 1:00 - -Rule AusAQ 1917 only - Mar 25 2:00 0 - -Rule AusAQ 1942 only - Jan 1 2:00 1:00 - -Rule AusAQ 1942 only - Mar 29 2:00 0 - -Rule AusAQ 1942 only - Sep 27 2:00 1:00 - -Rule AusAQ 1943 1944 - Mar lastSun 2:00 0 - -Rule AusAQ 1943 only - Oct 3 2:00 1:00 - -Rule ATAQ 1967 only - Oct Sun>=1 2:00s 1:00 - -Rule ATAQ 1968 only - Mar lastSun 2:00s 0 - -Rule ATAQ 1968 1985 - Oct lastSun 2:00s 1:00 - -Rule ATAQ 1969 1971 - Mar Sun>=8 2:00s 0 - -Rule ATAQ 1972 only - Feb lastSun 2:00s 0 - -Rule ATAQ 1973 1981 - Mar Sun>=1 2:00s 0 - -Rule ATAQ 1982 1983 - Mar lastSun 2:00s 0 - -Rule ATAQ 1984 1986 - Mar Sun>=1 2:00s 0 - -Rule ATAQ 1986 only - Oct Sun>=15 2:00s 1:00 - -Rule ATAQ 1987 1990 - Mar Sun>=15 2:00s 0 - -Rule ATAQ 1987 only - Oct Sun>=22 2:00s 1:00 - -Rule ATAQ 1988 1990 - Oct lastSun 2:00s 1:00 - -Rule ATAQ 1991 1999 - Oct Sun>=1 2:00s 1:00 - -Rule ATAQ 1991 2005 - Mar lastSun 2:00s 0 - -Rule ATAQ 2000 only - Aug lastSun 2:00s 1:00 - -Rule ATAQ 2001 max - Oct Sun>=1 2:00s 1:00 - -Rule ATAQ 2006 only - Apr Sun>=1 2:00s 0 - -Rule ATAQ 2007 only - Mar lastSun 2:00s 0 - -Rule ATAQ 2008 max - Apr Sun>=1 2:00s 0 - - # Argentina - year-round bases # Belgrano II, Confin Coast, -770227-0343737, since 1972-02-05 # Esperanza, San Martin Land, -6323-05659, since 1952-12-17 @@ -122,10 +94,7 @@ Rule ATAQ 2008 max - Apr Sun>=1 2:00s 0 # # From Steffen Thorsen (2010-03-10): -# We got these changes from the Australian Antarctic Division: -# - Macquarie Island will stay on UTC+11 for winter and therefore not -# switch back from daylight savings time when other parts of Australia do -# on 4 April. +# We got these changes from the Australian Antarctic Division: ... # # - Casey station reverted to its normal time of UTC+8 on 5 March 2010. # The change to UTC+11 is being considered as a regular summer thing but @@ -136,9 +105,6 @@ Rule ATAQ 2008 max - Apr Sun>=1 2:00s 0 # # - Mawson station stays on UTC+5. # -# In addition to the Rule changes for Casey/Davis, it means that Macquarie -# will no longer be like Hobart and will have to have its own Zone created. -# # Background: # # http://www.timeanddate.com/news/time/antartica-time-changes-2010.html @@ -165,12 +131,6 @@ Zone Antarctica/Mawson 0 - zzz 1954 Feb 6:00 - MAWT 2009 Oct 18 2:00 # Mawson Time 5:00 - MAWT -Zone Antarctica/Macquarie 0 - zzz 1911 - 10:00 - EST 1916 Oct 1 2:00 - 10:00 1:00 EST 1917 Feb - 10:00 AusAQ EST 1967 - 10:00 ATAQ EST 2010 Apr 4 3:00 - 11:00 - MIST # Macquarie Island Time # References: # # Casey Weather (1998-02-26) Modified: stable/7/share/zoneinfo/asia ============================================================================== --- stable/7/share/zoneinfo/asia Sat Apr 20 11:44:17 2013 (r249693) +++ stable/7/share/zoneinfo/asia Sat Apr 20 11:45:08 2013 (r249694) @@ -2291,11 +2291,20 @@ Zone Asia/Karachi 4:28:12 - LMT 1907 # http://www.timeanddate.com/news/time/gaza-west-bank-dst-2012.html # -# From Arthur David Olson (2012-03-27): -# The timeanddate article for 2012 says that "the end date has not yet been -# announced" and that "Last year, both...paused daylight saving time during... -# Ramadan. It is not yet known [for] 2012." -# For now, assume both switch back on the last Friday in September. XXX +# From Steffen Thorsen (2013-03-26): +# The following news sources tells that Palestine will "start daylight saving +# time from midnight on Friday, March 29, 2013" (translated). +# [These are in Arabic and are for Gaza and for Ramallah, respectively.] +# http://www.samanews.com/index.php?act=Show&id=154120 +# http://safa.ps/details/news/99844/%D8%B1%D8%A7%D9%85-%D8%A7%D9%84%D9%84%D9%87-%D8%A8%D8%AF%D8%A1-%D8%A7%D9%84%D8%AA%D9%88%D9%82%D9%8A%D8%AA-%D8%A7%D9%84%D8%B5%D9%8A%D9%81%D9%8A-29-%D8%A7%D9%84%D8%AC%D8%A7%D8%B1%D9%8A.html + +# From Paul Eggert (2013-04-15): +# For future dates, guess the last Thursday in March at 24:00 through +# the first Friday on or after September 21 at 01:00. This is consistent with +# the predictions in today's editions of the following URLs, +# which are for Gaza and Hebron respectively: +# http://www.timeanddate.com/worldclock/timezone.html?n=702 +# http://www.timeanddate.com/worldclock/timezone.html?n=2364 # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule EgyptAsia 1957 only - May 10 0:00 1:00 S @@ -2309,19 +2318,20 @@ Rule Palestine 1999 2005 - Apr Fri>=15 0 Rule Palestine 1999 2003 - Oct Fri>=15 0:00 0 - Rule Palestine 2004 only - Oct 1 1:00 0 - Rule Palestine 2005 only - Oct 4 2:00 0 - -Rule Palestine 2006 2008 - Apr 1 0:00 1:00 S +Rule Palestine 2006 2007 - Apr 1 0:00 1:00 S Rule Palestine 2006 only - Sep 22 0:00 0 - Rule Palestine 2007 only - Sep Thu>=8 2:00 0 - -Rule Palestine 2008 only - Aug lastFri 0:00 0 - -Rule Palestine 2009 only - Mar lastFri 0:00 1:00 S -Rule Palestine 2009 only - Sep Fri>=1 2:00 0 - -Rule Palestine 2010 only - Mar lastSat 0:01 1:00 S +Rule Palestine 2008 2009 - Mar lastFri 0:00 1:00 S +Rule Palestine 2008 only - Sep 1 0:00 0 - +Rule Palestine 2009 only - Sep Fri>=1 1:00 0 - +Rule Palestine 2010 only - Mar 26 0:00 1:00 S Rule Palestine 2010 only - Aug 11 0:00 0 - - -# From Arthur David Olson (2011-09-20): -# 2011 transitions per http://www.timeanddate.com as of 2011-09-20. -# From Paul Eggert (2012-10-12): -# 2012 transitions per http://www.timeanddate.com as of 2012-10-12. +Rule Palestine 2011 only - Apr 1 0:01 1:00 S +Rule Palestine 2011 only - Aug 1 0:00 0 - +Rule Palestine 2011 only - Aug 30 0:00 1:00 S +Rule Palestine 2011 only - Sep 30 0:00 0 - +Rule Palestine 2012 max - Mar lastThu 24:00 1:00 S +Rule Palestine 2012 max - Sep Fri>=21 1:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Gaza 2:17:52 - LMT 1900 Oct @@ -2329,26 +2339,20 @@ Zone Asia/Gaza 2:17:52 - LMT 1900 Oct 2:00 EgyptAsia EE%sT 1967 Jun 5 2:00 Zion I%sT 1996 2:00 Jordan EE%sT 1999 - 2:00 Palestine EE%sT 2011 Apr 2 12:01 - 2:00 1:00 EEST 2011 Aug 1 - 2:00 - EET 2012 Mar 30 - 2:00 1:00 EEST 2012 Sep 21 1:00 - 2:00 - EET + 2:00 Palestine EE%sT 2008 Aug 29 0:00 + 2:00 - EET 2008 Sep + 2:00 Palestine EE%sT 2010 + 2:00 - EET 2010 Mar 27 0:01 + 2:00 Palestine EE%sT 2011 Aug 1 + 2:00 - EET 2012 + 2:00 Palestine EE%sT Zone Asia/Hebron 2:20:23 - LMT 1900 Oct 2:00 Zion EET 1948 May 15 2:00 EgyptAsia EE%sT 1967 Jun 5 2:00 Zion I%sT 1996 2:00 Jordan EE%sT 1999 - 2:00 Palestine EE%sT 2008 Aug - 2:00 1:00 EEST 2008 Sep - 2:00 Palestine EE%sT 2011 Apr 1 12:01 - 2:00 1:00 EEST 2011 Aug 1 - 2:00 - EET 2011 Aug 30 - 2:00 1:00 EEST 2011 Sep 30 3:00 - 2:00 - EET 2012 Mar 30 - 2:00 1:00 EEST 2012 Sep 21 1:00 - 2:00 - EET + 2:00 Palestine EE%sT # Paracel Is # no information Modified: stable/7/share/zoneinfo/australasia ============================================================================== --- stable/7/share/zoneinfo/australasia Sat Apr 20 11:44:17 2013 (r249693) +++ stable/7/share/zoneinfo/australasia Sat Apr 20 11:45:08 2013 (r249694) @@ -218,9 +218,26 @@ Zone Australia/Lord_Howe 10:36:20 - LMT # no times are set # # Macquarie -# permanent occupation (scientific station) since 1948; -# sealing and penguin oil station operated 1888/1917 -# like Australia/Hobart +# Permanent occupation (scientific station) 1911-1915 and since 25 March 1948; +# sealing and penguin oil station operated Nov 1899 to Apr 1919. See the +# Tasmania Parks & Wildlife Service history of sealing at Macquarie Island +# +# . +# Guess that it was like Australia/Hobart while inhabited before 2010. +# +# From Steffen Thorsen (2010-03-10): +# We got these changes from the Australian Antarctic Division: +# - Macquarie Island will stay on UTC+11 for winter and therefore not +# switch back from daylight savings time when other parts of Australia do +# on 4 April. +Zone Antarctica/Macquarie 0 - zzz 1899 Nov + 10:00 - EST 1916 Oct 1 2:00 + 10:00 1:00 EST 1917 Feb + 10:00 Aus EST 1919 Apr + 0 - zzz 1948 Mar 25 + 10:00 Aus EST 1967 + 10:00 AT EST 2010 Apr 4 3:00 + 11:00 - MIST # Macquarie I Standard Time # Christmas # Zone NAME GMTOFF RULES FORMAT [UNTIL] Modified: stable/7/share/zoneinfo/southamerica ============================================================================== --- stable/7/share/zoneinfo/southamerica Sat Apr 20 11:44:17 2013 (r249693) +++ stable/7/share/zoneinfo/southamerica Sat Apr 20 11:45:08 2013 (r249694) @@ -1566,16 +1566,16 @@ Rule Para 2005 2009 - Mar Sun>=8 0:00 0 # forward 60 minutes, in all the territory of the Paraguayan Republic. # ... Rule Para 2010 max - Oct Sun>=1 0:00 1:00 S -Rule Para 2010 max - Apr Sun>=8 0:00 0 - +Rule Para 2010 2012 - Apr Sun>=8 0:00 0 - # # From Steffen Thorsen (2013-03-07): # Paraguay will end DST on 2013-03-24 00:00.... -# They do not tell if this will be a permanent change or just this year.... # http://www.ande.gov.py/interna.php?id=1075 # -# From Paul Eggert (2013-03-07): -# For now, assume it's just this year. -Rule Para 2013 only - Mar 24 0:00 0 - +# From Carlos Raul Perasso (2013-03-15): +# The change in Paraguay is now final. Decree number 10780 +# http://www.presidencia.gov.py/uploads/pdf/presidencia-3b86ff4b691c79d4f5927ca964922ec74772ce857c02ca054a52a37b49afc7fb.pdf +Rule Para 2013 max - Mar Sun>=22 0:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone America/Asuncion -3:50:40 - LMT 1890 Modified: stable/7/share/zoneinfo/zone.tab ============================================================================== --- stable/7/share/zoneinfo/zone.tab Sat Apr 20 11:44:17 2013 (r249693) +++ stable/7/share/zoneinfo/zone.tab Sat Apr 20 11:45:08 2013 (r249694) @@ -42,7 +42,6 @@ AQ -6617+11031 Antarctica/Casey Casey St AQ -7824+10654 Antarctica/Vostok Vostok Station, Lake Vostok AQ -6640+14001 Antarctica/DumontDUrville Dumont-d'Urville Station, Terre Adelie AQ -690022+0393524 Antarctica/Syowa Syowa Station, E Ongul I -AQ -5430+15857 Antarctica/Macquarie Macquarie Island Station, Macquarie Island AR -3436-05827 America/Argentina/Buenos_Aires Buenos Aires (BA, CF) AR -3124-06411 America/Argentina/Cordoba most locations (CB, CC, CN, ER, FM, MN, SE, SF) AR -2447-06525 America/Argentina/Salta (SA, LP, NQ, RN) @@ -58,6 +57,7 @@ AR -5448-06818 America/Argentina/Ushuaia AS -1416-17042 Pacific/Pago_Pago AT +4813+01620 Europe/Vienna AU -3133+15905 Australia/Lord_Howe Lord Howe Island +AU -5430+15857 Antarctica/Macquarie Macquarie Island AU -4253+14719 Australia/Hobart Tasmania - most locations AU -3956+14352 Australia/Currie Tasmania - King Island AU -3749+14458 Australia/Melbourne Victoria From owner-svn-src-all@FreeBSD.ORG Sat Apr 20 11:45:49 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 75F08946 for ; Sat, 20 Apr 2013 11:45:49 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from mail-da0-x235.google.com (mail-da0-x235.google.com [IPv6:2607:f8b0:400e:c00::235]) by mx1.freebsd.org (Postfix) with ESMTP id 50C561865 for ; Sat, 20 Apr 2013 11:45:49 +0000 (UTC) Received: by mail-da0-f53.google.com with SMTP id n34so2340096dal.12 for ; Sat, 20 Apr 2013 04:45:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:sender:subject:mime-version:content-type:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to:x-mailer:x-gm-message-state; bh=8TCNneII8gau7mY+pR0sfxLAP7xIiIAiO9t+eyQcQCc=; b=NcRSUFX5T3bCP+KytqTi92juCjmKSxNvUAqpuUBRyIq3407bdQU5EeYLMrax/4Wo4T KpP/Z7Waph6bmzbIRPCGrXce86OJAe2EB7lgaG9rpiSjic456JNx361mDzHP7EZfkR/C /ug7lowntknVCICToGgQzYittwAr+Vm4ZI+0JXQX3wDjpKBGzGKW1EDgDbT7UvG+jpnY QtLV4NoYwF1Zhc+WoMQAI9mom4TjJC8aeZhBm0U1lteyoZQe6icHxjRuRoGsGjgD9LFg ztprS4UbyZO7uLO7i3knVHaJartUmdTsPpFRqlF1kzllAUJ9XMZZgDjP/2lZ3VLgzQsB RXKw== X-Received: by 10.66.161.69 with SMTP id xq5mr20309658pab.136.1366458349037; Sat, 20 Apr 2013 04:45:49 -0700 (PDT) Received: from [10.0.0.53] (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198]) by mx.google.com with ESMTPS id wi6sm16960045pbc.22.2013.04.20.04.45.46 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 20 Apr 2013 04:45:47 -0700 (PDT) Sender: Warner Losh Subject: Re: svn commit: r249658 - in head: bin/chio sys/cam/scsi sys/sys Mime-Version: 1.0 (Apple Message framework v1085) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: <201304192003.r3JK3qFB013463@svn.freebsd.org> Date: Sat, 20 Apr 2013 05:45:43 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <82451AEC-79FD-448F-B180-C2CEC47EB18B@bsdimp.com> References: <201304192003.r3JK3qFB013463@svn.freebsd.org> To: Kenneth D. Merry X-Mailer: Apple Mail (2.1085) X-Gm-Message-State: ALoCoQlS1gZqsiqGNaYR6cR5Gs5xmyYTZoPU3OKfBQ/y+EIae5fPR+B3LNMB6mIg36wXUMtrWHlj Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Apr 2013 11:45:49 -0000 Hey Ken, this change doesn't compile for me. See below Warner On Apr 19, 2013, at 2:03 PM, Kenneth D. Merry wrote: > Author: ken > Date: Fri Apr 19 20:03:51 2013 > New Revision: 249658 > URL: http://svnweb.freebsd.org/changeset/base/249658 >=20 > Log: > Update chio(1) and ch(4) to support reporting element designators. >=20 > This allows mapping a tape drive in a changer (as reported by > 'chio status') to a sa(4) driver instance by comparing the > serial numbers. >=20 > The designators can be ASCII (which is printed out directly), binary > (which is printed in hex format) or UTF-8, which is printed in either > native UTF-8 format if the terminal can support it, or in %XX = notation > for non-ASCII characters. Thanks to Hiroki Sato for the > explaining UTF-8 printing and example UTF-8 printing code. >=20 > chio.h: Modify the changer_element_status structure to = add new > fields and definitions from the SMC3r16 spec. >=20 > Rename the original CHIOGSTATUS ioctl to OCHIOGTATUS and > define a new CHIOGSTATUS ioctl. >=20 > Clean up some tab/space issues. >=20 > chio.c: For the 'status' subcommand, print the designator field > if it is supplied by a device. >=20 > scsi_ch.h: Add new flags for DVCID and CURDATA to the READ > ELEMENT STATUS command structure. >=20 > Add a read_element_status_device_id structure > for the data fields in the new standard. Add new > unions, dt_or_obsolete and voltage_devid, to hold > and address data from either SCSI-2 or newer devices. >=20 > scsi_ch.c: Implement support for fetching device IDs with READ > ELEMENT STATUS data. >=20 > Add new arguments to scsi_read_element_status() to > allow the user to request the DVCID and CURDATA bits. > This isn't compiled into libcam (it's only an internal > kernel interface), so we don't need any special > handling for the API change. >=20 > If the user issues the new CHIOGSTATUS ioctl, copy all = of > the available element status data out. If he issues the > OCHIOGSTATUS ioctl, we don't copy the new fields in the > structure. >=20 > Fix a bug in chopen() that would result in the = peripheral > never getting unheld if chgetparams() failed. >=20 > Sponsored by: Spectra Logic > Submitted by: Po-Li Soong > MFC After: 1 week >=20 > Modified: > head/bin/chio/chio.c > head/sys/cam/scsi/scsi_ch.c > head/sys/cam/scsi/scsi_ch.h > head/sys/sys/chio.h >=20 > Modified: head/bin/chio/chio.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/bin/chio/chio.c Fri Apr 19 19:45:00 2013 = (r249657) > +++ head/bin/chio/chio.c Fri Apr 19 20:03:51 2013 = (r249658) > @@ -54,6 +54,8 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > +#include >=20 > #include "defs.h" > #include "pathnames.h" > @@ -81,6 +83,7 @@ static int do_status(const char *, int,=20 > static int do_ielem(const char *, int, char **); > static int do_return(const char *, int, char **); > static int do_voltag(const char *, int, char **); > +static void print_designator(const char *, u_int8_t, u_int8_t); >=20 > #ifndef CHET_VT > #define CHET_VT 10 /* Completely = Arbitrary */ > @@ -723,6 +726,10 @@ do_status(const char *cname, int argc, c > putchar('?'); > putchar('>'); > } > + if (ces->ces_designator_length > 0) > + print_designator(ces->ces_designator, > + ces->ces_code_set, > + = ces->ces_designator_length); > putchar('\n'); > } >=20 > @@ -1177,3 +1184,66 @@ usage(void) > "arg1 arg2 [arg3 [...]]\n", getprogname()); > exit(1); > } > + > +#define UTF8CODESET "UTF-8" > + > +static void > +print_designator(const char *designator, u_int8_t code_set, > + u_int8_t designator_length) > +{ > + printf(" serial number: <"); > + switch (code_set) { > + case CES_CODE_SET_ASCII: { > + /* > + * The driver insures that the string is always NUL = terminated. > + */ > + printf("%s", designator); > + break; > + } > + case CES_CODE_SET_UTF_8: { > + char *cs_native; > + > + setlocale(LC_ALL, ""); > + cs_native =3D nl_langinfo(CODESET); > + > + /* See if we can natively print UTF-8 */ > + if (strcmp(cs_native, UTF8CODESET) =3D=3D 0) > + cs_native =3D NULL; > + > + if (cs_native =3D=3D NULL) { > + /* We can natively print UTF-8, so use printf. = */ > + printf("%s", designator); > + } else { > + int i; > + > + /* > + * We can't natively print UTF-8. We should > + * convert it to the terminal's codeset, but = that > + * requires iconv(3) and FreeBSD doesn't have > + * iconv(3) in the base system yet. So we use = %XX > + * notation for non US-ASCII characters instead. > + */ > + for (i =3D 0; i < designator_length && > + designator[i] !=3D '\0'; i++) { > + if ((unsigned char)designator[i] < 0x80) > + printf("%c", designator[i]); > + else > + printf("%%%02x", > + (unsigned = char)designator[i]); > + } > + } > + break; > + } > + case CES_CODE_SET_BINARY: { > + int i; > + > + for (i =3D 0; i < designator_length; i++) > + printf("%02X%s", designator[i], > + (i =3D=3D designator_length - 1) ? "" : " = "); > + break; > + } > + default: > + break; > + } > + printf(">"); > +} >=20 > Modified: head/sys/cam/scsi/scsi_ch.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/cam/scsi/scsi_ch.c Fri Apr 19 19:45:00 2013 = (r249657) > +++ head/sys/cam/scsi/scsi_ch.c Fri Apr 19 20:03:51 2013 = (r249658) > @@ -194,12 +194,14 @@ static int chexchange(struct = cam_periph > static int chposition(struct cam_periph *periph, > struct changer_position *cp); > static int chgetelemstatus(struct cam_periph = *periph, > + int scsi_version, u_long cmd, > struct changer_element_status_request = *csr); > static int chsetvoltag(struct cam_periph *periph, > struct changer_set_voltag_request = *csvr); > static int chielem(struct cam_periph *periph,=20 > unsigned int timeout); > static int chgetparams(struct cam_periph *periph); > +static int chscsiversion(struct cam_periph = *periph); >=20 > static struct periph_driver chdriver =3D > { > @@ -474,6 +476,7 @@ chopen(struct cdev *dev, int flags, int=20 > * Load information about this changer device into the softc. > */ > if ((error =3D chgetparams(periph)) !=3D 0) { > + cam_periph_unhold(periph); > cam_periph_release_locked(periph); > cam_periph_unlock(periph); > return(error); > @@ -772,6 +775,7 @@ chioctl(struct cdev *dev, u_long cmd, ca > switch (cmd) { > case CHIOGPICKER: > case CHIOGPARAMS: > + case OCHIOGSTATUS: > case CHIOGSTATUS: > break; >=20 > @@ -824,10 +828,26 @@ chioctl(struct cdev *dev, u_long cmd, ca > error =3D chielem(periph, *(unsigned int *)addr); > break; >=20 > + case OCHIOGSTATUS: > + { > + error =3D chgetelemstatus(periph, SCSI_REV_2, cmd, > + (struct changer_element_status_request *)addr); > + break; > + } > + > case CHIOGSTATUS: > { > - error =3D chgetelemstatus(periph, > - (struct changer_element_status_request *) = addr); > + int scsi_version; > + > + scsi_version =3D chscsiversion(periph); > + if (scsi_version >=3D SCSI_REV_0) { > + error =3D chgetelemstatus(periph, scsi_version, = cmd, > + (struct changer_element_status_request = *)addr); > + } > + else { /* unable to determine the SCSI version */ > + cam_periph_unlock(periph); > + return (ENXIO); > + } > break; > } >=20 > @@ -1034,18 +1054,20 @@ copy_voltag(struct changer_voltag *uvolt > } >=20 > /* > - * Copy an an element status descriptor to a user-mode > + * Copy an element status descriptor to a user-mode > * changer_element_status structure. > */ > - > -static void > +static void > copy_element_status(struct ch_softc *softc, > u_int16_t flags, > struct read_element_status_descriptor *desc, > - struct changer_element_status *ces) > + struct changer_element_status *ces, > + int scsi_version) > { > u_int16_t eaddr =3D scsi_2btoul(desc->eaddr); > u_int16_t et; > + struct volume_tag *pvol_tag =3D NULL, *avol_tag =3D NULL; > + struct read_element_status_device_id *devid =3D NULL; >=20 > ces->ces_int_addr =3D eaddr; > /* set up logical address in element status */ > @@ -1076,7 +1098,7 @@ copy_element_status(struct ch_softc *sof > if ((softc->sc_firsts[et] <=3D eaddr) > && ((softc->sc_firsts[et] + = softc->sc_counts[et]) > > eaddr)) { > - ces->ces_source_addr =3D=20 > + ces->ces_source_addr =3D > eaddr - softc->sc_firsts[et]; > ces->ces_source_type =3D et; > ces->ces_flags |=3D CES_SOURCE_VALID; > @@ -1089,27 +1111,92 @@ copy_element_status(struct ch_softc *sof > "address %ud to a valid element type\n", > eaddr); > } > - =09 >=20 > + /* > + * pvoltag and avoltag are common between SCSI-2 and later = versions > + */ > if (flags & READ_ELEMENT_STATUS_PVOLTAG) > - copy_voltag(&(ces->ces_pvoltag), &(desc->pvoltag)); > + pvol_tag =3D &desc->voltag_devid.pvoltag; > if (flags & READ_ELEMENT_STATUS_AVOLTAG) > - copy_voltag(&(ces->ces_avoltag), &(desc->avoltag)); > - > - if (desc->dt_scsi_flags & READ_ELEMENT_STATUS_DT_IDVALID) { > - ces->ces_flags |=3D CES_SCSIID_VALID; > - ces->ces_scsi_id =3D desc->dt_scsi_addr; > - } > + avol_tag =3D (flags & READ_ELEMENT_STATUS_PVOLTAG) ? > + &desc->voltag_devid.voltag[1] = :&desc->voltag_devid.pvoltag; > + /* > + * For SCSI-3 and later, element status can carry designator and > + * other information. > + */ > + if (scsi_version >=3D SCSI_REV_SPC) { > + if ((flags & READ_ELEMENT_STATUS_PVOLTAG) ^ > + (flags & READ_ELEMENT_STATUS_AVOLTAG)) > + devid =3D = &desc->voltag_devid.pvol_and_devid.devid; > + else if (!(flags & READ_ELEMENT_STATUS_PVOLTAG) && > + !(flags & READ_ELEMENT_STATUS_AVOLTAG)) > + devid =3D &desc->voltag_devid.devid; > + else /* Have both PVOLTAG and AVOLTAG */ > + devid =3D = &desc->voltag_devid.vol_tags_and_devid.devid; > + } > + > + if (pvol_tag) > + copy_voltag(&(ces->ces_pvoltag), pvol_tag); > + if (avol_tag) > + copy_voltag(&(ces->ces_pvoltag), avol_tag); > + if (devid !=3D NULL) { > + if (devid->designator_length > 0) { > + bcopy((void *)devid->designator, > + (void *)ces->ces_designator, > + devid->designator_length); > + ces->ces_designator_length =3D = devid->designator_length; > + /* > + * Make sure we are always NUL terminated. The > + * buffer should be sized for the maximum > + * designator length plus 1, but this will make = sure > + * there is always a NUL at the end. This won't > + * matter for the binary code set, since the = user > + * will only pay attention to the length field. > + */ > + ces->ces_designator[ > + MIN(sizeof(ces->ces_designator) - 1, > + devid->designator_length)]=3D '\0'; compiler complains here that this comparison is always false due to data = ranges. I hacked it in my copy by always using devid->designator_length, = but I know that's a lame fix. Can you look into it? Also, just got tinderbox mail. Warner > + } > + if (devid->piv_assoc_designator_type & > + READ_ELEMENT_STATUS_PIV_SET) { > + ces->ces_flags |=3D CES_PIV; > + ces->ces_protocol_id =3D > + READ_ELEMENT_STATUS_PROTOCOL_ID( > + devid->prot_code_set); > + } > + ces->ces_code_set =3D > + READ_ELEMENT_STATUS_CODE_SET(devid->prot_code_set); > + ces->ces_assoc =3D READ_ELEMENT_STATUS_ASSOCIATION( > + devid->piv_assoc_designator_type); > + ces->ces_designator_type =3D = READ_ELEMENT_STATUS_DESIGNATOR_TYPE( > + devid->piv_assoc_designator_type); > + } else if (scsi_version > SCSI_REV_2) { > + /* SCSI-SPC and No devid, no designator */ > + ces->ces_designator_length =3D 0; > + ces->ces_designator[0] =3D '\0'; > + ces->ces_protocol_id =3D CES_PROTOCOL_ID_FCP_4; > + } > + > + if (scsi_version <=3D SCSI_REV_2) { > + if (desc->dt_or_obsolete.scsi_2.dt_scsi_flags & > + READ_ELEMENT_STATUS_DT_IDVALID) { > + ces->ces_flags |=3D CES_SCSIID_VALID; > + ces->ces_scsi_id =3D > + desc->dt_or_obsolete.scsi_2.dt_scsi_addr; > + } >=20 > - if (desc->dt_scsi_addr & READ_ELEMENT_STATUS_DT_LUVALID) { > - ces->ces_flags |=3D CES_LUN_VALID; > - ces->ces_scsi_lun =3D=20 > - desc->dt_scsi_flags & = READ_ELEMENT_STATUS_DT_LUNMASK; > + if (desc->dt_or_obsolete.scsi_2.dt_scsi_addr & > + READ_ELEMENT_STATUS_DT_LUVALID) { > + ces->ces_flags |=3D CES_LUN_VALID; > + ces->ces_scsi_lun =3D > + desc->dt_or_obsolete.scsi_2.dt_scsi_flags & > + READ_ELEMENT_STATUS_DT_LUNMASK; > + } > } > } >=20 > static int > -chgetelemstatus(struct cam_periph *periph,=20 > +chgetelemstatus(struct cam_periph *periph, int scsi_version, u_long = cmd, > struct changer_element_status_request *cesr) > { > struct read_element_status_header *st_hdr; > @@ -1155,6 +1242,8 @@ chgetelemstatus(struct cam_periph *perip > /* tag_action */ MSG_SIMPLE_Q_TAG, > /* voltag */ want_voltags, > /* sea */ softc->sc_firsts[chet], > + /* dvcid */ 1, > + /* curdata */ 1, > /* count */ 1, > /* data_ptr */ data, > /* dxfer_len */ 1024, > @@ -1177,7 +1266,6 @@ chgetelemstatus(struct cam_periph *perip > size =3D sizeof(struct read_element_status_header) + > sizeof(struct read_element_status_page_header) + > (desclen * cesr->cesr_element_count); > - > /* > * Reallocate storage for descriptors and get them from the > * device. > @@ -1193,12 +1281,14 @@ chgetelemstatus(struct cam_periph *perip > /* voltag */ want_voltags, > /* sea */ softc->sc_firsts[chet] > + cesr->cesr_element_base, > + /* dvcid */ 1, > + /* curdata */ 1, > /* count */ cesr->cesr_element_count, > /* data_ptr */ data, > /* dxfer_len */ size, > /* sense_len */ SSD_FULL_SIZE, > /* timeout */ = CH_TIMEOUT_READ_ELEMENT_STATUS); > -=09 > + > error =3D cam_periph_runccb(ccb, cherror, /*cam_flags*/ = CAM_RETRY_SELTO, > /*sense_flags*/ SF_RETRY_UA, > softc->device_stats); > @@ -1231,18 +1321,41 @@ chgetelemstatus(struct cam_periph *perip > * Set up the individual element status structures > */ > for (i =3D 0; i < avail; ++i) { > - struct changer_element_status *ces =3D &(user_data[i]); > + struct changer_element_status *ces; >=20 > - copy_element_status(softc, pg_hdr->flags, desc, ces); > + /* > + * In the changer_element_status structure, fields from > + * the beginning to the field of ces_scsi_lun are common > + * between SCSI-2 and SCSI-3, while all the rest are new > + * from SCSI-3. In order to maintain backward = compatibility > + * of the chio command, the ces pointer, below, is = computed > + * such that it lines up with the structure boundary > + * corresponding to the SCSI version. > + */ > + ces =3D cmd =3D=3D OCHIOGSTATUS ? > + (struct changer_element_status *) > + ((unsigned char *)user_data + i * > + (offsetof(struct = changer_element_status,ces_scsi_lun)+1)): > + &user_data[i]; > + > + copy_element_status(softc, pg_hdr->flags, desc, > + ces, scsi_version); >=20 > desc =3D (struct read_element_status_descriptor *) > - ((uintptr_t)desc + desclen); > + ((unsigned char *)desc + desclen); > } >=20 > /* Copy element status structures out to userspace. */ > - error =3D copyout(user_data, > - cesr->cesr_element_status, > - avail * sizeof(struct changer_element_status)); > + if (cmd =3D=3D OCHIOGSTATUS) > + error =3D copyout(user_data, > + cesr->cesr_element_status, > + avail* (offsetof(struct = changer_element_status, > + ces_scsi_lun) + 1)); > + else > + error =3D copyout(user_data, > + cesr->cesr_element_status, > + avail * sizeof(struct = changer_element_status)); > + > cam_periph_lock(periph); >=20 > done: > @@ -1549,6 +1662,39 @@ chgetparams(struct cam_periph *periph) > return(error); > } >=20 > +static int > +chscsiversion(struct cam_periph *periph) > +{ > + struct scsi_inquiry_data *inq_data; > + struct ccb_getdev *cgd; > + int dev_scsi_version; > + struct cam_sim *sim; > + > + sim =3D xpt_path_sim(periph->path); > + mtx_assert(sim->mtx, MA_OWNED); > + if ((cgd =3D (struct ccb_getdev *)xpt_alloc_ccb_nowait()) =3D=3D = NULL) > + return (-1); > + /* > + * Get the device information. > + */ > + xpt_setup_ccb(&cgd->ccb_h, > + periph->path, > + CAM_PRIORITY_NORMAL); > + cgd->ccb_h.func_code =3D XPT_GDEV_TYPE; > + xpt_action((union ccb *)cgd); > + > + if (cgd->ccb_h.status !=3D CAM_REQ_CMP) { > + xpt_free_ccb((union ccb *)cgd); > + return -1; > + } > + > + inq_data =3D &cgd->inq_data; > + dev_scsi_version =3D inq_data->version; > + xpt_free_ccb((union ccb *)cgd); > + > + return dev_scsi_version; > +} > + > void > scsi_move_medium(struct ccb_scsiio *csio, u_int32_t retries, > void (*cbfcnp)(struct cam_periph *, union ccb *), > @@ -1654,6 +1800,7 @@ void > scsi_read_element_status(struct ccb_scsiio *csio, u_int32_t retries, > void (*cbfcnp)(struct cam_periph *, union ccb = *), > u_int8_t tag_action, int voltag, u_int32_t sea, > + int curdata, int dvcid, > u_int32_t count, u_int8_t *data_ptr, > u_int32_t dxfer_len, u_int8_t sense_len, > u_int32_t timeout) > @@ -1668,6 +1815,10 @@ scsi_read_element_status(struct ccb_scsi > scsi_ulto2b(sea, scsi_cmd->sea); > scsi_ulto2b(count, scsi_cmd->count); > scsi_ulto3b(dxfer_len, scsi_cmd->len); > + if (dvcid) > + scsi_cmd->flags |=3D READ_ELEMENT_STATUS_DVCID; > + if (curdata) > + scsi_cmd->flags |=3D READ_ELEMENT_STATUS_CURDATA; >=20 > if (voltag) > scsi_cmd->byte2 |=3D READ_ELEMENT_STATUS_VOLTAG; >=20 > Modified: head/sys/cam/scsi/scsi_ch.h > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/cam/scsi/scsi_ch.h Fri Apr 19 19:45:00 2013 = (r249657) > +++ head/sys/cam/scsi/scsi_ch.h Fri Apr 19 20:03:51 2013 = (r249658) > @@ -136,11 +136,14 @@ struct scsi_position_to_element { > struct scsi_read_element_status { > u_int8_t opcode; > u_int8_t byte2; > -#define READ_ELEMENT_STATUS_VOLTAG 0x10 /* report volume tag = info */ > +#define READ_ELEMENT_STATUS_VOLTAG 0x10 /* report volume = tag info */ > /* ...next 4 bits are an element type code... */ > u_int8_t sea[2]; /* starting element address */ > u_int8_t count[2]; /* number of elements */ > - u_int8_t reserved0; > + u_int8_t flags; > +#define READ_ELEMENT_STATUS_DVCID 0x01 /* report device = serial number */ > +#define READ_ELEMENT_STATUS_CURDATA 0x02 /* allow motion = during command */ > + > u_int8_t len[3]; /* length of data buffer */ > u_int8_t reserved1; > u_int8_t control; > @@ -149,7 +152,7 @@ struct scsi_read_element_status { > struct scsi_request_volume_element_address { > u_int8_t opcode; > u_int8_t byte2; > -#define REQUEST_VOLUME_ELEMENT_ADDRESS_VOLTAG 0x10 > +#define REQUEST_VOLUME_ELEMENT_ADDRESS_VOLTAG 0x10 > /* ...next 4 bits are an element type code... */ > u_int8_t eaddr[2]; /* element address */ > u_int8_t count[2]; /* number of elements */ > @@ -182,8 +185,8 @@ struct read_element_status_header { > struct read_element_status_page_header { > u_int8_t type; /* element type code; see type codes = below */ > u_int8_t flags; > -#define READ_ELEMENT_STATUS_AVOLTAG 0x40 > -#define READ_ELEMENT_STATUS_PVOLTAG 0x80 > +#define READ_ELEMENT_STATUS_AVOLTAG 0x40 > +#define READ_ELEMENT_STATUS_PVOLTAG 0x80 > u_int8_t edl[2]; /* element descriptor length */ > u_int8_t reserved; > u_int8_t nbytes[3]; /* byte count of all descriptors */ > @@ -199,50 +202,79 @@ struct volume_tag { > u_int8_t vsn[2]; /* volume sequence number */ > }; >=20 > +struct read_element_status_device_id { > + u_int8_t prot_code_set; > +#define READ_ELEMENT_STATUS_CODE_SET(p) ((p) & 0x0F) > +#define READ_ELEMENT_STATUS_PROTOCOL_ID(p) ((p) >> 4) > + > + u_int8_t piv_assoc_designator_type; > +#define READ_ELEMENT_STATUS_PIV_SET 0x80 > +#define READ_ELEMENT_STATUS_ASSOCIATION(p) ((p) >> 4) > +#define READ_ELEMENT_STATUS_DESIGNATOR_TYPE(p) ((p) & 0x0F) > + > + u_int8_t reserved2; > + u_int8_t designator_length; > + u_int8_t designator[256]; /* Allocate max length */ > +}; > + > struct read_element_status_descriptor { > u_int8_t eaddr[2]; /* element address */ > u_int8_t flags1; >=20 > -#define READ_ELEMENT_STATUS_FULL 0x01 > -#define READ_ELEMENT_STATUS_IMPEXP 0x02 > -#define READ_ELEMENT_STATUS_EXCEPT 0x04 > -#define READ_ELEMENT_STATUS_ACCESS 0x08 > -#define READ_ELEMENT_STATUS_EXENAB 0x10 > -#define READ_ELEMENT_STATUS_INENAB 0x20 > - > -#define READ_ELEMENT_STATUS_MT_MASK1 0x05 > -#define READ_ELEMENT_STATUS_ST_MASK1 0x0c > -#define READ_ELEMENT_STATUS_IE_MASK1 0x3f > -#define READ_ELEMENT_STATUS_DT_MASK1 0x0c > +#define READ_ELEMENT_STATUS_FULL 0x01 > +#define READ_ELEMENT_STATUS_IMPEXP 0x02 > +#define READ_ELEMENT_STATUS_EXCEPT 0x04 > +#define READ_ELEMENT_STATUS_ACCESS 0x08 > +#define READ_ELEMENT_STATUS_EXENAB 0x10 > +#define READ_ELEMENT_STATUS_INENAB 0x20 > + > +#define READ_ELEMENT_STATUS_MT_MASK1 0x05 > +#define READ_ELEMENT_STATUS_ST_MASK1 0x0c > +#define READ_ELEMENT_STATUS_IE_MASK1 0x3f > +#define READ_ELEMENT_STATUS_DT_MASK1 0x0c >=20 > u_int8_t reserved0; > u_int8_t sense_code; > u_int8_t sense_qual; >=20 > - /* > - * dt_scsi_flags and dt_scsi_addr are valid only on data = transport > - * elements. These bytes are undefined for all other element = types. > - */ > - u_int8_t dt_scsi_flags; > - > -#define READ_ELEMENT_STATUS_DT_LUNMASK 0x07 > -#define READ_ELEMENT_STATUS_DT_LUVALID 0x10 > -#define READ_ELEMENT_STATUS_DT_IDVALID 0x20 > -#define READ_ELEMENT_STATUS_DT_NOTBUS 0x80 > - > - u_int8_t dt_scsi_addr; > - > - u_int8_t reserved1; > + union { > + struct { > + u_int8_t dt_scsi_flags; > + > +#define READ_ELEMENT_STATUS_DT_LUNMASK 0x07 > +#define READ_ELEMENT_STATUS_DT_LUVALID 0x10 > +#define READ_ELEMENT_STATUS_DT_IDVALID 0x20 > +#define READ_ELEMENT_STATUS_DT_NOTBUS 0x80 > + > + u_int8_t dt_scsi_addr; > + u_int8_t reserved1; > + } scsi_2; > + > + /* reserved and obsolete (as of SCSI-3) fields */ > + u_int8_t reserved_or_obsolete[3]; > + } dt_or_obsolete; >=20 > u_int8_t flags2; > -#define READ_ELEMENT_STATUS_INVERT 0x40 > -#define READ_ELEMENT_STATUS_SVALID 0x80 > - u_int8_t ssea[2]; /* source storage element = address */ > +#define READ_ELEMENT_STATUS_INVERT 0x40 > +#define READ_ELEMENT_STATUS_SVALID 0x80 > +#define READ_ELEMENT_STATUS_ED 0x80 > +#define READ_ELEMENT_STATUS_MEDIA_TYPE_MASK 0x07 >=20 > - struct volume_tag pvoltag; /* omitted if PVOLTAG =3D=3D 0 = */ > - struct volume_tag avoltag; /* omitted if AVOLTAG =3D=3D 0 = */ > + u_int8_t ssea[2]; /* source storage element = address */ >=20 > - /* Other data may follow */ > + union { > + struct volume_tag pvoltag; > + struct volume_tag voltag[2]; > + struct read_element_status_device_id devid; > + struct { > + struct volume_tag pvoltag; > + struct read_element_status_device_id devid; > + } pvol_and_devid; > + struct { > + struct volume_tag = voltag[2]; > + struct read_element_status_device_id devid; > + } vol_tags_and_devid; > + } voltag_devid; > }; >=20 > /* XXX add data returned by REQUEST VOLUME ELEMENT ADDRESS */ > @@ -457,6 +489,7 @@ void scsi_position_to_element(struct ccb > void scsi_read_element_status(struct ccb_scsiio *csio, u_int32_t = retries, > void (*cbfcnp)(struct cam_periph *, union = ccb *), > u_int8_t tag_action, int voltag, u_int32_t = sea, > + int curdata, int dvcid, > u_int32_t count, u_int8_t *data_ptr, > u_int32_t dxfer_len, u_int8_t sense_len, > u_int32_t timeout); >=20 > Modified: head/sys/sys/chio.h > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/sys/chio.h Fri Apr 19 19:45:00 2013 = (r249657) > +++ head/sys/sys/chio.h Fri Apr 19 20:03:51 2013 = (r249658) > @@ -152,7 +152,8 @@ typedef enum { > CES_INVERT =3D 0x040, /* invert bit */ > CES_SOURCE_VALID =3D 0x080, /* source address (ces_source) = valid */ > CES_SCSIID_VALID =3D 0x100, /* ces_scsi_id is valid */ > - CES_LUN_VALID =3D 0x200 /* ces_scsi_lun is valid */ > + CES_LUN_VALID =3D 0x200, /* ces_scsi_lun is valid */ > + CES_PIV =3D 0x400 /* ces_protocol_id is valid */ > } ces_status_flags; >=20 > struct changer_element_status { > @@ -181,6 +182,55 @@ struct changer_element_status { > changer_voltag_t ces_avoltag; /* alternate volume = tag */ > u_int8_t ces_scsi_id; /* SCSI id of element = */ > u_int8_t ces_scsi_lun; /* SCSI lun of element = */ > + > + /* > + * Data members for SMC3 and later versions > + */ > + u_int8_t ces_medium_type; > +#define CES_MEDIUM_TYPE_UNKNOWN 0 /* Medium type = unspecified */ > +#define CES_MEDIUM_TYPE_DATA 1 /* Data medium = */ > +#define CES_MEDIUM_TYPE_CLEANING 2 /* Cleaning = medium */ > +#define CES_MEDIUM_TYPE_DIAGNOSTIC 3 /* Diagnostic = medium */ > +#define CES_MEDIUM_TYPE_WORM 4 /* WORM medium = */ > +#define CES_MEDIUM_TYPE_MICROCODE 5 /* Microcode = image medium */ > + > + u_int8_t ces_protocol_id; > +#define CES_PROTOCOL_ID_FCP_4 0 /* Fiber channel */ > +#define CES_PROTOCOL_ID_SPI_5 1 /* Parallel SCSI */ > +#define CES_PROTOCOL_ID_SSA_S3P 2 /* SSA */ > +#define CES_PROTOCOL_ID_SBP_3 3 /* IEEE 1394 */ > +#define CES_PROTOCOL_ID_SRP 4 /* SCSI Remote DMA */ > +#define CES_PROTOCOL_ID_ISCSI 5 /* iSCSI */ > +#define CES_PROTOCOL_ID_SPL 6 /* SAS */ > +#define CES_PROTOCOL_ID_ADT_2 7 /* Automation/Drive = Interface */ > +#define CES_PROTOCOL_ID_ACS_2 8 /* ATA */ > + > + u_int8_t ces_assoc; > +#define CES_ASSOC_LOGICAL_UNIT 0 > +#define CES_ASSOC_TARGET_PORT 1 > +#define CES_ASSOC_TARGET_DEVICE 2 > + > + u_int8_t ces_designator_type; > +#define CES_DESIGNATOR_TYPE_VENDOR_SPECIFIC 0 > +#define CES_DESIGNATOR_TYPE_T10_VENDOR_ID 1 > +#define CES_DESIGNATOR_TYPE_EUI_64 2 > +#define CES_DESIGNATOR_TYPE_NAA 3 > +#define CES_DESIGNATOR_TYPE_TARGET_PORT_ID 4 > +#define CES_DESIGNATOR_TYPE_TARGET_PORT_GRP 5 > +#define CES_DESIGNATOR_TYPE_LOGICAL_UNIT_GRP 6 > +#define CES_DESIGNATOR_TYPE_MD5_LOGICAL_UNIT_ID 7 > +#define CES_DESIGNATOR_TYPE_SCSI_NAME_STRING 8 > + > + u_int8_t ces_code_set; > +#define CES_CODE_SET_RESERVED 0 > +#define CES_CODE_SET_BINARY 1 > +#define CES_CODE_SET_ASCII 2 > +#define CES_CODE_SET_UTF_8 3 > + > + u_int8_t ces_designator_length; > + > +#define CES_MAX_DESIGNATOR_LENGTH (1 << 8) > + u_int8_t ces_designator[CES_MAX_DESIGNATOR_LENGTH = + 1]; > }; >=20 > struct changer_element_status_request { > @@ -189,7 +239,7 @@ struct changer_element_status_request { > u_int16_t cesr_element_count; >=20 > u_int16_t cesr_flags; > -#define CESR_VOLTAGS 0x01 > +#define CESR_VOLTAGS 0x01 >=20 > struct changer_element_status *cesr_element_status; > }; > @@ -200,28 +250,29 @@ struct changer_set_voltag_request { > u_int16_t csvr_addr; >=20 > u_int16_t csvr_flags; > -#define CSVR_MODE_MASK 0x0f /* mode mask, acceptable = modes below: */ > +#define CSVR_MODE_MASK 0x0f /* mode mask, acceptable = modes below: */ > #define CSVR_MODE_SET 0x00 /* set volume tag if not = set */ > -#define CSVR_MODE_REPLACE 0x01 /* unconditionally replace = volume tag */ > -#define CSVR_MODE_CLEAR 0x02 /* clear volume tag */ > +#define CSVR_MODE_REPLACE 0x01 /* unconditionally = replace volume tag */ > +#define CSVR_MODE_CLEAR 0x02 /* clear volume tag */ >=20 > -#define CSVR_ALTERNATE 0x10 /* set to work with = alternate voltag */ > +#define CSVR_ALTERNATE 0x10 /* set to work with = alternate voltag */ >=20 > changer_voltag_t csvr_voltag; > }; >=20 >=20 > -#define CESTATUS_BITS \ > +#define CESTATUS_BITS \ > "\20\6INEAB\5EXENAB\4ACCESS\3EXCEPT\2IMPEXP\1FULL" >=20 > -#define CHIOMOVE _IOW('c', 0x01, struct changer_move) > -#define CHIOEXCHANGE _IOW('c', 0x02, struct changer_exchange) > -#define CHIOPOSITION _IOW('c', 0x03, struct changer_position) > -#define CHIOGPICKER _IOR('c', 0x04, int) > -#define CHIOSPICKER _IOW('c', 0x05, int) > -#define CHIOGPARAMS _IOR('c', 0x06, struct changer_params) > -#define CHIOIELEM _IOW('c', 0x07, u_int32_t) > -#define CHIOGSTATUS _IOW('c', 0x08, struct = changer_element_status_request) > -#define CHIOSETVOLTAG _IOW('c', 0x09, struct = changer_set_voltag_request) > +#define CHIOMOVE _IOW('c', 0x01, struct changer_move) > +#define CHIOEXCHANGE _IOW('c', 0x02, struct changer_exchange) > +#define CHIOPOSITION _IOW('c', 0x03, struct changer_position) > +#define CHIOGPICKER _IOR('c', 0x04, int) > +#define CHIOSPICKER _IOW('c', 0x05, int) > +#define CHIOGPARAMS _IOR('c', 0x06, struct changer_params) > +#define CHIOIELEM _IOW('c', 0x07, u_int32_t) > +#define OCHIOGSTATUS _IOW('c', 0x08, struct = changer_element_status_request) > +#define CHIOSETVOLTAG _IOW('c', 0x09, struct = changer_set_voltag_request) > +#define CHIOGSTATUS _IOW('c', 0x0A, struct = changer_element_status_request) >=20 > #endif /* !_SYS_CHIO_H_ */ From owner-svn-src-all@FreeBSD.ORG Sat Apr 20 11:46:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1FFEBAA8; Sat, 20 Apr 2013 11:46:03 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 31CE2186A; Sat, 20 Apr 2013 11:46:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3KBk33a059283; Sat, 20 Apr 2013 11:46:03 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3KBk1kC059248; Sat, 20 Apr 2013 11:46:01 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201304201146.r3KBk1kC059248@svn.freebsd.org> From: Edwin Groothuis Date: Sat, 20 Apr 2013 11:46:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r249695 - stable/8/share/zoneinfo X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Apr 2013 11:46:05 -0000 Author: edwin Date: Sat Apr 20 11:46:01 2013 New Revision: 249695 URL: http://svnweb.freebsd.org/changeset/base/249695 Log: Merge of current from 249692, tzdata2013c: - antarctica: AusAQ and ATAQ have been removed. - Antarctica/Macquarie has been moved to australasia file and AU. - Asia/Hebron, Palestine updated for 2013. - Paraguay stays with DST for the whole year. Modified: stable/8/share/zoneinfo/africa stable/8/share/zoneinfo/antarctica stable/8/share/zoneinfo/asia stable/8/share/zoneinfo/australasia stable/8/share/zoneinfo/europe stable/8/share/zoneinfo/northamerica stable/8/share/zoneinfo/southamerica stable/8/share/zoneinfo/zone.tab Directory Properties: stable/8/share/zoneinfo/ (props changed) Modified: stable/8/share/zoneinfo/africa ============================================================================== --- stable/8/share/zoneinfo/africa Sat Apr 20 11:45:08 2013 (r249694) +++ stable/8/share/zoneinfo/africa Sat Apr 20 11:46:01 2013 (r249695) @@ -6,7 +6,7 @@ # go ahead and edit the file (and please send any changes to # tz@iana.org for general use in the future). -# From Paul Eggert (2006-03-22): +# From Paul Eggert (2013-02-21): # # A good source for time zone historical data outside the U.S. is # Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition), @@ -25,6 +25,10 @@ # Whitman Publishing Co, 2 Niagara Av, Ealing, London (undated), which # I found in the UCLA library. # +# For data circa 1899, a common source is: +# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94 +# . +# # A reliable and entertaining source about time zones is # Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997). # @@ -116,8 +120,12 @@ Zone Africa/Porto-Novo 0:10:28 - LMT 191 1:00 - WAT # Botswana +# From Paul Eggert (2013-02-21): +# Milne says they were regulated by the Cape Town Signal in 1899; +# assume they switched to 2:00 when Cape Town did. # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Gaborone 1:43:40 - LMT 1885 + 1:30 - SAST 1903 Mar 2:00 - CAT 1943 Sep 19 2:00 2:00 1:00 CAST 1944 Mar 19 2:00 2:00 - CAT @@ -189,6 +197,11 @@ Zone Africa/Djibouti 2:52:36 - LMT 1911 # Egypt +# Milne says Cairo used 2:05:08.9, the local mean time of the Abbasizeh +# observatory; round to nearest. Milne also says that the official time for +# Egypt was mean noon at the Great Pyramid, 2:04:30.5, but apparently this +# did not apply to Cairo, Alexandria, or Port Said. + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Egypt 1940 only - Jul 15 0:00 1:00 S Rule Egypt 1940 only - Oct 1 0:00 0 - @@ -329,7 +342,7 @@ Rule Egypt 2010 only - Sep 10 0:00 1:00 Rule Egypt 2010 only - Sep lastThu 23:00s 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Cairo 2:05:00 - LMT 1900 Oct +Zone Africa/Cairo 2:05:09 - LMT 1900 Oct 2:00 Egypt EE%sT # Equatorial Guinea @@ -833,6 +846,41 @@ Zone Indian/Mayotte 3:00:56 - LMT 1911 J # 3:00 am Friday, July 20, 2012 and will again be advanced by 60 minutes # August 20, 2012 from 2:00 am. +# From Paul Eggert (2013-03-06): +# Morocco's daylight-saving transitions due to Ramadan seem to be +# announced a bit in advance. On 2012-07-11 the Moroccan government +# announced that year's Ramadan daylight-saving transitions would be +# 2012-07-20 and 2012-08-20; see +# . +# +# To estimate what the Moroccan government will do in future years, +# transition dates for 2013 through 2021 were determined by running +# the following program under GNU Emacs 24.3: +# +# (let ((islamic-year 1434)) +# (while (< islamic-year 1444) +# (let ((a +# (calendar-gregorian-from-absolute +# (calendar-islamic-to-absolute (list 9 1 islamic-year)))) +# (b +# (calendar-gregorian-from-absolute +# (calendar-islamic-to-absolute (list 10 1 islamic-year))))) +# (insert +# (format +# (concat "Rule\tMorocco\t%d\tonly\t-\t%s\t %2d\t 3:00\t0\t-\n" +# "Rule\tMorocco\t%d\tonly\t-\t%s\t %2d\t 2:00\t1:00\tS\n") +# (car (cdr (cdr a))) (calendar-month-name (car a) t) (car (cdr a)) +# (car (cdr (cdr b))) (calendar-month-name (car b) t) (car (cdr b))))) +# (setq islamic-year (+ 1 islamic-year)))) +# +# with the results hand-edited for 2020-2022, when the normal spring-forward +# date falls during the estimated Ramadan. +# +# From 2023 through 2038 Ramadan is not predicted to overlap with +# daylight saving time. Starting in 2039 there will be overlap again, +# but 32-bit time_t values roll around in 2038 so for now do not worry +# about dates after 2038. + # RULE NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Morocco 1939 only - Sep 12 0:00 1:00 S @@ -858,10 +906,28 @@ Rule Morocco 2010 only - May 2 0:00 1: Rule Morocco 2010 only - Aug 8 0:00 0 - Rule Morocco 2011 only - Apr 3 0:00 1:00 S Rule Morocco 2011 only - Jul 31 0 0 - -Rule Morocco 2012 max - Apr lastSun 2:00 1:00 S +Rule Morocco 2012 2019 - Apr lastSun 2:00 1:00 S Rule Morocco 2012 max - Sep lastSun 3:00 0 - Rule Morocco 2012 only - Jul 20 3:00 0 - Rule Morocco 2012 only - Aug 20 2:00 1:00 S +Rule Morocco 2013 only - Jul 9 3:00 0 - +Rule Morocco 2013 only - Aug 8 2:00 1:00 S +Rule Morocco 2014 only - Jun 29 3:00 0 - +Rule Morocco 2014 only - Jul 29 2:00 1:00 S +Rule Morocco 2015 only - Jun 18 3:00 0 - +Rule Morocco 2015 only - Jul 18 2:00 1:00 S +Rule Morocco 2016 only - Jun 7 3:00 0 - +Rule Morocco 2016 only - Jul 7 2:00 1:00 S +Rule Morocco 2017 only - May 27 3:00 0 - +Rule Morocco 2017 only - Jun 26 2:00 1:00 S +Rule Morocco 2018 only - May 16 3:00 0 - +Rule Morocco 2018 only - Jun 15 2:00 1:00 S +Rule Morocco 2019 only - May 6 3:00 0 - +Rule Morocco 2019 only - Jun 5 2:00 1:00 S +Rule Morocco 2020 only - May 24 2:00 1:00 S +Rule Morocco 2021 only - May 13 2:00 1:00 S +Rule Morocco 2022 only - May 3 2:00 1:00 S +Rule Morocco 2023 max - Apr lastSun 2:00 1:00 S # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Casablanca -0:30:20 - LMT 1913 Oct 26 Modified: stable/8/share/zoneinfo/antarctica ============================================================================== --- stable/8/share/zoneinfo/antarctica Sat Apr 20 11:45:08 2013 (r249694) +++ stable/8/share/zoneinfo/antarctica Sat Apr 20 11:46:01 2013 (r249695) @@ -50,38 +50,8 @@ Rule ChileAQ 2009 only - Mar Sun>=9 3:00 Rule ChileAQ 2010 only - Apr Sun>=1 3:00u 0 - Rule ChileAQ 2011 only - May Sun>=2 3:00u 0 - Rule ChileAQ 2011 only - Aug Sun>=16 4:00u 1:00 S -Rule ChileAQ 2012 only - Apr Sun>=23 3:00u 0 - -Rule ChileAQ 2012 only - Sep Sun>=2 4:00u 1:00 S -Rule ChileAQ 2013 max - Mar Sun>=9 3:00u 0 - -Rule ChileAQ 2013 max - Oct Sun>=9 4:00u 1:00 S - -# These rules are stolen from the `australasia' file. -Rule AusAQ 1917 only - Jan 1 0:01 1:00 - -Rule AusAQ 1917 only - Mar 25 2:00 0 - -Rule AusAQ 1942 only - Jan 1 2:00 1:00 - -Rule AusAQ 1942 only - Mar 29 2:00 0 - -Rule AusAQ 1942 only - Sep 27 2:00 1:00 - -Rule AusAQ 1943 1944 - Mar lastSun 2:00 0 - -Rule AusAQ 1943 only - Oct 3 2:00 1:00 - -Rule ATAQ 1967 only - Oct Sun>=1 2:00s 1:00 - -Rule ATAQ 1968 only - Mar lastSun 2:00s 0 - -Rule ATAQ 1968 1985 - Oct lastSun 2:00s 1:00 - -Rule ATAQ 1969 1971 - Mar Sun>=8 2:00s 0 - -Rule ATAQ 1972 only - Feb lastSun 2:00s 0 - -Rule ATAQ 1973 1981 - Mar Sun>=1 2:00s 0 - -Rule ATAQ 1982 1983 - Mar lastSun 2:00s 0 - -Rule ATAQ 1984 1986 - Mar Sun>=1 2:00s 0 - -Rule ATAQ 1986 only - Oct Sun>=15 2:00s 1:00 - -Rule ATAQ 1987 1990 - Mar Sun>=15 2:00s 0 - -Rule ATAQ 1987 only - Oct Sun>=22 2:00s 1:00 - -Rule ATAQ 1988 1990 - Oct lastSun 2:00s 1:00 - -Rule ATAQ 1991 1999 - Oct Sun>=1 2:00s 1:00 - -Rule ATAQ 1991 2005 - Mar lastSun 2:00s 0 - -Rule ATAQ 2000 only - Aug lastSun 2:00s 1:00 - -Rule ATAQ 2001 max - Oct Sun>=1 2:00s 1:00 - -Rule ATAQ 2006 only - Apr Sun>=1 2:00s 0 - -Rule ATAQ 2007 only - Mar lastSun 2:00s 0 - -Rule ATAQ 2008 max - Apr Sun>=1 2:00s 0 - +Rule ChileAQ 2012 max - Apr Sun>=23 3:00u 0 - +Rule ChileAQ 2012 max - Sep Sun>=2 4:00u 1:00 S # Argentina - year-round bases # Belgrano II, Confin Coast, -770227-0343737, since 1972-02-05 @@ -124,10 +94,7 @@ Rule ATAQ 2008 max - Apr Sun>=1 2:00s 0 # # From Steffen Thorsen (2010-03-10): -# We got these changes from the Australian Antarctic Division: -# - Macquarie Island will stay on UTC+11 for winter and therefore not -# switch back from daylight savings time when other parts of Australia do -# on 4 April. +# We got these changes from the Australian Antarctic Division: ... # # - Casey station reverted to its normal time of UTC+8 on 5 March 2010. # The change to UTC+11 is being considered as a regular summer thing but @@ -138,9 +105,6 @@ Rule ATAQ 2008 max - Apr Sun>=1 2:00s 0 # # - Mawson station stays on UTC+5. # -# In addition to the Rule changes for Casey/Davis, it means that Macquarie -# will no longer be like Hobart and will have to have its own Zone created. -# # Background: # # http://www.timeanddate.com/news/time/antartica-time-changes-2010.html @@ -167,12 +131,6 @@ Zone Antarctica/Mawson 0 - zzz 1954 Feb 6:00 - MAWT 2009 Oct 18 2:00 # Mawson Time 5:00 - MAWT -Zone Antarctica/Macquarie 0 - zzz 1911 - 10:00 - EST 1916 Oct 1 2:00 - 10:00 1:00 EST 1917 Feb - 10:00 AusAQ EST 1967 - 10:00 ATAQ EST 2010 Apr 4 3:00 - 11:00 - MIST # Macquarie Island Time # References: # # Casey Weather (1998-02-26) Modified: stable/8/share/zoneinfo/asia ============================================================================== --- stable/8/share/zoneinfo/asia Sat Apr 20 11:45:08 2013 (r249694) +++ stable/8/share/zoneinfo/asia Sat Apr 20 11:46:01 2013 (r249695) @@ -6,7 +6,7 @@ # go ahead and edit the file (and please send any changes to # tz@iana.org for general use in the future). -# From Paul Eggert (2006-03-22): +# From Paul Eggert (2013-02-21): # # A good source for time zone historical data outside the U.S. is # Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition), @@ -25,6 +25,10 @@ # Whitman Publishing Co, 2 Niagara Av, Ealing, London (undated), which # I found in the UCLA library. # +# For data circa 1899, a common source is: +# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94 +# . +# # A reliable and entertaining source about time zones is # Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997). # @@ -279,9 +283,12 @@ Zone Asia/Brunei 7:39:40 - LMT 1926 Mar 8:00 - BNT # Burma / Myanmar + +# Milne says 6:24:40 was the meridian of the time ball observatory at Rangoon. + # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Rangoon 6:24:40 - LMT 1880 # or Yangon - 6:24:36 - RMT 1920 # Rangoon Mean Time? + 6:24:40 - RMT 1920 # Rangoon Mean Time? 6:30 - BURT 1942 May # Burma Time 9:00 - JST 1945 May 3 6:30 - MMT # Myanmar Time @@ -384,7 +391,8 @@ Zone Asia/Harbin 8:26:44 - LMT 1928 # or 8:00 PRC C%sT # Zhongyuan Time ("Central plain Time") # most of China -Zone Asia/Shanghai 8:05:52 - LMT 1928 +# Milne gives 8:05:56.7; round to nearest. +Zone Asia/Shanghai 8:05:57 - LMT 1928 8:00 Shang C%sT 1949 8:00 PRC C%sT # Long-shu Time (probably due to Long and Shu being two names of that area) @@ -481,6 +489,10 @@ Zone Asia/Kashgar 5:03:56 - LMT 1928 # o 8:00 PRC C%sT +# Hong Kong (Xianggang) + +# Milne gives 7:36:41.7; round this. + # From Lee Yiu Chung (2009-10-24): # I found there are some mistakes for the...DST rule for Hong # Kong. [According] to the DST record from Hong Kong Observatory (actually, @@ -547,7 +559,6 @@ Zone Asia/Kashgar 5:03:56 - LMT 1928 # o # The Japanese surrender of Hong Kong was signed 1945-09-15. # For lack of anything better, use start of those days as the transition times. -# Hong Kong (Xianggang) # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule HK 1941 only - Apr 1 3:30 1:00 S Rule HK 1941 only - Sep 30 3:30 0 - @@ -569,7 +580,7 @@ Rule HK 1973 only - Dec 30 3:30 1:00 S Rule HK 1979 only - May Sun>=8 3:30 1:00 S Rule HK 1979 only - Oct Sun>=16 3:30 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Hong_Kong 7:36:36 - LMT 1904 Oct 30 +Zone Asia/Hong_Kong 7:36:42 - LMT 1904 Oct 30 8:00 HK HK%sT 1941 Dec 25 9:00 - JST 1945 Sep 15 8:00 HK HK%sT @@ -646,6 +657,9 @@ Zone Asia/Macau 7:34:20 - LMT 1912 ############################################################################### # Cyprus +# +# Milne says the Eastern Telegraph Company used 2:14:00. Stick with LMT. +# # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Cyprus 1975 only - Apr 13 0:00 1:00 S Rule Cyprus 1975 only - Oct 12 0:00 0 - @@ -1804,8 +1818,11 @@ Zone Asia/Kathmandu 5:41:16 - LMT 1920 5:45 - NPT # Nepal Time # Oman + +# Milne says 3:54:24 was the meridian of the Muscat Tidal Observatory. + # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Muscat 3:54:20 - LMT 1920 +Zone Asia/Muscat 3:54:24 - LMT 1920 4:00 - GST # Pakistan @@ -2274,11 +2291,20 @@ Zone Asia/Karachi 4:28:12 - LMT 1907 # http://www.timeanddate.com/news/time/gaza-west-bank-dst-2012.html # -# From Arthur David Olson (2012-03-27): -# The timeanddate article for 2012 says that "the end date has not yet been -# announced" and that "Last year, both...paused daylight saving time during... -# Ramadan. It is not yet known [for] 2012." -# For now, assume both switch back on the last Friday in September. XXX +# From Steffen Thorsen (2013-03-26): +# The following news sources tells that Palestine will "start daylight saving +# time from midnight on Friday, March 29, 2013" (translated). +# [These are in Arabic and are for Gaza and for Ramallah, respectively.] +# http://www.samanews.com/index.php?act=Show&id=154120 +# http://safa.ps/details/news/99844/%D8%B1%D8%A7%D9%85-%D8%A7%D9%84%D9%84%D9%87-%D8%A8%D8%AF%D8%A1-%D8%A7%D9%84%D8%AA%D9%88%D9%82%D9%8A%D8%AA-%D8%A7%D9%84%D8%B5%D9%8A%D9%81%D9%8A-29-%D8%A7%D9%84%D8%AC%D8%A7%D8%B1%D9%8A.html + +# From Paul Eggert (2013-04-15): +# For future dates, guess the last Thursday in March at 24:00 through +# the first Friday on or after September 21 at 01:00. This is consistent with +# the predictions in today's editions of the following URLs, +# which are for Gaza and Hebron respectively: +# http://www.timeanddate.com/worldclock/timezone.html?n=702 +# http://www.timeanddate.com/worldclock/timezone.html?n=2364 # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule EgyptAsia 1957 only - May 10 0:00 1:00 S @@ -2292,19 +2318,20 @@ Rule Palestine 1999 2005 - Apr Fri>=15 0 Rule Palestine 1999 2003 - Oct Fri>=15 0:00 0 - Rule Palestine 2004 only - Oct 1 1:00 0 - Rule Palestine 2005 only - Oct 4 2:00 0 - -Rule Palestine 2006 2008 - Apr 1 0:00 1:00 S +Rule Palestine 2006 2007 - Apr 1 0:00 1:00 S Rule Palestine 2006 only - Sep 22 0:00 0 - Rule Palestine 2007 only - Sep Thu>=8 2:00 0 - -Rule Palestine 2008 only - Aug lastFri 0:00 0 - -Rule Palestine 2009 only - Mar lastFri 0:00 1:00 S -Rule Palestine 2009 only - Sep Fri>=1 2:00 0 - -Rule Palestine 2010 only - Mar lastSat 0:01 1:00 S +Rule Palestine 2008 2009 - Mar lastFri 0:00 1:00 S +Rule Palestine 2008 only - Sep 1 0:00 0 - +Rule Palestine 2009 only - Sep Fri>=1 1:00 0 - +Rule Palestine 2010 only - Mar 26 0:00 1:00 S Rule Palestine 2010 only - Aug 11 0:00 0 - - -# From Arthur David Olson (2011-09-20): -# 2011 transitions per http://www.timeanddate.com as of 2011-09-20. -# From Paul Eggert (2012-10-12): -# 2012 transitions per http://www.timeanddate.com as of 2012-10-12. +Rule Palestine 2011 only - Apr 1 0:01 1:00 S +Rule Palestine 2011 only - Aug 1 0:00 0 - +Rule Palestine 2011 only - Aug 30 0:00 1:00 S +Rule Palestine 2011 only - Sep 30 0:00 0 - +Rule Palestine 2012 max - Mar lastThu 24:00 1:00 S +Rule Palestine 2012 max - Sep Fri>=21 1:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Gaza 2:17:52 - LMT 1900 Oct @@ -2312,26 +2339,20 @@ Zone Asia/Gaza 2:17:52 - LMT 1900 Oct 2:00 EgyptAsia EE%sT 1967 Jun 5 2:00 Zion I%sT 1996 2:00 Jordan EE%sT 1999 - 2:00 Palestine EE%sT 2011 Apr 2 12:01 - 2:00 1:00 EEST 2011 Aug 1 - 2:00 - EET 2012 Mar 30 - 2:00 1:00 EEST 2012 Sep 21 1:00 - 2:00 - EET + 2:00 Palestine EE%sT 2008 Aug 29 0:00 + 2:00 - EET 2008 Sep + 2:00 Palestine EE%sT 2010 + 2:00 - EET 2010 Mar 27 0:01 + 2:00 Palestine EE%sT 2011 Aug 1 + 2:00 - EET 2012 + 2:00 Palestine EE%sT Zone Asia/Hebron 2:20:23 - LMT 1900 Oct 2:00 Zion EET 1948 May 15 2:00 EgyptAsia EE%sT 1967 Jun 5 2:00 Zion I%sT 1996 2:00 Jordan EE%sT 1999 - 2:00 Palestine EE%sT 2008 Aug - 2:00 1:00 EEST 2008 Sep - 2:00 Palestine EE%sT 2011 Apr 1 12:01 - 2:00 1:00 EEST 2011 Aug 1 - 2:00 - EET 2011 Aug 30 - 2:00 1:00 EEST 2011 Sep 30 3:00 - 2:00 - EET 2012 Mar 30 - 2:00 1:00 EEST 2012 Sep 21 1:00 - 2:00 - EET + 2:00 Palestine EE%sT # Paracel Is # no information @@ -2400,6 +2421,13 @@ Zone Asia/Singapore 6:55:25 - LMT 1901 J # no information # Sri Lanka + +# From Paul Eggert (2013-02-21): +# Milne says "Madras mean time use from May 1, 1898. Prior to this Colombo +# mean time, 5h. 4m. 21.9s. F., was used." But 5:04:21.9 differs considerably +# from Colombo's meridian 5:19:24, so for now ignore Milne and stick with +# Shanks and Pottenger. + # From Paul Eggert (1996-09-03): # "Sri Lanka advances clock by an hour to avoid blackout" # (www.virtual-pc.com/lankaweb/news/items/240596-2.html, 1996-05-24, @@ -2699,6 +2727,12 @@ Zone Asia/Tashkent 4:37:12 - LMT 1924 Ma # Vietnam +# From Paul Eggert (2013-02-21): +# Milne gives 7:16:56 for the meridian of Saigon in 1899, as being +# used in Lower Laos, Cambodia, and Annam. But this is quite a ways +# from Saigon's location. For now, ignore this and stick with Shanks +# and Pottenger. + # From Arthur David Olson (2008-03-18): # The English-language name of Vietnam's most populous city is "Ho Chi Min City"; # we use Ho_Chi_Minh below to avoid a name of more than 14 characters. @@ -2712,6 +2746,10 @@ Zone Asia/Ho_Chi_Minh 7:06:40 - LMT 1906 7:00 - ICT # Yemen + +# Milne says 2:59:54 was the meridian of the saluting battery at Aden, +# and that Yemen was at 1:55:56, the meridian of the Hagia Sophia. + # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Aden 3:00:48 - LMT 1950 +Zone Asia/Aden 2:59:54 - LMT 1950 3:00 - AST Modified: stable/8/share/zoneinfo/australasia ============================================================================== --- stable/8/share/zoneinfo/australasia Sat Apr 20 11:45:08 2013 (r249694) +++ stable/8/share/zoneinfo/australasia Sat Apr 20 11:46:01 2013 (r249695) @@ -218,9 +218,26 @@ Zone Australia/Lord_Howe 10:36:20 - LMT # no times are set # # Macquarie -# permanent occupation (scientific station) since 1948; -# sealing and penguin oil station operated 1888/1917 -# like Australia/Hobart +# Permanent occupation (scientific station) 1911-1915 and since 25 March 1948; +# sealing and penguin oil station operated Nov 1899 to Apr 1919. See the +# Tasmania Parks & Wildlife Service history of sealing at Macquarie Island +# +# . +# Guess that it was like Australia/Hobart while inhabited before 2010. +# +# From Steffen Thorsen (2010-03-10): +# We got these changes from the Australian Antarctic Division: +# - Macquarie Island will stay on UTC+11 for winter and therefore not +# switch back from daylight savings time when other parts of Australia do +# on 4 April. +Zone Antarctica/Macquarie 0 - zzz 1899 Nov + 10:00 - EST 1916 Oct 1 2:00 + 10:00 1:00 EST 1917 Feb + 10:00 Aus EST 1919 Apr + 0 - zzz 1948 Mar 25 + 10:00 Aus EST 1967 + 10:00 AT EST 2010 Apr 4 3:00 + 11:00 - MIST # Macquarie I Standard Time # Christmas # Zone NAME GMTOFF RULES FORMAT [UNTIL] @@ -246,6 +263,9 @@ Zone Indian/Cocos 6:27:40 - LMT 1900 6:30 - CCT # Cocos Islands Time # Fiji + +# Milne gives 11:55:44 for Suva. + # From Alexander Krivenyshev (2009-11-10): # According to Fiji Broadcasting Corporation, Fiji plans to re-introduce DST # from November 29th 2009 to April 25th 2010. @@ -339,7 +359,7 @@ Rule Fiji 2010 max - Oct Sun>=18 2:00 1: Rule Fiji 2011 only - Mar Sun>=1 3:00 0 - Rule Fiji 2012 max - Jan Sun>=18 3:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Pacific/Fiji 11:53:40 - LMT 1915 Oct 26 # Suva +Zone Pacific/Fiji 11:55:44 - LMT 1915 Oct 26 # Suva 12:00 Fiji FJ%sT # Fiji Time # French Polynesia @@ -782,7 +802,7 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901 # go ahead and edit the file (and please send any changes to # tz@iana.org for general use in the future). -# From Paul Eggert (2006-03-22): +# From Paul Eggert (2013-02-21): # A good source for time zone historical data outside the U.S. is # Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition), # San Diego: ACS Publications, Inc. (2003). @@ -800,6 +820,10 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901 # Whitman Publishing Co, 2 Niagara Av, Ealing, London (undated), which # I found in the UCLA library. # +# For data circa 1899, a common source is: +# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94 +# . +# # A reliable and entertaining source about time zones is # Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997). # Modified: stable/8/share/zoneinfo/europe ============================================================================== --- stable/8/share/zoneinfo/europe Sat Apr 20 11:45:08 2013 (r249694) +++ stable/8/share/zoneinfo/europe Sat Apr 20 11:46:01 2013 (r249695) @@ -30,6 +30,12 @@ # William Willett, The Waste of Daylight, 19th edition # (1914-03) # +# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94 +# . He writes: +# "It is requested that corrections and additions to these tables +# may be sent to Mr. John Milne, Royal Geographical Society, +# Savile Row, London." Nowadays please email them to tz@iana.org. +# # Brazil's Departamento Servico da Hora (DSH), # # History of Summer Time @@ -666,6 +672,8 @@ Zone Europe/Andorra 0:06:04 - LMT 1901 # Austria +# Milne says Vienna time was 1:05:21. + # From Paul Eggert (2006-03-22): Shanks & Pottenger give 1918-06-16 and # 1945-11-18, but the Austrian Federal Office of Metrology and # Surveying (BEV) gives 1918-09-16 and for Vienna gives the "alleged" @@ -683,7 +691,7 @@ Rule Austria 1948 only - Apr 18 2:00s 1: Rule Austria 1980 only - Apr 6 0:00 1:00 S Rule Austria 1980 only - Sep 28 0:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Europe/Vienna 1:05:20 - LMT 1893 Apr +Zone Europe/Vienna 1:05:21 - LMT 1893 Apr 1:00 C-Eur CE%sT 1920 1:00 Austria CE%sT 1940 Apr 1 2:00s 1:00 C-Eur CE%sT 1945 Apr 2 2:00s @@ -1239,6 +1247,21 @@ Zone Europe/Berlin 0:53:28 - LMT 1893 Ap 1:00 Germany CE%sT 1980 1:00 EU CE%sT +# From Tobias Conradi (2011-09-12): +# Busingen , surrounded by the Swiss canton +# Schaffhausen, did not start observing DST in 1980 as the rest of DE +# (West Germany at that time) and DD (East Germany at that time) did. +# DD merged into DE, the area is currently covered by code DE in ISO 3166-1, +# which in turn is covered by the zone Europe/Berlin. +# +# Source for the time in Busingen 1980: +# http://www.srf.ch/player/video?id=c012c029-03b7-4c2b-9164-aa5902cd58d3 + +# From Arthur David Olson (2012-03-03): +# Busingen and Zurich have shared clocks since 1970. + +Link Europe/Zurich Europe/Busingen + # Georgia # Please see the "asia" file for Asia/Tbilisi. # Herodotus (Histories, IV.45) says Georgia north of the Phasis (now Rioni) @@ -2043,6 +2066,70 @@ Zone Europe/Bucharest 1:44:24 - LMT 1891 # Russia +# From Alexander Krivenyshev (2011-09-15): +# Based on last Russian Government Decree # 725 on August 31, 2011 +# (Government document +# +# http://www.government.ru/gov/results/16355/print/ +# +# in Russian) +# there are few corrections have to be made for some Russian time zones... +# All updated Russian Time Zones were placed in table and translated to English +# by WorldTimeZone.com at the link below: +# +# http://www.worldtimezone.com/dst_news/dst_news_russia36.htm +# + +# From Sanjeev Gupta (2011-09-27): +# Scans of [Decree #23 of January 8, 1992] are available at: +# +# http://government.consultant.ru/page.aspx?1223966 +# They are in Cyrillic letters (presumably Russian). + +# From Arthur David Olson (2012-05-09): +# Regarding the instant when clocks in time-zone-shifting parts of Russia +# changed in September 2011: +# +# One source is +# < a href="http://government.ru/gov/results/16355/> +# http://government.ru/gov/results/16355/ +# +# which, according to translate.google.com, begins "Decree of August 31, +# 2011 No 725" and contains no other dates or "effective date" information. +# +# Another source is +# +# http://www.rg.ru/2011/09/06/chas-zona-dok.html +# +# which, according to translate.google.com, begins "Resolution of the +# Government of the Russian Federation on August 31, 2011 N 725" and also +# contains "Date first official publication: September 6, 2011 Posted on: +# in the 'RG' - Federal Issue number 5573 September 6, 2011" but which +# does not contain any "effective date" information. +# +# Another source is +# +# http://en.wikipedia.org/wiki/Oymyakonsky_District#cite_note-RuTime-7 +# +# which, in note 8, contains "Resolution #725 of August 31, 2011... +# Effective as of after 7 days following the day of the official publication" +# but which does not contain any reference to September 6, 2011. +# +# The Wikipedia article refers to +# +# http://base.consultant.ru/cons/cgi/online.cgi?req=doc;base=LAW;n=118896 +# +# which seems to copy the text of the government.ru page. +# +# Tobias Conradi combines Wikipedia's +# "as of after 7 days following the day of the official publication" +# with www.rg.ru's "Date of first official publication: September 6, 2011" to get +# September 13, 2011 as the cutover date (unusually, a Tuesday, as Tobias Conradi notes). +# +# None of the sources indicates a time of day for changing clocks. +# +# Go with 2011-09-13 0:00s. + # From Paul Eggert (2006-03-22): # Except for Moscow after 1919-07-01, I invented the time zone abbreviations. # Moscow time zone abbreviations after 1919-07-01, and Moscow rules after 1991, @@ -2270,14 +2357,32 @@ Zone Asia/Yakutsk 8:38:40 - LMT 1919 De # [parts of] Respublika Sakha (Yakutiya). # From Oscar van Vlijmen (2009-11-29): -# The Sakha districts are: Bulunskij, Verkhoyanskij, Tomponskij, Ust'-Majskij, -# Ust'-Yanskij. +# The Sakha districts are: Bulunskij, Verkhoyanskij, ... Ust'-Yanskij. Zone Asia/Vladivostok 8:47:44 - LMT 1922 Nov 15 9:00 - VLAT 1930 Jun 21 # Vladivostok Time 10:00 Russia VLA%sT 1991 Mar 31 2:00s 9:00 Russia VLA%sST 1992 Jan 19 2:00s 10:00 Russia VLA%sT 2011 Mar 27 2:00s 11:00 - VLAT + +# From Arthur David Olson (2012-05-09): +# Tomponskij and Ust'-Majskij switched from Vladivostok time to Yakutsk time +# in 2011. +# +# From Paul Eggert (2012-11-25): +# Shanks and Pottenger (2003) has Khandyga on Yakutsk time. +# Make a wild guess that it switched to Vladivostok time in 2004. +# This transition is no doubt wrong, but we have no better info. +# +Zone Asia/Khandyga 9:02:13 - LMT 1919 Dec 15 + 8:00 - YAKT 1930 Jun 21 # Yakutsk Time + 9:00 Russia YAK%sT 1991 Mar 31 2:00s + 8:00 Russia YAK%sT 1992 Jan 19 2:00s + 9:00 Russia YAK%sT 2004 + 10:00 Russia VLA%sT 2011 Mar 27 2:00s + 11:00 - VLAT 2011 Sep 13 0:00s # Decree 725? + 10:00 - YAKT + # # Sakhalinskaya oblast'. # The Zone name should be Yuzhno-Sakhalinsk, but that's too long. @@ -2296,14 +2401,26 @@ Zone Asia/Sakhalin 9:30:48 - LMT 1905 A # From Oscar van Vlijmen (2009-11-29): # The Sakha districts are: Abyjskij, Allaikhovskij, Verkhhhnekolymskij, Momskij, -# Nizhnekolymskij, Ojmyakonskij, Srednekolymskij. +# Nizhnekolymskij, ... Srednekolymskij. Zone Asia/Magadan 10:03:12 - LMT 1924 May 2 10:00 - MAGT 1930 Jun 21 # Magadan Time 11:00 Russia MAG%sT 1991 Mar 31 2:00s 10:00 Russia MAG%sT 1992 Jan 19 2:00s 11:00 Russia MAG%sT 2011 Mar 27 2:00s 12:00 - MAGT -# + +# From Arthur David Olson (2012-05-09): +# Ojmyakonskij and the Kuril Islands switched from +# Magadan time to Vladivostok time in 2011. +Zone Asia/Ust-Nera 9:32:54 - LMT 1919 Dec 15 + 8:00 - YAKT 1930 Jun 21 # Yakutsk Time + 9:00 Russia YAKT 1981 Apr 1 + 11:00 Russia MAG%sT 1991 Mar 31 2:00s + 10:00 Russia MAG%sT 1992 Jan 19 2:00s + 11:00 Russia MAG%sT 2011 Mar 27 2:00s + 12:00 - MAGT 2011 Sep 13 0:00s # Decree 725? + 11:00 - VLAT + # From Oscar van Vlijmen (2001-08-25): [This region consists of] # Kamchatskaya oblast', Koryakskij avtonomnyj okrug. # Modified: stable/8/share/zoneinfo/northamerica ============================================================================== --- stable/8/share/zoneinfo/northamerica Sat Apr 20 11:45:08 2013 (r249694) +++ stable/8/share/zoneinfo/northamerica Sat Apr 20 11:46:01 2013 (r249695) @@ -1019,6 +1019,9 @@ Zone America/Menominee -5:50:27 - LMT 18 # William Willett, The Waste of Daylight, 19th edition # (1914-03) # +# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94 +# . +# # See the `europe' file for Greenland. # Canada @@ -2554,6 +2557,8 @@ Zone America/Antigua -4:07:12 - LMT 1912 # Bahamas # +# For 1899 Milne gives -5:09:29.5; round that. +# # From Sue Williams (2006-12-07): # The Bahamas announced about a month ago that they plan to change their DST # rules to sync with the U.S. starting in 2007.... @@ -2563,11 +2568,14 @@ Zone America/Antigua -4:07:12 - LMT 1912 Rule Bahamas 1964 1975 - Oct lastSun 2:00 0 S Rule Bahamas 1964 1975 - Apr lastSun 2:00 1:00 D # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone America/Nassau -5:09:24 - LMT 1912 Mar 2 +Zone America/Nassau -5:09:30 - LMT 1912 Mar 2 -5:00 Bahamas E%sT 1976 -5:00 US E%sT # Barbados + +# For 1899 Milne gives -3:58:29.2; round that. + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Barb 1977 only - Jun 12 2:00 1:00 D Rule Barb 1977 1978 - Oct Sun>=1 2:00 0 S @@ -2575,8 +2583,8 @@ Rule Barb 1978 1980 - Apr Sun>=15 2:00 1 Rule Barb 1979 only - Sep 30 2:00 0 S Rule Barb 1980 only - Sep 25 2:00 0 S # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone America/Barbados -3:58:28 - LMT 1924 # Bridgetown - -3:58:28 - BMT 1932 # Bridgetown Mean Time +Zone America/Barbados -3:58:29 - LMT 1924 # Bridgetown + -3:58:29 - BMT 1932 # Bridgetown Mean Time -4:00 Barb A%sT # Belize @@ -2594,6 +2602,9 @@ Zone America/Belize -5:52:48 - LMT 1912 # Bermuda +# For 1899 Milne gives -4:19:18.3 as the meridian of the clock tower, +# Bermuda dockyard, Ireland I; round that. + # From Dan Jones, reporting in The Royal Gazette (2006-06-26): # Next year, however, clocks in the US will go forward on the second Sunday @@ -2603,7 +2614,7 @@ Zone America/Belize -5:52:48 - LMT 1912 # http://www.theroyalgazette.com/apps/pbcs.dll/article?AID=/20060529/NEWS/105290135 # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Atlantic/Bermuda -4:19:04 - LMT 1930 Jan 1 2:00 # Hamilton +Zone Atlantic/Bermuda -4:19:18 - LMT 1930 Jan 1 2:00 # Hamilton -4:00 - AST 1974 Apr 28 2:00 -4:00 Bahamas A%sT 1976 -4:00 US A%sT @@ -2615,6 +2626,9 @@ Zone America/Cayman -5:25:32 - LMT 1890 -5:00 - EST # Costa Rica + +# Milne gives -5:36:13.3 as San Jose mean time; round to nearest. + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule CR 1979 1980 - Feb lastSun 0:00 1:00 D Rule CR 1979 1980 - Jun Sun>=1 0:00 0 S @@ -2625,14 +2639,19 @@ Rule CR 1991 only - Jul 1 0:00 0 S Rule CR 1992 only - Mar 15 0:00 0 S # There are too many San Joses elsewhere, so we'll use `Costa Rica'. # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone America/Costa_Rica -5:36:20 - LMT 1890 # San Jose - -5:36:20 - SJMT 1921 Jan 15 # San Jose Mean Time +Zone America/Costa_Rica -5:36:13 - LMT 1890 # San Jose + -5:36:13 - SJMT 1921 Jan 15 # San Jose Mean Time -6:00 CR C%sT # Coco # no information; probably like America/Costa_Rica # Cuba +# From Paul Eggert (2013-02-21): +# Milne gives -5:28:50.45 for the observatory at Havana, -5:29:23.57 +# for the port, and -5:30 for meteorological observations. +# For now, stick with Shanks & Pottenger. + # From Arthur David Olson (1999-03-29): # The 1999-03-28 exhibition baseball game held in Havana, Cuba, between # the Cuban National Team and the Baltimore Orioles was carried live on @@ -2981,24 +3000,21 @@ Zone America/Guatemala -6:02:04 - LMT 19 # apparently using the same start and end date as USA/Canada. # So this means they have already changed their time. # -# (Sources in French): -# # http://www.alterpresse.org/spip.php?article12510 -# -# # http://radiovision2000haiti.net/home/?p=13253 -# # -# Our coverage: -# -# http://www.timeanddate.com/news/time/haiti-dst-2012.html -# - # From Arthur David Olson (2012-03-11): # The alterpresse.org source seems to show a US-style leap from 2:00 a.m. to # 3:00 a.m. rather than the traditional Haitian jump at midnight. -# Assume a US-style fall back as well XXX. -# Do not yet assume that the change carries forward past 2012 XXX. +# Assume a US-style fall back as well. + +# From Steffen Thorsen (2013-03-10): +# It appears that Haiti is observing DST this year as well, same rules +# as US/Canada. They did it last year as well, and it looks like they +# are going to observe DST every year now... +# +# http://radiovision2000haiti.net/public/haiti-avis-changement-dheure-dimanche/ +# http://www.canalplushaiti.net/?p=6714 # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Haiti 1983 only - May 8 0:00 1:00 D @@ -3010,8 +3026,8 @@ Rule Haiti 1988 1997 - Apr Sun>=1 1:00s Rule Haiti 1988 1997 - Oct lastSun 1:00s 0 S Rule Haiti 2005 2006 - Apr Sun>=1 0:00 1:00 D Rule Haiti 2005 2006 - Oct lastSun 0:00 0 S -Rule Haiti 2012 only - Mar Sun>=8 2:00 1:00 D -Rule Haiti 2012 only - Nov Sun>=1 2:00 0 S +Rule Haiti 2012 max - Mar Sun>=8 2:00 1:00 D +Rule Haiti 2012 max - Nov Sun>=1 2:00 0 S # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone America/Port-au-Prince -4:49:20 - LMT 1890 -4:49 - PPMT 1917 Jan 24 12:00 # P-a-P MT Modified: stable/8/share/zoneinfo/southamerica ============================================================================== --- stable/8/share/zoneinfo/southamerica Sat Apr 20 11:45:08 2013 (r249694) +++ stable/8/share/zoneinfo/southamerica Sat Apr 20 11:46:01 2013 (r249695) @@ -11,6 +11,10 @@ # Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition), # San Diego: ACS Publications, Inc. (2003). # +# For data circa 1899, a common source is: +# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94 +# . +# # Gwillim Law writes that a good source # for recent time zone data is the International Air Transport # Association's Standard Schedules Information Manual (IATA SSIM), @@ -381,21 +385,11 @@ Rule Arg 2008 only - Oct Sun>=15 0:00 1: # # is the official page for the Province Government). # -# There's also a note in only one of the major national papers (La Nación) at -# +# There's also a note in only one of the major national papers ... # http://www.lanacion.com.ar/nota.asp?nota_id=1107912 -# # -# The press release says: -# (...) anunció que el próximo domingo a las 00:00 los puntanos deberán -# atrasar una hora sus relojes. -# -# A partir de entonces, San Luis establecerá el huso horario propio de -# la Provincia. De esta manera, durante el periodo del calendario anual -# 2009, el cambio horario quedará comprendido entre las 00:00 del tercer -# domingo de marzo y las 24:00 del segundo sábado de octubre. -# Quick&dirty translation -# (...) announced that next Sunday, at 00:00, Puntanos (the San Luis +# The press release says [quick and dirty translation]: +# ... announced that next Sunday, at 00:00, Puntanos (the San Luis # inhabitants) will have to turn back one hour their clocks # # Since then, San Luis will establish its own Province timezone. Thus, @@ -457,6 +451,9 @@ Rule Arg 2008 only - Oct Sun>=15 0:00 1: # rules...San Luis is still using "Western ARgentina Time" and it got # stuck on Summer daylight savings time even though the summer is over. +# From Paul Eggert (2013-02-21): +# Milne says Cordoba time was -4:16:48.2. Round to the nearest second. + # Zone NAME GMTOFF RULES FORMAT [UNTIL] # # Buenos Aires (BA), Capital Federal (CF), @@ -812,9 +809,9 @@ Zone America/La_Paz -4:32:36 - LMT 1890 # From Guilherme Bernardes Rodrigues (2011-10-07): # There is news in the media, however there is still no decree about it. -# I just send a e-mail to Zulmira Brandão at +# I just send a e-mail to Zulmira Brandao at # http://pcdsh01.on.br/ the -# oficial agency about time in Brazil, and she confirmed that the old rule is +# official agency about time in Brazil, and she confirmed that the old rule is # still in force. # From Guilherme Bernardes Rodrigues (2011-10-14) @@ -1243,9 +1240,13 @@ Zone America/Rio_Branco -4:31:12 - LMT 1 # b. Saturday, September 1, 2012, clocks should go forward 60 minutes; that is, # at 23:59:59, instead of passing to 0:00, the time should be adjusted to be # 01:00 on September 2. -# -# Note that...this is yet another "temporary" change that will be reevaluated -# AGAIN in 2013. + +# From Steffen Thorsen (2013-02-15): +# According to several news sources, Chile has extended DST this year, +# they will end DST later and start DST earlier than planned. They +# hope to save energy. The new end date is 2013-04-28 00:00 and new +# start date is 2013-09-08 00:00.... +# http://www.gob.cl/informa/2013/02/15/gobierno-anuncia-fechas-de-cambio-de-hora-para-el-ano-2013.htm # NOTE: ChileAQ rules for Antarctic bases are stored separately in the # 'antarctica' file. @@ -1288,10 +1289,8 @@ Rule Chile 2009 only - Mar Sun>=9 3:00u Rule Chile 2010 only - Apr Sun>=1 3:00u 0 - Rule Chile 2011 only - May Sun>=2 3:00u 0 - Rule Chile 2011 only - Aug Sun>=16 4:00u 1:00 S -Rule Chile 2012 only - Apr Sun>=23 3:00u 0 - -Rule Chile 2012 only - Sep Sun>=2 4:00u 1:00 S -Rule Chile 2013 max - Mar Sun>=9 3:00u 0 - -Rule Chile 2013 max - Oct Sun>=9 4:00u 1:00 S +Rule Chile 2012 max - Apr Sun>=23 3:00u 0 - +Rule Chile 2012 max - Sep Sun>=2 4:00u 1:00 S # IATA SSIM anomalies: (1992-02) says 1992-03-14; # (1996-09) says 1998-03-08. Ignore these. # Zone NAME GMTOFF RULES FORMAT [UNTIL] @@ -1313,17 +1312,23 @@ Zone Pacific/Easter -7:17:44 - LMT 1890 # San Felix, and Antarctic bases, are like America/Santiago. # Colombia + +# Milne gives 4:56:16.4 for Bogota time in 1899; round to nearest. He writes, +# "A variation of fifteen minutes in the public clocks of Bogota is not rare." + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule CO 1992 only - May 3 0:00 1:00 S Rule CO 1993 only - Apr 4 0:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone America/Bogota -4:56:20 - LMT 1884 Mar 13 - -4:56:20 - BMT 1914 Nov 23 # Bogota Mean Time +Zone America/Bogota -4:56:16 - LMT 1884 Mar 13 + -4:56:16 - BMT 1914 Nov 23 # Bogota Mean Time -5:00 CO CO%sT # Colombia Time # Malpelo, Providencia, San Andres # no information; probably like America/Bogota # Curacao + +# Milne gives 4:35:46.9 for Curacao mean time; round to nearest. # # From Paul Eggert (2006-03-22): # Shanks & Pottenger say that The Bottom and Philipsburg have been at @@ -1340,7 +1345,7 @@ Zone America/Bogota -4:56:20 - LMT 1884 # though, as far as we know. # # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone America/Curacao -4:35:44 - LMT 1912 Feb 12 # Willemstad +Zone America/Curacao -4:35:47 - LMT 1912 Feb 12 # Willemstad -4:30 - ANT 1965 # Netherlands Antilles Time -4:00 - AST @@ -1354,6 +1359,8 @@ Link America/Curacao America/Kralendijk # Ecuador # +# Milne says the Sentral and South American Telegraph Company used -5:24:15. +# # From Paul Eggert (2007-03-04): # Apparently Ecuador had a failed experiment with DST in 1992. # (2007-02-27) and @@ -1559,7 +1566,16 @@ Rule Para 2005 2009 - Mar Sun>=8 0:00 0 # forward 60 minutes, in all the territory of the Paraguayan Republic. # ... Rule Para 2010 max - Oct Sun>=1 0:00 1:00 S -Rule Para 2010 max - Apr Sun>=8 0:00 0 - +Rule Para 2010 2012 - Apr Sun>=8 0:00 0 - +# +# From Steffen Thorsen (2013-03-07): +# Paraguay will end DST on 2013-03-24 00:00.... +# http://www.ande.gov.py/interna.php?id=1075 +# +# From Carlos Raul Perasso (2013-03-15): +# The change in Paraguay is now final. Decree number 10780 +# http://www.presidencia.gov.py/uploads/pdf/presidencia-3b86ff4b691c79d4f5927ca964922ec74772ce857c02ca054a52a37b49afc7fb.pdf +Rule Para 2013 max - Mar Sun>=22 0:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone America/Asuncion -3:50:40 - LMT 1890 Modified: stable/8/share/zoneinfo/zone.tab ============================================================================== --- stable/8/share/zoneinfo/zone.tab Sat Apr 20 11:45:08 2013 (r249694) +++ stable/8/share/zoneinfo/zone.tab Sat Apr 20 11:46:01 2013 (r249695) @@ -42,7 +42,6 @@ AQ -6617+11031 Antarctica/Casey Casey St AQ -7824+10654 Antarctica/Vostok Vostok Station, Lake Vostok AQ -6640+14001 Antarctica/DumontDUrville Dumont-d'Urville Station, Terre Adelie AQ -690022+0393524 Antarctica/Syowa Syowa Station, E Ongul I -AQ -5430+15857 Antarctica/Macquarie Macquarie Island Station, Macquarie Island AR -3436-05827 America/Argentina/Buenos_Aires Buenos Aires (BA, CF) AR -3124-06411 America/Argentina/Cordoba most locations (CB, CC, CN, ER, FM, MN, SE, SF) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Apr 20 11:46:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C7703C50; Sat, 20 Apr 2013 11:46:39 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B976A1876; Sat, 20 Apr 2013 11:46:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3KBkdRM059926; Sat, 20 Apr 2013 11:46:39 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3KBkcsl059909; Sat, 20 Apr 2013 11:46:38 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201304201146.r3KBkcsl059909@svn.freebsd.org> From: Edwin Groothuis Date: Sat, 20 Apr 2013 11:46:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249696 - stable/9/contrib/tzdata X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Apr 2013 11:46:39 -0000 Author: edwin Date: Sat Apr 20 11:46:38 2013 New Revision: 249696 URL: http://svnweb.freebsd.org/changeset/base/249696 Log: Merge of current from 249692, tzdata2013c: - antarctica: AusAQ and ATAQ have been removed. - Antarctica/Macquarie has been moved to australasia file and AU. - Asia/Hebron, Palestine updated for 2013. - Paraguay stays with DST for the whole year. Modified: stable/9/contrib/tzdata/antarctica stable/9/contrib/tzdata/asia stable/9/contrib/tzdata/australasia stable/9/contrib/tzdata/southamerica stable/9/contrib/tzdata/zone.tab Directory Properties: stable/9/contrib/tzdata/ (props changed) Modified: stable/9/contrib/tzdata/antarctica ============================================================================== --- stable/9/contrib/tzdata/antarctica Sat Apr 20 11:46:01 2013 (r249695) +++ stable/9/contrib/tzdata/antarctica Sat Apr 20 11:46:38 2013 (r249696) @@ -53,34 +53,6 @@ Rule ChileAQ 2011 only - Aug Sun>=16 4:0 Rule ChileAQ 2012 max - Apr Sun>=23 3:00u 0 - Rule ChileAQ 2012 max - Sep Sun>=2 4:00u 1:00 S -# These rules are stolen from the `australasia' file. -Rule AusAQ 1917 only - Jan 1 0:01 1:00 - -Rule AusAQ 1917 only - Mar 25 2:00 0 - -Rule AusAQ 1942 only - Jan 1 2:00 1:00 - -Rule AusAQ 1942 only - Mar 29 2:00 0 - -Rule AusAQ 1942 only - Sep 27 2:00 1:00 - -Rule AusAQ 1943 1944 - Mar lastSun 2:00 0 - -Rule AusAQ 1943 only - Oct 3 2:00 1:00 - -Rule ATAQ 1967 only - Oct Sun>=1 2:00s 1:00 - -Rule ATAQ 1968 only - Mar lastSun 2:00s 0 - -Rule ATAQ 1968 1985 - Oct lastSun 2:00s 1:00 - -Rule ATAQ 1969 1971 - Mar Sun>=8 2:00s 0 - -Rule ATAQ 1972 only - Feb lastSun 2:00s 0 - -Rule ATAQ 1973 1981 - Mar Sun>=1 2:00s 0 - -Rule ATAQ 1982 1983 - Mar lastSun 2:00s 0 - -Rule ATAQ 1984 1986 - Mar Sun>=1 2:00s 0 - -Rule ATAQ 1986 only - Oct Sun>=15 2:00s 1:00 - -Rule ATAQ 1987 1990 - Mar Sun>=15 2:00s 0 - -Rule ATAQ 1987 only - Oct Sun>=22 2:00s 1:00 - -Rule ATAQ 1988 1990 - Oct lastSun 2:00s 1:00 - -Rule ATAQ 1991 1999 - Oct Sun>=1 2:00s 1:00 - -Rule ATAQ 1991 2005 - Mar lastSun 2:00s 0 - -Rule ATAQ 2000 only - Aug lastSun 2:00s 1:00 - -Rule ATAQ 2001 max - Oct Sun>=1 2:00s 1:00 - -Rule ATAQ 2006 only - Apr Sun>=1 2:00s 0 - -Rule ATAQ 2007 only - Mar lastSun 2:00s 0 - -Rule ATAQ 2008 max - Apr Sun>=1 2:00s 0 - - # Argentina - year-round bases # Belgrano II, Confin Coast, -770227-0343737, since 1972-02-05 # Esperanza, San Martin Land, -6323-05659, since 1952-12-17 @@ -122,10 +94,7 @@ Rule ATAQ 2008 max - Apr Sun>=1 2:00s 0 # # From Steffen Thorsen (2010-03-10): -# We got these changes from the Australian Antarctic Division: -# - Macquarie Island will stay on UTC+11 for winter and therefore not -# switch back from daylight savings time when other parts of Australia do -# on 4 April. +# We got these changes from the Australian Antarctic Division: ... # # - Casey station reverted to its normal time of UTC+8 on 5 March 2010. # The change to UTC+11 is being considered as a regular summer thing but @@ -136,9 +105,6 @@ Rule ATAQ 2008 max - Apr Sun>=1 2:00s 0 # # - Mawson station stays on UTC+5. # -# In addition to the Rule changes for Casey/Davis, it means that Macquarie -# will no longer be like Hobart and will have to have its own Zone created. -# # Background: # # http://www.timeanddate.com/news/time/antartica-time-changes-2010.html @@ -165,12 +131,6 @@ Zone Antarctica/Mawson 0 - zzz 1954 Feb 6:00 - MAWT 2009 Oct 18 2:00 # Mawson Time 5:00 - MAWT -Zone Antarctica/Macquarie 0 - zzz 1911 - 10:00 - EST 1916 Oct 1 2:00 - 10:00 1:00 EST 1917 Feb - 10:00 AusAQ EST 1967 - 10:00 ATAQ EST 2010 Apr 4 3:00 - 11:00 - MIST # Macquarie Island Time # References: # # Casey Weather (1998-02-26) Modified: stable/9/contrib/tzdata/asia ============================================================================== --- stable/9/contrib/tzdata/asia Sat Apr 20 11:46:01 2013 (r249695) +++ stable/9/contrib/tzdata/asia Sat Apr 20 11:46:38 2013 (r249696) @@ -2291,11 +2291,20 @@ Zone Asia/Karachi 4:28:12 - LMT 1907 # http://www.timeanddate.com/news/time/gaza-west-bank-dst-2012.html # -# From Arthur David Olson (2012-03-27): -# The timeanddate article for 2012 says that "the end date has not yet been -# announced" and that "Last year, both...paused daylight saving time during... -# Ramadan. It is not yet known [for] 2012." -# For now, assume both switch back on the last Friday in September. XXX +# From Steffen Thorsen (2013-03-26): +# The following news sources tells that Palestine will "start daylight saving +# time from midnight on Friday, March 29, 2013" (translated). +# [These are in Arabic and are for Gaza and for Ramallah, respectively.] +# http://www.samanews.com/index.php?act=Show&id=154120 +# http://safa.ps/details/news/99844/%D8%B1%D8%A7%D9%85-%D8%A7%D9%84%D9%84%D9%87-%D8%A8%D8%AF%D8%A1-%D8%A7%D9%84%D8%AA%D9%88%D9%82%D9%8A%D8%AA-%D8%A7%D9%84%D8%B5%D9%8A%D9%81%D9%8A-29-%D8%A7%D9%84%D8%AC%D8%A7%D8%B1%D9%8A.html + +# From Paul Eggert (2013-04-15): +# For future dates, guess the last Thursday in March at 24:00 through +# the first Friday on or after September 21 at 01:00. This is consistent with +# the predictions in today's editions of the following URLs, +# which are for Gaza and Hebron respectively: +# http://www.timeanddate.com/worldclock/timezone.html?n=702 +# http://www.timeanddate.com/worldclock/timezone.html?n=2364 # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule EgyptAsia 1957 only - May 10 0:00 1:00 S @@ -2309,19 +2318,20 @@ Rule Palestine 1999 2005 - Apr Fri>=15 0 Rule Palestine 1999 2003 - Oct Fri>=15 0:00 0 - Rule Palestine 2004 only - Oct 1 1:00 0 - Rule Palestine 2005 only - Oct 4 2:00 0 - -Rule Palestine 2006 2008 - Apr 1 0:00 1:00 S +Rule Palestine 2006 2007 - Apr 1 0:00 1:00 S Rule Palestine 2006 only - Sep 22 0:00 0 - Rule Palestine 2007 only - Sep Thu>=8 2:00 0 - -Rule Palestine 2008 only - Aug lastFri 0:00 0 - -Rule Palestine 2009 only - Mar lastFri 0:00 1:00 S -Rule Palestine 2009 only - Sep Fri>=1 2:00 0 - -Rule Palestine 2010 only - Mar lastSat 0:01 1:00 S +Rule Palestine 2008 2009 - Mar lastFri 0:00 1:00 S +Rule Palestine 2008 only - Sep 1 0:00 0 - +Rule Palestine 2009 only - Sep Fri>=1 1:00 0 - +Rule Palestine 2010 only - Mar 26 0:00 1:00 S Rule Palestine 2010 only - Aug 11 0:00 0 - - -# From Arthur David Olson (2011-09-20): -# 2011 transitions per http://www.timeanddate.com as of 2011-09-20. -# From Paul Eggert (2012-10-12): -# 2012 transitions per http://www.timeanddate.com as of 2012-10-12. +Rule Palestine 2011 only - Apr 1 0:01 1:00 S +Rule Palestine 2011 only - Aug 1 0:00 0 - +Rule Palestine 2011 only - Aug 30 0:00 1:00 S +Rule Palestine 2011 only - Sep 30 0:00 0 - +Rule Palestine 2012 max - Mar lastThu 24:00 1:00 S +Rule Palestine 2012 max - Sep Fri>=21 1:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Gaza 2:17:52 - LMT 1900 Oct @@ -2329,26 +2339,20 @@ Zone Asia/Gaza 2:17:52 - LMT 1900 Oct 2:00 EgyptAsia EE%sT 1967 Jun 5 2:00 Zion I%sT 1996 2:00 Jordan EE%sT 1999 - 2:00 Palestine EE%sT 2011 Apr 2 12:01 - 2:00 1:00 EEST 2011 Aug 1 - 2:00 - EET 2012 Mar 30 - 2:00 1:00 EEST 2012 Sep 21 1:00 - 2:00 - EET + 2:00 Palestine EE%sT 2008 Aug 29 0:00 + 2:00 - EET 2008 Sep + 2:00 Palestine EE%sT 2010 + 2:00 - EET 2010 Mar 27 0:01 + 2:00 Palestine EE%sT 2011 Aug 1 + 2:00 - EET 2012 + 2:00 Palestine EE%sT Zone Asia/Hebron 2:20:23 - LMT 1900 Oct 2:00 Zion EET 1948 May 15 2:00 EgyptAsia EE%sT 1967 Jun 5 2:00 Zion I%sT 1996 2:00 Jordan EE%sT 1999 - 2:00 Palestine EE%sT 2008 Aug - 2:00 1:00 EEST 2008 Sep - 2:00 Palestine EE%sT 2011 Apr 1 12:01 - 2:00 1:00 EEST 2011 Aug 1 - 2:00 - EET 2011 Aug 30 - 2:00 1:00 EEST 2011 Sep 30 3:00 - 2:00 - EET 2012 Mar 30 - 2:00 1:00 EEST 2012 Sep 21 1:00 - 2:00 - EET + 2:00 Palestine EE%sT # Paracel Is # no information Modified: stable/9/contrib/tzdata/australasia ============================================================================== --- stable/9/contrib/tzdata/australasia Sat Apr 20 11:46:01 2013 (r249695) +++ stable/9/contrib/tzdata/australasia Sat Apr 20 11:46:38 2013 (r249696) @@ -218,9 +218,26 @@ Zone Australia/Lord_Howe 10:36:20 - LMT # no times are set # # Macquarie -# permanent occupation (scientific station) since 1948; -# sealing and penguin oil station operated 1888/1917 -# like Australia/Hobart +# Permanent occupation (scientific station) 1911-1915 and since 25 March 1948; +# sealing and penguin oil station operated Nov 1899 to Apr 1919. See the +# Tasmania Parks & Wildlife Service history of sealing at Macquarie Island +# +# . +# Guess that it was like Australia/Hobart while inhabited before 2010. +# +# From Steffen Thorsen (2010-03-10): +# We got these changes from the Australian Antarctic Division: +# - Macquarie Island will stay on UTC+11 for winter and therefore not +# switch back from daylight savings time when other parts of Australia do +# on 4 April. +Zone Antarctica/Macquarie 0 - zzz 1899 Nov + 10:00 - EST 1916 Oct 1 2:00 + 10:00 1:00 EST 1917 Feb + 10:00 Aus EST 1919 Apr + 0 - zzz 1948 Mar 25 + 10:00 Aus EST 1967 + 10:00 AT EST 2010 Apr 4 3:00 + 11:00 - MIST # Macquarie I Standard Time # Christmas # Zone NAME GMTOFF RULES FORMAT [UNTIL] Modified: stable/9/contrib/tzdata/southamerica ============================================================================== --- stable/9/contrib/tzdata/southamerica Sat Apr 20 11:46:01 2013 (r249695) +++ stable/9/contrib/tzdata/southamerica Sat Apr 20 11:46:38 2013 (r249696) @@ -1566,16 +1566,16 @@ Rule Para 2005 2009 - Mar Sun>=8 0:00 0 # forward 60 minutes, in all the territory of the Paraguayan Republic. # ... Rule Para 2010 max - Oct Sun>=1 0:00 1:00 S -Rule Para 2010 max - Apr Sun>=8 0:00 0 - +Rule Para 2010 2012 - Apr Sun>=8 0:00 0 - # # From Steffen Thorsen (2013-03-07): # Paraguay will end DST on 2013-03-24 00:00.... -# They do not tell if this will be a permanent change or just this year.... # http://www.ande.gov.py/interna.php?id=1075 # -# From Paul Eggert (2013-03-07): -# For now, assume it's just this year. -Rule Para 2013 only - Mar 24 0:00 0 - +# From Carlos Raul Perasso (2013-03-15): +# The change in Paraguay is now final. Decree number 10780 +# http://www.presidencia.gov.py/uploads/pdf/presidencia-3b86ff4b691c79d4f5927ca964922ec74772ce857c02ca054a52a37b49afc7fb.pdf +Rule Para 2013 max - Mar Sun>=22 0:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone America/Asuncion -3:50:40 - LMT 1890 Modified: stable/9/contrib/tzdata/zone.tab ============================================================================== --- stable/9/contrib/tzdata/zone.tab Sat Apr 20 11:46:01 2013 (r249695) +++ stable/9/contrib/tzdata/zone.tab Sat Apr 20 11:46:38 2013 (r249696) @@ -42,7 +42,6 @@ AQ -6617+11031 Antarctica/Casey Casey St AQ -7824+10654 Antarctica/Vostok Vostok Station, Lake Vostok AQ -6640+14001 Antarctica/DumontDUrville Dumont-d'Urville Station, Terre Adelie AQ -690022+0393524 Antarctica/Syowa Syowa Station, E Ongul I -AQ -5430+15857 Antarctica/Macquarie Macquarie Island Station, Macquarie Island AR -3436-05827 America/Argentina/Buenos_Aires Buenos Aires (BA, CF) AR -3124-06411 America/Argentina/Cordoba most locations (CB, CC, CN, ER, FM, MN, SE, SF) AR -2447-06525 America/Argentina/Salta (SA, LP, NQ, RN) @@ -58,6 +57,7 @@ AR -5448-06818 America/Argentina/Ushuaia AS -1416-17042 Pacific/Pago_Pago AT +4813+01620 Europe/Vienna AU -3133+15905 Australia/Lord_Howe Lord Howe Island +AU -5430+15857 Antarctica/Macquarie Macquarie Island AU -4253+14719 Australia/Hobart Tasmania - most locations AU -3956+14352 Australia/Currie Tasmania - King Island AU -3749+14458 Australia/Melbourne Victoria From owner-svn-src-all@FreeBSD.ORG Sat Apr 20 12:36:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 162C2A7B; Sat, 20 Apr 2013 12:36:54 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0951E1BD9; Sat, 20 Apr 2013 12:36:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3KCarVA014881; Sat, 20 Apr 2013 12:36:53 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3KCarTJ014879; Sat, 20 Apr 2013 12:36:53 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201304201236.r3KCarTJ014879@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sat, 20 Apr 2013 12:36:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249697 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Apr 2013 12:36:54 -0000 Author: trasz Date: Sat Apr 20 12:36:53 2013 New Revision: 249697 URL: http://svnweb.freebsd.org/changeset/base/249697 Log: Make DELAY(9) reference pause(9). Modified: head/share/man/man9/DELAY.9 Modified: head/share/man/man9/DELAY.9 ============================================================================== --- head/share/man/man9/DELAY.9 Sat Apr 20 11:46:38 2013 (r249696) +++ head/share/man/man9/DELAY.9 Sat Apr 20 12:36:53 2013 (r249697) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 21, 2000 +.Dd April 20, 2013 .Dt DELAY 9 .Os .Sh NAME @@ -42,6 +42,8 @@ Delay for .Fa delay microseconds (1/1000000th of a second). +.Sh SEE ALSO +.Xr pause 9 .Sh AUTHORS This manual page was written by .An Alfred Perlstein . From owner-svn-src-all@FreeBSD.ORG Sat Apr 20 12:41:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4A064C00; Sat, 20 Apr 2013 12:41:06 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 236EF1BE6; Sat, 20 Apr 2013 12:41:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3KCf6Ua020537; Sat, 20 Apr 2013 12:41:06 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3KCf6l5020535; Sat, 20 Apr 2013 12:41:06 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201304201241.r3KCf6l5020535@svn.freebsd.org> From: Ulrich Spoerlein Date: Sat, 20 Apr 2013 12:41:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249698 - head/bin/df X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Apr 2013 12:41:06 -0000 Author: uqs Date: Sat Apr 20 12:41:05 2013 New Revision: 249698 URL: http://svnweb.freebsd.org/changeset/base/249698 Log: bin/df: Fix unitialized use in prtstat While here: - use NULL in the context of pointers - use memset instead of bzero throughout the file - free memory to appease clang static analyzer Found by: Coverity Scan (the UNINIT one) Modified: head/bin/df/df.c Modified: head/bin/df/df.c ============================================================================== --- head/bin/df/df.c Sat Apr 20 12:36:53 2013 (r249697) +++ head/bin/df/df.c Sat Apr 20 12:41:05 2013 (r249698) @@ -114,6 +114,7 @@ main(int argc, char *argv[]) fstype = "ufs"; (void)setlocale(LC_ALL, ""); + memset(&maxwidths, 0, sizeof(maxwidths)); memset(&totalbuf, 0, sizeof(totalbuf)); totalbuf.f_bsize = DEV_BSIZE; strlcpy(totalbuf.f_mntfromname, "total", MNAMELEN); @@ -200,7 +201,7 @@ main(int argc, char *argv[]) } else { /* just the filesystems specified on the command line */ mntbuf = malloc(argc * sizeof(*mntbuf)); - if (mntbuf == 0) + if (mntbuf == NULL) err(1, "malloc()"); mntsize = 0; /* continued in for loop below */ @@ -209,13 +210,13 @@ main(int argc, char *argv[]) /* iterate through specified filesystems */ for (; *argv; argv++) { if (stat(*argv, &stbuf) < 0) { - if ((mntpt = getmntpt(*argv)) == 0) { + if ((mntpt = getmntpt(*argv)) == NULL) { warn("%s", *argv); rv = 1; continue; } } else if (S_ISCHR(stbuf.st_mode)) { - if ((mntpt = getmntpt(*argv)) == 0) { + if ((mntpt = getmntpt(*argv)) == NULL) { mdev.fspec = *argv; mntpath = strdup("/tmp/df.XXXXXX"); if (mntpath == NULL) { @@ -282,7 +283,7 @@ main(int argc, char *argv[]) mntbuf[mntsize++] = statfsbuf; } - bzero(&maxwidths, sizeof(maxwidths)); + memset(&maxwidths, 0, sizeof(maxwidths)); for (i = 0; i < mntsize; i++) { if (aflag || (mntbuf[i].f_flags & MNT_IGNORE) == 0) { update_maxwidths(&maxwidths, &mntbuf[i]); @@ -295,6 +296,7 @@ main(int argc, char *argv[]) prtstat(&mntbuf[i], &maxwidths); if (cflag) prtstat(&totalbuf, &maxwidths); + free(mntbuf); return (rv); } @@ -309,7 +311,7 @@ getmntpt(const char *name) if (!strcmp(mntbuf[i].f_mntfromname, name)) return (mntbuf[i].f_mntonname); } - return (0); + return (NULL); } /* From owner-svn-src-all@FreeBSD.ORG Sat Apr 20 14:33:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3B3CAA12; Sat, 20 Apr 2013 14:33:56 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2CA6A1F60; Sat, 20 Apr 2013 14:33:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3KEXuYN041939; Sat, 20 Apr 2013 14:33:56 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3KEXufn041937; Sat, 20 Apr 2013 14:33:56 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201304201433.r3KEXufn041937@svn.freebsd.org> From: "Kenneth D. Merry" Date: Sat, 20 Apr 2013 14:33:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249701 - head/sys/cam/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Apr 2013 14:33:56 -0000 Author: ken Date: Sat Apr 20 14:33:55 2013 New Revision: 249701 URL: http://svnweb.freebsd.org/changeset/base/249701 Log: Fix compilation. Pointy hat to: ken Modified: head/sys/cam/scsi/scsi_ch.c Modified: head/sys/cam/scsi/scsi_ch.c ============================================================================== --- head/sys/cam/scsi/scsi_ch.c Sat Apr 20 14:01:22 2013 (r249700) +++ head/sys/cam/scsi/scsi_ch.c Sat Apr 20 14:33:55 2013 (r249701) @@ -1147,15 +1147,11 @@ copy_element_status(struct ch_softc *sof ces->ces_designator_length = devid->designator_length; /* * Make sure we are always NUL terminated. The - * buffer should be sized for the maximum - * designator length plus 1, but this will make sure - * there is always a NUL at the end. This won't - * matter for the binary code set, since the user - * will only pay attention to the length field. + * This won't matter for the binary code set, + * since the user will only pay attention to the + * length field. */ - ces->ces_designator[ - MIN(sizeof(ces->ces_designator) - 1, - devid->designator_length)]= '\0'; + ces->ces_designator[devid->designator_length]= '\0'; } if (devid->piv_assoc_designator_type & READ_ELEMENT_STATUS_PIV_SET) { From owner-svn-src-all@FreeBSD.ORG Sat Apr 20 14:37:04 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 81D48BBC; Sat, 20 Apr 2013 14:37:04 +0000 (UTC) (envelope-from ken@kdm.org) Received: from nargothrond.kdm.org (nargothrond.kdm.org [70.56.43.81]) by mx1.freebsd.org (Postfix) with ESMTP id 396E41F71; Sat, 20 Apr 2013 14:37:03 +0000 (UTC) Received: from nargothrond.kdm.org (localhost [127.0.0.1]) by nargothrond.kdm.org (8.14.2/8.14.2) with ESMTP id r3KEb0eh044335; Sat, 20 Apr 2013 08:37:00 -0600 (MDT) (envelope-from ken@nargothrond.kdm.org) Received: (from ken@localhost) by nargothrond.kdm.org (8.14.2/8.14.2/Submit) id r3KEb0AV044334; Sat, 20 Apr 2013 08:37:00 -0600 (MDT) (envelope-from ken) Date: Sat, 20 Apr 2013 08:37:00 -0600 From: "Kenneth D. Merry" To: Warner Losh Subject: Re: svn commit: r249658 - in head: bin/chio sys/cam/scsi sys/sys Message-ID: <20130420143700.GA44286@nargothrond.kdm.org> References: <201304192003.r3JK3qFB013463@svn.freebsd.org> <82451AEC-79FD-448F-B180-C2CEC47EB18B@bsdimp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <82451AEC-79FD-448F-B180-C2CEC47EB18B@bsdimp.com> User-Agent: Mutt/1.4.2i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Apr 2013 14:37:04 -0000 On Sat, Apr 20, 2013 at 05:45:43 -0600, Warner Losh wrote: > Hey Ken, > > this change doesn't compile for me. See below > > Warner > > On Apr 19, 2013, at 2:03 PM, Kenneth D. Merry wrote: [ ...] > > + ces->ces_designator_length = devid->designator_length; > > + /* > > + * Make sure we are always NUL terminated. The > > + * buffer should be sized for the maximum > > + * designator length plus 1, but this will make sure > > + * there is always a NUL at the end. This won't > > + * matter for the binary code set, since the user > > + * will only pay attention to the length field. > > + */ > > + ces->ces_designator[ > > + MIN(sizeof(ces->ces_designator) - 1, > > + devid->designator_length)]= '\0'; > > compiler complains here that this comparison is always false due to data ranges. I hacked it in my copy by always using devid->designator_length, but I know that's a lame fix. Can you look into it? > Not sure what happened there. Different warns levels on different architectures? In any case, I put in the same fix you did until I can figure out a better way to do it. (Hard to type with a toddler on your lap. :) Ken -- Kenneth Merry ken@FreeBSD.ORG From owner-svn-src-all@FreeBSD.ORG Sat Apr 20 14:44:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9DF84F42; Sat, 20 Apr 2013 14:44:29 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9019F1F93; Sat, 20 Apr 2013 14:44:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3KEiTLe051096; Sat, 20 Apr 2013 14:44:29 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3KEiTr7051092; Sat, 20 Apr 2013 14:44:29 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201304201444.r3KEiTr7051092@svn.freebsd.org> From: Ed Schouten Date: Sat, 20 Apr 2013 14:44:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249702 - in head: gnu/lib/libgcc lib/libcompiler_rt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Apr 2013 14:44:29 -0000 Author: ed Date: Sat Apr 20 14:44:28 2013 New Revision: 249702 URL: http://svnweb.freebsd.org/changeset/base/249702 Log: Enable libcompiler-rt on MIPS. Originally we disabled libcompiler-rt on MIPS and SPARC64, because of an issue where __clzdi2 and __ctzdi2 would cause endless recursion. This bug has been fixed in r230021 already, but for some reason we only switched to libcompiler-rt on SPARC64 -- not MIPS. This means we can finally use on all our architectures. Modified: head/gnu/lib/libgcc/Makefile head/lib/libcompiler_rt/Makefile Modified: head/gnu/lib/libgcc/Makefile ============================================================================== --- head/gnu/lib/libgcc/Makefile Sat Apr 20 14:33:55 2013 (r249701) +++ head/gnu/lib/libgcc/Makefile Sat Apr 20 14:44:28 2013 (r249702) @@ -19,10 +19,6 @@ MK_SSP= no CFLAGS+= -DTARGET_ARM_EABI .endif -.if ${TARGET_CPUARCH} == "mips" -LIB= gcc -.endif - .PATH: ${GCCDIR}/config/${GCC_CPU} ${GCCDIR}/config ${GCCDIR} CFLAGS+= -DIN_GCC -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED \ Modified: head/lib/libcompiler_rt/Makefile ============================================================================== --- head/lib/libcompiler_rt/Makefile Sat Apr 20 14:33:55 2013 (r249701) +++ head/lib/libcompiler_rt/Makefile Sat Apr 20 14:44:28 2013 (r249702) @@ -196,13 +196,11 @@ SRCS+= aeabi_idivmod.S \ aeabi_uldivmod.S .endif -.if ${MACHINE_CPUARCH} != "mips" -. if ${MK_INSTALLLIB} != "no" +.if ${MK_INSTALLLIB} != "no" SYMLINKS+=libcompiler_rt.a ${LIBDIR}/libgcc.a -. endif -. if ${MK_PROFILE} != "no" +.endif +.if ${MK_PROFILE} != "no" SYMLINKS+=libcompiler_rt_p.a ${LIBDIR}/libgcc_p.a -. endif .endif .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" || \ From owner-svn-src-all@FreeBSD.ORG Sat Apr 20 14:55:48 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CECFA4B3; Sat, 20 Apr 2013 14:55:48 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C00A229; Sat, 20 Apr 2013 14:55:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3KEtmJP058894; Sat, 20 Apr 2013 14:55:48 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3KEtmAD058892; Sat, 20 Apr 2013 14:55:48 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201304201455.r3KEtmAD058892@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sat, 20 Apr 2013 14:55:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249703 - stable/9/gnu/lib/libstdc++ X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Apr 2013 14:55:48 -0000 Author: pfg Date: Sat Apr 20 14:55:48 2013 New Revision: 249703 URL: http://svnweb.freebsd.org/changeset/base/249703 Log: libstdc++: Revert the expl addition from r246857. When the needed configuration update to libstdc++ was done. we overlooked that expl hasn't been merged. This is causing breakage in some ports. Reported by: Diane Bruce Reviewed by: dim Modified: stable/9/gnu/lib/libstdc++/config.h Modified: stable/9/gnu/lib/libstdc++/config.h ============================================================================== --- stable/9/gnu/lib/libstdc++/config.h Sat Apr 20 14:44:28 2013 (r249702) +++ stable/9/gnu/lib/libstdc++/config.h Sat Apr 20 14:55:48 2013 (r249703) @@ -67,7 +67,7 @@ #define HAVE_EXPF 1 /* Define to 1 if you have the `expl' function. */ -#define HAVE_EXPL 1 +/* #undef HAVE_EXPL 1 */ /* Define to 1 if you have the `fabsf' function. */ #define HAVE_FABSF 1 From owner-svn-src-all@FreeBSD.ORG Sat Apr 20 15:37:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 19F50F9; Sat, 20 Apr 2013 15:37:35 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0C4751AD; Sat, 20 Apr 2013 15:37:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3KFbYbn088265; Sat, 20 Apr 2013 15:37:34 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3KFbYIk088263; Sat, 20 Apr 2013 15:37:34 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201304201537.r3KFbYIk088263@svn.freebsd.org> From: Mikolaj Golub Date: Sat, 20 Apr 2013 15:37:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249704 - head/usr.bin/gcore X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Apr 2013 15:37:35 -0000 Author: trociny Date: Sat Apr 20 15:37:33 2013 New Revision: 249704 URL: http://svnweb.freebsd.org/changeset/base/249704 Log: Wrong cast. MFC after: 1 month Modified: head/usr.bin/gcore/elfcore.c Modified: head/usr.bin/gcore/elfcore.c ============================================================================== --- head/usr.bin/gcore/elfcore.c Sat Apr 20 14:55:48 2013 (r249703) +++ head/usr.bin/gcore/elfcore.c Sat Apr 20 15:37:33 2013 (r249704) @@ -634,8 +634,7 @@ static void * elf_note_procstat_groups(void *arg, size_t *sizep) { - return (procstat_sysctl(arg, KERN_PROC_GROUPS, - (int)sizeof(gid_t), sizep)); + return (procstat_sysctl(arg, KERN_PROC_GROUPS, sizeof(gid_t), sizep)); } static void * From owner-svn-src-all@FreeBSD.ORG Sat Apr 20 19:13:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id EFC916D8; Sat, 20 Apr 2013 19:13:56 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E2CE1AF7; Sat, 20 Apr 2013 19:13:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3KJDu6t039897; Sat, 20 Apr 2013 19:13:56 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3KJDuIG039896; Sat, 20 Apr 2013 19:13:56 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201304201913.r3KJDuIG039896@svn.freebsd.org> From: Glen Barber Date: Sat, 20 Apr 2013 19:13:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r249710 - releng/8.4/sys/conf X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Apr 2013 19:13:57 -0000 Author: gjb (doc,ports committer) Date: Sat Apr 20 19:13:56 2013 New Revision: 249710 URL: http://svnweb.freebsd.org/changeset/base/249710 Log: - Update releng/8.4 branch to -RC2 Approved by: re (jpaetzel) Modified: releng/8.4/sys/conf/newvers.sh Modified: releng/8.4/sys/conf/newvers.sh ============================================================================== --- releng/8.4/sys/conf/newvers.sh Sat Apr 20 18:52:06 2013 (r249709) +++ releng/8.4/sys/conf/newvers.sh Sat Apr 20 19:13:56 2013 (r249710) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="8.4" -BRANCH="RC1" +BRANCH="RC2" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@FreeBSD.ORG Sat Apr 20 22:16:49 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id ECB065AB; Sat, 20 Apr 2013 22:16:49 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DF335109C; Sat, 20 Apr 2013 22:16:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3KMGnlx060974; Sat, 20 Apr 2013 22:16:49 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3KMGntw060973; Sat, 20 Apr 2013 22:16:49 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201304202216.r3KMGntw060973@svn.freebsd.org> From: Joel Dahl Date: Sat, 20 Apr 2013 22:16:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249711 - head/lib/libprocstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Apr 2013 22:16:50 -0000 Author: joel (doc committer) Date: Sat Apr 20 22:16:49 2013 New Revision: 249711 URL: http://svnweb.freebsd.org/changeset/base/249711 Log: mdoc: end function context properly. Modified: head/lib/libprocstat/libprocstat.3 Modified: head/lib/libprocstat/libprocstat.3 ============================================================================== --- head/lib/libprocstat/libprocstat.3 Sat Apr 20 19:13:56 2013 (r249710) +++ head/lib/libprocstat/libprocstat.3 Sat Apr 20 22:16:49 2013 (r249711) @@ -65,7 +65,6 @@ .In libprocstat.h .Ft void .Fn procstat_close "struct procstat *procstat" -.Fc .Ft void .Fo procstat_freeargv .Fa "struct procstat *procstat" @@ -167,6 +166,7 @@ .Fa "struct procstat *procstat" .Fa "struct kinfo_proc *kp" .Fa "unsigned int *count" +.Fc .Ft int .Fo procstat_getosrel .Fa "struct procstat *procstat" From owner-svn-src-all@FreeBSD.ORG Sat Apr 20 22:26:34 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8B7F27B5; Sat, 20 Apr 2013 22:26:34 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7A13610D2; Sat, 20 Apr 2013 22:26:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3KMQYLi067340; Sat, 20 Apr 2013 22:26:34 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3KMQYsJ067339; Sat, 20 Apr 2013 22:26:34 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201304202226.r3KMQYsJ067339@svn.freebsd.org> From: Joel Dahl Date: Sat, 20 Apr 2013 22:26:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249712 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Apr 2013 22:26:34 -0000 Author: joel (doc committer) Date: Sat Apr 20 22:26:33 2013 New Revision: 249712 URL: http://svnweb.freebsd.org/changeset/base/249712 Log: Add missing Pp. Also remove some minor whitespace. PR: 177995 Submitted by: olgeni Modified: head/share/man/man4/syscons.4 Modified: head/share/man/man4/syscons.4 ============================================================================== --- head/share/man/man4/syscons.4 Sat Apr 20 22:16:49 2013 (r249711) +++ head/share/man/man4/syscons.4 Sat Apr 20 22:26:33 2013 (r249712) @@ -471,9 +471,9 @@ device atkbdc device atkbd device vga device sc - device splash .Ed +.Pp You also need the following lines in .Pa /boot/device.hints for these drivers. From owner-svn-src-all@FreeBSD.ORG Sat Apr 20 22:46:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 45883D58; Sat, 20 Apr 2013 22:46:32 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 370511168; Sat, 20 Apr 2013 22:46:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3KMkVUU080385; Sat, 20 Apr 2013 22:46:31 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3KMkVeS080383; Sat, 20 Apr 2013 22:46:31 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201304202246.r3KMkVeS080383@svn.freebsd.org> From: Adrian Chadd Date: Sat, 20 Apr 2013 22:46:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249713 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Apr 2013 22:46:32 -0000 Author: adrian Date: Sat Apr 20 22:46:31 2013 New Revision: 249713 URL: http://svnweb.freebsd.org/changeset/base/249713 Log: There's some races (likely in the BAR handling, sigh) which is causing the pause/resume code to not be called completely symmetrically. I'll chase down the root cause of that soon; this at least works around the bug and tells me when it happens. Modified: head/sys/dev/ath/if_ath_tx.c Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Sat Apr 20 22:26:33 2013 (r249712) +++ head/sys/dev/ath/if_ath_tx.c Sat Apr 20 22:46:31 2013 (r249713) @@ -2976,7 +2976,19 @@ ath_tx_tid_resume(struct ath_softc *sc, { ATH_TX_LOCK_ASSERT(sc); - tid->paused--; + /* + * There's some odd places where ath_tx_tid_resume() is called + * when it shouldn't be; this works around that particular issue + * until it's actually resolved. + */ + if (tid->paused == 0) { + device_printf(sc->sc_dev, "%s: %6D: paused=0?\n", + __func__, + tid->an->an_node.ni_macaddr, + ":"); + } else { + tid->paused--; + } DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL, "%s: unpaused = %d\n", __func__, tid->paused); From owner-svn-src-all@FreeBSD.ORG Sat Apr 20 23:33:52 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 50E1D68C; Sat, 20 Apr 2013 23:33:52 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 280A312C8; Sat, 20 Apr 2013 23:33:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3KNXqdM012498; Sat, 20 Apr 2013 23:33:52 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3KNXqSN012497; Sat, 20 Apr 2013 23:33:52 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201304202333.r3KNXqSN012497@svn.freebsd.org> From: Warner Losh Date: Sat, 20 Apr 2013 23:33:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249714 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Apr 2013 23:33:52 -0000 Author: imp Date: Sat Apr 20 23:33:51 2013 New Revision: 249714 URL: http://svnweb.freebsd.org/changeset/base/249714 Log: Add more details about updating across the clang divide. Add hints about having a root shell around on live updates. Couple of additional nits. Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Sat Apr 20 22:46:31 2013 (r249713) +++ head/UPDATING Sat Apr 20 23:33:51 2013 (r249714) @@ -12,9 +12,9 @@ Items affecting the ports and packages s /usr/ports/UPDATING. Please read that file before running portupgrade. NOTE: FreeBSD has switched from gcc to clang. If you have trouble bootstrapping -from older versions of FreeBSD, try WITHOUT_CLANG and WITHOUT_CLANG_IS_CC to -bootstrap to tip of head, and then rebuild without those options. The bootstrap -process from older version of current is a bit fragile. +from older versions of FreeBSD, try WITHOUT_CLANG to bootstrap to tip of +head, and then rebuild without this option. The bootstrap process from +older version of current is a bit fragile. NOTE TO PEOPLE WHO THINK THAT FreeBSD 10.x IS SLOW: FreeBSD 10.x has many debugging features turned on, in both the kernel @@ -127,7 +127,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 This means that the world and kernel will be compiled with clang and that clang will be installed as /usr/bin/cc, /usr/bin/c++, and /usr/bin/cpp. To disable this behavior and revert to building - with gcc, compile with WITHOUT_CLANG_IS_CC. + with gcc, compile with WITHOUT_CLANG_IS_CC. Really old versions + of current may need to bootstrap WITHOUT_CLANG first if the clang + build fails (its compatibility window doesn't extend to the 9 stable + branch point). 20121102: The IPFIREWALL_FORWARD kernel option has been removed. Its @@ -1609,6 +1612,11 @@ COMMON ITEMS: path, and has the highest probability of being successful. Please try this approach before reporting problems with a major version upgrade. + When upgrading a life system, having a root shell around before + installing anything can help undo problems. Not having a root shell + around can lead to problems if pam has changed too much from your + starting point to allow continued authentication after the upgrade. + ZFS notes --------- When upgrading the boot ZFS pool to a new version, always follow @@ -1674,7 +1682,6 @@ COMMON ITEMS: make delete-old [6] - To cross-install current onto a separate partition -------------------------------------------------- # In this approach we use a separate partition to hold