From owner-svn-src-head@FreeBSD.ORG Sun Jun 12 00:14:57 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8FFFE106564A; Sun, 12 Jun 2011 00:14:57 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 80F898FC08; Sun, 12 Jun 2011 00:14:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5C0EvCk000105; Sun, 12 Jun 2011 00:14:57 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5C0Evw4000103; Sun, 12 Jun 2011 00:14:57 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201106120014.p5C0Evw4000103@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 12 Jun 2011 00:14:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223001 - head/release/powerpc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Jun 2011 00:14:57 -0000 Author: nwhitehorn Date: Sun Jun 12 00:14:57 2011 New Revision: 223001 URL: http://svn.freebsd.org/changeset/base/223001 Log: Add an MBR to our release media to aid booting some IBM systems. Modified: head/release/powerpc/mkisoimages.sh Modified: head/release/powerpc/mkisoimages.sh ============================================================================== --- head/release/powerpc/mkisoimages.sh Sat Jun 11 22:23:25 2011 (r223000) +++ head/release/powerpc/mkisoimages.sh Sun Jun 12 00:14:57 2011 (r223001) @@ -43,6 +43,8 @@ if [ "x$1" = "x-b" ]; then boot &device;:&partition;,\ppc\chrp\loader EOF + bootable="$bootable -o chrp-boot" + shift else bootable="" From owner-svn-src-head@FreeBSD.ORG Sun Jun 12 05:22:37 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 70279106564A; Sun, 12 Jun 2011 05:22:37 +0000 (UTC) (envelope-from doconnor@gsoft.com.au) Received: from cain.gsoft.com.au (unknown [IPv6:2001:44b8:7c07:5581:266:e1ff:fe0c:8f16]) by mx1.freebsd.org (Postfix) with ESMTP id D8C048FC17; Sun, 12 Jun 2011 05:22:36 +0000 (UTC) Received: from ur.dons.net.au (ppp203-122-208-116.lns5.adl6.internode.on.net [203.122.208.116]) (authenticated bits=0) by cain.gsoft.com.au (8.14.4/8.14.3) with ESMTP id p5C5MX82053218 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Sun, 12 Jun 2011 14:52:34 +0930 (CST) (envelope-from doconnor@gsoft.com.au) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Daniel O'Connor" In-Reply-To: Date: Sun, 12 Jun 2011 14:52:32 +0930 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201106110908.p5B98kkE066709@svn.freebsd.org> To: Robert Watson X-Mailer: Apple Mail (2.1084) X-Spam-Score: 0.163 () BAYES_00,RDNS_DYNAMIC X-Scanned-By: MIMEDefang 2.67 on 203.31.81.10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Joel Dahl Subject: Re: svn commit: r222980 - in head/sys: amd64/conf i386/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Jun 2011 05:22:37 -0000 On 11/06/2011, at 22:37, Robert Watson wrote: > While it seems like memory is "free" these days, that's not really the = case. The base kernel footprint is quite observable in VM = configurations, where it's common to configure quite low memory = footprints -- 256M, 512M, etc, in order to improve VM density. Speaking of memory - does loading something as a module impact on memory = consumption by the kernel (one way or the other)? ie would it be a penalty to load stuff as a module, especially if you = start loading 10's of them. (That said, I'm a fan of a small base kernel + modules for the many = reasons listed in this thread :) -- Daniel O'Connor software and network engineer for Genesis Software - http://www.gsoft.com.au "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C From owner-svn-src-head@FreeBSD.ORG Sun Jun 12 06:56:07 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C1551065673 for ; Sun, 12 Jun 2011 06:56:07 +0000 (UTC) (envelope-from silby@silby.com) Received: from relay01.pair.com (relay01.pair.com [209.68.5.15]) by mx1.freebsd.org (Postfix) with SMTP id 21CCA8FC13 for ; Sun, 12 Jun 2011 06:56:06 +0000 (UTC) Received: (qmail 26061 invoked from network); 12 Jun 2011 06:56:05 -0000 Received: from 209.68.2.70 (HELO localhost) (209.68.2.70) by relay01.pair.com with SMTP; 12 Jun 2011 06:56:05 -0000 X-pair-Authenticated: 209.68.2.70 Date: Sun, 12 Jun 2011 01:56:05 -0500 (CDT) From: Mike Silbersack X-X-Sender: silby@telemachus.local To: John Baldwin In-Reply-To: <201106030944.36200.jhb@freebsd.org> Message-ID: References: <201105022105.p42L5q3j054498@svn.freebsd.org> <4DCE93BF.7000803@FreeBSD.org> <86boz5fby1.fsf@kopusha.home.net> <201106030944.36200.jhb@freebsd.org> User-Agent: Alpine 2.00 (OSX 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, Mikolaj Golub , svn-src-head@freebsd.org, Bjoern Zeeb , Mike Silbersack , Lawrence Stewart Subject: Re: svn commit: r221346 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Jun 2011 06:56:07 -0000 On Fri, 3 Jun 2011, John Baldwin wrote: > On Saturday, May 14, 2011 1:07:18 pm Mikolaj Golub wrote: >> >> On Sat, 14 May 2011 10:37:51 -0400 John Baldwin wrote: >> >> JB> Can you capture a tcpdump (probably easiest to do from the other host)? >> >> I replaced the asserts with log statements to make the host not panic and the >> captured dump survive. > > Please try this change. What is happening is that you have a remaining > window that is smaller than the window scale. You are receiving zero > window updates that are received ok (becuase the socket buffer isn't > completely empty), and that advance rcv_nxt. However, tcp_output() is > not advancing rcv_adv because 'recwin' is calculated as zero. My > invariants had assumed that the ACK that gets forced out for a reply > to a zero window probe would move rcv_adv, but that isn't happening. > This patch will allow rcv_adv to advance when a zero window probe is > ACK'd. I'm not sure if this is the best way to fix this, but I think > it will fix it: > > Index: tcp_output.c > =================================================================== > --- tcp_output.c (revision 222565) > +++ tcp_output.c (working copy) > @@ -1331,7 +1331,7 @@ out: > * then remember the size of the advertised window. > * Any pending ACK has now been sent. > */ > - if (recwin > 0 && SEQ_GT(tp->rcv_nxt + recwin, tp->rcv_adv)) > + if (recwin >= 0 && SEQ_GT(tp->rcv_nxt + recwin, tp->rcv_adv)) > tp->rcv_adv = tp->rcv_nxt + recwin; > tp->last_ack_sent = tp->rcv_nxt; > tp->t_flags &= ~(TF_ACKNOW | TF_DELACK); > > > -- > John Baldwin This change looks ok to me. I can't think of a better way to solve the problem, and I don't see it causing any major change in behavior. Mike "Silby" Silbersack From owner-svn-src-head@FreeBSD.ORG Sun Jun 12 08:48:55 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 43548106564A; Sun, 12 Jun 2011 08:48:55 +0000 (UTC) (envelope-from bruce@cran.org.uk) Received: from muon.cran.org.uk (muon.cran.org.uk [IPv6:2a01:348:0:15:5d59:5c40:0:1]) by mx1.freebsd.org (Postfix) with ESMTP id CD2A08FC1F; Sun, 12 Jun 2011 08:48:54 +0000 (UTC) Received: from muon.cran.org.uk (localhost [127.0.0.1]) by muon.cran.org.uk (Postfix) with ESMTP id C379BE63C6; Sun, 12 Jun 2011 09:48:53 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=cran.org.uk; h=message-id :date:from:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; s=mail; bh=ZKMzMy6z6fmj cn/d/On3j8ACEHk=; b=LMFi7TM0GabR8l6RXNYecw53e+/07mY/c9UQB/tGAX9O jweA2LvjBuAPxdTJy7jnt/M1R7CVrOkNEqv3bkhgCqpoDtRVuZ24UMfLF9fHXQ1W RjNv+tfqur4+n5iNZNFEdhu+TLqxLLXs6XrKwRJFBjkvTmDhgmjHCxDFxFzkbrs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=cran.org.uk; h=message-id :date:from:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; q=dns; s=mail; b=DPcql8 /lBuceQY7mgV6YwVwbnAYdtc4/wO7omOdY2ZxE1Y5heUhU2s0cyZSfBMat4xcK7B W0zDF2doeLhOWHcJXtM1/iQTGYcYr7i2WhLv9kJ+nBo0S69rhW9IGBZ5hBGyrgxx aI4EHYSsguPSXtIXuLyh1vpcOkEK5/u8TBlTA= Received: from [192.168.1.75] (188-222-18-231.zone13.bethere.co.uk [188.222.18.231]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by muon.cran.org.uk (Postfix) with ESMTPSA id 8CB37E63C5; Sun, 12 Jun 2011 09:48:53 +0100 (BST) Message-ID: <4DF47D70.4040206@cran.org.uk> Date: Sun, 12 Jun 2011 09:48:48 +0100 From: Bruce Cran User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 MIME-Version: 1.0 To: Nathan Whitehorn References: <201106112144.p5BLi7WO093575@svn.freebsd.org> In-Reply-To: <201106112144.p5BLi7WO093575@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r222998 - head/usr.sbin/bsdinstall X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Jun 2011 08:48:55 -0000 On 11/06/2011 22:44, Nathan Whitehorn wrote: > Author: nwhitehorn > Date: Sat Jun 11 21:44:07 2011 > New Revision: 222998 > URL: http://svn.freebsd.org/changeset/base/222998 > > Log: > Long-overdue man page for bsdinstall. > > +.Dd June 11, 2010 I guess this should be 2011? -- Bruce Cran From owner-svn-src-head@FreeBSD.ORG Sun Jun 12 10:13:48 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9582C1065670; Sun, 12 Jun 2011 10:13:48 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 85FAA8FC13; Sun, 12 Jun 2011 10:13:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5CADm6v018249; Sun, 12 Jun 2011 10:13:48 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5CADmjp018247; Sun, 12 Jun 2011 10:13:48 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201106121013.p5CADmjp018247@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 12 Jun 2011 10:13:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223005 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Jun 2011 10:13:48 -0000 Author: jilles Date: Sun Jun 12 10:13:48 2011 New Revision: 223005 URL: http://svn.freebsd.org/changeset/base/223005 Log: sh: Read .profile from the home directory (or / if HOME is not set). In most cases, login shells are started from the home directory, but not in all, such as xterm -ls. This commit depends on r222957 for read_profile() performing parameter expansion. PR: bin/50569 Modified: head/bin/sh/main.c Modified: head/bin/sh/main.c ============================================================================== --- head/bin/sh/main.c Sun Jun 12 09:18:48 2011 (r223004) +++ head/bin/sh/main.c Sun Jun 12 10:13:48 2011 (r223005) @@ -150,7 +150,7 @@ main(int argc, char *argv[]) state1: state = 2; if (privileged == 0) - read_profile(".profile"); + read_profile("${HOME-}/.profile"); else read_profile("/etc/suid_profile"); } From owner-svn-src-head@FreeBSD.ORG Sun Jun 12 11:16:02 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 4D0E5106566C; Sun, 12 Jun 2011 11:16:02 +0000 (UTC) Date: Sun, 12 Jun 2011 11:16:02 +0000 From: Alexey Dokuchaev To: Doug Barton Message-ID: <20110612111601.GA62801@FreeBSD.org> References: <201106110908.p5B98kkE066709@svn.freebsd.org> <4DF3B12C.8020505@FreeBSD.org> <9583277B-6EC0-4B7F-9640-2B128A96C6B8@bsdimp.com> <4DF3D633.5060506@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <4DF3D633.5060506@FreeBSD.org> User-Agent: Mutt/1.4.2.1i Cc: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, Robert Watson , Joel Dahl , svn-src-head@FreeBSD.org, Warner Losh Subject: Re: svn commit: r222980 - in head/sys: amd64/conf i386/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Jun 2011 11:16:02 -0000 On Sat, Jun 11, 2011 at 01:55:15PM -0700, Doug Barton wrote: > I have 3 or 4 modules loaded via loader.conf at boot time. They take at > least 2 seconds each. IMO loading everything via loader.conf would slow > the boot so much as to be a non-starter. With my normal slim kernel with most of the modules loaded via loader.conf (other few loaded later in runtime) I have this: $ kldstat | wc -l 60 I do not observe noticeable difference compared to GENERIC kernel. Plus, users try to reboot their machines as rarely as possible, no? ./danfe From owner-svn-src-head@FreeBSD.ORG Sun Jun 12 11:21:50 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 1C8FD1065674; Sun, 12 Jun 2011 11:21:50 +0000 (UTC) Date: Sun, 12 Jun 2011 11:21:50 +0000 From: Alexey Dokuchaev To: Pawel Jakub Dawidek Message-ID: <20110612112150.GB62801@FreeBSD.org> References: <201106110908.p5B98kkE066709@svn.freebsd.org> <75DAEF7E-F43E-427E-8AFA-586E0B56D450@bsdimp.com> <20110611184549.GB3284@garage.freebsd.pl> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <20110611184549.GB3284@garage.freebsd.pl> User-Agent: Mutt/1.4.2.1i Cc: Adrian Chadd , src-committers@freebsd.org, svn-src-all@freebsd.org, Robert Watson , Joel Dahl , svn-src-head@freebsd.org, Warner Losh Subject: Re: svn commit: r222980 - in head/sys: amd64/conf i386/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Jun 2011 11:21:50 -0000 On Sat, Jun 11, 2011 at 08:51:32PM +0200, Pawel Jakub Dawidek wrote: > On Sat, Jun 11, 2011 at 10:44:14AM -0600, Warner Losh wrote: > > I think our best bet for 9 is to strip GENERIC to the bone and have a > > 'generic.conf' if you will that loads everything we compile in today. > > I think trasz@ tried that and there is a problem. Loading modules on > boot is very slow. If you try to load everything that GENERIC has as > modules the boot will take forever. Perhaps then we need to come up with something more intelligent, i.e. do not load everything trying to get maximum coverage of users' hardware, but load only required bits based on what we see on PCI bus (roughly speaking). > On all my servers and my laptop I use such minimalistic kernels and load > everything from modules. Yes, this is very convenient and IMHO the way to go. :-) ./danfe From owner-svn-src-head@FreeBSD.ORG Sun Jun 12 12:27:17 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 67DDB106564A; Sun, 12 Jun 2011 12:27:17 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5821D8FC08; Sun, 12 Jun 2011 12:27:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5CCRHK0024661; Sun, 12 Jun 2011 12:27:17 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5CCRHMw024660; Sun, 12 Jun 2011 12:27:17 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201106121227.p5CCRHMw024660@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 12 Jun 2011 12:27:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223007 - head/tools/regression/bin/sh/builtins X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Jun 2011 12:27:17 -0000 Author: jilles Date: Sun Jun 12 12:27:17 2011 New Revision: 223007 URL: http://svn.freebsd.org/changeset/base/223007 Log: sh: Add test for case pattern matching with iso-8859-1 charset. This also passes on stable/8. Added: head/tools/regression/bin/sh/builtins/case6.0 (contents, props changed) Added: head/tools/regression/bin/sh/builtins/case6.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/case6.0 Sun Jun 12 12:27:17 2011 (r223007) @@ -0,0 +1,52 @@ +# $FreeBSD$ + +unset LC_ALL +LC_CTYPE=de_DE.ISO8859-1 +export LC_CTYPE + +c1=e +# o umlaut +c2=$(printf '\366') +# non-break space +c3=$(printf '\240') +c4=$(printf '\240') +# $c2$c3$c4 form one utf-8 character + +ok=0 +case $c1$c2$c3$c4 in +*) ok=1 ;; +esac +if [ $ok = 0 ]; then + echo wrong at $LINENO + exit 3 +fi + +case $c1$c2$c3$c4 in +$c1$c2$c3$c4) ;; +*) echo wrong at $LINENO ;; +esac + +case $c1$c2$c3$c4 in +"$c1$c2$c3$c4") ;; +*) echo wrong at $LINENO ;; +esac + +case $c1$c2$c3$c4 in +????) ;; +*) echo wrong at $LINENO ;; +esac + +case $c1$c2$c3$c4 in +[!$c2][!b][!c][!d]) ;; +*) echo wrong at $LINENO ;; +esac + +case $c1$c2$c3$c4 in +[$c1][$c2][$c3][$c4]) ;; +*) echo wrong at $LINENO ;; +esac + +case $c1$c2$c3$c4 in +["$c1"]["$c2"]["$c3"]["$c4"]) ;; +*) echo wrong at $LINENO ;; +esac From owner-svn-src-head@FreeBSD.ORG Sun Jun 12 12:44:03 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 02E571065676; Sun, 12 Jun 2011 12:44:03 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DE0968FC17; Sun, 12 Jun 2011 12:44:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5CCi2vj025195; Sun, 12 Jun 2011 12:44:02 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5CCi2l0025192; Sun, 12 Jun 2011 12:44:02 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201106121244.p5CCi2l0025192@svn.freebsd.org> From: Gabor Kovesdan Date: Sun, 12 Jun 2011 12:44:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223008 - head/usr.bin/grep X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Jun 2011 12:44:03 -0000 Author: gabor Date: Sun Jun 12 12:44:02 2011 New Revision: 223008 URL: http://svn.freebsd.org/changeset/base/223008 Log: - Fix -w behavior - Make -F and -w work together - Fix --color to colorize all of the matches PR: bin/156826 Submitted by: Yuri Pankov Approved by: delphij (mentor) Modified: head/usr.bin/grep/fastgrep.c head/usr.bin/grep/util.c Modified: head/usr.bin/grep/fastgrep.c ============================================================================== --- head/usr.bin/grep/fastgrep.c Sun Jun 12 12:27:17 2011 (r223007) +++ head/usr.bin/grep/fastgrep.c Sun Jun 12 12:44:02 2011 (r223008) @@ -89,7 +89,7 @@ fastcomp(fastgrep_t *fg, const char *pat fg->bol = false; fg->eol = false; fg->reversed = false; - fg->word = wflag; + fg->word = false; /* Remove end-of-line character ('$'). */ if (fg->len > 0 && pat[fg->len - 1] == '$') { Modified: head/usr.bin/grep/util.c ============================================================================== --- head/usr.bin/grep/util.c Sun Jun 12 12:27:17 2011 (r223007) +++ head/usr.bin/grep/util.c Sun Jun 12 12:44:02 2011 (r223008) @@ -301,18 +301,15 @@ procline(struct str *l, int nottext) * XXX: grep_search() is a workaround for speed up and should be * removed in the future. See fastgrep.c. */ - if (fg_pattern[i].pattern) { + if (fg_pattern[i].pattern) r = grep_search(&fg_pattern[i], (unsigned char *)l->dat, l->len, &pmatch); - r = (r == 0) ? 0 : REG_NOMATCH; - st = pmatch.rm_eo; - } else { + else r = regexec(&r_pattern[i], l->dat, 1, &pmatch, eflags); - r = (r == 0) ? 0 : REG_NOMATCH; - st = pmatch.rm_eo; - } + r = (r == 0) ? 0 : REG_NOMATCH; + st = pmatch.rm_eo; if (r == REG_NOMATCH) continue; /* Check for full match */ @@ -321,8 +318,7 @@ procline(struct str *l, int nottext) (size_t)pmatch.rm_eo != l->len) r = REG_NOMATCH; /* Check for whole word match */ - if (r == 0 && fg_pattern[i].word && - pmatch.rm_so != 0) { + if (r == 0 && (wflag || fg_pattern[i].word)) { wint_t wbegin, wend; wbegin = wend = L' '; @@ -330,11 +326,13 @@ procline(struct str *l, int nottext) sscanf(&l->dat[pmatch.rm_so - 1], "%lc", &wbegin) != 1) r = REG_NOMATCH; - else if ((size_t)pmatch.rm_eo != l->len && + else if ((size_t)pmatch.rm_eo != + l->len && sscanf(&l->dat[pmatch.rm_eo], "%lc", &wend) != 1) r = REG_NOMATCH; - else if (iswword(wbegin) || iswword(wend)) + else if (iswword(wbegin) || + iswword(wend)) r = REG_NOMATCH; } if (r == 0) { @@ -343,7 +341,8 @@ procline(struct str *l, int nottext) if (m < MAX_LINE_MATCHES) matches[m++] = pmatch; /* matches - skip further patterns */ - if ((color != NULL && !oflag) || qflag || lflag) + if ((color == NULL && !oflag) || + qflag || lflag) break; } } @@ -353,7 +352,7 @@ procline(struct str *l, int nottext) break; } /* One pass if we are not recording matches */ - if ((color != NULL && !oflag) || qflag || lflag) + if ((color == NULL && !oflag) || qflag || lflag) break; if (st == (size_t)pmatch.rm_so) From owner-svn-src-head@FreeBSD.ORG Sun Jun 12 12:51:58 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A87C106566B; Sun, 12 Jun 2011 12:51:58 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 61FA58FC14; Sun, 12 Jun 2011 12:51:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5CCpwHd025456; Sun, 12 Jun 2011 12:51:58 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5CCpwSX025453; Sun, 12 Jun 2011 12:51:58 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201106121251.p5CCpwSX025453@svn.freebsd.org> From: Gabor Kovesdan Date: Sun, 12 Jun 2011 12:51:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223009 - head/usr.bin/grep X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Jun 2011 12:51:58 -0000 Author: gabor Date: Sun Jun 12 12:51:58 2011 New Revision: 223009 URL: http://svn.freebsd.org/changeset/base/223009 Log: - Use REG_NOSUB to bypass submatch counting when not necessary. This may yield in somewhat better performance in a few cases. Approved by: delphij (mentor) Modified: head/usr.bin/grep/grep.c head/usr.bin/grep/util.c Modified: head/usr.bin/grep/grep.c ============================================================================== --- head/usr.bin/grep/grep.c Sun Jun 12 12:44:02 2011 (r223008) +++ head/usr.bin/grep/grep.c Sun Jun 12 12:51:58 2011 (r223009) @@ -73,7 +73,7 @@ const char *errstr[] = { }; /* Flags passed to regcomp() and regexec() */ -int cflags = 0; +int cflags = REG_NOSUB; int eflags = REG_STARTEND; /* Shortcut for matching all cases like empty regex */ @@ -519,6 +519,7 @@ main(int argc, char *argv[]) break; case 'o': oflag = true; + cflags &= ~REG_NOSUB; break; case 'p': linkbehave = LINK_SKIP; @@ -552,9 +553,11 @@ main(int argc, char *argv[]) break; case 'w': wflag = true; + cflags &= ~REG_NOSUB; break; case 'x': xflag = true; + cflags &= ~REG_NOSUB; break; case 'Z': filebehave = FILE_GZIP; @@ -588,6 +591,7 @@ main(int argc, char *argv[]) strcasecmp("none", optarg) != 0 && strcasecmp("no", optarg) != 0) errx(2, getstr(3), "--color"); + cflags &= ~REG_NOSUB; break; case LABEL_OPT: label = optarg; Modified: head/usr.bin/grep/util.c ============================================================================== --- head/usr.bin/grep/util.c Sun Jun 12 12:44:02 2011 (r223008) +++ head/usr.bin/grep/util.c Sun Jun 12 12:51:58 2011 (r223009) @@ -309,7 +309,9 @@ procline(struct str *l, int nottext) r = regexec(&r_pattern[i], l->dat, 1, &pmatch, eflags); r = (r == 0) ? 0 : REG_NOMATCH; - st = pmatch.rm_eo; + st = (cflags & REG_NOSUB) + ? (size_t)l->len + : (size_t)pmatch.rm_eo; if (r == REG_NOMATCH) continue; /* Check for full match */ From owner-svn-src-head@FreeBSD.ORG Sun Jun 12 12:54:52 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 78A85106564A; Sun, 12 Jun 2011 12:54:52 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 696958FC0C; Sun, 12 Jun 2011 12:54:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5CCsqAe025633; Sun, 12 Jun 2011 12:54:52 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5CCsqbW025631; Sun, 12 Jun 2011 12:54:52 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201106121254.p5CCsqbW025631@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 12 Jun 2011 12:54:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223010 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Jun 2011 12:54:52 -0000 Author: jilles Date: Sun Jun 12 12:54:52 2011 New Revision: 223010 URL: http://svn.freebsd.org/changeset/base/223010 Log: sh: Fix locale-dependent ranges in bracket expressions. When I added UTF-8 support in r221646, the LC_COLLATE-based ordering broke because of sign extension of char. Because of libc restrictions, this does not work for UTF-8. For UTF-8 locales, ranges always use character code order. Modified: head/bin/sh/expand.c Modified: head/bin/sh/expand.c ============================================================================== --- head/bin/sh/expand.c Sun Jun 12 12:51:58 2011 (r223009) +++ head/bin/sh/expand.c Sun Jun 12 12:54:52 2011 (r223010) @@ -1430,7 +1430,7 @@ patmatch(const char *pattern, const char if (localeisutf8) wc = get_wc(&q); else - wc = *q++; + wc = (unsigned char)*q++; if (wc == '\0') return 0; break; @@ -1487,7 +1487,7 @@ patmatch(const char *pattern, const char if (localeisutf8) chr = get_wc(&q); else - chr = *q++; + chr = (unsigned char)*q++; if (chr == '\0') return 0; c = *p++; @@ -1502,7 +1502,7 @@ patmatch(const char *pattern, const char if (wc == 0) /* bad utf-8 */ return 0; } else - wc = c; + wc = (unsigned char)c; if (*p == '-' && p[1] != ']') { p++; while (*p == CTLQUOTEMARK) @@ -1514,7 +1514,7 @@ patmatch(const char *pattern, const char if (wc2 == 0) /* bad utf-8 */ return 0; } else - wc2 = *p++; + wc2 = (unsigned char)*p++; if ( collate_range_cmp(chr, wc) >= 0 && collate_range_cmp(chr, wc2) <= 0 ) From owner-svn-src-head@FreeBSD.ORG Sun Jun 12 12:55:47 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0904B1065702; Sun, 12 Jun 2011 12:55:47 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EDADB8FC18; Sun, 12 Jun 2011 12:55:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5CCtkUm025707; Sun, 12 Jun 2011 12:55:46 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5CCtkwY025706; Sun, 12 Jun 2011 12:55:46 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201106121255.p5CCtkwY025706@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 12 Jun 2011 12:55:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223011 - head/tools/regression/bin/sh/builtins X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Jun 2011 12:55:47 -0000 Author: jilles Date: Sun Jun 12 12:55:46 2011 New Revision: 223011 URL: http://svn.freebsd.org/changeset/base/223011 Log: sh: Add test for LC_COLLATE-based character ranges in case. Added: head/tools/regression/bin/sh/builtins/case7.0 (contents, props changed) Added: head/tools/regression/bin/sh/builtins/case7.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/case7.0 Sun Jun 12 12:55:46 2011 (r223011) @@ -0,0 +1,24 @@ +# $FreeBSD$ + +# Character ranges in a locale other than the POSIX locale, not specified +# by POSIX. + +unset LC_ALL +LC_CTYPE=de_DE.ISO8859-1 +export LC_CTYPE +LC_COLLATE=de_DE.ISO8859-1 +export LC_COLLATE + +c1=e +# o umlaut +c2=$(printf '\366') + +case $c1$c2 in +[a-z][a-z]) ;; +*) echo wrong at $LINENO ;; +esac + +case $c1$c2 in +[a-f][n-p]) ;; +*) echo wrong at $LINENO ;; +esac From owner-svn-src-head@FreeBSD.ORG Sun Jun 12 14:47:11 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 16FC2106564A; Sun, 12 Jun 2011 14:47:11 +0000 (UTC) (envelope-from doconnor@gsoft.com.au) Received: from cain.gsoft.com.au (unknown [IPv6:2001:44b8:7c07:5581:266:e1ff:fe0c:8f16]) by mx1.freebsd.org (Postfix) with ESMTP id 620AB8FC0C; Sun, 12 Jun 2011 14:47:10 +0000 (UTC) Received: from ur.dons.net.au (ppp203-122-208-116.lns5.adl6.internode.on.net [203.122.208.116]) (authenticated bits=0) by cain.gsoft.com.au (8.14.4/8.14.3) with ESMTP id p5CEkumj084384 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Mon, 13 Jun 2011 00:16:57 +0930 (CST) (envelope-from doconnor@gsoft.com.au) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Daniel O'Connor" In-Reply-To: <20110612112150.GB62801@FreeBSD.org> Date: Mon, 13 Jun 2011 00:16:56 +0930 Content-Transfer-Encoding: quoted-printable Message-Id: <94A51677-0181-471A-B4D6-DC596C7BCBFD@gsoft.com.au> References: <201106110908.p5B98kkE066709@svn.freebsd.org> <75DAEF7E-F43E-427E-8AFA-586E0B56D450@bsdimp.com> <20110611184549.GB3284@garage.freebsd.pl> <20110612112150.GB62801@FreeBSD.org> To: Alexey Dokuchaev X-Mailer: Apple Mail (2.1084) X-Spam-Score: 0.163 () BAYES_00,RDNS_DYNAMIC X-Scanned-By: MIMEDefang 2.67 on 203.31.81.10 Cc: Adrian Chadd , src-committers@freebsd.org, Pawel Jakub Dawidek , svn-src-all@freebsd.org, Robert Watson , Joel Dahl , svn-src-head@freebsd.org, Warner Losh Subject: Re: svn commit: r222980 - in head/sys: amd64/conf i386/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Jun 2011 14:47:11 -0000 On 12/06/2011, at 20:51, Alexey Dokuchaev wrote: >> I think trasz@ tried that and there is a problem. Loading modules on >> boot is very slow. If you try to load everything that GENERIC has as >> modules the boot will take forever. >=20 > Perhaps then we need to come up with something more intelligent, i.e. = do not > load everything trying to get maximum coverage of users' hardware, but > load only required bits based on what we see on PCI bus (roughly = speaking). Now the tricky part is extracting supported device IDs from drivers in = an automatic fashion :) I imagine some symbol magic could be done for the general case so a tool = could extract the IDs & the bus type (so it could work for PCI & USB = which covers about 99.9% of the hardware in question). ISTR there a few modules which call some blob to determine if the module = is supported but I think it's quite rare (the 80/20 rule works for me = here :) -- Daniel O'Connor software and network engineer for Genesis Software - http://www.gsoft.com.au "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C From owner-svn-src-head@FreeBSD.ORG Sun Jun 12 15:19:38 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EBE26106566C; Sun, 12 Jun 2011 15:19:38 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DC1018FC08; Sun, 12 Jun 2011 15:19:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5CFJcKK029961; Sun, 12 Jun 2011 15:19:38 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5CFJce4029959; Sun, 12 Jun 2011 15:19:38 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201106121519.p5CFJce4029959@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 12 Jun 2011 15:19:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223012 - head/usr.sbin/bsdinstall X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Jun 2011 15:19:39 -0000 Author: nwhitehorn Date: Sun Jun 12 15:19:38 2011 New Revision: 223012 URL: http://svn.freebsd.org/changeset/base/223012 Log: I forgot what year it is, apparently. Submitted by: brucec Modified: head/usr.sbin/bsdinstall/bsdinstall.8 Modified: head/usr.sbin/bsdinstall/bsdinstall.8 ============================================================================== --- head/usr.sbin/bsdinstall/bsdinstall.8 Sun Jun 12 12:55:46 2011 (r223011) +++ head/usr.sbin/bsdinstall/bsdinstall.8 Sun Jun 12 15:19:38 2011 (r223012) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 11, 2010 +.Dd June 11, 2011 .Dt bsdinstall 8 .Os .Sh NAME From owner-svn-src-head@FreeBSD.ORG Sun Jun 12 18:01:32 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EAFE9106564A; Sun, 12 Jun 2011 18:01:32 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9E2078FC0C; Sun, 12 Jun 2011 18:01:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5CI1WLK035295; Sun, 12 Jun 2011 18:01:32 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5CI1Wr6035268; Sun, 12 Jun 2011 18:01:32 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201106121801.p5CI1Wr6035268@svn.freebsd.org> From: Dimitry Andric Date: Sun, 12 Jun 2011 18:01:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223017 - in head: contrib/llvm/include/llvm contrib/llvm/include/llvm-c contrib/llvm/include/llvm/ADT contrib/llvm/include/llvm/Analysis contrib/llvm/include/llvm/CodeGen contrib/llvm/... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Jun 2011 18:01:33 -0000 Author: dim Date: Sun Jun 12 18:01:31 2011 New Revision: 223017 URL: http://svn.freebsd.org/changeset/base/223017 Log: Upgrade our copy of llvm/clang to r132879, from upstream's trunk. Added: head/contrib/llvm/include/llvm/ADT/PackedVector.h - copied unchanged from r223016, vendor/llvm/dist/include/llvm/ADT/PackedVector.h head/contrib/llvm/include/llvm/Analysis/BranchProbabilityInfo.h - copied unchanged from r223016, vendor/llvm/dist/include/llvm/Analysis/BranchProbabilityInfo.h head/contrib/llvm/include/llvm/DefaultPasses.h - copied unchanged from r223016, vendor/llvm/dist/include/llvm/DefaultPasses.h head/contrib/llvm/include/llvm/MC/MCWin64EH.h - copied unchanged from r223016, vendor/llvm/dist/include/llvm/MC/MCWin64EH.h head/contrib/llvm/include/llvm/Support/BranchProbability.h - copied unchanged from r223016, vendor/llvm/dist/include/llvm/Support/BranchProbability.h head/contrib/llvm/include/llvm/Support/PassManagerBuilder.h - copied unchanged from r223016, vendor/llvm/dist/include/llvm/Support/PassManagerBuilder.h head/contrib/llvm/include/llvm/Support/Win64EH.h - copied unchanged from r223016, vendor/llvm/dist/include/llvm/Support/Win64EH.h head/contrib/llvm/lib/Analysis/BranchProbabilityInfo.cpp - copied unchanged from r223016, vendor/llvm/dist/lib/Analysis/BranchProbabilityInfo.cpp head/contrib/llvm/lib/CodeGen/AsmPrinter/Win64Exception.cpp - copied unchanged from r223016, vendor/llvm/dist/lib/CodeGen/AsmPrinter/Win64Exception.cpp head/contrib/llvm/lib/CodeGen/RegisterClassInfo.cpp - copied unchanged from r223016, vendor/llvm/dist/lib/CodeGen/RegisterClassInfo.cpp head/contrib/llvm/lib/CodeGen/RegisterClassInfo.h - copied unchanged from r223016, vendor/llvm/dist/lib/CodeGen/RegisterClassInfo.h head/contrib/llvm/lib/ExecutionEngine/TargetSelect.cpp - copied unchanged from r223016, vendor/llvm/dist/lib/ExecutionEngine/TargetSelect.cpp head/contrib/llvm/lib/MC/MCWin64EH.cpp - copied unchanged from r223016, vendor/llvm/dist/lib/MC/MCWin64EH.cpp head/contrib/llvm/lib/Support/BranchProbability.cpp - copied unchanged from r223016, vendor/llvm/dist/lib/Support/BranchProbability.cpp head/contrib/llvm/lib/Target/Mips/MipsEmitGPRestore.cpp - copied unchanged from r223016, vendor/llvm/dist/lib/Target/Mips/MipsEmitGPRestore.cpp head/contrib/llvm/utils/TableGen/CodeGenRegisters.cpp - copied unchanged from r223016, vendor/llvm/dist/utils/TableGen/CodeGenRegisters.cpp head/contrib/llvm/utils/TableGen/SetTheory.cpp - copied unchanged from r223016, vendor/llvm/dist/utils/TableGen/SetTheory.cpp head/contrib/llvm/utils/TableGen/SetTheory.h - copied unchanged from r223016, vendor/llvm/dist/utils/TableGen/SetTheory.h Deleted: head/contrib/llvm/include/llvm/Support/StandardPasses.h head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfTableException.cpp head/contrib/llvm/lib/ExecutionEngine/JIT/TargetSelect.cpp head/contrib/llvm/lib/ExecutionEngine/MCJIT/TargetSelect.cpp head/contrib/llvm/tools/clang/include/clang/Tooling/Tooling.h head/contrib/llvm/tools/clang/lib/Frontend/DiagChecker.cpp head/contrib/llvm/tools/clang/lib/Tooling/JsonCompileCommandLineDatabase.cpp head/contrib/llvm/tools/clang/lib/Tooling/JsonCompileCommandLineDatabase.h head/contrib/llvm/tools/clang/lib/Tooling/Tooling.cpp Modified: head/contrib/llvm/include/llvm-c/Core.h head/contrib/llvm/include/llvm-c/Disassembler.h head/contrib/llvm/include/llvm/ADT/FoldingSet.h head/contrib/llvm/include/llvm/ADT/StringRef.h head/contrib/llvm/include/llvm/ADT/Triple.h head/contrib/llvm/include/llvm/Analysis/AliasAnalysis.h head/contrib/llvm/include/llvm/Analysis/CallGraph.h head/contrib/llvm/include/llvm/Analysis/DIBuilder.h head/contrib/llvm/include/llvm/Analysis/DebugInfo.h head/contrib/llvm/include/llvm/Analysis/FindUsedTypes.h head/contrib/llvm/include/llvm/Analysis/IVUsers.h head/contrib/llvm/include/llvm/Analysis/RegionPass.h head/contrib/llvm/include/llvm/Analysis/ScalarEvolution.h head/contrib/llvm/include/llvm/Argument.h head/contrib/llvm/include/llvm/Attributes.h head/contrib/llvm/include/llvm/CodeGen/AsmPrinter.h head/contrib/llvm/include/llvm/CodeGen/CallingConvLower.h head/contrib/llvm/include/llvm/CodeGen/FastISel.h head/contrib/llvm/include/llvm/CodeGen/ISDOpcodes.h head/contrib/llvm/include/llvm/CodeGen/LiveInterval.h head/contrib/llvm/include/llvm/CodeGen/MachineInstr.h head/contrib/llvm/include/llvm/CodeGen/MachineInstrBuilder.h head/contrib/llvm/include/llvm/CodeGen/MachineModuleInfo.h head/contrib/llvm/include/llvm/CodeGen/MachineOperand.h head/contrib/llvm/include/llvm/CodeGen/PseudoSourceValue.h head/contrib/llvm/include/llvm/CodeGen/RegAllocPBQP.h head/contrib/llvm/include/llvm/CodeGen/ScheduleDAG.h head/contrib/llvm/include/llvm/CodeGen/SelectionDAG.h head/contrib/llvm/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h head/contrib/llvm/include/llvm/CompilerDriver/Common.td head/contrib/llvm/include/llvm/ExecutionEngine/ExecutionEngine.h head/contrib/llvm/include/llvm/Function.h head/contrib/llvm/include/llvm/InitializePasses.h head/contrib/llvm/include/llvm/IntrinsicInst.h head/contrib/llvm/include/llvm/Intrinsics.td head/contrib/llvm/include/llvm/IntrinsicsARM.td head/contrib/llvm/include/llvm/IntrinsicsX86.td head/contrib/llvm/include/llvm/IntrinsicsXCore.td head/contrib/llvm/include/llvm/LinkAllPasses.h head/contrib/llvm/include/llvm/MC/MCAsmInfo.h head/contrib/llvm/include/llvm/MC/MCDwarf.h head/contrib/llvm/include/llvm/MC/MCELFSymbolFlags.h head/contrib/llvm/include/llvm/MC/MCExpr.h head/contrib/llvm/include/llvm/MC/MCInstPrinter.h head/contrib/llvm/include/llvm/MC/MCParser/MCAsmLexer.h head/contrib/llvm/include/llvm/MC/MCParser/MCAsmParser.h head/contrib/llvm/include/llvm/MC/MCParser/MCAsmParserExtension.h head/contrib/llvm/include/llvm/MC/MCStreamer.h head/contrib/llvm/include/llvm/Metadata.h head/contrib/llvm/include/llvm/Operator.h head/contrib/llvm/include/llvm/Support/Casting.h head/contrib/llvm/include/llvm/Support/CrashRecoveryContext.h head/contrib/llvm/include/llvm/Support/Dwarf.h head/contrib/llvm/include/llvm/Support/IRBuilder.h head/contrib/llvm/include/llvm/Support/MemoryBuffer.h head/contrib/llvm/include/llvm/Support/PatternMatch.h head/contrib/llvm/include/llvm/Support/Program.h head/contrib/llvm/include/llvm/Support/SourceMgr.h head/contrib/llvm/include/llvm/Target/Target.td head/contrib/llvm/include/llvm/Target/TargetAsmInfo.h head/contrib/llvm/include/llvm/Target/TargetInstrItineraries.h head/contrib/llvm/include/llvm/Target/TargetLibraryInfo.h head/contrib/llvm/include/llvm/Target/TargetLowering.h head/contrib/llvm/include/llvm/Target/TargetLoweringObjectFile.h head/contrib/llvm/include/llvm/Target/TargetOptions.h head/contrib/llvm/include/llvm/Target/TargetRegisterInfo.h head/contrib/llvm/include/llvm/Target/TargetSelectionDAG.td head/contrib/llvm/include/llvm/Transforms/Instrumentation.h head/contrib/llvm/include/llvm/Transforms/Utils/Local.h head/contrib/llvm/include/llvm/Transforms/Utils/SSAUpdater.h head/contrib/llvm/include/llvm/Type.h head/contrib/llvm/lib/Analysis/Analysis.cpp head/contrib/llvm/lib/Analysis/BasicAliasAnalysis.cpp head/contrib/llvm/lib/Analysis/ConstantFolding.cpp head/contrib/llvm/lib/Analysis/DIBuilder.cpp head/contrib/llvm/lib/Analysis/IPA/CallGraph.cpp head/contrib/llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp head/contrib/llvm/lib/Analysis/IPA/FindUsedTypes.cpp head/contrib/llvm/lib/Analysis/IVUsers.cpp head/contrib/llvm/lib/Analysis/InlineCost.cpp head/contrib/llvm/lib/Analysis/InstructionSimplify.cpp head/contrib/llvm/lib/Analysis/LazyValueInfo.cpp head/contrib/llvm/lib/Analysis/Loads.cpp head/contrib/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp head/contrib/llvm/lib/Analysis/RegionPass.cpp head/contrib/llvm/lib/Analysis/ScalarEvolution.cpp head/contrib/llvm/lib/Analysis/ValueTracking.cpp head/contrib/llvm/lib/AsmParser/LLLexer.cpp head/contrib/llvm/lib/AsmParser/LLLexer.h head/contrib/llvm/lib/AsmParser/LLParser.cpp head/contrib/llvm/lib/AsmParser/LLToken.h head/contrib/llvm/lib/Bitcode/Reader/BitcodeReader.cpp head/contrib/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp head/contrib/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp head/contrib/llvm/lib/CodeGen/AggressiveAntiDepBreaker.cpp head/contrib/llvm/lib/CodeGen/AggressiveAntiDepBreaker.h head/contrib/llvm/lib/CodeGen/AllocationOrder.cpp head/contrib/llvm/lib/CodeGen/AllocationOrder.h head/contrib/llvm/lib/CodeGen/AntiDepBreaker.h head/contrib/llvm/lib/CodeGen/AsmPrinter/ARMException.cpp head/contrib/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp head/contrib/llvm/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfCFIException.cpp head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfException.h head/contrib/llvm/lib/CodeGen/BranchFolding.cpp head/contrib/llvm/lib/CodeGen/BranchFolding.h head/contrib/llvm/lib/CodeGen/CalcSpillWeights.cpp head/contrib/llvm/lib/CodeGen/CallingConvLower.cpp head/contrib/llvm/lib/CodeGen/CriticalAntiDepBreaker.cpp head/contrib/llvm/lib/CodeGen/CriticalAntiDepBreaker.h head/contrib/llvm/lib/CodeGen/DwarfEHPrepare.cpp head/contrib/llvm/lib/CodeGen/IfConversion.cpp head/contrib/llvm/lib/CodeGen/InlineSpiller.cpp head/contrib/llvm/lib/CodeGen/LLVMTargetMachine.cpp head/contrib/llvm/lib/CodeGen/LiveDebugVariables.cpp head/contrib/llvm/lib/CodeGen/LiveDebugVariables.h head/contrib/llvm/lib/CodeGen/LiveRangeEdit.cpp head/contrib/llvm/lib/CodeGen/LiveRangeEdit.h head/contrib/llvm/lib/CodeGen/MachineBasicBlock.cpp head/contrib/llvm/lib/CodeGen/MachineFunction.cpp head/contrib/llvm/lib/CodeGen/MachineInstr.cpp head/contrib/llvm/lib/CodeGen/MachineRegisterInfo.cpp head/contrib/llvm/lib/CodeGen/MachineVerifier.cpp head/contrib/llvm/lib/CodeGen/PostRASchedulerList.cpp head/contrib/llvm/lib/CodeGen/RegAllocBase.h head/contrib/llvm/lib/CodeGen/RegAllocBasic.cpp head/contrib/llvm/lib/CodeGen/RegAllocFast.cpp head/contrib/llvm/lib/CodeGen/RegAllocGreedy.cpp head/contrib/llvm/lib/CodeGen/RegisterScavenging.cpp head/contrib/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp head/contrib/llvm/lib/CodeGen/ScheduleDAGInstrs.h head/contrib/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h head/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp head/contrib/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp head/contrib/llvm/lib/CodeGen/SimpleRegisterCoalescing.h head/contrib/llvm/lib/CodeGen/SjLjEHPrepare.cpp head/contrib/llvm/lib/CodeGen/SplitKit.cpp head/contrib/llvm/lib/CodeGen/SplitKit.h head/contrib/llvm/lib/CodeGen/TailDuplication.cpp head/contrib/llvm/lib/CodeGen/TargetInstrInfoImpl.cpp head/contrib/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp head/contrib/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp head/contrib/llvm/lib/CodeGen/UnreachableBlockElim.cpp head/contrib/llvm/lib/CodeGen/VirtRegMap.cpp head/contrib/llvm/lib/ExecutionEngine/ExecutionEngine.cpp head/contrib/llvm/lib/ExecutionEngine/JIT/JIT.cpp head/contrib/llvm/lib/ExecutionEngine/JIT/JIT.h head/contrib/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp head/contrib/llvm/lib/ExecutionEngine/MCJIT/MCJIT.h head/contrib/llvm/lib/ExecutionEngine/MCJIT/MCJITMemoryManager.h head/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp head/contrib/llvm/lib/MC/ELFObjectWriter.cpp head/contrib/llvm/lib/MC/ELFObjectWriter.h head/contrib/llvm/lib/MC/MCAsmInfo.cpp head/contrib/llvm/lib/MC/MCAsmInfoDarwin.cpp head/contrib/llvm/lib/MC/MCAsmStreamer.cpp head/contrib/llvm/lib/MC/MCAssembler.cpp head/contrib/llvm/lib/MC/MCDisassembler/Disassembler.cpp head/contrib/llvm/lib/MC/MCDwarf.cpp head/contrib/llvm/lib/MC/MCELF.cpp head/contrib/llvm/lib/MC/MCELFStreamer.cpp head/contrib/llvm/lib/MC/MCExpr.cpp head/contrib/llvm/lib/MC/MCInstPrinter.cpp head/contrib/llvm/lib/MC/MCMachOStreamer.cpp head/contrib/llvm/lib/MC/MCObjectStreamer.cpp head/contrib/llvm/lib/MC/MCParser/AsmLexer.cpp head/contrib/llvm/lib/MC/MCParser/AsmParser.cpp head/contrib/llvm/lib/MC/MCParser/COFFAsmParser.cpp head/contrib/llvm/lib/MC/MCParser/DarwinAsmParser.cpp head/contrib/llvm/lib/MC/MCStreamer.cpp head/contrib/llvm/lib/MC/WinCOFFStreamer.cpp head/contrib/llvm/lib/Support/APInt.cpp head/contrib/llvm/lib/Support/Dwarf.cpp head/contrib/llvm/lib/Support/FoldingSet.cpp head/contrib/llvm/lib/Support/Host.cpp head/contrib/llvm/lib/Support/MemoryBuffer.cpp head/contrib/llvm/lib/Support/SourceMgr.cpp head/contrib/llvm/lib/Support/Unix/Host.inc head/contrib/llvm/lib/Support/Unix/Program.inc head/contrib/llvm/lib/Support/Windows/Program.inc head/contrib/llvm/lib/Target/ARM/ARMAsmBackend.cpp head/contrib/llvm/lib/Target/ARM/ARMAsmPrinter.cpp head/contrib/llvm/lib/Target/ARM/ARMAsmPrinter.h head/contrib/llvm/lib/Target/ARM/ARMBaseRegisterInfo.cpp head/contrib/llvm/lib/Target/ARM/ARMBaseRegisterInfo.h head/contrib/llvm/lib/Target/ARM/ARMCodeEmitter.cpp head/contrib/llvm/lib/Target/ARM/ARMFastISel.cpp head/contrib/llvm/lib/Target/ARM/ARMFixupKinds.h head/contrib/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp head/contrib/llvm/lib/Target/ARM/ARMISelLowering.cpp head/contrib/llvm/lib/Target/ARM/ARMISelLowering.h head/contrib/llvm/lib/Target/ARM/ARMInstrFormats.td head/contrib/llvm/lib/Target/ARM/ARMInstrInfo.td head/contrib/llvm/lib/Target/ARM/ARMInstrNEON.td head/contrib/llvm/lib/Target/ARM/ARMInstrThumb.td head/contrib/llvm/lib/Target/ARM/ARMInstrThumb2.td head/contrib/llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp head/contrib/llvm/lib/Target/ARM/ARMMCAsmInfo.cpp head/contrib/llvm/lib/Target/ARM/ARMMCCodeEmitter.cpp head/contrib/llvm/lib/Target/ARM/ARMPerfectShuffle.h head/contrib/llvm/lib/Target/ARM/ARMRegisterInfo.td head/contrib/llvm/lib/Target/ARM/ARMSelectionDAGInfo.cpp head/contrib/llvm/lib/Target/ARM/ARMSelectionDAGInfo.h head/contrib/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp head/contrib/llvm/lib/Target/ARM/Disassembler/ARMDisassemblerCore.cpp head/contrib/llvm/lib/Target/ARM/Disassembler/ThumbDisassemblerCore.h head/contrib/llvm/lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp head/contrib/llvm/lib/Target/ARM/InstPrinter/ARMInstPrinter.h head/contrib/llvm/lib/Target/ARM/Thumb1RegisterInfo.cpp head/contrib/llvm/lib/Target/Alpha/AlphaISelLowering.cpp head/contrib/llvm/lib/Target/Alpha/AlphaISelLowering.h head/contrib/llvm/lib/Target/Alpha/AlphaRegisterInfo.cpp head/contrib/llvm/lib/Target/Alpha/AlphaRegisterInfo.h head/contrib/llvm/lib/Target/Alpha/AlphaRegisterInfo.td head/contrib/llvm/lib/Target/Blackfin/BlackfinFrameLowering.cpp head/contrib/llvm/lib/Target/Blackfin/BlackfinFrameLowering.h head/contrib/llvm/lib/Target/Blackfin/BlackfinISelDAGToDAG.cpp head/contrib/llvm/lib/Target/Blackfin/BlackfinISelLowering.cpp head/contrib/llvm/lib/Target/Blackfin/BlackfinISelLowering.h head/contrib/llvm/lib/Target/Blackfin/BlackfinInstrInfo.cpp head/contrib/llvm/lib/Target/Blackfin/BlackfinRegisterInfo.cpp head/contrib/llvm/lib/Target/Blackfin/BlackfinRegisterInfo.h head/contrib/llvm/lib/Target/Blackfin/BlackfinRegisterInfo.td head/contrib/llvm/lib/Target/CBackend/CBackend.cpp head/contrib/llvm/lib/Target/CellSPU/SPUISelLowering.cpp head/contrib/llvm/lib/Target/CellSPU/SPUISelLowering.h head/contrib/llvm/lib/Target/CellSPU/SPURegisterInfo.cpp head/contrib/llvm/lib/Target/CellSPU/SPURegisterInfo.h head/contrib/llvm/lib/Target/CellSPU/SPURegisterInfo.td head/contrib/llvm/lib/Target/MBlaze/MBlazeISelLowering.cpp head/contrib/llvm/lib/Target/MBlaze/MBlazeISelLowering.h head/contrib/llvm/lib/Target/MBlaze/MBlazeInstrInfo.td head/contrib/llvm/lib/Target/MBlaze/MBlazeRegisterInfo.cpp head/contrib/llvm/lib/Target/MBlaze/MBlazeRegisterInfo.h head/contrib/llvm/lib/Target/MBlaze/MBlazeRegisterInfo.td head/contrib/llvm/lib/Target/MSP430/MSP430ISelLowering.cpp head/contrib/llvm/lib/Target/MSP430/MSP430ISelLowering.h head/contrib/llvm/lib/Target/MSP430/MSP430RegisterInfo.cpp head/contrib/llvm/lib/Target/MSP430/MSP430RegisterInfo.h head/contrib/llvm/lib/Target/MSP430/MSP430RegisterInfo.td head/contrib/llvm/lib/Target/Mips/Mips.h head/contrib/llvm/lib/Target/Mips/MipsAsmPrinter.cpp head/contrib/llvm/lib/Target/Mips/MipsFrameLowering.cpp head/contrib/llvm/lib/Target/Mips/MipsFrameLowering.h head/contrib/llvm/lib/Target/Mips/MipsISelDAGToDAG.cpp head/contrib/llvm/lib/Target/Mips/MipsISelLowering.cpp head/contrib/llvm/lib/Target/Mips/MipsISelLowering.h head/contrib/llvm/lib/Target/Mips/MipsInstrFPU.td head/contrib/llvm/lib/Target/Mips/MipsInstrFormats.td head/contrib/llvm/lib/Target/Mips/MipsInstrInfo.h head/contrib/llvm/lib/Target/Mips/MipsInstrInfo.td head/contrib/llvm/lib/Target/Mips/MipsMCAsmInfo.cpp head/contrib/llvm/lib/Target/Mips/MipsMachineFunction.h head/contrib/llvm/lib/Target/Mips/MipsRegisterInfo.cpp head/contrib/llvm/lib/Target/Mips/MipsRegisterInfo.h head/contrib/llvm/lib/Target/Mips/MipsRegisterInfo.td head/contrib/llvm/lib/Target/Mips/MipsTargetMachine.cpp head/contrib/llvm/lib/Target/Mips/MipsTargetMachine.h head/contrib/llvm/lib/Target/PTX/PTX.td head/contrib/llvm/lib/Target/PTX/PTXISelLowering.cpp head/contrib/llvm/lib/Target/PTX/PTXISelLowering.h head/contrib/llvm/lib/Target/PTX/PTXInstrInfo.td head/contrib/llvm/lib/Target/PTX/PTXRegisterInfo.h head/contrib/llvm/lib/Target/PTX/PTXSubtarget.cpp head/contrib/llvm/lib/Target/PTX/PTXSubtarget.h head/contrib/llvm/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp head/contrib/llvm/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.h head/contrib/llvm/lib/Target/PowerPC/PPC.h head/contrib/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp head/contrib/llvm/lib/Target/PowerPC/PPCFrameLowering.cpp head/contrib/llvm/lib/Target/PowerPC/PPCHazardRecognizers.cpp head/contrib/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp head/contrib/llvm/lib/Target/PowerPC/PPCISelLowering.cpp head/contrib/llvm/lib/Target/PowerPC/PPCISelLowering.h head/contrib/llvm/lib/Target/PowerPC/PPCInstr64Bit.td head/contrib/llvm/lib/Target/PowerPC/PPCInstrInfo.td head/contrib/llvm/lib/Target/PowerPC/PPCMCAsmInfo.cpp head/contrib/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp head/contrib/llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp head/contrib/llvm/lib/Target/PowerPC/PPCRegisterInfo.h head/contrib/llvm/lib/Target/PowerPC/PPCRegisterInfo.td head/contrib/llvm/lib/Target/Sparc/SparcISelLowering.cpp head/contrib/llvm/lib/Target/Sparc/SparcISelLowering.h head/contrib/llvm/lib/Target/Sparc/SparcRegisterInfo.cpp head/contrib/llvm/lib/Target/Sparc/SparcRegisterInfo.h head/contrib/llvm/lib/Target/Sparc/SparcRegisterInfo.td head/contrib/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp head/contrib/llvm/lib/Target/SystemZ/SystemZISelLowering.h head/contrib/llvm/lib/Target/SystemZ/SystemZRegisterInfo.cpp head/contrib/llvm/lib/Target/SystemZ/SystemZRegisterInfo.h head/contrib/llvm/lib/Target/SystemZ/SystemZRegisterInfo.td head/contrib/llvm/lib/Target/TargetLibraryInfo.cpp head/contrib/llvm/lib/Target/TargetLoweringObjectFile.cpp head/contrib/llvm/lib/Target/TargetMachine.cpp head/contrib/llvm/lib/Target/TargetRegisterInfo.cpp head/contrib/llvm/lib/Target/X86/InstPrinter/X86ATTInstPrinter.cpp head/contrib/llvm/lib/Target/X86/InstPrinter/X86ATTInstPrinter.h head/contrib/llvm/lib/Target/X86/InstPrinter/X86IntelInstPrinter.cpp head/contrib/llvm/lib/Target/X86/InstPrinter/X86IntelInstPrinter.h head/contrib/llvm/lib/Target/X86/X86.td head/contrib/llvm/lib/Target/X86/X86FastISel.cpp head/contrib/llvm/lib/Target/X86/X86FrameLowering.cpp head/contrib/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp head/contrib/llvm/lib/Target/X86/X86ISelLowering.h head/contrib/llvm/lib/Target/X86/X86InstrCompiler.td head/contrib/llvm/lib/Target/X86/X86InstrExtension.td head/contrib/llvm/lib/Target/X86/X86InstrFragmentsSIMD.td head/contrib/llvm/lib/Target/X86/X86InstrInfo.cpp head/contrib/llvm/lib/Target/X86/X86InstrInfo.h head/contrib/llvm/lib/Target/X86/X86InstrInfo.td head/contrib/llvm/lib/Target/X86/X86InstrMMX.td head/contrib/llvm/lib/Target/X86/X86InstrSSE.td head/contrib/llvm/lib/Target/X86/X86MCAsmInfo.cpp head/contrib/llvm/lib/Target/X86/X86MCCodeEmitter.cpp head/contrib/llvm/lib/Target/X86/X86MCInstLower.cpp head/contrib/llvm/lib/Target/X86/X86RegisterInfo.cpp head/contrib/llvm/lib/Target/X86/X86RegisterInfo.h head/contrib/llvm/lib/Target/X86/X86RegisterInfo.td head/contrib/llvm/lib/Target/X86/X86Subtarget.cpp head/contrib/llvm/lib/Target/XCore/XCoreISelDAGToDAG.cpp head/contrib/llvm/lib/Target/XCore/XCoreISelLowering.cpp head/contrib/llvm/lib/Target/XCore/XCoreISelLowering.h head/contrib/llvm/lib/Target/XCore/XCoreInstrInfo.td head/contrib/llvm/lib/Target/XCore/XCoreRegisterInfo.cpp head/contrib/llvm/lib/Target/XCore/XCoreRegisterInfo.h head/contrib/llvm/lib/Target/XCore/XCoreRegisterInfo.td head/contrib/llvm/lib/Transforms/IPO/DeadTypeElimination.cpp head/contrib/llvm/lib/Transforms/IPO/ExtractGV.cpp head/contrib/llvm/lib/Transforms/IPO/GlobalOpt.cpp head/contrib/llvm/lib/Transforms/IPO/PruneEH.cpp head/contrib/llvm/lib/Transforms/InstCombine/InstCombine.h head/contrib/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp head/contrib/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp head/contrib/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp head/contrib/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp head/contrib/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp head/contrib/llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp head/contrib/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp head/contrib/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp head/contrib/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp head/contrib/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp head/contrib/llvm/lib/Transforms/Instrumentation/PathProfiling.cpp head/contrib/llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp head/contrib/llvm/lib/Transforms/Scalar/GVN.cpp head/contrib/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp head/contrib/llvm/lib/Transforms/Scalar/JumpThreading.cpp head/contrib/llvm/lib/Transforms/Scalar/LICM.cpp head/contrib/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp head/contrib/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp head/contrib/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp head/contrib/llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp head/contrib/llvm/lib/Transforms/Scalar/SCCP.cpp head/contrib/llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp head/contrib/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp head/contrib/llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp head/contrib/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp head/contrib/llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp head/contrib/llvm/lib/Transforms/Utils/BuildLibCalls.cpp head/contrib/llvm/lib/Transforms/Utils/InlineFunction.cpp head/contrib/llvm/lib/Transforms/Utils/Local.cpp head/contrib/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp head/contrib/llvm/lib/Transforms/Utils/SSAUpdater.cpp head/contrib/llvm/lib/Transforms/Utils/SimplifyCFG.cpp head/contrib/llvm/lib/VMCore/Attributes.cpp head/contrib/llvm/lib/VMCore/AutoUpgrade.cpp head/contrib/llvm/lib/VMCore/DebugInfoProbe.cpp head/contrib/llvm/lib/VMCore/Function.cpp head/contrib/llvm/lib/VMCore/IRBuilder.cpp head/contrib/llvm/lib/VMCore/InlineAsm.cpp head/contrib/llvm/lib/VMCore/Instructions.cpp head/contrib/llvm/lib/VMCore/PassManager.cpp head/contrib/llvm/lib/VMCore/Type.cpp head/contrib/llvm/lib/VMCore/Verifier.cpp head/contrib/llvm/tools/clang/include/clang-c/Index.h head/contrib/llvm/tools/clang/include/clang/AST/APValue.h head/contrib/llvm/tools/clang/include/clang/AST/ASTContext.h head/contrib/llvm/tools/clang/include/clang/AST/CanonicalType.h head/contrib/llvm/tools/clang/include/clang/AST/Decl.h head/contrib/llvm/tools/clang/include/clang/AST/DeclBase.h head/contrib/llvm/tools/clang/include/clang/AST/DeclCXX.h head/contrib/llvm/tools/clang/include/clang/AST/DeclObjC.h head/contrib/llvm/tools/clang/include/clang/AST/DeclTemplate.h head/contrib/llvm/tools/clang/include/clang/AST/Expr.h head/contrib/llvm/tools/clang/include/clang/AST/ExternalASTSource.h head/contrib/llvm/tools/clang/include/clang/AST/RecursiveASTVisitor.h head/contrib/llvm/tools/clang/include/clang/AST/StmtVisitor.h head/contrib/llvm/tools/clang/include/clang/AST/Type.h head/contrib/llvm/tools/clang/include/clang/AST/TypeLoc.h head/contrib/llvm/tools/clang/include/clang/AST/TypeNodes.def head/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsARM.def head/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsX86.def head/contrib/llvm/tools/clang/include/clang/Basic/DeclNodes.td head/contrib/llvm/tools/clang/include/clang/Basic/Diagnostic.h head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticCommonKinds.td head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticFrontendKinds.td head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticGroups.td head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticIDs.h head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticParseKinds.td head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticSemaKinds.td head/contrib/llvm/tools/clang/include/clang/Basic/ExceptionSpecificationType.h head/contrib/llvm/tools/clang/include/clang/Basic/IdentifierTable.h head/contrib/llvm/tools/clang/include/clang/Basic/LangOptions.h head/contrib/llvm/tools/clang/include/clang/Basic/SourceLocation.h head/contrib/llvm/tools/clang/include/clang/Basic/SourceManager.h head/contrib/llvm/tools/clang/include/clang/Basic/Specifiers.h head/contrib/llvm/tools/clang/include/clang/Basic/StmtNodes.td head/contrib/llvm/tools/clang/include/clang/Basic/TargetInfo.h head/contrib/llvm/tools/clang/include/clang/Basic/TokenKinds.def head/contrib/llvm/tools/clang/include/clang/Basic/TypeTraits.h head/contrib/llvm/tools/clang/include/clang/Basic/arm_neon.td head/contrib/llvm/tools/clang/include/clang/Driver/CC1AsOptions.td head/contrib/llvm/tools/clang/include/clang/Driver/CC1Options.td head/contrib/llvm/tools/clang/include/clang/Driver/Options.td head/contrib/llvm/tools/clang/include/clang/Driver/ToolChain.h head/contrib/llvm/tools/clang/include/clang/Frontend/ASTUnit.h head/contrib/llvm/tools/clang/include/clang/Frontend/CodeGenOptions.h head/contrib/llvm/tools/clang/include/clang/Frontend/DiagnosticOptions.h head/contrib/llvm/tools/clang/include/clang/Frontend/LangStandard.h head/contrib/llvm/tools/clang/include/clang/Frontend/LangStandards.def head/contrib/llvm/tools/clang/include/clang/Frontend/PreprocessorOptions.h head/contrib/llvm/tools/clang/include/clang/Frontend/Utils.h head/contrib/llvm/tools/clang/include/clang/Lex/HeaderSearch.h head/contrib/llvm/tools/clang/include/clang/Lex/LiteralSupport.h head/contrib/llvm/tools/clang/include/clang/Lex/PreprocessingRecord.h head/contrib/llvm/tools/clang/include/clang/Lex/Preprocessor.h head/contrib/llvm/tools/clang/include/clang/Parse/Parser.h head/contrib/llvm/tools/clang/include/clang/Sema/CodeCompleteConsumer.h head/contrib/llvm/tools/clang/include/clang/Sema/DeclSpec.h head/contrib/llvm/tools/clang/include/clang/Sema/Initialization.h head/contrib/llvm/tools/clang/include/clang/Sema/Lookup.h head/contrib/llvm/tools/clang/include/clang/Sema/Overload.h head/contrib/llvm/tools/clang/include/clang/Sema/Scope.h head/contrib/llvm/tools/clang/include/clang/Sema/Sema.h head/contrib/llvm/tools/clang/include/clang/Sema/Template.h head/contrib/llvm/tools/clang/include/clang/Serialization/ASTBitCodes.h head/contrib/llvm/tools/clang/include/clang/Serialization/ASTReader.h head/contrib/llvm/tools/clang/include/clang/Serialization/ASTWriter.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/Checker.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/CheckerManager.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/BasicValueFactory.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/GRState.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ObjCMessage.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SValBuilder.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/Store.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SubEngine.h head/contrib/llvm/tools/clang/lib/AST/APValue.cpp head/contrib/llvm/tools/clang/lib/AST/ASTContext.cpp head/contrib/llvm/tools/clang/lib/AST/ASTDiagnostic.cpp head/contrib/llvm/tools/clang/lib/AST/ASTImporter.cpp head/contrib/llvm/tools/clang/lib/AST/Decl.cpp head/contrib/llvm/tools/clang/lib/AST/DeclBase.cpp head/contrib/llvm/tools/clang/lib/AST/DeclCXX.cpp head/contrib/llvm/tools/clang/lib/AST/DeclObjC.cpp head/contrib/llvm/tools/clang/lib/AST/DeclPrinter.cpp head/contrib/llvm/tools/clang/lib/AST/DeclTemplate.cpp head/contrib/llvm/tools/clang/lib/AST/DumpXML.cpp head/contrib/llvm/tools/clang/lib/AST/Expr.cpp head/contrib/llvm/tools/clang/lib/AST/ExprClassification.cpp head/contrib/llvm/tools/clang/lib/AST/ExprConstant.cpp head/contrib/llvm/tools/clang/lib/AST/ExternalASTSource.cpp head/contrib/llvm/tools/clang/lib/AST/ItaniumMangle.cpp head/contrib/llvm/tools/clang/lib/AST/Mangle.cpp head/contrib/llvm/tools/clang/lib/AST/MicrosoftMangle.cpp head/contrib/llvm/tools/clang/lib/AST/RecordLayoutBuilder.cpp head/contrib/llvm/tools/clang/lib/AST/StmtPrinter.cpp head/contrib/llvm/tools/clang/lib/AST/StmtProfile.cpp head/contrib/llvm/tools/clang/lib/AST/Type.cpp head/contrib/llvm/tools/clang/lib/AST/TypePrinter.cpp head/contrib/llvm/tools/clang/lib/Analysis/AnalysisContext.cpp head/contrib/llvm/tools/clang/lib/Analysis/CFG.cpp head/contrib/llvm/tools/clang/lib/Analysis/CocoaConventions.cpp head/contrib/llvm/tools/clang/lib/Analysis/LiveVariables.cpp head/contrib/llvm/tools/clang/lib/Analysis/UninitializedValues.cpp head/contrib/llvm/tools/clang/lib/Basic/Diagnostic.cpp head/contrib/llvm/tools/clang/lib/Basic/DiagnosticIDs.cpp head/contrib/llvm/tools/clang/lib/Basic/FileManager.cpp head/contrib/llvm/tools/clang/lib/Basic/IdentifierTable.cpp head/contrib/llvm/tools/clang/lib/Basic/SourceManager.cpp head/contrib/llvm/tools/clang/lib/Basic/Targets.cpp head/contrib/llvm/tools/clang/lib/CodeGen/BackendUtil.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGBlocks.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGBuiltin.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGCXX.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGCall.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGCall.h head/contrib/llvm/tools/clang/lib/CodeGen/CGClass.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.h head/contrib/llvm/tools/clang/lib/CodeGen/CGDecl.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGDeclCXX.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGException.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGExpr.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGExprAgg.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGExprCXX.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGExprConstant.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGExprScalar.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGObjC.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGObjCGNU.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGObjCMac.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGObjCRuntime.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGObjCRuntime.h head/contrib/llvm/tools/clang/lib/CodeGen/CGRecordLayoutBuilder.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGStmt.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGVTT.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGVTables.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CodeGenFunction.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CodeGenFunction.h head/contrib/llvm/tools/clang/lib/CodeGen/CodeGenModule.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CodeGenModule.h head/contrib/llvm/tools/clang/lib/CodeGen/CodeGenTypes.h head/contrib/llvm/tools/clang/lib/CodeGen/ItaniumCXXABI.cpp head/contrib/llvm/tools/clang/lib/CodeGen/ModuleBuilder.cpp head/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.cpp head/contrib/llvm/tools/clang/lib/Driver/Driver.cpp head/contrib/llvm/tools/clang/lib/Driver/HostInfo.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChains.h head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp head/contrib/llvm/tools/clang/lib/Driver/Tools.h head/contrib/llvm/tools/clang/lib/Frontend/ASTConsumers.cpp head/contrib/llvm/tools/clang/lib/Frontend/ASTUnit.cpp head/contrib/llvm/tools/clang/lib/Frontend/CompilerInstance.cpp head/contrib/llvm/tools/clang/lib/Frontend/CompilerInvocation.cpp head/contrib/llvm/tools/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp head/contrib/llvm/tools/clang/lib/Frontend/InitHeaderSearch.cpp head/contrib/llvm/tools/clang/lib/Frontend/InitPreprocessor.cpp head/contrib/llvm/tools/clang/lib/Frontend/LogDiagnosticPrinter.cpp head/contrib/llvm/tools/clang/lib/Frontend/TextDiagnosticPrinter.cpp head/contrib/llvm/tools/clang/lib/Frontend/Warnings.cpp head/contrib/llvm/tools/clang/lib/Headers/emmintrin.h head/contrib/llvm/tools/clang/lib/Headers/mmintrin.h head/contrib/llvm/tools/clang/lib/Headers/xmmintrin.h head/contrib/llvm/tools/clang/lib/Index/CallGraph.cpp head/contrib/llvm/tools/clang/lib/Index/Indexer.cpp head/contrib/llvm/tools/clang/lib/Lex/HeaderSearch.cpp head/contrib/llvm/tools/clang/lib/Lex/Lexer.cpp head/contrib/llvm/tools/clang/lib/Lex/LiteralSupport.cpp head/contrib/llvm/tools/clang/lib/Lex/MacroInfo.cpp head/contrib/llvm/tools/clang/lib/Lex/PPDirectives.cpp head/contrib/llvm/tools/clang/lib/Lex/PPMacroExpansion.cpp head/contrib/llvm/tools/clang/lib/Lex/Pragma.cpp head/contrib/llvm/tools/clang/lib/Lex/PreprocessingRecord.cpp head/contrib/llvm/tools/clang/lib/Lex/Preprocessor.cpp head/contrib/llvm/tools/clang/lib/Parse/ParseCXXInlineMethods.cpp head/contrib/llvm/tools/clang/lib/Parse/ParseDecl.cpp head/contrib/llvm/tools/clang/lib/Parse/ParseDeclCXX.cpp head/contrib/llvm/tools/clang/lib/Parse/ParseExpr.cpp head/contrib/llvm/tools/clang/lib/Parse/ParseExprCXX.cpp head/contrib/llvm/tools/clang/lib/Parse/ParseObjc.cpp head/contrib/llvm/tools/clang/lib/Parse/ParsePragma.cpp head/contrib/llvm/tools/clang/lib/Parse/ParseStmt.cpp head/contrib/llvm/tools/clang/lib/Parse/ParseTemplate.cpp head/contrib/llvm/tools/clang/lib/Parse/ParseTentative.cpp head/contrib/llvm/tools/clang/lib/Parse/Parser.cpp head/contrib/llvm/tools/clang/lib/Rewrite/RewriteObjC.cpp head/contrib/llvm/tools/clang/lib/Sema/AnalysisBasedWarnings.cpp head/contrib/llvm/tools/clang/lib/Sema/DeclSpec.cpp head/contrib/llvm/tools/clang/lib/Sema/JumpDiagnostics.cpp head/contrib/llvm/tools/clang/lib/Sema/Sema.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaAccess.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaCXXCast.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaCXXScopeSpec.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaChecking.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaCodeComplete.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaDecl.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaDeclCXX.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaDeclObjC.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaExceptionSpec.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaExpr.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaExprCXX.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaExprObjC.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaInit.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaLookup.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaOverload.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaStmt.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaTemplate.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaTemplateDeduction.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaTemplateInstantiate.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaTemplateVariadic.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaType.cpp head/contrib/llvm/tools/clang/lib/Sema/TreeTransform.h head/contrib/llvm/tools/clang/lib/Serialization/ASTReader.cpp head/contrib/llvm/tools/clang/lib/Serialization/ASTReaderDecl.cpp head/contrib/llvm/tools/clang/lib/Serialization/ASTReaderStmt.cpp head/contrib/llvm/tools/clang/lib/Serialization/ASTWriter.cpp head/contrib/llvm/tools/clang/lib/Serialization/ASTWriterDecl.cpp head/contrib/llvm/tools/clang/lib/Serialization/ASTWriterStmt.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/CStringChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/NSErrorChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/BasicStore.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/BasicValueFactory.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/CFRefCount.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/CXXExprEngine.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/CheckerManager.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/Environment.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/FlatStore.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/GRState.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/ObjCMessage.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/RegionStore.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/SimpleConstraintManager.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp head/contrib/llvm/tools/clang/tools/driver/cc1as_main.cpp head/contrib/llvm/utils/TableGen/AsmMatcherEmitter.cpp head/contrib/llvm/utils/TableGen/AsmWriterEmitter.cpp head/contrib/llvm/utils/TableGen/ClangDiagnosticsEmitter.cpp head/contrib/llvm/utils/TableGen/CodeGenIntrinsics.h head/contrib/llvm/utils/TableGen/CodeGenRegisters.h head/contrib/llvm/utils/TableGen/CodeGenTarget.cpp head/contrib/llvm/utils/TableGen/CodeGenTarget.h head/contrib/llvm/utils/TableGen/DAGISelMatcherGen.cpp head/contrib/llvm/utils/TableGen/EDEmitter.cpp head/contrib/llvm/utils/TableGen/FastISelEmitter.cpp head/contrib/llvm/utils/TableGen/IntrinsicEmitter.cpp head/contrib/llvm/utils/TableGen/LLVMCConfigurationEmitter.cpp head/contrib/llvm/utils/TableGen/NeonEmitter.cpp head/contrib/llvm/utils/TableGen/Record.cpp head/contrib/llvm/utils/TableGen/RegisterInfoEmitter.cpp head/contrib/llvm/utils/TableGen/TGLexer.cpp head/contrib/llvm/utils/TableGen/TGLexer.h head/contrib/llvm/utils/TableGen/TGParser.h head/contrib/llvm/utils/TableGen/TableGen.cpp head/lib/clang/include/clang/Basic/Version.inc head/lib/clang/libclangfrontend/Makefile head/lib/clang/libllvmasmprinter/Makefile head/lib/clang/libllvmcodegen/Makefile head/lib/clang/libllvmmc/Makefile head/lib/clang/libllvmmipscodegen/Makefile head/sys/boot/i386/zfsboot/Makefile head/usr.bin/clang/tblgen/Makefile Directory Properties: head/contrib/llvm/ (props changed) head/contrib/llvm/tools/clang/ (props changed) Modified: head/contrib/llvm/include/llvm-c/Core.h ============================================================================== --- head/contrib/llvm/include/llvm-c/Core.h Sun Jun 12 15:46:57 2011 (r223016) +++ head/contrib/llvm/include/llvm-c/Core.h Sun Jun 12 18:01:31 2011 (r223017) @@ -282,6 +282,8 @@ typedef enum { LLVMRealPredicateTrue /**< Always true (always folded) */ } LLVMRealPredicate; +void LLVMInitializeCore(LLVMPassRegistryRef R); + /*===-- Error handling ----------------------------------------------------===*/ @@ -1164,6 +1166,7 @@ namespace llvm { for (LLVMValueRef *I = Vals, *E = Vals + Length; I != E; ++I) cast(*I); #endif + (void)Length; return reinterpret_cast(Vals); } Modified: head/contrib/llvm/include/llvm-c/Disassembler.h ============================================================================== --- head/contrib/llvm/include/llvm-c/Disassembler.h Sun Jun 12 15:46:57 2011 (r223016) +++ head/contrib/llvm/include/llvm-c/Disassembler.h Sun Jun 12 18:01:31 2011 (r223017) @@ -7,16 +7,16 @@ |* *| |*===----------------------------------------------------------------------===*| |* *| -|* This header provides public interface to a disassembler library. *| +|* This header provides a public interface to a disassembler library. *| |* LLVM provides an implementation of this interface. *| |* *| \*===----------------------------------------------------------------------===*/ #ifndef LLVM_C_DISASSEMBLER_H -#define LLVM_C_DISASSEMBLER_H 1 +#define LLVM_C_DISASSEMBLER_H -#include #include "llvm/Support/DataTypes.h" +#include /** * An opaque reference to a disassembler context. @@ -38,14 +38,11 @@ typedef void *LLVMDisasmContextRef; * will be the instruction width. The information is returned in TagBuf and is * Triple specific with its specific information defined by the value of * TagType for that Triple. If symbolic information is returned the function - * returns 1 else it returns 0. + * returns 1, otherwise it returns 0. */ -typedef int (*LLVMOpInfoCallback)(void *DisInfo, - uint64_t PC, - uint64_t Offset, - uint64_t Size, - int TagType, - void *TagBuf); +typedef int (*LLVMOpInfoCallback)(void *DisInfo, uint64_t PC, + uint64_t Offset, uint64_t Size, + int TagType, void *TagBuf); /** * The initial support in LLVM MC for the most general form of a relocatable @@ -68,10 +65,11 @@ typedef int (*LLVMOpInfoCallback)(void * * operands like "_foo@GOT", ":lower16:_foo", etc. */ struct LLVMOpInfoSymbol1 { - uint64_t Present; /* 1 if this symbol is present */ - char *Name; /* symbol name if not NULL */ - uint64_t Value; /* symbol value if name is NULL */ + uint64_t Present; /* 1 if this symbol is present */ + char *Name; /* symbol name if not NULL */ + uint64_t Value; /* symbol value if name is NULL */ }; + struct LLVMOpInfo1 { struct LLVMOpInfoSymbol1 AddSymbol; struct LLVMOpInfoSymbol1 SubtractSymbol; @@ -92,11 +90,11 @@ struct LLVMOpInfo1 { /** * The type for the symbol lookup function. This may be called by the - * disassembler for such things like adding a comment for a PC plus a constant + * disassembler for things like adding a comment for a PC plus a constant * offset load instruction to use a symbol name instead of a load address value. * It is passed the block information is saved when the disassembler context is * created and a value of a symbol to look up. If no symbol is found NULL is - * to be returned. + * returned. */ typedef const char *(*LLVMSymbolLookupCallback)(void *DisInfo, uint64_t SymbolValue); @@ -107,40 +105,33 @@ extern "C" { /** * Create a disassembler for the TripleName. Symbolic disassembly is supported - * by passing a block of information in the DisInfo parameter and specifing the - * TagType and call back functions as described above. These can all be passed - * as NULL. If successful this returns a disassembler context if not it + * by passing a block of information in the DisInfo parameter and specifying the + * TagType and callback functions as described above. These can all be passed + * as NULL. If successful, this returns a disassembler context. If not, it * returns NULL. */ -extern LLVMDisasmContextRef -LLVMCreateDisasm(const char *TripleName, - void *DisInfo, - int TagType, - LLVMOpInfoCallback GetOpInfo, - LLVMSymbolLookupCallback SymbolLookUp); +LLVMDisasmContextRef LLVMCreateDisasm(const char *TripleName, void *DisInfo, + int TagType, LLVMOpInfoCallback GetOpInfo, + LLVMSymbolLookupCallback SymbolLookUp); /** * Dispose of a disassembler context. */ -extern void -LLVMDisasmDispose(LLVMDisasmContextRef DC); +void LLVMDisasmDispose(LLVMDisasmContextRef DC); /** - * Disassmble a single instruction using the disassembler context specified in - * the parameter DC. The bytes of the instruction are specified in the parameter - * Bytes, and contains at least BytesSize number of bytes. The instruction is - * at the address specified by the PC parameter. If a valid instruction can be - * disassembled its string is returned indirectly in OutString which whos size - * is specified in the parameter OutStringSize. This function returns the - * number of bytes in the instruction or zero if there was no valid instruction. - */ -extern size_t -LLVMDisasmInstruction(LLVMDisasmContextRef DC, - uint8_t *Bytes, - uint64_t BytesSize, - uint64_t PC, - char *OutString, - size_t OutStringSize); + * Disassemble a single instruction using the disassembler context specified in + * the parameter DC. The bytes of the instruction are specified in the + * parameter Bytes, and contains at least BytesSize number of bytes. The + * instruction is at the address specified by the PC parameter. If a valid + * instruction can be disassembled, its string is returned indirectly in + * OutString whose size is specified in the parameter OutStringSize. This + * function returns the number of bytes in the instruction or zero if there was + * no valid instruction. + */ +size_t LLVMDisasmInstruction(LLVMDisasmContextRef DC, uint8_t *Bytes, + uint64_t BytesSize, uint64_t PC, + char *OutString, size_t OutStringSize); #ifdef __cplusplus } Modified: head/contrib/llvm/include/llvm/ADT/FoldingSet.h ============================================================================== --- head/contrib/llvm/include/llvm/ADT/FoldingSet.h Sun Jun 12 15:46:57 2011 (r223016) +++ head/contrib/llvm/include/llvm/ADT/FoldingSet.h Sun Jun 12 18:01:31 2011 (r223017) @@ -671,17 +671,10 @@ public: // Partial specializations of FoldingSetTrait. template struct FoldingSetTrait { - static inline void Profile(const T *X, FoldingSetNodeID &ID) { + static inline void Profile(T *X, FoldingSetNodeID &ID) { ID.AddPointer(X); } }; - -template struct FoldingSetTrait { - static inline void Profile(const T *X, FoldingSetNodeID &ID) { - ID.AddPointer(X); - } -}; - } // End of namespace llvm. #endif Copied: head/contrib/llvm/include/llvm/ADT/PackedVector.h (from r223016, vendor/llvm/dist/include/llvm/ADT/PackedVector.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/llvm/include/llvm/ADT/PackedVector.h Sun Jun 12 18:01:31 2011 (r223017, copy of r223016, vendor/llvm/dist/include/llvm/ADT/PackedVector.h) @@ -0,0 +1,158 @@ +//===- llvm/ADT/PackedVector.h - Packed values vector -----------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file implements the PackedVector class. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_ADT_PACKEDVECTOR_H +#define LLVM_ADT_PACKEDVECTOR_H + +#include "llvm/ADT/BitVector.h" +#include + +namespace llvm { + +template +class PackedVectorBase; + +// This won't be necessary if we can specialize members without specializing +// the parent template. +template +class PackedVectorBase { +protected: + static T getValue(const llvm::BitVector &Bits, unsigned Idx) { + T val = T(); + for (unsigned i = 0; i != BitNum; ++i) + val = T(val | ((Bits[(Idx << (BitNum-1)) + i] ? 1UL : 0UL) << i)); + return val; + } + + static void setValue(llvm::BitVector &Bits, unsigned Idx, T val) { + assert((val >> BitNum) == 0 && "value is too big"); + for (unsigned i = 0; i != BitNum; ++i) + Bits[(Idx << (BitNum-1)) + i] = val & (T(1) << i); + } +}; + +template +class PackedVectorBase { +protected: + static T getValue(const llvm::BitVector &Bits, unsigned Idx) { + T val = T(); + for (unsigned i = 0; i != BitNum-1; ++i) + val = T(val | ((Bits[(Idx << (BitNum-1)) + i] ? 1UL : 0UL) << i)); + if (Bits[(Idx << (BitNum-1)) + BitNum-1]) + val = ~val; + return val; + } + + static void setValue(llvm::BitVector &Bits, unsigned Idx, T val) { + if (val < 0) { + val = ~val; + Bits.set((Idx << (BitNum-1)) + BitNum-1); + } + assert((val >> (BitNum-1)) == 0 && "value is too big"); + for (unsigned i = 0; i != BitNum-1; ++i) + Bits[(Idx << (BitNum-1)) + i] = val & (T(1) << i); + } +}; + +/// \brief Store a vector of values using a specific number of bits for each +/// value. Both signed and unsigned types can be used, e.g +/// @code +/// PackedVector vec; +/// @endcode +/// will create a vector accepting values -2, -1, 0, 1. Any other value will hit +/// an assertion. +template +class PackedVector : public PackedVectorBase::is_signed> { + llvm::BitVector Bits; + typedef PackedVectorBase::is_signed> base; + +public: + class reference { + PackedVector &Vec; + const unsigned Idx; + + reference(); // Undefined + public: + reference(PackedVector &vec, unsigned idx) : Vec(vec), Idx(idx) { } + + reference &operator=(T val) { + Vec.setValue(Vec.Bits, Idx, val); + return *this; + } + operator T() { + return Vec.getValue(Vec.Bits, Idx); + } + }; + + PackedVector() { } + explicit PackedVector(unsigned size) : Bits(size << (BitNum-1)) { } + + bool empty() const { return Bits.empty(); } + + unsigned size() const { return Bits.size() >> (BitNum-1); } + + void clear() { Bits.clear(); } + + void resize(unsigned N) { Bits.resize(N << (BitNum-1)); } + + void reserve(unsigned N) { Bits.reserve(N << (BitNum-1)); } + + PackedVector &reset() { + Bits.reset(); + return *this; + } + + void push_back(T val) { + resize(size()+1); + (*this)[size()-1] = val; + } + + reference operator[](unsigned Idx) { + return reference(*this, Idx); + } + + T operator[](unsigned Idx) const { + return base::getValue(Bits, Idx); + } + + bool operator==(const PackedVector &RHS) const { + return Bits == RHS.Bits; + } + + bool operator!=(const PackedVector &RHS) const { + return Bits != RHS.Bits; + } + + const PackedVector &operator=(const PackedVector &RHS) { + Bits = RHS.Bits; + return *this; + } + + PackedVector &operator|=(const PackedVector &RHS) { + Bits |= RHS.Bits; + return *this; + } + + void swap(PackedVector &RHS) { + Bits.swap(RHS.Bits); + } +}; + +// Leave BitNum=0 undefined. +template +class PackedVector; + +} // end llvm namespace + +#endif Modified: head/contrib/llvm/include/llvm/ADT/StringRef.h ============================================================================== --- head/contrib/llvm/include/llvm/ADT/StringRef.h Sun Jun 12 15:46:57 2011 (r223016) +++ head/contrib/llvm/include/llvm/ADT/StringRef.h Sun Jun 12 18:01:31 2011 (r223017) @@ -46,7 +46,14 @@ namespace llvm { // integer works around this bug. static size_t min(size_t a, size_t b) { return a < b ? a : b; } static size_t max(size_t a, size_t b) { return a > b ? a : b; } - + + // Workaround memcmp issue with null pointers (undefined behavior) + // by providing a specialized version + static int compareMemory(const char *Lhs, const char *Rhs, size_t Length) { + if (Length == 0) { return 0; } + return ::memcmp(Lhs,Rhs,Length); + } + public: /// @name Constructors /// @{ @@ -56,11 +63,17 @@ namespace llvm { /// Construct a string ref from a cstring. /*implicit*/ StringRef(const char *Str) - : Data(Str), Length(::strlen(Str)) {} + : Data(Str) { + assert(Str && "StringRef cannot be built from a NULL argument"); + Length = ::strlen(Str); // invoking strlen(NULL) is undefined behavior + } /// Construct a string ref from a pointer and length. /*implicit*/ StringRef(const char *data, size_t length) - : Data(data), Length(length) {} + : Data(data), Length(length) { + assert((data || length == 0) && + "StringRef cannot be built from a NULL argument with non-null length"); + } /// Construct a string ref from an std::string. /*implicit*/ StringRef(const std::string &Str) @@ -104,7 +117,7 @@ namespace llvm { /// compare() when the relative ordering of inequal strings isn't needed. bool equals(StringRef RHS) const { return (Length == RHS.Length && - memcmp(Data, RHS.Data, RHS.Length) == 0); + compareMemory(Data, RHS.Data, RHS.Length) == 0); } /// equals_lower - Check for string equality, ignoring case. @@ -116,7 +129,7 @@ namespace llvm { /// is lexicographically less than, equal to, or greater than the \arg RHS. int compare(StringRef RHS) const { // Check the prefix for a mismatch. - if (int Res = memcmp(Data, RHS.Data, min(Length, RHS.Length))) + if (int Res = compareMemory(Data, RHS.Data, min(Length, RHS.Length))) return Res < 0 ? -1 : 1; // Otherwise the prefixes match, so we only need to check the lengths. @@ -183,13 +196,13 @@ namespace llvm { /// startswith - Check if this string starts with the given \arg Prefix. bool startswith(StringRef Prefix) const { return Length >= Prefix.Length && - memcmp(Data, Prefix.Data, Prefix.Length) == 0; + compareMemory(Data, Prefix.Data, Prefix.Length) == 0; } /// endswith - Check if this string ends with the given \arg Suffix. bool endswith(StringRef Suffix) const { return Length >= Suffix.Length && - memcmp(end() - Suffix.Length, Suffix.Data, Suffix.Length) == 0; + compareMemory(end() - Suffix.Length, Suffix.Data, Suffix.Length) == 0; } /// @} @@ -447,6 +460,10 @@ namespace llvm { return LHS.compare(RHS) != -1; } + inline std::string &operator+=(std::string &buffer, llvm::StringRef string) { + return buffer.append(string.data(), string.size()); + } + /// @} // StringRefs can be treated like a POD type. Modified: head/contrib/llvm/include/llvm/ADT/Triple.h ============================================================================== --- head/contrib/llvm/include/llvm/ADT/Triple.h Sun Jun 12 15:46:57 2011 (r223016) +++ head/contrib/llvm/include/llvm/ADT/Triple.h Sun Jun 12 18:01:31 2011 (r223017) @@ -225,7 +225,7 @@ public: /// if the environment component is present). StringRef getOSAndEnvironmentName() const; - /// getOSNumber - Parse the version number from the OS name component of the + /// getOSVersion - Parse the version number from the OS name component of the /// triple, if present. /// /// For example, "fooos1.2.3" would return (1, 2, 3). Modified: head/contrib/llvm/include/llvm/Analysis/AliasAnalysis.h ============================================================================== --- head/contrib/llvm/include/llvm/Analysis/AliasAnalysis.h Sun Jun 12 15:46:57 2011 (r223016) +++ head/contrib/llvm/include/llvm/Analysis/AliasAnalysis.h Sun Jun 12 18:01:31 2011 (r223017) @@ -38,6 +38,7 @@ #define LLVM_ANALYSIS_ALIAS_ANALYSIS_H #include "llvm/Support/CallSite.h" +#include "llvm/ADT/DenseMap.h" namespace llvm { @@ -488,6 +489,32 @@ public: } }; +// Specialize DenseMapInfo for Location. +template<> +struct DenseMapInfo { + static inline AliasAnalysis::Location getEmptyKey() { + return + AliasAnalysis::Location(DenseMapInfo::getEmptyKey(), + 0, 0); + } + static inline AliasAnalysis::Location getTombstoneKey() { + return + AliasAnalysis::Location(DenseMapInfo::getTombstoneKey(), + 0, 0); + } + static unsigned getHashValue(const AliasAnalysis::Location &Val) { + return DenseMapInfo::getHashValue(Val.Ptr) ^ + DenseMapInfo::getHashValue(Val.Size) ^ + DenseMapInfo::getHashValue(Val.TBAATag); + } + static bool isEqual(const AliasAnalysis::Location &LHS, + const AliasAnalysis::Location &RHS) { + return LHS.Ptr == RHS.Ptr && + LHS.Size == RHS.Size && + LHS.TBAATag == RHS.TBAATag; + } +}; + /// isNoAliasCall - Return true if this pointer is returned by a noalias /// function. bool isNoAliasCall(const Value *V); Copied: head/contrib/llvm/include/llvm/Analysis/BranchProbabilityInfo.h (from r223016, vendor/llvm/dist/include/llvm/Analysis/BranchProbabilityInfo.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/llvm/include/llvm/Analysis/BranchProbabilityInfo.h Sun Jun 12 18:01:31 2011 (r223017, copy of r223016, vendor/llvm/dist/include/llvm/Analysis/BranchProbabilityInfo.h) @@ -0,0 +1,78 @@ +//===--- BranchProbabilityInfo.h - Branch Probability Analysis --*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This pass is used to evaluate branch probabilties. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_ANALYSIS_BRANCHPROBABILITYINFO_H +#define LLVM_ANALYSIS_BRANCHPROBABILITYINFO_H + +#include "llvm/InitializePasses.h" +#include "llvm/Support/BranchProbability.h" +#include "llvm/Analysis/LoopInfo.h" + +namespace llvm { + +class raw_ostream; + +class BranchProbabilityInfo : public FunctionPass { + + // Default weight value. Used when we don't have information about the edge. + static const uint32_t DEFAULT_WEIGHT = 16; + + typedef std::pair Edge; + + DenseMap Weights; + + // Get sum of the block successors' weights. + uint32_t getSumForBlock(BasicBlock *BB) const; + +public: + static char ID; + + BranchProbabilityInfo() : FunctionPass(ID) { + initializeBranchProbabilityInfoPass(*PassRegistry::getPassRegistry()); + } + + void getAnalysisUsage(AnalysisUsage &AU) const { + AU.addRequired(); + AU.setPreservesAll(); + } + + bool runOnFunction(Function &F); + + // Returned value is between 1 and UINT32_MAX. Look at + // BranchProbabilityInfo.cpp for details. + uint32_t getEdgeWeight(BasicBlock *Src, BasicBlock *Dst) const; + + // Look at BranchProbabilityInfo.cpp for details. Use it with caution! + void setEdgeWeight(BasicBlock *Src, BasicBlock *Dst, uint32_t Weight); + + // A 'Hot' edge is an edge which probability is >= 80%. + bool isEdgeHot(BasicBlock *Src, BasicBlock *Dst) const; + + // Return a hot successor for the block BB or null if there isn't one. + BasicBlock *getHotSucc(BasicBlock *BB) const; + + // Return a probability as a fraction between 0 (0% probability) and + // 1 (100% probability), however the value is never equal to 0, and can be 1 + // only iff SRC block has only one successor. + BranchProbability getEdgeProbability(BasicBlock *Src, BasicBlock *Dst) const; + + // Print value between 0 (0% probability) and 1 (100% probability), + // however the value is never equal to 0, and can be 1 only iff SRC block + // has only one successor. + raw_ostream &printEdgeProbability(raw_ostream &OS, BasicBlock *Src, + BasicBlock *Dst) const; +}; + +} + +#endif Modified: head/contrib/llvm/include/llvm/Analysis/CallGraph.h ============================================================================== --- head/contrib/llvm/include/llvm/Analysis/CallGraph.h Sun Jun 12 15:46:57 2011 (r223016) +++ head/contrib/llvm/include/llvm/Analysis/CallGraph.h Sun Jun 12 18:01:31 2011 (r223017) @@ -259,6 +259,9 @@ public: /// addCalledFunction - Add a function to the list of functions called by this /// one. void addCalledFunction(CallSite CS, CallGraphNode *M) { + assert(!CS.getInstruction() || + !CS.getCalledFunction() || + !CS.getCalledFunction()->isIntrinsic()); CalledFunctions.push_back(std::make_pair(CS.getInstruction(), M)); M->AddRef(); } Modified: head/contrib/llvm/include/llvm/Analysis/DIBuilder.h ============================================================================== --- head/contrib/llvm/include/llvm/Analysis/DIBuilder.h Sun Jun 12 15:46:57 2011 (r223016) +++ head/contrib/llvm/include/llvm/Analysis/DIBuilder.h Sun Jun 12 18:01:31 2011 (r223017) @@ -117,8 +117,9 @@ namespace llvm { /// @param Name Typedef name. /// @param File File where this type is defined. /// @param LineNo Line number. + /// @param Context The surrounding context for the typedef. DIType createTypedef(DIType Ty, StringRef Name, DIFile File, - unsigned LineNo); + unsigned LineNo, DIDescriptor Context); /// createFriend - Create debugging information entry for a 'friend'. DIType createFriend(DIType Ty, DIType FriendTy); Modified: head/contrib/llvm/include/llvm/Analysis/DebugInfo.h ============================================================================== --- head/contrib/llvm/include/llvm/Analysis/DebugInfo.h Sun Jun 12 15:46:57 2011 (r223016) +++ head/contrib/llvm/include/llvm/Analysis/DebugInfo.h Sun Jun 12 18:01:31 2011 (r223017) @@ -49,15 +49,16 @@ namespace llvm { class DIDescriptor { public: enum { - FlagPrivate = 1 << 0, - FlagProtected = 1 << 1, - FlagFwdDecl = 1 << 2, - FlagAppleBlock = 1 << 3, - FlagBlockByrefStruct = 1 << 4, - FlagVirtual = 1 << 5, - FlagArtificial = 1 << 6, - FlagExplicit = 1 << 7, - FlagPrototyped = 1 << 8 + FlagPrivate = 1 << 0, + FlagProtected = 1 << 1, + FlagFwdDecl = 1 << 2, + FlagAppleBlock = 1 << 3, + FlagBlockByrefStruct = 1 << 4, + FlagVirtual = 1 << 5, + FlagArtificial = 1 << 6, + FlagExplicit = 1 << 7, + FlagPrototyped = 1 << 8, + FlagObjcClassComplete = 1 << 9 }; protected: const MDNode *DbgNode; @@ -271,6 +272,9 @@ namespace llvm { bool isArtificial() const { return (getFlags() & FlagArtificial) != 0; } + bool isObjcClassComplete() const { + return (getFlags() & FlagObjcClassComplete) != 0; + } bool isValid() const { return DbgNode && (isBasicType() || isDerivedType() || isCompositeType()); } Modified: head/contrib/llvm/include/llvm/Analysis/FindUsedTypes.h ============================================================================== --- head/contrib/llvm/include/llvm/Analysis/FindUsedTypes.h Sun Jun 12 15:46:57 2011 (r223016) +++ head/contrib/llvm/include/llvm/Analysis/FindUsedTypes.h Sun Jun 12 18:01:31 2011 (r223017) @@ -14,8 +14,8 @@ #ifndef LLVM_ANALYSIS_FINDUSEDTYPES_H #define LLVM_ANALYSIS_FINDUSEDTYPES_H +#include "llvm/ADT/SetVector.h" #include "llvm/Pass.h" -#include namespace llvm { @@ -23,7 +23,7 @@ class Type; class Value; class FindUsedTypes : public ModulePass { - std::set UsedTypes; + SetVector UsedTypes; public: static char ID; // Pass identification, replacement for typeid FindUsedTypes() : ModulePass(ID) { @@ -33,7 +33,7 @@ public: /// getTypes - After the pass has been run, return the set containing all of /// the types used in the module. /// - const std::set &getTypes() const { return UsedTypes; } + const SetVector &getTypes() const { return UsedTypes; } /// Print the types found in the module. If the optional Module parameter is /// passed in, then the types are printed symbolically if possible, using the Modified: head/contrib/llvm/include/llvm/Analysis/IVUsers.h ============================================================================== --- head/contrib/llvm/include/llvm/Analysis/IVUsers.h Sun Jun 12 15:46:57 2011 (r223016) +++ head/contrib/llvm/include/llvm/Analysis/IVUsers.h Sun Jun 12 18:01:31 2011 (r223017) @@ -37,8 +37,8 @@ class TargetData; class IVStrideUse : public CallbackVH, public ilist_node { friend class IVUsers; public: - IVStrideUse(IVUsers *P, Instruction* U, Value *O) - : CallbackVH(U), Parent(P), OperandValToReplace(O) { + IVStrideUse(IVUsers *P, Instruction* U, Value *O, Value *PN) + : CallbackVH(U), Parent(P), OperandValToReplace(O), Phi(PN) { } /// getUser - Return the user instruction for this use. @@ -51,6 +51,11 @@ public: setValPtr(NewUser); } + /// getPhi - Return the phi node that represents this IV. + PHINode *getPhi() const { + return cast(Phi); + } + /// getOperandValToReplace - Return the Value of the operand in the user /// instruction that this IVStrideUse is representing. Value *getOperandValToReplace() const { @@ -81,6 +86,9 @@ private: /// that this IVStrideUse is representing. WeakVH OperandValToReplace; + /// Phi - The loop header phi that represents this IV. + WeakVH Phi; + /// PostIncLoops - The set of loops for which Expr has been adjusted to /// use post-inc mode. This corresponds with SCEVExpander's post-inc concept. PostIncLoopSet PostIncLoops; @@ -143,9 +151,9 @@ public: /// AddUsersIfInteresting - Inspect the specified Instruction. If it is a /// reducible SCEV, recursively add its users to the IVUsesByStride set and /// return true. Otherwise, return false. - bool AddUsersIfInteresting(Instruction *I); + bool AddUsersIfInteresting(Instruction *I, PHINode *Phi); - IVStrideUse &AddUser(Instruction *User, Value *Operand); + IVStrideUse &AddUser(Instruction *User, Value *Operand, PHINode *Phi); /// getReplacementExpr - Return a SCEV expression which computes the /// value of the OperandValToReplace of the given IVStrideUse. Modified: head/contrib/llvm/include/llvm/Analysis/RegionPass.h ============================================================================== --- head/contrib/llvm/include/llvm/Analysis/RegionPass.h Sun Jun 12 15:46:57 2011 (r223016) +++ head/contrib/llvm/include/llvm/Analysis/RegionPass.h Sun Jun 12 18:01:31 2011 (r223017) @@ -109,7 +109,7 @@ public: /// @brief Print passes managed by this manager. void dumpPassStructure(unsigned Offset); - /// @brief Print passes contained by this manager. + /// @brief Get passes contained by this manager. Pass *getContainedPass(unsigned N) { assert(N < PassVector.size() && "Pass number out of range!"); Pass *FP = static_cast(PassVector[N]); Modified: head/contrib/llvm/include/llvm/Analysis/ScalarEvolution.h ============================================================================== --- head/contrib/llvm/include/llvm/Analysis/ScalarEvolution.h Sun Jun 12 15:46:57 2011 (r223016) +++ head/contrib/llvm/include/llvm/Analysis/ScalarEvolution.h Sun Jun 12 18:01:31 2011 (r223017) @@ -270,30 +270,30 @@ namespace llvm { /// BackedgeTakenCounts - Cache the backedge-taken count of the loops for /// this function as they are computed. - std::map BackedgeTakenCounts; + DenseMap BackedgeTakenCounts; /// ConstantEvolutionLoopExitValue - This map contains entries for all of /// the PHI instructions that we attempt to compute constant evolutions for. /// This allows us to avoid potentially expensive recomputation of these /// properties. An instruction maps to null if we are unable to compute its /// exit value. - std::map ConstantEvolutionLoopExitValue; + DenseMap ConstantEvolutionLoopExitValue; /// ValuesAtScopes - This map contains entries for all the expressions /// that we attempt to compute getSCEVAtScope information for, which can /// be expensive in extreme cases. - std::map > ValuesAtScopes; /// LoopDispositions - Memoized computeLoopDisposition results. - std::map > LoopDispositions; /// computeLoopDisposition - Compute a LoopDisposition value. LoopDisposition computeLoopDisposition(const SCEV *S, const Loop *L); /// BlockDispositions - Memoized computeBlockDisposition results. - std::map > BlockDispositions; /// computeBlockDisposition - Compute a BlockDisposition value. Modified: head/contrib/llvm/include/llvm/Argument.h ============================================================================== --- head/contrib/llvm/include/llvm/Argument.h Sun Jun 12 15:46:57 2011 (r223016) +++ head/contrib/llvm/include/llvm/Argument.h Sun Jun 12 18:01:31 2011 (r223017) @@ -51,6 +51,9 @@ public: /// hasByValAttr - Return true if this argument has the byval attribute on it /// in its containing function. bool hasByValAttr() const; + + /// getParamAlignment - If this is a byval argument, return its alignment. + unsigned getParamAlignment() const; /// hasNestAttr - Return true if this argument has the nest attribute on /// it in its containing function. Modified: head/contrib/llvm/include/llvm/Attributes.h ============================================================================== --- head/contrib/llvm/include/llvm/Attributes.h Sun Jun 12 15:46:57 2011 (r223016) +++ head/contrib/llvm/include/llvm/Attributes.h Sun Jun 12 18:01:31 2011 (r223017) @@ -67,6 +67,20 @@ const Attributes StackAlignment = 7<<26 ///alignstack(1)) const Attributes Hotpatch = 1<<29; ///< Function should have special ///'hotpatch' sequence in prologue +const Attributes UWTable = 1<<30; ///< Function must be in a unwind + ///table + +/// Note that uwtable is about the ABI or the user mandating an entry in the +/// unwind table. The nounwind attribute is about an exception passing by the +/// function. +/// In a theoretical system that uses tables for profiling and sjlj for +/// exceptions, they would be fully independent. In a normal system that +/// uses tables for both, the semantics are: +/// nil = Needs an entry because an exception might pass by. +/// nounwind = No need for an entry +/// uwtable = Needs an entry because the ABI says so and because +/// an exception might pass by. +/// uwtable + nounwind = Needs an entry because the ABI says so. /// @brief Attributes that only apply to function parameters. const Attributes ParameterOnly = ByVal | Nest | StructRet | NoCapture; @@ -76,7 +90,7 @@ const Attributes ParameterOnly = ByVal | const Attributes FunctionOnly = NoReturn | NoUnwind | ReadNone | ReadOnly | NoInline | AlwaysInline | OptimizeForSize | StackProtect | StackProtectReq | NoRedZone | NoImplicitFloat | Naked | InlineHint | StackAlignment | - Hotpatch; + Hotpatch | UWTable; /// @brief Parameter attributes that do not apply to vararg call arguments. const Attributes VarArgsIncompatible = StructRet; Modified: head/contrib/llvm/include/llvm/CodeGen/AsmPrinter.h ============================================================================== --- head/contrib/llvm/include/llvm/CodeGen/AsmPrinter.h Sun Jun 12 15:46:57 2011 (r223016) +++ head/contrib/llvm/include/llvm/CodeGen/AsmPrinter.h Sun Jun 12 18:01:31 2011 (r223017) @@ -185,7 +185,14 @@ namespace llvm { void emitPrologLabel(const MachineInstr &MI); - bool needsCFIMoves(); + enum CFIMoveType { + CFI_M_None, + CFI_M_EH, + CFI_M_Debug + }; + CFIMoveType needsCFIMoves(); + + bool needsSEHMoves(); /// EmitConstantPool - Print to the current output stream assembly /// representations of the constants in the constant pool MCP. This is @@ -381,10 +388,6 @@ namespace llvm { /// operands. virtual MachineLocation getDebugValueLocation(const MachineInstr *MI) const; - /// getDwarfRegOpSize - get size required to emit given machine location - /// using dwarf encoding. - virtual unsigned getDwarfRegOpSize(const MachineLocation &MLoc) const; - /// getISAEncoding - Get the value for DW_AT_APPLE_isa. Zero if no isa /// encoding specified. virtual unsigned getISAEncoding() { return 0; } @@ -396,12 +399,9 @@ namespace llvm { // Dwarf Lowering Routines //===------------------------------------------------------------------===// - /// EmitFrameMoves - Emit frame instructions to describe the layout of the + /// EmitCFIFrameMove - Emit frame instruction to describe the layout of the /// frame. - void EmitFrameMoves(const std::vector &Moves, - MCSymbol *BaseLabel, bool isEH) const; void EmitCFIFrameMove(const MachineMove &Move) const; - void EmitCFIFrameMoves(const std::vector &Moves) const; //===------------------------------------------------------------------===// // Inline Asm Support Modified: head/contrib/llvm/include/llvm/CodeGen/CallingConvLower.h ============================================================================== --- head/contrib/llvm/include/llvm/CodeGen/CallingConvLower.h Sun Jun 12 15:46:57 2011 (r223016) +++ head/contrib/llvm/include/llvm/CodeGen/CallingConvLower.h Sun Jun 12 18:01:31 2011 (r223017) @@ -16,6 +16,7 @@ #define LLVM_CODEGEN_CALLINGCONVLOWER_H #include "llvm/ADT/SmallVector.h" +#include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/ValueTypes.h" #include "llvm/Target/TargetCallingConv.h" #include "llvm/CallingConv.h" @@ -141,14 +142,19 @@ typedef bool CCCustomFn(unsigned &ValNo, MVT &LocVT, CCValAssign::LocInfo &LocInfo, ISD::ArgFlagsTy &ArgFlags, CCState &State); -typedef enum { Invalid, Prologue, Call } ParmContext; +/// ParmContext - This enum tracks whether calling convention lowering is in +/// the context of prologue or call generation. Not all backends make use of +/// this information. +typedef enum { Unknown, Prologue, Call } ParmContext; /// CCState - This class holds information needed while lowering arguments and /// return values. It captures which registers are already assigned and which /// stack slots are used. It provides accessors to allocate these values. class CCState { +private: CallingConv::ID CallingConv; bool IsVarArg; + MachineFunction &MF; const TargetMachine &TM; const TargetRegisterInfo &TRI; SmallVector &Locs; @@ -158,10 +164,14 @@ class CCState { SmallVector UsedRegs; unsigned FirstByValReg; bool FirstByValRegValid; + +protected: ParmContext CallOrPrologue; + public: - CCState(CallingConv::ID CC, bool isVarArg, const TargetMachine &TM, - SmallVector &locs, LLVMContext &C); + CCState(CallingConv::ID CC, bool isVarArg, MachineFunction &MF, + const TargetMachine &TM, SmallVector &locs, + LLVMContext &C); void addLoc(const CCValAssign &V) { Locs.push_back(V); @@ -169,6 +179,7 @@ public: LLVMContext &getContext() const { return Context; } const TargetMachine &getTarget() const { return TM; } + MachineFunction &getMachineFunction() const { return MF; } CallingConv::ID getCallingConv() const { return CallingConv; } bool isVarArg() const { return IsVarArg; } @@ -301,7 +312,6 @@ public: bool isFirstByValRegValid() { return FirstByValRegValid; } ParmContext getCallOrPrologue() { return CallOrPrologue; } - void setCallOrPrologue(ParmContext pc) { CallOrPrologue = pc; } private: /// MarkAllocated - Mark a register and all of its aliases as allocated. Modified: head/contrib/llvm/include/llvm/CodeGen/FastISel.h ============================================================================== --- head/contrib/llvm/include/llvm/CodeGen/FastISel.h Sun Jun 12 15:46:57 2011 (r223016) +++ head/contrib/llvm/include/llvm/CodeGen/FastISel.h Sun Jun 12 18:01:31 2011 (r223017) @@ -241,6 +241,15 @@ protected: unsigned Op0, bool Op0IsKill, unsigned Op1, bool Op1IsKill); + /// FastEmitInst_rrr - Emit a MachineInstr with three register operands + /// and a result register in the given register class. + /// + unsigned FastEmitInst_rrr(unsigned MachineInstOpcode, + const TargetRegisterClass *RC, + unsigned Op0, bool Op0IsKill, + unsigned Op1, bool Op1IsKill, + unsigned Op2, bool Op2IsKill); + /// FastEmitInst_ri - Emit a MachineInstr with a register operand, /// an immediate, and a result register in the given register class. /// @@ -301,7 +310,7 @@ protected: /// the CFG. void FastEmitBranch(MachineBasicBlock *MBB, DebugLoc DL); - unsigned UpdateValueMap(const Value* I, unsigned Reg); + void UpdateValueMap(const Value* I, unsigned Reg, unsigned NumRegs = 1); unsigned createResultReg(const TargetRegisterClass *RC); @@ -334,6 +343,8 @@ private: bool SelectCast(const User *I, unsigned Opcode); + bool SelectExtractValue(const User *I); + /// HandlePHINodesInSuccessorBlocks - Handle PHI nodes in successor blocks. /// Emit code to ensure constants are copied into registers when needed. /// Remember the virtual registers that need to be added to the Machine PHI Modified: head/contrib/llvm/include/llvm/CodeGen/ISDOpcodes.h ============================================================================== --- head/contrib/llvm/include/llvm/CodeGen/ISDOpcodes.h Sun Jun 12 15:46:57 2011 (r223016) +++ head/contrib/llvm/include/llvm/CodeGen/ISDOpcodes.h Sun Jun 12 18:01:31 2011 (r223017) @@ -107,11 +107,11 @@ namespace ISD { // and returns an outchain. EH_SJLJ_LONGJMP, - // OUTCHAIN = EH_SJLJ_DISPATCHSETUP(INCHAIN, context) + // OUTCHAIN = EH_SJLJ_DISPATCHSETUP(INCHAIN, setjmpval) // This corresponds to the eh.sjlj.dispatchsetup intrinsic. It takes an - // input chain and a pointer to the sjlj function context as inputs and - // returns an outchain. By default, this does nothing. Targets can lower - // this to unwind setup code if needed. + // input chain and the value returning from setjmp as inputs and returns an + // outchain. By default, this does nothing. Targets can lower this to unwind + // setup code if needed. EH_SJLJ_DISPATCHSETUP, // TargetConstant* - Like Constant*, but the DAG does not do any folding, Modified: head/contrib/llvm/include/llvm/CodeGen/LiveInterval.h ============================================================================== --- head/contrib/llvm/include/llvm/CodeGen/LiveInterval.h Sun Jun 12 15:46:57 2011 (r223016) +++ head/contrib/llvm/include/llvm/CodeGen/LiveInterval.h Sun Jun 12 18:01:31 2011 (r223017) @@ -492,9 +492,10 @@ namespace llvm { /// Returns true if the live interval is zero length, i.e. no live ranges /// span instructions. It doesn't pay to spill such an interval. - bool isZeroLength() const { + bool isZeroLength(SlotIndexes *Indexes) const { for (const_iterator i = begin(), e = end(); i != e; ++i) - if (i->end.getPrevIndex() > i->start) + if (Indexes->getNextNonNullIndex(i->start).getBaseIndex() < + i->end.getBaseIndex()) return false; return true; } Modified: head/contrib/llvm/include/llvm/CodeGen/MachineInstr.h ============================================================================== --- head/contrib/llvm/include/llvm/CodeGen/MachineInstr.h Sun Jun 12 15:46:57 2011 (r223016) +++ head/contrib/llvm/include/llvm/CodeGen/MachineInstr.h Sun Jun 12 18:01:31 2011 (r223017) @@ -229,6 +229,7 @@ public: enum MICheckType { CheckDefs, // Check all operands for equality + CheckKillDead, // Check all operands including kill / dead markers IgnoreDefs, // Ignore all definitions IgnoreVRegDefs // Ignore virtual register definitions }; Modified: head/contrib/llvm/include/llvm/CodeGen/MachineInstrBuilder.h ============================================================================== --- head/contrib/llvm/include/llvm/CodeGen/MachineInstrBuilder.h Sun Jun 12 15:46:57 2011 (r223016) +++ head/contrib/llvm/include/llvm/CodeGen/MachineInstrBuilder.h Sun Jun 12 18:01:31 2011 (r223017) @@ -88,7 +88,7 @@ public: return *this; } - const MachineInstrBuilder &addFrameIndex(unsigned Idx) const { + const MachineInstrBuilder &addFrameIndex(int Idx) const { MI->addOperand(MachineOperand::CreateFI(Idx)); return *this; } Modified: head/contrib/llvm/include/llvm/CodeGen/MachineModuleInfo.h ============================================================================== --- head/contrib/llvm/include/llvm/CodeGen/MachineModuleInfo.h Sun Jun 12 15:46:57 2011 (r223016) +++ head/contrib/llvm/include/llvm/CodeGen/MachineModuleInfo.h Sun Jun 12 18:01:31 2011 (r223017) @@ -52,27 +52,13 @@ namespace llvm { class Constant; class GlobalVariable; class MDNode; +class MMIAddrLabelMap; class MachineBasicBlock; class MachineFunction; class Module; class PointerType; class StructType; -/// MachineModuleInfoImpl - This class can be derived from and used by targets -/// to hold private target-specific information for each Module. Objects of -/// type are accessed/created with MMI::getInfo and destroyed when the -/// MachineModuleInfo is destroyed. -class MachineModuleInfoImpl { -public: - typedef PointerIntPair StubValueTy; - virtual ~MachineModuleInfoImpl(); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sun Jun 12 18:46:48 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CC042106566B; Sun, 12 Jun 2011 18:46:48 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BC8B18FC14; Sun, 12 Jun 2011 18:46:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5CIkmO1036754; Sun, 12 Jun 2011 18:46:48 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5CIkmBP036751; Sun, 12 Jun 2011 18:46:48 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201106121846.p5CIkmBP036751@svn.freebsd.org> From: Kirk McKusick Date: Sun, 12 Jun 2011 18:46:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223018 - head/sys/ufs/ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Jun 2011 18:46:48 -0000 Author: mckusick Date: Sun Jun 12 18:46:48 2011 New Revision: 223018 URL: http://svn.freebsd.org/changeset/base/223018 Log: Disable the soft updates journaling after a filesystem is successfully downgraded to read-only. It will be restarted if the filesystem is upgraded back to read-write. Modified: head/sys/ufs/ffs/ffs_softdep.c head/sys/ufs/ffs/ffs_vfsops.c Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Sun Jun 12 18:01:31 2011 (r223017) +++ head/sys/ufs/ffs/ffs_softdep.c Sun Jun 12 18:46:48 2011 (r223018) @@ -2386,8 +2386,15 @@ softdep_unmount(mp) struct mount *mp; { - if (mp->mnt_kern_flag & MNTK_SUJ) - journal_unmount(mp); + MNT_ILOCK(mp); + mp->mnt_flag &= ~MNT_SOFTDEP; + if ((mp->mnt_kern_flag & MNTK_SUJ) == 0) { + MNT_IUNLOCK(mp); + return; + } + mp->mnt_kern_flag &= ~MNTK_SUJ; + MNT_IUNLOCK(mp); + journal_unmount(mp); } struct jblocks { Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Sun Jun 12 18:01:31 2011 (r223017) +++ head/sys/ufs/ffs/ffs_vfsops.c Sun Jun 12 18:46:48 2011 (r223018) @@ -269,6 +269,8 @@ ffs_mount(struct mount *mp) vfs_write_resume(mp); return (error); } + if (mp->mnt_flag & MNT_SOFTDEP) + softdep_unmount(mp); DROP_GIANT(); g_topology_lock(); g_access(ump->um_cp, 0, -1, 0); From owner-svn-src-head@FreeBSD.ORG Sun Jun 12 18:52:40 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 47958106566B; Sun, 12 Jun 2011 18:52:40 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1F3018FC21; Sun, 12 Jun 2011 18:52:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5CIqeav036967; Sun, 12 Jun 2011 18:52:40 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5CIqdJR036964; Sun, 12 Jun 2011 18:52:40 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201106121852.p5CIqdJR036964@svn.freebsd.org> From: Alexander Motin Date: Sun, 12 Jun 2011 18:52:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223019 - head/sys/cam/ata X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Jun 2011 18:52:40 -0000 Author: mav Date: Sun Jun 12 18:52:39 2011 New Revision: 223019 URL: http://svn.freebsd.org/changeset/base/223019 Log: Do not report CFA devices as ATAPI, even though IDENTIFY data look alike. Modified: head/sys/cam/ata/ata_all.c head/sys/cam/ata/ata_xpt.c Modified: head/sys/cam/ata/ata_all.c ============================================================================== --- head/sys/cam/ata/ata_all.c Sun Jun 12 18:46:48 2011 (r223018) +++ head/sys/cam/ata/ata_all.c Sun Jun 12 18:52:39 2011 (r223019) @@ -270,6 +270,7 @@ ata_print_ident(struct ata_params *ident sizeof(revision)); printf("<%s %s> %s-%d", product, revision, + (ident_data->config == ATA_PROTO_CFA) ? "CFA" : (ident_data->config & ATA_PROTO_ATAPI) ? "ATAPI" : "ATA", ata_version(ident_data->version_major)); if (ident_data->satacapabilities && ident_data->satacapabilities != 0xffff) { Modified: head/sys/cam/ata/ata_xpt.c ============================================================================== --- head/sys/cam/ata/ata_xpt.c Sun Jun 12 18:46:48 2011 (r223018) +++ head/sys/cam/ata/ata_xpt.c Sun Jun 12 18:52:39 2011 (r223019) @@ -1583,12 +1583,14 @@ ata_device_transport(struct cam_path *pa cts.proto_specific.valid = 0; if (ident_buf) { if (path->device->transport == XPORT_ATA) { - cts.xport_specific.ata.atapi = + cts.xport_specific.ata.atapi = + (ident_buf->config == ATA_PROTO_CFA) ? 0 : ((ident_buf->config & ATA_PROTO_MASK) == ATA_PROTO_ATAPI_16) ? 16 : ((ident_buf->config & ATA_PROTO_MASK) == ATA_PROTO_ATAPI_12) ? 12 : 0; cts.xport_specific.ata.valid = CTS_ATA_VALID_ATAPI; } else { - cts.xport_specific.sata.atapi = + cts.xport_specific.sata.atapi = + (ident_buf->config == ATA_PROTO_CFA) ? 0 : ((ident_buf->config & ATA_PROTO_MASK) == ATA_PROTO_ATAPI_16) ? 16 : ((ident_buf->config & ATA_PROTO_MASK) == ATA_PROTO_ATAPI_12) ? 12 : 0; cts.xport_specific.sata.valid = CTS_SATA_VALID_ATAPI; @@ -1638,7 +1640,9 @@ ata_action(union ccb *start_ccb) uint16_t p = device->ident_data.config & ATA_PROTO_MASK; - maxlen = (p == ATA_PROTO_ATAPI_16) ? 16 : + maxlen = + (device->ident_data.config == ATA_PROTO_CFA) ? 0 : + (p == ATA_PROTO_ATAPI_16) ? 16 : (p == ATA_PROTO_ATAPI_12) ? 12 : 0; } if (start_ccb->csio.cdb_len > maxlen) { From owner-svn-src-head@FreeBSD.ORG Sun Jun 12 19:09:38 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 4E8641065672; Sun, 12 Jun 2011 19:09:38 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from [127.0.0.1] (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id C81FD163465; Sun, 12 Jun 2011 19:09:34 +0000 (UTC) Message-ID: <4DF50EEF.8010708@FreeBSD.org> Date: Sun, 12 Jun 2011 12:09:35 -0700 From: Doug Barton Organization: http://www.FreeBSD.org/ User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 MIME-Version: 1.0 To: Alexey Dokuchaev References: <201106110908.p5B98kkE066709@svn.freebsd.org> <4DF3B12C.8020505@FreeBSD.org> <9583277B-6EC0-4B7F-9640-2B128A96C6B8@bsdimp.com> <4DF3D633.5060506@FreeBSD.org> <20110612111601.GA62801@FreeBSD.org> In-Reply-To: <20110612111601.GA62801@FreeBSD.org> X-Enigmail-Version: 1.1.1 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, Robert Watson , Joel Dahl , svn-src-head@FreeBSD.org, Warner Losh Subject: Re: svn commit: r222980 - in head/sys: amd64/conf i386/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Jun 2011 19:09:38 -0000 On 6/12/2011 4:16 AM, Alexey Dokuchaev wrote: > On Sat, Jun 11, 2011 at 01:55:15PM -0700, Doug Barton wrote: >> I have 3 or 4 modules loaded via loader.conf at boot time. They take at >> least 2 seconds each. IMO loading everything via loader.conf would slow >> the boot so much as to be a non-starter. > > With my normal slim kernel with most of the modules loaded via loader.conf > (other few loaded later in runtime) I have this: > > $ kldstat | wc -l > 60 > > I do not observe noticeable difference compared to GENERIC kernel. Try the script I posted to -current and see how it goes for you. > Plus, users try to reboot their machines as rarely as possible, no? A) Arguing from anecdote B) I realize desktop is not a priority for us, but desktop users generally reboot much more frequently (usually daily for me). C) For those times that you do need to reboot a system, why add minutes to the boot without reason? I mentioned the problem, and proposed a solution for it ... I'm asking people to test the solution I proposed. Doug -- Nothin' ever doesn't change, but nothin' changes much. -- OK Go Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ From owner-svn-src-head@FreeBSD.ORG Sun Jun 12 19:27:06 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 007E0106564A; Sun, 12 Jun 2011 19:27:06 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E42C58FC1A; Sun, 12 Jun 2011 19:27:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5CJR5rf038043; Sun, 12 Jun 2011 19:27:05 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5CJR5Wi038037; Sun, 12 Jun 2011 19:27:05 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201106121927.p5CJR5Wi038037@svn.freebsd.org> From: Kirk McKusick Date: Sun, 12 Jun 2011 19:27:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223020 - in head/sys/ufs: ffs ufs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Jun 2011 19:27:06 -0000 Author: mckusick Date: Sun Jun 12 19:27:05 2011 New Revision: 223020 URL: http://svn.freebsd.org/changeset/base/223020 Log: Update to soft updates journaling to properly track freed blocks that get claimed by snapshots. Submitted by: Jeff Roberson Tested by: Peter Holm Modified: head/sys/ufs/ffs/ffs_alloc.c head/sys/ufs/ffs/ffs_extern.h head/sys/ufs/ffs/ffs_snapshot.c head/sys/ufs/ffs/ffs_softdep.c head/sys/ufs/ufs/ufs_vnops.c Modified: head/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_alloc.c Sun Jun 12 18:52:39 2011 (r223019) +++ head/sys/ufs/ffs/ffs_alloc.c Sun Jun 12 19:27:05 2011 (r223020) @@ -2035,7 +2035,7 @@ ffs_blkfree(ump, fs, devvp, bno, size, i */ if (devvp->v_type != VREG && (devvp->v_vflag & VV_COPYONWRITE) && - ffs_snapblkfree(fs, devvp, bno, size, inum)) { + ffs_snapblkfree(fs, devvp, bno, size, inum, dephd)) { return; } if (!ump->um_candelete) { Modified: head/sys/ufs/ffs/ffs_extern.h ============================================================================== --- head/sys/ufs/ffs/ffs_extern.h Sun Jun 12 18:52:39 2011 (r223019) +++ head/sys/ufs/ffs/ffs_extern.h Sun Jun 12 19:27:05 2011 (r223020) @@ -80,12 +80,14 @@ int ffs_realloccg(struct inode *, ufs2_d ufs2_daddr_t, int, int, int, struct ucred *, struct buf **); int ffs_sbupdate(struct ufsmount *, int, int); void ffs_setblock(struct fs *, u_char *, ufs1_daddr_t); -int ffs_snapblkfree(struct fs *, struct vnode *, ufs2_daddr_t, long, ino_t); +int ffs_snapblkfree(struct fs *, struct vnode *, ufs2_daddr_t, long, ino_t, + struct workhead *); void ffs_snapremove(struct vnode *vp); int ffs_snapshot(struct mount *mp, char *snapfile); void ffs_snapshot_mount(struct mount *mp); void ffs_snapshot_unmount(struct mount *mp); void process_deferred_inactive(struct mount *mp); +void ffs_sync_snap(struct mount *, int); int ffs_syncvnode(struct vnode *vp, int waitfor); int ffs_truncate(struct vnode *, off_t, int, struct ucred *, struct thread *); int ffs_update(struct vnode *, int); @@ -149,6 +151,9 @@ int softdep_prealloc(struct vnode *, int int softdep_journal_lookup(struct mount *, struct vnode **); void softdep_journal_freeblocks(struct inode *, struct ucred *, off_t, int); void softdep_journal_fsync(struct inode *); +void softdep_buf_append(struct buf *, struct workhead *); +void softdep_inode_append(struct inode *, struct ucred *, struct workhead *); +void softdep_freework(struct workhead *); /* @@ -161,4 +166,14 @@ void softdep_journal_fsync(struct inode int ffs_rdonly(struct inode *); +TAILQ_HEAD(snaphead, inode); + +struct snapdata { + LIST_ENTRY(snapdata) sn_link; + struct snaphead sn_head; + daddr_t sn_listsize; + daddr_t *sn_blklist; + struct lock sn_lock; +}; + #endif /* !_UFS_FFS_EXTERN_H */ Modified: head/sys/ufs/ffs/ffs_snapshot.c ============================================================================== --- head/sys/ufs/ffs/ffs_snapshot.c Sun Jun 12 18:52:39 2011 (r223019) +++ head/sys/ufs/ffs/ffs_snapshot.c Sun Jun 12 19:27:05 2011 (r223020) @@ -81,12 +81,13 @@ ffs_snapshot(mp, snapfile) } int -ffs_snapblkfree(fs, devvp, bno, size, inum) +ffs_snapblkfree(fs, devvp, bno, size, inum, wkhd) struct fs *fs; struct vnode *devvp; ufs2_daddr_t bno; long size; ino_t inum; + struct workhead *wkhd; { return (EINVAL); } @@ -123,19 +124,16 @@ ffs_copyonwrite(devvp, bp) return (EINVAL); } +void +ffs_sync_snap(mp, waitfor) + struct mount *mp; + int waitfor; +{ +} + #else FEATURE(ffs_snapshot, "FFS snapshot support"); -TAILQ_HEAD(snaphead, inode); - -struct snapdata { - LIST_ENTRY(snapdata) sn_link; - struct snaphead sn_head; - daddr_t sn_listsize; - daddr_t *sn_blklist; - struct lock sn_lock; -}; - LIST_HEAD(, snapdata) snapfree; static struct mtx snapfree_lock; MTX_SYSINIT(ffs_snapfree, &snapfree_lock, "snapdata free list", MTX_DEF); @@ -1635,7 +1633,7 @@ ffs_snapremove(vp) DIP_SET(ip, i_db[blkno], 0); else if ((dblk == blkstofrags(fs, blkno) && ffs_snapblkfree(fs, ip->i_devvp, dblk, fs->fs_bsize, - ip->i_number))) { + ip->i_number, NULL))) { DIP_SET(ip, i_blocks, DIP(ip, i_blocks) - btodb(fs->fs_bsize)); DIP_SET(ip, i_db[blkno], 0); @@ -1660,7 +1658,7 @@ ffs_snapremove(vp) ((ufs1_daddr_t *)(ibp->b_data))[loc]= 0; else if ((dblk == blkstofrags(fs, blkno) && ffs_snapblkfree(fs, ip->i_devvp, dblk, - fs->fs_bsize, ip->i_number))) { + fs->fs_bsize, ip->i_number, NULL))) { ip->i_din1->di_blocks -= btodb(fs->fs_bsize); ((ufs1_daddr_t *)(ibp->b_data))[loc]= 0; @@ -1674,7 +1672,7 @@ ffs_snapremove(vp) ((ufs2_daddr_t *)(ibp->b_data))[loc] = 0; else if ((dblk == blkstofrags(fs, blkno) && ffs_snapblkfree(fs, ip->i_devvp, dblk, - fs->fs_bsize, ip->i_number))) { + fs->fs_bsize, ip->i_number, NULL))) { ip->i_din2->di_blocks -= btodb(fs->fs_bsize); ((ufs2_daddr_t *)(ibp->b_data))[loc] = 0; } @@ -1722,12 +1720,13 @@ ffs_snapremove(vp) * must always have been allocated from a BLK_NOCOPY location. */ int -ffs_snapblkfree(fs, devvp, bno, size, inum) +ffs_snapblkfree(fs, devvp, bno, size, inum, wkhd) struct fs *fs; struct vnode *devvp; ufs2_daddr_t bno; long size; ino_t inum; + struct workhead *wkhd; { struct buf *ibp, *cbp, *savedcbp = 0; struct thread *td = curthread; @@ -1825,6 +1824,17 @@ retry: "Grabonremove: snapino", ip->i_number, (intmax_t)lbn, inum); #endif + /* + * If journaling is tracking this write we must add + * the work to the inode or indirect being written. + */ + if (wkhd != NULL) { + if (lbn < NDADDR) + softdep_inode_append(ip, + curthread->td_ucred, wkhd); + else + softdep_buf_append(ibp, wkhd); + } if (lbn < NDADDR) { DIP_SET(ip, i_db[lbn], bno); } else if (ip->i_ump->um_fstype == UFS1) { @@ -1902,6 +1912,8 @@ retry: * not be freed. Although space will be lost, the snapshot * will stay consistent. */ + if (error != 0 && wkhd != NULL) + softdep_freework(wkhd); lockmgr(vp->v_vnlock, LK_RELEASE, NULL); return (error); } @@ -2400,6 +2412,42 @@ ffs_copyonwrite(devvp, bp) } /* + * sync snapshots to force freework records waiting on snapshots to claim + * blocks to free. + */ +void +ffs_sync_snap(mp, waitfor) + struct mount *mp; + int waitfor; +{ + struct snapdata *sn; + struct vnode *devvp; + struct vnode *vp; + struct inode *ip; + + devvp = VFSTOUFS(mp)->um_devvp; + if ((devvp->v_vflag & VV_COPYONWRITE) == 0) + return; + for (;;) { + VI_LOCK(devvp); + sn = devvp->v_rdev->si_snapdata; + if (sn == NULL) { + VI_UNLOCK(devvp); + return; + } + if (lockmgr(&sn->sn_lock, + LK_INTERLOCK | LK_EXCLUSIVE | LK_SLEEPFAIL, + VI_MTX(devvp)) == 0) + break; + } + TAILQ_FOREACH(ip, &sn->sn_head, i_nextsnap) { + vp = ITOV(ip); + ffs_syncvnode(vp, waitfor); + } + lockmgr(&sn->sn_lock, LK_RELEASE, NULL); +} + +/* * Read the specified block into the given buffer. * Much of this boiler-plate comes from bwrite(). */ Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Sun Jun 12 18:52:39 2011 (r223019) +++ head/sys/ufs/ffs/ffs_softdep.c Sun Jun 12 19:27:05 2011 (r223020) @@ -584,6 +584,33 @@ softdep_get_depcounts(struct mount *mp, *softdepactiveaccp = 0; } +void +softdep_buf_append(bp, wkhd) + struct buf *bp; + struct workhead *wkhd; +{ + + panic("softdep_buf_appendwork called"); +} + +void +softdep_inode_append(ip, cred, wkhd) + struct inode *ip; + struct ucred *cred; + struct workhead *wkhd; +{ + + panic("softdep_inode_appendwork called"); +} + +void +softdep_freework(wkhd) + struct workhead *wkhd; +{ + + panic("softdep_freework called"); +} + #else FEATURE(softupdates, "FFS soft-updates support"); @@ -867,7 +894,7 @@ static void freework_enqueue(struct free static int handle_workitem_freeblocks(struct freeblks *, int); static int handle_complete_freeblocks(struct freeblks *, int); static void handle_workitem_indirblk(struct freework *); -static void handle_written_freework(struct freework *, int); +static void handle_written_freework(struct freework *); static void merge_inode_lists(struct allocdirectlst *,struct allocdirectlst *); static struct worklist *jnewblk_merge(struct worklist *, struct worklist *, struct workhead *); @@ -1632,6 +1659,7 @@ process_truncates(vp) if (cgwait) { FREE_LOCK(&lk); sync_cgs(mp, MNT_WAIT); + ffs_sync_snap(mp, MNT_WAIT); ACQUIRE_LOCK(&lk); continue; } @@ -5922,7 +5950,7 @@ complete_trunc_indir(freework) */ if (bp == NULL) { if (LIST_EMPTY(&indirdep->ir_freeblks->fb_jblkdephd)) - handle_written_freework(freework, 0); + handle_written_freework(freework); else WORKLIST_INSERT(&indirdep->ir_freeblks->fb_freeworkhd, &freework->fw_list); @@ -5974,7 +6002,7 @@ out: */ if (totblks > datablocks) return (0); - return (totblks - datablocks); + return (datablocks - totblks); } /* @@ -7228,6 +7256,7 @@ freework_freeblock(freework) cancel_jnewblk(jnewblk, &wkhd); needj = 0; } else if (needj) { + freework->fw_state |= DELAYEDFREE; freeblks->fb_cgwait++; WORKLIST_INSERT(&wkhd, &freework->fw_list); } @@ -7241,7 +7270,7 @@ freework_freeblock(freework) * made it to disk. We can immediately free the freeblk. */ if (needj == 0) - handle_written_freework(freework, 0); + handle_written_freework(freework); } /* @@ -7256,7 +7285,8 @@ freework_enqueue(freework) struct freeblks *freeblks; freeblks = freework->fw_freeblks; - WORKLIST_INSERT(&freeblks->fb_freeworkhd, &freework->fw_list); + if ((freework->fw_state & INPROGRESS) == 0) + WORKLIST_INSERT(&freeblks->fb_freeworkhd, &freework->fw_list); if ((freeblks->fb_state & (ONWORKLIST | INPROGRESS | ALLCOMPLETE)) == ALLCOMPLETE && LIST_EMPTY(&freeblks->fb_jblkdephd)) @@ -7282,13 +7312,14 @@ handle_workitem_indirblk(freework) ump = VFSTOUFS(freeblks->fb_list.wk_mp); fs = ump->um_fs; if (freework->fw_state & DEPCOMPLETE) { - handle_written_freework(freework, 0); + handle_written_freework(freework); return; } if (freework->fw_off == NINDIR(fs)) { freework_freeblock(freework); return; } + freework->fw_state |= INPROGRESS; FREE_LOCK(&lk); indir_trunc(freework, fsbtodb(fs, freework->fw_blkno), freework->fw_lbn); @@ -7301,16 +7332,16 @@ handle_workitem_indirblk(freework) * the freeblks is added back to the worklist if there is more work to do. */ static void -handle_written_freework(freework, cgwrite) +handle_written_freework(freework) struct freework *freework; - int cgwrite; { struct freeblks *freeblks; struct freework *parent; freeblks = freework->fw_freeblks; parent = freework->fw_parent; - freeblks->fb_cgwait -= cgwrite; + if (freework->fw_state & DELAYEDFREE) + freeblks->fb_cgwait--; freework->fw_state |= COMPLETE; if ((freework->fw_state & ALLCOMPLETE) == ALLCOMPLETE) WORKITEM_FREE(freework, D_FREEWORK); @@ -7552,6 +7583,8 @@ indir_trunc(freework, dbn, lbn) return; } ACQUIRE_LOCK(&lk); + /* Protects against a race with complete_trunc_indir(). */ + freework->fw_state &= ~INPROGRESS; /* * If we have an indirdep we need to enforce the truncation order * and discard it when it is complete. @@ -7675,7 +7708,7 @@ indir_trunc(freework, dbn, lbn) if (freework->fw_blkno == dbn) { freework->fw_state |= ALLCOMPLETE; ACQUIRE_LOCK(&lk); - handle_written_freework(freework, 0); + handle_written_freework(freework); FREE_LOCK(&lk); } return; @@ -10368,8 +10401,7 @@ softdep_disk_write_complete(bp) continue; case D_FREEWORK: - /* Freework on an indirect block, not bmsafemap. */ - handle_written_freework(WK_FREEWORK(wk), 0); + handle_written_freework(WK_FREEWORK(wk)); break; case D_JSEGDEP: @@ -10540,7 +10572,7 @@ handle_jwork(wkhd) free_freedep(WK_FREEDEP(wk)); continue; case D_FREEWORK: - handle_written_freework(WK_FREEWORK(wk), 1); + handle_written_freework(WK_FREEWORK(wk)); continue; default: panic("handle_jwork: Unknown type %s\n", @@ -12738,6 +12770,53 @@ clear_inodedeps(td) } } +void +softdep_buf_append(bp, wkhd) + struct buf *bp; + struct workhead *wkhd; +{ + struct worklist *wk; + + ACQUIRE_LOCK(&lk); + while ((wk = LIST_FIRST(wkhd)) != NULL) { + WORKLIST_REMOVE(wk); + WORKLIST_INSERT(&bp->b_dep, wk); + } + FREE_LOCK(&lk); + +} + +void +softdep_inode_append(ip, cred, wkhd) + struct inode *ip; + struct ucred *cred; + struct workhead *wkhd; +{ + struct buf *bp; + struct fs *fs; + int error; + + fs = ip->i_fs; + error = bread(ip->i_devvp, fsbtodb(fs, ino_to_fsba(fs, ip->i_number)), + (int)fs->fs_bsize, cred, &bp); + if (error) { + softdep_freework(wkhd); + return; + } + softdep_buf_append(bp, wkhd); + bqrelse(bp); +} + +void +softdep_freework(wkhd) + struct workhead *wkhd; +{ + + ACQUIRE_LOCK(&lk); + handle_jwork(wkhd); + FREE_LOCK(&lk); +} + /* * Function to determine if the buffer has outstanding dependencies * that will cause a roll-back if the buffer is written. If wantcount Modified: head/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- head/sys/ufs/ufs/ufs_vnops.c Sun Jun 12 18:52:39 2011 (r223019) +++ head/sys/ufs/ufs/ufs_vnops.c Sun Jun 12 19:27:05 2011 (r223020) @@ -1838,6 +1838,8 @@ ufs_mkdir(ap) #ifdef QUOTA if ((error = getinoquota(ip)) || (error = chkiq(ip, 1, ucp, 0))) { + if (DOINGSOFTDEP(tvp)) + softdep_revert_link(dp, ip); UFS_VFREE(tvp, ip->i_number, dmode); vput(tvp); return (error); @@ -1850,6 +1852,8 @@ ufs_mkdir(ap) #ifdef QUOTA if ((error = getinoquota(ip)) || (error = chkiq(ip, 1, cnp->cn_cred, 0))) { + if (DOINGSOFTDEP(tvp)) + softdep_revert_link(dp, ip); UFS_VFREE(tvp, ip->i_number, dmode); vput(tvp); return (error); @@ -2608,6 +2612,8 @@ ufs_makeinode(mode, dvp, vpp, cnp) #ifdef QUOTA if ((error = getinoquota(ip)) || (error = chkiq(ip, 1, ucp, 0))) { + if (DOINGSOFTDEP(tvp)) + softdep_revert_link(pdir, ip); UFS_VFREE(tvp, ip->i_number, mode); vput(tvp); return (error); @@ -2620,6 +2626,8 @@ ufs_makeinode(mode, dvp, vpp, cnp) #ifdef QUOTA if ((error = getinoquota(ip)) || (error = chkiq(ip, 1, cnp->cn_cred, 0))) { + if (DOINGSOFTDEP(tvp)) + softdep_revert_link(pdir, ip); UFS_VFREE(tvp, ip->i_number, mode); vput(tvp); return (error); From owner-svn-src-head@FreeBSD.ORG Sun Jun 12 19:27:09 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE47B106566B; Sun, 12 Jun 2011 19:27:09 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id A48698FC14; Sun, 12 Jun 2011 19:27:09 +0000 (UTC) Received: from 63.imp.bsdimp.com (63.imp.bsdimp.com [10.0.0.63]) (authenticated bits=0) by harmony.bsdimp.com (8.14.4/8.14.3) with ESMTP id p5CJLtIk065853 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Sun, 12 Jun 2011 13:21:55 -0600 (MDT) (envelope-from imp@bsdimp.com) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: <20110612112150.GB62801@FreeBSD.org> Date: Sun, 12 Jun 2011 13:21:11 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <6BB2BD4D-824A-4EDA-8B9D-A774AC7DCDA2@bsdimp.com> References: <201106110908.p5B98kkE066709@svn.freebsd.org> <75DAEF7E-F43E-427E-8AFA-586E0B56D450@bsdimp.com> <20110611184549.GB3284@garage.freebsd.pl> <20110612112150.GB62801@FreeBSD.org> To: Alexey Dokuchaev X-Mailer: Apple Mail (2.1084) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (harmony.bsdimp.com [10.0.0.6]); Sun, 12 Jun 2011 13:21:55 -0600 (MDT) Cc: Adrian Chadd , src-committers@freebsd.org, Pawel Jakub Dawidek , svn-src-all@freebsd.org, Robert Watson , Joel Dahl , svn-src-head@freebsd.org Subject: Re: svn commit: r222980 - in head/sys: amd64/conf i386/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Jun 2011 19:27:10 -0000 On Jun 12, 2011, at 5:21 AM, Alexey Dokuchaev wrote: > On Sat, Jun 11, 2011 at 08:51:32PM +0200, Pawel Jakub Dawidek wrote: >> On Sat, Jun 11, 2011 at 10:44:14AM -0600, Warner Losh wrote: >>> I think our best bet for 9 is to strip GENERIC to the bone and have = a >>> 'generic.conf' if you will that loads everything we compile in = today. >>=20 >> I think trasz@ tried that and there is a problem. Loading modules on >> boot is very slow. If you try to load everything that GENERIC has as >> modules the boot will take forever. >=20 > Perhaps then we need to come up with something more intelligent, i.e. = do not > load everything trying to get maximum coverage of users' hardware, but > load only required bits based on what we see on PCI bus (roughly = speaking). Yea. Good luck with that. I had that idea like 4 or 5 years ago. = However, there's a lot of grunt work to do on all the drivers in the = system to get them into good enough shape to export their PCI ID lists = in a uniform way so we could automatically do the right thing. This isn't a 9.x item, but it could easily be a 10.x item. Warner= From owner-svn-src-head@FreeBSD.ORG Sun Jun 12 20:43:20 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B9128106566C; Sun, 12 Jun 2011 20:43:20 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id 7CA9D8FC14; Sun, 12 Jun 2011 20:43:20 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:192b:ad96:b84:94cd] (unknown [IPv6:2001:7b8:3a7:0:192b:ad96:b84:94cd]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 657115C59; Sun, 12 Jun 2011 22:43:19 +0200 (CEST) Message-ID: <4DF524E5.6060603@FreeBSD.org> Date: Sun, 12 Jun 2011 22:43:17 +0200 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.18pre) Gecko/20110527 Lanikai/3.1.11pre MIME-Version: 1.0 To: Kirk McKusick References: <201106121927.p5CJR5Wi038037@svn.freebsd.org> In-Reply-To: <201106121927.p5CJR5Wi038037@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223020 - in head/sys/ufs: ffs ufs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Jun 2011 20:43:20 -0000 On 2011-06-12 21:27, Kirk McKusick wrote: > Author: mckusick > Date: Sun Jun 12 19:27:05 2011 > New Revision: 223020 > URL: http://svn.freebsd.org/changeset/base/223020 ... > Modified: head/sys/ufs/ffs/ffs_extern.h > ============================================================================== > --- head/sys/ufs/ffs/ffs_extern.h Sun Jun 12 18:52:39 2011 (r223019) > +++ head/sys/ufs/ffs/ffs_extern.h Sun Jun 12 19:27:05 2011 (r223020) ... > @@ -161,4 +166,14 @@ void softdep_journal_fsync(struct inode > > int ffs_rdonly(struct inode *); > > +TAILQ_HEAD(snaphead, inode); > + > +struct snapdata { > + LIST_ENTRY(snapdata) sn_link; > + struct snaphead sn_head; > + daddr_t sn_listsize; > + daddr_t *sn_blklist; > + struct lock sn_lock; > +}; > + > #endif /* !_UFS_FFS_EXTERN_H */ This addition breaks world compilation in usr.sbin/makefs, apparently because the TAILQ_HEAD macro isn't defined at that point: ... cc -O2 -pipe -I/usr/src/usr.sbin/makefs -I/usr/src/usr.sbin/makefs/../../sys/fs/cd9660/ -I/usr/src/usr.sbin/makefs/../../sys/ufs/ffs -I/usr/src/usr.sbin/makefs/compat -DHAVE_STRUCT_STAT_ST_FLAGS=1 -DHAVE_STRUCT_STAT_ST_GEN=1 -I/usr/src/usr.sbin/makefs/../mtree -std=gnu99 -fstack-protector -Wsystem-headers -Werror -Wall -Wno-format-y2k -Wno-uninitialized -Wno-pointer-sign -c /usr/src/usr.sbin/makefs/ffs/ffs_bswap.c cc1: warnings being treated as errors In file included from /usr/src/usr.sbin/makefs/ffs/ffs_bswap.c:51: /usr/obj/usr/src/tmp/usr/include/ufs/ffs/ffs_extern.h:169: warning: data definition has no type or storage class /usr/obj/usr/src/tmp/usr/include/ufs/ffs/ffs_extern.h:169: warning: parameter names (without types) in function declaration /usr/obj/usr/src/tmp/usr/include/ufs/ffs/ffs_extern.h:172: error: expected specifier-qualifier-list before 'LIST_ENTRY' *** Error code 1 Stop in /usr/src/usr.sbin/makefs. From owner-svn-src-head@FreeBSD.ORG Sun Jun 12 21:40:07 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9BEBA106564A; Sun, 12 Jun 2011 21:40:07 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) by mx1.freebsd.org (Postfix) with ESMTP id 440E28FC0A; Sun, 12 Jun 2011 21:40:07 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 33A0725D3810; Sun, 12 Jun 2011 21:40:05 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 02ACE15A1841; Sun, 12 Jun 2011 21:40:04 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id zQjhDw7FHhdw; Sun, 12 Jun 2011 21:40:03 +0000 (UTC) Received: by mail.sbone.de (Postfix, from userid 66) id BE22515A187D; Sun, 12 Jun 2011 21:40:03 +0000 (UTC) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id 010CD444936; Sun, 12 Jun 2011 21:38:42 +0000 (UTC) Date: Sun, 12 Jun 2011 21:38:42 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Daniel Eischen In-Reply-To: <200705131412.l4DECf2N068712@repoman.freebsd.org> Message-ID: <20110612213330.D10590@maildrop.int.zabbadoz.net> References: <200705131412.l4DECf2N068712@repoman.freebsd.org> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@FreeBSD.org Subject: Re: cvs commit: src Makefile.inc1 src/lib/libc Makefile src/lib/libc_r Makefile src/lib/libpthread Makefile pthread.map src/lib/libpthread/thread thr_private.h src/lib/librt Makefile src/lib/libthr Makefile pthread.map src/lib/libthread_db Makefile ... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Jun 2011 21:40:07 -0000 On Sun, 13 May 2007, Daniel Eischen wrote: > deischen 2007-05-13 14:12:41 UTC > > FreeBSD src repository > > Modified files: > . Makefile.inc1 > lib/libc Makefile > lib/libc_r Makefile > lib/libpthread Makefile pthread.map > lib/libpthread/thread thr_private.h > lib/librt Makefile > lib/libthr Makefile pthread.map > lib/libthread_db Makefile > lib/msun Makefile > libexec/rtld-elf Makefile > share/mk bsd.lib.mk bsd.libnames.mk bsd.own.mk > bsd.symver.mk > Log: > Enable symbol versioning by default. Use WITHOUT_SYMVER to disable it. > Warning, after symbol versioning is enabled, going back is not easy > (use WITHOUT_SYMVER at your own risk). > > Change the default thread library to libthr. > > There most likely still needs to be a version bump for at least the > thread libraries. If necessary, this will happen later. http://svnweb.freebsd.org/base?view=revision&revision=169524 I figured WITHOUT_SYMVER= hs been useless since 201001. I am no longer able to do build worlds with WITHOUT_SYMVER= set in src.conf on a system with symbol versioning. I'd love someone to fix that and allow us to build libraries without all the historic stuff in them. If we cannot get it back working our libraries will grow bigger and bigger forever. If one is building images for clean-state systems that will never run anything older than the current CURRENT build, there is no need for the extra size. Contrary to what people think, memory and direct attached storage can still be expensive in some environments. Anyone who understands the system can come up with patches to fix this? /bz -- Bjoern A. Zeeb You have to have visions! Stop bit received. Insert coin for new address family. From owner-svn-src-head@FreeBSD.ORG Sun Jun 12 22:19:32 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E1D0106566C; Sun, 12 Jun 2011 22:19:32 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id B67A78FC0C; Sun, 12 Jun 2011 22:19:31 +0000 (UTC) Received: from 63.imp.bsdimp.com (63.imp.bsdimp.com [10.0.0.63]) (authenticated bits=0) by harmony.bsdimp.com (8.14.4/8.14.3) with ESMTP id p5CMG5Su067245 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Sun, 12 Jun 2011 16:16:08 -0600 (MDT) (envelope-from imp@bsdimp.com) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: <94A51677-0181-471A-B4D6-DC596C7BCBFD@gsoft.com.au> Date: Sun, 12 Jun 2011 16:16:03 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <5506A922-E3FF-477D-AB12-4B47C4D6CE04@bsdimp.com> References: <201106110908.p5B98kkE066709@svn.freebsd.org> <75DAEF7E-F43E-427E-8AFA-586E0B56D450@bsdimp.com> <20110611184549.GB3284@garage.freebsd.pl> <20110612112150.GB62801@FreeBSD.org> <94A51677-0181-471A-B4D6-DC596C7BCBFD@gsoft.com.au> To: "Daniel O'Connor" X-Mailer: Apple Mail (2.1084) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (harmony.bsdimp.com [10.0.0.6]); Sun, 12 Jun 2011 16:16:08 -0600 (MDT) Cc: Alexey Dokuchaev , src-committers@freebsd.org, Pawel Jakub Dawidek , svn-src-all@freebsd.org, Adrian Chadd , Robert Watson , Joel Dahl , svn-src-head@freebsd.org Subject: Re: svn commit: r222980 - in head/sys: amd64/conf i386/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Jun 2011 22:19:32 -0000 On Jun 12, 2011, at 8:46 AM, Daniel O'Connor wrote: > On 12/06/2011, at 20:51, Alexey Dokuchaev wrote: >>> I think trasz@ tried that and there is a problem. Loading modules on >>> boot is very slow. If you try to load everything that GENERIC has as >>> modules the boot will take forever. >>=20 >> Perhaps then we need to come up with something more intelligent, i.e. = do not >> load everything trying to get maximum coverage of users' hardware, = but >> load only required bits based on what we see on PCI bus (roughly = speaking). >=20 > Now the tricky part is extracting supported device IDs from drivers in = an automatic fashion :) >=20 > I imagine some symbol magic could be done for the general case so a = tool could extract the IDs & the bus type (so it could work for PCI & = USB which covers about 99.9% of the hardware in question). >=20 > ISTR there a few modules which call some blob to determine if the = module is supported but I think it's quite rare (the 80/20 rule works = for me here :) I've looked into this extensively. usb comes the closest right now, = since nearly all of its drivers use the right interface to match driver = to device. There is a standard structure people use. However, even it = is impossible to extract this data in a reliable automated fashion. = Ideally, these tables would move to their own section which could then = be extracted by a tool to see when to load it. This section would also = need some additional metadata in it so we know how to interpret the = section. The situation with the PCI bus is much less uniform. While many drivers = have tables, these tables are all ad-hoc. There's no standard structure = so everybody invents their own. In addition to annotating the tables, = you'd have to regularize them all across all pci drivers. Doing this = for 100+ drivers is a bit tedious. Also, there are at least two cases = where we have to load two drivers to be sure that one of them attaches = because there's matching done outside of the normal plug and play = identifiers (eg vendor/device/function/subvendor/subdevice) in their = probe routines. PC Card has also had the standard structure and interface for many = years. When I tried to move this to PCI many years ago, I encountered a = lot of resistance that didn't make sense to me at the time (so I can't = do it justice now). This should tell you how long the problem has = languished. It was the primary motivator behind writing devd, but the = pci resistance lead me to put aside the problem for a while. I'll be = happy to pick it back up, especially if I can get some help going = through all the drivers and tagging things appropriately. Warner= From owner-svn-src-head@FreeBSD.ORG Sun Jun 12 23:06:05 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 39F37106564A; Sun, 12 Jun 2011 23:06:05 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2A7A78FC13; Sun, 12 Jun 2011 23:06:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5CN65DT045065; Sun, 12 Jun 2011 23:06:05 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5CN64s2045057; Sun, 12 Jun 2011 23:06:04 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201106122306.p5CN64s2045057@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 12 Jun 2011 23:06:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223024 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Jun 2011 23:06:05 -0000 Author: jilles Date: Sun Jun 12 23:06:04 2011 New Revision: 223024 URL: http://svn.freebsd.org/changeset/base/223024 Log: sh: Save/restore changed variables in optimized command substitution. In optimized command substitution, save and restore any variables changed by expansions (${var=value} and $((var=assigned))), instead of trying to determine if an expansion may cause such changes. If $! is referenced in optimized command substitution, do not cause jobs to be remembered longer. This fixes $(jobs $!) again, simplifies the man page and shortens the code. Modified: head/bin/sh/eval.c head/bin/sh/expand.c head/bin/sh/expand.h head/bin/sh/jobs.c head/bin/sh/sh.1 head/bin/sh/var.c head/bin/sh/var.h Modified: head/bin/sh/eval.c ============================================================================== --- head/bin/sh/eval.c Sun Jun 12 22:47:04 2011 (r223023) +++ head/bin/sh/eval.c Sun Jun 12 23:06:04 2011 (r223024) @@ -571,14 +571,8 @@ evalpipe(union node *n) static int is_valid_fast_cmdsubst(union node *n) { - union node *argp; - if (n->type != NCMD) - return 0; - for (argp = n->ncmd.args ; argp ; argp = argp->narg.next) - if (expandhassideeffects(argp->narg.text)) - return 0; - return 1; + return (n->type == NCMD); } /* @@ -596,6 +590,7 @@ evalbackcmd(union node *n, struct backcm struct stackmark smark; /* unnecessary */ struct jmploc jmploc; struct jmploc *savehandler; + struct localvar *savelocalvars; setstackmark(&smark); result->fd = -1; @@ -608,12 +603,18 @@ evalbackcmd(union node *n, struct backcm } if (is_valid_fast_cmdsubst(n)) { exitstatus = oexitstatus; + savelocalvars = localvars; + localvars = NULL; + forcelocal++; savehandler = handler; if (setjmp(jmploc.loc)) { if (exception == EXERROR || exception == EXEXEC) exitstatus = 2; else if (exception != 0) { handler = savehandler; + forcelocal--; + poplocalvars(); + localvars = savelocalvars; longjmp(handler->loc, 1); } } else { @@ -621,6 +622,9 @@ evalbackcmd(union node *n, struct backcm evalcommand(n, EV_BACKCMD, result); } handler = savehandler; + forcelocal--; + poplocalvars(); + localvars = savelocalvars; } else { exitstatus = 0; if (pipe(pip) < 0) Modified: head/bin/sh/expand.c ============================================================================== --- head/bin/sh/expand.c Sun Jun 12 22:47:04 2011 (r223023) +++ head/bin/sh/expand.c Sun Jun 12 23:06:04 2011 (r223024) @@ -1621,78 +1621,6 @@ cvtnum(int num, char *buf) } /* - * Check statically if expanding a string may have side effects. - */ -int -expandhassideeffects(const char *p) -{ - int c; - int arinest; - - arinest = 0; - while ((c = *p++) != '\0') { - switch (c) { - case CTLESC: - p++; - break; - case CTLVAR: - c = *p++; - /* Expanding $! sets the job to remembered. */ - if (*p == '!') - return 1; - if ((c & VSTYPE) == VSASSIGN) - return 1; - /* - * If we are in arithmetic, the parameter may contain - * '=' which may cause side effects. Exceptions are - * the length of a parameter and $$, $# and $? which - * are always numeric. - */ - if ((c & VSTYPE) == VSLENGTH) { - while (*p != '=') - p++; - p++; - break; - } - if ((*p == '$' || *p == '#' || *p == '?') && - p[1] == '=') { - p += 2; - break; - } - if (arinest > 0) - return 1; - break; - case CTLBACKQ: - case CTLBACKQ | CTLQUOTE: - if (arinest > 0) - return 1; - break; - case CTLARI: - arinest++; - break; - case CTLENDARI: - arinest--; - break; - case '=': - if (*p == '=') { - /* Allow '==' operator. */ - p++; - continue; - } - if (arinest > 0) - return 1; - break; - case '!': case '<': case '>': - /* Allow '!=', '<=', '>=' operators. */ - if (*p == '=') - p++; - break; - } - } - return 0; -} - -/* * Do most of the work for wordexp(3). */ Modified: head/bin/sh/expand.h ============================================================================== --- head/bin/sh/expand.h Sun Jun 12 22:47:04 2011 (r223023) +++ head/bin/sh/expand.h Sun Jun 12 23:06:04 2011 (r223024) @@ -63,5 +63,4 @@ void expari(int); int patmatch(const char *, const char *, int); void rmescapes(char *); int casematch(union node *, const char *); -int expandhassideeffects(const char *); int wordexpcmd(int, char **); Modified: head/bin/sh/jobs.c ============================================================================== --- head/bin/sh/jobs.c Sun Jun 12 22:47:04 2011 (r223023) +++ head/bin/sh/jobs.c Sun Jun 12 23:06:04 2011 (r223024) @@ -70,6 +70,7 @@ __FBSDID("$FreeBSD$"); #include "memalloc.h" #include "error.h" #include "mystring.h" +#include "var.h" static struct job *jobtab; /* array of jobs */ @@ -798,6 +799,7 @@ forkshell(struct job *jp, union node *n, handler = &main_handler; closescript(); INTON; + forcelocal = 0; clear_traps(); #if JOBS jobctl = 0; /* do job control only in root shell */ @@ -1121,7 +1123,7 @@ backgndpidset(void) pid_t backgndpidval(void) { - if (bgjob != NULL) + if (bgjob != NULL && !forcelocal) bgjob->remembered = 1; return backgndpid; } Modified: head/bin/sh/sh.1 ============================================================================== --- head/bin/sh/sh.1 Sun Jun 12 22:47:04 2011 (r223023) +++ head/bin/sh/sh.1 Sun Jun 12 23:06:04 2011 (r223024) @@ -32,7 +32,7 @@ .\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95 .\" $FreeBSD$ .\" -.Dd June 10, 2011 +.Dd June 12, 2011 .Dt SH 1 .Os .Sh NAME @@ -1536,10 +1536,7 @@ except that the built-in commands and .Ic trap return information about the main shell environment -if they are the only command in a command substitution -and the substitutions in the command cannot cause side effects -(such as from assigning values to variables or referencing -.Li $! ). +if they are the only command in a command substitution. .Ss Arithmetic Expansion Arithmetic expansion provides a mechanism for evaluating an arithmetic expression and substituting its value. Modified: head/bin/sh/var.c ============================================================================== --- head/bin/sh/var.c Sun Jun 12 22:47:04 2011 (r223023) +++ head/bin/sh/var.c Sun Jun 12 23:06:04 2011 (r223024) @@ -94,6 +94,8 @@ struct var vps4; struct var vvers; static struct var voptind; +int forcelocal; + static const struct varinit varinit[] = { #ifndef NO_HISTORY { &vhistsize, VUNSET, "HISTSIZE=", @@ -325,6 +327,8 @@ setvareq(char *s, int flags) if (aflag) flags |= VEXPORT; + if (forcelocal && !(flags & (VNOSET | VNOLOCAL))) + mklocal(s); vp = find_var(s, &vpp, &nlen); if (vp != NULL) { if (vp->flags & VREADONLY) @@ -740,9 +744,9 @@ mklocal(char *name) vp = find_var(name, &vpp, NULL); if (vp == NULL) { if (strchr(name, '=')) - setvareq(savestr(name), VSTRFIXED); + setvareq(savestr(name), VSTRFIXED | VNOLOCAL); else - setvar(name, NULL, VSTRFIXED); + setvar(name, NULL, VSTRFIXED | VNOLOCAL); vp = *vpp; /* the new variable */ lvp->text = NULL; lvp->flags = VUNSET; @@ -751,7 +755,7 @@ mklocal(char *name) lvp->flags = vp->flags; vp->flags |= VSTRFIXED|VTEXTFIXED; if (name[vp->name_len] == '=') - setvareq(savestr(name), 0); + setvareq(savestr(name), VNOLOCAL); } } lvp->vp = vp; Modified: head/bin/sh/var.h ============================================================================== --- head/bin/sh/var.h Sun Jun 12 22:47:04 2011 (r223023) +++ head/bin/sh/var.h Sun Jun 12 23:06:04 2011 (r223024) @@ -46,6 +46,7 @@ #define VUNSET 0x20 /* the variable is not set */ #define VNOFUNC 0x40 /* don't call the callback function */ #define VNOSET 0x80 /* do not set variable - just readonly test */ +#define VNOLOCAL 0x100 /* ignore forcelocal */ struct var { @@ -68,6 +69,7 @@ struct localvar { struct localvar *localvars; +extern int forcelocal; extern struct var vifs; extern struct var vmail; From owner-svn-src-head@FreeBSD.ORG Sun Jun 12 23:09:01 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 59A3E1065673; Sun, 12 Jun 2011 23:09:01 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4B0748FC0C; Sun, 12 Jun 2011 23:09:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5CN91sQ045183; Sun, 12 Jun 2011 23:09:01 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5CN91jN045181; Sun, 12 Jun 2011 23:09:01 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201106122309.p5CN91jN045181@svn.freebsd.org> From: Dimitry Andric Date: Sun, 12 Jun 2011 23:09:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223025 - head/usr.sbin/makefs/ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Jun 2011 23:09:01 -0000 Author: dim Date: Sun Jun 12 23:09:00 2011 New Revision: 223025 URL: http://svn.freebsd.org/changeset/base/223025 Log: Unbreak usr.sbin/makefs after r223020. Pointy hat to: mckusick Modified: head/usr.sbin/makefs/ffs/ffs_bswap.c Modified: head/usr.sbin/makefs/ffs/ffs_bswap.c ============================================================================== --- head/usr.sbin/makefs/ffs/ffs_bswap.c Sun Jun 12 23:06:04 2011 (r223024) +++ head/usr.sbin/makefs/ffs/ffs_bswap.c Sun Jun 12 23:09:00 2011 (r223025) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include +#include #if defined(_KERNEL) #include #endif From owner-svn-src-head@FreeBSD.ORG Sun Jun 12 23:33:08 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7D9F106566C; Sun, 12 Jun 2011 23:33:08 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D90808FC13; Sun, 12 Jun 2011 23:33:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5CNX8Zm045936; Sun, 12 Jun 2011 23:33:08 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5CNX8Nd045934; Sun, 12 Jun 2011 23:33:08 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201106122333.p5CNX8Nd045934@svn.freebsd.org> From: Xin LI Date: Sun, 12 Jun 2011 23:33:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223026 - head/sys/dev/safe X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Jun 2011 23:33:09 -0000 Author: delphij Date: Sun Jun 12 23:33:08 2011 New Revision: 223026 URL: http://svn.freebsd.org/changeset/base/223026 Log: Use swap32() right. Submitted by: gcopper MFC after: 2 weeks Modified: head/sys/dev/safe/safe.c Modified: head/sys/dev/safe/safe.c ============================================================================== --- head/sys/dev/safe/safe.c Sun Jun 12 23:09:00 2011 (r223025) +++ head/sys/dev/safe/safe.c Sun Jun 12 23:33:08 2011 (r223026) @@ -1580,9 +1580,12 @@ safe_callback(struct safe_softc *sc, str * SHA-1 ICV's are byte-swapped; fix 'em up * before copy them to their destination. */ - bswap32(re->re_sastate.sa_saved_indigest[0]); - bswap32(re->re_sastate.sa_saved_indigest[1]); - bswap32(re->re_sastate.sa_saved_indigest[2]); + re->re_sastate.sa_saved_indigest[0] = + bswap32(re->re_sastate.sa_saved_indigest[0]); + re->re_sastate.sa_saved_indigest[1] = + bswap32(re->re_sastate.sa_saved_indigest[1]); + re->re_sastate.sa_saved_indigest[2] = + bswap32(re->re_sastate.sa_saved_indigest[2]); } crypto_copyback(crp->crp_flags, crp->crp_buf, crd->crd_inject, From owner-svn-src-head@FreeBSD.ORG Sun Jun 12 23:53:37 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CDA731065670; Sun, 12 Jun 2011 23:53:37 +0000 (UTC) (envelope-from doconnor@gsoft.com.au) Received: from cain.gsoft.com.au (unknown [IPv6:2001:44b8:7c07:5581:266:e1ff:fe0c:8f16]) by mx1.freebsd.org (Postfix) with ESMTP id DDF9A8FC14; Sun, 12 Jun 2011 23:53:36 +0000 (UTC) Received: from ur.dons.net.au (ppp203-122-208-116.lns5.adl6.internode.on.net [203.122.208.116]) (authenticated bits=0) by cain.gsoft.com.au (8.14.4/8.14.3) with ESMTP id p5CNrQiq031954 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Mon, 13 Jun 2011 09:23:26 +0930 (CST) (envelope-from doconnor@gsoft.com.au) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Daniel O'Connor" In-Reply-To: <5506A922-E3FF-477D-AB12-4B47C4D6CE04@bsdimp.com> Date: Mon, 13 Jun 2011 09:23:26 +0930 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201106110908.p5B98kkE066709@svn.freebsd.org> <75DAEF7E-F43E-427E-8AFA-586E0B56D450@bsdimp.com> <20110611184549.GB3284@garage.freebsd.pl> <20110612112150.GB62801@FreeBSD.org> <94A51677-0181-471A-B4D6-DC596C7BCBFD@gsoft.com.au> <5506A922-E3FF-477D-AB12-4B47C4D6CE04@bsdimp.com> To: Warner Losh X-Mailer: Apple Mail (2.1084) X-Spam-Score: 0.163 () BAYES_00,RDNS_DYNAMIC X-Scanned-By: MIMEDefang 2.67 on 203.31.81.10 Cc: Alexey Dokuchaev , src-committers@freebsd.org, Pawel Jakub Dawidek , svn-src-all@freebsd.org, Adrian Chadd , Robert Watson , Joel Dahl , svn-src-head@freebsd.org Subject: Re: svn commit: r222980 - in head/sys: amd64/conf i386/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Jun 2011 23:53:38 -0000 On 13/06/2011, at 7:46, Warner Losh wrote: >> ISTR there a few modules which call some blob to determine if the = module is supported but I think it's quite rare (the 80/20 rule works = for me here :) >=20 > I've looked into this extensively. usb comes the closest right now, = since nearly all of its drivers use the right interface to match driver = to device. There is a standard structure people use. However, even it = is impossible to extract this data in a reliable automated fashion. = Ideally, these tables would move to their own section which could then = be extracted by a tool to see when to load it. This section would also = need some additional metadata in it so we know how to interpret the = section. >=20 > The situation with the PCI bus is much less uniform. While many = drivers have tables, these tables are all ad-hoc. There's no standard = structure so everybody invents their own. In addition to annotating the = tables, you'd have to regularize them all across all pci drivers. Doing = this for 100+ drivers is a bit tedious. Also, there are at least two = cases where we have to load two drivers to be sure that one of them = attaches because there's matching done outside of the normal plug and = play identifiers (eg vendor/device/function/subvendor/subdevice) in = their probe routines. > PC Card has also had the standard structure and interface for many = years. When I tried to move this to PCI many years ago, I encountered a = lot of resistance that didn't make sense to me at the time (so I can't = do it justice now). This should tell you how long the problem has = languished. It was the primary motivator behind writing devd, but the = pci resistance lead me to put aside the problem for a while. I'll be = happy to pick it back up, especially if I can get some help going = through all the drivers and tagging things appropriately. I would be interested in helping, certainly with the mechanical changes. -- Daniel O'Connor software and network engineer for Genesis Software - http://www.gsoft.com.au "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C From owner-svn-src-head@FreeBSD.ORG Mon Jun 13 00:05:44 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 86C27106564A for ; Mon, 13 Jun 2011 00:05:44 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-yi0-f54.google.com (mail-yi0-f54.google.com [209.85.218.54]) by mx1.freebsd.org (Postfix) with ESMTP id 39D3F8FC13 for ; Mon, 13 Jun 2011 00:05:43 +0000 (UTC) Received: by yic13 with SMTP id 13so580098yic.13 for ; Sun, 12 Jun 2011 17:05:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=nSK19Ai0+gQ2ce/nVdXxBDRepdY/P68yXLC+Ogpdq9o=; b=jKidiMiT/z0KSCE5jWeFZvZMOjdIAN3oZnHYhLbqoL299tfqByIJgpkuWH48FC1VPB Hdl5SXuZapQIJRFWC1Jhd+SYQG7g3n6QFjUCh+r7A8kf65kFHqCD+IiWy0k//zXXo+JW McfaYgZsdjYnXqtWXp+/9LNTGNW21X36qQwJU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=Z2wwqZvEamoIQo1eDJHIKjb39iBV7jhHtjM9gX0nbejxK2xGCFagY/3Jakm1znDXPm 0xrx9F1txY3u7jpa2q5VE+yHGDJrN3j0bZqz+KtrE5e/5b7ce3HI5kg4MAONRTbwtit6 MW5NQkFjzBJjRPVHOO/jYlIos9TW48omadwRc= MIME-Version: 1.0 Received: by 10.150.132.15 with SMTP id f15mr5519455ybd.388.1307923543376; Sun, 12 Jun 2011 17:05:43 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.150.216.3 with HTTP; Sun, 12 Jun 2011 17:05:43 -0700 (PDT) In-Reply-To: References: <201106110908.p5B98kkE066709@svn.freebsd.org> <75DAEF7E-F43E-427E-8AFA-586E0B56D450@bsdimp.com> <20110611184549.GB3284@garage.freebsd.pl> <20110612112150.GB62801@FreeBSD.org> <94A51677-0181-471A-B4D6-DC596C7BCBFD@gsoft.com.au> <5506A922-E3FF-477D-AB12-4B47C4D6CE04@bsdimp.com> Date: Mon, 13 Jun 2011 08:05:43 +0800 X-Google-Sender-Auth: U8V-JlhXKN8uBPkQpnTVt6utjC0 Message-ID: From: Adrian Chadd To: "Daniel O'Connor" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, Warner Losh Subject: Re: svn commit: r222980 - in head/sys: amd64/conf i386/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2011 00:05:44 -0000 On 13 June 2011 07:53, Daniel O'Connor wrote: >> PC Card has also had the standard structure and interface for many years= . =A0When I tried to move this to PCI many years ago, I encountered a lot o= f resistance that didn't make sense to me at the time (so I can't do it jus= tice now). =A0This should tell you how long the problem has languished. =A0= It was the primary motivator behind writing devd, but the pci resistance le= ad me to put aside the problem for a while. =A0I'll be happy to pick it bac= k up, especially if I can get some help going through all the drivers and t= agging things appropriately. > > I would be interested in helping, certainly with the mechanical changes. Give me a couple weeks to tinker with the build so I can at least populate a modules.conf file and boot i386/amd64 from a modules-only kernel, then I'll post an update to -arch. This kind of device enumeration would be nice but it's mostly orthogonal to the initial discussion point. Eg, given that you need to have loaded the root devices (eg ata/scsi, usb+umass, etc) before you boot the kernel, those will have to either be enumerated by loader (ew?) or loaded by loader at load time. Adrian (Alliteration was intentional. :) From owner-svn-src-head@FreeBSD.ORG Mon Jun 13 01:04:00 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DFA941065670; Mon, 13 Jun 2011 01:04:00 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D01248FC13; Mon, 13 Jun 2011 01:04:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5D140YR048751; Mon, 13 Jun 2011 01:04:00 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5D140VF048748; Mon, 13 Jun 2011 01:04:00 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201106130104.p5D140VF048748@svn.freebsd.org> From: Dimitry Andric Date: Mon, 13 Jun 2011 01:04:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223029 - head/usr.sbin/makefs/ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2011 01:04:01 -0000 Author: dim Date: Mon Jun 13 01:04:00 2011 New Revision: 223029 URL: http://svn.freebsd.org/changeset/base/223029 Log: Apparently makefs needs a few more system headers to compile during buildworld. Modified: head/usr.sbin/makefs/ffs/ffs_bswap.c head/usr.sbin/makefs/ffs/ffs_subr.c Modified: head/usr.sbin/makefs/ffs/ffs_bswap.c ============================================================================== --- head/usr.sbin/makefs/ffs/ffs_bswap.c Mon Jun 13 00:55:29 2011 (r223028) +++ head/usr.sbin/makefs/ffs/ffs_bswap.c Mon Jun 13 01:04:00 2011 (r223029) @@ -35,6 +35,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #if defined(_KERNEL) #include #endif Modified: head/usr.sbin/makefs/ffs/ffs_subr.c ============================================================================== --- head/usr.sbin/makefs/ffs/ffs_subr.c Mon Jun 13 00:55:29 2011 (r223028) +++ head/usr.sbin/makefs/ffs/ffs_subr.c Mon Jun 13 01:04:00 2011 (r223029) @@ -35,6 +35,9 @@ __FBSDID("$FreeBSD$"); #include +#include +#include +#include #include #include From owner-svn-src-head@FreeBSD.ORG Mon Jun 13 01:15:09 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 286BD106564A; Mon, 13 Jun 2011 01:15:09 +0000 (UTC) (envelope-from buganini@gmail.com) Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id BE5498FC12; Mon, 13 Jun 2011 01:15:08 +0000 (UTC) Received: by iwn33 with SMTP id 33so5104281iwn.13 for ; Sun, 12 Jun 2011 18:15:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=V0K0Wz2yWeQ0qREBYSHxgk18n/4Aiv3nfE3MjVlzAiU=; b=AYe+tjkm3RUuquNY9mCI5j0fXgyVAaWAKgX33MiOm+n7x/D5cST+beXfAasHNyisOL USRnqfEw3OswnBKL6ajlpoUIQ9pVysghQGzrQkV1K0EGjkbQvvD5JfL48xLwlFM0swiy 3b+Sb0gAvIZ0iZ6JVueywyZwmwbxxw8a6iRP0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=tTQQ3tv7S6eHCPF7n2Iu8ipPkV69fVidCoyxJaKv0DKbmrkkYujwtZNkGtbHoNc5H0 3SRMRF8caEhUpmxD9U2o4nYjDQJuhR8LVxoV+he3Q8g2H/Ajpt0xCayyN7Y5IXHYBqRn MwYVrgcpkXjXgeuGQuusxyYP2rcZWgEn0K9U8= MIME-Version: 1.0 Received: by 10.231.51.17 with SMTP id b17mr5185589ibg.0.1307926148859; Sun, 12 Jun 2011 17:49:08 -0700 (PDT) Received: by 10.231.35.75 with HTTP; Sun, 12 Jun 2011 17:49:08 -0700 (PDT) In-Reply-To: <201106122309.p5CN91jN045181@svn.freebsd.org> References: <201106122309.p5CN91jN045181@svn.freebsd.org> Date: Mon, 13 Jun 2011 08:49:08 +0800 Message-ID: From: Buganini 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 Subject: Re: svn commit: r223025 - head/usr.sbin/makefs/ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2011 01:15:09 -0000 still broken: cc -O2 -pipe -I/usr/src/usr.sbin/makefs -I/usr/src/usr.sbin/makefs/../../sys/fs/cd9660/ -I/usr/src/usr.sbin/makefs/../../sys/ufs/ffs -I/usr/src/usr.sbin/makefs/compat -DHAVE_STRUCT_STAT_ST_FLAGS=1 -DHAVE_STRUCT_STAT_ST_GEN=1 -I/usr/src/usr.sbin/makefs/../mtree -std=gnu99 -fstack-protector -Wsystem-headers -Wall -Wno-format-y2k -Wno-uninitialized -Wno-pointer-sign -c /usr/src/usr.sbin/makefs/ffs/ffs_bswap.c In file included from /usr/src/usr.sbin/makefs/ffs/ffs_bswap.c:52: /usr/obj/usr/src/tmp/usr/include/ufs/ffs/ffs_extern.h:176: error: field 'sn_lock' has incomplete type *** Error code 1 Stop in /usr/src/usr.sbin/makefs. *** Error code 1 Following lock(9): #include #include #include fix it. and another breakage: cc -O2 -pipe -I/usr/src/usr.sbin/makefs -I/usr/src/usr.sbin/makefs/../../sys/fs/cd9660/ -I/usr/src/usr.sbin/makefs/../../sys/ufs/ffs -I/usr/src/usr.sbin/makefs/compat -DHAVE_STRUCT_STAT_ST_FLAGS=1 -DHAVE_STRUCT_STAT_ST_GEN=1 -I/usr/src/usr.sbin/makefs/../mtree -std=gnu99 -fstack-protector -Wsystem-headers -Wall -Wno-format-y2k -Wno-uninitialized -Wno-pointer-sign -c /usr/src/usr.sbin/makefs/ffs/ffs_subr.c In file included from /usr/src/usr.sbin/makefs/ffs/ffs_subr.c:48: /usr/obj/usr/src/tmp/usr/include/ufs/ffs/ffs_extern.h:169: warning: data definition has no type or storage class /usr/obj/usr/src/tmp/usr/include/ufs/ffs/ffs_extern.h:169: warning: parameter names (without types) in function declaration /usr/obj/usr/src/tmp/usr/include/ufs/ffs/ffs_extern.h:172: error: expected specifier-qualifier-list before 'LIST_ENTRY' *** Error code 1 #include #include #include #include fix it. From owner-svn-src-head@FreeBSD.ORG Mon Jun 13 04:31:57 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B452E106566B; Mon, 13 Jun 2011 04:31:57 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A49568FC0C; Mon, 13 Jun 2011 04:31:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5D4VvBv055606; Mon, 13 Jun 2011 04:31:57 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5D4Vv0t055604; Mon, 13 Jun 2011 04:31:57 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201106130431.p5D4Vv0t055604@svn.freebsd.org> From: Adrian Chadd Date: Mon, 13 Jun 2011 04:31:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223032 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2011 04:31:57 -0000 Author: adrian Date: Mon Jun 13 04:31:57 2011 New Revision: 223032 URL: http://svn.freebsd.org/changeset/base/223032 Log: Fix ath_ahb(4) bus attach and eeprom error handling. Submitted by: Luiz Otavio O Souza Modified: head/sys/dev/ath/if_ath_ahb.c Modified: head/sys/dev/ath/if_ath_ahb.c ============================================================================== --- head/sys/dev/ath/if_ath_ahb.c Mon Jun 13 02:23:51 2011 (r223031) +++ head/sys/dev/ath/if_ath_ahb.c Mon Jun 13 04:31:57 2011 (r223032) @@ -123,7 +123,7 @@ ath_ahb_attach(device_t dev) device_printf(sc->sc_dev, "eeprom @ %p\n", (void *) eepromaddr); psc->sc_eeprom = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, (uintptr_t) eepromaddr, (uintptr_t) eepromaddr + (uintptr_t) ((ATH_EEPROM_DATA_SIZE * 2) - 1), 0, RF_ACTIVE); - if (psc->sc_sr == NULL) { + if (psc->sc_eeprom == NULL) { device_printf(dev, "cannot map eeprom space\n"); goto bad0; } @@ -139,6 +139,10 @@ ath_ahb_attach(device_t dev) /* Copy the EEPROM data out */ sc->sc_eepromdata = malloc(ATH_EEPROM_DATA_SIZE * 2, M_TEMP, M_NOWAIT | M_ZERO); + if (sc->sc_eepromdata == NULL) { + device_printf(dev, "cannot allocate memory for eeprom data\n"); + goto bad1; + } device_printf(sc->sc_dev, "eeprom data @ %p\n", (void *) rman_get_bushandle(psc->sc_eeprom)); /* XXX why doesn't this work? -adrian */ #if 0 From owner-svn-src-head@FreeBSD.ORG Mon Jun 13 05:22:07 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D15C2106566B; Mon, 13 Jun 2011 05:22:07 +0000 (UTC) (envelope-from avatar@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A81B48FC08; Mon, 13 Jun 2011 05:22:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5D5M7fk057306; Mon, 13 Jun 2011 05:22:07 GMT (envelope-from avatar@svn.freebsd.org) Received: (from avatar@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5D5M7sa057304; Mon, 13 Jun 2011 05:22:07 GMT (envelope-from avatar@svn.freebsd.org) Message-Id: <201106130522.p5D5M7sa057304@svn.freebsd.org> From: Tai-hwa Liang Date: Mon, 13 Jun 2011 05:22:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223035 - head/usr.bin/find X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2011 05:22:07 -0000 Author: avatar Date: Mon Jun 13 05:22:07 2011 New Revision: 223035 URL: http://svn.freebsd.org/changeset/base/223035 Log: Using statfs.f_fstypename rather than statfs.f_type whilst performing fstype comparsion as nullfs will copy f_type from underlayer FS. PR: bin/156258 Submitted by: Marcin Wisnicki MFC after: 1 month Modified: head/usr.bin/find/function.c Modified: head/usr.bin/find/function.c ============================================================================== --- head/usr.bin/find/function.c Mon Jun 13 04:55:29 2011 (r223034) +++ head/usr.bin/find/function.c Mon Jun 13 05:22:07 2011 (r223035) @@ -846,7 +846,8 @@ f_fstype(PLAN *plan, FTSENT *entry) static dev_t curdev; /* need a guaranteed illegal dev value */ static int first = 1; struct statfs sb; - static int val_type, val_flags; + static int val_flags; + static char fstype[sizeof(sb.f_fstypename)]; char *p, save[2] = {0,0}; if ((plan->flags & F_MTMASK) == F_MTUNKNOWN) @@ -888,13 +889,13 @@ f_fstype(PLAN *plan, FTSENT *entry) * always copy both of them. */ val_flags = sb.f_flags; - val_type = sb.f_type; + strlcpy(fstype, sb.f_fstypename, sizeof(fstype)); } switch (plan->flags & F_MTMASK) { case F_MTFLAG: return val_flags & plan->mt_data; case F_MTTYPE: - return val_type == plan->mt_data; + return (strncmp(fstype, plan->c_data, sizeof(fstype)) == 0); default: abort(); } @@ -905,22 +906,11 @@ c_fstype(OPTION *option, char ***argvp) { char *fsname; PLAN *new; - struct xvfsconf vfc; fsname = nextarg(option, argvp); ftsoptions &= ~FTS_NOSTAT; new = palloc(option); - - /* - * Check first for a filesystem name. - */ - if (getvfsbyname(fsname, &vfc) == 0) { - new->flags |= F_MTTYPE; - new->mt_data = vfc.vfc_typenum; - return new; - } - switch (*fsname) { case 'l': if (!strcmp(fsname, "local")) { @@ -938,12 +928,8 @@ c_fstype(OPTION *option, char ***argvp) break; } - /* - * We need to make filesystem checks for filesystems - * that exists but aren't in the kernel work. - */ - fprintf(stderr, "Warning: Unknown filesystem type %s\n", fsname); - new->flags |= F_MTUNKNOWN; + new->flags |= F_MTTYPE; + new->c_data = fsname; return new; } From owner-svn-src-head@FreeBSD.ORG Mon Jun 13 06:27:58 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 026CA1065676; Mon, 13 Jun 2011 06:27:58 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail06.syd.optusnet.com.au (mail06.syd.optusnet.com.au [211.29.132.187]) by mx1.freebsd.org (Postfix) with ESMTP id 61EAC8FC13; Mon, 13 Jun 2011 06:27:56 +0000 (UTC) Received: from c122-106-165-191.carlnfd1.nsw.optusnet.com.au (c122-106-165-191.carlnfd1.nsw.optusnet.com.au [122.106.165.191]) by mail06.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p5D6Rn42028080 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 13 Jun 2011 16:27:51 +1000 Date: Mon, 13 Jun 2011 16:27:49 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Dimitry Andric In-Reply-To: <201106130104.p5D140VF048748@svn.freebsd.org> Message-ID: <20110613161452.S843@besplex.bde.org> References: <201106130104.p5D140VF048748@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223029 - head/usr.sbin/makefs/ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2011 06:27:58 -0000 On Mon, 13 Jun 2011, Dimitry Andric wrote: > Log: > Apparently makefs needs a few more system headers to compile during > buildworld. This expands the bug. > Modified: > head/usr.sbin/makefs/ffs/ffs_bswap.c > head/usr.sbin/makefs/ffs/ffs_subr.c > > Modified: head/usr.sbin/makefs/ffs/ffs_bswap.c > ============================================================================== > --- head/usr.sbin/makefs/ffs/ffs_bswap.c Mon Jun 13 00:55:29 2011 (r223028) > +++ head/usr.sbin/makefs/ffs/ffs_bswap.c Mon Jun 13 01:04:00 2011 (r223029) > @@ -35,6 +35,8 @@ __FBSDID("$FreeBSD$"); > > #include > #include > +#include > +#include > #if defined(_KERNEL) > #include > #endif Kernel variables like sn_lock should not be exported to userland. And even when they are, the full kernel API for accessing them should not by included by userland (or in kernel headers). The system provides headers and to help avoid exposing the full API. These bugs are in many networking headers, but should not be added in new code. The networking headers are so convuluted and broken that many of them have to expose the full API. This should be even easier to avoid adding in new code. Bruce From owner-svn-src-head@FreeBSD.ORG Mon Jun 13 06:57:54 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9463E106564A; Mon, 13 Jun 2011 06:57:54 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 18DC08FC14; Mon, 13 Jun 2011 06:57:53 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id p5D6vn0K046085 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 13 Jun 2011 09:57:49 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id p5D6vnjh053532; Mon, 13 Jun 2011 09:57:49 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id p5D6vnLI053531; Mon, 13 Jun 2011 09:57:49 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 13 Jun 2011 09:57:49 +0300 From: Kostik Belousov To: Dimitry Andric Message-ID: <20110613065749.GT48734@deviant.kiev.zoral.com.ua> References: <201106130104.p5D140VF048748@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="nj/v3niR77Tv8XPp" Content-Disposition: inline In-Reply-To: <201106130104.p5D140VF048748@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223029 - head/usr.sbin/makefs/ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2011 06:57:54 -0000 --nj/v3niR77Tv8XPp Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jun 13, 2011 at 01:04:00AM +0000, Dimitry Andric wrote: > Author: dim > Date: Mon Jun 13 01:04:00 2011 > New Revision: 223029 > URL: http://svn.freebsd.org/changeset/base/223029 >=20 > Log: > Apparently makefs needs a few more system headers to compile during > buildworld. >=20 > Modified: > head/usr.sbin/makefs/ffs/ffs_bswap.c > head/usr.sbin/makefs/ffs/ffs_subr.c >=20 > Modified: head/usr.sbin/makefs/ffs/ffs_bswap.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/usr.sbin/makefs/ffs/ffs_bswap.c Mon Jun 13 00:55:29 2011 (r22302= 8) > +++ head/usr.sbin/makefs/ffs/ffs_bswap.c Mon Jun 13 01:04:00 2011 (r22302= 9) > @@ -35,6 +35,8 @@ __FBSDID("$FreeBSD$"); > =20 > #include > #include > +#include > +#include > #if defined(_KERNEL) > #include > #endif >=20 > Modified: head/usr.sbin/makefs/ffs/ffs_subr.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/usr.sbin/makefs/ffs/ffs_subr.c Mon Jun 13 00:55:29 2011 (r223028) > +++ head/usr.sbin/makefs/ffs/ffs_subr.c Mon Jun 13 01:04:00 2011 (r223029) > @@ -35,6 +35,9 @@ > __FBSDID("$FreeBSD$"); > =20 > #include > +#include > +#include > +#include > =20 > #include > #include I suspect it is easier and less controversial to put the structure under #ifdef _KERNEL braces instead. --nj/v3niR77Tv8XPp Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk31tO0ACgkQC3+MBN1Mb4gPwwCfSh7OJgVt8bSMx8ly7aavTzoq uLgAnifIUYmgTteu2XDKb4z1r4ucQzXx =6lCG -----END PGP SIGNATURE----- --nj/v3niR77Tv8XPp-- From owner-svn-src-head@FreeBSD.ORG Mon Jun 13 12:45:20 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4492C1065673; Mon, 13 Jun 2011 12:45:20 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 34B238FC16; Mon, 13 Jun 2011 12:45:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5DCjKAo074555; Mon, 13 Jun 2011 12:45:20 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5DCjK6W074553; Mon, 13 Jun 2011 12:45:20 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201106131245.p5DCjK6W074553@svn.freebsd.org> From: Marius Strobl Date: Mon, 13 Jun 2011 12:45:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223044 - head/sys/sparc64/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2011 12:45:20 -0000 Author: marius Date: Mon Jun 13 12:45:19 2011 New Revision: 223044 URL: http://svn.freebsd.org/changeset/base/223044 Log: - Merge r222980 from x86: add sound(4) and common device drivers. - Fix whitespace. Modified: head/sys/sparc64/conf/GENERIC Modified: head/sys/sparc64/conf/GENERIC ============================================================================== --- head/sys/sparc64/conf/GENERIC Mon Jun 13 12:23:45 2011 (r223043) +++ head/sys/sparc64/conf/GENERIC Mon Jun 13 12:45:19 2011 (r223044) @@ -61,13 +61,13 @@ options PRINTF_BUFR_SIZE=128 # Prevent options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) options AUDIT # Security event auditing options MAC # TrustedBSD MAC Framework -options INCLUDE_CONFIG_FILE # Include this file in kernel +options INCLUDE_CONFIG_FILE # Include this file in kernel # Debugging for use in -current options KDB # Enable kernel debugger support. options DDB # Support DDB. options GDB # Support remote GDB. -options DEADLKRES # Enable the deadlock resolver +options DEADLKRES # Enable the deadlock resolver options INVARIANTS # Enable calls of extra sanity checking options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS options WITNESS # Enable checks to detect deadlocks and cycles @@ -266,3 +266,10 @@ device fwe # Ethernet over FireWire (n device fwip # IP over FireWire (RFC 2734,3146) device dcons # Dumb console driver device dcons_crom # Configuration ROM for dcons + +# Sound support +device sound # Generic sound driver (required) +device snd_audiocs # Crystal Semiconductor CS4231 +device snd_es137x # Ensoniq AudioPCI ES137x +device snd_t4dwave # Acer Labs M5451 +device snd_uaudio # USB Audio From owner-svn-src-head@FreeBSD.ORG Mon Jun 13 13:24:33 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7840E106566C; Mon, 13 Jun 2011 13:24:33 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 689978FC12; Mon, 13 Jun 2011 13:24:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5DDOXOX076391; Mon, 13 Jun 2011 13:24:33 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5DDOXCi076389; Mon, 13 Jun 2011 13:24:33 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201106131324.p5DDOXCi076389@svn.freebsd.org> From: Takahashi Yoshihiro Date: Mon, 13 Jun 2011 13:24:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223046 - head/sys/pc98/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2011 13:24:33 -0000 Author: nyan Date: Mon Jun 13 13:24:33 2011 New Revision: 223046 URL: http://svn.freebsd.org/changeset/base/223046 Log: - Reduce diffs against i386. - Add snd_uaudio. Modified: head/sys/pc98/conf/GENERIC Modified: head/sys/pc98/conf/GENERIC ============================================================================== --- head/sys/pc98/conf/GENERIC Mon Jun 13 13:21:12 2011 (r223045) +++ head/sys/pc98/conf/GENERIC Mon Jun 13 13:24:33 2011 (r223046) @@ -139,12 +139,6 @@ device sc # Add suspend/resume support for the i8254. #device pmtimer -# Audio support -#device sound # Generic sound driver -#device snd_mss # Microsoft Sound System -#device "snd_sb16" # Sound Blaster 16 -#device snd_sbc # Sound Blaster - # PCCARD (PCMCIA) support # PCMCIA and cardbus bridge support device cbb # cardbus (yenta) bridge @@ -288,3 +282,10 @@ device bpf # Berkeley packet filter #device firewire # FireWire bus code #device sbp # SCSI over FireWire (Requires scbus and da) #device fwe # Ethernet over FireWire (non-standard!) + +# Sound support +#device sound # Generic sound driver (required) +#device snd_mss # Microsoft Sound System +#device "snd_sb16" # Sound Blaster 16 +#device snd_sbc # Sound Blaster +#device snd_uaudio # USB Audio From owner-svn-src-head@FreeBSD.ORG Mon Jun 13 15:38:31 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A043D106566C; Mon, 13 Jun 2011 15:38:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 912428FC1A; Mon, 13 Jun 2011 15:38:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5DFcV2i088348; Mon, 13 Jun 2011 15:38:31 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5DFcVWB088346; Mon, 13 Jun 2011 15:38:31 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201106131538.p5DFcVWB088346@svn.freebsd.org> From: John Baldwin Date: Mon, 13 Jun 2011 15:38:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223049 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2011 15:38:31 -0000 Author: jhb Date: Mon Jun 13 15:38:31 2011 New Revision: 223049 URL: http://svn.freebsd.org/changeset/base/223049 Log: Advance the advertised window (rcv_adv) to the currently received data (rcv_nxt) if we advertising a zero window. This can be true when ACK'ing a window probe whose one byte payload was accepted rather than dropped because the socket's receive buffer was not completely full, but the remaining space was smaller than the window scale. This ensures that window probe ACKs satisfy the assumption made in r221346 and closes a window where rcv_nxt could be greater than rcv_adv. Tested by: trasz, pho, trociny Reviewed by: silby MFC after: 1 week Modified: head/sys/netinet/tcp_output.c Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Mon Jun 13 13:40:12 2011 (r223048) +++ head/sys/netinet/tcp_output.c Mon Jun 13 15:38:31 2011 (r223049) @@ -1331,7 +1331,7 @@ out: * then remember the size of the advertised window. * Any pending ACK has now been sent. */ - if (recwin > 0 && SEQ_GT(tp->rcv_nxt + recwin, tp->rcv_adv)) + if (recwin >= 0 && SEQ_GT(tp->rcv_nxt + recwin, tp->rcv_adv)) tp->rcv_adv = tp->rcv_nxt + recwin; tp->last_ack_sent = tp->rcv_nxt; tp->t_flags &= ~(TF_ACKNOW | TF_DELACK); From owner-svn-src-head@FreeBSD.ORG Mon Jun 13 16:05:41 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E633C106566C; Mon, 13 Jun 2011 16:05:41 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D69658FC1B; Mon, 13 Jun 2011 16:05:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5DG5f25089447; Mon, 13 Jun 2011 16:05:41 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5DG5fvp089443; Mon, 13 Jun 2011 16:05:41 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201106131605.p5DG5fvp089443@svn.freebsd.org> From: Dimitry Andric Date: Mon, 13 Jun 2011 16:05:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223052 - in head: sys/ufs/ffs usr.sbin/makefs/ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2011 16:05:42 -0000 Author: dim Date: Mon Jun 13 16:05:41 2011 New Revision: 223052 URL: http://svn.freebsd.org/changeset/base/223052 Log: Use alternative, less messy solution to avoid breakage after r223020: put the snapdata structure between #ifdef _KERNEL guards. Suggested by: kib Modified: head/sys/ufs/ffs/ffs_extern.h head/usr.sbin/makefs/ffs/ffs_bswap.c head/usr.sbin/makefs/ffs/ffs_subr.c Modified: head/sys/ufs/ffs/ffs_extern.h ============================================================================== --- head/sys/ufs/ffs/ffs_extern.h Mon Jun 13 15:59:21 2011 (r223051) +++ head/sys/ufs/ffs/ffs_extern.h Mon Jun 13 16:05:41 2011 (r223052) @@ -166,6 +166,7 @@ void softdep_freework(struct workhead *) int ffs_rdonly(struct inode *); +#ifdef _KERNEL TAILQ_HEAD(snaphead, inode); struct snapdata { @@ -175,5 +176,6 @@ struct snapdata { daddr_t *sn_blklist; struct lock sn_lock; }; +#endif /* _KERNEL */ #endif /* !_UFS_FFS_EXTERN_H */ Modified: head/usr.sbin/makefs/ffs/ffs_bswap.c ============================================================================== --- head/usr.sbin/makefs/ffs/ffs_bswap.c Mon Jun 13 15:59:21 2011 (r223051) +++ head/usr.sbin/makefs/ffs/ffs_bswap.c Mon Jun 13 16:05:41 2011 (r223052) @@ -34,9 +34,6 @@ __FBSDID("$FreeBSD$"); #include -#include -#include -#include #if defined(_KERNEL) #include #endif Modified: head/usr.sbin/makefs/ffs/ffs_subr.c ============================================================================== --- head/usr.sbin/makefs/ffs/ffs_subr.c Mon Jun 13 15:59:21 2011 (r223051) +++ head/usr.sbin/makefs/ffs/ffs_subr.c Mon Jun 13 16:05:41 2011 (r223052) @@ -35,9 +35,6 @@ __FBSDID("$FreeBSD$"); #include -#include -#include -#include #include #include From owner-svn-src-head@FreeBSD.ORG Mon Jun 13 19:45:02 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1C1A31065672; Mon, 13 Jun 2011 19:45:02 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 04DAE8FC08; Mon, 13 Jun 2011 19:45:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5DJj1tE096080; Mon, 13 Jun 2011 19:45:01 GMT (envelope-from jpaetzel@svn.freebsd.org) Received: (from jpaetzel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5DJj1JF096079; Mon, 13 Jun 2011 19:45:01 GMT (envelope-from jpaetzel@svn.freebsd.org) Message-Id: <201106131945.p5DJj1JF096079@svn.freebsd.org> From: Josh Paetzel Date: Mon, 13 Jun 2011 19:45:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223056 - head/etc/periodic/daily X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2011 19:45:02 -0000 Author: jpaetzel Date: Mon Jun 13 19:45:01 2011 New Revision: 223056 URL: http://svn.freebsd.org/changeset/base/223056 Log: Convert the allowed characters '-', '.', and ':' in a ZFS pool name to _ to avoid causing errors in the shell script. Submitted by: William Grzybowski Approved by: kib (mentor) MFC after: 7 days Sponsored by: iXsystems Modified: head/etc/periodic/daily/800.scrub-zfs Modified: head/etc/periodic/daily/800.scrub-zfs ============================================================================== --- head/etc/periodic/daily/800.scrub-zfs Mon Jun 13 19:40:09 2011 (r223055) +++ head/etc/periodic/daily/800.scrub-zfs Mon Jun 13 19:45:01 2011 (r223056) @@ -46,7 +46,7 @@ case "$daily_scrub_zfs_enable" in esac # determine how many days shall be between scrubs - eval _pool_threshold=\${daily_scrub_zfs_${pool}_threshold} + eval _pool_threshold=\${daily_scrub_zfs_$(echo "${pool}"|tr -s "-" "_"|tr -s "." "_"|tr -s ":" "_")_threshold} if [ -z "${_pool_threshold}" ];then _pool_threshold=${daily_scrub_zfs_default_threshold} fi From owner-svn-src-head@FreeBSD.ORG Mon Jun 13 20:11:28 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E210E1065677; Mon, 13 Jun 2011 20:11:28 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D07388FC08; Mon, 13 Jun 2011 20:11:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5DKBS7T096910; Mon, 13 Jun 2011 20:11:28 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5DKBSGI096903; Mon, 13 Jun 2011 20:11:28 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201106132011.p5DKBSGI096903@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Mon, 13 Jun 2011 20:11:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223057 - head/contrib/pf/pfctl X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2011 20:11:29 -0000 Author: bz Date: Mon Jun 13 20:11:28 2011 New Revision: 223057 URL: http://svn.freebsd.org/changeset/base/223057 Log: Add a new option -P to suppress getservbyport(3) calls when printing rules. This allows one to force consistent printing of numeric port numbers like we do with -n for other tools like netstat (just that -n was already taken) rather than the service names. -P is currently unused in OpenBSD so the change is eligible for upstreaming. PR: misc/151015 Submitted by: Matt Koivisto (mkoivisto sandvine.com) Sponsored by: Sandvine Incorporated MFC after: 1 week Modified: head/contrib/pf/pfctl/pfctl.8 head/contrib/pf/pfctl/pfctl.c head/contrib/pf/pfctl/pfctl_optimize.c head/contrib/pf/pfctl/pfctl_parser.c head/contrib/pf/pfctl/pfctl_parser.h Modified: head/contrib/pf/pfctl/pfctl.8 ============================================================================== --- head/contrib/pf/pfctl/pfctl.8 Mon Jun 13 19:45:01 2011 (r223056) +++ head/contrib/pf/pfctl/pfctl.8 Mon Jun 13 20:11:28 2011 (r223057) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 20, 2002 +.Dd June 13, 2011 .Dt PFCTL 8 .Os .Sh NAME @@ -35,7 +35,7 @@ .Sh SYNOPSIS .Nm pfctl .Bk -words -.Op Fl AdeghmNnOqRrvz +.Op Fl AdeghmNnOPqRrvz .Op Fl a Ar anchor .Oo Fl D Ar macro Ns = .Ar value Oc @@ -350,6 +350,9 @@ without any options will enable optimizations, and a second .Fl o will enable profiling. +.It Fl P +Do not perform service name lookup for port specific rules, +instead display the ports numerically. .It Fl p Ar device Use the device file .Ar device @@ -670,6 +673,7 @@ Passive operating system fingerprint dat .Xr pf.conf 5 , .Xr pf.os 5 , .Xr rc.conf 5 , +.Xr services 5 , .Xr sysctl.conf 5 , .Xr authpf 8 , .Xr ftp-proxy 8 , Modified: head/contrib/pf/pfctl/pfctl.c ============================================================================== --- head/contrib/pf/pfctl/pfctl.c Mon Jun 13 19:45:01 2011 (r223056) +++ head/contrib/pf/pfctl/pfctl.c Mon Jun 13 20:11:28 2011 (r223057) @@ -235,7 +235,7 @@ usage(void) { extern char *__progname; - fprintf(stderr, "usage: %s [-AdeghmNnOqRrvz] ", __progname); + fprintf(stderr, "usage: %s [-AdeghmNnOPqRrvz] ", __progname); fprintf(stderr, "[-a anchor] [-D macro=value] [-F modifier]\n"); fprintf(stderr, "\t[-f file] [-i interface] [-K host | network] "); fprintf(stderr, "[-k host | network ]\n"); @@ -770,6 +770,7 @@ pfctl_show_rules(int dev, char *path, in struct pfioc_rule pr; u_int32_t nr, mnr, header = 0; int rule_numbers = opts & (PF_OPT_VERBOSE2 | PF_OPT_DEBUG); + int numeric = opts & PF_OPT_NUMERIC; int len = strlen(path); int brace; char *p; @@ -834,7 +835,7 @@ pfctl_show_rules(int dev, char *path, in case PFCTL_SHOW_RULES: if (pr.rule.label[0] && (opts & PF_OPT_SHOWALL)) labels = 1; - print_rule(&pr.rule, pr.anchor_call, rule_numbers); + print_rule(&pr.rule, pr.anchor_call, rule_numbers, numeric); printf("\n"); pfctl_print_rule_counters(&pr.rule, opts); break; @@ -894,7 +895,7 @@ pfctl_show_rules(int dev, char *path, in } else p = &pr.anchor_call[0]; - print_rule(&pr.rule, p, rule_numbers); + print_rule(&pr.rule, p, rule_numbers, numeric); if (brace) printf(" {\n"); else @@ -951,7 +952,7 @@ pfctl_show_nat(int dev, int opts, char * dotitle = 0; } print_rule(&pr.rule, pr.anchor_call, - opts & PF_OPT_VERBOSE2); + opts & PF_OPT_VERBOSE2, opts & PF_OPT_NUMERIC); printf("\n"); pfctl_print_rule_counters(&pr.rule, opts); pfctl_clear_pool(&pr.rule.rpool); @@ -1318,7 +1319,8 @@ pfctl_load_rule(struct pfctl *pf, char * if (pf->opts & PF_OPT_VERBOSE) { INDENT(depth, !(pf->opts & PF_OPT_VERBOSE2)); print_rule(r, r->anchor ? r->anchor->name : "", - pf->opts & PF_OPT_VERBOSE2); + pf->opts & PF_OPT_VERBOSE2, + pf->opts & PF_OPT_NUMERIC); } path[len] = '\0'; pfctl_clear_pool(&r->rpool); @@ -1978,7 +1980,7 @@ main(int argc, char *argv[]) usage(); while ((ch = getopt(argc, argv, - "a:AdD:eqf:F:ghi:k:K:mnNOo::p:rRs:t:T:vx:z")) != -1) { + "a:AdD:eqf:F:ghi:k:K:mnNOo::Pp:rRs:t:T:vx:z")) != -1) { switch (ch) { case 'a': anchoropt = optarg; @@ -2080,6 +2082,9 @@ main(int argc, char *argv[]) case 'p': pf_device = optarg; break; + case 'P': + opts |= PF_OPT_NUMERIC; + break; case 's': showopt = pfctl_lookup_option(optarg, showopt_list); if (showopt == NULL) { Modified: head/contrib/pf/pfctl/pfctl_optimize.c ============================================================================== --- head/contrib/pf/pfctl/pfctl_optimize.c Mon Jun 13 19:45:01 2011 (r223056) +++ head/contrib/pf/pfctl/pfctl_optimize.c Mon Jun 13 20:11:28 2011 (r223057) @@ -407,7 +407,7 @@ optimize_superblock(struct pfctl *pf, st TAILQ_FOREACH(por, &block->sb_rules, por_entry) { printf(" "); print_rule(&por->por_rule, por->por_rule.anchor ? - por->por_rule.anchor->name : "", 1); + por->por_rule.anchor->name : "", 1, 0); } #endif /* OPT_DEBUG */ Modified: head/contrib/pf/pfctl/pfctl_parser.c ============================================================================== --- head/contrib/pf/pfctl/pfctl_parser.c Mon Jun 13 19:45:01 2011 (r223056) +++ head/contrib/pf/pfctl/pfctl_parser.c Mon Jun 13 20:11:28 2011 (r223057) @@ -64,11 +64,11 @@ __FBSDID("$FreeBSD$"); #include "pfctl.h" void print_op (u_int8_t, const char *, const char *); -void print_port (u_int8_t, u_int16_t, u_int16_t, const char *); +void print_port (u_int8_t, u_int16_t, u_int16_t, const char *, int); void print_ugid (u_int8_t, unsigned, unsigned, const char *, unsigned); void print_flags (u_int8_t); void print_fromto(struct pf_rule_addr *, pf_osfp_t, - struct pf_rule_addr *, u_int8_t, u_int8_t, int); + struct pf_rule_addr *, u_int8_t, u_int8_t, int, int); int ifa_skip_if(const char *filter, struct node_host *p); struct node_host *ifa_grouplookup(const char *, int); @@ -320,12 +320,15 @@ print_op(u_int8_t op, const char *a1, co } void -print_port(u_int8_t op, u_int16_t p1, u_int16_t p2, const char *proto) +print_port(u_int8_t op, u_int16_t p1, u_int16_t p2, const char *proto, int numeric) { char a1[6], a2[6]; struct servent *s; - s = getservbyport(p1, proto); + if (!numeric) + s = getservbyport(p1, proto); + else + s = NULL; p1 = ntohs(p1); p2 = ntohs(p2); snprintf(a1, sizeof(a1), "%u", p1); @@ -363,7 +366,7 @@ print_flags(u_int8_t f) void print_fromto(struct pf_rule_addr *src, pf_osfp_t osfp, struct pf_rule_addr *dst, - sa_family_t af, u_int8_t proto, int verbose) + sa_family_t af, u_int8_t proto, int verbose, int numeric) { char buf[PF_OSFP_LEN*3]; if (src->addr.type == PF_ADDR_ADDRMASK && @@ -384,7 +387,8 @@ print_fromto(struct pf_rule_addr *src, p if (src->port_op) print_port(src->port_op, src->port[0], src->port[1], - proto == IPPROTO_TCP ? "tcp" : "udp"); + proto == IPPROTO_TCP ? "tcp" : "udp", + numeric); if (osfp != PF_OSFP_ANY) printf(" os \"%s\"", pfctl_lookup_fingerprint(osfp, buf, sizeof(buf))); @@ -396,7 +400,8 @@ print_fromto(struct pf_rule_addr *src, p if (dst->port_op) print_port(dst->port_op, dst->port[0], dst->port[1], - proto == IPPROTO_TCP ? "tcp" : "udp"); + proto == IPPROTO_TCP ? "tcp" : "udp", + numeric); } } @@ -673,7 +678,7 @@ print_src_node(struct pf_src_node *sn, i } void -print_rule(struct pf_rule *r, const char *anchor_call, int verbose) +print_rule(struct pf_rule *r, const char *anchor_call, int verbose, int numeric) { static const char *actiontypes[] = { "pass", "block", "scrub", "no scrub", "nat", "no nat", "binat", "no binat", "rdr", "no rdr" }; @@ -800,7 +805,7 @@ print_rule(struct pf_rule *r, const char printf(" proto %u", r->proto); } print_fromto(&r->src, r->os_fingerprint, &r->dst, r->af, r->proto, - verbose); + verbose, numeric); if (r->uid.op) print_ugid(r->uid.op, r->uid.uid[0], r->uid.uid[1], "user", UID_MAX); Modified: head/contrib/pf/pfctl/pfctl_parser.h ============================================================================== --- head/contrib/pf/pfctl/pfctl_parser.h Mon Jun 13 19:45:01 2011 (r223056) +++ head/contrib/pf/pfctl/pfctl_parser.h Mon Jun 13 20:11:28 2011 (r223057) @@ -48,6 +48,7 @@ #define PF_OPT_DEBUG 0x0200 #define PF_OPT_SHOWALL 0x0400 #define PF_OPT_OPTIMIZE 0x0800 +#define PF_OPT_NUMERIC 0x1000 #define PF_OPT_MERGE 0x2000 #define PF_OPT_RECURSE 0x4000 @@ -235,7 +236,7 @@ int pfctl_load_anchors(int, struct pfctl void print_pool(struct pf_pool *, u_int16_t, u_int16_t, sa_family_t, int); void print_src_node(struct pf_src_node *, int); -void print_rule(struct pf_rule *, const char *, int); +void print_rule(struct pf_rule *, const char *, int, int); void print_tabledef(const char *, int, int, struct node_tinithead *); void print_status(struct pf_status *, int); From owner-svn-src-head@FreeBSD.ORG Mon Jun 13 20:15:45 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B7DB106564A; Mon, 13 Jun 2011 20:15:45 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id C9D398FC16; Mon, 13 Jun 2011 20:15:44 +0000 (UTC) Received: by vws18 with SMTP id 18so5680847vws.13 for ; Mon, 13 Jun 2011 13:15:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=ZNDW9qOrOWE9FUzztEyWmBhi8TvO/pK+/8nOCTYZPEg=; b=a0Hnxh6xqY0sb8m63maVMUVvMzbb0P3HFWcRYXh2xs4VqHL7Cx+wfoA4RIYa+NctHR RQTS14/YDK+9AAa9tUMx7p9LHNO0ubLc1sqhBLEc88pp40twcmOGxwm+5YdG5kHYnlqL Rf2y/NNOrwRQ5fTE/uLdIsZOpoTTLzP7pkeIY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=TNIAzVjIDHy7bUZLIjz5hrU670or+SFEi6NcxPvL3yGeN1L9wAWSg3EXh3AYNFa1Y1 TM/HQ/Y9NhiKDuqp5KnfkSSVH8LrUy5u/XCcU5QaYli9jK6ZHB7qAaNPfEZ5MLqEf4zN 8nEHdPbWKqFdLi2EqZXJskHBes3zGKcFbW0p8= MIME-Version: 1.0 Received: by 10.220.187.76 with SMTP id cv12mr2230510vcb.128.1307996143767; Mon, 13 Jun 2011 13:15:43 -0700 (PDT) Received: by 10.220.189.202 with HTTP; Mon, 13 Jun 2011 13:15:43 -0700 (PDT) In-Reply-To: <201106131945.p5DJj1JF096079@svn.freebsd.org> References: <201106131945.p5DJj1JF096079@svn.freebsd.org> Date: Mon, 13 Jun 2011 13:15:43 -0700 Message-ID: From: Garrett Cooper To: Josh Paetzel Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223056 - head/etc/periodic/daily X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2011 20:15:45 -0000 On Mon, Jun 13, 2011 at 12:45 PM, Josh Paetzel wrote= : > Author: jpaetzel > Date: Mon Jun 13 19:45:01 2011 > New Revision: 223056 > URL: http://svn.freebsd.org/changeset/base/223056 > > Log: > =A0Convert the allowed characters '-', '.', and ':' in a ZFS pool name to= _ > =A0to avoid causing errors in the shell script. This could be done like: sed -E -e 's/[-\.:]/_/g' to avoid the need for pipelining multiple tr calls. Example: $ echo :-. | sed -E -e 's/[-\.:]/_/g' ___ $ From owner-svn-src-head@FreeBSD.ORG Mon Jun 13 20:34:12 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7710A106566C; Mon, 13 Jun 2011 20:34:12 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5C7488FC18; Mon, 13 Jun 2011 20:34:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5DKYCMK097594; Mon, 13 Jun 2011 20:34:12 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5DKYCkM097592; Mon, 13 Jun 2011 20:34:12 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201106132034.p5DKYCkM097592@svn.freebsd.org> From: Alexander Motin Date: Mon, 13 Jun 2011 20:34:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223058 - head/sys/dev/sound/pci/hda X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2011 20:34:12 -0000 Author: mav Date: Mon Jun 13 20:34:12 2011 New Revision: 223058 URL: http://svn.freebsd.org/changeset/base/223058 Log: Add bunch of Conexant codec IDs. For some of them add quirks to disable excessive signal paths to simplify tracer's life. Modified: head/sys/dev/sound/pci/hda/hdac.c Modified: head/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.c Mon Jun 13 20:11:28 2011 (r223057) +++ head/sys/dev/sound/pci/hda/hdac.c Mon Jun 13 20:34:12 2011 (r223058) @@ -754,7 +754,17 @@ static const struct { #define HDA_CODEC_CX20561 HDA_CODEC_CONSTRUCT(CONEXANT, 0x5051) #define HDA_CODEC_CX20582 HDA_CODEC_CONSTRUCT(CONEXANT, 0x5066) #define HDA_CODEC_CX20583 HDA_CODEC_CONSTRUCT(CONEXANT, 0x5067) +#define HDA_CODEC_CX20584 HDA_CODEC_CONSTRUCT(CONEXANT, 0x5068) #define HDA_CODEC_CX20585 HDA_CODEC_CONSTRUCT(CONEXANT, 0x5069) +#define HDA_CODEC_CX20590 HDA_CODEC_CONSTRUCT(CONEXANT, 0x506e) +#define HDA_CODEC_CX20631 HDA_CODEC_CONSTRUCT(CONEXANT, 0x5097) +#define HDA_CODEC_CX20632 HDA_CODEC_CONSTRUCT(CONEXANT, 0x5098) +#define HDA_CODEC_CX20641 HDA_CODEC_CONSTRUCT(CONEXANT, 0x50a1) +#define HDA_CODEC_CX20642 HDA_CODEC_CONSTRUCT(CONEXANT, 0x50a2) +#define HDA_CODEC_CX20651 HDA_CODEC_CONSTRUCT(CONEXANT, 0x50ab) +#define HDA_CODEC_CX20652 HDA_CODEC_CONSTRUCT(CONEXANT, 0x50ac) +#define HDA_CODEC_CX20664 HDA_CODEC_CONSTRUCT(CONEXANT, 0x50b8) +#define HDA_CODEC_CX20665 HDA_CODEC_CONSTRUCT(CONEXANT, 0x50b9) #define HDA_CODEC_CXXXXX HDA_CODEC_CONSTRUCT(CONEXANT, 0xffff) /* VIA */ @@ -939,7 +949,17 @@ static const struct { { HDA_CODEC_CX20561, "Conexant CX20561 (Hermosa)" }, { HDA_CODEC_CX20582, "Conexant CX20582 (Pebble)" }, { HDA_CODEC_CX20583, "Conexant CX20583 (Pebble HSF)" }, + { HDA_CODEC_CX20584, "Conexant CX20584" }, { HDA_CODEC_CX20585, "Conexant CX20585" }, + { HDA_CODEC_CX20590, "Conexant CX20590" }, + { HDA_CODEC_CX20631, "Conexant CX20631" }, + { HDA_CODEC_CX20632, "Conexant CX20632" }, + { HDA_CODEC_CX20641, "Conexant CX20641" }, + { HDA_CODEC_CX20642, "Conexant CX20642" }, + { HDA_CODEC_CX20651, "Conexant CX20651" }, + { HDA_CODEC_CX20652, "Conexant CX20652" }, + { HDA_CODEC_CX20664, "Conexant CX20664" }, + { HDA_CODEC_CX20665, "Conexant CX20665" }, { HDA_CODEC_VT1708_8, "VIA VT1708_8" }, { HDA_CODEC_VT1708_9, "VIA VT1708_9" }, { HDA_CODEC_VT1708_A, "VIA VT1708_A" }, @@ -4921,6 +4941,25 @@ hdac_vendor_patch_parse(struct hdac_devi if (w != NULL) w->connsenable[0] = 0; break; + case HDA_CODEC_CX20582: + case HDA_CODEC_CX20583: + case HDA_CODEC_CX20584: + case HDA_CODEC_CX20585: + case HDA_CODEC_CX20590: + /* + * These codecs have extra connectivity on record side + * too reach for the present parser. + */ + w = hdac_widget_get(devinfo, 20); + if (w != NULL) + w->connsenable[1] = 0; + w = hdac_widget_get(devinfo, 21); + if (w != NULL) + w->connsenable[1] = 0; + w = hdac_widget_get(devinfo, 22); + if (w != NULL) + w->connsenable[0] = 0; + break; } } From owner-svn-src-head@FreeBSD.ORG Mon Jun 13 20:36:30 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 27B681065676; Mon, 13 Jun 2011 20:36:30 +0000 (UTC) (envelope-from gibbs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 15F9B8FC22; Mon, 13 Jun 2011 20:36:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5DKaUEA097701; Mon, 13 Jun 2011 20:36:30 GMT (envelope-from gibbs@svn.freebsd.org) Received: (from gibbs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5DKaUXY097699; Mon, 13 Jun 2011 20:36:30 GMT (envelope-from gibbs@svn.freebsd.org) Message-Id: <201106132036.p5DKaUXY097699@svn.freebsd.org> From: "Justin T. Gibbs" Date: Mon, 13 Jun 2011 20:36:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223059 - head/sys/dev/xen/blkback X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2011 20:36:30 -0000 Author: gibbs Date: Mon Jun 13 20:36:29 2011 New Revision: 223059 URL: http://svn.freebsd.org/changeset/base/223059 Log: Several enhancements to the Xen block back driver. sys/dev/xen/blkback/blkback.c: o Implement front-end request coalescing. This greatly improves the performance of front-end clients that are unaware of the dynamic request-size/number of requests negotiation available in the FreeBSD backend driver. This required a large restructuring in how this driver records in-flight transactions and how those transactions are mapped into kernel KVA. For example, the driver now includes a mini "KVA manager" that allocates ranges of contiguous KVA to patches of requests that are physically contiguous in the backing store so that a single bio or UIO segment can be used to represent the I/O. o Refuse to open any backend files or devices if the system has yet to mount root. This avoids a panic. o Properly handle "onlined" devices. An "onlined" backend device stays attached to its backing store across front-end disconnections. This feature is intended to reduce latency when a front-end does a hand-off to another driver (e.g. PV aware bootloader to OS kernel) or during a VM reboot. o Harden the driver against a pathological/buggy front-end by carefully vetting front-end XenStore data such as the front-end state. o Add sysctls that report the negotiated number of segments per-request and the number of requests that can be concurrently in flight. Submitted by: kdm Reviewed by: gibbs Sponsored by: Spectra Logic Corporation MFC after: 1 week Modified: head/sys/dev/xen/blkback/blkback.c Modified: head/sys/dev/xen/blkback/blkback.c ============================================================================== --- head/sys/dev/xen/blkback/blkback.c Mon Jun 13 20:34:12 2011 (r223058) +++ head/sys/dev/xen/blkback/blkback.c Mon Jun 13 20:36:29 2011 (r223059) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2009-2010 Spectra Logic Corporation + * Copyright (c) 2009-2011 Spectra Logic Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -61,6 +61,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include @@ -153,9 +155,19 @@ MALLOC_DEFINE(M_XENBLOCKBACK, "xbbd", "X #define XBB_MAX_RING_PAGES \ BLKIF_RING_PAGES(BLKIF_SEGS_TO_BLOCKS(XBB_MAX_SEGMENTS_PER_REQUEST) \ * XBB_MAX_REQUESTS) +/** + * The maximum number of ring pages that we can allow per request list. + * We limit this to the maximum number of segments per request, because + * that is already a reasonable number of segments to aggregate. This + * number should never be smaller than XBB_MAX_SEGMENTS_PER_REQUEST, + * because that would leave situations where we can't dispatch even one + * large request. + */ +#define XBB_MAX_SEGMENTS_PER_REQLIST XBB_MAX_SEGMENTS_PER_REQUEST /*--------------------------- Forward Declarations ---------------------------*/ struct xbb_softc; +struct xbb_xen_req; static void xbb_attach_failed(struct xbb_softc *xbb, int err, const char *fmt, ...) __attribute__((format(printf, 3, 4))); @@ -163,16 +175,15 @@ static int xbb_shutdown(struct xbb_soft static int xbb_detach(device_t dev); /*------------------------------ Data Structures -----------------------------*/ -/** - * \brief Object tracking an in-flight I/O from a Xen VBD consumer. - */ -struct xbb_xen_req { - /** - * Linked list links used to aggregate idle request in the - * request free pool (xbb->request_free_slist). - */ - SLIST_ENTRY(xbb_xen_req) links; +STAILQ_HEAD(xbb_xen_req_list, xbb_xen_req); + +typedef enum { + XBB_REQLIST_NONE = 0x00, + XBB_REQLIST_MAPPED = 0x01 +} xbb_reqlist_flags; + +struct xbb_xen_reqlist { /** * Back reference to the parent block back instance for this * request. Used during bio_done handling. @@ -180,17 +191,71 @@ struct xbb_xen_req { struct xbb_softc *xbb; /** - * The remote domain's identifier for this I/O request. + * BLKIF_OP code for this request. + */ + int operation; + + /** + * Set to BLKIF_RSP_* to indicate request status. + * + * This field allows an error status to be recorded even if the + * delivery of this status must be deferred. Deferred reporting + * is necessary, for example, when an error is detected during + * completion processing of one bio when other bios for this + * request are still outstanding. + */ + int status; + + /** + * Number of 512 byte sectors not transferred. + */ + int residual_512b_sectors; + + /** + * Starting sector number of the first request in the list. + */ + off_t starting_sector_number; + + /** + * If we're going to coalesce, the next contiguous sector would be + * this one. + */ + off_t next_contig_sector; + + /** + * Number of child requests in the list. */ - uint64_t id; + int num_children; + + /** + * Number of I/O requests dispatched to the backend. + */ + int pendcnt; + + /** + * Total number of segments for requests in the list. + */ + int nr_segments; + + /** + * Flags for this particular request list. + */ + xbb_reqlist_flags flags; /** * Kernel virtual address space reserved for this request - * structure and used to map the remote domain's pages for + * list structure and used to map the remote domain's pages for * this I/O, into our domain's address space. */ uint8_t *kva; + /** + * Base, psuedo-physical address, corresponding to the start + * of this request's kva region. + */ + uint64_t gnt_base; + + #ifdef XBB_USE_BOUNCE_BUFFERS /** * Pre-allocated domain local memory used to proxy remote @@ -200,53 +265,91 @@ struct xbb_xen_req { #endif /** - * Base, psuedo-physical address, corresponding to the start - * of this request's kva region. + * Array of grant handles (one per page) used to map this request. */ - uint64_t gnt_base; + grant_handle_t *gnt_handles; + + /** + * Device statistics request ordering type (ordered or simple). + */ + devstat_tag_type ds_tag_type; + + /** + * Device statistics request type (read, write, no_data). + */ + devstat_trans_flags ds_trans_type; + + /** + * The start time for this request. + */ + struct bintime ds_t0; + + /** + * Linked list of contiguous requests with the same operation type. + */ + struct xbb_xen_req_list contig_req_list; + + /** + * Linked list links used to aggregate idle requests in the + * request list free pool (xbb->reqlist_free_stailq) and pending + * requests waiting for execution (xbb->reqlist_pending_stailq). + */ + STAILQ_ENTRY(xbb_xen_reqlist) links; +}; + +STAILQ_HEAD(xbb_xen_reqlist_list, xbb_xen_reqlist); + +/** + * \brief Object tracking an in-flight I/O from a Xen VBD consumer. + */ +struct xbb_xen_req { + /** + * Linked list links used to aggregate requests into a reqlist + * and to store them in the request free pool. + */ + STAILQ_ENTRY(xbb_xen_req) links; + + /** + * The remote domain's identifier for this I/O request. + */ + uint64_t id; /** * The number of pages currently mapped for this request. */ - int nr_pages; + int nr_pages; /** * The number of 512 byte sectors comprising this requests. */ - int nr_512b_sectors; + int nr_512b_sectors; /** * The number of struct bio requests still outstanding for this * request on the backend device. This field is only used for * device (rather than file) backed I/O. */ - int pendcnt; + int pendcnt; /** * BLKIF_OP code for this request. */ - int operation; + int operation; /** - * BLKIF_RSP status code for this request. - * - * This field allows an error status to be recorded even if the - * delivery of this status must be deferred. Deferred reporting - * is necessary, for example, when an error is detected during - * completion processing of one bio when other bios for this - * request are still outstanding. + * Storage used for non-native ring requests. */ - int status; + blkif_request_t ring_req_storage; /** - * Device statistics request ordering type (ordered or simple). + * Pointer to the Xen request in the ring. */ - devstat_tag_type ds_tag_type; + blkif_request_t *ring_req; /** - * Device statistics request type (read, write, no_data). + * Consumer index for this request. */ - devstat_trans_flags ds_trans_type; + RING_IDX req_ring_idx; /** * The start time for this request. @@ -254,9 +357,9 @@ struct xbb_xen_req { struct bintime ds_t0; /** - * Array of grant handles (one per page) used to map this request. + * Pointer back to our parent request list. */ - grant_handle_t *gnt_handles; + struct xbb_xen_reqlist *reqlist; }; SLIST_HEAD(xbb_xen_req_slist, xbb_xen_req); @@ -321,7 +424,10 @@ typedef enum XBBF_RESOURCE_SHORTAGE = 0x04, /** Connection teardown in progress. */ - XBBF_SHUTDOWN = 0x08 + XBBF_SHUTDOWN = 0x08, + + /** A thread is already performing shutdown processing. */ + XBBF_IN_SHUTDOWN = 0x10 } xbb_flag_t; /** Backend device type. */ @@ -399,7 +505,7 @@ struct xbb_file_data { * Only a single file based request is outstanding per-xbb instance, * so we only need one of these. */ - struct iovec xiovecs[XBB_MAX_SEGMENTS_PER_REQUEST]; + struct iovec xiovecs[XBB_MAX_SEGMENTS_PER_REQLIST]; #ifdef XBB_USE_BOUNCE_BUFFERS /** @@ -411,7 +517,7 @@ struct xbb_file_data { * bounce-out the read data. This array serves as the temporary * storage for this saved data. */ - struct iovec saved_xiovecs[XBB_MAX_SEGMENTS_PER_REQUEST]; + struct iovec saved_xiovecs[XBB_MAX_SEGMENTS_PER_REQLIST]; /** * \brief Array of memoized bounce buffer kva offsets used @@ -422,7 +528,7 @@ struct xbb_file_data { * the request sg elements is unavoidable. We memoize the computed * bounce address here to reduce the cost of the second walk. */ - void *xiovecs_vaddr[XBB_MAX_SEGMENTS_PER_REQUEST]; + void *xiovecs_vaddr[XBB_MAX_SEGMENTS_PER_REQLIST]; #endif /* XBB_USE_BOUNCE_BUFFERS */ }; @@ -437,9 +543,9 @@ union xbb_backend_data { /** * Function signature of backend specific I/O handlers. */ -typedef int (*xbb_dispatch_t)(struct xbb_softc *xbb, blkif_request_t *ring_req, - struct xbb_xen_req *req, int nseg, - int operation, int flags); +typedef int (*xbb_dispatch_t)(struct xbb_softc *xbb, + struct xbb_xen_reqlist *reqlist, int operation, + int flags); /** * Per-instance configuration data. @@ -467,14 +573,23 @@ struct xbb_softc { xbb_dispatch_t dispatch_io; /** The number of requests outstanding on the backend device/file. */ - u_int active_request_count; + int active_request_count; /** Free pool of request tracking structures. */ - struct xbb_xen_req_slist request_free_slist; + struct xbb_xen_req_list request_free_stailq; /** Array, sized at connection time, of request tracking structures. */ struct xbb_xen_req *requests; + /** Free pool of request list structures. */ + struct xbb_xen_reqlist_list reqlist_free_stailq; + + /** List of pending request lists awaiting execution. */ + struct xbb_xen_reqlist_list reqlist_pending_stailq; + + /** Array, sized at connection time, of request list structures. */ + struct xbb_xen_reqlist *request_lists; + /** * Global pool of kva used for mapping remote domain ring * and I/O transaction data. @@ -487,6 +602,15 @@ struct xbb_softc { /** The size of the global kva pool. */ int kva_size; + /** The size of the KVA area used for request lists. */ + int reqlist_kva_size; + + /** The number of pages of KVA used for request lists */ + int reqlist_kva_pages; + + /** Bitmap of free KVA pages */ + bitstr_t *kva_free; + /** * \brief Cached value of the front-end's domain id. * @@ -508,12 +632,12 @@ struct xbb_softc { int abi; /** - * \brief The maximum number of requests allowed to be in - * flight at a time. + * \brief The maximum number of requests and request lists allowed + * to be in flight at a time. * * This value is negotiated via the XenStore. */ - uint32_t max_requests; + u_int max_requests; /** * \brief The maximum number of segments (1 page per segment) @@ -521,7 +645,15 @@ struct xbb_softc { * * This value is negotiated via the XenStore. */ - uint32_t max_request_segments; + u_int max_request_segments; + + /** + * \brief Maximum number of segments per request list. + * + * This value is derived from and will generally be larger than + * max_request_segments. + */ + u_int max_reqlist_segments; /** * The maximum size of any request to this back-end @@ -529,7 +661,13 @@ struct xbb_softc { * * This value is negotiated via the XenStore. */ - uint32_t max_request_size; + u_int max_request_size; + + /** + * The maximum size of any request list. This is derived directly + * from max_reqlist_segments. + */ + u_int max_reqlist_size; /** Various configuration and state bit flags. */ xbb_flag_t flags; @@ -574,6 +712,7 @@ struct xbb_softc { struct vnode *vn; union xbb_backend_data backend; + /** The native sector size of the backend. */ u_int sector_size; @@ -598,7 +737,14 @@ struct xbb_softc { * * Ring processing is serialized so we only need one of these. */ - struct xbb_sg xbb_sgs[XBB_MAX_SEGMENTS_PER_REQUEST]; + struct xbb_sg xbb_sgs[XBB_MAX_SEGMENTS_PER_REQLIST]; + + /** + * Temporary grant table map used in xbb_dispatch_io(). When + * XBB_MAX_SEGMENTS_PER_REQLIST gets large, keeping this on the + * stack could cause a stack overflow. + */ + struct gnttab_map_grant_ref maps[XBB_MAX_SEGMENTS_PER_REQLIST]; /** Mutex protecting per-instance data. */ struct mtx lock; @@ -614,8 +760,51 @@ struct xbb_softc { int pseudo_phys_res_id; #endif - /** I/O statistics. */ + /** + * I/O statistics from BlockBack dispatch down. These are + * coalesced requests, and we start them right before execution. + */ struct devstat *xbb_stats; + + /** + * I/O statistics coming into BlockBack. These are the requests as + * we get them from BlockFront. They are started as soon as we + * receive a request, and completed when the I/O is complete. + */ + struct devstat *xbb_stats_in; + + /** Disable sending flush to the backend */ + int disable_flush; + + /** Send a real flush for every N flush requests */ + int flush_interval; + + /** Count of flush requests in the interval */ + int flush_count; + + /** Don't coalesce requests if this is set */ + int no_coalesce_reqs; + + /** Number of requests we have received */ + uint64_t reqs_received; + + /** Number of requests we have completed*/ + uint64_t reqs_completed; + + /** How many forced dispatches (i.e. without coalescing) have happend */ + uint64_t forced_dispatch; + + /** How many normal dispatches have happend */ + uint64_t normal_dispatch; + + /** How many total dispatches have happend */ + uint64_t total_dispatch; + + /** How many times we have run out of KVA */ + uint64_t kva_shortages; + + /** How many times we have run out of request structures */ + uint64_t request_shortages; }; /*---------------------------- Request Processing ----------------------------*/ @@ -633,21 +822,14 @@ xbb_get_req(struct xbb_softc *xbb) struct xbb_xen_req *req; req = NULL; - mtx_lock(&xbb->lock); - /* - * Do not allow new requests to be allocated while we - * are shutting down. - */ - if ((xbb->flags & XBBF_SHUTDOWN) == 0) { - if ((req = SLIST_FIRST(&xbb->request_free_slist)) != NULL) { - SLIST_REMOVE_HEAD(&xbb->request_free_slist, links); - xbb->active_request_count++; - } else { - xbb->flags |= XBBF_RESOURCE_SHORTAGE; - } + mtx_assert(&xbb->lock, MA_OWNED); + + if ((req = STAILQ_FIRST(&xbb->request_free_stailq)) != NULL) { + STAILQ_REMOVE_HEAD(&xbb->request_free_stailq, links); + xbb->active_request_count++; } - mtx_unlock(&xbb->lock); + return (req); } @@ -660,34 +842,40 @@ xbb_get_req(struct xbb_softc *xbb) static inline void xbb_release_req(struct xbb_softc *xbb, struct xbb_xen_req *req) { - int wake_thread; + mtx_assert(&xbb->lock, MA_OWNED); - mtx_lock(&xbb->lock); - wake_thread = xbb->flags & XBBF_RESOURCE_SHORTAGE; - xbb->flags &= ~XBBF_RESOURCE_SHORTAGE; - SLIST_INSERT_HEAD(&xbb->request_free_slist, req, links); + STAILQ_INSERT_HEAD(&xbb->request_free_stailq, req, links); xbb->active_request_count--; - if ((xbb->flags & XBBF_SHUTDOWN) != 0) { - /* - * Shutdown is in progress. See if we can - * progress further now that one more request - * has completed and been returned to the - * free pool. - */ - xbb_shutdown(xbb); - } - mtx_unlock(&xbb->lock); + KASSERT(xbb->active_request_count >= 0, + ("xbb_release_req: negative active count")); +} - if (wake_thread != 0) - taskqueue_enqueue(xbb->io_taskqueue, &xbb->io_task); +/** + * Return an xbb_xen_req_list of allocated xbb_xen_reqs to the free pool. + * + * \param xbb Per-instance xbb configuration structure. + * \param req_list The list of requests to free. + * \param nreqs The number of items in the list. + */ +static inline void +xbb_release_reqs(struct xbb_softc *xbb, struct xbb_xen_req_list *req_list, + int nreqs) +{ + mtx_assert(&xbb->lock, MA_OWNED); + + STAILQ_CONCAT(&xbb->request_free_stailq, req_list); + xbb->active_request_count -= nreqs; + + KASSERT(xbb->active_request_count >= 0, + ("xbb_release_reqs: negative active count")); } /** * Given a page index and 512b sector offset within that page, * calculate an offset into a request's kva region. * - * \param req The request structure whose kva region will be accessed. + * \param reqlist The request structure whose kva region will be accessed. * \param pagenr The page index used to compute the kva offset. * \param sector The 512b sector index used to compute the page relative * kva offset. @@ -695,9 +883,9 @@ xbb_release_req(struct xbb_softc *xbb, s * \return The computed global KVA offset. */ static inline uint8_t * -xbb_req_vaddr(struct xbb_xen_req *req, int pagenr, int sector) +xbb_reqlist_vaddr(struct xbb_xen_reqlist *reqlist, int pagenr, int sector) { - return (req->kva + (PAGE_SIZE * pagenr) + (sector << 9)); + return (reqlist->kva + (PAGE_SIZE * pagenr) + (sector << 9)); } #ifdef XBB_USE_BOUNCE_BUFFERS @@ -705,7 +893,7 @@ xbb_req_vaddr(struct xbb_xen_req *req, i * Given a page index and 512b sector offset within that page, * calculate an offset into a request's local bounce memory region. * - * \param req The request structure whose bounce region will be accessed. + * \param reqlist The request structure whose bounce region will be accessed. * \param pagenr The page index used to compute the bounce offset. * \param sector The 512b sector index used to compute the page relative * bounce offset. @@ -713,9 +901,9 @@ xbb_req_vaddr(struct xbb_xen_req *req, i * \return The computed global bounce buffer address. */ static inline uint8_t * -xbb_req_bounce_addr(struct xbb_xen_req *req, int pagenr, int sector) +xbb_reqlist_bounce_addr(struct xbb_xen_reqlist *reqlist, int pagenr, int sector) { - return (req->bounce + (PAGE_SIZE * pagenr) + (sector << 9)); + return (reqlist->bounce + (PAGE_SIZE * pagenr) + (sector << 9)); } #endif @@ -724,7 +912,7 @@ xbb_req_bounce_addr(struct xbb_xen_req * * calculate an offset into the request's memory region that the * underlying backend device/file should use for I/O. * - * \param req The request structure whose I/O region will be accessed. + * \param reqlist The request structure whose I/O region will be accessed. * \param pagenr The page index used to compute the I/O offset. * \param sector The 512b sector index used to compute the page relative * I/O offset. @@ -736,12 +924,12 @@ xbb_req_bounce_addr(struct xbb_xen_req * * this request. */ static inline uint8_t * -xbb_req_ioaddr(struct xbb_xen_req *req, int pagenr, int sector) +xbb_reqlist_ioaddr(struct xbb_xen_reqlist *reqlist, int pagenr, int sector) { #ifdef XBB_USE_BOUNCE_BUFFERS - return (xbb_req_bounce_addr(req, pagenr, sector)); + return (xbb_reqlist_bounce_addr(reqlist, pagenr, sector)); #else - return (xbb_req_vaddr(req, pagenr, sector)); + return (xbb_reqlist_vaddr(reqlist, pagenr, sector)); #endif } @@ -750,7 +938,7 @@ xbb_req_ioaddr(struct xbb_xen_req *req, * an offset into the local psuedo-physical address space used to map a * front-end's request data into a request. * - * \param req The request structure whose pseudo-physical region + * \param reqlist The request list structure whose pseudo-physical region * will be accessed. * \param pagenr The page index used to compute the pseudo-physical offset. * \param sector The 512b sector index used to compute the page relative @@ -763,10 +951,126 @@ xbb_req_ioaddr(struct xbb_xen_req *req, * this request. */ static inline uintptr_t -xbb_req_gntaddr(struct xbb_xen_req *req, int pagenr, int sector) +xbb_get_gntaddr(struct xbb_xen_reqlist *reqlist, int pagenr, int sector) +{ + struct xbb_softc *xbb; + + xbb = reqlist->xbb; + + return ((uintptr_t)(xbb->gnt_base_addr + + (uintptr_t)(reqlist->kva - xbb->kva) + + (PAGE_SIZE * pagenr) + (sector << 9))); +} + +/** + * Get Kernel Virtual Address space for mapping requests. + * + * \param xbb Per-instance xbb configuration structure. + * \param nr_pages Number of pages needed. + * \param check_only If set, check for free KVA but don't allocate it. + * \param have_lock If set, xbb lock is already held. + * + * \return On success, a pointer to the allocated KVA region. Otherwise NULL. + * + * Note: This should be unnecessary once we have either chaining or + * scatter/gather support for struct bio. At that point we'll be able to + * put multiple addresses and lengths in one bio/bio chain and won't need + * to map everything into one virtual segment. + */ +static uint8_t * +xbb_get_kva(struct xbb_softc *xbb, int nr_pages) +{ + intptr_t first_clear, num_clear; + uint8_t *free_kva; + int i; + + KASSERT(nr_pages != 0, ("xbb_get_kva of zero length")); + + first_clear = 0; + free_kva = NULL; + + mtx_lock(&xbb->lock); + + /* + * Look for the first available page. If there are none, we're done. + */ + bit_ffc(xbb->kva_free, xbb->reqlist_kva_pages, &first_clear); + + if (first_clear == -1) + goto bailout; + + /* + * Starting at the first available page, look for consecutive free + * pages that will satisfy the user's request. + */ + for (i = first_clear, num_clear = 0; i < xbb->reqlist_kva_pages; i++) { + /* + * If this is true, the page is used, so we have to reset + * the number of clear pages and the first clear page + * (since it pointed to a region with an insufficient number + * of clear pages). + */ + if (bit_test(xbb->kva_free, i)) { + num_clear = 0; + first_clear = -1; + continue; + } + + if (first_clear == -1) + first_clear = i; + + /* + * If this is true, we've found a large enough free region + * to satisfy the request. + */ + if (++num_clear == nr_pages) { + + bit_nset(xbb->kva_free, first_clear, + first_clear + nr_pages - 1); + + free_kva = xbb->kva + + (uint8_t *)(first_clear * PAGE_SIZE); + + KASSERT(free_kva >= (uint8_t *)xbb->kva && + free_kva + (nr_pages * PAGE_SIZE) <= + (uint8_t *)xbb->ring_config.va, + ("Free KVA %p len %d out of range, " + "kva = %#jx, ring VA = %#jx\n", free_kva, + nr_pages * PAGE_SIZE, (uintmax_t)xbb->kva, + (uintmax_t)xbb->ring_config.va)); + break; + } + } + +bailout: + + if (free_kva == NULL) { + xbb->flags |= XBBF_RESOURCE_SHORTAGE; + xbb->kva_shortages++; + } + + mtx_unlock(&xbb->lock); + + return (free_kva); +} + +/** + * Free allocated KVA. + * + * \param xbb Per-instance xbb configuration structure. + * \param kva_ptr Pointer to allocated KVA region. + * \param nr_pages Number of pages in the KVA region. + */ +static void +xbb_free_kva(struct xbb_softc *xbb, uint8_t *kva_ptr, int nr_pages) { - return ((uintptr_t)(req->gnt_base - + (PAGE_SIZE * pagenr) + (sector << 9))); + intptr_t start_page; + + mtx_assert(&xbb->lock, MA_OWNED); + + start_page = (intptr_t)(kva_ptr - xbb->kva) >> PAGE_SHIFT; + bit_nclear(xbb->kva_free, start_page, start_page + nr_pages - 1); + } /** @@ -775,23 +1079,23 @@ xbb_req_gntaddr(struct xbb_xen_req *req, * \param req The request structure to unmap. */ static void -xbb_unmap_req(struct xbb_xen_req *req) +xbb_unmap_reqlist(struct xbb_xen_reqlist *reqlist) { - struct gnttab_unmap_grant_ref unmap[XBB_MAX_SEGMENTS_PER_REQUEST]; + struct gnttab_unmap_grant_ref unmap[XBB_MAX_SEGMENTS_PER_REQLIST]; u_int i; u_int invcount; int error; invcount = 0; - for (i = 0; i < req->nr_pages; i++) { + for (i = 0; i < reqlist->nr_segments; i++) { - if (req->gnt_handles[i] == GRANT_REF_INVALID) + if (reqlist->gnt_handles[i] == GRANT_REF_INVALID) continue; - unmap[invcount].host_addr = xbb_req_gntaddr(req, i, 0); + unmap[invcount].host_addr = xbb_get_gntaddr(reqlist, i, 0); unmap[invcount].dev_bus_addr = 0; - unmap[invcount].handle = req->gnt_handles[i]; - req->gnt_handles[i] = GRANT_REF_INVALID; + unmap[invcount].handle = reqlist->gnt_handles[i]; + reqlist->gnt_handles[i] = GRANT_REF_INVALID; invcount++; } @@ -801,6 +1105,175 @@ xbb_unmap_req(struct xbb_xen_req *req) } /** + * Allocate an internal transaction tracking structure from the free pool. + * + * \param xbb Per-instance xbb configuration structure. + * + * \return On success, a pointer to the allocated xbb_xen_reqlist structure. + * Otherwise NULL. + */ +static inline struct xbb_xen_reqlist * +xbb_get_reqlist(struct xbb_softc *xbb) +{ + struct xbb_xen_reqlist *reqlist; + + reqlist = NULL; + + mtx_assert(&xbb->lock, MA_OWNED); + + if ((reqlist = STAILQ_FIRST(&xbb->reqlist_free_stailq)) != NULL) { + + STAILQ_REMOVE_HEAD(&xbb->reqlist_free_stailq, links); + reqlist->flags = XBB_REQLIST_NONE; + reqlist->kva = NULL; + reqlist->status = BLKIF_RSP_OKAY; + reqlist->residual_512b_sectors = 0; + reqlist->num_children = 0; + reqlist->nr_segments = 0; + STAILQ_INIT(&reqlist->contig_req_list); + } + + return (reqlist); +} + +/** + * Return an allocated transaction tracking structure to the free pool. + * + * \param xbb Per-instance xbb configuration structure. + * \param req The request list structure to free. + * \param wakeup If set, wakeup the work thread if freeing this reqlist + * during a resource shortage condition. + */ +static inline void +xbb_release_reqlist(struct xbb_softc *xbb, struct xbb_xen_reqlist *reqlist, + int wakeup) +{ + + mtx_lock(&xbb->lock); + + if (wakeup) { + wakeup = xbb->flags & XBBF_RESOURCE_SHORTAGE; + xbb->flags &= ~XBBF_RESOURCE_SHORTAGE; + } + + if (reqlist->kva != NULL) + xbb_free_kva(xbb, reqlist->kva, reqlist->nr_segments); + + xbb_release_reqs(xbb, &reqlist->contig_req_list, reqlist->num_children); + + STAILQ_INSERT_TAIL(&xbb->reqlist_free_stailq, reqlist, links); + + if ((xbb->flags & XBBF_SHUTDOWN) != 0) { + /* + * Shutdown is in progress. See if we can + * progress further now that one more request + * has completed and been returned to the + * free pool. + */ + xbb_shutdown(xbb); + } + + mtx_unlock(&xbb->lock); + + if (wakeup != 0) + taskqueue_enqueue(xbb->io_taskqueue, &xbb->io_task); +} + +/** + * Request resources and do basic request setup. + * + * \param xbb Per-instance xbb configuration structure. + * \param reqlist Pointer to reqlist pointer. + * \param ring_req Pointer to a block ring request. + * \param ring_index The ring index of this request. + * + * \return 0 for success, non-zero for failure. + */ +static int +xbb_get_resources(struct xbb_softc *xbb, struct xbb_xen_reqlist **reqlist, + blkif_request_t *ring_req, RING_IDX ring_idx) +{ + struct xbb_xen_reqlist *nreqlist; + struct xbb_xen_req *nreq; + + nreqlist = NULL; + nreq = NULL; + + mtx_lock(&xbb->lock); + + /* + * We don't allow new resources to be allocated if we're in the + * process of shutting down. + */ + if ((xbb->flags & XBBF_SHUTDOWN) != 0) { + mtx_unlock(&xbb->lock); + return (1); + } + + /* + * Allocate a reqlist if the caller doesn't have one already. + */ + if (*reqlist == NULL) { + nreqlist = xbb_get_reqlist(xbb); + if (nreqlist == NULL) + goto bailout_error; + } + + /* We always allocate a request. */ + nreq = xbb_get_req(xbb); + if (nreq == NULL) + goto bailout_error; + + mtx_unlock(&xbb->lock); + + if (*reqlist == NULL) { + *reqlist = nreqlist; + nreqlist->operation = ring_req->operation; + nreqlist->starting_sector_number = ring_req->sector_number; + STAILQ_INSERT_TAIL(&xbb->reqlist_pending_stailq, nreqlist, + links); + } + + nreq->reqlist = *reqlist; + nreq->req_ring_idx = ring_idx; + + if (xbb->abi != BLKIF_PROTOCOL_NATIVE) { + bcopy(ring_req, &nreq->ring_req_storage, sizeof(*ring_req)); + nreq->ring_req = &nreq->ring_req_storage; + } else { + nreq->ring_req = ring_req; + } + + binuptime(&nreq->ds_t0); + devstat_start_transaction(xbb->xbb_stats_in, &nreq->ds_t0); + STAILQ_INSERT_TAIL(&(*reqlist)->contig_req_list, nreq, links); + (*reqlist)->num_children++; + (*reqlist)->nr_segments += ring_req->nr_segments; + + return (0); + +bailout_error: + + /* + * We're out of resources, so set the shortage flag. The next time + * a request is released, we'll try waking up the work thread to + * see if we can allocate more resources. + */ + xbb->flags |= XBBF_RESOURCE_SHORTAGE; + xbb->request_shortages++; + + if (nreq != NULL) + xbb_release_req(xbb, nreq); + + mtx_unlock(&xbb->lock); + + if (nreqlist != NULL) + xbb_release_reqlist(xbb, nreqlist, /*wakeup*/ 0); + + return (1); +} + +/** * Create and transmit a response to a blkif request. * * \param xbb Per-instance xbb configuration structure. @@ -862,6 +1335,8 @@ xbb_send_response(struct xbb_softc *xbb, more_to_do = 1; } + xbb->reqs_completed++; + mtx_unlock(&xbb->lock); if (more_to_do) @@ -872,6 +1347,70 @@ xbb_send_response(struct xbb_softc *xbb, } /** + * Complete a request list. + * + * \param xbb Per-instance xbb configuration structure. + * \param reqlist Allocated internal request list structure. + */ +static void +xbb_complete_reqlist(struct xbb_softc *xbb, struct xbb_xen_reqlist *reqlist) +{ + struct xbb_xen_req *nreq; + off_t sectors_sent; + + sectors_sent = 0; + + if (reqlist->flags & XBB_REQLIST_MAPPED) + xbb_unmap_reqlist(reqlist); + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Jun 13 21:03:27 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DFCB71065670; Mon, 13 Jun 2011 21:03:27 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CDED48FC0C; Mon, 13 Jun 2011 21:03:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5DL3RoK098595; Mon, 13 Jun 2011 21:03:27 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5DL3Rj4098571; Mon, 13 Jun 2011 21:03:27 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201106132103.p5DL3Rj4098571@svn.freebsd.org> From: Jilles Tjoelker Date: Mon, 13 Jun 2011 21:03:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223060 - in head/bin/sh: . bltin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2011 21:03:28 -0000 Author: jilles Date: Mon Jun 13 21:03:27 2011 New Revision: 223060 URL: http://svn.freebsd.org/changeset/base/223060 Log: sh: Fix duplicate prototypes for builtins. Have mkbuiltins write the prototypes for the *cmd functions to builtins.h instead of builtins.c and include builtins.h in more .c files instead of duplicating prototypes for *cmd functions in other headers. Modified: head/bin/sh/alias.c head/bin/sh/alias.h head/bin/sh/arith.h head/bin/sh/bltin/bltin.h head/bin/sh/cd.c head/bin/sh/cd.h head/bin/sh/eval.h head/bin/sh/exec.h head/bin/sh/expand.c head/bin/sh/expand.h head/bin/sh/histedit.c head/bin/sh/jobs.c head/bin/sh/jobs.h head/bin/sh/main.c head/bin/sh/main.h head/bin/sh/mkbuiltins head/bin/sh/myhistedit.h head/bin/sh/options.c head/bin/sh/options.h head/bin/sh/trap.c head/bin/sh/trap.h head/bin/sh/var.c head/bin/sh/var.h Modified: head/bin/sh/alias.c ============================================================================== --- head/bin/sh/alias.c Mon Jun 13 20:36:29 2011 (r223059) +++ head/bin/sh/alias.c Mon Jun 13 21:03:27 2011 (r223060) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include "mystring.h" #include "alias.h" #include "options.h" /* XXX for argptr (should remove?) */ +#include "builtins.h" #define ATABSIZE 39 Modified: head/bin/sh/alias.h ============================================================================== --- head/bin/sh/alias.h Mon Jun 13 20:36:29 2011 (r223059) +++ head/bin/sh/alias.h Mon Jun 13 21:03:27 2011 (r223060) @@ -43,5 +43,3 @@ struct alias { }; struct alias *lookupalias(const char *, int); -int aliascmd(int, char **); -int unaliascmd(int, char **); Modified: head/bin/sh/arith.h ============================================================================== --- head/bin/sh/arith.h Mon Jun 13 20:36:29 2011 (r223059) +++ head/bin/sh/arith.h Mon Jun 13 21:03:27 2011 (r223060) @@ -36,4 +36,3 @@ arith_t arith(const char *); void arith_lex_reset(void); -int expcmd(int, char **); Modified: head/bin/sh/bltin/bltin.h ============================================================================== --- head/bin/sh/bltin/bltin.h Mon Jun 13 20:36:29 2011 (r223059) +++ head/bin/sh/bltin/bltin.h Mon Jun 13 21:03:27 2011 (r223060) @@ -43,6 +43,7 @@ #include "../mystring.h" #ifdef SHELL #include "../output.h" +#include "builtins.h" #define FILE struct output #undef stdout #define stdout out1 @@ -75,7 +76,4 @@ pointer stalloc(int); void error(const char *, ...) __printf0like(1, 2); pid_t getjobpgrp(char *); -int echocmd(int, char **); -int testcmd(int, char **); - extern char *commandname; Modified: head/bin/sh/cd.c ============================================================================== --- head/bin/sh/cd.c Mon Jun 13 20:36:29 2011 (r223059) +++ head/bin/sh/cd.c Mon Jun 13 21:03:27 2011 (r223060) @@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$"); #include "mystring.h" #include "show.h" #include "cd.h" +#include "builtins.h" static int cdlogical(char *); static int cdphysical(char *); Modified: head/bin/sh/cd.h ============================================================================== --- head/bin/sh/cd.h Mon Jun 13 20:36:29 2011 (r223059) +++ head/bin/sh/cd.h Mon Jun 13 21:03:27 2011 (r223060) @@ -30,5 +30,3 @@ */ void pwd_init(int); -int cdcmd (int, char **); -int pwdcmd(int, char **); Modified: head/bin/sh/eval.h ============================================================================== --- head/bin/sh/eval.h Mon Jun 13 20:36:29 2011 (r223059) +++ head/bin/sh/eval.h Mon Jun 13 21:03:27 2011 (r223060) @@ -51,19 +51,10 @@ struct backcmd { /* result of evalbackc #define EV_TESTED 02 /* exit status is checked; ignore -e flag */ #define EV_BACKCMD 04 /* command executing within back quotes */ -int evalcmd(int, char **); void evalstring(char *, int); union node; /* BLETCH for ansi C */ void evaltree(union node *, int); void evalbackcmd(union node *, struct backcmd *); -int bltincmd(int, char **); -int breakcmd(int, char **); -int returncmd(int, char **); -int falsecmd(int, char **); -int truecmd(int, char **); -int execcmd(int, char **); -int timescmd(int, char **); -int commandcmd(int, char **); /* in_function returns nonzero if we are currently evaluating a function */ #define in_function() funcnest Modified: head/bin/sh/exec.h ============================================================================== --- head/bin/sh/exec.h Mon Jun 13 20:36:29 2011 (r223059) +++ head/bin/sh/exec.h Mon Jun 13 21:03:27 2011 (r223060) @@ -66,7 +66,6 @@ extern int exerrno; /* last exec error void shellexec(char **, char **, const char *, int) __dead2; char *padvance(const char **, const char *); -int hashcmd(int, char **); void find_command(const char *, struct cmdentry *, int, const char *); int find_builtin(const char *, int *); void hashcd(void); @@ -75,5 +74,4 @@ void addcmdentry(const char *, struct cm void defun(const char *, union node *); int unsetfunc(const char *); int typecmd_impl(int, char **, int, const char *); -int typecmd(int, char **); void clearcmdentry(void); Modified: head/bin/sh/expand.c ============================================================================== --- head/bin/sh/expand.c Mon Jun 13 20:36:29 2011 (r223059) +++ head/bin/sh/expand.c Mon Jun 13 21:03:27 2011 (r223060) @@ -76,6 +76,7 @@ __FBSDID("$FreeBSD$"); #include "mystring.h" #include "arith.h" #include "show.h" +#include "builtins.h" /* * Structure specifying which parts of the string should be searched Modified: head/bin/sh/expand.h ============================================================================== --- head/bin/sh/expand.h Mon Jun 13 20:36:29 2011 (r223059) +++ head/bin/sh/expand.h Mon Jun 13 21:03:27 2011 (r223060) @@ -63,4 +63,3 @@ void expari(int); int patmatch(const char *, const char *, int); void rmescapes(char *); int casematch(union node *, const char *); -int wordexpcmd(int, char **); Modified: head/bin/sh/histedit.c ============================================================================== --- head/bin/sh/histedit.c Mon Jun 13 20:36:29 2011 (r223059) +++ head/bin/sh/histedit.c Mon Jun 13 21:03:27 2011 (r223060) @@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$"); #include "error.h" #include "eval.h" #include "memalloc.h" +#include "builtins.h" #define MAXHISTLOOPS 4 /* max recursions through fc */ #define DEFEDITOR "ed" /* default editor *should* be $EDITOR */ Modified: head/bin/sh/jobs.c ============================================================================== --- head/bin/sh/jobs.c Mon Jun 13 20:36:29 2011 (r223059) +++ head/bin/sh/jobs.c Mon Jun 13 21:03:27 2011 (r223060) @@ -71,6 +71,7 @@ __FBSDID("$FreeBSD$"); #include "error.h" #include "mystring.h" #include "var.h" +#include "builtins.h" static struct job *jobtab; /* array of jobs */ Modified: head/bin/sh/jobs.h ============================================================================== --- head/bin/sh/jobs.h Mon Jun 13 20:36:29 2011 (r223059) +++ head/bin/sh/jobs.h Mon Jun 13 21:03:27 2011 (r223060) @@ -88,12 +88,7 @@ extern int in_dowait; /* are we in dowa extern volatile sig_atomic_t breakwaitcmd; /* break wait to process traps? */ void setjobctl(int); -int fgcmd(int, char **); -int bgcmd(int, char **); -int jobscmd(int, char **); void showjobs(int, int); -int waitcmd(int, char **); -int jobidcmd(int, char **); struct job *makejob(union node *, int); pid_t forkshell(struct job *, union node *, int); int waitforjob(struct job *, int *); Modified: head/bin/sh/main.c ============================================================================== --- head/bin/sh/main.c Mon Jun 13 20:36:29 2011 (r223059) +++ head/bin/sh/main.c Mon Jun 13 21:03:27 2011 (r223060) @@ -72,6 +72,7 @@ __FBSDID("$FreeBSD$"); #include "mystring.h" #include "exec.h" #include "cd.h" +#include "builtins.h" int rootpid; int rootshell; Modified: head/bin/sh/main.h ============================================================================== --- head/bin/sh/main.h Mon Jun 13 20:36:29 2011 (r223059) +++ head/bin/sh/main.h Mon Jun 13 21:03:27 2011 (r223060) @@ -39,5 +39,3 @@ extern struct jmploc main_handler; /* to void readcmdfile(const char *); void cmdloop(int); -int dotcmd(int, char **); -int exitcmd(int, char **); Modified: head/bin/sh/mkbuiltins ============================================================================== --- head/bin/sh/mkbuiltins Mon Jun 13 20:36:29 2011 (r223059) +++ head/bin/sh/mkbuiltins Mon Jun 13 21:03:27 2011 (r223060) @@ -58,9 +58,7 @@ cat <<\! ! awk '/^[^#]/ {if(('$havejobs' || $2 != "-j") && ('$havehist' || $2 != "-h")) \ print $0}' builtins.def | sed 's/-[hj]//' > $temp -awk '{ printf "int %s(int, char **);\n", $1}' $temp -echo ' -int (*const builtinfunc[])(int, char **) = {' +echo 'int (*const builtinfunc[])(int, char **) = {' awk '/^[^#]/ { printf "\t%s,\n", $1}' $temp echo '}; @@ -94,5 +92,7 @@ struct builtincmd { }; extern int (*const builtinfunc[])(int, char **); -extern const struct builtincmd builtincmd[];' +extern const struct builtincmd builtincmd[]; +' +awk '{ printf "int %s(int, char **);\n", $1}' $temp rm -f $temp Modified: head/bin/sh/myhistedit.h ============================================================================== --- head/bin/sh/myhistedit.h Mon Jun 13 20:36:29 2011 (r223059) +++ head/bin/sh/myhistedit.h Mon Jun 13 21:03:27 2011 (r223060) @@ -39,8 +39,6 @@ extern int displayhist; void histedit(void); void sethistsize(const char *); void setterm(const char *); -int histcmd(int, char **); int not_fcnumber(const char *); int str_to_event(const char *, int); -int bindcmd(int, char **); Modified: head/bin/sh/options.c ============================================================================== --- head/bin/sh/options.c Mon Jun 13 20:36:29 2011 (r223059) +++ head/bin/sh/options.c Mon Jun 13 21:03:27 2011 (r223060) @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include "memalloc.h" #include "error.h" #include "mystring.h" +#include "builtins.h" #ifndef NO_HISTORY #include "myhistedit.h" #endif Modified: head/bin/sh/options.h ============================================================================== --- head/bin/sh/options.h Mon Jun 13 20:36:29 2011 (r223059) +++ head/bin/sh/options.h Mon Jun 13 21:03:27 2011 (r223060) @@ -108,8 +108,5 @@ void procargs(int, char **); void optschanged(void); void setparam(char **); void freeparam(struct shparam *); -int shiftcmd(int, char **); -int setcmd(int, char **); -int getoptscmd(int, char **); int nextopt(const char *); void getoptsreset(const char *); Modified: head/bin/sh/trap.c ============================================================================== --- head/bin/sh/trap.c Mon Jun 13 20:36:29 2011 (r223059) +++ head/bin/sh/trap.c Mon Jun 13 21:03:27 2011 (r223060) @@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$"); #include "error.h" #include "trap.h" #include "mystring.h" +#include "builtins.h" #include "myhistedit.h" Modified: head/bin/sh/trap.h ============================================================================== --- head/bin/sh/trap.h Mon Jun 13 20:36:29 2011 (r223059) +++ head/bin/sh/trap.h Mon Jun 13 21:03:27 2011 (r223060) @@ -37,7 +37,6 @@ extern int pendingsigs; extern int in_dotrap; extern volatile sig_atomic_t gotwinch; -int trapcmd(int, char **); void clear_traps(void); int have_traps(void); void setsignal(int); Modified: head/bin/sh/var.c ============================================================================== --- head/bin/sh/var.c Mon Jun 13 20:36:29 2011 (r223059) +++ head/bin/sh/var.c Mon Jun 13 21:03:27 2011 (r223060) @@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$"); #include "error.h" #include "mystring.h" #include "parser.h" +#include "builtins.h" #ifndef NO_HISTORY #include "myhistedit.h" #endif Modified: head/bin/sh/var.h ============================================================================== --- head/bin/sh/var.h Mon Jun 13 20:36:29 2011 (r223059) +++ head/bin/sh/var.h Mon Jun 13 21:03:27 2011 (r223060) @@ -123,11 +123,7 @@ void updatecharset(void); void initcharset(void); char **environment(void); int showvarscmd(int, char **); -int exportcmd(int, char **); -int localcmd(int, char **); void mklocal(char *); void poplocalvars(void); -int setvarcmd(int, char **); -int unsetcmd(int, char **); int unsetvar(const char *); int setvarsafe(const char *, const char *, int); From owner-svn-src-head@FreeBSD.ORG Mon Jun 13 21:21:03 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 08557106564A; Mon, 13 Jun 2011 21:21:03 +0000 (UTC) (envelope-from gibbs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D2D8C8FC15; Mon, 13 Jun 2011 21:21:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5DLL2K3099155; Mon, 13 Jun 2011 21:21:02 GMT (envelope-from gibbs@svn.freebsd.org) Received: (from gibbs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5DLL2Fp099153; Mon, 13 Jun 2011 21:21:02 GMT (envelope-from gibbs@svn.freebsd.org) Message-Id: <201106132121.p5DLL2Fp099153@svn.freebsd.org> From: "Justin T. Gibbs" Date: Mon, 13 Jun 2011 21:21:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223061 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2011 21:21:03 -0000 Author: gibbs Date: Mon Jun 13 21:21:02 2011 New Revision: 223061 URL: http://svn.freebsd.org/changeset/base/223061 Log: Fix a couple of race conditions in devstat(9) initialization. In devstat_new_entry(), there is no need to initialize the queue and the mutex in this function. There are ways to do static initialization on both, so use STAILQ_HEAD_INITIALIZER and MTX_SYSINIT to initialize the queue and the mutex. In devstat_alloc(), use an atomic test and set routine to guard making our entry in /dev. Using just a plain static variable creates a race condition on multiprocessor machines. If you attempt to create a second entry in devfs, the kernel will panic. Submitted by: kdm Reviewed by: gibbs Sponsored by: Spectra Logic Corporation MFC after: 1 week. Modified: head/sys/kern/subr_devstat.c Modified: head/sys/kern/subr_devstat.c ============================================================================== --- head/sys/kern/subr_devstat.c Mon Jun 13 21:03:27 2011 (r223060) +++ head/sys/kern/subr_devstat.c Mon Jun 13 21:21:02 2011 (r223061) @@ -49,8 +49,9 @@ static long devstat_generation = 1; static int devstat_version = DEVSTAT_VERSION; static int devstat_current_devnumber; static struct mtx devstat_mutex; +MTX_SYSINIT(devstat_mutex, &devstat_mutex, "devstat", MTX_DEF); -static struct devstatlist device_statq; +static struct devstatlist device_statq = STAILQ_HEAD_INITIALIZER(device_statq); static struct devstat *devstat_alloc(void); static void devstat_free(struct devstat *); static void devstat_add_entry(struct devstat *ds, const void *dev_name, @@ -70,13 +71,7 @@ devstat_new_entry(const void *dev_name, devstat_priority priority) { struct devstat *ds; - static int once; - if (!once) { - STAILQ_INIT(&device_statq); - mtx_init(&devstat_mutex, "devstat", NULL, MTX_DEF); - once = 1; - } mtx_assert(&devstat_mutex, MA_NOTOWNED); ds = devstat_alloc(); @@ -475,10 +470,9 @@ devstat_alloc(void) static int once; mtx_assert(&devstat_mutex, MA_NOTOWNED); - if (!once) { + if (!once && atomic_cmpset_int(&once, 0, 1)) { make_dev_credf(MAKEDEV_ETERNAL, &devstat_cdevsw, 0, NULL, UID_ROOT, GID_WHEEL, 0400, DEVSTAT_DEVICE_NAME); - once = 1; } spp2 = NULL; mtx_lock(&devstat_mutex); From owner-svn-src-head@FreeBSD.ORG Mon Jun 13 21:31:55 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CBDD7106564A; Mon, 13 Jun 2011 21:31:55 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 42B0D8FC0C; Mon, 13 Jun 2011 21:31:54 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id p5DLVopn005593 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 14 Jun 2011 00:31:50 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id p5DLVoot057620; Tue, 14 Jun 2011 00:31:50 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id p5DLVo1x057619; Tue, 14 Jun 2011 00:31:50 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 14 Jun 2011 00:31:50 +0300 From: Kostik Belousov To: "Justin T. Gibbs" Message-ID: <20110613213150.GC48734@deviant.kiev.zoral.com.ua> References: <201106132121.p5DLL2Fp099153@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="KCLJDKHmrU6/EDiO" Content-Disposition: inline In-Reply-To: <201106132121.p5DLL2Fp099153@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223061 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2011 21:31:55 -0000 --KCLJDKHmrU6/EDiO Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jun 13, 2011 at 09:21:02PM +0000, Justin T. Gibbs wrote: > Author: gibbs > Date: Mon Jun 13 21:21:02 2011 > New Revision: 223061 > URL: http://svn.freebsd.org/changeset/base/223061 >=20 > Log: > Fix a couple of race conditions in devstat(9) initialization. > =20 > In devstat_new_entry(), there is no need to initialize the queue > and the mutex in this function. There are ways to do static > initialization on both, so use STAILQ_HEAD_INITIALIZER and > MTX_SYSINIT to initialize the queue and the mutex. > =20 > In devstat_alloc(), use an atomic test and set routine to guard > making our entry in /dev. Using just a plain static variable > creates a race condition on multiprocessor machines. If you > attempt to create a second entry in devfs, the kernel will panic. Devfs returns an error if MAKEDEV_CHECKNAME flag is supplied and attempt is made to create the existing node. The static guard is still useful, since make_dev() call is costly, but you can remove the atomic, since the race should be of limited scope. --KCLJDKHmrU6/EDiO Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk32gcYACgkQC3+MBN1Mb4j2AwCdG+xcxM5g23Quq4ZSM+zqvkYF BZcAoOWLa7gs2VQMuVGQXU5x3BJwumQF =0ZGG -----END PGP SIGNATURE----- --KCLJDKHmrU6/EDiO-- From owner-svn-src-head@FreeBSD.ORG Mon Jun 13 22:08:24 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A1785106566C; Mon, 13 Jun 2011 22:08:24 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 918308FC13; Mon, 13 Jun 2011 22:08:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5DM8OQ7000932; Mon, 13 Jun 2011 22:08:24 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5DM8OZ1000930; Mon, 13 Jun 2011 22:08:24 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201106132208.p5DM8OZ1000930@svn.freebsd.org> From: "Kenneth D. Merry" Date: Mon, 13 Jun 2011 22:08:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223062 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2011 22:08:24 -0000 Author: ken Date: Mon Jun 13 22:08:24 2011 New Revision: 223062 URL: http://svn.freebsd.org/changeset/base/223062 Log: Instead of using an atomic operation to determine whether the devstat(9) device node has been created, pass MAKEDEV_CHECKNAME in so that the devfs code will do the check. Use a regular static variable as before, that's good enough to keep us from calling into devfs most of the time. Suggested by: kib MFC after: 1 week Sponsored by: Spectra Logic Corporation Modified: head/sys/kern/subr_devstat.c Modified: head/sys/kern/subr_devstat.c ============================================================================== --- head/sys/kern/subr_devstat.c Mon Jun 13 21:21:02 2011 (r223061) +++ head/sys/kern/subr_devstat.c Mon Jun 13 22:08:24 2011 (r223062) @@ -470,9 +470,11 @@ devstat_alloc(void) static int once; mtx_assert(&devstat_mutex, MA_NOTOWNED); - if (!once && atomic_cmpset_int(&once, 0, 1)) { - make_dev_credf(MAKEDEV_ETERNAL, &devstat_cdevsw, 0, NULL, - UID_ROOT, GID_WHEEL, 0400, DEVSTAT_DEVICE_NAME); + if (!once) { + make_dev_credf(MAKEDEV_ETERNAL | MAKEDEV_CHECKNAME, + &devstat_cdevsw, 0, NULL, UID_ROOT, GID_WHEEL, 0400, + DEVSTAT_DEVICE_NAME); + once = 1; } spp2 = NULL; mtx_lock(&devstat_mutex); From owner-svn-src-head@FreeBSD.ORG Mon Jun 13 22:09:53 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A82F41065675; Mon, 13 Jun 2011 22:09:53 +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 719B98FC14; Mon, 13 Jun 2011 22:09:53 +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 p5DM9q2b049010; Mon, 13 Jun 2011 16:09:52 -0600 (MDT) (envelope-from ken@nargothrond.kdm.org) Received: (from ken@localhost) by nargothrond.kdm.org (8.14.2/8.14.2/Submit) id p5DM9qmd049009; Mon, 13 Jun 2011 16:09:52 -0600 (MDT) (envelope-from ken) Date: Mon, 13 Jun 2011 16:09:52 -0600 From: "Kenneth D. Merry" To: Kostik Belousov Message-ID: <20110613220952.GA47928@nargothrond.kdm.org> References: <201106132121.p5DLL2Fp099153@svn.freebsd.org> <20110613213150.GC48734@deviant.kiev.zoral.com.ua> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110613213150.GC48734@deviant.kiev.zoral.com.ua> User-Agent: Mutt/1.4.2i Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, "Justin T. Gibbs" , src-committers@FreeBSD.org Subject: Re: svn commit: r223061 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2011 22:09:53 -0000 On Tue, Jun 14, 2011 at 00:31:50 +0300, Kostik Belousov wrote: > On Mon, Jun 13, 2011 at 09:21:02PM +0000, Justin T. Gibbs wrote: > > Author: gibbs > > Date: Mon Jun 13 21:21:02 2011 > > New Revision: 223061 > > URL: http://svn.freebsd.org/changeset/base/223061 > > > > Log: > > Fix a couple of race conditions in devstat(9) initialization. > > > > In devstat_new_entry(), there is no need to initialize the queue > > and the mutex in this function. There are ways to do static > > initialization on both, so use STAILQ_HEAD_INITIALIZER and > > MTX_SYSINIT to initialize the queue and the mutex. > > > > In devstat_alloc(), use an atomic test and set routine to guard > > making our entry in /dev. Using just a plain static variable > > creates a race condition on multiprocessor machines. If you > > attempt to create a second entry in devfs, the kernel will panic. > Devfs returns an error if MAKEDEV_CHECKNAME flag is supplied and > attempt is made to create the existing node. The static guard is > still useful, since make_dev() call is costly, but you can remove > the atomic, since the race should be of limited scope. Done, thanks for the suggestion! Ken -- Kenneth Merry ken@FreeBSD.org From owner-svn-src-head@FreeBSD.ORG Tue Jun 14 04:20:19 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 757F31065670; Tue, 14 Jun 2011 04:20:19 +0000 (UTC) (envelope-from gshapiro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6232B8FC0C; Tue, 14 Jun 2011 04:20:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5E4KJRx013112; Tue, 14 Jun 2011 04:20:19 GMT (envelope-from gshapiro@svn.freebsd.org) Received: (from gshapiro@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5E4KIiN013092; Tue, 14 Jun 2011 04:20:18 GMT (envelope-from gshapiro@svn.freebsd.org) Message-Id: <201106140420.p5E4KIiN013092@svn.freebsd.org> From: Gregory Neil Shapiro Date: Tue, 14 Jun 2011 04:20:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223067 - in head/contrib/sendmail: . cf/cf cf/feature cf/m4 cf/ostype contrib doc/op include/sm libmilter libmilter/docs libsm makemap src X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jun 2011 04:20:19 -0000 Author: gshapiro Date: Tue Jun 14 04:20:18 2011 New Revision: 223067 URL: http://svn.freebsd.org/changeset/base/223067 Log: Merge sendmail 8.14.5 to HEAD MFC after: 4 days Added: - copied unchanged from r223065, vendor/sendmail/dist/cf/ostype/solaris11.m4 Directory Properties: head/contrib/sendmail/cf/ostype/solaris11.m4 (props changed) Modified: head/contrib/sendmail/CACerts head/contrib/sendmail/KNOWNBUGS head/contrib/sendmail/LICENSE head/contrib/sendmail/PGPKEYS head/contrib/sendmail/RELEASE_NOTES head/contrib/sendmail/cf/cf/submit.cf head/contrib/sendmail/cf/feature/ldap_routing.m4 head/contrib/sendmail/cf/m4/cfhead.m4 head/contrib/sendmail/cf/m4/proto.m4 head/contrib/sendmail/cf/m4/version.m4 head/contrib/sendmail/contrib/qtool.pl head/contrib/sendmail/doc/op/op.me head/contrib/sendmail/include/sm/conf.h head/contrib/sendmail/libmilter/docs/overview.html head/contrib/sendmail/libmilter/docs/smfi_stop.html head/contrib/sendmail/libmilter/docs/xxfi_envrcpt.html head/contrib/sendmail/libmilter/engine.c head/contrib/sendmail/libmilter/sm_gethost.c head/contrib/sendmail/libmilter/worker.c head/contrib/sendmail/libsm/ldap.c head/contrib/sendmail/makemap/makemap.c head/contrib/sendmail/src/Makefile.m4 head/contrib/sendmail/src/conf.c head/contrib/sendmail/src/daemon.c head/contrib/sendmail/src/deliver.c head/contrib/sendmail/src/domain.c head/contrib/sendmail/src/envelope.c head/contrib/sendmail/src/err.c head/contrib/sendmail/src/main.c head/contrib/sendmail/src/map.c head/contrib/sendmail/src/mci.c head/contrib/sendmail/src/parseaddr.c head/contrib/sendmail/src/queue.c head/contrib/sendmail/src/readcf.c head/contrib/sendmail/src/sendmail.8 head/contrib/sendmail/src/sendmail.h head/contrib/sendmail/src/sm_resolve.c head/contrib/sendmail/src/srvrsmtp.c head/contrib/sendmail/src/tls.c head/contrib/sendmail/src/udb.c head/contrib/sendmail/src/usersmtp.c head/contrib/sendmail/src/version.c Directory Properties: head/contrib/sendmail/ (props changed) Modified: head/contrib/sendmail/CACerts ============================================================================== --- head/contrib/sendmail/CACerts Tue Jun 14 04:20:17 2011 (r223066) +++ head/contrib/sendmail/CACerts Tue Jun 14 04:20:18 2011 (r223067) @@ -1,4 +1,4 @@ -# $Id: CACerts,v 8.4 2009/06/26 05:46:10 ca Exp $ +# $Id: CACerts,v 8.5 2011/05/06 23:05:10 ca Exp $ # This file contains some CA certificates that are used to sign the # certificates of mail servers of members of the sendmail consortium # who may reply to questions etc sent to sendmail.org. @@ -9,73 +9,6 @@ Certificate: Data: Version: 3 (0x2) - Serial Number: 0 (0x0) - Signature Algorithm: md5WithRSAEncryption - Issuer: C=US, ST=Illinois, L=De Kalb, O=Northern Illinois University, OU=Computer Science, CN=Neil Rickert/emailAddress=rickert@cs.niu.edu - Validity - Not Before: May 12 00:40:50 2000 GMT - Not After : May 20 00:40:50 2010 GMT - Subject: C=US, ST=Illinois, L=De Kalb, O=Northern Illinois University, OU=Computer Science, CN=Neil Rickert/emailAddress=rickert@cs.niu.edu - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - RSA Public Key: (1024 bit) - Modulus (1024 bit): - 00:b1:1b:49:06:ef:3f:44:e0:93:ad:8c:a7:f7:21: - 7c:87:cb:da:35:f6:4b:a2:fd:8a:a0:07:5b:cc:6a: - 9b:89:33:fc:24:f5:b1:24:59:5a:25:50:fd:16:d7: - d4:bc:c7:04:1d:df:90:9b:5e:c3:a8:e9:8b:7d:a3: - 5d:9a:e9:7f:e5:2b:ea:15:a7:ad:ba:58:26:0a:11: - 49:4f:da:9a:67:7f:b0:a6:66:f4:27:b6:61:4e:3c: - c8:3e:a0:2f:6a:b4:0e:15:d6:39:f8:92:60:85:df: - a6:34:f3:fa:a4:a5:e4:47:49:e7:87:a4:a5:5c:8e: - 6a:2f:13:76:5f:29:f3:64:73 - Exponent: 65537 (0x10001) - X509v3 extensions: - X509v3 Subject Key Identifier: - B6:31:78:BB:7E:AA:4D:A1:5D:FD:A2:24:18:C6:90:5A:2D:2F:19:48 - X509v3 Authority Key Identifier: - keyid:B6:31:78:BB:7E:AA:4D:A1:5D:FD:A2:24:18:C6:90:5A:2D:2F:19:48 - DirName:/C=US/ST=Illinois/L=De Kalb/O=Northern Illinois University/OU=Computer Science/CN=Neil Rickert/emailAddress=rickert@cs.niu.edu - serial:00 - - X509v3 Basic Constraints: - CA:TRUE - Signature Algorithm: md5WithRSAEncryption - 60:69:23:65:97:51:5c:06:a4:42:cb:00:e7:9a:dc:39:70:c3: - d3:5d:bf:0f:e0:04:54:4d:d9:dc:12:57:12:6c:67:fd:5b:b0: - 39:63:ea:c4:12:65:51:bb:3d:f1:f7:25:b4:cd:0b:f6:5b:7a: - 61:25:ad:06:0a:01:55:dc:71:05:29:0d:73:e9:30:51:be:d3: - e1:b2:89:fc:0f:28:f7:06:75:96:1b:34:75:e0:07:e5:3b:b3: - 0b:28:24:e5:79:ea:55:39:e7:d2:ee:ec:63:b4:e4:c6:ee:cb: - 15:d0:c8:eb:3b:4f:36:10:a4:6a:c0:6b:03:e8:29:72:c7:a7: - 10:00 ------BEGIN CERTIFICATE----- -MIID5TCCA06gAwIBAgIBADANBgkqhkiG9w0BAQQFADCBrjELMAkGA1UEBhMCVVMx -ETAPBgNVBAgTCElsbGlub2lzMRAwDgYDVQQHEwdEZSBLYWxiMSUwIwYDVQQKExxO -b3J0aGVybiBJbGxpbm9pcyBVbml2ZXJzaXR5MRkwFwYDVQQLExBDb21wdXRlciBT -Y2llbmNlMRUwEwYDVQQDEwxOZWlsIFJpY2tlcnQxITAfBgkqhkiG9w0BCQEWEnJp -Y2tlcnRAY3Mubml1LmVkdTAeFw0wMDA1MTIwMDQwNTBaFw0xMDA1MjAwMDQwNTBa -MIGuMQswCQYDVQQGEwJVUzERMA8GA1UECBMISWxsaW5vaXMxEDAOBgNVBAcTB0Rl -IEthbGIxJTAjBgNVBAoTHE5vcnRoZXJuIElsbGlub2lzIFVuaXZlcnNpdHkxGTAX -BgNVBAsTEENvbXB1dGVyIFNjaWVuY2UxFTATBgNVBAMTDE5laWwgUmlja2VydDEh -MB8GCSqGSIb3DQEJARYScmlja2VydEBjcy5uaXUuZWR1MIGfMA0GCSqGSIb3DQEB -AQUAA4GNADCBiQKBgQCxG0kG7z9E4JOtjKf3IXyHy9o19kui/YqgB1vMapuJM/wk -9bEkWVolUP0W19S8xwQd35CbXsOo6Yt9o12a6X/lK+oVp626WCYKEUlP2ppnf7Cm -ZvQntmFOPMg+oC9qtA4V1jn4kmCF36Y08/qkpeRHSeeHpKVcjmovE3ZfKfNkcwID -AQABo4IBDzCCAQswHQYDVR0OBBYEFLYxeLt+qk2hXf2iJBjGkFotLxlIMIHbBgNV -HSMEgdMwgdCAFLYxeLt+qk2hXf2iJBjGkFotLxlIoYG0pIGxMIGuMQswCQYDVQQG -EwJVUzERMA8GA1UECBMISWxsaW5vaXMxEDAOBgNVBAcTB0RlIEthbGIxJTAjBgNV -BAoTHE5vcnRoZXJuIElsbGlub2lzIFVuaXZlcnNpdHkxGTAXBgNVBAsTEENvbXB1 -dGVyIFNjaWVuY2UxFTATBgNVBAMTDE5laWwgUmlja2VydDEhMB8GCSqGSIb3DQEJ -ARYScmlja2VydEBjcy5uaXUuZWR1ggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcN -AQEEBQADgYEAYGkjZZdRXAakQssA55rcOXDD012/D+AEVE3Z3BJXEmxn/VuwOWPq -xBJlUbs98fcltM0L9lt6YSWtBgoBVdxxBSkNc+kwUb7T4bKJ/A8o9wZ1lhs0deAH -5TuzCygk5XnqVTnn0u7sY7Tkxu7LFdDI6ztPNhCkasBrA+gpcsenEAA= ------END CERTIFICATE----- - -Certificate: - Data: - Version: 3 (0x2) Serial Number: c2:3c:61:67:3b:0a:cc:5e Signature Algorithm: md5WithRSAEncryption Modified: head/contrib/sendmail/KNOWNBUGS ============================================================================== --- head/contrib/sendmail/KNOWNBUGS Tue Jun 14 04:20:17 2011 (r223066) +++ head/contrib/sendmail/KNOWNBUGS Tue Jun 14 04:20:18 2011 (r223067) @@ -12,6 +12,14 @@ distribution). This list is not guaranteed to be complete. +* Header values which are too long may be truncated. + + If a value of a structured header is longer than 256 (MAXNAME) + characters then it may be truncated during output. For example, + if a single address in the To: header is longer than 256 characters + then it will be truncated which may result in a syntactically + invalid address. + * Delivery to programs that generate too much output may cause problems If e-mail is delivered to a program which generates too much @@ -258,4 +266,4 @@ Kresolve sequence dnsmx canon be used if set instead of LOCAL_RELAY ($R). This will be fixed in a future version. -$Revision: 8.60 $, Last updated $Date: 2007/12/04 01:16:50 $ +$Revision: 8.61 $, Last updated $Date: 2011/04/07 17:48:23 $ Modified: head/contrib/sendmail/LICENSE ============================================================================== --- head/contrib/sendmail/LICENSE Tue Jun 14 04:20:17 2011 (r223066) +++ head/contrib/sendmail/LICENSE Tue Jun 14 04:20:18 2011 (r223067) @@ -1,8 +1,9 @@ SENDMAIL LICENSE -The following license terms and conditions apply, unless a different -license is obtained from Sendmail, Inc., 6475 Christie Ave, Suite 350, -Emeryville, CA 94608, USA, or by electronic mail at license@sendmail.com. +The following license terms and conditions apply, unless a redistribution +agreement or other license is obtained from Sendmail, Inc., 6475 Christie +Ave, Third Floor, Emeryville, CA 94608, USA, or by electronic mail at +license@sendmail.com. License Terms: @@ -22,10 +23,11 @@ each of the following conditions is met: must allow further use, modification, and redistribution of the Source Code under substantially the same terms as this license. For the purposes of redistribution "Source Code" means the complete compilable - and linkable source code of sendmail including all modifications. + and linkable source code of sendmail and associated libraries and + utilities in the sendmail distribution including all modifications. -2. Redistributions of source code must retain the copyright notices as they - appear in each source code file, these license terms, and the +2. Redistributions of Source Code must retain the copyright notices as they + appear in each Source Code file, these license terms, and the disclaimer/limitation of liability set forth as paragraph 6 below. 3. Redistributions in binary form must reproduce the Copyright Notice, @@ -33,16 +35,16 @@ each of the following conditions is met: forth as paragraph 6 below, in the documentation and/or other materials provided with the distribution. For the purposes of binary distribution the "Copyright Notice" refers to the following language: - "Copyright (c) 1998-2009 Sendmail, Inc. All rights reserved." + "Copyright (c) 1998-2010 Sendmail, Inc. All rights reserved." 4. Neither the name of Sendmail, Inc. nor the University of California nor - the names of their contributors may be used to endorse or promote + names of their contributors may be used to endorse or promote products derived from this software without specific prior written permission. The name "sendmail" is a trademark of Sendmail, Inc. 5. All redistributions must comply with the conditions imposed by the - University of California on certain embedded code, whose copyright - notice and conditions for redistribution are as follows: + University of California on certain embedded code, which copyright + Notice and conditions for redistribution are as follows: (a) Copyright (c) 1988, 1993 The Regents of the University of California. All rights reserved. @@ -76,4 +78,4 @@ each of the following conditions is met: (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. -$Revision: 8.15 $, Last updated $Date: 2009/03/04 19:58:04 $ +$Revision: 8.17 $, Last updated $Date: 2010/12/03 01:10:00 $, Document 139848.1 Modified: head/contrib/sendmail/PGPKEYS ============================================================================== --- head/contrib/sendmail/PGPKEYS Tue Jun 14 04:20:17 2011 (r223066) +++ head/contrib/sendmail/PGPKEYS Tue Jun 14 04:20:18 2011 (r223067) @@ -142,6 +142,223 @@ gpExpdV7qPrw9k01j5rod5PjZlG8zV0= -----END PGP PUBLIC KEY BLOCK----- Type Bits KeyID Created Expires Algorithm Use +pub 2048 A97884B0 2011-01-04 ------- RSA Sign & Encrypt +fingerprint: 5872 6218 A913 400D E660 3601 39A4 C77D A978 84B0 +uid Sendmail Signing Key/2011 + +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v1.4.9 (OpenBSD) + +mQENBE0ios4BCAC0mjr+Fljl/LRvhI3sI29bM146dWJFr+oJVTHuafDuKQS5ICeU +89LewVL6Pjp8RureijfbqZC51Z2v5v6GxAizr/LlD9FohjQXiAaA1vgPChBdzvLg +4TzEVnQOGFuDUnuucQH82I7ysQkK7z1GpFkofKHHgwmcfFpOiRLoUR7YVP7yDpfv +Zx3EPvRoFtR22kWlhms49J7zgRpXUCH9ggrtcl1QCXkPOlZ+VspUPrZaZEZy8RTA +3W5l0yhnGVgnJHBfOo2svFurukQ7LAU4U6yCG5AFogcD3sgEvuFAkmWBJZ2rnOBn +yCL658zfAJlmrni8kLQp6yBuEsUrT6jdRgRBABEBAAG0MVNlbmRtYWlsIFNpZ25p +bmcgS2V5LzIwMTEgPHNlbmRtYWlsQFNlbmRtYWlsLk9SRz6JATkEEwECACMFAk0i +os4CGwMHCwkIBwMCAQYVCAIJCgsEFgIDAQIeAQIXgAAKCRA5pMd9qXiEsHIXB/0S +PFGPpoJzQqcEUHZ8w21mJOhoB6eO3GYRXBBLODQbu3x5qMXgTXT2fZgsSO5zkKBD +QCm4lMns+cJCds1+ggAZLywNM1SUvctXJYIaHnSLEnEbxIgRMM+HdULlJn3xgT6w +HUVZhzjamXOLospz5BfIXx9NynvjxvjcZ/NI8Cas1WFPvP+89fT+VCzLw0eC1bAo +puv2CA384i7pqeCvw13taksA0QnpHeN9c2xjWA6LTbLBrDLoTkfxvas0H9WzgNTF +DpzSuIHyDFonrkSvdgyOCIUYWJ0qkzDYnJzaOd7ku+4YjcF1bw5FhbvXAvcBY8OA +Ilr9WaR2TGj7//OylOjNiQEcBBABAgAGBQJNIqNLAAoJEGBN+/KFQQq+gDEH/i7x +aOd7L+QV5rIYyujJdirVoO/9s1+YJkKmFAKltUPcj8vOulQrxjK1E4Wul1qzMclr +TpZnIb9lyoqIKlGFwx345iHFhDHdWeGFxMxeQBopyOmAZcfMIX2C22+EYGNZNUsO +xVxpNV0CzKTdbfPHmBFSbA4lWnkyFxZsTR0GmGXRluwc1kT3i98QJbqNudKzUSU4 +f0+3Uda3xrnLtmChSEc57PRSDV4jHdILxORcuHh3xi50y0J3JJ2Yj0utNZ/W2KWX +guO0WSaNxv7lcKv5ilTWA5WWRt42SZfHlTiBJVpWydRBTZQGJLR6GTWpMoMs5jwP +9BGlbcR9J5+wmOFT9BmInAQQAQIABgUCTSKjbwAKCRASiW6bp38kKRGJBAC+VwW2 +/kXhV70FPyny4RErQDtyovkyS4rqFLdTNWNu80xbgEZJZY9ZcxT8YLjePsPmDZ0R +d4omumo5M35/gAastE5UMC4JCFM4v/iUUZwm5LRQNn0UtSKsSdHf32OqJx0FBr5k +GAe9LAd6gIqkPMw4AaK5H+C3H9VbR4sWHr3AEYicBBABAgAGBQJNIqN3AAoJENiq +8Mr2swcpK94D/A30eBH+qNleOIlwocxV+Fu7g6rvIPdULeYSNLhi/cuXUzo0HREs +FowErSD9gSabBkHbAUUhz8gBIXBATUKDgPfoqUqzYZmWRz15jgbKv2vVF36v6uuj +C/xgVZJsgw5uaZkJM5TI7FCEIs8EfjtPGD3AG1zBYw1+cmls6x+sq6tsiJwEEAEC +AAYFAk0io40ACgkQl0MBGHCTuEEeRwP/eaawZ80/BoQLdlgz6nNsIhomtFZSPhMS +/AFMo+cd4G777R1VJijNiD2ou3/2QbcPfu8OPENFYMLAOcYxYTzCL7XgSWkMxAmF +l2S1/xNUIteUwReoWpp/TZfCaTyro1VrX5pbTf3EYRlkF1qStBwmFfwSIZazhabi +XjlG/rDXL4WInAQQAQIABgUCTSKjlwAKCRAee7PIr5WWJfQsBACcJNvwXwHZVaf3 ++7f2wvqk1HxQk/3x2A/kMBSl1KuWFHV/WGu7Abj8hrjdrBffeCo27TpOhNt5946X +dwBLl4LYNL2Ogi8lH4nR1DsLTcJKICzxveFN1pRafd7+raVqsg/pIVQnagjxbuTa +6ClKEqGnF23kfnjMmlkQgQqupXh6kYicBBABAgAGBQJNIqOfAAoJEHCgJE0e+ZJR +RKYD/17M7wr4tyR+cO1vEJWftFbVCuyKnlUGH4yqjvZhFI0G3NhGnHcjXtl5Tntu +6gUOzObitN1vL/n0BYOPX4ppQ52Ocv6I87geOXC9EDREy5fJU8kX9lGkDRwWJEcg +i88ap0L/8Z3ihtr73hKZp3V6zfBIKdR/RfxxjV3xe5AevuooiJwEEAECAAYFAk0i +o6YACgkQyNXtKZX2F3G35wQApLZxcOkchrNplG4YJMucVcPFyNzeUFL6yhV6PMIQ +Vz8/ktBYF3LK2QQBxIFBEINF8EslKZ7LSfiFTSvsAxb8OiXGV23qHnglfN2zLFrA +CR9wvZ7jtDHHFfhHoDN8d9PA2LQR7M9qJzf1ltTaSETm9bSEZ/wC+VHvw+EVQU2S +OlSInAQQAQIABgUCTSKjrgAKCRAhg+GxOW8HiYOzBACR7nqyHOXspyNy0k2iKkEN +yAaorX32AecPpwyee7G2+QLxbK8jGGcmh5NR/GUx3ZbdKroyMZHK6OrQi42NwC7Q +n9xnzzgUgSdKRwnsA1IyP7DpiBSXMdk0kCc6UJy2L9fanHbamAe0oSZAACt9ePYD +jjq4Jmf25ObWv16Hyv83N4icBBABAgAGBQJNIqPIAAoJEIlpYrhnjAoDa9sD/inn +1dFkBlDPlPtGwHbw3+qCk8y6h3HpZubae7FxdE1pzsh/G00pB7Wy5K/EHL3MKlul +TxtetwQhSrYBmsPD5t3BhDKIyU2MQuec8dbJw/O1/7xGYmG1O4gGwq9vM4C2g+wz +atMl2pQnmi9DhhxFTwxhTgeorQ7nXrTclbuaqyLSiJwEEAECAAYFAk0io9EACgkQ +OCLbR8w3Ty1JCgQAjkZe0O9GZko22lkc7/3eql8zKwBx3Fpugt1NZ9nyOxeS2WpO +FfuiAiruA+p1L7b/dC60BUu+z6pgGIs05vIvPzzqjxnPBhqeYwWeW3ABa4JMVDi1 +RkR4TK6PsEj6IE7ZatzqiPST/GNRrjvpqtNyLsEbybPdY13hZSmxb780d1mInAQQ +AQIABgUCTSKj2gAKCRCcHL3i41xWNXseA/93476LuPukf9rKz9hvf88HrK5O0YPc +jG/CU2nFLhRbo5gkGFyf7540pODGBaCHyqwT46etzVY+WtZ1fETN0ALIJwoXkbwM +QE637pwnCLUO6ZTixa6CwceWXXAIc5/hiuQn0uKL8x4kHUcMUZqggYvqrjG1ZEDG +ZCVuTes1yhalDYicBBABAgAGBQJNIqPnAAoJEG9Sk9ijm6ZVpFYD/1OyjV5+9N/2 +rGbKcfaDXqTM0cvBjs1vBvFJfmDCy3fcOv590SboiCwY6dt5Sd6eRruY4FaTnosI +V4MZZnvMq1W3KfbT6fvcli/hgTKwYfJM7Mj+Tdp3uOGXN1u+cvKEfY3YHwDb4NAc +G3jPSslu1nrZq84bsokhnE+en8du7mKPiJwEEAECAAYFAk0io+8ACgkQ71iWZNQy +4Z1jiQP8CdqzrpIpNuKOs1nVcMsX+T1ZdiNbqbPYbjhQx7isUoaarDk/tQZZGxDE +dEXayRuNobRzQXltAKOhBrXlN2yFP9d9BR1y8B3dVBO9vsThuQ1BtMrtLrAL5In9 +4RyAvpuKcOhWnf9kJLis2MGghhIllJMuXOFeyujE3A4HSHFqGDWInAQQAQIABgUC +TSKj+gAKCRDBnB0lEtNGHaOHA/4+zClhAJappAYqATHLCs8mgzYa0/9RvI+e6iV8 +OD8/BOJl4DnHya0ijX7Kt78VJymcmdXge1ypBnq4D2b/vTo18asDfzysPhAmPoCK +FTlerV9xV/TW/QBZ7EkPW3BwOQW7LYnFd/NnoiX4z+KWh9FwOVWlXPz8xKgBgX3V +yoz3l4icBBABAgAGBQJNIqQhAAoJEMApykAW9MzppmsD/1HonMTzk4X9qvhvaLTU +/OKvOzxIdX6b/62DA0WZxN3Duyh2S8OLZzryI9SASesk5vgb2uSMC3dVCwOcfsiz +QWqStOLG5eyYJh0/iiRZ2K4YM/FrFBo3+AmQ2IeL3qRftBWGyIf11l1ZFS3Uzp8t +uzIxUFcQU2bJpy7GjHcq989qiJwEEAECAAYFAk0ipIwACgkQvdqP1j/qff3gwwP/ +WTAZ3r8UYbMoIN+ES8A9xLvUZRh/aT7TtiFCLxmJXIk3e+XKHw57DO3WUgZEo99d +PYNm/Q3tTqT+fj1rIDH9VdxhiSVw2lq/7qoIoYFb1fyCtuMQ+27jF/AFqbkDQJYx +gcnalClseYEsA9+GYKYfY0UAQePuDuWBMSPMkM+m+e+InAQQAQIABgUCTSKkqgAK +CRB8S2dtoA4VY+t1A/922nF4Apuc162UVBiP+v67PeXLgekdkjqlDACxqqgWWerW +6e41VaznDZjIGx76pQSbguCq7XbQXkiqO3E7bHcbjC8OEZ1Glju13GZG3heaoc23 +4n5pNctLmBWSdrp/4RCaf1BAgZ0UAYPO9fR7ZJyenp3vID8vwKTufoy0nR8/MIic +BBABAgAGBQJNIqS6AAoJENbgof5PvirdRDID/39vOWdqbvu17vX2n3GBI4RYseA2 +1pmvDqvzQcLLDJAXr1auTY7uiotYlXA8qPd4KTy0hCcj2r+7lZMhY1mCumG/0Sp+ +CahRkvUk/rVgWLeK0WGEsCV4IcayKc6ARJVKW+JHUNc1eAScMDAlMOyg0cNtQeDA +huCt6hxL1YGTPpPSiJwEEAECAAYFAk0on/MACgkQzx61AyIyegHYdAP/c4bKqid9 +lK7ciLbuo7RD0ZngCy+mE+xI4EQV+5LEhFVrqT+fMzSlHKLZGbPPJ2yP1ksBJITw +cYh7wGN7Dc1xA5bnB0CtjUWYqGRcQoifbgetdee2AfRs0+RvnEo5FMJIBlJOPc2X +o5eDTxmoSrt7cxnh7PEZnbxZi1gp/wJ+E+iIRgQQEQIABgUCTTHB2wAKCRAJp6JK +0eWCBxuyAJkBu7Qu46EFKyVyC8eUFwLJkghR2gCdHQUS7eF9pXHFr6aN3J2VrGFe +mFiIRgQQEQIABgUCTTUNYgAKCRDCeBwaRrHv4ROhAJ99EeU9KWWDnd2RjCN7uex5 +S6u3rQCeLUshZhe/NCehUnaaC8LJ1kwj/5yIRgQQEQIABgUCTTWM/AAKCRCWnNph +S7Y2S8bjAJ9bOB/fFGyPgTuwQIEakXITRILLgwCgvrjaVZagTRwQW2BM1uH+vk9j +yDuIRgQQEQIABgUCTUMwnwAKCRCiu/skDPlW91hCAJ0eizb5bxByUpXY0qsbcupw +H3kiBwCg1Yc7cur+Yz2dhPuRreaPk4QeVrWIRgQQEQIABgUCTUMxEgAKCRD7VAFa ++haI7RKlAKCGogTWoJdDbetwBdRpRJ72d9qUgACfUehPWCmq2A/mIaMFlPI+F3k3 +Lk25AQ0ETSKizgEIALV2tE8RtEgC1fjw4zHrZVUChXKm1uVEkRkeoaASrAI4IiK+ +qtgbNEzhLEQavQaIZECQLCaQb5qzvKLCEvuo5tClU+2P4/YjnikdBDFXUwHznSmd +N27SsX6gNoeX/ZwaEJUNpMd/v+/Gu9QmMBIFUhtXXZyeBBpCyi6CP5jw66KjjH1g +OXCQvSYJVlutIGtzvHolvQ2I+h6Ztwy9d7pFIVlr7EymFI+x0oI/i4UwF3FZPVWO +C1OZD7suXSre+eLzYXGBYyHkvGldhA/hvKLs3Z6udcirTMtX27xL6C5WKaCsuQPu +ZiYWxJ2A9UgP6zTuBzmAJ4XXKo7QgamAbxHT0sMAEQEAAYkBHwQYAQIACQUCTSKi +zgIbDAAKCRA5pMd9qXiEsI/1CACv83SSDOBt6HZcg7ucOZJ7Wkb5EJG6Mseh/K33 +CFDwWgYa20YeUUzPWD3ZRKY4irNL3ipnB3tJUF4yaasTPpI0owpcdCkOhpDw9S7M +AOnUACuv3JIZ17892ZLjXalNGMY/23qPxbQIaAidNh02ouZ6Md+NUvgh22+oDa+v +kxTkXmKiBGFpqY2myzzPvg84TMTpRBU372CZpmjjHK8duObUr9I0iIbVzshdnWuR +MKGu+n4hSU3SIYl6xLsdBGpiDOQJ3C1YHIduhDrQlyAjDVEgzgw20DUxUzKIpn2b +KH6d5q94eHcPD56A4cYD275DIZzAYqRpwzmB9O845HrHAPmQ +=pDAG +-----END PGP PUBLIC KEY BLOCK----- + +Type Bits KeyID Created Expires Algorithm Use +pub 2048 85410ABE 2010-02-19 ------- RSA Sign +fingerprint: B175 9644 5303 5DCE DD7B E919 604D FBF2 8541 0ABE +uid Sendmail Signing Key/2010 + +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v1.4.9 (OpenBSD) + +mQENBEt+6goBCAC95sVPzf4AWFmUklHO9yGBq6K135Tlt9JaX3frj6PCBjkLNn97 +J5WDAoLqE9wB7WgiBzs2lu8OPZZcf+6syd97SojEze5bj2uv84DBv2juupbHEBys +9OH52QqYWG+1yuwAHY2gjKLYcvNgaOKLp5hoHZ2rakRc4a2ypLTPazsGFBO9/qBA ++v6qkP70/lOZeN9HX/yipbygAE+Y9elptW6ohvdGW8jbtllFqYFebB+lIaclkQnK +pldnQfktnJDB+XmLOc5m/1BsultlI5IH9HXCeskXxLcxXq+ldg+it1DgzxmHpHTK +dIhgOKY3MvTgxkcXiwIGcHBMnov6ESL1KaU5ABEBAAG0MVNlbmRtYWlsIFNpZ25p +bmcgS2V5LzIwMTAgPHNlbmRtYWlsQFNlbmRtYWlsLk9SRz6JATkEEwECACMFAkt+ +6goCGwMHCwkIBwMCAQYVCAIJCgsEFgIDAQIeAQIXgAAKCRBgTfvyhUEKvi4qB/0T +Em3whttGoUrxdZd1gYKI9SY1/4dHOhD+xJQQgIoQSRpOEA7xQ6TTAYvG8sYdsF5K +9/lWjOTEy5w6wBcu4e9F7aO/TUzue/7p0c2UKJTrEOw4HsRrENfQHx1TAXudQHHn +5+PgBCQCSr36ktuSXnlOo2bGbZ4FUwNCu0ztmoEEca8ZgY6ciEXbva1kRj6Eumul +MkqtVYEAtjzdIga6M3xYuJlus+qi/uEj5kivtf2LUDxXpGE6XFrArum0za/URiW8 +wxt5zBbTbne3tDr2yg6GC046+f1Wr02xWYapGyNRU6yrPciWOu0tpaxJ7CwEIMRq +6HzbSVdZkqOdSoZ3ufqYiJwEEAECAAYFAkt+6lkACgkQEolum6d/JClfWAP/VBVb +VYBQKV+NQyXl6ULJI91iIpEAR/T3nRoemGVPhbB8a7zRRkz1h4ou6VAMJeS4BxSC +fm2iOHCYMAOMSQ03VaEM2F13b8PtsGaKjuAwDf2pHARYbOj4DRCY0dUmwPXze3Tp +7S5ui/fk9t+NhQQa6IZHFkqdnQ+xZ88hhoF5slmInAQQAQIABgUCS37q1AAKCRDv +WJZk1DLhnTPYA/0VhRNooc2csxwvxBG6HiS8wp2k+kbGbbtlQ4JFg59p4EUnT2Ld +P9eUzFtj6fRkU/bZcIKgOn37M4GOXEoNvMT6NfmpTKeofg7hwp+pMdHlq4y9Em55 +TSC+rK2g6rAaSxMvDzasBouQqfxirj3nBI65zVHK98Zaj9vrpWCVCBIoZoicBBAB +AgAGBQJLfurtAAoJEG9Sk9ijm6ZVjcoEAJdB5kzFWHsvf0u/Oe+LWQwowL5SjQ6W +uhKgTDJ5IqFbDlCT/V33mpLEC9us4wNRT6Bff5agInCKfcUXdJijExkEbDB9ErZc +WmZqtquxQJN3xH+fIoIorxjWD0RMPmMvwQRgjn/puXwichQP9PafTgd9YsQ3aWAU +DGvx1U8pkloCiJwEEAECAAYFAkt+6vIACgkQnBy94uNcVjWGswQAhqDOQ8Os3gOo +UAGm/Oju6t6JG4wxLyl7vlMZ2eQHAX8rJ99Q4kyJB9xR4uaZ42BwbPx3s25N67qb +6z/ZAMrtqsXuK90+WlwykxG1uq4FOznHU6QT7cyO48Yeoq2PO1kFgQuRESPCRxXV +8dmDgeoDQ0EDO1Ykm003AKCd0N7+n1CInAQQAQIABgUCS37q9wAKCRA4IttHzDdP +LXmrA/4r9bzS6YnAHE0MFzByA2uZq0HeyrHI/Q6ELzqeMjuu/CwKdki/8gzz6Zt3 +KkXbqd9mPidsi/nqfUwQlqMHCFSRTyqw3FkGzQ/wk9fk4G+AF+5A//xGFIACHd54 +a/1+k0iVM5GNQkrknltYps0TmW8priU1uzmzAHpsCh0e4xFDIYicBBABAgAGBQJL +fur9AAoJEIlpYrhnjAoD9mQD/0s7tHTX+Mzt7iwZzsAZEqoxSQS5dUAKK+j6GR5K +8/cWcdiDJwCABViIn+TT7/GDmTlA4EUKQzIMPDfuagqa1SPxKXgivUnfhmpJVAma +MUmZeGFQyfTBjp4qZ+Agk15Ulnz7arqmOmeAWSvdsJ/vCm44TCEDO1gIjLzgyOIc +ktU5iJwEEAECAAYFAkt+6wQACgkQIYPhsTlvB4lH8wQAyqIKclShWxxaXi6YpS/k +H+susHMVePzBPyEmv93UkSOj2bdMWuhVENPXlBn1UnFt0vKPOL+krF3+zIAjg6N6 +zFlasBUL9p2HqRI35Sq4cn3S3Im4vZIPwWNYgtQY41Hc1Gx2pIxmKtIz+9+sUiTE +DGrTxnzUAohPaTzUVXPtWOuInAQQAQIABgUCS37rCgAKCRDI1e0plfYXcQXaA/9D ++sQJdEc1orgN/aTVGKkKoNyMmJhtNLECYIsfAYcE9lMGtymkkli0BrvrtNN1Co6P +qmR+oaZSmeyq0qNVdV8AnoyFI5Dk3Nir82ISOtvzuNzn8NrosSed0nyVmg88amTa +WoJS7as6s6/lCxuarGwRuHA7vXaxDg92lCYeTw09I4icBBABAgAGBQJLfusSAAoJ +EHCgJE0e+ZJRWiMD/i65FDmbZo0srV01XwSUb8EF/70RF0uOxrGfunMin93cR8VW +mNSzcydfH/mKR1Rf4Snsz9hp9NWryZpjVXrPJx6GOBzzwgyUtzAxH6OElv7rlK2Y +XJ+Xi94djsyB56e6PKHA1uB30g2l5beh0bDUEa9mLfstTidMWGXRdtnVtW5KiJwE +EAECAAYFAkt+6yAACgkQHnuzyK+VliU0OQQApyvdx0YKiDL7EuLf/QkOk64DRAKf +7rxZSlN5jHnNJSQeX7cMRBcklbl/GlZH2oyHdDuahrZ62MT/mCneRIH58lf8c91h +WLFjkpU/j8Md8ahFQDWpCwNSSwz4tqZyhKfeP/w0OaHC4ttAwbjKk6mn0wFpWxpH +sYFc08L5PoUyaQaInAQQAQIABgUCS37rJAAKCRCXQwEYcJO4QR+cA/9EEv5UJCgt +0glLmhIzpvGxlEyzhVqhtfDE8CI06lOSGWhYy4VCcOCho8ig+atxU1+/zPaJGIbI +mvR+kuPZ9kmtd+LtV6fWtp7U6FrAZSXV6paWHc9ZCLJeKSNwmRrcOqaBEjj3MqNA +pwXO3gCiuylHzgIo05+FxRho91AS/mciI4icBBABAgAGBQJLfusoAAoJENiq8Mr2 +swcppz4EALJ3JQOIPsvgptuPdq8XZuxxuFonjcr8RaLB89a9MDduFBM8zw/Q0qcA +asltDtQidMwn+VCDQavkrpEM2QbNxFfhbdnw5c97CvovgmTATPaR2XZ7LaeIwE36 +HLL5e5/k0BThiqymD3tjaFbx7uTK2o3ZTyMvbjtqMOdt0eLqFvHRiJwEEAECAAYF +Akt+6ywACgkQwCnKQBb0zOnn+AP+OdZu4BowBVYzmygmM1O7XyiEMd5TB3MxwkZR +8+rGW8Xcl4JtLY9iiXzfakTHuP3OrINrhXnMQLAY46kAcUc+VcHvLdMth6btsltE +Jjc33aZovPRabCeKVCnDKcEPRYclsXgGStXlFMoacI2KUUENZeGCUr0NJb7RnAk5 +Pfuib+mInAQQAQIABgUCS37rVgAKCRDBnB0lEtNGHcMMA/9mYtgCaK/zihws7d4V +p+uQXKjnfhKZx4XX33BoUFgxC2N5/TB6qd0sBnaUYby/DDGh6W3721dGTw66i9vF +Wn2IJ6JUj4CpLCCFVb9FxPdjrt/F1eKg8N1SOfVQg0D9Nkl48Y81tIf0xcMa9yuV +8qssX8baTDhatDGFIZlYPfGpZIicBBABAgAGBQJLg2FTAAoJEM8etQMiMnoByVwD +/3iim8IBm3ssOFJ58RR9wFPgH7INTiE28vO5yO+f2i0/cEdWwJDwmqOpKhUM7DWy +LeK7LaZWzViuxh83ZI2KlcJJksdFtohuzyJul/phyaQYDPGlgu7AIthNm49pdDnR +0AAQl98ccn0iT69Zp3Fi5fRMHVC4ChBsBir5JjJBh0aliJwEEAECAAYFAkuDdtQA +CgkQvdqP1j/qff0GMwQAqgbWFQsOoEzzwSDo/SEun8gmRRLUH8vWx5Us659x2nQy +BPtp8w2HpqKsyMn2E4TavKjyzUZPINziPVszXhG+dtCFuOQvRFFZzFQccdhAIB8o +KJ7y/LRa7MpvIMRFJOURBnJgQ3asUojRcksd+rgMqujFrwyYN5J+LeXwBXS9eMSI +nAQQAQIABgUCS4N2+gAKCRB8S2dtoA4VY6KoA/91U29DqRR0XRlk+KdRs6Qjo/R0 +lQp7uUtuP55xJkv+UMPVhABbMOR+/sjE8eUJdMpHfaQmdG89M5VZ+Ck2MZrhjveE +acNH/sIWCDvIFV5gheNZycpp+wH2VO7+i9bWmMVl4JKK0grFRYQMqiqT+tHYfXS3 +MVQH8U4EhwnFuwFrgoicBBABAgAGBQJLg3cQAAoJENbgof5PvirdPboD/jUU/UV7 +7jGtnW9+xrsUUDcHeU8Ha/VKXfKts4Z0KifWYnjUOH5jR/OqYzHy7vAOyGpyrziN +eJHLM/I8AuTtmsCY3IpfhaeRg4ZkJYRqx5QkhfUesOpPfKVPYtoF53Uw04iu0dtv +2bFftaX0tX/hKhWmzobllBGM9b5E4G+kHCRZiEYEEBECAAYFAkuEoagACgkQCaei +StHlggfktQCgjyKOB4tlm9WnufcJaYIbchyZVSQAn3thzs5akheaVsVwBHSmpJyk +PDRbiJwEEAECAAYFAkuFS4UACgkQXx7Ib4gMnlUZEQP9HoutmYz6pAB8XEADTKrR +wTWGqu/S4V6zhSJbIYSDIFAY+WeKCTUdVO8eFfrPIrS459z8yQ3PgFKL3QMp1VgX +jMGPcvfHOjWh1jSw5W1aLcJX428T0oybgLZLvPT7QXpIwKcY8TtS/jjVTaepIqIG +9tmQupstoaw/h9b1vHY7R7uIRgQQEQIABgUCS4Uc9QAKCRCWnNphS7Y2SyT5AKCE +1AR60B2GDZ75U2kaNe/SyOQJ3ACfVtndQ22edDOB1INak6SyfYv9ZuSIRgQQEQIA +BgUCS4TumQAKCRCiu/skDPlW9we5AKC6dNVZjpg/yDQiepI2E0XZ222vzACeJ7Ds +41t2z3BT4qGJyZrpGK8G3kKIRgQQEQIABgUCS4TuuQAKCRD7VAFa+haI7WniAKCY +mNr9FG/180EcUY/tgaHNuUDXtwCfX0DYjxL9ExvQ7wB2uXB2M7AwGxSIRgQQEQIA +BgUCS4Ts4wAKCRCgT/sbfcrp09HnAJ0dELKCp7WoOoAPVBHez/sfHAmgAwCdG64t +bjYwj5CamCOhDvuNjfbUpBSIRgQQEQIABgUCS4W+PgAKCRDCeBwaRrHv4S4EAKCV +LKV3q7PiVV5rb9T+s5uyrETBsgCfUVhchd+Ha5nbduvnF25C0Eswouq5AQ0ES37q +CgEIAK8GnjvPPqWqcNCmLyuscuTKPjqTyaA3xVVYNX+8hMD1iK4VAGf3QfKExVnN +QLvLpnknnKK/caaXFME9t4L0BTjCJRYJiDpoWImwu5fTRIyfIIy4vv5vPErqqKen +7dII6gptC2i538ntj7k8qkhewKJuTOVpE1eLHe3RxuP8rsv1AsvjJ+6WGZlFYINZ ++d0pxSOhdPN9WoTCl9JfkTQrnoVPClzG/euOkF5fUThL90gt31iN+RjB5DeWTPB/ +jDrq6t5spA8hTKvQ+UB65chI6TzrCr+k8f5D9AR0Fkf9KPFOL7+U9o6Ap9yur5sn +njDP4fFVhazVyljUwwPvJ5jjS1cAEQEAAYkBHwQYAQIACQUCS37qCgIbDAAKCRBg +TfvyhUEKvpWAB/0YnkJx6/5rIwDh1u5iFdboUCEsX92n9eOilPWw1NWbq/Gdx7+Z +xoRjrGl8e8SxOZJbfyehgPX8NxOrkBfcAOOXmOvXSO1i3HSo2gaQxVh1urXojzID +raUMcltcNeQagdtDfPhYnS25vJnj+H29Dal2FwLJb9wp8QH1DdhUBoqeRQH34REu +fWu0LjF87JjUELhZe0Op4B8HnQV9oGo7W4IYw/3Ek6c5As+WIWSaz0NmHP2Xw+kI +kpC4BVIwG0l2mChAT8Ds+rDLGYA2dxYK39mFSApem2KiXFhAanDBb5XgilmeDepk +A4NAZlDwxoivB/5PTy67pX+AC1JgvPPafUMu +=6Xeh +-----END PGP PUBLIC KEY BLOCK----- + +Type Bits KeyID Created Expires Algorithm Use pub 1024 0xA77F2429 2009-01-01 ---------- RSA Sign & Encrypt f16 Fingerprint16 = 33 3A 62 61 2C F3 21 AA 4E 87 47 F2 2F 2C 40 4D uid Sendmail Signing Key/2009 @@ -1865,4 +2082,4 @@ DnF3FZZEzV7oqPwC2jzv/1dD6GFhtgy0cnyoPGUJ =nES8 -----END PGP PUBLIC KEY BLOCK----- -$Revision: 8.29 $, Last updated $Date: 2009/01/06 05:59:03 $ +$Revision: 8.36 $, Last updated $Date: 2011/01/28 21:17:54 $ Modified: head/contrib/sendmail/RELEASE_NOTES ============================================================================== --- head/contrib/sendmail/RELEASE_NOTES Tue Jun 14 04:20:17 2011 (r223066) +++ head/contrib/sendmail/RELEASE_NOTES Tue Jun 14 04:20:18 2011 (r223067) @@ -1,11 +1,75 @@ SENDMAIL RELEASE NOTES - $Id: RELEASE_NOTES,v 8.1963 2009/12/23 04:43:46 ca Exp $ + $Id: RELEASE_NOTES,v 8.1991 2011/05/15 04:28:16 ca Exp $ This listing shows the version of the sendmail binary, the version of the sendmail configuration files, the date of release, and a summary of the changes in that release. +8.14.5/8.14.5 2011/05/17 + Do not cache SMTP extensions across connections as the cache + is based on hostname which may not be a unique identifier + for a server, i.e., different machines may have the + same hostname but provide different SMTP extensions. + Problem noted by Jim Hermann. + Avoid an out-of-bounds access in case a resolver reply for a DNS + map lookup returns a size larger than 1K. Based on a + patch from Dr. Werner Fink of SuSE. + If a job is aborted using the interrupt signal (e.g., control-C from + the keyboard), perform minimal cleanup to avoid invoking + functions that are not signal-safe. Note: in previous + versions the mail might have been queued up already + and would be delivered subsequently, now an interrupt + will always remove the queue files and thus prevent + delivery. + Per RFC 6176, when operating as a TLS client, do not offer SSLv2. + Since TLS session resumption is never used as a client, disable + use of RFC 4507-style session tickets. + Work around gcc4 versions which reverse 25 years of history and + no longer align char buffers on the stack, breaking calls + to resolver functions on strict alignment platforms. + Found by Stuart Henderson of OpenBSD. + Read at most two AUTH lines from a server greeting (up to two + lines are read because servers may use "AUTH mechs" and + "AUTH=mechs"). Otherwise a malicious server may exhaust + the memory of the client. Bug report by Nils of MWR + InfoSecurity. + Avoid triggering an assertion in the OpenLDAP code when the + connection to an LDAP server is lost while making a query. + Problem noted and patch provided by Andy Fiddaman. + If ConnectOnlyTo is set and sendmail is compiled with NETINET6 + it would try to use an IPv6 address if an IPv4 (or + unparseable) address is specified. + If SASLv2 is used, make sure that the macro {auth_authen} is + stored in xtext format to avoid problems with parsing + it. Problem noted by Christophe Wolfhugel. + CONFIG: FEATURE(`ldap_routing') in 8.14.4 tried to add a missing + -T that is required, but failed for some cases + that did not use LDAP. This change has been undone + until a better solution can be implemented. Problem + found by Andy Fiddaman. + CONFIG: Add cf/ostype/solaris11.m4 for Solaris11 support. + Contributed by Casper Dik of Oracle. + CONTRIB: qtool.pl: Deal with H entries that do not have a + letter between the question marks. Patch from + Stefan Christensen. + DOC: Use a better description for the -i option in sendmail. + Patch from Mitchell Berger. + Portability: + Add support for Darwin 10.x (Mac OS X 10.6). + Enable HAVE_NANOSLEEP for FreeBSD 3 and later. Patch + from John Marshall. + Enable HAVE_NANOSLEEP for OpenBSD 4.3 and later. + Use new directory "/system/volatile" for PidFile on + Solaris 11. Patch from Casper Dik of Oracle. + Fix compilation on Solaris 11 (and maybe some other + OSs) when using OpenSSL 1.0. Based on patch from + Jan Pechanec of Oracle. + Set SOCKADDR_LEN_T and SOCKOPT_LEN_T to socklen_t + for Solaris 11. Patch from Roger Faulkner of Oracle. + New Files: + cf/ostype/solaris11.m4 + 8.14.4/8.14.4 2009/12/30 SECURITY: Handle bogus certificates containing NUL characters in CNs by placing a string indicating a bad certificate Modified: head/contrib/sendmail/cf/cf/submit.cf ============================================================================== --- head/contrib/sendmail/cf/cf/submit.cf Tue Jun 14 04:20:17 2011 (r223066) +++ head/contrib/sendmail/cf/cf/submit.cf Tue Jun 14 04:20:18 2011 (r223067) @@ -1,5 +1,5 @@ # -# Copyright (c) 1998-2004, 2009 Sendmail, Inc. and its suppliers. +# Copyright (c) 1998-2004, 2009, 2010 Sendmail, Inc. and its suppliers. # All rights reserved. # Copyright (c) 1983, 1995 Eric P. Allman. All rights reserved. # Copyright (c) 1988, 1993 @@ -16,8 +16,8 @@ ##### ##### SENDMAIL CONFIGURATION FILE ##### -##### built by ca@wiz.smi.sendmail.com on Tue Dec 22 20:49:09 PST 2009 -##### in /extra/home/ca/sm-8.14.4/OpenSource/sendmail-8.14.4/cf/cf +##### built by ca@wiz.smi.sendmail.com on Sat May 14 21:31:14 PDT 2011 +##### in /extra/home/ca/sm-8.14.5/OpenSource/sendmail-8.14.5/cf/cf ##### using ../ as configuration include directory ##### ###################################################################### @@ -27,7 +27,7 @@ ###################################################################### ###################################################################### -##### $Id: cfhead.m4,v 8.120 2009/01/23 22:39:21 ca Exp $ ##### +##### $Id: cfhead.m4,v 8.121 2010/01/07 18:20:19 ca Exp $ ##### ##### $Id: cf.m4,v 8.32 1999/02/07 07:26:14 gshapiro Exp $ ##### ##### $Id: submit.mc,v 8.14 2006/04/05 05:54:41 ca Exp $ ##### ##### $Id: msp.m4,v 1.33 2004/02/09 22:32:38 ca Exp $ ##### @@ -35,7 +35,7 @@ ##### $Id: no_default_msa.m4,v 8.2 2001/02/14 05:03:22 gshapiro Exp $ ##### -##### $Id: proto.m4,v 8.741 2009/12/11 00:04:53 ca Exp $ ##### +##### $Id: proto.m4,v 8.744 2010/11/23 20:29:47 guenther Exp $ ##### # level 10 config file format V10/Berkeley @@ -114,7 +114,7 @@ D{MTAHost}[127.0.0.1] # Configuration version number -DZ8.14.4/Submit +DZ8.14.5/Submit ############### @@ -992,7 +992,6 @@ R< $* > $* $: $2 - ###################################################################### ### check_mail -- check SMTP `MAIL FROM:' command argument ###################################################################### Modified: head/contrib/sendmail/cf/feature/ldap_routing.m4 ============================================================================== --- head/contrib/sendmail/cf/feature/ldap_routing.m4 Tue Jun 14 04:20:17 2011 (r223066) +++ head/contrib/sendmail/cf/feature/ldap_routing.m4 Tue Jun 14 04:20:18 2011 (r223067) @@ -1,6 +1,6 @@ divert(-1) # -# Copyright (c) 1999-2002, 2004, 2007, 2009 Sendmail, Inc. and its suppliers. +# Copyright (c) 1999-2002, 2004, 2007 Sendmail, Inc. and its suppliers. # All rights reserved. # # By using this file, you agree to the terms and conditions set @@ -10,7 +10,7 @@ divert(-1) # divert(0) -VERSIONID(`$Id: ldap_routing.m4,v 8.17 2009/06/26 21:11:08 ca Exp $') +VERSIONID(`$Id: ldap_routing.m4,v 8.18 2010/01/05 00:57:27 ca Exp $') divert(-1) # Check first two arguments. If they aren't set, may need to warn in proto.m4 @@ -35,40 +35,12 @@ ifelse(len(X`'_ARG6_), `1', `define(`_LD _ARG6_, `tempfail', `define(`_LDAP_ROUTE_MAPTEMP_', `_TEMPFAIL_')', _ARG6_, `queue', `define(`_LDAP_ROUTE_MAPTEMP_', `_QUEUE_')') -define(`_ATMPF_', `')dnl -dnl check whether arg contains -T`'_ATMPF_ -dnl unless it is a sequence map or just LDAP -dnl note: this does not work if ARG1 begins with space(s), however, as -dnl we issue a warning, hopefully the user will fix it... -ifelse(defn(`_ARG1_'), `', `', - defn(`_ARG1_'), `LDAP', `', - `ifelse(index(_ARG1_, `sequence '), `0', `', - `ifelse(index(_ARG1_, _ATMPF_), `-1', - `errprint(`*** WARNING: missing -T'_ATMPF_` in first argument of FEATURE(`ldap_routing') -') - define(`_ABP_', index(_ARG1_, ` ')) - define(`_NARG1_', `substr(_ARG1_, 0, _ABP_) -T'_ATMPF_` substr(_ARG1_, _ABP_)') - ') - ') - ') -ifelse(defn(`_ARG2_'), `', `', - defn(`_ARG2_'), `LDAP', `', - `ifelse(index(_ARG2_, `sequence '), `0', `', - `ifelse(index(_ARG2_, _ATMPF_), `-1', - `errprint(`*** WARNING: missing -T'_ATMPF_` in second argument of FEATURE(`ldap_routing') -') - define(`_ABP_', index(_ARG2_, ` ')) - define(`_NARG2_', `substr(_ARG2_, 0, _ABP_) -T'_ATMPF_` substr(_ARG2_, _ABP_)') - ') - ') - ') - LOCAL_CONFIG # LDAP routing maps Kldapmh ifelse(len(X`'_ARG1_), `1', `ldap -1 -T -v mailHost -k (&(objectClass=inetLocalMailRecipient)(mailLocalAddress=%0))', - defn(`_NARG1_'), `', `_ARG1_', `_NARG1_') + `_ARG1_') Kldapmra ifelse(len(X`'_ARG2_), `1', `ldap -1 -T -v mailRoutingAddress -k (&(objectClass=inetLocalMailRecipient)(mailLocalAddress=%0))', - defn(`_NARG2_'), `', `_ARG2_', `_NARG2_') + `_ARG2_') Modified: head/contrib/sendmail/cf/m4/cfhead.m4 ============================================================================== --- head/contrib/sendmail/cf/m4/cfhead.m4 Tue Jun 14 04:20:17 2011 (r223066) +++ head/contrib/sendmail/cf/m4/cfhead.m4 Tue Jun 14 04:20:18 2011 (r223067) @@ -1,5 +1,5 @@ # -# Copyright (c) 1998-2004, 2009 Sendmail, Inc. and its suppliers. +# Copyright (c) 1998-2004, 2009, 2010 Sendmail, Inc. and its suppliers. # All rights reserved. # Copyright (c) 1983, 1995 Eric P. Allman. All rights reserved. # Copyright (c) 1988, 1993 @@ -189,6 +189,7 @@ SLocal_tls_server') define(`LOCAL_RULE_3', `divert(2)') define(`LOCAL_CONFIG', `divert(6)') define(`MAILER_DEFINITIONS', `divert(7)') +define(`LOCAL_DNSBL', `divert(8)') define(`LOCAL_NET_CONFIG', `define(`_LOCAL_RULES_', 1)divert(1)') define(`UUCPSMTP', `R DOL(*) < @ $1 .UUCP > DOL(*) DOL(1) < @ $2 > DOL(2)') define(`CONCAT', `$1$2$3$4$5$6$7') @@ -308,4 +309,4 @@ define(`confMILTER_MACROS_EOM', `{msg_id divert(0)dnl -VERSIONID(`$Id: cfhead.m4,v 8.120 2009/01/23 22:39:21 ca Exp $') +VERSIONID(`$Id: cfhead.m4,v 8.121 2010/01/07 18:20:19 ca Exp $') Modified: head/contrib/sendmail/cf/m4/proto.m4 ============================================================================== --- head/contrib/sendmail/cf/m4/proto.m4 Tue Jun 14 04:20:17 2011 (r223066) +++ head/contrib/sendmail/cf/m4/proto.m4 Tue Jun 14 04:20:18 2011 (r223067) @@ -1,6 +1,6 @@ divert(-1) # -# Copyright (c) 1998-2009 Sendmail, Inc. and its suppliers. +# Copyright (c) 1998-2010 Sendmail, Inc. and its suppliers. # All rights reserved. # Copyright (c) 1983, 1995 Eric P. Allman. All rights reserved. # Copyright (c) 1988, 1993 @@ -13,10 +13,10 @@ divert(-1) # divert(0) -VERSIONID(`$Id: proto.m4,v 8.741 2009/12/11 00:04:53 ca Exp $') +VERSIONID(`$Id: proto.m4,v 8.744 2010/11/23 20:29:47 guenther Exp $') # level CF_LEVEL config file format -V`'CF_LEVEL/ifdef(`VENDOR_NAME', `VENDOR_NAME', `Berkeley') +V`'CF_LEVEL`'ifdef(`NO_VENDOR',`', `/ifdef(`VENDOR_NAME', `VENDOR_NAME', `Berkeley')') divert(-1) dnl if MAILER(`local') not defined: do it ourself; be nice @@ -1795,7 +1795,7 @@ ifdef(`_CONN_CONTROL_',`dnl ifdef(`_CONN_CONTROL_IMMEDIATE_',`',`dnl dnl workspace: ignored... R$* $: $>"ConnControl" dummy')', `dnl') -undivert(8) +undivert(8)dnl LOCAL_DNSBL ifdef(`_REQUIRE_RDNS_', `dnl R$* $: $&{client_addr} $| $&{client_resolve} R$=R $* $@ RELAY We relay for these Modified: head/contrib/sendmail/cf/m4/version.m4 ============================================================================== --- head/contrib/sendmail/cf/m4/version.m4 Tue Jun 14 04:20:17 2011 (r223066) +++ head/contrib/sendmail/cf/m4/version.m4 Tue Jun 14 04:20:18 2011 (r223067) @@ -1,6 +1,6 @@ divert(-1) # -# Copyright (c) 1998-2009 Sendmail, Inc. and its suppliers. +# Copyright (c) 1998-2011 Sendmail, Inc. and its suppliers. # All rights reserved. # Copyright (c) 1983 Eric P. Allman. All rights reserved. # Copyright (c) 1988, 1993 @@ -11,8 +11,8 @@ divert(-1) # the sendmail distribution. # # -VERSIONID(`$Id: version.m4,v 8.205 2009/12/23 04:43:09 ca Exp $') +VERSIONID(`$Id: version.m4,v 8.214 2011/04/26 23:02:36 ca Exp $') # divert(0) # Configuration version number -DZ8.14.4`'ifdef(`confCF_VERSION', `/confCF_VERSION') +DZ8.14.5`'ifdef(`confCF_VERSION', `/confCF_VERSION') Copied: head/contrib/sendmail/cf/ostype/solaris11.m4 (from r223065, vendor/sendmail/dist/cf/ostype/solaris11.m4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/sendmail/cf/ostype/solaris11.m4 Tue Jun 14 04:20:18 2011 (r223067, copy of r223065, vendor/sendmail/dist/cf/ostype/solaris11.m4) @@ -0,0 +1,22 @@ +divert(-1) +# +# Copyright (c) 2011 Sendmail, Inc. and its suppliers. +# All rights reserved. +# +# By using this file, you agree to the terms and conditions set +# forth in the LICENSE file which can be found at the top level of +# the sendmail distribution. +# +# This ostype file is suitable for use on Solaris 11 and later systems, +# make use of /system/volatile, introduced in Solaris 11. +# + +divert(0) +VERSIONID(`$Id: solaris11.m4,v 1.1 2011/01/24 21:22:08 ca Exp $') +divert(-1) + +ifdef(`UUCP_MAILER_ARGS',, `define(`UUCP_MAILER_ARGS', `uux - -r -a$g $h!rmail ($u)')') +define(`confEBINDIR', `/usr/lib')dnl +define(`confPID_FILE', `/system/volatile/sendmail.pid')dnl +define(`_NETINET6_')dnl +FEATURE(`local_lmtp')dnl Modified: head/contrib/sendmail/contrib/qtool.pl ============================================================================== --- head/contrib/sendmail/contrib/qtool.pl Tue Jun 14 04:20:17 2011 (r223066) +++ head/contrib/sendmail/contrib/qtool.pl Tue Jun 14 04:20:18 2011 (r223067) @@ -3,7 +3,7 @@ ## Copyright (c) 1998-2002 Sendmail, Inc. and its suppliers. ## All rights reserved. ## -## $Id: qtool.pl,v 8.30 2009/03/04 16:57:30 ca Exp $ +## $Id: qtool.pl,v 8.31 2010/11/10 19:11:54 ca Exp $ ## use strict; use File::Basename; @@ -607,7 +607,7 @@ sub parse_header $first_char = substr($line, 0, 1); if ($first_char eq "?") { - $line = substr($line, 3); + $line = (split(/\?/, $line,3))[2]; } elsif ($first_char eq "\t") { Modified: head/contrib/sendmail/doc/op/op.me ============================================================================== --- head/contrib/sendmail/doc/op/op.me Tue Jun 14 04:20:17 2011 (r223066) +++ head/contrib/sendmail/doc/op/op.me Tue Jun 14 04:20:18 2011 (r223067) @@ -9,7 +9,7 @@ .\" the sendmail distribution. .\" .\" -.\" $Id: op.me,v 8.745 2009/12/13 04:12:46 ca Exp $ +.\" $Id: op.me,v 8.747 2010/05/08 04:18:27 ca Exp $ .\" .\" eqn op.me | pic | troff -me .\" @@ -90,7 +90,7 @@ Sendmail, Inc. .de Ve Version \\$2 .. -.Ve $Revision: 8.745 $ +.Ve $Revision: 8.747 $ .rm Ve .sp For Sendmail Version 8.14 @@ -1095,6 +1095,9 @@ The number of envelope recipients for th (after aliasing and forwarding). .ip msgid The message id of the message (from the header). +.ip bodytype +The message body type (7BIT or 8BITMIME), +as determined from the envelope. .ip proto The protocol used to receive this message (e.g., ESMTP or UUCP) .ip daemon @@ -5154,7 +5157,8 @@ FAIL cert presented but could not be ver e.g., the signing CA is missing. NONE STARTTLS has not been performed. TEMP temporary error occurred. -PROTOCOL some protocol error occurred. +PROTOCOL some protocol error occurred + at the ESMTP level (not TLS). SOFTWARE STARTTLS handshake failed, which is a fatal error for this session, the e-mail will be queued. @@ -11463,7 +11467,7 @@ replace it with a blank sheet for double .\".sz 10 .\"Eric Allman .\".sp -.\"Version $Revision: 8.745 $ +.\"Version $Revision: 8.747 $ .\".ce 0 .bp 3 .ce Modified: head/contrib/sendmail/include/sm/conf.h ============================================================================== --- head/contrib/sendmail/include/sm/conf.h Tue Jun 14 04:20:17 2011 (r223066) +++ head/contrib/sendmail/include/sm/conf.h Tue Jun 14 04:20:18 2011 (r223067) @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998-2009 Sendmail, Inc. and its suppliers. + * Copyright (c) 1998-2011 Sendmail, Inc. and its suppliers. * All rights reserved. * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved. * Copyright (c) 1988, 1993 @@ -10,7 +10,7 @@ * the sendmail distribution. * * - * $Id: conf.h,v 1.139 2009/06/16 23:41:32 ca Exp $ + * $Id: conf.h,v 1.144 2011/05/03 16:24:00 ca Exp $ */ /* @@ -381,6 +381,12 @@ typedef int pid_t; # ifndef __svr4__ # define __svr4__ /* use all System V Release 4 defines below */ # endif /* ! __svr4__ */ +# if SOLARIS >= 21100 +# include +# endif /* SOLARIS >= 21100 */ +# ifndef _PATH_VARRUN +# define _PATH_VARRUN "/var/run/" +# endif /* _PATH_VARRUN */ # define GIDSET_T gid_t # define USE_SA_SIGACTION 1 /* use sa_sigaction field */ # define BROKEN_PTHREAD_SLEEP 1 /* sleep after pthread_create() fails */ @@ -443,7 +449,7 @@ typedef int pid_t; # endif /* SOLARIS >= 20700 || (SOLARIS < 10000 && SOLARIS >= 207) */ # if SOLARIS >= 20800 || (SOLARIS < 10000 && SOLARIS >= 208) # undef _PATH_SENDMAILPID /* tmpfs /var/run added in 2.8 */ -# define _PATH_SENDMAILPID "/var/run/sendmail.pid" +# define _PATH_SENDMAILPID _PATH_VARRUN "sendmail.pid" # ifndef SMRSH_CMDDIR # define SMRSH_CMDDIR "/var/adm/sm.bin" # endif /* ! SMRSH_CMDDIR */ @@ -461,6 +467,8 @@ typedef int pid_t; # if SOLARIS >= 21100 || (SOLARIS < 10000 && SOLARIS >= 211) # define GETLDAPALIASBYNAME_VERSION 2 /* changed in S11 */ # define HAVE_NANOSLEEP 1 /* moved from librt to libc in S11 */ +# define SOCKADDR_LEN_T socklen_t /* arg#3 to accept, getsockname */ +# define SOCKOPT_LEN_T socklen_t /* arg#5 to getsockopt */ # endif /* SOLARIS >= 21100 || (SOLARIS < 10000 && SOLARIS >= 211) */ # ifndef HASGETUSERSHELL # define HASGETUSERSHELL 0 /* getusershell(3) causes core dumps pre-2.7 */ @@ -1014,6 +1022,9 @@ extern unsigned int sleepX __P((unsigned # if __FreeBSD_version >= 222000 /* 2.2.2-release and later */ # define HASSETUSERCONTEXT 1 /* BSDI-style login classes */ # endif /* __FreeBSD_version >= 222000 */ +# if __FreeBSD_version >= 300000 /* 3.0.0-release and later */ +# define HAVE_NANOSLEEP 1 /* has nanosleep(2) */ +# endif /* __FreeBSD_version >= 300000 */ # if __FreeBSD_version >= 330000 /* 3.3.0-release and later */ # ifndef SMRSH_CMDDIR # define SMRSH_CMDDIR "/usr/libexec/sm.bin" @@ -1055,6 +1066,9 @@ extern unsigned int sleepX __P((unsigned # if OpenBSD >= 200505 # undef NETISO /* iso.h removed in 3.7 */ # endif /* OpenBSD >= 200505 */ +# if OpenBSD >= 200800 +# define HAVE_NANOSLEEP 1 /* has nanosleep(2) */ +# endif /* OpenBSD >= 200800 */ # endif /* defined(__OpenBSD__) */ # endif /* defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) */ @@ -2808,7 +2822,7 @@ struct utsname # if _FFR_LINUX_MHNL && defined(__linux__) && MAXHOSTNAMELEN < 255 /* - ** override Linux wierdness: a FQHN can be 255 chars long + ** override Linux weirdness: a FQHN can be 255 chars long ** SUSv3 requires HOST_NAME_MAX ("Maximum length of a host ** name (not including the terminating null) as returned from the ** gethostname() function.") to be at least 255. c.f.: Modified: head/contrib/sendmail/libmilter/docs/overview.html ============================================================================== --- head/contrib/sendmail/libmilter/docs/overview.html Tue Jun 14 04:20:17 2011 (r223066) +++ head/contrib/sendmail/libmilter/docs/overview.html Tue Jun 14 04:20:18 2011 (r223067) @@ -4,7 +4,7 @@

Technical Overview

@@ -126,7 +126,7 @@ messages may be sent in a single connect Note also that a message or connection may be aborted by either the remote host or the MTA at any point during the SMTP transaction. -f this occurs during a message (between the MAIL command and the final "."), +If this occurs during a message (between the MAIL command and the final "."), the filter's xxfi_abort routine will be called. xxfi_close is called any time the Modified: head/contrib/sendmail/libmilter/docs/smfi_stop.html ============================================================================== --- head/contrib/sendmail/libmilter/docs/smfi_stop.html Tue Jun 14 04:20:17 2011 (r223066) +++ head/contrib/sendmail/libmilter/docs/smfi_stop.html Tue Jun 14 04:20:18 2011 (r223067) @@ -2,7 +2,7 @@ smfi_stop

smfi_stop

@@ -42,7 +42,7 @@ which may then exit or warm-restart. -
ArgumentDescription
voidTakes no arguement. + Takes no argument.
Modified: head/contrib/sendmail/libmilter/docs/xxfi_envrcpt.html ============================================================================== --- head/contrib/sendmail/libmilter/docs/xxfi_envrcpt.html Tue Jun 14 04:20:17 2011 (r223066) +++ head/contrib/sendmail/libmilter/docs/xxfi_envrcpt.html Tue Jun 14 04:20:18 2011 (r223067) @@ -2,7 +2,7 @@ xxfi_envrcpt

xxfi_envrcpt

@@ -71,7 +71,8 @@ Handle the envelope RCPT command. SMFIS_ACCEPT - Accept recipient. xxfi_abort will not be called. + Accept this message. + xxfi_abort will not be called. @@ -87,7 +88,7 @@ Handle the envelope RCPT command.
-Copyright (c) 2000, 2003 Sendmail, Inc. and its suppliers. +Copyright (c) 2000, 2003, 2010 Sendmail, Inc. and its suppliers. All rights reserved.
By using this file, you agree to the terms and conditions set Modified: head/contrib/sendmail/libmilter/engine.c ============================================================================== --- head/contrib/sendmail/libmilter/engine.c Tue Jun 14 04:20:17 2011 (r223066) +++ head/contrib/sendmail/libmilter/engine.c Tue Jun 14 04:20:18 2011 (r223067) @@ -9,7 +9,7 @@ */ #include -SM_RCSID("@(#)$Id: engine.c,v 8.166 2009/11/06 00:57:07 ca Exp $") +SM_RCSID("@(#)$Id: engine.c,v 8.167 2011/03/03 06:09:15 ca Exp $") #include "libmilter.h" @@ -284,7 +284,7 @@ mi_engine(ctx) if (mi_stop() == MILTER_ABRT) { if (ctx->ctx_dbg > 3) - sm_dprintf("[%ld] milter_abort\n", + sm_dprintf("[%lu] milter_abort\n", (long) ctx->ctx_id); ret = MI_FAILURE; break; @@ -315,7 +315,7 @@ mi_engine(ctx) cmd < SMFIC_VALIDCMD) { if (ctx->ctx_dbg > 5) - sm_dprintf("[%ld] mi_engine: mi_rd_cmd error (%x)\n", + sm_dprintf("[%lu] mi_engine: mi_rd_cmd error (%x)\n", (long) ctx->ctx_id, (int) cmd); /* @@ -328,7 +328,7 @@ mi_engine(ctx) break; } if (ctx->ctx_dbg > 4) - sm_dprintf("[%ld] got cmd '%c' len %d\n", + sm_dprintf("[%lu] got cmd '%c' len %d\n", (long) ctx->ctx_id, cmd, (int) len); for (i = 0; i < ncmds; i++) { @@ -339,7 +339,7 @@ mi_engine(ctx) { /* unknown command */ if (ctx->ctx_dbg > 1) - sm_dprintf("[%ld] cmd '%c' unknown\n", + sm_dprintf("[%lu] cmd '%c' unknown\n", (long) ctx->ctx_id, cmd); ret = MI_FAILURE; break; @@ -348,7 +348,7 @@ mi_engine(ctx) { /* stop for now */ if (ctx->ctx_dbg > 1) - sm_dprintf("[%ld] cmd '%c' not impl\n", + sm_dprintf("[%lu] cmd '%c' not impl\n", (long) ctx->ctx_id, cmd); ret = MI_FAILURE; break; @@ -357,14 +357,14 @@ mi_engine(ctx) /* is new state ok? */ newstate = cmds[i].cm_next; if (ctx->ctx_dbg > 5) - sm_dprintf("[%ld] cur %x new %x nextmask %x\n", + sm_dprintf("[%lu] cur %x new %x nextmask %x\n", (long) ctx->ctx_id, curstate, newstate, next_states[curstate]); if (newstate != ST_NONE && !trans_ok(curstate, newstate)) { if (ctx->ctx_dbg > 1) - sm_dprintf("[%ld] abort: cur %d (%x) new %d (%x) next %x\n", + sm_dprintf("[%lu] abort: cur %d (%x) new %d (%x) next %x\n", (long) ctx->ctx_id, curstate, MI_MASK(curstate), newstate, MI_MASK(newstate), @@ -434,7 +434,7 @@ mi_engine(ctx) else if (r == _SMFIS_ABORT) { if (ctx->ctx_dbg > 5) - sm_dprintf("[%ld] function returned abort\n", + sm_dprintf("[%lu] function returned abort\n", (long) ctx->ctx_id); ret = MI_FAILURE; break; @@ -1122,7 +1122,7 @@ st_optionneg(g) fix_stm(ctx); if (ctx->ctx_dbg > 3) - sm_dprintf("[%ld] milter_negotiate:" + sm_dprintf("[%lu] milter_negotiate:" " mta_actions=0x%lx, mta_flags=0x%lx" " actions=0x%lx, flags=0x%lx\n" , (long) ctx->ctx_id @@ -1131,7 +1131,7 @@ st_optionneg(g) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Tue Jun 14 04:33:44 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 41BBE106564A; Tue, 14 Jun 2011 04:33:44 +0000 (UTC) (envelope-from gshapiro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 317B98FC0A; Tue, 14 Jun 2011 04:33:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5E4XiC7013541; Tue, 14 Jun 2011 04:33:44 GMT (envelope-from gshapiro@svn.freebsd.org) Received: (from gshapiro@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5E4XirN013539; Tue, 14 Jun 2011 04:33:44 GMT (envelope-from gshapiro@svn.freebsd.org) Message-Id: <201106140433.p5E4XirN013539@svn.freebsd.org> From: Gregory Neil Shapiro Date: Tue, 14 Jun 2011 04:33:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223068 - head/etc/sendmail X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jun 2011 04:33:44 -0000 Author: gshapiro Date: Tue Jun 14 04:33:43 2011 New Revision: 223068 URL: http://svn.freebsd.org/changeset/base/223068 Log: Update DNSBL information (MAPS has been acquired, used a generic example) Modified: head/etc/sendmail/freebsd.mc Modified: head/etc/sendmail/freebsd.mc ============================================================================== --- head/etc/sendmail/freebsd.mc Tue Jun 14 04:20:18 2011 (r223067) +++ head/etc/sendmail/freebsd.mc Tue Jun 14 04:33:43 2011 (r223068) @@ -66,12 +66,10 @@ dnl so this file will not serve as a dat dnl For that, visit dnl http://www.google.com/Top/Computers/Internet/E-mail/Spam/Blacklists/ -dnl Uncomment to activate Realtime Blackhole List -dnl information available at http://www.mail-abuse.com/ -dnl NOTE: This is a subscription service as of July 31, 2001 -dnl FEATURE(dnsbl) +dnl Uncomment to activate your chosen DNS based blacklist +dnl FEATURE(dnsbl, `dnsbl.example.com') dnl Alternatively, you can provide your own server and rejection message: -dnl FEATURE(dnsbl, `blackholes.mail-abuse.org', ``"550 Mail from " $&{client_addr} " rejected, see http://mail-abuse.org/cgi-bin/lookup?" $&{client_addr}'') +dnl FEATURE(dnsbl, `dnsbl.example.com', ``"550 Mail from " $&{client_addr} " rejected'') dnl Dialup users should uncomment and define this appropriately dnl define(`SMART_HOST', `your.isp.mail.server') From owner-svn-src-head@FreeBSD.ORG Tue Jun 14 04:34:20 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ABD2E106566C; Tue, 14 Jun 2011 04:34:20 +0000 (UTC) (envelope-from gshapiro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9C10F8FC0C; Tue, 14 Jun 2011 04:34:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5E4YKCu013599; Tue, 14 Jun 2011 04:34:20 GMT (envelope-from gshapiro@svn.freebsd.org) Received: (from gshapiro@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5E4YKo7013597; Tue, 14 Jun 2011 04:34:20 GMT (envelope-from gshapiro@svn.freebsd.org) Message-Id: <201106140434.p5E4YKo7013597@svn.freebsd.org> From: Gregory Neil Shapiro Date: Tue, 14 Jun 2011 04:34:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223069 - head/etc/sendmail X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jun 2011 04:34:20 -0000 Author: gshapiro Date: Tue Jun 14 04:34:20 2011 New Revision: 223069 URL: http://svn.freebsd.org/changeset/base/223069 Log: Minor change to force commit this file so new freebsd*.cf files are built to use the new sendmail-8.14.5/cf tree. MFC after: 4 days Modified: head/etc/sendmail/freebsd.submit.mc Modified: head/etc/sendmail/freebsd.submit.mc ============================================================================== --- head/etc/sendmail/freebsd.submit.mc Tue Jun 14 04:33:43 2011 (r223068) +++ head/etc/sendmail/freebsd.submit.mc Tue Jun 14 04:34:20 2011 (r223069) @@ -25,4 +25,3 @@ define(`confBIND_OPTS', `WorkAroundBroke dnl dnl If you use IPv6 only, change [127.0.0.1] to [IPv6:::1] FEATURE(`msp', `[127.0.0.1]')dnl - From owner-svn-src-head@FreeBSD.ORG Tue Jun 14 06:44:42 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F04BC106566B; Tue, 14 Jun 2011 06:44:42 +0000 (UTC) (envelope-from gshapiro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DFF8D8FC14; Tue, 14 Jun 2011 06:44:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5E6igL7017261; Tue, 14 Jun 2011 06:44:42 GMT (envelope-from gshapiro@svn.freebsd.org) Received: (from gshapiro@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5E6igKo017259; Tue, 14 Jun 2011 06:44:42 GMT (envelope-from gshapiro@svn.freebsd.org) Message-Id: <201106140644.p5E6igKo017259@svn.freebsd.org> From: Gregory Neil Shapiro Date: Tue, 14 Jun 2011 06:44:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223071 - head/contrib/sendmail X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jun 2011 06:44:43 -0000 Author: gshapiro Date: Tue Jun 14 06:44:42 2011 New Revision: 223071 URL: http://svn.freebsd.org/changeset/base/223071 Log: Update notes regarding FreeBSD import Modified: head/contrib/sendmail/FREEBSD-upgrade Modified: head/contrib/sendmail/FREEBSD-upgrade ============================================================================== --- head/contrib/sendmail/FREEBSD-upgrade Tue Jun 14 04:37:09 2011 (r223070) +++ head/contrib/sendmail/FREEBSD-upgrade Tue Jun 14 06:44:42 2011 (r223071) @@ -1,6 +1,6 @@ $FreeBSD$ -sendmail 8.14.4 +sendmail 8.14.5 originals can be found at: ftp://ftp.sendmail.org/pub/sendmail/ For the import of sendmail, the following directories were renamed: @@ -110,4 +110,4 @@ infrastructure in FreeBSD: usr.sbin/mailwrapper/Makefile gshapiro@FreeBSD.org -25-January-2010 +13-June-2011 From owner-svn-src-head@FreeBSD.ORG Tue Jun 14 06:45:49 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 550B6106564A; Tue, 14 Jun 2011 06:45:49 +0000 (UTC) (envelope-from gshapiro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4497A8FC12; Tue, 14 Jun 2011 06:45:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5E6jnDS017334; Tue, 14 Jun 2011 06:45:49 GMT (envelope-from gshapiro@svn.freebsd.org) Received: (from gshapiro@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5E6jnbo017332; Tue, 14 Jun 2011 06:45:49 GMT (envelope-from gshapiro@svn.freebsd.org) Message-Id: <201106140645.p5E6jnbo017332@svn.freebsd.org> From: Gregory Neil Shapiro Date: Tue, 14 Jun 2011 06:45:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223072 - head/release/doc/en_US.ISO8859-1/relnotes X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jun 2011 06:45:49 -0000 Author: gshapiro Date: Tue Jun 14 06:45:48 2011 New Revision: 223072 URL: http://svn.freebsd.org/changeset/base/223072 Log: sendmail has been updated to 8.14.5 Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.sgml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.sgml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.sgml Tue Jun 14 06:44:42 2011 (r223071) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.sgml Tue Jun 14 06:45:48 2011 (r223072) @@ -480,7 +480,7 @@ Figwort release to the Hydrangea release. sendmail has been updated from - 8.14.1 to 8.14.4. + 8.14.1 to 8.14.5. The timezone database has been updated from the tzdata2008h release to From owner-svn-src-head@FreeBSD.ORG Tue Jun 14 07:20:16 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9F011065673; Tue, 14 Jun 2011 07:20:16 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BEB6C8FC23; Tue, 14 Jun 2011 07:20:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5E7KG94018392; Tue, 14 Jun 2011 07:20:16 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5E7KGAu018390; Tue, 14 Jun 2011 07:20:16 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201106140720.p5E7KGAu018390@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Tue, 14 Jun 2011 07:20:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223073 - head/sys/netinet/ipfw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jun 2011 07:20:16 -0000 Author: ae Date: Tue Jun 14 07:20:16 2011 New Revision: 223073 URL: http://svn.freebsd.org/changeset/base/223073 Log: Add IPv6 support to the ipfw uid/gid check. Pass an ip_fw_args structure to the check_uidgid() function, since it contains all needed arguments and also pointer to mbuf and now it is possible use in_pcblookup_mbuf() function. Since i can not test it for the non-FreeBSD case, i keep this ifdef unchanged. Tested by: Alexander V. Chernikov MFC after: 3 weeks Modified: head/sys/netinet/ipfw/ip_fw2.c Modified: head/sys/netinet/ipfw/ip_fw2.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw2.c Tue Jun 14 06:45:48 2011 (r223072) +++ head/sys/netinet/ipfw/ip_fw2.c Tue Jun 14 07:20:16 2011 (r223073) @@ -84,6 +84,7 @@ __FBSDID("$FreeBSD$"); #include #include #ifdef INET6 +#include #include #include #endif @@ -646,21 +647,27 @@ send_reject(struct ip_fw_args *args, int * we tried and failed, or any other value if successful. */ static int -check_uidgid(ipfw_insn_u32 *insn, int proto, struct ifnet *oif, - struct in_addr dst_ip, u_int16_t dst_port, struct in_addr src_ip, - u_int16_t src_port, int *ugid_lookupp, - struct ucred **uc, struct inpcb *inp) +check_uidgid(ipfw_insn_u32 *insn, struct ip_fw_args *args, int *ugid_lookupp, + struct ucred **uc) { #ifndef __FreeBSD__ + /* XXX */ return cred_check(insn, proto, oif, dst_ip, dst_port, src_ip, src_port, (struct bsd_ucred *)uc, ugid_lookupp, ((struct mbuf *)inp)->m_skb); #else /* FreeBSD */ + struct in_addr src_ip, dst_ip; struct inpcbinfo *pi; + struct ipfw_flow_id *id; + struct inpcb *pcb, *inp; + struct ifnet *oif; int lookupflags; - struct inpcb *pcb; int match; + id = &args->f_id; + inp = args->inp; + oif = args->oif; + /* * Check to see if the UDP or TCP stack supplied us with * the PCB. If so, rather then holding a lock and looking @@ -681,10 +688,10 @@ check_uidgid(ipfw_insn_u32 *insn, int pr */ if (*ugid_lookupp == -1) return (0); - if (proto == IPPROTO_TCP) { + if (id->proto == IPPROTO_TCP) { lookupflags = 0; pi = &V_tcbinfo; - } else if (proto == IPPROTO_UDP) { + } else if (id->proto == IPPROTO_UDP) { lookupflags = INPLOOKUP_WILDCARD; pi = &V_udbinfo; } else @@ -692,19 +699,36 @@ check_uidgid(ipfw_insn_u32 *insn, int pr lookupflags |= INPLOOKUP_RLOCKPCB; match = 0; if (*ugid_lookupp == 0) { - /* - * XXXRW: If we had the mbuf here, could use - * in_pcblookup_mbuf(). - */ - pcb = (oif) ? - in_pcblookup(pi, - dst_ip, htons(dst_port), - src_ip, htons(src_port), - lookupflags, oif) : - in_pcblookup(pi, - src_ip, htons(src_port), - dst_ip, htons(dst_port), - lookupflags, NULL); + if (id->addr_type == 6) { +#ifdef INET6 + if (oif == NULL) + pcb = in6_pcblookup_mbuf(pi, + &id->src_ip6, htons(id->src_port), + &id->dst_ip6, htons(id->dst_port), + lookupflags, oif, args->m); + else + pcb = in6_pcblookup_mbuf(pi, + &id->dst_ip6, htons(id->dst_port), + &id->src_ip6, htons(id->src_port), + lookupflags, oif, args->m); +#else + *ugid_lookupp = -1; + return (0); +#endif + } else { + src_ip.s_addr = htonl(id->src_ip); + dst_ip.s_addr = htonl(id->dst_ip); + if (oif == NULL) + pcb = in_pcblookup_mbuf(pi, + src_ip, htons(id->src_port), + dst_ip, htons(id->dst_port), + lookupflags, oif, args->m); + else + pcb = in_pcblookup_mbuf(pi, + dst_ip, htons(id->dst_port), + src_ip, htons(id->src_port), + lookupflags, oif, args->m); + } if (pcb != NULL) { INP_RLOCK_ASSERT(pcb); *uc = crhold(pcb->inp_cred); @@ -719,14 +743,14 @@ check_uidgid(ipfw_insn_u32 *insn, int pr *ugid_lookupp = -1; return (0); } - } + } if (insn->o.opcode == O_UID) match = ((*uc)->cr_uid == (uid_t)insn->d[0]); else if (insn->o.opcode == O_GID) match = groupmember((gid_t)insn->d[0], *uc); else if (insn->o.opcode == O_JAIL) match = ((*uc)->cr_prison->pr_id == (int)insn->d[0]); - return match; + return (match); #endif /* __FreeBSD__ */ } @@ -1264,22 +1288,17 @@ do { \ * as this ensures that we have a * packet with the ports info. */ - if (offset!=0) - break; - if (is_ipv6) /* XXX to be fixed later */ + if (offset != 0) break; if (proto == IPPROTO_TCP || proto == IPPROTO_UDP) match = check_uidgid( (ipfw_insn_u32 *)cmd, - proto, oif, - dst_ip, dst_port, - src_ip, src_port, &ucred_lookup, + args, &ucred_lookup, #ifdef __FreeBSD__ - &ucred_cache, args->inp); + &ucred_cache); #else - (void *)&ucred_cache, - (struct inpcb *)args->m); + (void *)&ucred_cache); #endif break; @@ -1394,18 +1413,15 @@ do { \ else if (v == 4 || v == 5) { check_uidgid( (ipfw_insn_u32 *)cmd, - proto, oif, - dst_ip, dst_port, - src_ip, src_port, &ucred_lookup, + args, &ucred_lookup, #ifdef __FreeBSD__ - &ucred_cache, args->inp); + &ucred_cache); if (v == 4 /* O_UID */) key = ucred_cache->cr_uid; else if (v == 5 /* O_JAIL */) key = ucred_cache->cr_prison->pr_id; #else /* !__FreeBSD__ */ - (void *)&ucred_cache, - (struct inpcb *)args->m); + (void *)&ucred_cache); if (v ==4 /* O_UID */) key = ucred_cache.uid; else if (v == 5 /* O_JAIL */) From owner-svn-src-head@FreeBSD.ORG Tue Jun 14 12:06:39 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 40FC11065673; Tue, 14 Jun 2011 12:06:39 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 312288FC15; Tue, 14 Jun 2011 12:06:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5EC6dCT033639; Tue, 14 Jun 2011 12:06:39 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5EC6dPF033637; Tue, 14 Jun 2011 12:06:39 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201106141206.p5EC6dPF033637@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Tue, 14 Jun 2011 12:06:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223077 - head/sys/netinet/libalias X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jun 2011 12:06:39 -0000 Author: ae Date: Tue Jun 14 12:06:38 2011 New Revision: 223077 URL: http://svn.freebsd.org/changeset/base/223077 Log: Sort alias mode flags in the increasing order. Modified: head/sys/netinet/libalias/alias.h Modified: head/sys/netinet/libalias/alias.h ============================================================================== --- head/sys/netinet/libalias/alias.h Tue Jun 14 10:50:16 2011 (r223076) +++ head/sys/netinet/libalias/alias.h Tue Jun 14 12:06:38 2011 (r223077) @@ -197,17 +197,6 @@ struct mbuf *m_megapullup(struct mbuf */ #define PKT_ALIAS_RESET_ON_ADDR_CHANGE 0x20 -#ifndef NO_FW_PUNCH -/* - * If PKT_ALIAS_PUNCH_FW is set, active FTP and IRC DCC connections will - * create a 'hole' in the firewall to allow the transfers to work. The - * ipfw rule number that the hole is created with is controlled by - * PacketAliasSetFWBase(). The hole will be attached to that - * particular alias_link, so when the link goes away the hole is deleted. - */ -#define PKT_ALIAS_PUNCH_FW 0x100 -#endif - /* * If PKT_ALIAS_PROXY_ONLY is set, then NAT will be disabled and only * transparent proxying is performed. @@ -220,6 +209,17 @@ struct mbuf *m_megapullup(struct mbuf */ #define PKT_ALIAS_REVERSE 0x80 +#ifndef NO_FW_PUNCH +/* + * If PKT_ALIAS_PUNCH_FW is set, active FTP and IRC DCC connections will + * create a 'hole' in the firewall to allow the transfers to work. The + * ipfw rule number that the hole is created with is controlled by + * PacketAliasSetFWBase(). The hole will be attached to that + * particular alias_link, so when the link goes away the hole is deleted. + */ +#define PKT_ALIAS_PUNCH_FW 0x100 +#endif + /* Function return codes. */ #define PKT_ALIAS_ERROR -1 #define PKT_ALIAS_OK 1 From owner-svn-src-head@FreeBSD.ORG Tue Jun 14 12:40:56 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3134D1065677; Tue, 14 Jun 2011 12:40:56 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BDA748FC13; Tue, 14 Jun 2011 12:40:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5ECetXu034681; Tue, 14 Jun 2011 12:40:55 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5ECetMH034678; Tue, 14 Jun 2011 12:40:55 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201106141240.p5ECetMH034678@svn.freebsd.org> From: Luigi Rizzo Date: Tue, 14 Jun 2011 12:40:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223078 - in head: sbin/ifconfig sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jun 2011 12:40:56 -0000 Author: luigi Date: Tue Jun 14 12:40:55 2011 New Revision: 223078 URL: http://svn.freebsd.org/changeset/base/223078 Log: Grab one of the ifcap bits for netmap, and enable printing in ifconfig. Document the fact that we might want an IFCAP_CANTCHANGE mask, even though the value is not yet used in sys/net/if.c (asked on -current a week ago, no feedback so i assume no objection). Modified: head/sbin/ifconfig/ifconfig.c head/sys/net/if.h Modified: head/sbin/ifconfig/ifconfig.c ============================================================================== --- head/sbin/ifconfig/ifconfig.c Tue Jun 14 12:06:38 2011 (r223077) +++ head/sbin/ifconfig/ifconfig.c Tue Jun 14 12:40:55 2011 (r223078) @@ -908,7 +908,7 @@ unsetifdescr(const char *val, int value, #define IFCAPBITS \ "\020\1RXCSUM\2TXCSUM\3NETCONS\4VLAN_MTU\5VLAN_HWTAGGING\6JUMBO_MTU\7POLLING" \ "\10VLAN_HWCSUM\11TSO4\12TSO6\13LRO\14WOL_UCAST\15WOL_MCAST\16WOL_MAGIC" \ -"\21VLAN_HWFILTER\23VLAN_HWTSO\24LINKSTATE" +"\21VLAN_HWFILTER\23VLAN_HWTSO\24LINKSTATE\25NETMAP" /* * Print the status of the interface. If an address family was Modified: head/sys/net/if.h ============================================================================== --- head/sys/net/if.h Tue Jun 14 12:06:38 2011 (r223077) +++ head/sys/net/if.h Tue Jun 14 12:40:55 2011 (r223078) @@ -199,6 +199,13 @@ struct if_data { * field. IFCAP_* and CSUM_* do not match one to one and CSUM_* may be * more detailed or differenciated than IFCAP_*. * Hwassist features are defined CSUM_* in sys/mbuf.h + * + * Capabilities that cannot be arbitrarily changed with ifconfig/ioctl + * are listed in IFCAP_CANTCHANGE, similar to IFF_CANTCHANGE. + * This is not strictly necessary because the common code never + * changes capabilities, and it is left to the individual driver + * to do the right thing. However, having the filter here + * avoids replication of the same code in all individual drivers. */ #define IFCAP_RXCSUM 0x00001 /* can offload checksum on RX */ #define IFCAP_TXCSUM 0x00002 /* can offload checksum on TX */ @@ -220,12 +227,15 @@ struct if_data { #define IFCAP_POLLING_NOCOUNT 0x20000 /* polling ticks cannot be fragmented */ #define IFCAP_VLAN_HWTSO 0x40000 /* can do IFCAP_TSO on VLANs */ #define IFCAP_LINKSTATE 0x80000 /* the runtime link state is dynamic */ +#define IFCAP_NETMAP 0x100000 /* netmap mode supported/enabled */ #define IFCAP_HWCSUM (IFCAP_RXCSUM | IFCAP_TXCSUM) #define IFCAP_TSO (IFCAP_TSO4 | IFCAP_TSO6) #define IFCAP_WOL (IFCAP_WOL_UCAST | IFCAP_WOL_MCAST | IFCAP_WOL_MAGIC) #define IFCAP_TOE (IFCAP_TOE4 | IFCAP_TOE6) +#define IFCAP_CANTCHANGE (IFCAP_NETMAP) + #define IFQ_MAXLEN 50 #define IFNET_SLOWHZ 1 /* granularity is 1 second */ From owner-svn-src-head@FreeBSD.ORG Tue Jun 14 13:02:26 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6DA7A1065670; Tue, 14 Jun 2011 13:02:26 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5DE078FC16; Tue, 14 Jun 2011 13:02:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5ED2QUI036245; Tue, 14 Jun 2011 13:02:26 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5ED2QJ8036243; Tue, 14 Jun 2011 13:02:26 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201106141302.p5ED2QJ8036243@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Tue, 14 Jun 2011 13:02:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223079 - head/sbin/ipfw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jun 2011 13:02:26 -0000 Author: ae Date: Tue Jun 14 13:02:26 2011 New Revision: 223079 URL: http://svn.freebsd.org/changeset/base/223079 Log: Check nat id a bit more strictly. Modified: head/sbin/ipfw/nat.c Modified: head/sbin/ipfw/nat.c ============================================================================== --- head/sbin/ipfw/nat.c Tue Jun 14 12:40:55 2011 (r223078) +++ head/sbin/ipfw/nat.c Tue Jun 14 13:02:26 2011 (r223079) @@ -721,16 +721,18 @@ ipfw_config_nat(int ac, char **av) { struct cfg_nat *n; /* Nat instance configuration. */ int i, off, tok, ac1; - char *id, *buf, **av1; + char *id, *buf, **av1, *end; size_t len; av++; ac--; /* Nat id. */ - if (ac && isdigit(**av)) { - id = *av; - ac--; av++; - } else + if (ac == 0) errx(EX_DATAERR, "missing nat id"); + id = *av; + i = (int)strtol(id, &end, 0); + if (i <= 0 || *end != '\0') + errx(EX_DATAERR, "illegal nat id: %s", id); + av++; ac--; if (ac == 0) errx(EX_DATAERR, "missing option"); @@ -787,7 +789,6 @@ ipfw_config_nat(int ac, char **av) off = sizeof(*n); memset(buf, 0, len); n = (struct cfg_nat *)buf; - i = atoi(id); n->id = i; while (ac > 0) { From owner-svn-src-head@FreeBSD.ORG Tue Jun 14 13:35:25 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C51E1065688; Tue, 14 Jun 2011 13:35:25 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BF0638FC18; Tue, 14 Jun 2011 13:35:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5EDZOEZ037253; Tue, 14 Jun 2011 13:35:24 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5EDZO1U037245; Tue, 14 Jun 2011 13:35:24 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201106141335.p5EDZO1U037245@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Tue, 14 Jun 2011 13:35:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223080 - in head: sbin/ipfw sys/netinet/ipfw sys/netinet/libalias X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jun 2011 13:35:25 -0000 Author: ae Date: Tue Jun 14 13:35:24 2011 New Revision: 223080 URL: http://svn.freebsd.org/changeset/base/223080 Log: Implement "global" mode for ipfw nat. It is similar to natd(8) "globalport" option for multiple NAT instances. If ipfw rule contains "global" keyword instead of nat_number, then for each outgoing packet ipfw_nat looks up translation state in all configured nat instances. If an entry is found, packet aliased according to that entry, otherwise packet is passed unchanged. User can specify "skip_global" option in NAT configuration to exclude an instance from the lookup in global mode. PR: kern/157867 Submitted by: Alexander V. Chernikov (previous version) Tested by: Eugene Grosbein Modified: head/sbin/ipfw/ipfw.8 head/sbin/ipfw/ipfw2.c head/sbin/ipfw/ipfw2.h head/sbin/ipfw/nat.c head/sys/netinet/ipfw/ip_fw2.c head/sys/netinet/ipfw/ip_fw_nat.c head/sys/netinet/libalias/alias.h Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Tue Jun 14 13:02:26 2011 (r223079) +++ head/sbin/ipfw/ipfw.8 Tue Jun 14 13:35:24 2011 (r223080) @@ -1,7 +1,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 30, 2011 +.Dd June 14, 2011 .Dt IPFW 8 .Os .Sh NAME @@ -2435,6 +2435,27 @@ Reset table of the packet aliasing engin Reverse the way libalias handles aliasing. .It Cm proxy_only Obey transparent proxy rules only, packet aliasing is not performed. +.It Cm skip_global +Skip instance in case of global state lookup (see below). +.El +.Pp +Some specials value can be supplied instead of +.Va nat_number: +.Bl -tag -width indent +.It Cm global +Looks up translation state in all configured nat instances. +If an entry is found, packet is aliased according to that entry. +If no entry was found in any of the instances, packet is passed unchanged, +and no new entry will be created. +See section +.Sx MULTIPLE INSTANCES +in +.Xr natd 8 +for more information. +.It Cm tablearg +Uses argument supplied in lookup table. See +.Sx LOOKUP TABLES +section below for more information on lookup tables. .El .Pp To let the packet continue after being (de)aliased, set the sysctl variable Modified: head/sbin/ipfw/ipfw2.c ============================================================================== --- head/sbin/ipfw/ipfw2.c Tue Jun 14 13:02:26 2011 (r223079) +++ head/sbin/ipfw/ipfw2.c Tue Jun 14 13:35:24 2011 (r223080) @@ -1121,8 +1121,11 @@ show_ipfw(struct ip_fw *rule, int pcwidt break; case O_NAT: - PRINT_UINT_ARG("nat ", cmd->arg1); - break; + if (cmd->arg1 != 0) + PRINT_UINT_ARG("nat ", cmd->arg1); + else + printf("nat global"); + break; case O_SETFIB: PRINT_UINT_ARG("setfib ", cmd->arg1); @@ -2738,9 +2741,14 @@ ipfw_add(char *av[]) break; case TOK_NAT: - action->opcode = O_NAT; - action->len = F_INSN_SIZE(ipfw_insn_nat); - goto chkarg; + action->opcode = O_NAT; + action->len = F_INSN_SIZE(ipfw_insn_nat); + if (_substrcmp(*av, "global") == 0) { + action->arg1 = 0; + av++; + break; + } else + goto chkarg; case TOK_QUEUE: action->opcode = O_QUEUE; Modified: head/sbin/ipfw/ipfw2.h ============================================================================== --- head/sbin/ipfw/ipfw2.h Tue Jun 14 13:02:26 2011 (r223079) +++ head/sbin/ipfw/ipfw2.h Tue Jun 14 13:35:24 2011 (r223080) @@ -178,6 +178,7 @@ enum tokens { TOK_DENY_INC, TOK_SAME_PORTS, TOK_UNREG_ONLY, + TOK_SKIP_GLOBAL, TOK_RESET_ADDR, TOK_ALIAS_REV, TOK_PROXY_ONLY, Modified: head/sbin/ipfw/nat.c ============================================================================== --- head/sbin/ipfw/nat.c Tue Jun 14 13:02:26 2011 (r223079) +++ head/sbin/ipfw/nat.c Tue Jun 14 13:35:24 2011 (r223080) @@ -53,6 +53,7 @@ static struct _s_x nat_params[] = { { "deny_in", TOK_DENY_INC }, { "same_ports", TOK_SAME_PORTS }, { "unreg_only", TOK_UNREG_ONLY }, + { "skip_global", TOK_SKIP_GLOBAL }, { "reset", TOK_RESET_ADDR }, { "reverse", TOK_ALIAS_REV }, { "proxy_only", TOK_PROXY_ONLY }, @@ -628,6 +629,9 @@ print_nat_config(unsigned char *buf) } else if (n->mode & PKT_ALIAS_SAME_PORTS) { printf(" same_ports"); n->mode &= ~PKT_ALIAS_SAME_PORTS; + } else if (n->mode & PKT_ALIAS_SKIP_GLOBAL) { + printf(" skip_global"); + n->mode &= ~PKT_ALIAS_SKIP_GLOBAL; } else if (n->mode & PKT_ALIAS_UNREGISTERED_ONLY) { printf(" unreg_only"); n->mode &= ~PKT_ALIAS_UNREGISTERED_ONLY; @@ -746,10 +750,11 @@ ipfw_config_nat(int ac, char **av) case TOK_IP: case TOK_IF: ac1--; av1++; - break; + break; case TOK_ALOG: case TOK_DENY_INC: case TOK_SAME_PORTS: + case TOK_SKIP_GLOBAL: case TOK_UNREG_ONLY: case TOK_RESET_ADDR: case TOK_ALIAS_REV: @@ -821,6 +826,9 @@ ipfw_config_nat(int ac, char **av) case TOK_UNREG_ONLY: n->mode |= PKT_ALIAS_UNREGISTERED_ONLY; break; + case TOK_SKIP_GLOBAL: + n->mode |= PKT_ALIAS_SKIP_GLOBAL; + break; case TOK_RESET_ADDR: n->mode |= PKT_ALIAS_RESET_ON_ADDR_CHANGE; break; Modified: head/sys/netinet/ipfw/ip_fw2.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw2.c Tue Jun 14 13:02:26 2011 (r223079) +++ head/sys/netinet/ipfw/ip_fw2.c Tue Jun 14 13:35:24 2011 (r223080) @@ -2194,6 +2194,13 @@ do { \ int nat_id; set_match(args, f_pos, chain); + /* Check if this is 'global' nat rule */ + if (cmd->arg1 == 0) { + retval = ipfw_nat_ptr(args, NULL, m); + l = 0; + done = 1; + break; + } t = ((ipfw_insn_nat *)cmd)->nat; if (t == NULL) { nat_id = (cmd->arg1 == IP_FW_TABLEARG) ? Modified: head/sys/netinet/ipfw/ip_fw_nat.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw_nat.c Tue Jun 14 13:02:26 2011 (r223079) +++ head/sys/netinet/ipfw/ip_fw_nat.c Tue Jun 14 13:35:24 2011 (r223080) @@ -207,7 +207,8 @@ ipfw_nat(struct ip_fw_args *args, struct struct mbuf *mcl; struct ip *ip; /* XXX - libalias duct tape */ - int ldt, retval; + int ldt, retval, found; + struct ip_fw_chain *chain; char *c; ldt = 0; @@ -256,12 +257,44 @@ ipfw_nat(struct ip_fw_args *args, struct ldt = 1; c = mtod(mcl, char *); - if (args->oif == NULL) - retval = LibAliasIn(t->lib, c, - mcl->m_len + M_TRAILINGSPACE(mcl)); - else - retval = LibAliasOut(t->lib, c, - mcl->m_len + M_TRAILINGSPACE(mcl)); + + /* Check if this is 'global' instance */ + if (t == NULL) { + if (args->oif == NULL) { + /* Wrong direction, skip processing */ + args->m = mcl; + return (IP_FW_NAT); + } + + found = 0; + chain = &V_layer3_chain; + IPFW_RLOCK(chain); + /* Check every nat entry... */ + LIST_FOREACH(t, &chain->nat, _next) { + if ((t->mode & PKT_ALIAS_SKIP_GLOBAL) != 0) + continue; + retval = LibAliasOutTry(t->lib, c, + mcl->m_len + M_TRAILINGSPACE(mcl), 0); + if (retval == PKT_ALIAS_OK) { + /* Nat instance recognises state */ + found = 1; + break; + } + } + IPFW_RUNLOCK(chain); + if (found != 1) { + /* No instance found, return ignore */ + args->m = mcl; + return (IP_FW_NAT); + } + } else { + if (args->oif == NULL) + retval = LibAliasIn(t->lib, c, + mcl->m_len + M_TRAILINGSPACE(mcl)); + else + retval = LibAliasOut(t->lib, c, + mcl->m_len + M_TRAILINGSPACE(mcl)); + } /* * We drop packet when: @@ -274,7 +307,7 @@ ipfw_nat(struct ip_fw_args *args, struct if (retval == PKT_ALIAS_ERROR || (args->oif == NULL && (retval == PKT_ALIAS_UNRESOLVED_FRAGMENT || (retval == PKT_ALIAS_IGNORED && - (t->lib->packetAliasMode & PKT_ALIAS_DENY_INCOMING) != 0)))) { + (t->mode & PKT_ALIAS_DENY_INCOMING) != 0)))) { /* XXX - should i add some logging? */ m_free(mcl); args->m = NULL; Modified: head/sys/netinet/libalias/alias.h ============================================================================== --- head/sys/netinet/libalias/alias.h Tue Jun 14 13:02:26 2011 (r223079) +++ head/sys/netinet/libalias/alias.h Tue Jun 14 13:35:24 2011 (r223080) @@ -220,6 +220,12 @@ struct mbuf *m_megapullup(struct mbuf #define PKT_ALIAS_PUNCH_FW 0x100 #endif +/* + * If PKT_ALIAS_SKIP_GLOBAL is set, nat instance is not checked for matching + * states in 'ipfw nat global' rule. + */ +#define PKT_ALIAS_SKIP_GLOBAL 0x200 + /* Function return codes. */ #define PKT_ALIAS_ERROR -1 #define PKT_ALIAS_OK 1 From owner-svn-src-head@FreeBSD.ORG Tue Jun 14 14:53:18 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3599B1065673; Tue, 14 Jun 2011 14:53:18 +0000 (UTC) (envelope-from gibbs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 237F78FC12; Tue, 14 Jun 2011 14:53:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5EErI5R039649; Tue, 14 Jun 2011 14:53:18 GMT (envelope-from gibbs@svn.freebsd.org) Received: (from gibbs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5EErH3q039637; Tue, 14 Jun 2011 14:53:17 GMT (envelope-from gibbs@svn.freebsd.org) Message-Id: <201106141453.p5EErH3q039637@svn.freebsd.org> From: "Justin T. Gibbs" Date: Tue, 14 Jun 2011 14:53:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223081 - in head: sbin/camcontrol sys/cam sys/cam/scsi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jun 2011 14:53:18 -0000 Author: gibbs Date: Tue Jun 14 14:53:17 2011 New Revision: 223081 URL: http://svn.freebsd.org/changeset/base/223081 Log: Lay groundwork in CAM for recording and reporting physical path and other device attributes stored in the CAM Existing Device Table (EDT). This includes some infrastructure requried by the enclosure services driver to export physical path information. Make the CAM device advanced info interface accept store requests. sys/cam/scsi/scsi_all.c: sys/cam/scsi/scsi_all.h: - Replace scsi_get_sas_addr() with a scsi_get_devid() which takes a callback that decides whether to accept a particular descriptor. Provide callbacks for NAA IEEE Registered addresses and for SAS addresses, replacing the old function. This is needed because the old function doesn't work for an enclosure address for a SAS device, which is not flagged as a SAS address, but is NAA IEEE Registered. It may be worthwhile merging this interface with the devid match interface. - Add a few more defines for some device ID fields. sbin/camcontrol/camcontrol.c: - Update for the CCB_DEV_ADVINFO interface change. cam/cam_xpt_internal.h: - Add the new fields for the physical path string to the CAM EDT. cam/cam_ccb.h: - Rename CCB_GDEV_ADVINFO to simply CCB_DEV_ADVINFO, and the ccb structure to ccb_dev_advinfo. - Add a flag that changes this CCB's action to store, rather than the default, retrieve. - Add a new buffer type, CDAI_TYPE_PHYS_PATH, for the new CAM EDT physpath field. - Remove the never-implemented transport & proto flags. cam/cam_xpt.c: cam/cam_xpt.h: - Add xpt_getattr(), which provides a wrapper for fetching a device's attribute using the GEOM strings as key. This method currently supports "GEOM::ident" and "GEOM::physpath". Submitted by: will Reviewed by : gibbs Extend the XPT_DEV_MATCH api to allow a device search by device ID. As far as the API is concerned, device ID is a binary blob to be interpreted by the transport layer. The SCSI implementation assumes it is an array of VPD device ID descriptors. sys/cam/cam_ccb.h: Create a new structure, device_id_match_pattern, and update the XPT_DEV_MATCH datastructures and flags so that this pattern type can be used. sys/cam/cam_xpt.c: - A single pattern matching on both inquiry data and device ID is invalid. Report any violators. - Pass device ID match requests through to the new routine scsi_devid_match(). The direct call of a SCSI routine is a layering violation, but no worse than the one a few lines up that checks inquiry data. Defer cleaning this up until our future, larger, rototilling of CAM. - Zero out cam_ed and cam_et nodes on allocation. Prior to this change, device_id_len and device_id were not inialized, preventing proper detection of the presence of this information. sys/cam/scsi/scsi_all.c: sys/cam/scsi/scsi_all.h: Add the scsi_match_devid() routine. Add a helper function for extracting peripherial driver names sys/cam/cam_periph.c: sys/cam/cam_periph.h: Add the cam_periph_list() method which fills an sbuf with a comma delimited list of the peripheral instances associated with a given CAM path. Add a helper functions for SCSI commands used by the SES driver. sys/cam/scsi/scsi_all.c: sys/cam/scsi/scsi_all.h: Add structure definitions and csio filling functions for the receive diagnostic results and send diagnostic commands. Misc CAM XPT cleanups. sys/cam/cam_xpt.c: Broadcast AC_FOUND_DEVICE and AC_PATH_REGISTERED events at the time async event handlers are attached even when registering just for events on a partitular SIM. Previously, you had to register for these events on all SIMs in the system in order to get the initial broadcast even though subsequent device and path arrivals would be delivered. sys/cam/cam_xpt.c: Remove SIM mutex held asserts from path accessors. CAM paths are reference counted and it is this reference count, not the sim mutex, that garantees they are stable. Sponsored by: Spectra Logic Corporation Modified: head/sbin/camcontrol/camcontrol.c head/sys/cam/cam_ccb.h head/sys/cam/cam_periph.c head/sys/cam/cam_periph.h head/sys/cam/cam_xpt.c head/sys/cam/cam_xpt.h head/sys/cam/cam_xpt_internal.h head/sys/cam/scsi/scsi_all.c head/sys/cam/scsi/scsi_all.h head/sys/cam/scsi/scsi_pass.c head/sys/cam/scsi/scsi_xpt.c Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Tue Jun 14 13:35:24 2011 (r223080) +++ head/sbin/camcontrol/camcontrol.c Tue Jun 14 14:53:17 2011 (r223081) @@ -5044,13 +5044,13 @@ getdevid(struct cam_devitem *item) * then allocate that much memory and try again. */ retry: - ccb->ccb_h.func_code = XPT_GDEV_ADVINFO; + ccb->ccb_h.func_code = XPT_DEV_ADVINFO; ccb->ccb_h.flags = CAM_DIR_IN; - ccb->cgdai.flags = CGDAI_FLAG_PROTO; - ccb->cgdai.buftype = CGDAI_TYPE_SCSI_DEVID; - ccb->cgdai.bufsiz = item->device_id_len; + ccb->cdai.flags = 0; + ccb->cdai.buftype = CDAI_TYPE_SCSI_DEVID; + ccb->cdai.bufsiz = item->device_id_len; if (item->device_id_len != 0) - ccb->cgdai.buf = (uint8_t *)item->device_id; + ccb->cdai.buf = (uint8_t *)item->device_id; if (cam_send_ccb(dev, ccb) < 0) { warn("%s: error sending XPT_GDEV_ADVINFO CCB", __func__); @@ -5069,13 +5069,13 @@ retry: * This is our first time through. Allocate the buffer, * and then go back to get the data. */ - if (ccb->cgdai.provsiz == 0) { + if (ccb->cdai.provsiz == 0) { warnx("%s: invalid .provsiz field returned with " "XPT_GDEV_ADVINFO CCB", __func__); retval = 1; goto bailout; } - item->device_id_len = ccb->cgdai.provsiz; + item->device_id_len = ccb->cdai.provsiz; item->device_id = malloc(item->device_id_len); if (item->device_id == NULL) { warn("%s: unable to allocate %d bytes", __func__, @@ -5283,8 +5283,9 @@ findsasdevice(struct cam_devlist *devlis /* * XXX KDM look for LUN IDs as well? */ - item_addr = scsi_get_sas_addr(item->device_id, - item->device_id_len); + item_addr = scsi_get_devid(item->device_id, + item->device_id_len, + scsi_devid_is_sas_target); if (item_addr == NULL) continue; Modified: head/sys/cam/cam_ccb.h ============================================================================== --- head/sys/cam/cam_ccb.h Tue Jun 14 13:35:24 2011 (r223080) +++ head/sys/cam/cam_ccb.h Tue Jun 14 14:53:17 2011 (r223081) @@ -144,8 +144,8 @@ typedef enum { /* Device statistics (error counts, etc.) */ XPT_FREEZE_QUEUE = 0x0d, /* Freeze device queue */ - XPT_GDEV_ADVINFO = 0x0e, - /* Advanced device information */ + XPT_DEV_ADVINFO = 0x0e, + /* Get/Set Device advanced information */ /* SCSI Control Functions: 0x10->0x1F */ XPT_ABORT = 0x10, /* Abort the specified CCB */ @@ -391,15 +391,24 @@ typedef enum { DEV_MATCH_TARGET = 0x002, DEV_MATCH_LUN = 0x004, DEV_MATCH_INQUIRY = 0x008, + DEV_MATCH_DEVID = 0x010, DEV_MATCH_ANY = 0x00f } dev_pattern_flags; +struct device_id_match_pattern { + uint8_t id_len; + uint8_t id[256]; +}; + struct device_match_pattern { - path_id_t path_id; - target_id_t target_id; - lun_id_t target_lun; - struct scsi_static_inquiry_pattern inq_pat; - dev_pattern_flags flags; + path_id_t path_id; + target_id_t target_id; + lun_id_t target_lun; + dev_pattern_flags flags; + union { + struct scsi_static_inquiry_pattern inq_pat; + struct device_id_match_pattern devid_pat; + } data; }; typedef enum { @@ -745,6 +754,7 @@ struct ccb_relsim { * Definitions for the asynchronous callback CCB fields. */ typedef enum { + AC_ADVINFO_CHANGED = 0x2000,/* Advance info might have changes */ AC_CONTRACT = 0x1000,/* A contractual callback */ AC_GETDEV_CHANGED = 0x800,/* Getdev info might have changed */ AC_INQ_CHANGED = 0x400,/* Inquiry info might have changed */ @@ -1094,19 +1104,20 @@ struct ccb_eng_exec { /* This structure #define XPT_CCB_INVALID -1 /* for signaling a bad CCB to free */ /* - * CCB for getting advanced device information. This operates in a fashion + * CCB for working with advanced device information. This operates in a fashion * similar to XPT_GDEV_TYPE. Specify the target in ccb_h, the buffer * type requested, and provide a buffer size/buffer to write to. If the - * buffer is too small, the handler will set GDEVAI_FLAG_MORE. + * buffer is too small, provsiz will be larger than bufsiz. */ -struct ccb_getdev_advinfo { +struct ccb_dev_advinfo { struct ccb_hdr ccb_h; uint32_t flags; -#define CGDAI_FLAG_TRANSPORT 0x1 -#define CGDAI_FLAG_PROTO 0x2 +#define CDAI_FLAG_STORE 0x1 /* If set, action becomes store */ uint32_t buftype; /* IN: Type of data being requested */ /* NB: buftype is interpreted on a per-transport basis */ -#define CGDAI_TYPE_SCSI_DEVID 1 +#define CDAI_TYPE_SCSI_DEVID 1 +#define CDAI_TYPE_SERIAL_NUM 2 +#define CDAI_TYPE_PHYS_PATH 3 off_t bufsiz; /* IN: Size of external buffer */ #define CAM_SCSI_DEVID_MAXLEN 65536 /* length in buffer is an uint16_t */ off_t provsiz; /* OUT: Size required/used */ @@ -1151,7 +1162,7 @@ union ccb { struct ccb_rescan crcn; struct ccb_debug cdbg; struct ccb_ataio ataio; - struct ccb_getdev_advinfo cgdai; + struct ccb_dev_advinfo cdai; }; __BEGIN_DECLS Modified: head/sys/cam/cam_periph.c ============================================================================== --- head/sys/cam/cam_periph.c Tue Jun 14 13:35:24 2011 (r223080) +++ head/sys/cam/cam_periph.c Tue Jun 14 14:53:17 2011 (r223081) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -303,6 +304,38 @@ cam_periph_find(struct cam_path *path, c return(NULL); } +/* + * Find a peripheral structure with the specified path, target, lun, + * and (optionally) type. If the name is NULL, this function will return + * the first peripheral driver that matches the specified path. + */ +int +cam_periph_list(struct cam_path *path, struct sbuf *sb) +{ + struct periph_driver **p_drv; + struct cam_periph *periph; + int count; + + count = 0; + xpt_lock_buses(); + for (p_drv = periph_drivers; *p_drv != NULL; p_drv++) { + + TAILQ_FOREACH(periph, &(*p_drv)->units, unit_links) { + if (xpt_path_comp(periph->path, path) != 0) + continue; + + if (sbuf_len(sb) != 0) + sbuf_cat(sb, ","); + + sbuf_printf(sb, "%s%d", periph->periph_name, + periph->unit_number); + count++; + } + } + xpt_unlock_buses(); + return (count); +} + cam_status cam_periph_acquire(struct cam_periph *periph) { @@ -654,12 +687,12 @@ cam_periph_mapmem(union ccb *ccb, struct dirs[1] = CAM_DIR_IN; numbufs = 2; break; - case XPT_GDEV_ADVINFO: - if (ccb->cgdai.bufsiz == 0) + case XPT_DEV_ADVINFO: + if (ccb->cdai.bufsiz == 0) return (0); - data_ptrs[0] = (uint8_t **)&ccb->cgdai.buf; - lengths[0] = ccb->cgdai.bufsiz; + data_ptrs[0] = (uint8_t **)&ccb->cdai.buf; + lengths[0] = ccb->cdai.bufsiz; dirs[0] = CAM_DIR_IN; numbufs = 1; @@ -813,9 +846,9 @@ cam_periph_unmapmem(union ccb *ccb, stru data_ptrs[0] = &ccb->smpio.smp_request; data_ptrs[1] = &ccb->smpio.smp_response; break; - case XPT_GDEV_ADVINFO: + case XPT_DEV_ADVINFO: numbufs = min(mapinfo->num_bufs_used, 1); - data_ptrs[0] = (uint8_t **)&ccb->cgdai.buf; + data_ptrs[0] = (uint8_t **)&ccb->cdai.buf; break; default: /* allow ourselves to be swapped once again */ Modified: head/sys/cam/cam_periph.h ============================================================================== --- head/sys/cam/cam_periph.h Tue Jun 14 13:35:24 2011 (r223080) +++ head/sys/cam/cam_periph.h Tue Jun 14 14:53:17 2011 (r223081) @@ -142,6 +142,7 @@ cam_status cam_periph_alloc(periph_ctor_ char *name, cam_periph_type type, struct cam_path *, ac_callback_t *, ac_code, void *arg); struct cam_periph *cam_periph_find(struct cam_path *path, char *name); +int cam_periph_list(struct cam_path *, struct sbuf *); cam_status cam_periph_acquire(struct cam_periph *periph); void cam_periph_release(struct cam_periph *periph); void cam_periph_release_locked(struct cam_periph *periph); @@ -200,5 +201,12 @@ cam_periph_owned(struct cam_periph *peri return (mtx_owned(periph->sim->mtx)); } +static __inline int +cam_periph_sleep(struct cam_periph *periph, void *chan, int priority, + const char *wmesg, int timo) +{ + return (msleep(chan, periph->sim->mtx, priority, wmesg, timo)); +} + #endif /* _KERNEL */ #endif /* _CAM_CAM_PERIPH_H */ Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Tue Jun 14 13:35:24 2011 (r223080) +++ head/sys/cam/cam_xpt.c Tue Jun 14 14:53:17 2011 (r223081) @@ -287,9 +287,6 @@ static xpt_targetfunc_t xptdeftargetfunc static xpt_devicefunc_t xptdefdevicefunc; static xpt_periphfunc_t xptdefperiphfunc; static void xpt_finishconfig_task(void *context, int pending); -static int xpt_for_all_busses(xpt_busfunc_t *tr_func, void *arg); -static int xpt_for_all_devices(xpt_devicefunc_t *tr_func, - void *arg); static void xpt_dev_async_default(u_int32_t async_code, struct cam_eb *bus, struct cam_et *target, @@ -1105,6 +1102,44 @@ xpt_announce_periph(struct cam_periph *p periph->unit_number, announce_string); } +int +xpt_getattr(char *buf, size_t len, const char *attr, struct cam_path *path) +{ + int ret = -1; + struct ccb_dev_advinfo cdai; + + memset(&cdai, 0, sizeof(cdai)); + xpt_setup_ccb(&cdai.ccb_h, path, CAM_PRIORITY_NORMAL); + cdai.ccb_h.func_code = XPT_DEV_ADVINFO; + cdai.bufsiz = len; + + if (!strcmp(attr, "GEOM::ident")) + cdai.buftype = CDAI_TYPE_SERIAL_NUM; + else if (!strcmp(attr, "GEOM::physpath")) + cdai.buftype = CDAI_TYPE_PHYS_PATH; + else + goto out; + + cdai.buf = malloc(cdai.bufsiz, M_CAMXPT, M_NOWAIT|M_ZERO); + if (cdai.buf == NULL) { + ret = ENOMEM; + goto out; + } + xpt_action((union ccb *)&cdai); /* can only be synchronous */ + if ((cdai.ccb_h.status & CAM_DEV_QFRZN) != 0) + cam_release_devq(cdai.ccb_h.path, 0, 0, 0, FALSE); + if (cdai.provsiz == 0) + goto out; + ret = 0; + if (strlcpy(buf, cdai.buf, len) >= len) + ret = EFAULT; + +out: + if (cdai.buf != NULL) + free(cdai.buf, M_CAMXPT); + return ret; +} + static dev_match_ret xptbusmatch(struct dev_match_pattern *patterns, u_int num_patterns, struct cam_eb *bus) @@ -1241,6 +1276,7 @@ xptdevicematch(struct dev_match_pattern for (i = 0; i < num_patterns; i++) { struct device_match_pattern *cur_pattern; + struct scsi_vpd_device_id *device_id_page; /* * If the pattern in question isn't for a device node, we @@ -1255,22 +1291,17 @@ xptdevicematch(struct dev_match_pattern cur_pattern = &patterns[i].pattern.device_pattern; + /* Error out if mutually exclusive options are specified. */ + if ((cur_pattern->flags & (DEV_MATCH_INQUIRY|DEV_MATCH_DEVID)) + == (DEV_MATCH_INQUIRY|DEV_MATCH_DEVID)) + return(DM_RET_ERROR); + /* * If they want to match any device node, we give them any * device node. */ - if (cur_pattern->flags == DEV_MATCH_ANY) { - /* set the copy flag */ - retval |= DM_RET_COPY; - - - /* - * If we've already decided on an action, go ahead - * and return. - */ - if ((retval & DM_RET_ACTION_MASK) != DM_RET_NONE) - return(retval); - } + if (cur_pattern->flags == DEV_MATCH_ANY) + goto copy_dev_node; /* * Not sure why someone would do this... @@ -1292,11 +1323,22 @@ xptdevicematch(struct dev_match_pattern if (((cur_pattern->flags & DEV_MATCH_INQUIRY) != 0) && (cam_quirkmatch((caddr_t)&device->inq_data, - (caddr_t)&cur_pattern->inq_pat, - 1, sizeof(cur_pattern->inq_pat), + (caddr_t)&cur_pattern->data.inq_pat, + 1, sizeof(cur_pattern->data.inq_pat), scsi_static_inquiry_match) == NULL)) continue; + device_id_page = (struct scsi_vpd_device_id *)device->device_id; + if (((cur_pattern->flags & DEV_MATCH_DEVID) != 0) + && (device->device_id_len < SVPD_DEVICE_ID_HDR_LEN + || scsi_devid_match((uint8_t *)device_id_page->desc_list, + device->device_id_len + - SVPD_DEVICE_ID_HDR_LEN, + cur_pattern->data.devid_pat.id, + cur_pattern->data.devid_pat.id_len) != 0)) + continue; + +copy_dev_node: /* * If we get to this point, the user definitely wants * information on this device. So tell the caller to copy @@ -2889,6 +2931,8 @@ xpt_action_default(union ccb *start_ccb) case XPT_TERM_IO: case XPT_ENG_INQ: /* XXX Implement */ + printf("%s: CCB type %#x not supported\n", __func__, + start_ccb->ccb_h.func_code); start_ccb->ccb_h.status = CAM_PROVIDE_FAIL; if (start_ccb->ccb_h.func_code & XPT_FC_DEV_QUEUED) { xpt_done(start_ccb); @@ -3528,16 +3572,12 @@ xpt_path_string(struct cam_path *path, c path_id_t xpt_path_path_id(struct cam_path *path) { - mtx_assert(path->bus->sim->mtx, MA_OWNED); - return(path->bus->path_id); } target_id_t xpt_path_target_id(struct cam_path *path) { - mtx_assert(path->bus->sim->mtx, MA_OWNED); - if (path->target != NULL) return (path->target->target_id); else @@ -3547,8 +3587,6 @@ xpt_path_target_id(struct cam_path *path lun_id_t xpt_path_lun_id(struct cam_path *path) { - mtx_assert(path->bus->sim->mtx, MA_OWNED); - if (path->device != NULL) return (path->device->lun_id); else @@ -4242,7 +4280,8 @@ xpt_alloc_target(struct cam_eb *bus, tar { struct cam_et *target; - target = (struct cam_et *)malloc(sizeof(*target), M_CAMXPT, M_NOWAIT); + target = (struct cam_et *)malloc(sizeof(*target), M_CAMXPT, + M_NOWAIT|M_ZERO); if (target != NULL) { struct cam_et *cur_target; @@ -4330,7 +4369,7 @@ xpt_alloc_device(struct cam_eb *bus, str device = NULL; } else { device = (struct cam_ed *)malloc(sizeof(*device), - M_CAMXPT, M_NOWAIT); + M_CAMXPT, M_NOWAIT|M_ZERO); } if (device != NULL) { @@ -4676,27 +4715,29 @@ xpt_register_async(int event, ac_callbac csa.callback_arg = cbarg; xpt_action((union ccb *)&csa); status = csa.ccb_h.status; + if (xptpath) { xpt_free_path(path); mtx_unlock(&xsoftc.xpt_lock); + } - if ((status == CAM_REQ_CMP) && - (csa.event_enable & AC_FOUND_DEVICE)) { - /* - * Get this peripheral up to date with all - * the currently existing devices. - */ - xpt_for_all_devices(xptsetasyncfunc, &csa); - } - if ((status == CAM_REQ_CMP) && - (csa.event_enable & AC_PATH_REGISTERED)) { - /* - * Get this peripheral up to date with all - * the currently existing busses. - */ - xpt_for_all_busses(xptsetasyncbusfunc, &csa); - } + if ((status == CAM_REQ_CMP) && + (csa.event_enable & AC_FOUND_DEVICE)) { + /* + * Get this peripheral up to date with all + * the currently existing devices. + */ + xpt_for_all_devices(xptsetasyncfunc, &csa); } + if ((status == CAM_REQ_CMP) && + (csa.event_enable & AC_PATH_REGISTERED)) { + /* + * Get this peripheral up to date with all + * the currently existing busses. + */ + xpt_for_all_busses(xptsetasyncbusfunc, &csa); + } + return (status); } @@ -4852,8 +4893,10 @@ camisr_runqueue(void *V_queue) if ((dev->flags & CAM_DEV_TAG_AFTER_COUNT) != 0 && (--dev->tag_delay_count == 0)) xpt_start_tags(ccb_h->path); - if (!device_is_send_queued(dev)) - xpt_schedule_dev_sendq(ccb_h->path->bus, dev); + if (!device_is_send_queued(dev)) { + runq = xpt_schedule_dev_sendq(ccb_h->path->bus, + dev); + } } if (ccb_h->status & CAM_RELEASE_SIMQ) { Modified: head/sys/cam/cam_xpt.h ============================================================================== --- head/sys/cam/cam_xpt.h Tue Jun 14 13:35:24 2011 (r223080) +++ head/sys/cam/cam_xpt.h Tue Jun 14 14:53:17 2011 (r223081) @@ -103,6 +103,8 @@ cam_status xpt_create_path_unlocked(str struct cam_periph *perph, path_id_t path_id, target_id_t target_id, lun_id_t lun_id); +int xpt_getattr(char *buf, size_t len, const char *attr, + struct cam_path *path); void xpt_free_path(struct cam_path *path); int xpt_path_comp(struct cam_path *path1, struct cam_path *path2); Modified: head/sys/cam/cam_xpt_internal.h ============================================================================== --- head/sys/cam/cam_xpt_internal.h Tue Jun 14 13:35:24 2011 (r223080) +++ head/sys/cam/cam_xpt_internal.h Tue Jun 14 14:53:17 2011 (r223081) @@ -97,6 +97,8 @@ struct cam_ed { uint8_t supported_vpds_len; uint32_t device_id_len; uint8_t *device_id; + uint8_t physpath_len; + uint8_t *physpath; /* physical path string form */ struct ata_params ident_data; u_int8_t inq_flags; /* * Current settings for inquiry flags. Modified: head/sys/cam/scsi/scsi_all.c ============================================================================== --- head/sys/cam/scsi/scsi_all.c Tue Jun 14 13:35:24 2011 (r223080) +++ head/sys/cam/scsi/scsi_all.c Tue Jun 14 14:53:17 2011 (r223081) @@ -3552,32 +3552,63 @@ scsi_calc_syncparam(u_int period) return (period/400); } -uint8_t * -scsi_get_sas_addr(struct scsi_vpd_device_id *id, uint32_t len) +int +scsi_devid_is_naa_ieee_reg(uint8_t *bufp) { - uint8_t *bufp, *buf_end; struct scsi_vpd_id_descriptor *descr; struct scsi_vpd_id_naa_basic *naa; - bufp = buf_end = (uint8_t *)id; - bufp += SVPD_DEVICE_ID_HDR_LEN; - buf_end += len; - while (bufp < buf_end) { - descr = (struct scsi_vpd_id_descriptor *)bufp; - bufp += SVPD_DEVICE_ID_DESC_HDR_LEN; - /* Right now, we only care about SAS NAA IEEE Reg addrs */ - if (((descr->id_type & SVPD_ID_PIV) != 0) - && (descr->proto_codeset >> SVPD_ID_PROTO_SHIFT) == - SCSI_PROTO_SAS - && (descr->id_type & SVPD_ID_TYPE_MASK) == SVPD_ID_TYPE_NAA){ - naa = (struct scsi_vpd_id_naa_basic *)bufp; - if ((naa->naa >> 4) == SVPD_ID_NAA_IEEE_REG) - return bufp; - } - bufp += descr->length; + descr = (struct scsi_vpd_id_descriptor *)bufp; + naa = (struct scsi_vpd_id_naa_basic *)descr->identifier; + if ((descr->id_type & SVPD_ID_TYPE_MASK) != SVPD_ID_TYPE_NAA) + return 0; + if (descr->length < sizeof(struct scsi_vpd_id_naa_ieee_reg)) + return 0; + if ((naa->naa >> SVPD_ID_NAA_NAA_SHIFT) != SVPD_ID_NAA_IEEE_REG) + return 0; + return 1; +} + +int +scsi_devid_is_sas_target(uint8_t *bufp) +{ + struct scsi_vpd_id_descriptor *descr; + + descr = (struct scsi_vpd_id_descriptor *)bufp; + if (!scsi_devid_is_naa_ieee_reg(bufp)) + return 0; + if ((descr->id_type & SVPD_ID_PIV) == 0) /* proto field reserved */ + return 0; + if ((descr->proto_codeset >> SVPD_ID_PROTO_SHIFT) != SCSI_PROTO_SAS) + return 0; + return 1; +} + +uint8_t * +scsi_get_devid(struct scsi_vpd_device_id *id, uint32_t page_len, + scsi_devid_checkfn_t ck_fn) +{ + struct scsi_vpd_id_descriptor *desc; + uint8_t *page_end; + uint8_t *desc_buf_end; + + page_end = (uint8_t *)id + page_len; + if (page_end < id->desc_list) + return (NULL); + + desc_buf_end = MIN(id->desc_list + scsi_2btoul(id->length), page_end); + + for (desc = (struct scsi_vpd_id_descriptor *)id->desc_list; + desc->identifier <= desc_buf_end + && desc->identifier + desc->length <= desc_buf_end; + desc = (struct scsi_vpd_id_descriptor *)(desc->identifier + + desc->length)) { + + if (ck_fn == NULL || ck_fn((uint8_t *)desc) != 0) + return (desc->identifier); } - return NULL; + return (NULL); } void @@ -4174,6 +4205,77 @@ scsi_read_write(struct ccb_scsiio *csio, timeout); } +void +scsi_receive_diagnostic_results(struct ccb_scsiio *csio, u_int32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb*), + uint8_t tag_action, int pcv, uint8_t page_code, + uint8_t *data_ptr, uint16_t allocation_length, + uint8_t sense_len, uint32_t timeout) +{ + struct scsi_receive_diag *scsi_cmd; + + scsi_cmd = (struct scsi_receive_diag *)&csio->cdb_io.cdb_bytes; + memset(scsi_cmd, 0, sizeof(*scsi_cmd)); + scsi_cmd->opcode = RECEIVE_DIAGNOSTIC; + if (pcv) { + scsi_cmd->byte2 |= SRD_PCV; + scsi_cmd->page_code = page_code; + } + scsi_ulto2b(allocation_length, scsi_cmd->length); + + cam_fill_csio(csio, + retries, + cbfcnp, + /*flags*/CAM_DIR_IN, + tag_action, + data_ptr, + allocation_length, + sense_len, + sizeof(*scsi_cmd), + timeout); +} + +void +scsi_send_diagnostic(struct ccb_scsiio *csio, u_int32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb *), + uint8_t tag_action, int unit_offline, int device_offline, + int self_test, int page_format, int self_test_code, + uint8_t *data_ptr, uint16_t param_list_length, + uint8_t sense_len, uint32_t timeout) +{ + struct scsi_send_diag *scsi_cmd; + + scsi_cmd = (struct scsi_send_diag *)&csio->cdb_io.cdb_bytes; + memset(scsi_cmd, 0, sizeof(*scsi_cmd)); + scsi_cmd->opcode = SEND_DIAGNOSTIC; + + /* + * The default self-test mode control and specific test + * control are mutually exclusive. + */ + if (self_test) + self_test_code = SSD_SELF_TEST_CODE_NONE; + + scsi_cmd->byte2 = ((self_test_code << SSD_SELF_TEST_CODE_SHIFT) + & SSD_SELF_TEST_CODE_MASK) + | (unit_offline ? SSD_UNITOFFL : 0) + | (device_offline ? SSD_DEVOFFL : 0) + | (self_test ? SSD_SELFTEST : 0) + | (page_format ? SSD_PF : 0); + scsi_ulto2b(param_list_length, scsi_cmd->length); + + cam_fill_csio(csio, + retries, + cbfcnp, + /*flags*/param_list_length ? CAM_DIR_OUT : CAM_DIR_NONE, + tag_action, + data_ptr, + param_list_length, + sense_len, + sizeof(*scsi_cmd), + timeout); +} + void scsi_start_stop(struct ccb_scsiio *csio, u_int32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb *), @@ -4206,7 +4308,6 @@ scsi_start_stop(struct ccb_scsiio *csio, sense_len, sizeof(*scsi_cmd), timeout); - } @@ -4264,6 +4365,66 @@ scsi_static_inquiry_match(caddr_t inqbuf return (-1); } +/** + * Compare two buffers of vpd device descriptors for a match. + * + * \param lhs Pointer to first buffer of descriptors to compare. + * \param lhs_len The length of the first buffer. + * \param rhs Pointer to second buffer of descriptors to compare. + * \param rhs_len The length of the second buffer. + * + * \return 0 on a match, -1 otherwise. + * + * Treat rhs and lhs as arrays of vpd device id descriptors. Walk lhs matching + * agains each element in rhs until all data are exhausted or we have found + * a match. + */ +int +scsi_devid_match(uint8_t *lhs, size_t lhs_len, uint8_t *rhs, size_t rhs_len) +{ + struct scsi_vpd_id_descriptor *lhs_id; + struct scsi_vpd_id_descriptor *lhs_last; + struct scsi_vpd_id_descriptor *rhs_last; + uint8_t *lhs_end; + uint8_t *rhs_end; + + lhs_end = lhs + lhs_len; + rhs_end = rhs + rhs_len; + + /* + * rhs_last and lhs_last are the last posible position of a valid + * descriptor assuming it had a zero length identifier. We use + * these variables to insure we can safely dereference the length + * field in our loop termination tests. + */ + lhs_last = (struct scsi_vpd_id_descriptor *) + (lhs_end - __offsetof(struct scsi_vpd_id_descriptor, identifier)); + rhs_last = (struct scsi_vpd_id_descriptor *) + (rhs_end - __offsetof(struct scsi_vpd_id_descriptor, identifier)); + + lhs_id = (struct scsi_vpd_id_descriptor *)lhs; + while (lhs_id <= lhs_last + && (lhs_id->identifier + lhs_id->length) <= lhs_end) { + struct scsi_vpd_id_descriptor *rhs_id; + + rhs_id = (struct scsi_vpd_id_descriptor *)rhs; + while (rhs_id <= rhs_last + && (rhs_id->identifier + rhs_id->length) <= rhs_end) { + + if (rhs_id->length == lhs_id->length + && memcmp(rhs_id->identifier, lhs_id->identifier, + rhs_id->length) == 0) + return (0); + + rhs_id = (struct scsi_vpd_id_descriptor *) + (rhs_id->identifier + rhs_id->length); + } + lhs_id = (struct scsi_vpd_id_descriptor *) + (lhs_id->identifier + lhs_id->length); + } + return (-1); +} + #ifdef _KERNEL static void init_scsi_delay(void) Modified: head/sys/cam/scsi/scsi_all.h ============================================================================== --- head/sys/cam/scsi/scsi_all.h Tue Jun 14 13:35:24 2011 (r223080) +++ head/sys/cam/scsi/scsi_all.h Tue Jun 14 14:53:17 2011 (r223081) @@ -115,6 +115,7 @@ struct scsi_request_sense { u_int8_t opcode; u_int8_t byte2; +#define SRS_DESC 0x01 u_int8_t unused[2]; u_int8_t length; u_int8_t control; @@ -128,17 +129,33 @@ struct scsi_test_unit_ready u_int8_t control; }; -struct scsi_send_diag -{ - u_int8_t opcode; - u_int8_t byte2; -#define SSD_UOL 0x01 -#define SSD_DOL 0x02 -#define SSD_SELFTEST 0x04 -#define SSD_PF 0x10 - u_int8_t unused[1]; - u_int8_t paramlen[2]; - u_int8_t control; +struct scsi_receive_diag { + uint8_t opcode; + uint8_t byte2; +#define SRD_PCV 0x01 + uint8_t page_code; + uint8_t length[2]; + uint8_t control; +}; + +struct scsi_send_diag { + uint8_t opcode; + uint8_t byte2; +#define SSD_UNITOFFL 0x01 +#define SSD_DEVOFFL 0x02 +#define SSD_SELFTEST 0x04 +#define SSD_PF 0x10 +#define SSD_SELF_TEST_CODE_MASK 0xE0 +#define SSD_SELF_TEST_CODE_SHIFT 5 +#define SSD_SELF_TEST_CODE_NONE 0x00 +#define SSD_SELF_TEST_CODE_BG_SHORT 0x01 +#define SSD_SELF_TEST_CODE_BG_EXTENDED 0x02 +#define SSD_SELF_TEST_CODE_BG_ABORT 0x04 +#define SSD_SELF_TEST_CODE_FG_SHORT 0x05 +#define SSD_SELF_TEST_CODE_FG_EXTENDED 0x06 + uint8_t reserved; + uint8_t length[2]; + uint8_t control; }; struct scsi_sense @@ -894,11 +911,12 @@ struct scsi_vpd_id_naa_basic uint8_t naa : 4; uint8_t naa_desig : 4; */ +#define SVPD_ID_NAA_NAA_SHIFT 4 #define SVPD_ID_NAA_IEEE_EXT 0x02 #define SVPD_ID_NAA_LOCAL_REG 0x03 #define SVPD_ID_NAA_IEEE_REG 0x05 #define SVPD_ID_NAA_IEEE_REG_EXT 0x06 - uint8_t naa_data[0]; + uint8_t naa_data[]; }; struct scsi_vpd_id_naa_ieee_extended_id @@ -1322,7 +1340,12 @@ void scsi_print_inquiry(struct scsi_inq u_int scsi_calc_syncsrate(u_int period_factor); u_int scsi_calc_syncparam(u_int period); -uint8_t * scsi_get_sas_addr(struct scsi_vpd_device_id *id, uint32_t len); + +typedef int (*scsi_devid_checkfn_t)(uint8_t *); +int scsi_devid_is_naa_ieee_reg(uint8_t *bufp); +int scsi_devid_is_sas_target(uint8_t *bufp); +uint8_t * scsi_get_devid(struct scsi_vpd_device_id *id, uint32_t len, + scsi_devid_checkfn_t ck_fn); void scsi_test_unit_ready(struct ccb_scsiio *csio, u_int32_t retries, void (*cbfcnp)(struct cam_periph *, @@ -1439,6 +1462,22 @@ void scsi_synchronize_cache(struct ccb_ u_int32_t begin_lba, u_int16_t lb_count, u_int8_t sense_len, u_int32_t timeout); +void scsi_receive_diagnostic_results(struct ccb_scsiio *csio, u_int32_t retries, + void (*cbfcnp)(struct cam_periph *, + union ccb*), + uint8_t tag_action, int pcv, + uint8_t page_code, uint8_t *data_ptr, + uint16_t allocation_length, + uint8_t sense_len, uint32_t timeout); + +void scsi_send_diagnostic(struct ccb_scsiio *csio, u_int32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb *), + uint8_t tag_action, int unit_offline, + int device_offline, int self_test, int page_format, + int self_test_code, uint8_t *data_ptr, + uint16_t param_list_length, uint8_t sense_len, + uint32_t timeout); + void scsi_read_write(struct ccb_scsiio *csio, u_int32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb *), u_int8_t tag_action, int readop, u_int8_t byte2, @@ -1455,6 +1494,8 @@ void scsi_start_stop(struct ccb_scsiio * int scsi_inquiry_match(caddr_t inqbuffer, caddr_t table_entry); int scsi_static_inquiry_match(caddr_t inqbuffer, caddr_t table_entry); +int scsi_devid_match(uint8_t *rhs, size_t rhs_len, + uint8_t *lhs, size_t lhs_len); static __inline void scsi_extract_sense(struct scsi_sense_data *sense, int *error_code, int *sense_key, Modified: head/sys/cam/scsi/scsi_pass.c ============================================================================== --- head/sys/cam/scsi/scsi_pass.c Tue Jun 14 13:35:24 2011 (r223080) +++ head/sys/cam/scsi/scsi_pass.c Tue Jun 14 14:53:17 2011 (r223081) @@ -548,8 +548,8 @@ passsendccb(struct cam_periph *periph, u && ((ccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE)) || (ccb->ccb_h.func_code == XPT_DEV_MATCH) || (ccb->ccb_h.func_code == XPT_SMP_IO) - || ((ccb->ccb_h.func_code == XPT_GDEV_ADVINFO) - && (ccb->cgdai.bufsiz > 0)))) { + || ((ccb->ccb_h.func_code == XPT_DEV_ADVINFO) + && (ccb->cdai.bufsiz > 0)))) { bzero(&mapinfo, sizeof(mapinfo)); Modified: head/sys/cam/scsi/scsi_xpt.c ============================================================================== --- head/sys/cam/scsi/scsi_xpt.c Tue Jun 14 13:35:24 2011 (r223080) +++ head/sys/cam/scsi/scsi_xpt.c Tue Jun 14 14:53:17 2011 (r223081) @@ -542,6 +542,7 @@ static const int scsi_quirk_table_size = static cam_status proberegister(struct cam_periph *periph, void *arg); static void probeschedule(struct cam_periph *probe_periph); +static int device_has_vpd(struct cam_ed *device, uint8_t page_id); static void probestart(struct cam_periph *periph, union ccb *start_ccb); static void proberequestdefaultnegotiation(struct cam_periph *periph); static int proberequestbackoff(struct cam_periph *periph, @@ -1460,7 +1461,7 @@ probedone(struct cam_periph *periph, uni path->device->device_id = (uint8_t *)devid; } } else if (cam_periph_error(done_ccb, 0, - SF_RETRY_UA|SF_NO_PRINT, + SF_RETRY_UA, &softc->saved_ccb) == ERESTART) { return; } else if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) { @@ -1506,9 +1507,9 @@ probe_device_check: (u_int8_t *)malloc((serial_buf->length + 1), M_CAMXPT, M_NOWAIT); if (path->device->serial_num != NULL) { - bcopy(serial_buf->serial_num, - path->device->serial_num, - serial_buf->length); + memcpy(path->device->serial_num, + serial_buf->serial_num, + serial_buf->length); path->device->serial_num_len = serial_buf->length; path->device->serial_num[serial_buf->length] @@ -2433,28 +2434,77 @@ scsi_devise_transport(struct cam_path *p } static void -scsi_getdev_advinfo(union ccb *start_ccb) +scsi_dev_advinfo(union ccb *start_ccb) { struct cam_ed *device; - struct ccb_getdev_advinfo *cgdai; + struct ccb_dev_advinfo *cdai; off_t amt; device = start_ccb->ccb_h.path->device; - cgdai = &start_ccb->cgdai; - switch(cgdai->buftype) { - case CGDAI_TYPE_SCSI_DEVID: - cgdai->provsiz = device->device_id_len; + cdai = &start_ccb->cdai; + switch(cdai->buftype) { + case CDAI_TYPE_SCSI_DEVID: + if (cdai->flags & CDAI_FLAG_STORE) + break; + cdai->provsiz = device->device_id_len; if (device->device_id_len == 0) break; amt = device->device_id_len; - if (cgdai->provsiz > cgdai->bufsiz) - amt = cgdai->bufsiz; - bcopy(device->device_id, cgdai->buf, amt); + if (cdai->provsiz > cdai->bufsiz) + amt = cdai->bufsiz; + memcpy(cdai->buf, device->device_id, amt); + break; + case CDAI_TYPE_SERIAL_NUM: + if (cdai->flags & CDAI_FLAG_STORE) + break; + cdai->provsiz = device->serial_num_len; + if (device->serial_num_len == 0) + break; + amt = device->serial_num_len; + if (cdai->provsiz > cdai->bufsiz) + amt = cdai->bufsiz; + memcpy(cdai->buf, device->serial_num, amt); + break; + case CDAI_TYPE_PHYS_PATH: + if (cdai->flags & CDAI_FLAG_STORE) { + if (device->physpath != NULL) + free(device->physpath, M_CAMXPT); + device->physpath_len = cdai->bufsiz; + /* Clear existing buffer if zero length */ + if (cdai->bufsiz == 0) + break; + device->physpath = malloc(cdai->bufsiz, M_CAMXPT, M_NOWAIT); + if (device->physpath == NULL) { + start_ccb->ccb_h.status = CAM_REQ_ABORTED; + return; + } + memcpy(device->physpath, cdai->buf, cdai->bufsiz); + } else { + cdai->provsiz = device->physpath_len; + if (device->physpath_len == 0) + break; + amt = device->physpath_len; + if (cdai->provsiz > cdai->bufsiz) + amt = cdai->bufsiz; + memcpy(cdai->buf, device->physpath, amt); + } break; default: break; } start_ccb->ccb_h.status = CAM_REQ_CMP; + + if (cdai->flags & CDAI_FLAG_STORE) { + int owned; + + owned = mtx_owned(start_ccb->ccb_h.path->bus->sim->mtx); + if (owned == 0) + mtx_lock(start_ccb->ccb_h.path->bus->sim->mtx); + xpt_async(AC_ADVINFO_CHANGED, start_ccb->ccb_h.path, + (void *)(uintptr_t)cdai->buftype); + if (owned == 0) + mtx_unlock(start_ccb->ccb_h.path->bus->sim->mtx); + } } static void @@ -2486,9 +2536,9 @@ scsi_action(union ccb *start_ccb) (*(sim->sim_action))(sim, start_ccb); break; } - case XPT_GDEV_ADVINFO: + case XPT_DEV_ADVINFO: { - scsi_getdev_advinfo(start_ccb); + scsi_dev_advinfo(start_ccb); break; } default: From owner-svn-src-head@FreeBSD.ORG Tue Jun 14 15:20:31 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 02B091065688; Tue, 14 Jun 2011 15:20:31 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E51528FC1B; Tue, 14 Jun 2011 15:20:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5EFKU3L040556; Tue, 14 Jun 2011 15:20:30 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5EFKURp040554; Tue, 14 Jun 2011 15:20:30 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201106141520.p5EFKURp040554@svn.freebsd.org> From: Andreas Tobler Date: Tue, 14 Jun 2011 15:20:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223082 - head/contrib/gdb/gdb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jun 2011 15:20:31 -0000 Author: andreast Date: Tue Jun 14 15:20:30 2011 New Revision: 223082 URL: http://svn.freebsd.org/changeset/base/223082 Log: - Check on target wordsize instead of compile time define if we build on 64-bit PowerPC or 32-bit PowerPC. - Make gdb work on powerpc64, the code for this is obtained from ppc-linux-tdep.c. - Remove non-elf core read functionality. Implement core read functionality similar like other FreeBSD targets. - Set long double limitations. Modified: head/contrib/gdb/gdb/ppcfbsd-tdep.c Modified: head/contrib/gdb/gdb/ppcfbsd-tdep.c ============================================================================== --- head/contrib/gdb/gdb/ppcfbsd-tdep.c Tue Jun 14 14:53:17 2011 (r223081) +++ head/contrib/gdb/gdb/ppcfbsd-tdep.c Tue Jun 14 15:20:30 2011 (r223082) @@ -27,7 +27,9 @@ #include "target.h" #include "breakpoint.h" #include "value.h" +#include "gdb_string.h" #include "osabi.h" +#include "regset.h" #include "ppc-tdep.h" #include "ppcfbsd-tdep.h" @@ -80,6 +82,17 @@ ppcfbsd_supply_reg (char *regs, int regn regcache_raw_supply (current_regcache, PC_REGNUM, regs + REG_PC_OFFSET); } +static void +ppcfbsd_supply_gregset (const struct regset *regset, + struct regcache *regcache, + int regnum, void *gregs, size_t size) +{ + ppcfbsd_supply_reg (gregs, -1); +} + +static struct regset ppcfbsd_gregset = { + NULL, (void*)ppcfbsd_supply_gregset +}; void ppcfbsd_fill_reg (char *regs, int regno) @@ -144,6 +157,20 @@ ppcfbsd_supply_fpreg (char *fpregs, int fpregs + FPREG_FPSCR_OFFSET); } +static void +ppcfbsd_supply_fpregset (const struct regset *regset, + struct regcache * regcache, + int regnum, void *fpset, size_t size) +{ + ppcfbsd_supply_fpreg (fpset, -1); +} + + +static struct regset ppcfbsd_fpregset = +{ + NULL, (void*)ppcfbsd_supply_fpregset +}; + void ppcfbsd_fill_fpreg (char *fpregs, int regno) { @@ -174,69 +201,285 @@ ppcfbsd_fill_fpreg (char *fpregs, int re fpregs + FPREG_FPSCR_OFFSET); } -static void -fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, int which, - CORE_ADDR ignore) +/* Return the appropriate register set for the core section identified + by SECT_NAME and SECT_SIZE. */ + +const struct regset * +ppcfbsd_regset_from_core_section (struct gdbarch *gdbarch, + const char *sect_name, size_t sect_size) { - char *regs, *fpregs; + struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + + if (strcmp (sect_name, ".reg") == 0 && sect_size >= SIZEOF_STRUCT_REG) + return &ppcfbsd_gregset; + + if (strcmp (sect_name, ".reg2") == 0 && sect_size >= SIZEOF_STRUCT_FPREG) + return &ppcfbsd_fpregset; - /* We get everything from one section. */ - if (which != 0) - return; + return NULL; +} - regs = core_reg_sect; - fpregs = core_reg_sect + SIZEOF_STRUCT_REG; - /* Integer registers. */ - ppcfbsd_supply_reg (regs, -1); +/* Macros for matching instructions. Note that, since all the + operands are masked off before they're or-ed into the instruction, + you can use -1 to make masks. */ + +#define insn_d(opcd, rts, ra, d) \ + ((((opcd) & 0x3f) << 26) \ + | (((rts) & 0x1f) << 21) \ + | (((ra) & 0x1f) << 16) \ + | ((d) & 0xffff)) + +#define insn_ds(opcd, rts, ra, d, xo) \ + ((((opcd) & 0x3f) << 26) \ + | (((rts) & 0x1f) << 21) \ + | (((ra) & 0x1f) << 16) \ + | ((d) & 0xfffc) \ + | ((xo) & 0x3)) + +#define insn_xfx(opcd, rts, spr, xo) \ + ((((opcd) & 0x3f) << 26) \ + | (((rts) & 0x1f) << 21) \ + | (((spr) & 0x1f) << 16) \ + | (((spr) & 0x3e0) << 6) \ + | (((xo) & 0x3ff) << 1)) + +/* Read a PPC instruction from memory. PPC instructions are always + big-endian, no matter what endianness the program is running in, so + we can't use read_memory_integer or one of its friends here. */ +static unsigned int +read_insn (CORE_ADDR pc) +{ + unsigned char buf[4]; - /* Floating point registers. */ - ppcfbsd_supply_fpreg (fpregs, -1); + read_memory (pc, buf, 4); + return (buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | buf[3]; } -static void -fetch_elfcore_registers (char *core_reg_sect, unsigned core_reg_size, int which, - CORE_ADDR ignore) + +/* An instruction to match. */ +struct insn_pattern { - switch (which) + unsigned int mask; /* mask the insn with this... */ + unsigned int data; /* ...and see if it matches this. */ + int optional; /* If non-zero, this insn may be absent. */ +}; + +/* Return non-zero if the instructions at PC match the series + described in PATTERN, or zero otherwise. PATTERN is an array of + 'struct insn_pattern' objects, terminated by an entry whose mask is + zero. + + When the match is successful, fill INSN[i] with what PATTERN[i] + matched. If PATTERN[i] is optional, and the instruction wasn't + present, set INSN[i] to 0 (which is not a valid PPC instruction). + INSN should have as many elements as PATTERN. Note that, if + PATTERN contains optional instructions which aren't present in + memory, then INSN will have holes, so INSN[i] isn't necessarily the + i'th instruction in memory. */ +static int +insns_match_pattern (CORE_ADDR pc, + struct insn_pattern *pattern, + unsigned int *insn) +{ + int i; + + for (i = 0; pattern[i].mask; i++) { - case 0: /* Integer registers. */ - if (core_reg_size != SIZEOF_STRUCT_REG) - warning (_("Wrong size register set in core file.")); + insn[i] = read_insn (pc); + if ((insn[i] & pattern[i].mask) == pattern[i].data) + pc += 4; + else if (pattern[i].optional) + insn[i] = 0; else - ppcfbsd_supply_reg (core_reg_sect, -1); - break; + return 0; + } - case 2: /* Floating point registers. */ - if (core_reg_size != SIZEOF_STRUCT_FPREG) - warning (_("Wrong size FP register set in core file.")); - else - ppcfbsd_supply_fpreg (core_reg_sect, -1); - break; + return 1; +} - default: - /* Don't know what kind of register request this is; just ignore it. */ - break; - } + +/* Return the 'd' field of the d-form instruction INSN, properly + sign-extended. */ +static CORE_ADDR +insn_d_field (unsigned int insn) +{ + return ((((CORE_ADDR) insn & 0xffff) ^ 0x8000) - 0x8000); } -static struct core_fns ppcfbsd_core_fns = + +/* Return the 'ds' field of the ds-form instruction INSN, with the two + zero bits concatenated at the right, and properly + sign-extended. */ +static CORE_ADDR +insn_ds_field (unsigned int insn) { - bfd_target_unknown_flavour, /* core_flavour */ - default_check_format, /* check_format */ - default_core_sniffer, /* core_sniffer */ - fetch_core_registers, /* core_read_registers */ - NULL /* next */ -}; + return ((((CORE_ADDR) insn & 0xfffc) ^ 0x8000) - 0x8000); +} + -static struct core_fns ppcfbsd_elfcore_fns = +/* If DESC is the address of a 64-bit PowerPC FreeBSD function + descriptor, return the descriptor's entry point. */ +static CORE_ADDR +ppc64_desc_entry_point (CORE_ADDR desc) { - bfd_target_elf_flavour, /* core_flavour */ - default_check_format, /* check_format */ - default_core_sniffer, /* core_sniffer */ - fetch_elfcore_registers, /* core_read_registers */ - NULL /* next */ -}; + /* The first word of the descriptor is the entry point. */ + return (CORE_ADDR) read_memory_unsigned_integer (desc, 8); +} + + +/* Pattern for the standard linkage function. These are built by + build_plt_stub in elf64-ppc.c, whose GLINK argument is always + zero. */ +static struct insn_pattern ppc64_standard_linkage[] = + { + /* addis r12, r2, */ + { insn_d (-1, -1, -1, 0), insn_d (15, 12, 2, 0), 0 }, + + /* std r2, 40(r1) */ + { -1, insn_ds (62, 2, 1, 40, 0), 0 }, + + /* ld r11, (r12) */ + { insn_ds (-1, -1, -1, 0, -1), insn_ds (58, 11, 12, 0, 0), 0 }, + + /* addis r12, r12, 1 */ + { insn_d (-1, -1, -1, -1), insn_d (15, 12, 2, 1), 1 }, + + /* ld r2, (r12) */ + { insn_ds (-1, -1, -1, 0, -1), insn_ds (58, 2, 12, 0, 0), 0 }, + + /* addis r12, r12, 1 */ + { insn_d (-1, -1, -1, -1), insn_d (15, 12, 2, 1), 1 }, + + /* mtctr r11 */ + { insn_xfx (-1, -1, -1, -1), insn_xfx (31, 11, 9, 467), + 0 }, + + /* ld r11, (r12) */ + { insn_ds (-1, -1, -1, 0, -1), insn_ds (58, 11, 12, 0, 0), 0 }, + + /* bctr */ + { -1, 0x4e800420, 0 }, + + { 0, 0, 0 } + }; +#define PPC64_STANDARD_LINKAGE_LEN \ + (sizeof (ppc64_standard_linkage) / sizeof (ppc64_standard_linkage[0])) + +/* When the dynamic linker is doing lazy symbol resolution, the first + call to a function in another object will go like this: + + - The user's function calls the linkage function: + + 100007c4: 4b ff fc d5 bl 10000498 + 100007c8: e8 41 00 28 ld r2,40(r1) + + - The linkage function loads the entry point (and other stuff) from + the function descriptor in the PLT, and jumps to it: + + 10000498: 3d 82 00 00 addis r12,r2,0 + 1000049c: f8 41 00 28 std r2,40(r1) + 100004a0: e9 6c 80 98 ld r11,-32616(r12) + 100004a4: e8 4c 80 a0 ld r2,-32608(r12) + 100004a8: 7d 69 03 a6 mtctr r11 + 100004ac: e9 6c 80 a8 ld r11,-32600(r12) + 100004b0: 4e 80 04 20 bctr + + - But since this is the first time that PLT entry has been used, it + sends control to its glink entry. That loads the number of the + PLT entry and jumps to the common glink0 code: + + 10000c98: 38 00 00 00 li r0,0 + 10000c9c: 4b ff ff dc b 10000c78 + + - The common glink0 code then transfers control to the dynamic + linker's fixup code: + + 10000c78: e8 41 00 28 ld r2,40(r1) + 10000c7c: 3d 82 00 00 addis r12,r2,0 + 10000c80: e9 6c 80 80 ld r11,-32640(r12) + 10000c84: e8 4c 80 88 ld r2,-32632(r12) + 10000c88: 7d 69 03 a6 mtctr r11 + 10000c8c: e9 6c 80 90 ld r11,-32624(r12) + 10000c90: 4e 80 04 20 bctr + + Eventually, this code will figure out how to skip all of this, + including the dynamic linker. At the moment, we just get through + the linkage function. */ + +/* If the current thread is about to execute a series of instructions + at PC matching the ppc64_standard_linkage pattern, and INSN is the result + from that pattern match, return the code address to which the + standard linkage function will send them. (This doesn't deal with + dynamic linker lazy symbol resolution stubs.) */ +static CORE_ADDR +ppc64_standard_linkage_target (CORE_ADDR pc, unsigned int *insn) +{ + struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); + + /* The address of the function descriptor this linkage function + references. */ + CORE_ADDR desc + = ((CORE_ADDR) read_register (tdep->ppc_gp0_regnum + 2) + + (insn_d_field (insn[0]) << 16) + + insn_ds_field (insn[2])); + + /* The first word of the descriptor is the entry point. Return that. */ + return ppc64_desc_entry_point (desc); +} + + +/* Given that we've begun executing a call trampoline at PC, return + the entry point of the function the trampoline will go to. */ +static CORE_ADDR +ppc64_skip_trampoline_code (CORE_ADDR pc) +{ + unsigned int ppc64_standard_linkage_insn[PPC64_STANDARD_LINKAGE_LEN]; + + if (insns_match_pattern (pc, ppc64_standard_linkage, + ppc64_standard_linkage_insn)) + return ppc64_standard_linkage_target (pc, ppc64_standard_linkage_insn); + else + return 0; +} + + +/* Support for CONVERT_FROM_FUNC_PTR_ADDR (ARCH, ADDR, TARG) on PPC64 + GNU/Linux and FreeBSD. + + Usually a function pointer's representation is simply the address + of the function. On GNU/Linux on the 64-bit PowerPC however, a + function pointer is represented by a pointer to a TOC entry. This + TOC entry contains three words, the first word is the address of + the function, the second word is the TOC pointer (r2), and the + third word is the static chain value. Throughout GDB it is + currently assumed that a function pointer contains the address of + the function, which is not easy to fix. In addition, the + conversion of a function address to a function pointer would + require allocation of a TOC entry in the inferior's memory space, + with all its drawbacks. To be able to call C++ virtual methods in + the inferior (which are called via function pointers), + find_function_addr uses this function to get the function address + from a function pointer. */ + +/* If ADDR points at what is clearly a function descriptor, transform + it into the address of the corresponding function. Be + conservative, otherwize GDB will do the transformation on any + random addresses such as occures when there is no symbol table. */ + +static CORE_ADDR +ppc64_fbsd_convert_from_func_ptr_addr (struct gdbarch *gdbarch, + CORE_ADDR addr, + struct target_ops *targ) +{ + struct section_table *s = target_section_by_addr (targ, addr); + + /* Check if ADDR points to a function descriptor. */ + if (s && strcmp (s->the_bfd_section->name, ".opd") == 0) + return get_target_memory_unsigned (targ, addr, 8); + + return addr; +} static int ppcfbsd_pc_in_sigtramp (CORE_ADDR pc, char *func_name) @@ -270,27 +513,42 @@ static void ppcfbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { + struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + + /* FreeBSD doesn't support the 128-bit `long double' from the psABI. */ + set_gdbarch_long_double_bit (gdbarch, 64); + set_gdbarch_pc_in_sigtramp (gdbarch, ppcfbsd_pc_in_sigtramp); - /* For NetBSD, this is an on again, off again thing. Some systems - do use the broken struct convention, and some don't. */ - set_gdbarch_return_value (gdbarch, ppcfbsd_return_value); -#ifdef __powerpc64__ - set_solib_svr4_fetch_link_map_offsets (gdbarch, - svr4_lp64_fetch_link_map_offsets); -#else - set_solib_svr4_fetch_link_map_offsets (gdbarch, - svr4_ilp32_fetch_link_map_offsets); -#endif + + if (tdep->wordsize == 4) + { + set_gdbarch_return_value (gdbarch, ppcfbsd_return_value); + set_solib_svr4_fetch_link_map_offsets (gdbarch, + svr4_ilp32_fetch_link_map_offsets); + } + + if (tdep->wordsize == 8) + { + set_gdbarch_convert_from_func_ptr_addr + (gdbarch, ppc64_fbsd_convert_from_func_ptr_addr); + + set_gdbarch_skip_trampoline_code (gdbarch, ppc64_skip_trampoline_code); + + set_solib_svr4_fetch_link_map_offsets (gdbarch, + svr4_lp64_fetch_link_map_offsets); + } + + set_gdbarch_regset_from_core_section (gdbarch, + ppcfbsd_regset_from_core_section); } void _initialize_ppcfbsd_tdep (void) { + gdbarch_register_osabi (bfd_arch_powerpc, bfd_mach_ppc, + GDB_OSABI_FREEBSD_ELF, ppcfbsd_init_abi); + gdbarch_register_osabi (bfd_arch_powerpc, bfd_mach_ppc64, + GDB_OSABI_FREEBSD_ELF, ppcfbsd_init_abi); gdbarch_register_osabi (bfd_arch_rs6000, 0, GDB_OSABI_FREEBSD_ELF, ppcfbsd_init_abi); - gdbarch_register_osabi (bfd_arch_powerpc, 0, GDB_OSABI_FREEBSD_ELF, - ppcfbsd_init_abi); - - add_core_fns (&ppcfbsd_core_fns); - add_core_fns (&ppcfbsd_elfcore_fns); } From owner-svn-src-head@FreeBSD.ORG Tue Jun 14 16:05:01 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C07C106566C; Tue, 14 Jun 2011 16:05:01 +0000 (UTC) (envelope-from gibbs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 47A438FC1C; Tue, 14 Jun 2011 16:05:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5EG510f041989; Tue, 14 Jun 2011 16:05:01 GMT (envelope-from gibbs@svn.freebsd.org) Received: (from gibbs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5EG51vx041987; Tue, 14 Jun 2011 16:05:01 GMT (envelope-from gibbs@svn.freebsd.org) Message-Id: <201106141605.p5EG51vx041987@svn.freebsd.org> From: "Justin T. Gibbs" Date: Tue, 14 Jun 2011 16:05:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223084 - head/sys/cam/scsi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jun 2011 16:05:01 -0000 Author: gibbs Date: Tue Jun 14 16:05:00 2011 New Revision: 223084 URL: http://svn.freebsd.org/changeset/base/223084 Log: sys/cam/scsi/scsi_da.c: - Only attempt the closing synchronize cache on a disk if it is still there. - When a device is lost, report the number of outstanding I/Os as they are drained. - When a device is lost, return any unprocessed bios with ENXIO instead of EIO. - Filter asynchronous events, but always allow cam_periph_async() to see them too. Sponsored by: Spectra Logic Corporation Modified: head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Tue Jun 14 15:45:41 2011 (r223083) +++ head/sys/cam/scsi/scsi_da.c Tue Jun 14 16:05:00 2011 (r223084) @@ -727,7 +727,8 @@ daclose(struct disk *dp) softc = (struct da_softc *)periph->softc; - if ((softc->quirks & DA_Q_NO_SYNC_CACHE) == 0) { + if ((softc->quirks & DA_Q_NO_SYNC_CACHE) == 0 + && (softc->flags & DA_FLAG_PACK_INVALID) == 0) { union ccb *ccb; ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL); @@ -977,7 +978,8 @@ daoninvalidate(struct cam_periph *periph bioq_flush(&softc->bio_queue, NULL, ENXIO); disk_gone(softc->disk); - xpt_print(periph->path, "lost device\n"); + xpt_print(periph->path, "lost device - %d outstanding\n", + softc->outstanding_cmds); } static void @@ -1060,12 +1062,12 @@ daasync(void *callback_arg, u_int32_t co softc->flags |= DA_FLAG_RETRY_UA; LIST_FOREACH(ccbh, &softc->pending_ccbs, periph_links.le) ccbh->ccb_state |= DA_CCB_RETRY_UA; - /* FALLTHROUGH*/ + break; } default: - cam_periph_async(periph, code, path, arg); break; } + cam_periph_async(periph, code, path, arg); } static void @@ -1558,7 +1560,7 @@ dadone(struct cam_periph *periph, union if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { int error; int sf; - + if ((csio->ccb_h.ccb_state & DA_CCB_RETRY_UA) != 0) sf = SF_RETRY_UA; else @@ -1573,8 +1575,17 @@ dadone(struct cam_periph *periph, union return; } if (error != 0) { + int queued_error; + + /* + * return all queued I/O with EIO, so that + * the client can retry these I/Os in the + * proper order should it attempt to recover. + */ + queued_error = EIO; - if (error == ENXIO) { + if (error == ENXIO + && (softc->flags & DA_FLAG_PACK_INVALID)== 0) { /* * Catastrophic error. Mark our pack as * invalid. @@ -1586,14 +1597,10 @@ dadone(struct cam_periph *periph, union xpt_print(periph->path, "Invalidating pack\n"); softc->flags |= DA_FLAG_PACK_INVALID; + queued_error = ENXIO; } - - /* - * return all queued I/O with EIO, so that - * the client can retry these I/Os in the - * proper order should it attempt to recover. - */ - bioq_flush(&softc->bio_queue, NULL, EIO); + bioq_flush(&softc->bio_queue, NULL, + queued_error); bp->bio_error = error; bp->bio_resid = bp->bio_bcount; bp->bio_flags |= BIO_ERROR; @@ -1626,6 +1633,11 @@ dadone(struct cam_periph *periph, union if (softc->outstanding_cmds == 0) softc->flags |= DA_FLAG_WENT_IDLE; + if ((softc->flags & DA_FLAG_PACK_INVALID) != 0) { + xpt_print(periph->path, "oustanding %d\n", + softc->outstanding_cmds); + } + biodone(bp); break; } From owner-svn-src-head@FreeBSD.ORG Tue Jun 14 16:29:44 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 53C5B1065674; Tue, 14 Jun 2011 16:29:44 +0000 (UTC) (envelope-from gibbs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 433078FC1C; Tue, 14 Jun 2011 16:29:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5EGTiAo042712; Tue, 14 Jun 2011 16:29:44 GMT (envelope-from gibbs@svn.freebsd.org) Received: (from gibbs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5EGTiOp042709; Tue, 14 Jun 2011 16:29:44 GMT (envelope-from gibbs@svn.freebsd.org) Message-Id: <201106141629.p5EGTiOp042709@svn.freebsd.org> From: "Justin T. Gibbs" Date: Tue, 14 Jun 2011 16:29:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223085 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jun 2011 16:29:44 -0000 Author: gibbs Date: Tue Jun 14 16:29:43 2011 New Revision: 223085 URL: http://svn.freebsd.org/changeset/base/223085 Log: sys/sys/conf.h: sys/kern/kern_conf.c: Add make_dev_physpath_alias(). This interface takes the parent cdev of the alias, an old alias cdev (if any) to replace with the newly created alias, and the physical path string. The alias is visiable as a symlink to the parent, with the same name as the parent, rooted at physpath in devfs. Note: make_dev_physpath_alias() has hard coded knowledge of the Solaris style prefix convention for physical path data, "id1,". In the future, I expect the convention to change to allow "physical path quality" to be reported in the prefix. For example, a physical path based on NewBus topology would be of "lower quality" than a physical path reported by a device enclosure. Sponsored by: Spectra Logic Corporation Modified: head/sys/kern/kern_conf.c head/sys/sys/conf.h Modified: head/sys/kern/kern_conf.c ============================================================================== --- head/sys/kern/kern_conf.c Tue Jun 14 16:05:00 2011 (r223084) +++ head/sys/kern/kern_conf.c Tue Jun 14 16:29:43 2011 (r223085) @@ -963,6 +963,68 @@ make_dev_alias_p(int flags, struct cdev return (res); } +int +make_dev_physpath_alias(int flags, struct cdev **cdev, struct cdev *pdev, + struct cdev *old_alias, const char *physpath) +{ + char *devfspath; + int physpath_len; + int max_parentpath_len; + int parentpath_len; + int devfspathbuf_len; + int mflags; + int ret; + + *cdev = NULL; + devfspath = NULL; + physpath_len = strlen(physpath); + ret = EINVAL; + if (physpath_len == 0) + goto out; + + if (strncmp("id1,", physpath, 4) == 0) { + physpath += 4; + physpath_len -= 4; + if (physpath_len == 0) + goto out; + } + + max_parentpath_len = SPECNAMELEN - physpath_len - /*/*/1; + parentpath_len = strlen(pdev->si_name); + if (max_parentpath_len < parentpath_len) { + printf("make_dev_physpath_alias: WARNING - Unable to alias %s " + "to %s/%s - path too long\n", + pdev->si_name, physpath, pdev->si_name); + ret = ENAMETOOLONG; + goto out; + } + + mflags = (flags & MAKEDEV_NOWAIT) ? M_NOWAIT : M_WAITOK; + devfspathbuf_len = physpath_len + /*/*/1 + parentpath_len + /*NUL*/1; + devfspath = malloc(devfspathbuf_len, M_DEVBUF, mflags); + if (devfspath == NULL) { + ret = ENOMEM; + goto out; + } + + sprintf(devfspath, "%s/%s", physpath, pdev->si_name); + if (old_alias != NULL + && strcmp(old_alias->si_name, devfspath) == 0) { + /* Retain the existing alias. */ + *cdev = old_alias; + old_alias = NULL; + ret = 0; + } else { + ret = make_dev_alias_p(flags, cdev, pdev, devfspath); + } +out: + if (old_alias != NULL) + destroy_dev(old_alias); + if (devfspath != NULL) + free(devfspath, M_DEVBUF); + return (ret); +} + static void destroy_devl(struct cdev *dev) { Modified: head/sys/sys/conf.h ============================================================================== --- head/sys/sys/conf.h Tue Jun 14 16:05:00 2011 (r223084) +++ head/sys/sys/conf.h Tue Jun 14 16:29:43 2011 (r223085) @@ -280,6 +280,9 @@ struct cdev *make_dev_alias(struct cdev __printflike(2, 3); int make_dev_alias_p(int _flags, struct cdev **_cdev, struct cdev *_pdev, const char *_fmt, ...) __printflike(4, 5); +int make_dev_physpath_alias(int _flags, struct cdev **_cdev, + struct cdev *_pdev, struct cdev *_old_alias, + const char *_physpath); void dev_lock(void); void dev_unlock(void); void setconf(void); From owner-svn-src-head@FreeBSD.ORG Tue Jun 14 16:50:16 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C42ED1065673; Tue, 14 Jun 2011 16:50:16 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 70E968FC1A; Tue, 14 Jun 2011 16:50:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5EGoGoF043408; Tue, 14 Jun 2011 16:50:16 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5EGoGvv043403; Tue, 14 Jun 2011 16:50:16 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201106141650.p5EGoGvv043403@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 14 Jun 2011 16:50:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223086 - head/bin/ps X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jun 2011 16:50:17 -0000 Author: trasz Date: Tue Jun 14 16:50:16 2011 New Revision: 223086 URL: http://svn.freebsd.org/changeset/base/223086 Log: Add "gid" and "group" keywords to display the effective group ID and effective group name. Also, add "egid", "egroup" and "euid" aliases. PR: bin/146331 Submitted by: Jeremie Le Hen Modified: head/bin/ps/extern.h head/bin/ps/keyword.c head/bin/ps/print.c head/bin/ps/ps.1 Modified: head/bin/ps/extern.h ============================================================================== --- head/bin/ps/extern.h Tue Jun 14 16:29:43 2011 (r223085) +++ head/bin/ps/extern.h Tue Jun 14 16:50:16 2011 (r223086) @@ -70,6 +70,7 @@ void pmem(KINFO *, VARENT *); void pri(KINFO *, VARENT *); void printheader(void); void priorityr(KINFO *, VARENT *); +void egroupname(KINFO *, VARENT *); void rgroupname(KINFO *, VARENT *); void runame(KINFO *, VARENT *); void rvar(KINFO *, VARENT *); @@ -78,6 +79,7 @@ int s_cputime(KINFO *); int s_label(KINFO *); int s_loginclass(KINFO *); int s_logname(KINFO *); +int s_egroupname(KINFO *); int s_rgroupname(KINFO *); int s_runame(KINFO *); int s_systime(KINFO *); Modified: head/bin/ps/keyword.c ============================================================================== --- head/bin/ps/keyword.c Tue Jun 14 16:29:43 2011 (r223085) +++ head/bin/ps/keyword.c Tue Jun 14 16:50:16 2011 (r223086) @@ -88,12 +88,19 @@ static VAR var[] = { {"cpu", "CPU", NULL, 0, kvar, NULL, 3, KOFF(ki_estcpu), UINT, "d", 0}, {"cputime", "", "time", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, + {"egid", "", "gid", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, + {"egroup", "", "group", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, {"emul", "EMUL", NULL, LJUST, emulname, NULL, EMULLEN, 0, CHAR, NULL, 0}, {"etime", "ELAPSED", NULL, USER, elapsed, NULL, 12, 0, CHAR, NULL, 0}, {"etimes", "ELAPSED", NULL, USER, elapseds, NULL, 12, 0, CHAR, NULL, 0}, + {"euid", "", "uid", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, {"f", "F", NULL, 0, kvar, NULL, 8, KOFF(ki_flag), INT, "x", 0}, {"flags", "", "f", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, + {"gid", "GID", NULL, 0, kvar, NULL, UIDLEN, KOFF(ki_groups), + UINT, UIDFMT, 0}, + {"group", "GROUP", NULL, LJUST, egroupname, s_egroupname, + USERLEN, 0, CHAR, NULL, 0}, {"ignored", "", "sigignore", 0, NULL, NULL, 0, 0, CHAR, NULL, 0}, {"inblk", "INBLK", NULL, USER, rvar, NULL, 4, ROFF(ru_inblock), LONG, "ld", 0}, Modified: head/bin/ps/print.c ============================================================================== --- head/bin/ps/print.c Tue Jun 14 16:29:43 2011 (r223085) +++ head/bin/ps/print.c Tue Jun 14 16:50:16 2011 (r223086) @@ -341,6 +341,22 @@ s_uname(KINFO *k) } void +egroupname(KINFO *k, VARENT *ve) +{ + VAR *v; + + v = ve->var; + (void)printf("%-*s", v->width, + group_from_gid(k->ki_p->ki_groups[0], 0)); +} + +int +s_egroupname(KINFO *k) +{ + return (strlen(group_from_gid(k->ki_p->ki_groups[0], 0))); +} + +void rgroupname(KINFO *k, VARENT *ve) { VAR *v; Modified: head/bin/ps/ps.1 ============================================================================== --- head/bin/ps/ps.1 Tue Jun 14 16:29:43 2011 (r223085) +++ head/bin/ps/ps.1 Tue Jun 14 16:50:16 2011 (r223086) @@ -29,7 +29,7 @@ .\" @(#)ps.1 8.3 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd April 18, 2011 +.Dd June 14, 2011 .Dt PS 1 .Os .Sh NAME @@ -502,6 +502,12 @@ elapsed running time, in decimal integer .It Cm flags the process flags, in hexadecimal (alias .Cm f ) +.It Cm gid +effective group ID (alias +.Cm egid ) +.It Cm group +group name (from egid) (alias +.Cm egroup ) .It Cm inblk total blocks read (alias .Cm inblock ) @@ -629,7 +635,8 @@ process pointer .It Cm ucomm name to be used for accounting .It Cm uid -effective user ID +effective user ID (alias +.Cm euid ) .It Cm upr scheduling priority on return from system call (alias .Cm usrpri ) From owner-svn-src-head@FreeBSD.ORG Tue Jun 14 17:09:31 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA15D1065670; Tue, 14 Jun 2011 17:09:30 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A08A48FC15; Tue, 14 Jun 2011 17:09:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5EH9Ul2044053; Tue, 14 Jun 2011 17:09:30 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5EH9UWm044049; Tue, 14 Jun 2011 17:09:30 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201106141709.p5EH9UWm044049@svn.freebsd.org> From: "David E. O'Brien" Date: Tue, 14 Jun 2011 17:09:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223088 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jun 2011 17:09:31 -0000 Author: obrien Date: Tue Jun 14 17:09:30 2011 New Revision: 223088 URL: http://svn.freebsd.org/changeset/base/223088 Log: We should not return ECHILD when debugging a child and the parent does a "wait4(-1, ..., WNOHANG, ...)". Instead wait(2) should behave as if the child does not wish to report status at this time. Reviewed by: jhb Modified: head/sys/kern/kern_exit.c head/sys/kern/sys_process.c head/sys/sys/proc.h Modified: head/sys/kern/kern_exit.c ============================================================================== --- head/sys/kern/kern_exit.c Tue Jun 14 16:50:29 2011 (r223087) +++ head/sys/kern/kern_exit.c Tue Jun 14 17:09:30 2011 (r223088) @@ -701,8 +701,9 @@ proc_reap(struct thread *td, struct proc */ if (p->p_oppid && (t = pfind(p->p_oppid)) != NULL) { PROC_LOCK(p); - p->p_oppid = 0; proc_reparent(p, t); + p->p_pptr->p_dbg_child--; + p->p_oppid = 0; PROC_UNLOCK(p); pksignal(t, SIGCHLD, p->p_ksi); wakeup(t); @@ -794,7 +795,8 @@ kern_wait(struct thread *td, pid_t pid, pid = -q->p_pgid; PROC_UNLOCK(q); } - if (options &~ (WUNTRACED|WNOHANG|WCONTINUED|WNOWAIT|WLINUXCLONE)) + /* If we don't know the option, just return. */ + if (options & ~(WUNTRACED|WNOHANG|WCONTINUED|WNOWAIT|WLINUXCLONE)) return (EINVAL); loop: if (q->p_flag & P_STATCHILD) { @@ -873,7 +875,10 @@ loop: } if (nfound == 0) { sx_xunlock(&proctree_lock); - return (ECHILD); + if (td->td_proc->p_dbg_child) + return (0); + else + return (ECHILD); } if (options & WNOHANG) { sx_xunlock(&proctree_lock); Modified: head/sys/kern/sys_process.c ============================================================================== --- head/sys/kern/sys_process.c Tue Jun 14 16:50:29 2011 (r223087) +++ head/sys/kern/sys_process.c Tue Jun 14 17:09:30 2011 (r223088) @@ -831,8 +831,11 @@ kern_ptrace(struct thread *td, int req, /* security check done above */ p->p_flag |= P_TRACED; p->p_oppid = p->p_pptr->p_pid; - if (p->p_pptr != td->td_proc) + if (p->p_pptr != td->td_proc) { + /* Remember that a child is being debugged(traced). */ + p->p_pptr->p_dbg_child++; proc_reparent(p, td->td_proc); + } data = SIGSTOP; goto sendsig; /* in PT_CONTINUE below */ @@ -919,11 +922,12 @@ kern_ptrace(struct thread *td, int req, PROC_UNLOCK(pp); PROC_LOCK(p); proc_reparent(p, pp); + p->p_pptr->p_dbg_child--; if (pp == initproc) p->p_sigparent = SIGCHLD; } - p->p_flag &= ~(P_TRACED | P_WAITED | P_FOLLOWFORK); p->p_oppid = 0; + p->p_flag &= ~(P_TRACED | P_WAITED | P_FOLLOWFORK); /* should we send SIGCHLD? */ /* childproc_continued(p); */ Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Tue Jun 14 16:50:29 2011 (r223087) +++ head/sys/sys/proc.h Tue Jun 14 17:09:30 2011 (r223088) @@ -503,6 +503,8 @@ struct proc { /* The following fields are all zeroed upon creation in fork. */ #define p_startzero p_oppid pid_t p_oppid; /* (c + e) Save ppid in ptrace. XXX */ + int p_dbg_child; /* (c + e) # of debugged children in + ptrace. */ struct vmspace *p_vmspace; /* (b) Address space. */ u_int p_swtick; /* (c) Tick when swapped in or out. */ struct itimerval p_realtimer; /* (c) Alarm timer. */ From owner-svn-src-head@FreeBSD.ORG Tue Jun 14 17:10:33 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 47A9B1065673; Tue, 14 Jun 2011 17:10:33 +0000 (UTC) (envelope-from gibbs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3573E8FC1D; Tue, 14 Jun 2011 17:10:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5EHAXuA044131; Tue, 14 Jun 2011 17:10:33 GMT (envelope-from gibbs@svn.freebsd.org) Received: (from gibbs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5EHAXYS044119; Tue, 14 Jun 2011 17:10:33 GMT (envelope-from gibbs@svn.freebsd.org) Message-Id: <201106141710.p5EHAXYS044119@svn.freebsd.org> From: "Justin T. Gibbs" Date: Tue, 14 Jun 2011 17:10:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223089 - in head: sys/cam/ata sys/cam/scsi sys/geom sys/sys usr.sbin/diskinfo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jun 2011 17:10:33 -0000 Author: gibbs Date: Tue Jun 14 17:10:32 2011 New Revision: 223089 URL: http://svn.freebsd.org/changeset/base/223089 Log: Plumb device physical path reporting from CAM devices, through GEOM and DEVFS, and make it accessible via the diskinfo utility. Extend GEOM's generic attribute query mechanism into generic disk consumers. sys/geom/geom_disk.c: sys/geom/geom_disk.h: sys/cam/scsi/scsi_da.c: sys/cam/ata/ata_da.c: - Allow disk providers to implement a new method which can override the default BIO_GETATTR response, d_getattr(struct bio *). This function returns -1 if not handled, otherwise it returns 0 or an errno to be passed to g_io_deliver(). sys/cam/scsi/scsi_da.c: sys/cam/ata/ata_da.c: - Don't copy the serial number to dp->d_ident anymore, as the CAM XPT is now responsible for returning this information via d_getattr()->(a)dagetattr()->xpt_getatr(). sys/geom/geom_dev.c: - Implement a new ioctl, DIOCGPHYSPATH, which returns the GEOM attribute "GEOM::physpath", if possible. If the attribute request returns a zero-length string, ENOENT is returned. usr.sbin/diskinfo/diskinfo.c: - If the DIOCGPHYSPATH ioctl is successful, report physical path data when diskinfo is executed with the '-v' option. Submitted by: will Reviewed by: gibbs Sponsored by: Spectra Logic Corporation Add generic attribute change notification support to GEOM. sys/sys/geom/geom.h: Add a new attrchanged method field to both g_class and g_geom. sys/sys/geom/geom.h: sys/geom/geom_event.c: - Provide the g_attr_changed() function that providers can use to advertise attribute changes. - Perform delivery of attribute change notifications from a thread context via the standard GEOM event mechanism. sys/geom/geom_subr.c: Inherit the attrchanged method from class to geom (class instance). sys/geom/geom_disk.c: Provide disk_attr_changed() to provide g_attr_changed() access to consumers of the disk API. sys/cam/scsi/scsi_pass.c: sys/cam/scsi/scsi_da.c: sys/geom/geom_dev.c: sys/geom/geom_disk.c: Use attribute changed events to track updates to physical path information. sys/cam/scsi/scsi_da.c: Add AC_ADVINFO_CHANGED to the registered asynchronous CAM events for this driver. When this event occurs, and the updated buffer type references our physical path attribute, emit a GEOM attribute changed event via the disk_attr_changed() API. sys/cam/scsi/scsi_pass.c: Add AC_ADVINFO_CHANGED to the registered asynchronous CAM events for this driver. When this event occurs, update the physical patch devfs alias for this pass instance. Submitted by: gibbs Sponsored by: Spectra Logic Corporation Modified: head/sys/cam/ata/ata_da.c head/sys/cam/scsi/scsi_da.c head/sys/cam/scsi/scsi_pass.c head/sys/geom/geom.h head/sys/geom/geom_dev.c head/sys/geom/geom_disk.c head/sys/geom/geom_disk.h head/sys/geom/geom_event.c head/sys/geom/geom_subr.c head/sys/sys/disk.h head/usr.sbin/diskinfo/diskinfo.c Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Tue Jun 14 17:09:30 2011 (r223088) +++ head/sys/cam/ata/ata_da.c Tue Jun 14 17:10:32 2011 (r223089) @@ -812,6 +812,25 @@ adasysctlinit(void *context, int pending cam_periph_release(periph); } +static int +adagetattr(struct bio *bp) +{ + int ret = -1; + struct cam_periph *periph; + + if (bp->bio_disk == NULL || bp->bio_disk->d_drv1) + return ENXIO; + periph = (struct cam_periph *)bp->bio_disk->d_drv1; + if (periph->path == NULL) + return ENXIO; + + ret = xpt_getattr(bp->bio_data, bp->bio_length, bp->bio_attribute, + periph->path); + if (ret == 0) + bp->bio_completed = bp->bio_length; + return ret; +} + static cam_status adaregister(struct cam_periph *periph, void *arg) { @@ -917,6 +936,7 @@ adaregister(struct cam_periph *periph, v softc->disk->d_open = adaopen; softc->disk->d_close = adaclose; softc->disk->d_strategy = adastrategy; + softc->disk->d_getattr = adagetattr; softc->disk->d_dump = adadump; softc->disk->d_name = "ada"; softc->disk->d_drv1 = periph; @@ -938,8 +958,6 @@ adaregister(struct cam_periph *periph, v ((softc->flags & ADA_FLAG_CAN_CFA) && !(softc->flags & ADA_FLAG_CAN_48BIT))) softc->disk->d_flags |= DISKFLAG_CANDELETE; - strlcpy(softc->disk->d_ident, cgd->serial_num, - MIN(sizeof(softc->disk->d_ident), cgd->serial_num_len + 1)); strlcpy(softc->disk->d_descr, cgd->ident_data.model, MIN(sizeof(softc->disk->d_descr), sizeof(cgd->ident_data.model))); softc->disk->d_hba_vendor = cpi.hba_vendor; Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Tue Jun 14 17:09:30 2011 (r223088) +++ head/sys/cam/scsi/scsi_da.c Tue Jun 14 17:10:32 2011 (r223089) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #endif /* _KERNEL */ @@ -933,6 +934,25 @@ dadump(void *arg, void *virtual, vm_offs return (0); } +static int +dagetattr(struct bio *bp) +{ + int ret = -1; + struct cam_periph *periph; + + if (bp->bio_disk == NULL || bp->bio_disk->d_drv1 == NULL) + return ENXIO; + periph = (struct cam_periph *)bp->bio_disk->d_drv1; + if (periph->path == NULL) + return ENXIO; + + ret = xpt_getattr(bp->bio_data, bp->bio_length, bp->bio_attribute, + periph->path); + if (ret == 0) + bp->bio_completed = bp->bio_length; + return ret; +} + static void dainit(void) { @@ -1046,6 +1066,20 @@ daasync(void *callback_arg, u_int32_t co && status != CAM_REQ_INPROG) printf("daasync: Unable to attach to new device " "due to status 0x%x\n", status); + return; + } + case AC_ADVINFO_CHANGED: + { + uintptr_t buftype; + + buftype = (uintptr_t)arg; + if (buftype == CDAI_TYPE_PHYS_PATH) { + struct da_softc *softc; + + softc = periph->softc; + disk_attr_changed(softc->disk, "GEOM::physpath", + M_NOWAIT); + } break; } case AC_SENT_BDR: @@ -1233,17 +1267,6 @@ daregister(struct cam_periph *periph, vo TASK_INIT(&softc->sysctl_task, 0, dasysctlinit, periph); /* - * Add async callbacks for bus reset and - * bus device reset calls. I don't bother - * checking if this fails as, in most cases, - * the system will function just fine without - * them and the only alternative would be to - * not attach the device on failure. - */ - xpt_register_async(AC_SENT_BDR | AC_BUS_RESET | AC_LOST_DEVICE, - daasync, periph, periph->path); - - /* * Take an exclusive refcount on the periph while dastart is called * to finish the probe. The reference will be dropped in dadone at * the end of probe. @@ -1303,6 +1326,7 @@ daregister(struct cam_periph *periph, vo softc->disk->d_close = daclose; softc->disk->d_strategy = dastrategy; softc->disk->d_dump = dadump; + softc->disk->d_getattr = dagetattr; softc->disk->d_name = "da"; softc->disk->d_drv1 = periph; if (cpi.maxio == 0) @@ -1315,8 +1339,6 @@ daregister(struct cam_periph *periph, vo softc->disk->d_flags = 0; if ((softc->quirks & DA_Q_NO_SYNC_CACHE) == 0) softc->disk->d_flags |= DISKFLAG_CANFLUSHCACHE; - strlcpy(softc->disk->d_ident, cgd->serial_num, - MIN(sizeof(softc->disk->d_ident), cgd->serial_num_len + 1)); cam_strvis(softc->disk->d_descr, cgd->inq_data.vendor, sizeof(cgd->inq_data.vendor), sizeof(softc->disk->d_descr)); strlcat(softc->disk->d_descr, " ", sizeof(softc->disk->d_descr)); @@ -1330,6 +1352,25 @@ daregister(struct cam_periph *periph, vo disk_create(softc->disk, DISK_VERSION); mtx_lock(periph->sim->mtx); + /* + * Add async callbacks for events of interest. + * I don't bother checking if this fails as, + * in most cases, the system will function just + * fine without them and the only alternative + * would be to not attach the device on failure. + */ + xpt_register_async(AC_SENT_BDR | AC_BUS_RESET + | AC_LOST_DEVICE | AC_ADVINFO_CHANGED, + daasync, periph, periph->path); + + /* + * Emit an attribute changed notification just in case + * physical path information arrived before our async + * event handler was registered, but after anyone attaching + * to our disk device polled it. + */ + disk_attr_changed(softc->disk, "GEOM::physpath", M_NOWAIT); + xpt_schedule(periph, CAM_PRIORITY_DEV); return(CAM_REQ_CMP); Modified: head/sys/cam/scsi/scsi_pass.c ============================================================================== --- head/sys/cam/scsi/scsi_pass.c Tue Jun 14 17:09:30 2011 (r223088) +++ head/sys/cam/scsi/scsi_pass.c Tue Jun 14 17:10:32 2011 (r223089) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -70,12 +71,14 @@ typedef enum { #define ccb_bp ppriv_ptr1 struct pass_softc { - pass_state state; - pass_flags flags; - u_int8_t pd_type; - union ccb saved_ccb; - struct devstat *device_stats; - struct cdev *dev; + pass_state state; + pass_flags flags; + u_int8_t pd_type; + union ccb saved_ccb; + struct devstat *device_stats; + struct cdev *dev; + struct cdev *alias_dev; + struct task add_physpath_task; }; @@ -88,6 +91,7 @@ static periph_ctor_t passregister; static periph_oninv_t passoninvalidate; static periph_dtor_t passcleanup; static periph_start_t passstart; +static void pass_add_physpath(void *context, int pending); static void passasync(void *callback_arg, u_int32_t code, struct cam_path *path, void *arg); static void passdone(struct cam_periph *periph, @@ -168,17 +172,45 @@ passcleanup(struct cam_periph *periph) if (bootverbose) xpt_print(periph->path, "removing device entry\n"); devstat_remove_entry(softc->device_stats); + cam_periph_unlock(periph); + taskqueue_drain(taskqueue_thread, &softc->add_physpath_task); + /* * passcleanup() is indirectly a d_close method via passclose, * so using destroy_dev(9) directly can result in deadlock. */ destroy_dev_sched(softc->dev); cam_periph_lock(periph); + free(softc, M_DEVBUF); } static void +pass_add_physpath(void *context, int pending) +{ + struct cam_periph *periph; + struct pass_softc *softc; + char *physpath; + + /* + * If we have one, create a devfs alias for our + * physical path. + */ + periph = context; + softc = periph->softc; + physpath = malloc(MAXPATHLEN, M_DEVBUF, M_WAITOK); + if (xpt_getattr(physpath, MAXPATHLEN, + "GEOM::physpath", periph->path) == 0 + && strlen(physpath) != 0) { + + make_dev_physpath_alias(MAKEDEV_WAITOK, &softc->alias_dev, + softc->dev, softc->alias_dev, physpath); + } + free(physpath, M_DEVBUF); +} + +static void passasync(void *callback_arg, u_int32_t code, struct cam_path *path, void *arg) { @@ -219,6 +251,20 @@ passasync(void *callback_arg, u_int32_t break; } + case AC_ADVINFO_CHANGED: + { + uintptr_t buftype; + + buftype = (uintptr_t)arg; + if (buftype == CDAI_TYPE_PHYS_PATH) { + struct pass_softc *softc; + + softc = (struct pass_softc *)periph->softc; + taskqueue_enqueue(taskqueue_thread, + &softc->add_physpath_task); + } + break; + } default: cam_periph_async(periph, code, path, arg); break; @@ -292,11 +338,22 @@ passregister(struct cam_periph *periph, mtx_lock(periph->sim->mtx); softc->dev->si_drv1 = periph; + TASK_INIT(&softc->add_physpath_task, /*priority*/0, + pass_add_physpath, periph); + + /* + * See if physical path information is already available. + */ + taskqueue_enqueue(taskqueue_thread, &softc->add_physpath_task); + /* - * Add an async callback so that we get - * notified if this device goes away. + * Add an async callback so that we get notified if + * this device goes away or its physical path + * (stored in the advanced info data of the EDT) has + * changed. */ - xpt_register_async(AC_LOST_DEVICE, passasync, periph, periph->path); + xpt_register_async(AC_LOST_DEVICE | AC_ADVINFO_CHANGED, + passasync, periph, periph->path); if (bootverbose) xpt_announce_periph(periph, NULL); Modified: head/sys/geom/geom.h ============================================================================== --- head/sys/geom/geom.h Tue Jun 14 17:09:30 2011 (r223088) +++ head/sys/geom/geom.h Tue Jun 14 17:10:32 2011 (r223089) @@ -76,6 +76,7 @@ typedef void g_orphan_t (struct g_consum typedef void g_start_t (struct bio *); typedef void g_spoiled_t (struct g_consumer *); +typedef void g_attrchanged_t (struct g_consumer *, const char *attr); typedef void g_dumpconf_t (struct sbuf *, const char *indent, struct g_geom *, struct g_consumer *, struct g_provider *); @@ -100,6 +101,7 @@ struct g_class { */ g_start_t *start; g_spoiled_t *spoiled; + g_attrchanged_t *attrchanged; g_dumpconf_t *dumpconf; g_access_t *access; g_orphan_t *orphan; @@ -128,6 +130,7 @@ struct g_geom { int rank; g_start_t *start; g_spoiled_t *spoiled; + g_attrchanged_t *attrchanged; g_dumpconf_t *dumpconf; g_access_t *access; g_orphan_t *orphan; @@ -217,6 +220,7 @@ struct g_classifier_hook { /* geom_dev.c */ struct cdev; void g_dev_print(void); +void g_dev_physpath_changed(void); struct g_provider *g_dev_getprovider(struct cdev *dev); /* geom_dump.c */ @@ -232,6 +236,7 @@ typedef void g_event_t(void *, int flag) int g_post_event(g_event_t *func, void *arg, int flag, ...); int g_waitfor_event(g_event_t *func, void *arg, int flag, ...); void g_cancel_event(void *ref); +int g_attr_changed(struct g_provider *pp, const char *attr, int flag); void g_orphan_provider(struct g_provider *pp, int error); void g_waitidlelock(void); Modified: head/sys/geom/geom_dev.c ============================================================================== --- head/sys/geom/geom_dev.c Tue Jun 14 17:09:30 2011 (r223088) +++ head/sys/geom/geom_dev.c Tue Jun 14 17:10:32 2011 (r223089) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -52,6 +53,12 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include + +/* + * Use the consumer private field to reference a physdev alias (if any). + */ +#define cp_alias_dev private static d_open_t g_dev_open; static d_close_t g_dev_close; @@ -72,12 +79,14 @@ static struct cdevsw g_dev_cdevsw = { static g_taste_t g_dev_taste; static g_orphan_t g_dev_orphan; +static g_attrchanged_t g_dev_attrchanged; static struct g_class g_dev_class = { .name = "DEV", .version = G_VERSION, .taste = g_dev_taste, .orphan = g_dev_orphan, + .attrchanged = g_dev_attrchanged }; void @@ -93,6 +102,40 @@ g_dev_print(void) printf("\n"); } +static void +g_dev_attrchanged(struct g_consumer *cp, const char *attr) +{ + + if (strcmp(attr, "GEOM::physpath") != 0) + return; + + if (g_access(cp, 1, 0, 0) == 0) { + char *physpath; + int error, physpath_len; + + physpath_len = MAXPATHLEN; + physpath = g_malloc(physpath_len, M_WAITOK|M_ZERO); + error = + g_io_getattr("GEOM::physpath", cp, &physpath_len, physpath); + g_access(cp, -1, 0, 0); + if (error == 0 && strlen(physpath) != 0) { + struct cdev *dev; + 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; + 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; + } + g_free(physpath); + } +} + struct g_provider * g_dev_getprovider(struct cdev *dev) { @@ -107,7 +150,6 @@ g_dev_getprovider(struct cdev *dev) return (cp->provider); } - static struct g_geom * g_dev_taste(struct g_class *mp, struct g_provider *pp, int insist __unused) { @@ -167,6 +209,9 @@ g_dev_taste(struct g_class *mp, struct g adev->si_drv1 = gp; adev->si_drv2 = cp; } + + g_dev_attrchanged(cp, "GEOM::physpath"); + return (gp); } @@ -365,6 +410,11 @@ g_dev_ioctl(struct cdev *dev, u_long cmd case DIOCGSTRIPEOFFSET: *(off_t *)data = cp->provider->stripeoffset; break; + case DIOCGPHYSPATH: + error = g_io_getattr("GEOM::physpath", cp, &i, data); + if (error == 0 && *(char *)data == '\0') + error = ENOENT; + break; default: if (cp->provider->geom->ioctl != NULL) { error = cp->provider->geom->ioctl(cp->provider, cmd, data, fflag, td); Modified: head/sys/geom/geom_disk.c ============================================================================== --- head/sys/geom/geom_disk.c Tue Jun 14 17:09:30 2011 (r223088) +++ head/sys/geom/geom_disk.c Tue Jun 14 17:10:32 2011 (r223089) @@ -347,6 +347,15 @@ g_disk_start(struct bio *bp) } while (bp2 != NULL); break; case BIO_GETATTR: + /* Give the driver a chance to override */ + if (dp->d_getattr != NULL) { + if (bp->bio_disk == NULL) + bp->bio_disk = dp; + error = dp->d_getattr(bp); + if (error != -1) + break; + error = EJUSTRETURN; + } if (g_handleattr_int(bp, "GEOM::candelete", (dp->d_flags & DISKFLAG_CANDELETE) != 0)) break; @@ -582,6 +591,18 @@ disk_gone(struct disk *dp) g_wither_provider(pp, ENXIO); } +void +disk_attr_changed(struct disk *dp, const char *attr, int flag) +{ + struct g_geom *gp; + struct g_provider *pp; + + gp = dp->d_geom; + if (gp != NULL) + LIST_FOREACH(pp, &gp->provider, provider) + (void)g_attr_changed(pp, attr, flag); +} + static void g_kern_disks(void *p, int flag __unused) { Modified: head/sys/geom/geom_disk.h ============================================================================== --- head/sys/geom/geom_disk.h Tue Jun 14 17:09:30 2011 (r223088) +++ head/sys/geom/geom_disk.h Tue Jun 14 17:10:32 2011 (r223089) @@ -49,6 +49,7 @@ struct disk; typedef int disk_open_t(struct disk *); typedef int disk_close_t(struct disk *); typedef void disk_strategy_t(struct bio *bp); +typedef int disk_getattr_t(struct bio *bp); typedef int disk_ioctl_t(struct disk *, u_long cmd, void *data, int fflag, struct thread *td); /* NB: disk_ioctl_t SHALL be cast'able to d_ioctl_t */ @@ -75,6 +76,7 @@ struct disk { disk_strategy_t *d_strategy; disk_ioctl_t *d_ioctl; dumper_t *d_dump; + disk_getattr_t *d_getattr; /* Info fields from driver to geom_disk.c. Valid when open */ u_int d_sectorsize; @@ -104,6 +106,7 @@ struct disk *disk_alloc(void); void disk_create(struct disk *disk, int version); void disk_destroy(struct disk *disk); void disk_gone(struct disk *disk); +void disk_attr_changed(struct disk *dp, const char *attr, int flag); #define DISK_VERSION_00 0x58561059 #define DISK_VERSION_01 0x5856105a Modified: head/sys/geom/geom_event.c ============================================================================== --- head/sys/geom/geom_event.c Tue Jun 14 17:09:30 2011 (r223088) +++ head/sys/geom/geom_event.c Tue Jun 14 17:10:32 2011 (r223089) @@ -110,6 +110,53 @@ g_waitidlelock(void) } #endif +struct g_attrchanged_args { + struct g_provider *pp; + const char *attr; +}; + +static void +g_attr_changed_event(void *arg, int flag) +{ + struct g_attrchanged_args *args; + struct g_provider *pp; + struct g_consumer *cp; + struct g_consumer *next_cp; + + args = arg; + pp = args->pp; + + g_topology_assert(); + if (flag != EV_CANCEL && g_shutdown == 0) { + + /* + * Tell all consumers of the change. + */ + LIST_FOREACH_SAFE(cp, &pp->consumers, consumers, next_cp) { + if (cp->geom->attrchanged != NULL) + cp->geom->attrchanged(cp, args->attr); + } + } + g_free(args); +} + +int +g_attr_changed(struct g_provider *pp, const char *attr, int flag) +{ + struct g_attrchanged_args *args; + int error; + + args = g_malloc(sizeof *args, flag); + if (args == NULL) + return (ENOMEM); + args->pp = pp; + args->attr = attr; + error = g_post_event(g_attr_changed_event, args, flag, pp, NULL); + if (error != 0) + g_free(args); + return (error); +} + void g_orphan_provider(struct g_provider *pp, int error) { Modified: head/sys/geom/geom_subr.c ============================================================================== --- head/sys/geom/geom_subr.c Tue Jun 14 17:09:30 2011 (r223088) +++ head/sys/geom/geom_subr.c Tue Jun 14 17:10:32 2011 (r223089) @@ -350,6 +350,7 @@ g_new_geomf(struct g_class *mp, const ch /* Fill in defaults from class */ gp->start = mp->start; gp->spoiled = mp->spoiled; + gp->attrchanged = mp->attrchanged; gp->dumpconf = mp->dumpconf; gp->access = mp->access; gp->orphan = mp->orphan; Modified: head/sys/sys/disk.h ============================================================================== --- head/sys/sys/disk.h Tue Jun 14 17:09:30 2011 (r223088) +++ head/sys/sys/disk.h Tue Jun 14 17:10:32 2011 (r223089) @@ -116,4 +116,12 @@ void disk_err(struct bio *bp, const char * This should be a multiple of the sector size. */ +#define DIOCGPHYSPATH _IOR('d', 141, char[MAXPATHLEN]) + /* + * Get a string defining the physical path for a given provider. + * This has similar rules to ident, but is intended to uniquely + * identify the physical location of the device, not the current + * occupant of that location. + */ + #endif /* _SYS_DISK_H_ */ Modified: head/usr.sbin/diskinfo/diskinfo.c ============================================================================== --- head/usr.sbin/diskinfo/diskinfo.c Tue Jun 14 17:09:30 2011 (r223088) +++ head/usr.sbin/diskinfo/diskinfo.c Tue Jun 14 17:10:32 2011 (r223089) @@ -39,6 +39,7 @@ #include #include #include +#include #include static void @@ -57,7 +58,7 @@ int main(int argc, char **argv) { int i, ch, fd, error, exitval = 0; - char buf[BUFSIZ], ident[DISK_IDENT_SIZE]; + char buf[BUFSIZ], ident[DISK_IDENT_SIZE], physpath[MAXPATHLEN]; off_t mediasize, stripesize, stripeoffset; u_int sectorsize, fwsectors, fwheads; @@ -151,6 +152,8 @@ main(int argc, char **argv) } if (ioctl(fd, DIOCGIDENT, ident) == 0) printf("\t%-12s\t# Disk ident.\n", ident); + if (ioctl(fd, DIOCGPHYSPATH, physpath) == 0) + printf("\t%-12s\t# Physical path\n", physpath); } printf("\n"); if (opt_c) From owner-svn-src-head@FreeBSD.ORG Tue Jun 14 17:51:46 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C5A281065670; Tue, 14 Jun 2011 17:51:46 +0000 (UTC) (envelope-from stephen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B5B4E8FC12; Tue, 14 Jun 2011 17:51:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5EHpkQo045428; Tue, 14 Jun 2011 17:51:46 GMT (envelope-from stephen@svn.freebsd.org) Received: (from stephen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5EHpkWS045426; Tue, 14 Jun 2011 17:51:46 GMT (envelope-from stephen@svn.freebsd.org) Message-Id: <201106141751.p5EHpkWS045426@svn.freebsd.org> From: Stephen Montgomery-Smith Date: Tue, 14 Jun 2011 17:51:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223090 - head/share/misc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jun 2011 17:51:46 -0000 Author: stephen (ports committer) Date: Tue Jun 14 17:51:46 2011 New Revision: 223090 URL: http://svn.freebsd.org/changeset/base/223090 Log: Reviewed by: gabor (mentor) Approved by: gabor (mentor) Modified: head/share/misc/committers-ports.dot Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Tue Jun 14 17:10:32 2011 (r223089) +++ head/share/misc/committers-ports.dot Tue Jun 14 17:51:46 2011 (r223090) @@ -166,6 +166,7 @@ skreuzer [label="Steven Kreuzer\nskreuze sobomax[label="Maxim Sobolev\nsobomax@FreeBSD.org\n2000/05/17"] stas [label="Stanislav Sedov\nstas@FreeBSD.org\n2006/09/18"] stefan [label="Stefan Walter\nstefan@FreeBSD.org\n2006/05/07"] +stephen [label="Stephen Montgomery-Smith\nstephen@FreeBSD.org\n2011/06/13"] sunpoet [label="Po-Chuan Hsieh\nsunpoet@FreeBSD.org\n2010/09/21"] sylvio [label="Sylvio Cesar Teixeira\nsylvio@FreeBSD.org\n2009/10/29"] swills [label="Steve Wills\nswills@FreeBSD.org\n2010/09/03"] @@ -259,6 +260,7 @@ flz -> romain gabor -> lippe gabor -> pgj +gabor -> stephen garga -> acm garga -> alepulver @@ -311,6 +313,7 @@ lioux -> pat lwhsu -> yzlin +maho -> stephen maho -> tota marcus -> ahze From owner-svn-src-head@FreeBSD.ORG Tue Jun 14 18:19:48 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 93167106566B; Tue, 14 Jun 2011 18:19:48 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 79B728FC18; Tue, 14 Jun 2011 18:19:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5EIJmD2046265; Tue, 14 Jun 2011 18:19:48 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5EIJmlU046260; Tue, 14 Jun 2011 18:19:48 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201106141819.p5EIJmlU046260@svn.freebsd.org> From: John Baldwin Date: Tue, 14 Jun 2011 18:19:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223091 - head/sys/dev/puc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jun 2011 18:19:48 -0000 Author: jhb Date: Tue Jun 14 18:19:48 2011 New Revision: 223091 URL: http://svn.freebsd.org/changeset/base/223091 Log: Add location and pnpinfo strings for puc device ports. The location is announced during boot and contains the port number. The pnpinfo string lists the port type (PUC_TYPE_* constants). Tested by: Boris Samorodov bsam ipt ru MFC after: 1 week Modified: head/sys/dev/puc/puc.c head/sys/dev/puc/puc_bfe.h head/sys/dev/puc/puc_pccard.c head/sys/dev/puc/puc_pci.c Modified: head/sys/dev/puc/puc.c ============================================================================== --- head/sys/dev/puc/puc.c Tue Jun 14 17:51:46 2011 (r223090) +++ head/sys/dev/puc/puc.c Tue Jun 14 18:19:48 2011 (r223091) @@ -726,3 +726,41 @@ puc_bus_read_ivar(device_t dev, device_t } return (0); } + +int +puc_bus_print_child(device_t dev, device_t child) +{ + struct puc_port *port; + int retval; + + port = device_get_ivars(child); + retval = 0; + + retval += bus_print_child_header(dev, child); + retval += printf(" at port %d", port->p_nr); + retval += bus_print_child_footer(dev, child); + + return (retval); +} + +int +puc_bus_child_location_str(device_t dev, device_t child, char *buf, + size_t buflen) +{ + struct puc_port *port; + + port = device_get_ivars(child); + snprintf(buf, buflen, "port=%d", port->p_nr); + return (0); +} + +int +puc_bus_child_pnpinfo_str(device_t dev, device_t child, char *buf, + size_t buflen) +{ + struct puc_port *port; + + port = device_get_ivars(child); + snprintf(buf, buflen, "type=%d", port->p_type); + return (0); +} Modified: head/sys/dev/puc/puc_bfe.h ============================================================================== --- head/sys/dev/puc/puc_bfe.h Tue Jun 14 17:51:46 2011 (r223090) +++ head/sys/dev/puc/puc_bfe.h Tue Jun 14 18:19:48 2011 (r223091) @@ -82,9 +82,12 @@ int puc_bfe_attach(device_t); int puc_bfe_detach(device_t); int puc_bfe_probe(device_t, const struct puc_cfg *); +int puc_bus_child_location_str(device_t, device_t, char *, size_t); +int puc_bus_child_pnpinfo_str(device_t, device_t, char *, size_t); struct resource *puc_bus_alloc_resource(device_t, device_t, int, int *, u_long, u_long, u_long, u_int); int puc_bus_get_resource(device_t, device_t, int, int, u_long *, u_long *); +int puc_bus_print_child(device_t, device_t); int puc_bus_read_ivar(device_t, device_t, int, uintptr_t *); int puc_bus_release_resource(device_t, device_t, int, int, struct resource *); int puc_bus_setup_intr(device_t, device_t, struct resource *, int, Modified: head/sys/dev/puc/puc_pccard.c ============================================================================== --- head/sys/dev/puc/puc_pccard.c Tue Jun 14 17:51:46 2011 (r223090) +++ head/sys/dev/puc/puc_pccard.c Tue Jun 14 18:19:48 2011 (r223091) @@ -82,7 +82,9 @@ static device_method_t puc_pccard_method DEVMETHOD(bus_read_ivar, puc_bus_read_ivar), DEVMETHOD(bus_setup_intr, puc_bus_setup_intr), DEVMETHOD(bus_teardown_intr, puc_bus_teardown_intr), - DEVMETHOD(bus_print_child, bus_generic_print_child), + DEVMETHOD(bus_print_child, puc_bus_print_child), + DEVMETHOD(bus_child_pnpinfo_str, puc_bus_child_pnpinfo_str), + DEVMETHOD(bus_child_location_str, puc_bus_child_location_str), DEVMETHOD(bus_driver_added, bus_generic_driver_added), { 0, 0 } }; Modified: head/sys/dev/puc/puc_pci.c ============================================================================== --- head/sys/dev/puc/puc_pci.c Tue Jun 14 17:51:46 2011 (r223090) +++ head/sys/dev/puc/puc_pci.c Tue Jun 14 18:19:48 2011 (r223091) @@ -132,7 +132,9 @@ static device_method_t puc_pci_methods[] DEVMETHOD(bus_read_ivar, puc_bus_read_ivar), DEVMETHOD(bus_setup_intr, puc_bus_setup_intr), DEVMETHOD(bus_teardown_intr, puc_bus_teardown_intr), - DEVMETHOD(bus_print_child, bus_generic_print_child), + DEVMETHOD(bus_print_child, puc_bus_print_child), + DEVMETHOD(bus_child_pnpinfo_str, puc_bus_child_pnpinfo_str), + DEVMETHOD(bus_child_location_str, puc_bus_child_location_str), DEVMETHOD(bus_driver_added, bus_generic_driver_added), { 0, 0 } }; From owner-svn-src-head@FreeBSD.ORG Tue Jun 14 20:30:16 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A7591065676; Tue, 14 Jun 2011 20:30:16 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4B5EE8FC08; Tue, 14 Jun 2011 20:30:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5EKUG2f050439; Tue, 14 Jun 2011 20:30:16 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5EKUGuI050437; Tue, 14 Jun 2011 20:30:16 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201106142030.p5EKUGuI050437@svn.freebsd.org> From: Alexander Motin Date: Tue, 14 Jun 2011 20:30:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223097 - head/sys/dev/ata/chipsets X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jun 2011 20:30:16 -0000 Author: mav Date: Tue Jun 14 20:30:15 2011 New Revision: 223097 URL: http://svn.freebsd.org/changeset/base/223097 Log: Skip BAR(5) usage for SATA registers access on ICH8M Apples, because for some reason it causes system lock up. Linux does the same. MFC after: 1 week Modified: head/sys/dev/ata/chipsets/ata-intel.c Modified: head/sys/dev/ata/chipsets/ata-intel.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-intel.c Tue Jun 14 20:04:23 2011 (r223096) +++ head/sys/dev/ata/chipsets/ata-intel.c Tue Jun 14 20:30:15 2011 (r223097) @@ -288,7 +288,9 @@ ata_intel_chipinit(device_t dev) ATA_OUTL(ctlr->r_res2, 0x0C, ATA_INL(ctlr->r_res2, 0x0C) | 0xf); } - } else { + /* Skip BAR(5) on ICH8M Apples, system locks up on access. */ + } else if (ctlr->chip->chipid != ATA_I82801HBM_S1 || + pci_get_subvendor(dev) != 0x106b) { ctlr->r_type2 = SYS_RES_IOPORT; ctlr->r_rid2 = PCIR_BAR(5); ctlr->r_res2 = bus_alloc_resource_any(dev, ctlr->r_type2, From owner-svn-src-head@FreeBSD.ORG Tue Jun 14 20:30:49 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA8721065678; Tue, 14 Jun 2011 20:30:49 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9B1698FC1B; Tue, 14 Jun 2011 20:30:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5EKUnQ3050490; Tue, 14 Jun 2011 20:30:49 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5EKUn6Y050487; Tue, 14 Jun 2011 20:30:49 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201106142030.p5EKUn6Y050487@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 14 Jun 2011 20:30:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223098 - in head/sys: amd64/conf i386/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jun 2011 20:30:49 -0000 Author: hselasky Date: Tue Jun 14 20:30:49 2011 New Revision: 223098 URL: http://svn.freebsd.org/changeset/base/223098 Log: Enable USB 3.0 support by default in i386 and amd64 GENERIC kernels. Discussed with: joel @ and thompsa @ MFC after: 7 days Modified: head/sys/amd64/conf/GENERIC head/sys/i386/conf/GENERIC Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Tue Jun 14 20:30:15 2011 (r223097) +++ head/sys/amd64/conf/GENERIC Tue Jun 14 20:30:49 2011 (r223098) @@ -295,6 +295,7 @@ options USB_DEBUG # enable debug msgs device uhci # UHCI PCI->USB interface device ohci # OHCI PCI->USB interface device ehci # EHCI PCI->USB interface (USB 2.0) +device xhci # XHCI PCI->USB interface (USB 3.0) device usb # USB Bus (required) #device udbp # USB Double Bulk Pipe devices (needs netgraph) device uhid # "Human Interface Devices" Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Tue Jun 14 20:30:15 2011 (r223097) +++ head/sys/i386/conf/GENERIC Tue Jun 14 20:30:49 2011 (r223098) @@ -308,6 +308,7 @@ options USB_DEBUG # enable debug msgs device uhci # UHCI PCI->USB interface device ohci # OHCI PCI->USB interface device ehci # EHCI PCI->USB interface (USB 2.0) +device xhci # XHCI PCI->USB interface (USB 3.0) device usb # USB Bus (required) #device udbp # USB Double Bulk Pipe devices (needs netgraph) device uhid # "Human Interface Devices" From owner-svn-src-head@FreeBSD.ORG Tue Jun 14 21:37:25 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9987D106564A; Tue, 14 Jun 2011 21:37:25 +0000 (UTC) (envelope-from gibbs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8A4208FC12; Tue, 14 Jun 2011 21:37:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5ELbPCZ052562; Tue, 14 Jun 2011 21:37:25 GMT (envelope-from gibbs@svn.freebsd.org) Received: (from gibbs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5ELbPpN052560; Tue, 14 Jun 2011 21:37:25 GMT (envelope-from gibbs@svn.freebsd.org) Message-Id: <201106142137.p5ELbPpN052560@svn.freebsd.org> From: "Justin T. Gibbs" Date: Tue, 14 Jun 2011 21:37:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223099 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jun 2011 21:37:25 -0000 Author: gibbs Date: Tue Jun 14 21:37:25 2011 New Revision: 223099 URL: http://svn.freebsd.org/changeset/base/223099 Log: sys/kern/subr_kdb.c: Modify the "alternate break sequence" detecting state machine so that only a contiguous invocation of the break sequence is accepted. The old implementation did not reset the state machine when detecting an unexpected character. While here, use an enum for the states of the machine instead of magic numbers.bmitted by: Sponsored by: Spectra Logic Corporation Modified: head/sys/kern/subr_kdb.c Modified: head/sys/kern/subr_kdb.c ============================================================================== --- head/sys/kern/subr_kdb.c Tue Jun 14 20:30:49 2011 (r223098) +++ head/sys/kern/subr_kdb.c Tue Jun 14 21:37:25 2011 (r223099) @@ -244,29 +244,44 @@ kdb_reboot(void) #define KEY_CRTLP 16 /* ^P */ #define KEY_CRTLR 18 /* ^R */ +/* States of th KDB "alternate break sequence" detecting state machine. */ +enum { + KDB_ALT_BREAK_SEEN_NONE, + KDB_ALT_BREAK_SEEN_CR, + KDB_ALT_BREAK_SEEN_CR_TILDE, +}; + int kdb_alt_break(int key, int *state) { int brk; + /* All states transition to KDB_ALT_BREAK_SEEN_CR on a CR. */ + if (key == KEY_CR) { + *state = KDB_ALT_BREAK_SEEN_CR; + return (0); + } + brk = 0; switch (*state) { - case 0: - if (key == KEY_CR) - *state = 1; - break; - case 1: + case KDB_ALT_BREAK_SEEN_CR: + *state = KDB_ALT_BREAK_SEEN_NONE; if (key == KEY_TILDE) - *state = 2; + *state = KDB_ALT_BREAK_SEEN_CR_TILDE; break; - case 2: + case KDB_ALT_BREAK_SEEN_CR_TILDE: + *state = KDB_ALT_BREAK_SEEN_NONE; if (key == KEY_CRTLB) brk = KDB_REQ_DEBUGGER; else if (key == KEY_CRTLP) brk = KDB_REQ_PANIC; else if (key == KEY_CRTLR) brk = KDB_REQ_REBOOT; - *state = 0; + break; + case KDB_ALT_BREAK_SEEN_NONE: + default: + *state = KDB_ALT_BREAK_SEEN_NONE; + break; } return (brk); } From owner-svn-src-head@FreeBSD.ORG Wed Jun 15 06:13:08 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B25D1106566B; Wed, 15 Jun 2011 06:13:08 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A322A8FC15; Wed, 15 Jun 2011 06:13:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5F6D8F9068240; Wed, 15 Jun 2011 06:13:08 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5F6D8mb068238; Wed, 15 Jun 2011 06:13:08 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201106150613.p5F6D8mb068238@svn.freebsd.org> From: Kirk McKusick Date: Wed, 15 Jun 2011 06:13:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223105 - head/sys/ufs/ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2011 06:13:08 -0000 Author: mckusick Date: Wed Jun 15 06:13:08 2011 New Revision: 223105 URL: http://svn.freebsd.org/changeset/base/223105 Log: Missing cleanup case after completion of a snapshot vnode write claiming a released block. Submitted by: Jeff Roberson Tested by: Peter Holm Modified: head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Wed Jun 15 01:08:47 2011 (r223104) +++ head/sys/ufs/ffs/ffs_softdep.c Wed Jun 15 06:13:08 2011 (r223105) @@ -10417,6 +10417,10 @@ softdep_disk_write_complete(bp) WORKLIST_INSERT(&reattach, wk); continue; + case D_FREEDEP: + free_freedep(WK_FREEDEP(wk)); + continue; + default: panic("handle_disk_write_complete: Unknown type %s", TYPENAME(wk->wk_type)); From owner-svn-src-head@FreeBSD.ORG Wed Jun 15 09:42:38 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 82846106564A; Wed, 15 Jun 2011 09:42:38 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id C8F0C8FC0A; Wed, 15 Jun 2011 09:42:36 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 232F745C8C; Wed, 15 Jun 2011 11:42:21 +0200 (CEST) Received: from localhost (58.wheelsystems.com [83.12.187.58]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id F147B45684; Wed, 15 Jun 2011 11:42:05 +0200 (CEST) Date: Wed, 15 Jun 2011 11:42:02 +0200 From: Pawel Jakub Dawidek To: "Justin T. Gibbs" Message-ID: <20110615094202.GB1975@garage.freebsd.pl> References: <201106141710.p5EHAXYS044119@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="+pHx0qQiF2pBVqBT" Content-Disposition: inline In-Reply-To: <201106141710.p5EHAXYS044119@svn.freebsd.org> X-OS: FreeBSD 9.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-3.9 required=4.5 tests=ALL_TRUSTED,BAYES_00, RCVD_IN_SORBS_DUL autolearn=ham version=3.0.4 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223089 - in head: sys/cam/ata sys/cam/scsi sys/geom sys/sys usr.sbin/diskinfo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2011 09:42:38 -0000 --+pHx0qQiF2pBVqBT Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jun 14, 2011 at 05:10:33PM +0000, Justin T. Gibbs wrote: > Author: gibbs > Date: Tue Jun 14 17:10:32 2011 > New Revision: 223089 > URL: http://svn.freebsd.org/changeset/base/223089 >=20 > Log: [...] > sys/sys/geom/geom.h: > sys/geom/geom_event.c: > - Provide the g_attr_changed() function that providers > can use to advertise attribute changes. > - Perform delivery of attribute change notifications > from a thread context via the standard GEOM event > mechanism. Would be nice to discuss it before the commit (or did I miss the dicussion?). I was working on something that could be easly merged with your changes. I had a patch to implement provider's properties change notification to consumers and devd: http://people.freebsd.org/~pjd/patches/geom_property_change.patch Currently it implements only mediasize changes, so the upper layers can act accordingly. The patch also implements ZFS bits to detect vdev size changes and eventually autoexpand the pool. Could you look at the patch and see how we could add property changes to your API? --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://yomoli.com --+pHx0qQiF2pBVqBT Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAk34fmoACgkQForvXbEpPzQPxgCfQmhD3bNYwd09tgrcFu6JqHYo SN0AoIc8fICCR1uArljvsqVWP9/S7uFS =PFrh -----END PGP SIGNATURE----- --+pHx0qQiF2pBVqBT-- From owner-svn-src-head@FreeBSD.ORG Wed Jun 15 14:07:16 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C2B8106572A; Wed, 15 Jun 2011 14:07:16 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7CB098FC17; Wed, 15 Jun 2011 14:07:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5FE7GHv084941; Wed, 15 Jun 2011 14:07:16 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5FE7G8r084939; Wed, 15 Jun 2011 14:07:16 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201106151407.p5FE7G8r084939@svn.freebsd.org> From: Nathan Whitehorn Date: Wed, 15 Jun 2011 14:07:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223109 - head/sys/boot/forth X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2011 14:07:16 -0000 Author: nwhitehorn Date: Wed Jun 15 14:07:16 2011 New Revision: 223109 URL: http://svn.freebsd.org/changeset/base/223109 Log: Revert changes to this file in r222417. This unconditionally enabled the boot menu on all platforms, which breaks loader completely on at least powerpc for reasons that are not understood yet. Reviewed by: Devin Teske Modified: head/sys/boot/forth/loader.rc Modified: head/sys/boot/forth/loader.rc ============================================================================== --- head/sys/boot/forth/loader.rc Wed Jun 15 13:10:37 2011 (r223108) +++ head/sys/boot/forth/loader.rc Wed Jun 15 14:07:16 2011 (r223109) @@ -10,8 +10,5 @@ start \ Tests for password -- executes autoboot first if a password was defined check-password -\ Load in the boot menu -include /boot/beastie.4th +\ Unless set otherwise, autoboot is automatic at this point -\ Start the boot menu -beastie-start From owner-svn-src-head@FreeBSD.ORG Wed Jun 15 18:05:08 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 97176106564A; Wed, 15 Jun 2011 18:05:08 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7CB1A8FC14; Wed, 15 Jun 2011 18:05:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5FI58ql092270; Wed, 15 Jun 2011 18:05:08 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5FI58Hs092266; Wed, 15 Jun 2011 18:05:08 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201106151805.p5FI58Hs092266@svn.freebsd.org> From: Kirk McKusick Date: Wed, 15 Jun 2011 18:05:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223114 - head/sys/ufs/ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2011 18:05:08 -0000 Author: mckusick Date: Wed Jun 15 18:05:08 2011 New Revision: 223114 URL: http://svn.freebsd.org/changeset/base/223114 Log: With the restructuring of the block reclaimation code, the notification messages for a filesystem being out of space need to be moved so that they do not print out until after a failed cleanup attempt. Suggested by: Jeff Roberson Modified: head/sys/ufs/ffs/ffs_alloc.c head/sys/ufs/ffs/ffs_balloc.c head/sys/ufs/ffs/ffs_extern.h Modified: head/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_alloc.c Wed Jun 15 15:24:21 2011 (r223113) +++ head/sys/ufs/ffs/ffs_alloc.c Wed Jun 15 18:05:08 2011 (r223114) @@ -116,7 +116,6 @@ static ufs2_daddr_t ffs_clusteralloc(str static ino_t ffs_dirpref(struct inode *); static ufs2_daddr_t ffs_fragextend(struct inode *, u_int, ufs2_daddr_t, int, int); -static void ffs_fserr(struct fs *, ino_t, char *); static ufs2_daddr_t ffs_hashalloc (struct inode *, u_int, ufs2_daddr_t, int, int, allocfcn_t *); static ufs2_daddr_t ffs_nodealloccg(struct inode *, u_int, ufs2_daddr_t, int, @@ -223,7 +222,7 @@ nospace: goto retry; } UFS_UNLOCK(ump); - if (ppsratecheck(&lastfail, &curfail, 1)) { + if (reclaimed > 0 && ppsratecheck(&lastfail, &curfail, 1)) { ffs_fserr(fs, ip->i_number, "filesystem full"); uprintf("\n%s: write failed, filesystem is full\n", fs->fs_fsmnt); @@ -432,7 +431,7 @@ nospace: UFS_UNLOCK(ump); if (bp) brelse(bp); - if (ppsratecheck(&lastfail, &curfail, 1)) { + if (reclaimed > 0 && ppsratecheck(&lastfail, &curfail, 1)) { ffs_fserr(fs, ip->i_number, "filesystem full"); uprintf("\n%s: write failed, filesystem is full\n", fs->fs_fsmnt); @@ -2335,7 +2334,7 @@ ffs_mapsearch(fs, cgp, bpref, allocsiz) * The form of the error message is: * fs: error message */ -static void +void ffs_fserr(fs, inum, cp) struct fs *fs; ino_t inum; Modified: head/sys/ufs/ffs/ffs_balloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_balloc.c Wed Jun 15 15:24:21 2011 (r223113) +++ head/sys/ufs/ffs/ffs_balloc.c Wed Jun 15 18:05:08 2011 (r223114) @@ -105,6 +105,8 @@ ffs_balloc_ufs1(struct vnode *vp, off_t ufs2_daddr_t *lbns_remfree, lbns[NIADDR + 1]; int unwindidx = -1; int saved_inbdflush; + static struct timeval lastfail; + static int curfail; int reclaimed; ip = VTOI(vp); @@ -308,6 +310,11 @@ retry: UFS_UNLOCK(ump); goto retry; } + if (ppsratecheck(&lastfail, &curfail, 1)) { + ffs_fserr(fs, ip->i_number, "filesystem full"); + uprintf("\n%s: write failed, filesystem " + "is full\n", fs->fs_fsmnt); + } goto fail; } nb = newb; @@ -370,6 +377,11 @@ retry: UFS_UNLOCK(ump); goto retry; } + if (ppsratecheck(&lastfail, &curfail, 1)) { + ffs_fserr(fs, ip->i_number, "filesystem full"); + uprintf("\n%s: write failed, filesystem " + "is full\n", fs->fs_fsmnt); + } goto fail; } nb = newb; @@ -523,6 +535,8 @@ ffs_balloc_ufs2(struct vnode *vp, off_t int deallocated, osize, nsize, num, i, error; int unwindidx = -1; int saved_inbdflush; + static struct timeval lastfail; + static int curfail; int reclaimed; ip = VTOI(vp); @@ -836,6 +850,11 @@ retry: UFS_UNLOCK(ump); goto retry; } + if (ppsratecheck(&lastfail, &curfail, 1)) { + ffs_fserr(fs, ip->i_number, "filesystem full"); + uprintf("\n%s: write failed, filesystem " + "is full\n", fs->fs_fsmnt); + } goto fail; } nb = newb; @@ -898,6 +917,11 @@ retry: UFS_UNLOCK(ump); goto retry; } + if (ppsratecheck(&lastfail, &curfail, 1)) { + ffs_fserr(fs, ip->i_number, "filesystem full"); + uprintf("\n%s: write failed, filesystem " + "is full\n", fs->fs_fsmnt); + } goto fail; } nb = newb; Modified: head/sys/ufs/ffs/ffs_extern.h ============================================================================== --- head/sys/ufs/ffs/ffs_extern.h Wed Jun 15 15:24:21 2011 (r223113) +++ head/sys/ufs/ffs/ffs_extern.h Wed Jun 15 18:05:08 2011 (r223114) @@ -69,6 +69,7 @@ int ffs_flushfiles(struct mount *, int, void ffs_fragacct(struct fs *, int, int32_t [], int); int ffs_freefile(struct ufsmount *, struct fs *, struct vnode *, ino_t, int, struct workhead *); +void ffs_fserr(struct fs *, ino_t, char *); int ffs_isblock(struct fs *, u_char *, ufs1_daddr_t); int ffs_isfreeblock(struct fs *, u_char *, ufs1_daddr_t); void ffs_load_inode(struct buf *, struct inode *, struct fs *, ino_t); From owner-svn-src-head@FreeBSD.ORG Wed Jun 15 19:09:58 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 601AA106566C; Wed, 15 Jun 2011 19:09:58 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4FFC08FC08; Wed, 15 Jun 2011 19:09:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5FJ9w5D094516; Wed, 15 Jun 2011 19:09:58 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5FJ9wR8094514; Wed, 15 Jun 2011 19:09:58 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201106151909.p5FJ9wR8094514@svn.freebsd.org> From: Xin LI Date: Wed, 15 Jun 2011 19:09:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223115 - head/usr.sbin/pw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2011 19:09:58 -0000 Author: delphij Date: Wed Jun 15 19:09:58 2011 New Revision: 223115 URL: http://svn.freebsd.org/changeset/base/223115 Log: Don't attempt to create the base directory when -d is specified. MFC after: 1 month Modified: head/usr.sbin/pw/pw_user.c Modified: head/usr.sbin/pw/pw_user.c ============================================================================== --- head/usr.sbin/pw/pw_user.c Wed Jun 15 18:05:08 2011 (r223114) +++ head/usr.sbin/pw/pw_user.c Wed Jun 15 19:09:58 2011 (r223115) @@ -163,7 +163,7 @@ pw_user(struct userconf * cnf, int mode, * If we'll need to use it or we're updating it, * then create the base home directory if necessary */ - if (arg != NULL || getarg(args, 'm') != NULL) { + if ((arg != NULL || getarg(args, 'm') != NULL) && (getarg(args, 'd') == NULL)) { int l = strlen(cnf->home); if (l > 1 && cnf->home[l-1] == '/') /* Shave off any trailing path delimiter */ From owner-svn-src-head@FreeBSD.ORG Wed Jun 15 19:15:51 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 47E1B106567C; Wed, 15 Jun 2011 19:15:51 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 37ADB8FC0C; Wed, 15 Jun 2011 19:15:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5FJFpIQ094751; Wed, 15 Jun 2011 19:15:51 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5FJFpUe094749; Wed, 15 Jun 2011 19:15:51 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <201106151915.p5FJFpUe094749@svn.freebsd.org> From: Olivier Houchard Date: Wed, 15 Jun 2011 19:15:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223116 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2011 19:15:51 -0000 Author: cognet Date: Wed Jun 15 19:15:50 2011 New Revision: 223116 URL: http://svn.freebsd.org/changeset/base/223116 Log: Add -ffreestanding to the command line, so taht inflate.c compiles and link properly with llvm. PR: arm/156771 Submitted by: Damjan Marion Modified: head/sys/conf/Makefile.arm Modified: head/sys/conf/Makefile.arm ============================================================================== --- head/sys/conf/Makefile.arm Wed Jun 15 19:09:58 2011 (r223115) +++ head/sys/conf/Makefile.arm Wed Jun 15 19:15:50 2011 (r223116) @@ -108,7 +108,8 @@ ${KERNEL_KO}.tramp: ${KERNEL_KO} $S/$M/$ gzip -9 ${KERNEL_KO}.tmp eval $$(stat -s ${KERNEL_KO}.tmp.gz) && \ echo "#define KERNCOMPSIZE $$st_size" >>opt_kernname.h - ${CC} -O2 -DKZIP -I. -I$S -c $S/kern/inflate.c -o inflate-tramp.o + ${CC} -O2 -ffreestanding -DKZIP -I. -I$S -c $S/kern/inflate.c -o \ + inflate-tramp.o ${CC} -O -nostdlib -I. -I$S -Xlinker -T -Xlinker ldscript.$M.tramp \ -DKZIP tmphack.S $S/$M/$M/elf_trampoline.c inflate-tramp.o \ $S/$M/$M/inckern.S ${FILES_CPU_FUNC} -o ${KERNEL_KO}.gz.tramp From owner-svn-src-head@FreeBSD.ORG Wed Jun 15 19:33:03 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D28F106564A; Wed, 15 Jun 2011 19:33:03 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3C79D8FC17; Wed, 15 Jun 2011 19:33:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5FJX3Yo095309; Wed, 15 Jun 2011 19:33:03 GMT (envelope-from jpaetzel@svn.freebsd.org) Received: (from jpaetzel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5FJX3bw095307; Wed, 15 Jun 2011 19:33:03 GMT (envelope-from jpaetzel@svn.freebsd.org) Message-Id: <201106151933.p5FJX3bw095307@svn.freebsd.org> From: Josh Paetzel Date: Wed, 15 Jun 2011 19:33:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223117 - head/etc/periodic/daily X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2011 19:33:03 -0000 Author: jpaetzel Date: Wed Jun 15 19:33:02 2011 New Revision: 223117 URL: http://svn.freebsd.org/changeset/base/223117 Log: Eliminate extraneous pipelines and tr calls. Approved by: kib (mentor) MFC after: 3 days Modified: head/etc/periodic/daily/800.scrub-zfs Modified: head/etc/periodic/daily/800.scrub-zfs ============================================================================== --- head/etc/periodic/daily/800.scrub-zfs Wed Jun 15 19:15:50 2011 (r223116) +++ head/etc/periodic/daily/800.scrub-zfs Wed Jun 15 19:33:02 2011 (r223117) @@ -46,7 +46,7 @@ case "$daily_scrub_zfs_enable" in esac # determine how many days shall be between scrubs - eval _pool_threshold=\${daily_scrub_zfs_$(echo "${pool}"|tr -s "-" "_"|tr -s "." "_"|tr -s ":" "_")_threshold} + eval _pool_threshold=\${daily_scrub_zfs_$(echo "${pool}"|tr ".:-" "_")_threshold} if [ -z "${_pool_threshold}" ];then _pool_threshold=${daily_scrub_zfs_default_threshold} fi From owner-svn-src-head@FreeBSD.ORG Wed Jun 15 19:53:08 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A9ABB106574C; Wed, 15 Jun 2011 19:53:08 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 993EF8FC21; Wed, 15 Jun 2011 19:53:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5FJr8Ht095963; Wed, 15 Jun 2011 19:53:08 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5FJr8Ne095961; Wed, 15 Jun 2011 19:53:08 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201106151953.p5FJr8Ne095961@svn.freebsd.org> From: Joel Dahl Date: Wed, 15 Jun 2011 19:53:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223118 - head/sys/dev/sound/pci/hda X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2011 19:53:08 -0000 Author: joel (doc committer) Date: Wed Jun 15 19:53:08 2011 New Revision: 223118 URL: http://svn.freebsd.org/changeset/base/223118 Log: Hide driver revision behind bootverbose. Approved by: mav Modified: head/sys/dev/sound/pci/hda/hdac.c Modified: head/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.c Wed Jun 15 19:33:02 2011 (r223117) +++ head/sys/dev/sound/pci/hda/hdac.c Wed Jun 15 19:53:08 2011 (r223118) @@ -4146,7 +4146,10 @@ hdac_attach(device_t dev) uint16_t vendor; uint8_t v; - device_printf(dev, "HDA Driver Revision: %s\n", HDA_DRV_TEST_REV); + HDA_BOOTVERBOSE( + device_printf(dev, "HDA Driver Revision: %s\n", + HDA_DRV_TEST_REV); + ); model = (uint32_t)pci_get_device(dev) << 16; model |= (uint32_t)pci_get_vendor(dev) & 0x0000ffff; From owner-svn-src-head@FreeBSD.ORG Wed Jun 15 21:48:10 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A4A22106566B; Wed, 15 Jun 2011 21:48:10 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8A6CE8FC17; Wed, 15 Jun 2011 21:48:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5FLmAn4099443; Wed, 15 Jun 2011 21:48:10 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5FLmAxr099439; Wed, 15 Jun 2011 21:48:10 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201106152148.p5FLmAxr099439@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 15 Jun 2011 21:48:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223120 - in head: bin/sh tools/regression/bin/sh/builtins X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2011 21:48:10 -0000 Author: jilles Date: Wed Jun 15 21:48:10 2011 New Revision: 223120 URL: http://svn.freebsd.org/changeset/base/223120 Log: sh: Add support for named character classes in bracket expressions. Example: case x in [[:alpha:]]) echo yes ;; esac Added: head/tools/regression/bin/sh/builtins/case8.0 (contents, props changed) Modified: head/bin/sh/expand.c head/bin/sh/sh.1 Modified: head/bin/sh/expand.c ============================================================================== --- head/bin/sh/expand.c Wed Jun 15 20:34:40 2011 (r223119) +++ head/bin/sh/expand.c Wed Jun 15 21:48:10 2011 (r223120) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include /* * Routines to expand arguments to commands. We have to deal with @@ -1401,13 +1402,43 @@ get_wc(const char **p) /* + * See if a character matches a character class, starting at the first colon + * of "[:class:]". + * If a valid character class is recognized, a pointer to the next character + * after the final closing bracket is stored into *end, otherwise a null + * pointer is stored into *end. + */ +static int +match_charclass(const char *p, wchar_t chr, const char **end) +{ + char name[20]; + const char *nameend; + wctype_t cclass; + + *end = NULL; + p++; + nameend = strstr(p, ":]"); + if (nameend == NULL || nameend - p >= sizeof(name) || nameend == p) + return 0; + memcpy(name, p, nameend - p); + name[nameend - p] = '\0'; + *end = nameend + 2; + cclass = wctype(name); + /* An unknown class matches nothing but is valid nevertheless. */ + if (cclass == 0) + return 0; + return iswctype(chr, cclass); +} + + +/* * Returns true if the pattern matches the string. */ int patmatch(const char *pattern, const char *string, int squoted) { - const char *p, *q; + const char *p, *q, *end; char c; wchar_t wc, wc2; @@ -1495,6 +1526,11 @@ patmatch(const char *pattern, const char do { if (c == CTLQUOTEMARK) continue; + if (c == '[' && *p == ':') { + found |= match_charclass(p, chr, &end); + if (end != NULL) + p = end; + } if (c == CTLESC) c = *p++; if (localeisutf8 && c & 0x80) { Modified: head/bin/sh/sh.1 ============================================================================== --- head/bin/sh/sh.1 Wed Jun 15 20:34:40 2011 (r223119) +++ head/bin/sh/sh.1 Wed Jun 15 21:48:10 2011 (r223120) @@ -32,7 +32,7 @@ .\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95 .\" $FreeBSD$ .\" -.Dd June 12, 2011 +.Dd June 15, 2011 .Dt SH 1 .Os .Sh NAME @@ -1648,6 +1648,15 @@ matches a rather than introducing a character class. A character class matches any of the characters between the square brackets. A range of characters may be specified using a minus sign. +A named class of characters (see +.Xr wctype 3 ) +may be specified by surrounding the name with +.Ql \&[: +and +.Ql :\&] . +For example, +.Ql \&[\&[:alpha:\&]\&] +is a shell pattern that matches a single letter. The character class may be complemented by making an exclamation point .Pq Ql !\& the first character of the character class. @@ -2572,6 +2581,7 @@ will return the argument. .Xr execve 2 , .Xr getrlimit 2 , .Xr umask 2 , +.Xr wctype 3 , .Xr editrc 5 .Sh HISTORY A Added: head/tools/regression/bin/sh/builtins/case8.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/case8.0 Wed Jun 15 21:48:10 2011 (r223120) @@ -0,0 +1,32 @@ +# $FreeBSD$ + +case aZ_ in +[[:alpha:]_][[:upper:]_][[:alpha:]_]) ;; +*) echo Failed at $LINENO ;; +esac + +case ' ' in +[[:alpha:][:digit:]]) echo Failed at $LINENO ;; +[![:alpha:][:digit:]]) ;; +*) echo Failed at $LINENO ;; +esac + +case '.X.' in +*[[:lower:]]*) echo Failed at $LINENO ;; +*[[:upper:]]*) ;; +*) echo Failed at $LINENO ;; +esac + +case ' ' in +[![:print:]]) echo Failed at $LINENO ;; +[![:alnum:][:punct:]]) ;; +*) echo Failed at $LINENO ;; +esac + +case ' +' in +[[:print:]]) echo Failed at $LINENO ;; +[' +'[:digit:]]) ;; +*) echo Failed at $LINENO ;; +esac From owner-svn-src-head@FreeBSD.ORG Wed Jun 15 21:58:01 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 81747106566B; Wed, 15 Jun 2011 21:58:01 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 712588FC08; Wed, 15 Jun 2011 21:58:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5FLw1cV099769; Wed, 15 Jun 2011 21:58:01 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5FLw1oU099767; Wed, 15 Jun 2011 21:58:01 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201106152158.p5FLw1oU099767@svn.freebsd.org> From: Craig Rodrigues Date: Wed, 15 Jun 2011 21:58:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223121 - head/lib/libstand X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2011 21:58:01 -0000 Author: rodrigc Date: Wed Jun 15 21:58:01 2011 New Revision: 223121 URL: http://svn.freebsd.org/changeset/base/223121 Log: In sendrecv function, change the receive timeout value between retries to increase in steps of MINTMO, instead of doubling the timeout for every retry. Obtained from: Juniper Networks Fixed by: Santhanakrishnan Balraj Modified: head/lib/libstand/net.c Modified: head/lib/libstand/net.c ============================================================================== --- head/lib/libstand/net.c Wed Jun 15 21:48:10 2011 (r223120) +++ head/lib/libstand/net.c Wed Jun 15 21:58:01 2011 (r223121) @@ -100,7 +100,7 @@ sendrecv(struct iodesc *d, cc, ssize); tleft = tmo; - tmo <<= 1; + tmo += MINTMO; if (tmo > MAXTMO) tmo = MAXTMO; From owner-svn-src-head@FreeBSD.ORG Wed Jun 15 22:04:15 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 402741065672; Wed, 15 Jun 2011 22:04:15 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 265DB8FC15; Wed, 15 Jun 2011 22:04:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5FM4F69000158; Wed, 15 Jun 2011 22:04:15 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5FM4F4F000156; Wed, 15 Jun 2011 22:04:15 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201106152204.p5FM4F4F000156@svn.freebsd.org> From: Craig Rodrigues Date: Wed, 15 Jun 2011 22:04:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223122 - head/lib/libstand X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2011 22:04:15 -0000 Author: rodrigc Date: Wed Jun 15 22:04:14 2011 New Revision: 223122 URL: http://svn.freebsd.org/changeset/base/223122 Log: Added sendrecv_tftp function instead of sendrecv for use by tftp. In sendrecv_tftp: * Upon receving an unexpected block of data or error, resend the ACK immediately instead of waiting till the expiry of receive data timeout to resend the ACK. * change the receive timeout value between retries to be 2xMINTMO. Obtained from: Juniper Networks Fixed by: Santhanakrishnan Balraj Modified: head/lib/libstand/tftp.c Modified: head/lib/libstand/tftp.c ============================================================================== --- head/lib/libstand/tftp.c Wed Jun 15 21:58:01 2011 (r223121) +++ head/lib/libstand/tftp.c Wed Jun 15 22:04:14 2011 (r223122) @@ -66,6 +66,7 @@ static int tftp_read(struct open_file *f static int tftp_write(struct open_file *f, void *buf, size_t size, size_t *resid); static off_t tftp_seek(struct open_file *f, off_t offset, int where); static int tftp_stat(struct open_file *f, struct stat *sb); +static ssize_t sendrecv_tftp(d, sproc, sbuf, ssize, rproc, rbuf, rsize); struct fs_ops tftp_fsops = { "tftp", @@ -191,7 +192,7 @@ tftp_makereq(struct tftp_handle *h) h->iodesc->destport = htons(IPPORT_TFTP); h->iodesc->xid = 1; /* expected block */ - res = sendrecv(h->iodesc, sendudp, &wbuf.t, wtail - (char *) &wbuf.t, + res = sendrecv_tftp(h->iodesc, sendudp, &wbuf.t, wtail - (char *) &wbuf.t, recvtftp, t, sizeof(*t) + RSPACE); if (res == -1) @@ -226,7 +227,7 @@ tftp_getnextblock(struct tftp_handle *h) h->iodesc->xid = h->currblock + 1; /* expected block */ - res = sendrecv(h->iodesc, sendudp, &wbuf.t, wtail - (char *) &wbuf.t, + res = sendrecv_tftp(h->iodesc, sendudp, &wbuf.t, wtail - (char *) &wbuf.t, recvtftp, t, sizeof(*t) + RSPACE); if (res == -1) /* 0 is OK! */ @@ -404,3 +405,55 @@ tftp_seek(struct open_file *f, off_t off } return (tftpfile->off); } + +static ssize_t +sendrecv_tftp(d, sproc, sbuf, ssize, rproc, rbuf, rsize) + struct iodesc *d; + ssize_t (*sproc)(struct iodesc *, void *, size_t); + void *sbuf; + size_t ssize; + ssize_t (*rproc)(struct iodesc *, void *, size_t, time_t); + void *rbuf; + size_t rsize; +{ + ssize_t cc; + time_t t, t1, tleft; + +#ifdef TFTP_DEBUG + if (debug) + printf("sendrecv: called\n"); +#endif + + tleft = MINTMO; + t = t1 = getsecs(); + for (;;) { + if ((getsecs() - t) > MAXTMO) { + errno = ETIMEDOUT; + return -1; + } + + cc = (*sproc)(d, sbuf, ssize); + if (cc != -1 && cc < ssize) + panic("sendrecv: short write! (%zd < %zu)", + cc, ssize); + + if (cc == -1) { + /* Error on transmit; wait before retrying */ + while ((getsecs() - t1) < tleft); + continue; + } + + /* Try to get a packet and process it. */ + cc = (*rproc)(d, rbuf, rsize, tleft); + /* Return on data, EOF or real error. */ + if (cc != -1 || errno != 0) + return (cc); + + /* Timed out or didn't get the packet we're waiting for */ + tleft += MINTMO; + if (tleft > (2 * MINTMO)) { + tleft = (2 * MINTMO); + } + t1 = getsecs(); + } +} From owner-svn-src-head@FreeBSD.ORG Wed Jun 15 22:08:19 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 08706106566B; Wed, 15 Jun 2011 22:08:19 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EC7DF8FC27; Wed, 15 Jun 2011 22:08:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5FM8Imq000304; Wed, 15 Jun 2011 22:08:18 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5FM8IcR000302; Wed, 15 Jun 2011 22:08:18 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201106152208.p5FM8IcR000302@svn.freebsd.org> From: Craig Rodrigues Date: Wed, 15 Jun 2011 22:08:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223123 - head/lib/libstand X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2011 22:08:19 -0000 Author: rodrigc Date: Wed Jun 15 22:08:18 2011 New Revision: 223123 URL: http://svn.freebsd.org/changeset/base/223123 Log: Currently tftp code in the loader retransmits the previous packet if it receives any unwanted packet(non-tftp). Change this to retransmit the packet(request or ack) only after a timeout. Obtained from: Juniper Networks Fixed by: Santhanakrishnan Balraj Modified: head/lib/libstand/tftp.c Modified: head/lib/libstand/tftp.c ============================================================================== --- head/lib/libstand/tftp.c Wed Jun 15 22:04:14 2011 (r223122) +++ head/lib/libstand/tftp.c Wed Jun 15 22:08:18 2011 (r223123) @@ -443,11 +443,15 @@ sendrecv_tftp(d, sproc, sbuf, ssize, rpr continue; } +recvnext: /* Try to get a packet and process it. */ cc = (*rproc)(d, rbuf, rsize, tleft); /* Return on data, EOF or real error. */ if (cc != -1 || errno != 0) return (cc); + if ((getsecs() - t1) < tleft) { + goto recvnext; + } /* Timed out or didn't get the packet we're waiting for */ tleft += MINTMO; From owner-svn-src-head@FreeBSD.ORG Wed Jun 15 22:13:22 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 72C84106564A; Wed, 15 Jun 2011 22:13:22 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 616F28FC15; Wed, 15 Jun 2011 22:13:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5FMDMc9000493; Wed, 15 Jun 2011 22:13:22 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5FMDMWP000491; Wed, 15 Jun 2011 22:13:22 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201106152213.p5FMDMWP000491@svn.freebsd.org> From: Craig Rodrigues Date: Wed, 15 Jun 2011 22:13:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223124 - head/lib/libstand X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2011 22:13:22 -0000 Author: rodrigc Date: Wed Jun 15 22:13:22 2011 New Revision: 223124 URL: http://svn.freebsd.org/changeset/base/223124 Log: (1) When sending the TFTP RRQ packet to read a file, send along the "blksize" option specified in RFC2348, and the "tsize" option specified in RFC2349. Add code to parse the TFTP Option Acknowledgement (OACK) packet as specified in RFC2347. For TFTP servers which support the "blksize" option, we can specify a TFTP Data block size larger than the default 512 bytes specified in RFC1350. This offers greater read performance when downloading files. We request an initial size of 1428 bytes, which is less than the Ethernet MTU of 1500 bytes. If the TFTP server sends back an OACK packet, then use the block size specified in the OACK packet. Most times it is usually the same value as what we request. If the TFTP server supports RFC2348, we will see performance improvements by transferring files over TFTP with larger block sizes. If we do not get back an OACK packet, then we most likely we are interoperating with a legacy TFTP server that does not support TFTP extension options, so default to the block size of 512 bytes. (2) If the "tftp.blksize" environment variable is set, then take that value and use it when sending the TFTP RRQ packet, instead of 1428. This allows us to set different values of "tftp.blksize" in the loader, so that we can test out different TFTP block sizes at run time. Obtained from: Juniper Networks Fixed by: rodrigc Modified: head/lib/libstand/tftp.c Modified: head/lib/libstand/tftp.c ============================================================================== --- head/lib/libstand/tftp.c Wed Jun 15 22:08:18 2011 (r223123) +++ head/lib/libstand/tftp.c Wed Jun 15 22:13:22 2011 (r223124) @@ -60,13 +60,21 @@ __FBSDID("$FreeBSD$"); #include "tftp.h" +struct tftp_handle; + static int tftp_open(const char *path, struct open_file *f); static int tftp_close(struct open_file *f); +static void tftp_parse_oack(struct tftp_handle *h, char *buf, size_t len); static int tftp_read(struct open_file *f, void *buf, size_t size, size_t *resid); static int tftp_write(struct open_file *f, void *buf, size_t size, size_t *resid); static off_t tftp_seek(struct open_file *f, off_t offset, int where); +static int tftp_set_blksize(struct tftp_handle *h, const char *str); static int tftp_stat(struct open_file *f, struct stat *sb); -static ssize_t sendrecv_tftp(d, sproc, sbuf, ssize, rproc, rbuf, rsize); +static ssize_t sendrecv_tftp(struct tftp_handle *h, + ssize_t (*sproc)(struct iodesc *, void *, size_t), + void *sbuf, size_t ssize, + ssize_t (*rproc)(struct tftp_handle *h, void *, ssize_t, time_t, unsigned short *), + void *rbuf, size_t rsize, unsigned short *rtype); struct fs_ops tftp_fsops = { "tftp", @@ -82,8 +90,20 @@ struct fs_ops tftp_fsops = { extern struct in_addr servip; static int tftpport = 2000; +static int is_open = 0; -#define RSPACE 520 /* max data packet, rounded up */ +/* + * The legacy TFTP_BLKSIZE value was 512. + * TFTP_REQUESTED_BLKSIZE of 1428 is (Ethernet MTU, less the TFTP, UDP and + * IP header lengths). + */ +#define TFTP_REQUESTED_BLKSIZE 1428 + +/* + * Choose a blksize big enough so we can test with Ethernet + * Jumbo frames in the future. + */ +#define TFTP_MAX_BLKSIZE 9008 struct tftp_handle { struct iodesc *iodesc; @@ -92,14 +112,16 @@ struct tftp_handle { int validsize; int off; char *path; /* saved for re-requests */ + unsigned int tftp_blksize; + unsigned long tftp_tsize; struct { u_char header[HEADER_SIZE]; struct tftphdr t; - u_char space[RSPACE]; - } __packed __aligned(4) lastdata; + u_char space[TFTP_MAX_BLKSIZE]; + } lastdata; }; -static const int tftperrors[8] = { +static int tftperrors[8] = { 0, /* ??? */ ENOENT, EPERM, @@ -111,8 +133,10 @@ static const int tftperrors[8] = { }; static ssize_t -recvtftp(struct iodesc *d, void *pkt, ssize_t len, time_t tleft) +recvtftp(struct tftp_handle *h, void *pkt, ssize_t len, time_t tleft, + unsigned short *rtype) { + struct iodesc *d = h->iodesc; struct tftphdr *t; errno = 0; @@ -123,6 +147,7 @@ recvtftp(struct iodesc *d, void *pkt, ss return (-1); t = (struct tftphdr *) pkt; + *rtype = ntohs(t->th_opcode); switch (ntohs(t->th_opcode)) { case DATA: { int got; @@ -155,6 +180,18 @@ recvtftp(struct iodesc *d, void *pkt, ss errno = tftperrors[ntohs(t->th_code)]; } return (-1); + case OACK: { + struct udphdr *uh; + int tftp_oack_len = len - sizeof(t->th_opcode); + tftp_parse_oack(h, t->th_u.tu_stuff, tftp_oack_len); + /* + * Remember which port this OACK came from, + * because we need to send the ACK back to it. + */ + uh = (struct udphdr *) pkt - 1; + d->destport = uh->uh_sport; + return (0); + } default: #ifdef TFTP_DEBUG printf("tftp type %d not handled\n", ntohs(t->th_opcode)); @@ -171,19 +208,40 @@ tftp_makereq(struct tftp_handle *h) u_char header[HEADER_SIZE]; struct tftphdr t; u_char space[FNAME_SIZE + 6]; - } __packed __aligned(4) wbuf; + } wbuf; char *wtail; int l; ssize_t res; struct tftphdr *t; + char *tftp_blksize = NULL; + int blksize_l; + unsigned short rtype = 0; + + /* + * Allow overriding default TFTP block size by setting + * a tftp.blksize environment variable. + */ + if ((tftp_blksize = getenv("tftp.blksize")) != NULL) { + tftp_set_blksize(h, tftp_blksize); + } wbuf.t.th_opcode = htons((u_short) RRQ); wtail = wbuf.t.th_stuff; l = strlen(h->path); + if (l > FNAME_SIZE) + return (ENAMETOOLONG); bcopy(h->path, wtail, l + 1); wtail += l + 1; bcopy("octet", wtail, 6); wtail += 6; + bcopy("blksize", wtail, 8); + wtail += 8; + blksize_l = sprintf(wtail, "%d", h->tftp_blksize); + wtail += blksize_l + 1; + bcopy("tsize", wtail, 6); + wtail += 6; + bcopy("0", wtail, 2); + wtail += 2; t = &h->lastdata.t; @@ -192,18 +250,33 @@ tftp_makereq(struct tftp_handle *h) h->iodesc->destport = htons(IPPORT_TFTP); h->iodesc->xid = 1; /* expected block */ - res = sendrecv_tftp(h->iodesc, sendudp, &wbuf.t, wtail - (char *) &wbuf.t, - recvtftp, t, sizeof(*t) + RSPACE); + res = sendrecv_tftp(h, &sendudp, &wbuf.t, wtail - (char *) &wbuf.t, + &recvtftp, t, sizeof(*t) + h->tftp_blksize, &rtype); - if (res == -1) - return (errno); + if (rtype == OACK) { + wbuf.t.th_opcode = htons((u_short)ACK); + wtail = (char *) &wbuf.t.th_block; + wbuf.t.th_block = htons(0); + wtail += 2; + rtype = 0; + res = sendrecv_tftp(h, &sendudp, &wbuf.t, wtail - (char *) &wbuf.t, + &recvtftp, t, sizeof(*t) + h->tftp_blksize, &rtype); + } + + switch (rtype) { + case DATA: { + h->currblock = 1; + h->validsize = res; + h->islastblock = 0; + if (res < h->tftp_blksize) + h->islastblock = 1; /* very short file */ + return (0); + } + case ERROR: + default: + return (errno); + } - h->currblock = 1; - h->validsize = res; - h->islastblock = 0; - if (res < SEGSIZE) - h->islastblock = 1; /* very short file */ - return (0); } /* ack block, expect next */ @@ -213,11 +286,11 @@ tftp_getnextblock(struct tftp_handle *h) struct { u_char header[HEADER_SIZE]; struct tftphdr t; - } __packed __aligned(4) wbuf; + } wbuf; char *wtail; int res; struct tftphdr *t; - + unsigned short rtype = 0; wbuf.t.th_opcode = htons((u_short) ACK); wtail = (char *) &wbuf.t.th_block; wbuf.t.th_block = htons((u_short) h->currblock); @@ -227,16 +300,23 @@ tftp_getnextblock(struct tftp_handle *h) h->iodesc->xid = h->currblock + 1; /* expected block */ - res = sendrecv_tftp(h->iodesc, sendudp, &wbuf.t, wtail - (char *) &wbuf.t, - recvtftp, t, sizeof(*t) + RSPACE); + res = sendrecv_tftp(h, &sendudp, &wbuf.t, wtail - (char *) &wbuf.t, + &recvtftp, t, sizeof(*t) + h->tftp_blksize, &rtype); if (res == -1) /* 0 is OK! */ return (errno); h->currblock++; h->validsize = res; - if (res < SEGSIZE) + if (res < h->tftp_blksize) h->islastblock = 1; /* EOF */ + + if (h->islastblock == 1) { + /* Send an ACK for the last block */ + wbuf.t.th_block = htons((u_short) h->currblock); + sendudp(h->iodesc, &wbuf.t, wtail - (char *)&wbuf.t); + } + return (0); } @@ -252,10 +332,15 @@ tftp_open(const char *path, struct open_ return (EINVAL); #endif + if (is_open) + return (EBUSY); + tftpfile = (struct tftp_handle *) malloc(sizeof(*tftpfile)); if (!tftpfile) return (ENOMEM); + memset(tftpfile, 0, sizeof(*tftpfile)); + tftpfile->tftp_blksize = TFTP_REQUESTED_BLKSIZE; tftpfile->iodesc = io = socktodesc(*(int *) (f->f_devdata)); if (io == NULL) return (EINVAL); @@ -276,6 +361,7 @@ tftp_open(const char *path, struct open_ return (res); } f->f_fsdata = (void *) tftpfile; + is_open = 1; return (0); } @@ -293,7 +379,7 @@ tftp_read(struct open_file *f, void *add if (!(tc++ % 16)) twiddle(); - needblock = tftpfile->off / SEGSIZE + 1; + needblock = tftpfile->off / tftpfile->tftp_blksize + 1; if (tftpfile->currblock > needblock) /* seek backwards */ tftp_makereq(tftpfile); /* no error check, it worked @@ -316,7 +402,7 @@ tftp_read(struct open_file *f, void *add if (tftpfile->currblock == needblock) { int offinblock, inbuffer; - offinblock = tftpfile->off % SEGSIZE; + offinblock = tftpfile->off % tftpfile->tftp_blksize; inbuffer = tftpfile->validsize - offinblock; if (inbuffer < 0) { @@ -362,18 +448,19 @@ tftp_close(struct open_file *f) free(tftpfile->path); free(tftpfile); } + is_open = 0; return (0); } static int tftp_write(struct open_file *f __unused, void *start __unused, size_t size __unused, - size_t *resid /* out */ __unused) + size_t *resid __unused /* out */) { return (EROFS); } static int -tftp_stat(struct open_file *f, struct stat *sb) +tftp_stat(struct open_file *f, struct stat *sb) { struct tftp_handle *tftpfile; tftpfile = (struct tftp_handle *) f->f_fsdata; @@ -407,15 +494,13 @@ tftp_seek(struct open_file *f, off_t off } static ssize_t -sendrecv_tftp(d, sproc, sbuf, ssize, rproc, rbuf, rsize) - struct iodesc *d; - ssize_t (*sproc)(struct iodesc *, void *, size_t); - void *sbuf; - size_t ssize; - ssize_t (*rproc)(struct iodesc *, void *, size_t, time_t); - void *rbuf; - size_t rsize; +sendrecv_tftp(struct tftp_handle *h, + ssize_t (*sproc)(struct iodesc *, void *, size_t), + void *sbuf, size_t ssize, + ssize_t (*rproc)(struct tftp_handle *, void *, ssize_t, time_t, unsigned short *), + void *rbuf, size_t rsize, unsigned short *rtype) { + struct iodesc *d = h->iodesc; ssize_t cc; time_t t, t1, tleft; @@ -445,7 +530,7 @@ sendrecv_tftp(d, sproc, sbuf, ssize, rpr recvnext: /* Try to get a packet and process it. */ - cc = (*rproc)(d, rbuf, rsize, tleft); + cc = (*rproc)(h, rbuf, rsize, tleft, rtype); /* Return on data, EOF or real error. */ if (cc != -1 || errno != 0) return (cc); @@ -461,3 +546,112 @@ recvnext: t1 = getsecs(); } } + +static int +tftp_set_blksize(struct tftp_handle *h, const char *str) +{ + char *endptr; + int new_blksize; + int ret = 0; + + if (h == NULL || str == NULL) + return (ret); + + new_blksize = + (unsigned int)strtol(str, &endptr, 0); + + /* + * Only accept blksize value if it is numeric. + * RFC2348 specifies that acceptable valuesare 8-65464 + * 8-65464 . Let's choose a limit less than MAXRSPACE + */ + if (*endptr == '\0' && new_blksize >= 8 + && new_blksize <= TFTP_MAX_BLKSIZE) { + h->tftp_blksize = new_blksize; + ret = 1; + } + + return (ret); +} + +/* + * In RFC2347, the TFTP Option Acknowledgement package (OACK) + * is used to acknowledge a client's option negotiation request. + * The format of an OACK packet is: + * +-------+---~~---+---+---~~---+---+---~~---+---+---~~---+---+ + * | opc | opt1 | 0 | value1 | 0 | optN | 0 | valueN | 0 | + * +-------+---~~---+---+---~~---+---+---~~---+---+---~~---+---+ + * + * opc + * The opcode field contains a 6, for Option Acknowledgment. + * + * opt1 + * The first option acknowledgment, copied from the original + * request. + * + * value1 + * The acknowledged value associated with the first option. If + * and how this value may differ from the original request is + * detailed in the specification for the option. + * + * optN, valueN + * The final option/value acknowledgment pair. + */ +static void +tftp_parse_oack(struct tftp_handle *h, char *buf, size_t len) +{ + /* + * We parse the OACK strings into an array + * of name-value pairs. + * + */ + char *tftp_options[128] = { 0 }; + char *val = buf; + int i = 0; + int option_idx = 0; + int blksize_is_set = 0; + int tsize = 0; + + + while ( option_idx < 128 && i < len ) { + if (buf[i] == '\0') { + if (&buf[i] > val) { + tftp_options[option_idx] = val; + val = &buf[i] + 1; + ++option_idx; + } + } + ++i; + } + + /* + * Parse individual TFTP options. + * * "blksize" is specified in RFC2348. + * * "tsize" is specified in RFC2349. + */ + for (i = 0; i < option_idx; i += 2) { + if (strcasecmp(tftp_options[i], "blksize") == 0) { + if (i + 1 < option_idx) { + blksize_is_set = + tftp_set_blksize(h, tftp_options[i + 1]); + } + } else if (strcasecmp(tftp_options[i], "tsize") == 0) { + if (i + 1 < option_idx) { + tsize = strtol(tftp_options[i + 1], (char **)NULL, 10); + } + } + } + + if (!blksize_is_set) { + /* + * If TFTP blksize was not set, try defaulting + * to the legacy TFTP blksize of 512 + */ + h->tftp_blksize = 512; + } + +#ifdef TFTP_DEBUG + printf("tftp_blksize: %u\n", h->tftp_blksize); + printf("tftp_tsize: %lu\n", h->tftp_tsize); +#endif +} From owner-svn-src-head@FreeBSD.ORG Wed Jun 15 22:15:28 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ECA2E1065679; Wed, 15 Jun 2011 22:15:28 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C3A258FC14; Wed, 15 Jun 2011 22:15:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5FMFS8o000590; Wed, 15 Jun 2011 22:15:28 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5FMFSLI000588; Wed, 15 Jun 2011 22:15:28 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201106152215.p5FMFSLI000588@svn.freebsd.org> From: Craig Rodrigues Date: Wed, 15 Jun 2011 22:15:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223125 - head/lib/libstand X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2011 22:15:29 -0000 Author: rodrigc Date: Wed Jun 15 22:15:28 2011 New Revision: 223125 URL: http://svn.freebsd.org/changeset/base/223125 Log: Increase WARNS level to 2. Modified: head/lib/libstand/Makefile Modified: head/lib/libstand/Makefile ============================================================================== --- head/lib/libstand/Makefile Wed Jun 15 22:13:22 2011 (r223124) +++ head/lib/libstand/Makefile Wed Jun 15 22:15:28 2011 (r223125) @@ -15,7 +15,7 @@ NO_PIC= INCS= stand.h MAN= libstand.3 -WARNS?= 0 +WARNS?= 2 CFLAGS+= -ffreestanding -Wformat CFLAGS+= -I${.CURDIR} From owner-svn-src-head@FreeBSD.ORG Wed Jun 15 22:41:55 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F693106564A; Wed, 15 Jun 2011 22:41:55 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 65CBB8FC13; Wed, 15 Jun 2011 22:41:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5FMft0l001390; Wed, 15 Jun 2011 22:41:55 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5FMft8D001388; Wed, 15 Jun 2011 22:41:55 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201106152241.p5FMft8D001388@svn.freebsd.org> From: Marius Strobl Date: Wed, 15 Jun 2011 22:41:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223126 - head/sys/sparc64/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2011 22:41:55 -0000 Author: marius Date: Wed Jun 15 22:41:55 2011 New Revision: 223126 URL: http://svn.freebsd.org/changeset/base/223126 Log: Don't include curcpu in the mask which is used as the IPI cookie as we have to ignore it when sending the IPI anyway. Actually I can't think of a good reason why this ever was done that way in the first place as it's not even usefull for debugging. While at it replace the use of pc_other_cpus as it's slated for deorbit. Modified: head/sys/sparc64/include/smp.h Modified: head/sys/sparc64/include/smp.h ============================================================================== --- head/sys/sparc64/include/smp.h Wed Jun 15 22:15:28 2011 (r223125) +++ head/sys/sparc64/include/smp.h Wed Jun 15 22:41:55 2011 (r223126) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2001 Jake Burkholder. + * Copyright (c) 2007 - 2011 Marius Strobl * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -136,8 +137,11 @@ extern char tl_ipi_tlb_range_demap[]; static __inline void ipi_all_but_self(u_int ipi) { + cpuset_t cpus; - cpu_ipi_selected(PCPU_GET(other_cpus), 0, (u_long)tl_ipi_level, ipi); + cpus = all_cpus; + CPU_CLR(PCPU_GET(cpuid), &cpus); + cpu_ipi_selected(cpus, 0, (u_long)tl_ipi_level, ipi); } static __inline void @@ -167,8 +171,9 @@ ipi_dcache_page_inval(void *func, vm_pad ica = &ipi_cache_args; mtx_lock_spin(&ipi_mtx); ica->ica_mask = all_cpus; + CPU_CLR(PCPU_GET(cpuid), &ica->ica_mask); ica->ica_pa = pa; - cpu_ipi_selected(PCPU_GET(other_cpus), 0, (u_long)func, (u_long)ica); + cpu_ipi_selected(ica->ica_mask, 0, (u_long)func, (u_long)ica); return (&ica->ica_mask); } @@ -183,8 +188,9 @@ ipi_icache_page_inval(void *func, vm_pad ica = &ipi_cache_args; mtx_lock_spin(&ipi_mtx); ica->ica_mask = all_cpus; + CPU_CLR(PCPU_GET(cpuid), &ica->ica_mask); ica->ica_pa = pa; - cpu_ipi_selected(PCPU_GET(other_cpus), 0, (u_long)func, (u_long)ica); + cpu_ipi_selected(ica->ica_mask, 0, (u_long)func, (u_long)ica); return (&ica->ica_mask); } @@ -198,8 +204,7 @@ ipi_rd(u_int cpu, void *func, u_long *va sched_pin(); ira = &ipi_rd_args; mtx_lock_spin(&ipi_mtx); - ira->ira_mask = PCPU_GET(cpumask); - CPU_SET(cpu, &ira->ira_mask); + CPU_SETOF(cpu, &ira->ira_mask); ira->ira_val = val; cpu_ipi_single(cpu, 0, (u_long)func, (u_long)ira); return (&ira->ira_mask); @@ -215,7 +220,8 @@ ipi_tlb_context_demap(struct pmap *pm) return (NULL); sched_pin(); cpus = pm->pm_active; - CPU_AND(&cpus, PCPU_PTR(other_cpus)); + CPU_AND(&cpus, &all_cpus); + CPU_CLR(PCPU_GET(cpuid), &cpus); if (CPU_EMPTY(&cpus)) { sched_unpin(); return (NULL); @@ -223,7 +229,6 @@ ipi_tlb_context_demap(struct pmap *pm) ita = &ipi_tlb_args; mtx_lock_spin(&ipi_mtx); ita->ita_mask = cpus; - CPU_OR(&ita->ita_mask, PCPU_PTR(cpumask)); ita->ita_pmap = pm; cpu_ipi_selected(cpus, 0, (u_long)tl_ipi_tlb_context_demap, (u_long)ita); @@ -240,7 +245,8 @@ ipi_tlb_page_demap(struct pmap *pm, vm_o return (NULL); sched_pin(); cpus = pm->pm_active; - CPU_AND(&cpus, PCPU_PTR(other_cpus)); + CPU_AND(&cpus, &all_cpus); + CPU_CLR(PCPU_GET(cpuid), &cpus); if (CPU_EMPTY(&cpus)) { sched_unpin(); return (NULL); @@ -248,7 +254,6 @@ ipi_tlb_page_demap(struct pmap *pm, vm_o ita = &ipi_tlb_args; mtx_lock_spin(&ipi_mtx); ita->ita_mask = cpus; - CPU_OR(&ita->ita_mask, PCPU_PTR(cpumask)); ita->ita_pmap = pm; ita->ita_va = va; cpu_ipi_selected(cpus, 0, (u_long)tl_ipi_tlb_page_demap, (u_long)ita); @@ -265,7 +270,8 @@ ipi_tlb_range_demap(struct pmap *pm, vm_ return (NULL); sched_pin(); cpus = pm->pm_active; - CPU_AND(&cpus, PCPU_PTR(other_cpus)); + CPU_AND(&cpus, &all_cpus); + CPU_CLR(PCPU_GET(cpuid), &cpus); if (CPU_EMPTY(&cpus)) { sched_unpin(); return (NULL); @@ -273,7 +279,6 @@ ipi_tlb_range_demap(struct pmap *pm, vm_ ita = &ipi_tlb_args; mtx_lock_spin(&ipi_mtx); ita->ita_mask = cpus; - CPU_OR(&ita->ita_mask, PCPU_PTR(cpumask)); ita->ita_pmap = pm; ita->ita_start = start; ita->ita_end = end; @@ -288,7 +293,6 @@ ipi_wait(void *cookie) volatile cpuset_t *mask; if ((mask = cookie) != NULL) { - CPU_NAND_ATOMIC(mask, PCPU_PTR(cpumask)); while (!CPU_EMPTY(mask)) ; mtx_unlock_spin(&ipi_mtx); From owner-svn-src-head@FreeBSD.ORG Wed Jun 15 23:19:10 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0ACA31065670; Wed, 15 Jun 2011 23:19:10 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ED4878FC16; Wed, 15 Jun 2011 23:19:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5FNJ9oi002533; Wed, 15 Jun 2011 23:19:09 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5FNJ9Yf002525; Wed, 15 Jun 2011 23:19:09 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201106152319.p5FNJ9Yf002525@svn.freebsd.org> From: Kirk McKusick Date: Wed, 15 Jun 2011 23:19:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223127 - head/sys/ufs/ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2011 23:19:10 -0000 Author: mckusick Date: Wed Jun 15 23:19:09 2011 New Revision: 223127 URL: http://svn.freebsd.org/changeset/base/223127 Log: Ensure that filesystem metadata contained within persistent snapshots is always kept consistent. Suggested by: Jeff Roberson Modified: head/sys/ufs/ffs/ffs_alloc.c head/sys/ufs/ffs/ffs_balloc.c head/sys/ufs/ffs/ffs_extern.h head/sys/ufs/ffs/ffs_inode.c head/sys/ufs/ffs/ffs_snapshot.c head/sys/ufs/ffs/ffs_softdep.c head/sys/ufs/ffs/softdep.h Modified: head/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_alloc.c Wed Jun 15 22:41:55 2011 (r223126) +++ head/sys/ufs/ffs/ffs_alloc.c Wed Jun 15 23:19:09 2011 (r223127) @@ -390,7 +390,7 @@ retry: bp->b_blkno = fsbtodb(fs, bno); if (!DOINGSOFTDEP(vp)) ffs_blkfree(ump, fs, ip->i_devvp, bprev, (long)osize, - ip->i_number, NULL); + ip->i_number, vp->v_type, NULL); delta = btodb(nsize - osize); DIP_SET(ip, i_blocks, DIP(ip, i_blocks) + delta); if (flags & IO_EXT) @@ -670,7 +670,7 @@ ffs_reallocblks_ufs1(ap) if (!DOINGSOFTDEP(vp)) ffs_blkfree(ump, fs, ip->i_devvp, dbtofsb(fs, buflist->bs_children[i]->b_blkno), - fs->fs_bsize, ip->i_number, NULL); + fs->fs_bsize, ip->i_number, vp->v_type, NULL); buflist->bs_children[i]->b_blkno = fsbtodb(fs, blkno); #ifdef INVARIANTS if (!ffs_checkblk(ip, @@ -878,7 +878,7 @@ ffs_reallocblks_ufs2(ap) if (!DOINGSOFTDEP(vp)) ffs_blkfree(ump, fs, ip->i_devvp, dbtofsb(fs, buflist->bs_children[i]->b_blkno), - fs->fs_bsize, ip->i_number, NULL); + fs->fs_bsize, ip->i_number, vp->v_type, NULL); buflist->bs_children[i]->b_blkno = fsbtodb(fs, blkno); #ifdef INVARIANTS if (!ffs_checkblk(ip, @@ -1880,7 +1880,7 @@ ffs_blkfree_cg(ump, fs, devvp, bno, size printf("dev=%s, bno = %jd, bsize = %ld, size = %ld, fs = %s\n", devtoname(dev), (intmax_t)bno, (long)fs->fs_bsize, size, fs->fs_fsmnt); - panic("ffs_blkfree: bad size"); + panic("ffs_blkfree_cg: bad size"); } #endif if ((u_int)bno >= fs->fs_size) { @@ -1914,7 +1914,7 @@ ffs_blkfree_cg(ump, fs, devvp, bno, size } printf("dev = %s, block = %jd, fs = %s\n", devtoname(dev), (intmax_t)bno, fs->fs_fsmnt); - panic("ffs_blkfree: freeing free block"); + panic("ffs_blkfree_cg: freeing free block"); } ffs_setblock(fs, blksfree, fragno); ffs_clusteracct(fs, cgp, fragno, 1); @@ -1937,7 +1937,7 @@ ffs_blkfree_cg(ump, fs, devvp, bno, size printf("dev = %s, block = %jd, fs = %s\n", devtoname(dev), (intmax_t)(bno + i), fs->fs_fsmnt); - panic("ffs_blkfree: freeing free frag"); + panic("ffs_blkfree_cg: freeing free frag"); } setbit(blksfree, cgbno + i); } @@ -2013,13 +2013,14 @@ ffs_blkfree_trim_completed(bip) } void -ffs_blkfree(ump, fs, devvp, bno, size, inum, dephd) +ffs_blkfree(ump, fs, devvp, bno, size, inum, vtype, dephd) struct ufsmount *ump; struct fs *fs; struct vnode *devvp; ufs2_daddr_t bno; long size; ino_t inum; + enum vtype vtype; struct workhead *dephd; { struct mount *mp; @@ -2034,7 +2035,7 @@ ffs_blkfree(ump, fs, devvp, bno, size, i */ if (devvp->v_type != VREG && (devvp->v_vflag & VV_COPYONWRITE) && - ffs_snapblkfree(fs, devvp, bno, size, inum, dephd)) { + ffs_snapblkfree(fs, devvp, bno, size, inum, vtype, dephd)) { return; } if (!ump->um_candelete) { @@ -2571,7 +2572,7 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) if (blksize > blkcnt) blksize = blkcnt; ffs_blkfree(ump, fs, ump->um_devvp, blkno, - blksize * fs->fs_fsize, ROOTINO, NULL); + blksize * fs->fs_fsize, ROOTINO, VDIR, NULL); blkno += blksize; blkcnt -= blksize; blksize = fs->fs_frag; Modified: head/sys/ufs/ffs/ffs_balloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_balloc.c Wed Jun 15 22:41:55 2011 (r223126) +++ head/sys/ufs/ffs/ffs_balloc.c Wed Jun 15 23:19:09 2011 (r223127) @@ -506,7 +506,7 @@ fail: */ for (blkp = allociblk; blkp < allocblk; blkp++) { ffs_blkfree(ump, fs, ip->i_devvp, *blkp, fs->fs_bsize, - ip->i_number, NULL); + ip->i_number, vp->v_type, NULL); } return (error); } @@ -1052,7 +1052,7 @@ fail: */ for (blkp = allociblk; blkp < allocblk; blkp++) { ffs_blkfree(ump, fs, ip->i_devvp, *blkp, fs->fs_bsize, - ip->i_number, NULL); + ip->i_number, vp->v_type, NULL); } return (error); } Modified: head/sys/ufs/ffs/ffs_extern.h ============================================================================== --- head/sys/ufs/ffs/ffs_extern.h Wed Jun 15 22:41:55 2011 (r223126) +++ head/sys/ufs/ffs/ffs_extern.h Wed Jun 15 23:19:09 2011 (r223127) @@ -57,7 +57,7 @@ int ffs_balloc_ufs2(struct vnode *a_vp, struct ucred *a_cred, int a_flags, struct buf **a_bpp); int ffs_blkatoff(struct vnode *, off_t, char **, struct buf **); void ffs_blkfree(struct ufsmount *, struct fs *, struct vnode *, - ufs2_daddr_t, long, ino_t, struct workhead *); + ufs2_daddr_t, long, ino_t, enum vtype, struct workhead *); ufs2_daddr_t ffs_blkpref_ufs1(struct inode *, ufs_lbn_t, int, ufs1_daddr_t *); ufs2_daddr_t ffs_blkpref_ufs2(struct inode *, ufs_lbn_t, int, ufs2_daddr_t *); int ffs_checkfreefile(struct fs *, struct vnode *, ino_t); @@ -82,7 +82,7 @@ int ffs_realloccg(struct inode *, ufs2_d int ffs_sbupdate(struct ufsmount *, int, int); void ffs_setblock(struct fs *, u_char *, ufs1_daddr_t); int ffs_snapblkfree(struct fs *, struct vnode *, ufs2_daddr_t, long, ino_t, - struct workhead *); + enum vtype, struct workhead *); void ffs_snapremove(struct vnode *vp); int ffs_snapshot(struct mount *mp, char *snapfile); void ffs_snapshot_mount(struct mount *mp); Modified: head/sys/ufs/ffs/ffs_inode.c ============================================================================== --- head/sys/ufs/ffs/ffs_inode.c Wed Jun 15 22:41:55 2011 (r223126) +++ head/sys/ufs/ffs/ffs_inode.c Wed Jun 15 23:19:09 2011 (r223127) @@ -235,7 +235,8 @@ ffs_truncate(vp, length, flags, cred, td if (oldblks[i] == 0) continue; ffs_blkfree(ump, fs, ip->i_devvp, oldblks[i], - sblksize(fs, osize, i), ip->i_number, NULL); + sblksize(fs, osize, i), ip->i_number, + vp->v_type, NULL); } } } @@ -435,7 +436,8 @@ ffs_truncate(vp, length, flags, cred, td if (lastiblock[level] < 0) { DIP_SET(ip, i_ib[level], 0); ffs_blkfree(ump, fs, ip->i_devvp, bn, - fs->fs_bsize, ip->i_number, NULL); + fs->fs_bsize, ip->i_number, + vp->v_type, NULL); blocksreleased += nblocks; } } @@ -455,7 +457,7 @@ ffs_truncate(vp, length, flags, cred, td DIP_SET(ip, i_db[i], 0); bsize = blksize(fs, ip, i); ffs_blkfree(ump, fs, ip->i_devvp, bn, bsize, ip->i_number, - NULL); + vp->v_type, NULL); blocksreleased += btodb(bsize); } if (lastblock < 0) @@ -487,7 +489,7 @@ ffs_truncate(vp, length, flags, cred, td */ bn += numfrags(fs, newspace); ffs_blkfree(ump, fs, ip->i_devvp, bn, - oldspace - newspace, ip->i_number, NULL); + oldspace - newspace, ip->i_number, vp->v_type, NULL); blocksreleased += btodb(oldspace - newspace); } } @@ -634,7 +636,7 @@ ffs_indirtrunc(ip, lbn, dbn, lastbn, lev blocksreleased += blkcount; } ffs_blkfree(ip->i_ump, fs, ip->i_devvp, nb, fs->fs_bsize, - ip->i_number, NULL); + ip->i_number, vp->v_type, NULL); blocksreleased += nblocks; } Modified: head/sys/ufs/ffs/ffs_snapshot.c ============================================================================== --- head/sys/ufs/ffs/ffs_snapshot.c Wed Jun 15 22:41:55 2011 (r223126) +++ head/sys/ufs/ffs/ffs_snapshot.c Wed Jun 15 23:19:09 2011 (r223127) @@ -81,12 +81,13 @@ ffs_snapshot(mp, snapfile) } int -ffs_snapblkfree(fs, devvp, bno, size, inum, wkhd) +ffs_snapblkfree(fs, devvp, bno, size, inum, vtype, wkhd) struct fs *fs; struct vnode *devvp; ufs2_daddr_t bno; long size; ino_t inum; + enum vtype vtype; struct workhead *wkhd; { return (EINVAL); @@ -174,8 +175,10 @@ static int ffs_bp_snapblk(struct vnode * * To ensure the consistency of snapshots across crashes, we must * synchronously write out copied blocks before allowing the * originals to be modified. Because of the rather severe speed - * penalty that this imposes, the following flag allows this - * crash persistence to be disabled. + * penalty that this imposes, the code normally only ensures + * persistence for the filesystem metadata contained within a + * snapshot. Setting the following flag allows this crash + * persistence to be enabled for file contents. */ int dopersistence = 0; @@ -582,7 +585,7 @@ loop: if (len != 0 && len < fs->fs_bsize) { ffs_blkfree(ump, copy_fs, vp, DIP(xp, i_db[loc]), len, xp->i_number, - NULL); + xvp->v_type, NULL); blkno = DIP(xp, i_db[loc]); DIP_SET(xp, i_db[loc], 0); } @@ -1245,7 +1248,8 @@ mapacct_ufs1(vp, oldblkp, lastblkp, fs, *ip->i_snapblklist++ = lblkno; if (blkno == BLK_SNAP) blkno = blkstofrags(fs, lblkno); - ffs_blkfree(ip->i_ump, fs, vp, blkno, fs->fs_bsize, inum, NULL); + ffs_blkfree(ip->i_ump, fs, vp, blkno, fs->fs_bsize, inum, + vp->v_type, NULL); } return (0); } @@ -1528,7 +1532,8 @@ mapacct_ufs2(vp, oldblkp, lastblkp, fs, *ip->i_snapblklist++ = lblkno; if (blkno == BLK_SNAP) blkno = blkstofrags(fs, lblkno); - ffs_blkfree(ip->i_ump, fs, vp, blkno, fs->fs_bsize, inum, NULL); + ffs_blkfree(ip->i_ump, fs, vp, blkno, fs->fs_bsize, inum, + vp->v_type, NULL); } return (0); } @@ -1633,7 +1638,7 @@ ffs_snapremove(vp) DIP_SET(ip, i_db[blkno], 0); else if ((dblk == blkstofrags(fs, blkno) && ffs_snapblkfree(fs, ip->i_devvp, dblk, fs->fs_bsize, - ip->i_number, NULL))) { + ip->i_number, vp->v_type, NULL))) { DIP_SET(ip, i_blocks, DIP(ip, i_blocks) - btodb(fs->fs_bsize)); DIP_SET(ip, i_db[blkno], 0); @@ -1658,7 +1663,8 @@ ffs_snapremove(vp) ((ufs1_daddr_t *)(ibp->b_data))[loc]= 0; else if ((dblk == blkstofrags(fs, blkno) && ffs_snapblkfree(fs, ip->i_devvp, dblk, - fs->fs_bsize, ip->i_number, NULL))) { + fs->fs_bsize, ip->i_number, vp->v_type, + NULL))) { ip->i_din1->di_blocks -= btodb(fs->fs_bsize); ((ufs1_daddr_t *)(ibp->b_data))[loc]= 0; @@ -1672,7 +1678,7 @@ ffs_snapremove(vp) ((ufs2_daddr_t *)(ibp->b_data))[loc] = 0; else if ((dblk == blkstofrags(fs, blkno) && ffs_snapblkfree(fs, ip->i_devvp, dblk, - fs->fs_bsize, ip->i_number, NULL))) { + fs->fs_bsize, ip->i_number, vp->v_type, NULL))) { ip->i_din2->di_blocks -= btodb(fs->fs_bsize); ((ufs2_daddr_t *)(ibp->b_data))[loc] = 0; } @@ -1720,12 +1726,13 @@ ffs_snapremove(vp) * must always have been allocated from a BLK_NOCOPY location. */ int -ffs_snapblkfree(fs, devvp, bno, size, inum, wkhd) +ffs_snapblkfree(fs, devvp, bno, size, inum, vtype, wkhd) struct fs *fs; struct vnode *devvp; ufs2_daddr_t bno; long size; ino_t inum; + enum vtype vtype; struct workhead *wkhd; { struct buf *ibp, *cbp, *savedcbp = 0; @@ -1874,12 +1881,16 @@ retry: * simply copy them to the new block. Note that we need * to synchronously write snapshots that have not been * unlinked, and hence will be visible after a crash, - * to ensure their integrity. + * to ensure their integrity. At a minimum we ensure the + * integrity of the filesystem metadata, but use the + * dopersistence sysctl-setable flag to decide on the + * persistence needed for file content data. */ if (savedcbp != 0) { bcopy(savedcbp->b_data, cbp->b_data, fs->fs_bsize); bawrite(cbp); - if (dopersistence && ip->i_effnlink > 0) + if ((vtype == VDIR || dopersistence) && + ip->i_effnlink > 0) (void) ffs_syncvnode(vp, MNT_WAIT); continue; } @@ -1889,7 +1900,8 @@ retry: if ((error = readblock(vp, cbp, lbn)) != 0) { bzero(cbp->b_data, fs->fs_bsize); bawrite(cbp); - if (dopersistence && ip->i_effnlink > 0) + if ((vtype == VDIR || dopersistence) && + ip->i_effnlink > 0) (void) ffs_syncvnode(vp, MNT_WAIT); break; } @@ -1898,12 +1910,15 @@ retry: /* * Note that we need to synchronously write snapshots that * have not been unlinked, and hence will be visible after - * a crash, to ensure their integrity. + * a crash, to ensure their integrity. At a minimum we + * ensure the integrity of the filesystem metadata, but + * use the dopersistence sysctl-setable flag to decide on + * the persistence needed for file content data. */ if (savedcbp) { vp = savedcbp->b_vp; bawrite(savedcbp); - if (dopersistence && VTOI(vp)->i_effnlink > 0) + if ((vtype == VDIR || dopersistence) && ip->i_effnlink > 0) (void) ffs_syncvnode(vp, MNT_WAIT); } /* @@ -2358,12 +2373,16 @@ ffs_copyonwrite(devvp, bp) * simply copy them to the new block. Note that we need * to synchronously write snapshots that have not been * unlinked, and hence will be visible after a crash, - * to ensure their integrity. + * to ensure their integrity. At a minimum we ensure the + * integrity of the filesystem metadata, but use the + * dopersistence sysctl-setable flag to decide on the + * persistence needed for file content data. */ if (savedcbp != 0) { bcopy(savedcbp->b_data, cbp->b_data, fs->fs_bsize); bawrite(cbp); - if (dopersistence && ip->i_effnlink > 0) + if ((devvp == bp->b_vp || bp->b_vp->v_type == VDIR || + dopersistence) && ip->i_effnlink > 0) (void) ffs_syncvnode(vp, MNT_WAIT); else launched_async_io = 1; @@ -2375,7 +2394,8 @@ ffs_copyonwrite(devvp, bp) if ((error = readblock(vp, cbp, lbn)) != 0) { bzero(cbp->b_data, fs->fs_bsize); bawrite(cbp); - if (dopersistence && ip->i_effnlink > 0) + if ((devvp == bp->b_vp || bp->b_vp->v_type == VDIR || + dopersistence) && ip->i_effnlink > 0) (void) ffs_syncvnode(vp, MNT_WAIT); else launched_async_io = 1; @@ -2386,12 +2406,16 @@ ffs_copyonwrite(devvp, bp) /* * Note that we need to synchronously write snapshots that * have not been unlinked, and hence will be visible after - * a crash, to ensure their integrity. + * a crash, to ensure their integrity. At a minimum we + * ensure the integrity of the filesystem metadata, but + * use the dopersistence sysctl-setable flag to decide on + * the persistence needed for file content data. */ if (savedcbp) { vp = savedcbp->b_vp; bawrite(savedcbp); - if (dopersistence && VTOI(vp)->i_effnlink > 0) + if ((devvp == bp->b_vp || bp->b_vp->v_type == VDIR || + dopersistence) && VTOI(vp)->i_effnlink > 0) (void) ffs_syncvnode(vp, MNT_WAIT); else launched_async_io = 1; Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Wed Jun 15 22:41:55 2011 (r223126) +++ head/sys/ufs/ffs/ffs_softdep.c Wed Jun 15 23:19:09 2011 (r223127) @@ -5172,6 +5172,7 @@ newfreefrag(ip, blkno, size, lbn) freefrag->ff_state = ATTACHED; LIST_INIT(&freefrag->ff_jwork); freefrag->ff_inum = ip->i_number; + freefrag->ff_vtype = ITOV(ip)->v_type; freefrag->ff_blkno = blkno; freefrag->ff_fragsize = size; @@ -5216,7 +5217,7 @@ handle_workitem_freefrag(freefrag) } FREE_LOCK(&lk); ffs_blkfree(ump, ump->um_fs, ump->um_devvp, freefrag->ff_blkno, - freefrag->ff_fragsize, freefrag->ff_inum, &wkhd); + freefrag->ff_fragsize, freefrag->ff_inum, freefrag->ff_vtype, &wkhd); ACQUIRE_LOCK(&lk); WORKITEM_FREE(freefrag, D_FREEFRAG); FREE_LOCK(&lk); @@ -5724,6 +5725,7 @@ newfreeblks(mp, ip) freeblks->fb_state = ATTACHED; freeblks->fb_uid = ip->i_uid; freeblks->fb_inum = ip->i_number; + freeblks->fb_vtype = ITOV(ip)->v_type; freeblks->fb_modrev = DIP(ip, i_modrev); freeblks->fb_devvp = ip->i_devvp; freeblks->fb_chkcnt = 0; @@ -7263,7 +7265,7 @@ freework_freeblock(freework) freeblks->fb_freecnt += btodb(bsize); FREE_LOCK(&lk); ffs_blkfree(ump, fs, freeblks->fb_devvp, freework->fw_blkno, bsize, - freeblks->fb_inum, &wkhd); + freeblks->fb_inum, freeblks->fb_vtype, &wkhd); ACQUIRE_LOCK(&lk); /* * The jnewblk will be discarded and the bits in the map never @@ -7669,7 +7671,8 @@ indir_trunc(freework, dbn, lbn) freedeps++; } ffs_blkfree(ump, fs, freeblks->fb_devvp, nb, - fs->fs_bsize, freeblks->fb_inum, &wkhd); + fs->fs_bsize, freeblks->fb_inum, + freeblks->fb_vtype, &wkhd); } } if (goingaway) { @@ -7702,7 +7705,7 @@ indir_trunc(freework, dbn, lbn) fs_pendingblocks += nblocks; dbn = dbtofsb(fs, dbn); ffs_blkfree(ump, fs, freeblks->fb_devvp, dbn, fs->fs_bsize, - freeblks->fb_inum, NULL); + freeblks->fb_inum, freeblks->fb_vtype, NULL); /* Non SUJ softdep does single-threaded truncations. */ freeblks->fb_freecnt += fs_pendingblocks; if (freework->fw_blkno == dbn) { Modified: head/sys/ufs/ffs/softdep.h ============================================================================== --- head/sys/ufs/ffs/softdep.h Wed Jun 15 22:41:55 2011 (r223126) +++ head/sys/ufs/ffs/softdep.h Wed Jun 15 23:19:09 2011 (r223127) @@ -511,6 +511,7 @@ struct freefrag { ufs2_daddr_t ff_blkno; /* fragment physical block number */ long ff_fragsize; /* size of fragment being deleted */ ino_t ff_inum; /* owning inode number */ + enum vtype ff_vtype; /* owning inode's file type */ }; /* @@ -538,6 +539,7 @@ struct freeblks { ufs2_daddr_t fb_chkcnt; /* Expected blks released. */ ufs2_daddr_t fb_freecnt; /* Actual blocks released. */ ino_t fb_inum; /* inode owner of blocks */ + enum vtype fb_vtype; /* inode owner's file type */ uid_t fb_uid; /* uid of previous owner of blocks */ int fb_ref; /* Children outstanding. */ int fb_cgwait; /* cg writes outstanding. */ From owner-svn-src-head@FreeBSD.ORG Wed Jun 15 23:22:36 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A20E106564A; Wed, 15 Jun 2011 23:22:36 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 30D768FC13; Wed, 15 Jun 2011 23:22:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5FNMa9j002690; Wed, 15 Jun 2011 23:22:36 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5FNMafx002688; Wed, 15 Jun 2011 23:22:36 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201106152322.p5FNMafx002688@svn.freebsd.org> From: Craig Rodrigues Date: Wed, 15 Jun 2011 23:22:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223128 - head/lib/libstand X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2011 23:22:36 -0000 Author: rodrigc Date: Wed Jun 15 23:22:35 2011 New Revision: 223128 URL: http://svn.freebsd.org/changeset/base/223128 Log: Bring back following change which was undone in previous commit: ------------------------------------------------------------------------ r172854 | marius | 2007-10-21 10:03:18 -0700 (Sun, 21 Oct 2007) | 16 lines Changed paths: M /head/lib/libstand/tftp.c - Given that we tell the compiler that struct ip is packed and 32-bit aligned, GCC 4.2.1 also generates code for sendudp() that assumes this alignment. GCC 4.2.1 however doesn't 32-bit align wbuf, causing the loader to crash due to an unaligned access of wbuf in sendudp() when netbooting sparc64. Solve this by specifying wbuf as packed and 32-bit aligned, too. As for lastdata and readudp() this currently is no issue when compiled with GCC 4.2.1, though give lastdata the same treatment as wbuf for consistency and possibility of being affected in the future. [1] - Sprinkle const on a lookup table. ------------------------------------------------------------------------ Modified: head/lib/libstand/tftp.c Modified: head/lib/libstand/tftp.c ============================================================================== --- head/lib/libstand/tftp.c Wed Jun 15 23:19:09 2011 (r223127) +++ head/lib/libstand/tftp.c Wed Jun 15 23:22:35 2011 (r223128) @@ -118,10 +118,10 @@ struct tftp_handle { u_char header[HEADER_SIZE]; struct tftphdr t; u_char space[TFTP_MAX_BLKSIZE]; - } lastdata; + } __packed __aligned(4) lastdata; }; -static int tftperrors[8] = { +static const int tftperrors[8] = { 0, /* ??? */ ENOENT, EPERM, @@ -208,7 +208,7 @@ tftp_makereq(struct tftp_handle *h) u_char header[HEADER_SIZE]; struct tftphdr t; u_char space[FNAME_SIZE + 6]; - } wbuf; + } __packed __aligned(4) wbuf; char *wtail; int l; ssize_t res; @@ -286,7 +286,7 @@ tftp_getnextblock(struct tftp_handle *h) struct { u_char header[HEADER_SIZE]; struct tftphdr t; - } wbuf; + } __packed __aligned(4) wbuf; char *wtail; int res; struct tftphdr *t; From owner-svn-src-head@FreeBSD.ORG Wed Jun 15 23:38:15 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE96D106564A; Wed, 15 Jun 2011 23:38:15 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AEDE58FC14; Wed, 15 Jun 2011 23:38:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5FNcFJf003177; Wed, 15 Jun 2011 23:38:15 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5FNcFlN003175; Wed, 15 Jun 2011 23:38:15 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201106152338.p5FNcFlN003175@svn.freebsd.org> From: Nathan Whitehorn Date: Wed, 15 Jun 2011 23:38:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223129 - head/release X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2011 23:38:15 -0000 Author: nwhitehorn Date: Wed Jun 15 23:38:15 2011 New Revision: 223129 URL: http://svn.freebsd.org/changeset/base/223129 Log: Do not install the rescue tools onto the install CD. Since it is read only, they are very unlikely to be needed and take up a great deal of space. Modified: head/release/Makefile Modified: head/release/Makefile ============================================================================== --- head/release/Makefile Wed Jun 15 23:22:35 2011 (r223128) +++ head/release/Makefile Wed Jun 15 23:38:15 2011 (r223129) @@ -110,7 +110,8 @@ reldoc: system: packagesystem # Install system -mkdir ${.OBJDIR}/release - cd ${WORLDDIR} && ${IMAKE} installkernel installworld distribution DESTDIR=${.OBJDIR}/release + cd ${WORLDDIR} && ${IMAKE} installkernel installworld distribution \ + DESTDIR=${.OBJDIR}/release WITHOUT_RESCUE=1 -rm ${.OBJDIR}/release/boot/kernel/*.symbols # Copy distfiles mkdir ${.OBJDIR}/release/usr/freebsd-dist From owner-svn-src-head@FreeBSD.ORG Wed Jun 15 23:50:27 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D68F0106564A; Wed, 15 Jun 2011 23:50:27 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C58C18FC18; Wed, 15 Jun 2011 23:50:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5FNoR1k003659; Wed, 15 Jun 2011 23:50:27 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5FNoR4f003652; Wed, 15 Jun 2011 23:50:27 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201106152350.p5FNoR4f003652@svn.freebsd.org> From: Michael Tuexen Date: Wed, 15 Jun 2011 23:50:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223132 - in head: lib/libc/net sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2011 23:50:27 -0000 Author: tuexen Date: Wed Jun 15 23:50:27 2011 New Revision: 223132 URL: http://svn.freebsd.org/changeset/base/223132 Log: Add support for the newly added SCTP API. In particular add support for: * SCTP_SNDINFO, SCTP_PRINFO, SCTP_AUTHINFO, SCTP_DSTADDRV4, and SCTP_DSTADDRV6 cmsgs. * SCTP_NXTINFO and SCTP_RCVINFO cmgs. * SCTP_EVENT, SCTP_RECVRCVINFO, SCTP_RECVNXTINFO and SCTP_DEFAULT_SNDINFO socket option. * Special association ids (SCTP_FUTURE_ASSOC, ...) * sctp_recvv() and sctp_sendv() functions. MFC after: 1 month. Modified: head/lib/libc/net/sctp_sys_calls.c head/sys/netinet/sctp.h head/sys/netinet/sctp_auth.c head/sys/netinet/sctp_indata.c head/sys/netinet/sctp_output.c head/sys/netinet/sctp_pcb.c head/sys/netinet/sctp_structs.h head/sys/netinet/sctp_uio.h head/sys/netinet/sctp_usrreq.c head/sys/netinet/sctp_var.h head/sys/netinet/sctputil.c Modified: head/lib/libc/net/sctp_sys_calls.c ============================================================================== --- head/lib/libc/net/sctp_sys_calls.c Wed Jun 15 23:45:35 2011 (r223131) +++ head/lib/libc/net/sctp_sys_calls.c Wed Jun 15 23:50:27 2011 (r223132) @@ -141,7 +141,7 @@ in6_sin6_2_sin(struct sockaddr_in *sin, int sctp_getaddrlen(sa_family_t family) { - int error, sd; + int ret, sd; socklen_t siz; struct sctp_assoc_value av; @@ -151,13 +151,15 @@ sctp_getaddrlen(sa_family_t family) sd = socket(AF_INET, SOCK_SEQPACKET, IPPROTO_SCTP); #elif defined(AF_INET6) sd = socket(AF_INET6, SOCK_SEQPACKET, IPPROTO_SCTP); +#else + sd = -1; #endif if (sd == -1) { return (-1); } - error = getsockopt(sd, IPPROTO_SCTP, SCTP_GET_ADDR_LEN, &av, &siz); + ret = getsockopt(sd, IPPROTO_SCTP, SCTP_GET_ADDR_LEN, &av, &siz); close(sd); - if (error == 0) { + if (ret == 0) { return ((int)av.assoc_value); } else { return (-1); @@ -402,6 +404,9 @@ sctp_opt_info(int sd, sctp_assoc_t id, i case SCTP_TIMEOUTS: ((struct sctp_timeouts *)arg)->stimo_assoc_id = id; break; + case SCTP_EVENT: + ((struct sctp_event *)arg)->se_assoc_id = id; + break; default: break; } @@ -919,32 +924,259 @@ sctp_recvmsg(int s, #endif } +ssize_t +sctp_recvv(int sd, + const struct iovec *iov, + int iovlen, + struct sockaddr *from, + socklen_t * fromlen, + void *info, + socklen_t * infolen, + unsigned int *infotype, + int *flags) +{ + char ctlbuf[SCTP_CONTROL_VEC_SIZE_RCV]; + struct msghdr msg; + struct cmsghdr *cmsg; + ssize_t n; + struct sctp_rcvinfo *rcvinfo; + struct sctp_nxtinfo *nxtinfo; -#if defined(HAVE_SCTP_PEELOFF_SOCKOPT) -#include + if (infotype) { + *infotype = SCTP_RECVV_NOINFO; + } + msg.msg_name = from; + if (fromlen == NULL) { + msg.msg_namelen = 0; + } else { + msg.msg_namelen = *fromlen; + } + msg.msg_iov = (struct iovec *)iov; + msg.msg_iovlen = iovlen; + msg.msg_control = ctlbuf; + msg.msg_controllen = sizeof(ctlbuf); + errno = 0; + n = recvmsg(sd, &msg, *flags); + *flags = msg.msg_flags; + if ((n > 0) && + (msg.msg_controllen > 0) && + (infotype != NULL) && + (infolen != NULL) && + (*infolen > 0)) { + rcvinfo = NULL; + nxtinfo = NULL; + for (cmsg = CMSG_FIRSTHDR(&msg); cmsg; cmsg = CMSG_NXTHDR(&msg, cmsg)) { + if (cmsg->cmsg_level != IPPROTO_SCTP) { + continue; + } + if (cmsg->cmsg_type == SCTP_RCVINFO) { + rcvinfo = (struct sctp_rcvinfo *)CMSG_DATA(cmsg); + } + if (cmsg->cmsg_type == SCTP_NXTINFO) { + nxtinfo = (struct sctp_nxtinfo *)CMSG_DATA(cmsg); + } + if (rcvinfo && nxtinfo) { + break; + } + } + if (rcvinfo) { + if (nxtinfo) { + if (*infolen >= sizeof(struct sctp_recvv_rn)) { + struct sctp_recvv_rn *rn_info; + + rn_info = (struct sctp_recvv_rn *)info; + rn_info->recvv_rcvinfo = *rcvinfo; + rn_info->recvv_nxtinfo = *nxtinfo; + *infolen = (socklen_t) sizeof(struct sctp_recvv_rn); + *infotype = SCTP_RECVV_RN; + } + } else { + if (*infolen >= sizeof(struct sctp_rcvinfo)) { + memcpy(info, rcvinfo, sizeof(struct sctp_rcvinfo)); + *infolen = (socklen_t) sizeof(struct sctp_rcvinfo); + *infotype = SCTP_RECVV_RCVINFO; + } + } + } else if (nxtinfo) { + if (*infolen >= sizeof(struct sctp_rcvinfo)) { + memcpy(info, nxtinfo, sizeof(struct sctp_nxtinfo)); + *infolen = (socklen_t) sizeof(struct sctp_nxtinfo); + *infotype = SCTP_RECVV_NXTINFO; + } + } + } + return (n); +} -int -sctp_peeloff(int sd, sctp_assoc_t assoc_id) +ssize_t +sctp_sendv(int sd, + const struct iovec *iov, int iovcnt, + struct sockaddr *addrs, int addrcnt, + void *info, socklen_t infolen, unsigned int infotype, + int flags) { - struct sctp_peeloff_opt peeloff; - int result; - socklen_t optlen; - - /* set in the socket option params */ - memset(&peeloff, 0, sizeof(peeloff)); - peeloff.s = sd; - peeloff.assoc_id = assoc_id; - optlen = sizeof(peeloff); - result = getsockopt(sd, IPPROTO_SCTP, SCTP_PEELOFF, (void *)&peeloff, &optlen); + ssize_t ret; + int i; + size_t addr_len; + struct sctp_sendv_spa *spa_info; + struct msghdr msg; + struct cmsghdr *cmsg; + char *cmsgbuf; + struct sockaddr *addr; + struct sockaddr_in *addr_in; + struct sockaddr_in6 *addr_in6; - if (result < 0) { + if ((addrcnt < 0) || (iovcnt < 0)) { + errno = EINVAL; + return (-1); + } + cmsgbuf = malloc(CMSG_SPACE(sizeof(struct sctp_sndinfo)) + + CMSG_SPACE(sizeof(struct sctp_prinfo)) + + CMSG_SPACE(sizeof(struct sctp_authinfo)) + + addrcnt * CMSG_SPACE(sizeof(struct in6_addr))); + if (cmsgbuf == NULL) { + errno = ENOBUFS; return (-1); + } + msg.msg_control = cmsgbuf; + msg.msg_controllen = 0; + cmsg = (struct cmsghdr *)cmsgbuf; + switch (infotype) { + case SCTP_SENDV_SNDINFO: + if (infolen < sizeof(struct sctp_sndinfo)) { + free(cmsgbuf); + errno = EINVAL; + return (-1); + } + cmsg->cmsg_level = IPPROTO_SCTP; + cmsg->cmsg_type = SCTP_SNDINFO; + cmsg->cmsg_len = CMSG_LEN(sizeof(struct sctp_sndinfo)); + memcpy(CMSG_DATA(cmsg), info, sizeof(struct sctp_sndinfo)); + msg.msg_controllen += CMSG_SPACE(sizeof(struct sctp_sndinfo)); + cmsg = (struct cmsghdr *)((caddr_t)cmsg + CMSG_SPACE(sizeof(struct sctp_sndinfo))); + break; + case SCTP_SENDV_PRINFO: + if (infolen < sizeof(struct sctp_prinfo)) { + free(cmsgbuf); + errno = EINVAL; + return (-1); + } + cmsg->cmsg_level = IPPROTO_SCTP; + cmsg->cmsg_type = SCTP_PRINFO; + cmsg->cmsg_len = CMSG_LEN(sizeof(struct sctp_prinfo)); + memcpy(CMSG_DATA(cmsg), info, sizeof(struct sctp_prinfo)); + msg.msg_controllen += CMSG_SPACE(sizeof(struct sctp_prinfo)); + cmsg = (struct cmsghdr *)((caddr_t)cmsg + CMSG_SPACE(sizeof(struct sctp_prinfo))); + break; + case SCTP_SENDV_AUTHINFO: + if (infolen < sizeof(struct sctp_authinfo)) { + free(cmsgbuf); + errno = EINVAL; + return (-1); + } + cmsg->cmsg_level = IPPROTO_SCTP; + cmsg->cmsg_type = SCTP_AUTHINFO; + cmsg->cmsg_len = CMSG_LEN(sizeof(struct sctp_authinfo)); + memcpy(CMSG_DATA(cmsg), info, sizeof(struct sctp_authinfo)); + msg.msg_controllen += CMSG_SPACE(sizeof(struct sctp_authinfo)); + cmsg = (struct cmsghdr *)((caddr_t)cmsg + CMSG_SPACE(sizeof(struct sctp_authinfo))); + break; + case SCTP_SENDV_SPA: + if (infolen < sizeof(struct sctp_sendv_spa)) { + free(cmsgbuf); + errno = EINVAL; + return (-1); + } + spa_info = (struct sctp_sendv_spa *)info; + if (spa_info->sendv_flags & SCTP_SEND_SNDINFO_VALID) { + cmsg->cmsg_level = IPPROTO_SCTP; + cmsg->cmsg_type = SCTP_SNDINFO; + cmsg->cmsg_len = CMSG_LEN(sizeof(struct sctp_sndinfo)); + memcpy(CMSG_DATA(cmsg), &spa_info->sendv_sndinfo, sizeof(struct sctp_sndinfo)); + msg.msg_controllen += CMSG_SPACE(sizeof(struct sctp_sndinfo)); + cmsg = (struct cmsghdr *)((caddr_t)cmsg + CMSG_SPACE(sizeof(struct sctp_sndinfo))); + } + if (spa_info->sendv_flags & SCTP_SEND_PRINFO_VALID) { + cmsg->cmsg_level = IPPROTO_SCTP; + cmsg->cmsg_type = SCTP_PRINFO; + cmsg->cmsg_len = CMSG_LEN(sizeof(struct sctp_prinfo)); + memcpy(CMSG_DATA(cmsg), &spa_info->sendv_prinfo, sizeof(struct sctp_prinfo)); + msg.msg_controllen += CMSG_SPACE(sizeof(struct sctp_prinfo)); + cmsg = (struct cmsghdr *)((caddr_t)cmsg + CMSG_SPACE(sizeof(struct sctp_prinfo))); + } + if (spa_info->sendv_flags & SCTP_SEND_AUTHINFO_VALID) { + cmsg->cmsg_level = IPPROTO_SCTP; + cmsg->cmsg_type = SCTP_AUTHINFO; + cmsg->cmsg_len = CMSG_LEN(sizeof(struct sctp_authinfo)); + memcpy(CMSG_DATA(cmsg), &spa_info->sendv_authinfo, sizeof(struct sctp_authinfo)); + msg.msg_controllen += CMSG_SPACE(sizeof(struct sctp_authinfo)); + cmsg = (struct cmsghdr *)((caddr_t)cmsg + CMSG_SPACE(sizeof(struct sctp_authinfo))); + } + break; + default: + free(cmsgbuf); + errno = EINVAL; + return (-1); + } + addr = addrs; + if (addrcnt == 1) { + msg.msg_name = addr; + switch (addr->sa_family) { + case AF_INET: + msg.msg_namelen = sizeof(struct sockaddr_in); + break; + case AF_INET6: + msg.msg_namelen = sizeof(struct sockaddr_in6); + break; + default: + free(cmsgbuf); + errno = EINVAL; + return (-1); + } } else { - return (peeloff.new_sd); + msg.msg_name = NULL; + msg.msg_namelen = 0; + for (i = 0; i < addrcnt; i++) { + switch (addr->sa_family) { + case AF_INET: + addr_len = sizeof(struct sockaddr_in); + addr_in = (struct sockaddr_in *)addr; + cmsg->cmsg_level = IPPROTO_SCTP; + cmsg->cmsg_type = SCTP_DSTADDRV4; + cmsg->cmsg_len = CMSG_LEN(sizeof(struct in_addr)); + memcpy(CMSG_DATA(cmsg), &addr_in->sin_addr, sizeof(struct in_addr)); + msg.msg_controllen += CMSG_SPACE(sizeof(struct in_addr)); + cmsg = (struct cmsghdr *)((caddr_t)cmsg + CMSG_SPACE(sizeof(struct in_addr))); + break; + case AF_INET6: + addr_len = sizeof(struct sockaddr_in6); + addr_in6 = (struct sockaddr_in6 *)addr; + cmsg->cmsg_level = IPPROTO_SCTP; + cmsg->cmsg_type = SCTP_DSTADDRV6; + cmsg->cmsg_len = CMSG_LEN(sizeof(struct in6_addr)); + memcpy(CMSG_DATA(cmsg), &addr_in6->sin6_addr, sizeof(struct in6_addr)); + msg.msg_controllen += CMSG_SPACE(sizeof(struct in6_addr)); + cmsg = (struct cmsghdr *)((caddr_t)cmsg + CMSG_SPACE(sizeof(struct in6_addr))); + break; + default: + free(cmsgbuf); + errno = EINVAL; + return (-1); + } + addr = (struct sockaddr *)((caddr_t)addr + addr_len); + } } + if (msg.msg_controllen == 0) { + msg.msg_control = NULL; + } + msg.msg_iov = (struct iovec *)iov; + msg.msg_iovlen = iovcnt; + msg.msg_flags = 0; + ret = sendmsg(sd, &msg, flags); + free(cmsgbuf); + return (ret); } -#endif #if !defined(SYS_sctp_peeloff) && !defined(HAVE_SCTP_PEELOFF_SOCKOPT) Modified: head/sys/netinet/sctp.h ============================================================================== --- head/sys/netinet/sctp.h Wed Jun 15 23:45:35 2011 (r223131) +++ head/sys/netinet/sctp.h Wed Jun 15 23:50:27 2011 (r223132) @@ -91,7 +91,7 @@ struct sctp_paramhdr { #define SCTP_PEER_ADDR_PARAMS 0x0000000a #define SCTP_DEFAULT_SEND_PARAM 0x0000000b /* ancillary data/notification interest options */ -#define SCTP_EVENTS 0x0000000c +#define SCTP_EVENTS 0x0000000c /* deprecated */ /* Without this applied we will give V4 and V6 addresses on a V6 socket */ #define SCTP_I_WANT_MAPPED_V4_ADDR 0x0000000d #define SCTP_MAXSEG 0x0000000e @@ -114,6 +114,10 @@ struct sctp_paramhdr { #define SCTP_EXPLICIT_EOR 0x0000001b #define SCTP_REUSE_PORT 0x0000001c /* rw */ #define SCTP_AUTH_DEACTIVATE_KEY 0x0000001d +#define SCTP_EVENT 0x0000001e +#define SCTP_RECVRCVINFO 0x0000001f +#define SCTP_RECVNXTINFO 0x00000020 +#define SCTP_DEFAULT_SNDINFO 0x00000021 /* * read-only options @@ -490,7 +494,7 @@ struct sctp_error_unrecognized_chunk { /* * PCB Features (in sctp_features bitmask) */ -#define SCTP_PCB_FLAGS_EXT_RCVINFO 0x00000002 +#define SCTP_PCB_FLAGS_EXT_RCVINFO 0x00000002 /* deprecated */ #define SCTP_PCB_FLAGS_DONOT_HEARTBEAT 0x00000004 #define SCTP_PCB_FLAGS_FRAG_INTERLEAVE 0x00000008 #define SCTP_PCB_FLAGS_INTERLEAVE_STRMS 0x00000010 @@ -500,7 +504,7 @@ struct sctp_error_unrecognized_chunk { /* socket options */ #define SCTP_PCB_FLAGS_NODELAY 0x00000100 #define SCTP_PCB_FLAGS_AUTOCLOSE 0x00000200 -#define SCTP_PCB_FLAGS_RECVDATAIOEVNT 0x00000400 +#define SCTP_PCB_FLAGS_RECVDATAIOEVNT 0x00000400 /* deprecated */ #define SCTP_PCB_FLAGS_RECVASSOCEVNT 0x00000800 #define SCTP_PCB_FLAGS_RECVPADDREVNT 0x00001000 #define SCTP_PCB_FLAGS_RECVPEERERR 0x00002000 @@ -516,6 +520,9 @@ struct sctp_error_unrecognized_chunk { #define SCTP_PCB_FLAGS_MULTIPLE_ASCONFS 0x01000000 #define SCTP_PCB_FLAGS_PORTREUSE 0x02000000 #define SCTP_PCB_FLAGS_DRYEVNT 0x04000000 +#define SCTP_PCB_FLAGS_RECVRCVINFO 0x08000000 +#define SCTP_PCB_FLAGS_RECVNXTINFO 0x10000000 + /*- * mobility_features parameters (by micchie).Note * these features are applied against the Modified: head/sys/netinet/sctp_auth.c ============================================================================== --- head/sys/netinet/sctp_auth.c Wed Jun 15 23:45:35 2011 (r223131) +++ head/sys/netinet/sctp_auth.c Wed Jun 15 23:50:27 2011 (r223132) @@ -1866,7 +1866,7 @@ sctp_notify_authentication(struct sctp_t /* If the socket is gone we are out of here */ return; } - if (sctp_is_feature_off(stcb->sctp_ep, SCTP_PCB_FLAGS_AUTHEVNT)) + if (sctp_stcb_is_feature_off(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_AUTHEVNT)) /* event not enabled */ return; Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Wed Jun 15 23:45:35 2011 (r223131) +++ head/sys/netinet/sctp_indata.c Wed Jun 15 23:50:27 2011 (r223132) @@ -201,48 +201,110 @@ failed_build: struct mbuf * -sctp_build_ctl_nchunk(struct sctp_inpcb *inp, - struct sctp_sndrcvinfo *sinfo) +sctp_build_ctl_nchunk(struct sctp_inpcb *inp, struct sctp_sndrcvinfo *sinfo) { + struct sctp_extrcvinfo *seinfo; struct sctp_sndrcvinfo *outinfo; + struct sctp_rcvinfo *rcvinfo; + struct sctp_nxtinfo *nxtinfo; struct cmsghdr *cmh; struct mbuf *ret; int len; - int use_extended = 0; + int use_extended; + int provide_nxt; - if (sctp_is_feature_off(inp, SCTP_PCB_FLAGS_RECVDATAIOEVNT)) { - /* user does not want the sndrcv ctl */ + if (sctp_is_feature_off(inp, SCTP_PCB_FLAGS_RECVDATAIOEVNT) && + sctp_is_feature_off(inp, SCTP_PCB_FLAGS_RECVRCVINFO) && + sctp_is_feature_off(inp, SCTP_PCB_FLAGS_RECVNXTINFO)) { + /* user does not want any ancillary data */ return (NULL); } - if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_EXT_RCVINFO)) { - use_extended = 1; - len = CMSG_LEN(sizeof(struct sctp_extrcvinfo)); + len = 0; + if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_RECVRCVINFO)) { + len += CMSG_SPACE(sizeof(struct sctp_rcvinfo)); + } + seinfo = (struct sctp_extrcvinfo *)sinfo; + if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_RECVNXTINFO) && + (seinfo->sreinfo_next_flags & SCTP_NEXT_MSG_AVAIL)) { + provide_nxt = 1; + len += CMSG_SPACE(sizeof(struct sctp_rcvinfo)); } else { - len = CMSG_LEN(sizeof(struct sctp_sndrcvinfo)); + provide_nxt = 0; + } + if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_RECVDATAIOEVNT)) { + if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_EXT_RCVINFO)) { + use_extended = 1; + len += CMSG_SPACE(sizeof(struct sctp_extrcvinfo)); + } else { + use_extended = 0; + len += CMSG_SPACE(sizeof(struct sctp_sndrcvinfo)); + } + } else { + use_extended = 0; } - - ret = sctp_get_mbuf_for_msg(len, - 0, M_DONTWAIT, 1, MT_DATA); - + ret = sctp_get_mbuf_for_msg(len, 0, M_DONTWAIT, 1, MT_DATA); if (ret == NULL) { /* No space */ return (ret); } - /* We need a CMSG header followed by the struct */ + SCTP_BUF_LEN(ret) = 0; + + /* We need a CMSG header followed by the struct */ cmh = mtod(ret, struct cmsghdr *); - outinfo = (struct sctp_sndrcvinfo *)CMSG_DATA(cmh); - cmh->cmsg_level = IPPROTO_SCTP; - if (use_extended) { - cmh->cmsg_type = SCTP_EXTRCV; - cmh->cmsg_len = len; - memcpy(outinfo, sinfo, len); - } else { - cmh->cmsg_type = SCTP_SNDRCV; - cmh->cmsg_len = len; - *outinfo = *sinfo; + if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_RECVRCVINFO)) { + cmh->cmsg_level = IPPROTO_SCTP; + cmh->cmsg_len = CMSG_LEN(sizeof(struct sctp_rcvinfo)); + cmh->cmsg_type = SCTP_RCVINFO; + rcvinfo = (struct sctp_rcvinfo *)CMSG_DATA(cmh); + rcvinfo->rcv_sid = sinfo->sinfo_stream; + rcvinfo->rcv_ssn = sinfo->sinfo_ssn; + rcvinfo->rcv_flags = sinfo->sinfo_flags; + rcvinfo->rcv_ppid = sinfo->sinfo_ppid; + rcvinfo->rcv_tsn = sinfo->sinfo_tsn; + rcvinfo->rcv_cumtsn = sinfo->sinfo_cumtsn; + rcvinfo->rcv_context = sinfo->sinfo_context; + rcvinfo->rcv_assoc_id = sinfo->sinfo_assoc_id; + cmh = (struct cmsghdr *)((caddr_t)cmh + CMSG_SPACE(sizeof(struct sctp_rcvinfo))); + SCTP_BUF_LEN(ret) += CMSG_SPACE(sizeof(struct sctp_rcvinfo)); + } + if (provide_nxt) { + cmh->cmsg_level = IPPROTO_SCTP; + cmh->cmsg_len = CMSG_LEN(sizeof(struct sctp_nxtinfo)); + cmh->cmsg_type = SCTP_NXTINFO; + nxtinfo = (struct sctp_nxtinfo *)CMSG_DATA(cmh); + nxtinfo->nxt_sid = seinfo->sreinfo_next_stream; + nxtinfo->nxt_flags = 0; + if (seinfo->sreinfo_next_flags & SCTP_NEXT_MSG_IS_UNORDERED) { + nxtinfo->nxt_flags |= SCTP_UNORDERED; + } + if (seinfo->sreinfo_next_flags & SCTP_NEXT_MSG_IS_NOTIFICATION) { + nxtinfo->nxt_flags |= SCTP_NOTIFICATION; + } + if (seinfo->sreinfo_next_flags & SCTP_NEXT_MSG_ISCOMPLETE) { + nxtinfo->nxt_flags |= SCTP_COMPLETE; + } + nxtinfo->nxt_ppid = seinfo->sreinfo_next_ppid; + nxtinfo->nxt_length = seinfo->sreinfo_next_length; + nxtinfo->nxt_assoc_id = seinfo->sreinfo_next_aid; + cmh = (struct cmsghdr *)((caddr_t)cmh + CMSG_SPACE(sizeof(struct sctp_nxtinfo))); + SCTP_BUF_LEN(ret) += CMSG_SPACE(sizeof(struct sctp_nxtinfo)); + } + if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_RECVDATAIOEVNT)) { + cmh->cmsg_level = IPPROTO_SCTP; + outinfo = (struct sctp_sndrcvinfo *)CMSG_DATA(cmh); + if (use_extended) { + cmh->cmsg_len = CMSG_LEN(sizeof(struct sctp_extrcvinfo)); + cmh->cmsg_type = SCTP_EXTRCV; + memcpy(outinfo, sinfo, sizeof(struct sctp_extrcvinfo)); + SCTP_BUF_LEN(ret) += CMSG_SPACE(sizeof(struct sctp_extrcvinfo)); + } else { + cmh->cmsg_len = CMSG_LEN(sizeof(struct sctp_sndrcvinfo)); + cmh->cmsg_type = SCTP_SNDRCV; + *outinfo = *sinfo; + SCTP_BUF_LEN(ret) += CMSG_SPACE(sizeof(struct sctp_sndrcvinfo)); + } } - SCTP_BUF_LEN(ret) = cmh->cmsg_len; return (ret); } Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Wed Jun 15 23:45:35 2011 (r223131) +++ head/sys/netinet/sctp_output.c Wed Jun 15 23:50:27 2011 (r223132) @@ -3355,54 +3355,338 @@ sctp_source_address_selection(struct sct } static int -sctp_find_cmsg(int c_type, void *data, struct mbuf *control, int cpsize) +sctp_find_cmsg(int c_type, void *data, struct mbuf *control, size_t cpsize) { struct cmsghdr cmh; - int tlen, at; + int tlen, at, found; + struct sctp_sndinfo sndinfo; + struct sctp_prinfo prinfo; + struct sctp_authinfo authinfo; tlen = SCTP_BUF_LEN(control); at = 0; + found = 0; /* * Independent of how many mbufs, find the c_type inside the control * structure and copy out the data. */ while (at < tlen) { if ((tlen - at) < (int)CMSG_ALIGN(sizeof(cmh))) { - /* not enough room for one more we are done. */ - return (0); + /* There is not enough room for one more. */ + return (found); } m_copydata(control, at, sizeof(cmh), (caddr_t)&cmh); + if (cmh.cmsg_len < CMSG_ALIGN(sizeof(struct cmsghdr))) { + /* We dont't have a complete CMSG header. */ + return (found); + } if (((int)cmh.cmsg_len + at) > tlen) { - /* - * this is real messed up since there is not enough - * data here to cover the cmsg header. We are done. - */ - return (0); + /* We don't have the complete CMSG. */ + return (found); } if ((cmh.cmsg_level == IPPROTO_SCTP) && - (c_type == cmh.cmsg_type)) { - /* found the one we want, copy it out */ - at += CMSG_ALIGN(sizeof(struct cmsghdr)); - if ((int)(cmh.cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr))) < cpsize) { - /* - * space of cmsg_len after header not big - * enough - */ - return (0); + ((c_type == cmh.cmsg_type) || + ((c_type == SCTP_SNDRCV) && + ((cmh.cmsg_type == SCTP_SNDINFO) || + (cmh.cmsg_type == SCTP_PRINFO) || + (cmh.cmsg_type == SCTP_AUTHINFO))))) { + if (c_type == cmh.cmsg_type) { + if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr))) < cpsize) { + return (found); + } + /* It is exactly what we want. Copy it out. */ + m_copydata(control, at + CMSG_ALIGN(sizeof(struct cmsghdr)), cpsize, (caddr_t)data); + return (1); + } else { + struct sctp_sndrcvinfo *sndrcvinfo; + + sndrcvinfo = (struct sctp_sndrcvinfo *)data; + if (found == 0) { + if (cpsize < sizeof(struct sctp_sndrcvinfo)) { + return (found); + } + memset(sndrcvinfo, 0, sizeof(struct sctp_sndrcvinfo)); + } + switch (cmh.cmsg_type) { + case SCTP_SNDINFO: + if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr))) < sizeof(struct sctp_sndinfo)) { + return (found); + } + m_copydata(control, at + CMSG_ALIGN(sizeof(struct cmsghdr)), sizeof(struct sctp_sndinfo), (caddr_t)&sndinfo); + sndrcvinfo->sinfo_stream = sndinfo.snd_sid; + sndrcvinfo->sinfo_flags = sndinfo.snd_flags; + sndrcvinfo->sinfo_ppid = sndinfo.snd_ppid; + sndrcvinfo->sinfo_context = sndinfo.snd_context; + sndrcvinfo->sinfo_assoc_id = sndinfo.snd_assoc_id; + break; + case SCTP_PRINFO: + if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr))) < sizeof(struct sctp_prinfo)) { + return (found); + } + m_copydata(control, at + CMSG_ALIGN(sizeof(struct cmsghdr)), sizeof(struct sctp_prinfo), (caddr_t)&prinfo); + sndrcvinfo->sinfo_timetolive = prinfo.pr_value; + sndrcvinfo->sinfo_flags |= prinfo.pr_policy; + break; + case SCTP_AUTHINFO: + if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr))) < sizeof(struct sctp_authinfo)) { + return (found); + } + m_copydata(control, at + CMSG_ALIGN(sizeof(struct cmsghdr)), sizeof(struct sctp_authinfo), (caddr_t)&authinfo); + sndrcvinfo->sinfo_keynumber_valid = 1; + sndrcvinfo->sinfo_keynumber = authinfo.auth_keyid; + break; + default: + return (found); + } + found = 1; } - m_copydata(control, at, cpsize, data); + } + at += CMSG_ALIGN(cmh.cmsg_len); + } + return (found); +} + +static int +sctp_process_cmsgs_for_init(struct sctp_tcb *stcb, struct mbuf *control, int *error) +{ + struct cmsghdr cmh; + int tlen, at; + struct sctp_initmsg initmsg; + +#ifdef INET + struct sockaddr_in sin; + +#endif +#ifdef INET6 + struct sockaddr_in6 sin6; + +#endif + + tlen = SCTP_BUF_LEN(control); + at = 0; + while (at < tlen) { + if ((tlen - at) < (int)CMSG_ALIGN(sizeof(cmh))) { + /* There is not enough room for one more. */ + *error = EINVAL; return (1); - } else { - at += CMSG_ALIGN(cmh.cmsg_len); - if (cmh.cmsg_len == 0) { + } + m_copydata(control, at, sizeof(cmh), (caddr_t)&cmh); + if (cmh.cmsg_len < CMSG_ALIGN(sizeof(struct cmsghdr))) { + /* We dont't have a complete CMSG header. */ + *error = EINVAL; + return (1); + } + if (((int)cmh.cmsg_len + at) > tlen) { + /* We don't have the complete CMSG. */ + *error = EINVAL; + return (1); + } + if (cmh.cmsg_level == IPPROTO_SCTP) { + switch (cmh.cmsg_type) { + case SCTP_INIT: + if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr))) < sizeof(struct sctp_initmsg)) { + *error = EINVAL; + return (1); + } + m_copydata(control, at + CMSG_ALIGN(sizeof(struct cmsghdr)), sizeof(struct sctp_initmsg), (caddr_t)&initmsg); + if (initmsg.sinit_max_attempts) + stcb->asoc.max_init_times = initmsg.sinit_max_attempts; + if (initmsg.sinit_num_ostreams) + stcb->asoc.pre_open_streams = initmsg.sinit_num_ostreams; + if (initmsg.sinit_max_instreams) + stcb->asoc.max_inbound_streams = initmsg.sinit_max_instreams; + if (initmsg.sinit_max_init_timeo) + stcb->asoc.initial_init_rto_max = initmsg.sinit_max_init_timeo; + if (stcb->asoc.streamoutcnt < stcb->asoc.pre_open_streams) { + struct sctp_stream_out *tmp_str; + unsigned int i; + + /* Default is NOT correct */ + SCTPDBG(SCTP_DEBUG_OUTPUT1, "Ok, default:%d pre_open:%d\n", + stcb->asoc.streamoutcnt, stcb->asoc.pre_open_streams); + SCTP_TCB_UNLOCK(stcb); + SCTP_MALLOC(tmp_str, + struct sctp_stream_out *, + (stcb->asoc.pre_open_streams * sizeof(struct sctp_stream_out)), + SCTP_M_STRMO); + SCTP_TCB_LOCK(stcb); + if (tmp_str != NULL) { + SCTP_FREE(stcb->asoc.strmout, SCTP_M_STRMO); + stcb->asoc.strmout = tmp_str; + stcb->asoc.strm_realoutsize = stcb->asoc.streamoutcnt = stcb->asoc.pre_open_streams; + } else { + stcb->asoc.pre_open_streams = stcb->asoc.streamoutcnt; + } + for (i = 0; i < stcb->asoc.streamoutcnt; i++) { + stcb->asoc.strmout[i].next_sequence_sent = 0; + TAILQ_INIT(&stcb->asoc.strmout[i].outqueue); + stcb->asoc.strmout[i].stream_no = i; + stcb->asoc.strmout[i].last_msg_incomplete = 0; + stcb->asoc.ss_functions.sctp_ss_init_stream(&stcb->asoc.strmout[i], NULL); + } + } + break; +#ifdef INET + case SCTP_DSTADDRV4: + if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr))) < sizeof(struct in_addr)) { + *error = EINVAL; + return (1); + } + memset(&sin, 0, sizeof(struct sockaddr_in)); + sin.sin_family = AF_INET; + sin.sin_len = sizeof(struct sockaddr_in); + sin.sin_port = stcb->rport; + m_copydata(control, at + CMSG_ALIGN(sizeof(struct cmsghdr)), sizeof(struct in_addr), (caddr_t)&sin.sin_addr); + if ((sin.sin_addr.s_addr == INADDR_ANY) || + (sin.sin_addr.s_addr == INADDR_BROADCAST) || + IN_MULTICAST(ntohl(sin.sin_addr.s_addr))) { + *error = EINVAL; + return (-1); + } + if (sctp_add_remote_addr(stcb, (struct sockaddr *)&sin, SCTP_DONOT_SETSCOPE, SCTP_ADDR_IS_CONFIRMED)) { + *error = ENOBUFS; + return (1); + } + break; +#endif +#ifdef INET6 + case SCTP_DSTADDRV6: + if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr))) < sizeof(struct in6_addr)) { + *error = EINVAL; + return (1); + } + memset(&sin6, 0, sizeof(struct sockaddr_in6)); + sin6.sin6_family = AF_INET6; + sin6.sin6_len = sizeof(struct sockaddr_in6); + sin6.sin6_port = stcb->rport; + m_copydata(control, at + CMSG_ALIGN(sizeof(struct cmsghdr)), sizeof(struct in6_addr), (caddr_t)&sin6.sin6_addr); + if (IN6_IS_ADDR_UNSPECIFIED(&sin6.sin6_addr) || + IN6_IS_ADDR_MULTICAST(&sin6.sin6_addr)) { + *error = EINVAL; + return (-1); + } +#ifdef INET + if (IN6_IS_ADDR_V4MAPPED(&sin6.sin6_addr)) { + in6_sin6_2_sin(&sin, &sin6); + if ((sin.sin_addr.s_addr == INADDR_ANY) || + (sin.sin_addr.s_addr == INADDR_BROADCAST) || + IN_MULTICAST(ntohl(sin.sin_addr.s_addr))) { + *error = EINVAL; + return (-1); + } + if (sctp_add_remote_addr(stcb, (struct sockaddr *)&sin, SCTP_DONOT_SETSCOPE, SCTP_ADDR_IS_CONFIRMED)) { + *error = ENOBUFS; + return (1); + } + } else +#endif + if (sctp_add_remote_addr(stcb, (struct sockaddr *)&sin6, SCTP_DONOT_SETSCOPE, SCTP_ADDR_IS_CONFIRMED)) { + *error = ENOBUFS; + return (1); + } + break; +#endif + default: break; } } + at += CMSG_ALIGN(cmh.cmsg_len); } - /* not found */ return (0); } +static struct sctp_tcb * +sctp_findassociation_cmsgs(struct sctp_inpcb **inp_p, + in_port_t port, + struct mbuf *control, + struct sctp_nets **net_p, + int *error) +{ + struct cmsghdr cmh; + int tlen, at; + struct sctp_tcb *stcb; + struct sockaddr *addr; + +#ifdef INET + struct sockaddr_in sin; + +#endif +#ifdef INET6 + struct sockaddr_in6 sin6; + +#endif + + tlen = SCTP_BUF_LEN(control); + at = 0; + while (at < tlen) { + if ((tlen - at) < (int)CMSG_ALIGN(sizeof(cmh))) { + /* There is not enough room for one more. */ + *error = EINVAL; + return (NULL); + } + m_copydata(control, at, sizeof(cmh), (caddr_t)&cmh); + if (cmh.cmsg_len < CMSG_ALIGN(sizeof(struct cmsghdr))) { + /* We dont't have a complete CMSG header. */ + *error = EINVAL; + return (NULL); + } + if (((int)cmh.cmsg_len + at) > tlen) { + /* We don't have the complete CMSG. */ + *error = EINVAL; + return (NULL); + } + if (cmh.cmsg_level == IPPROTO_SCTP) { + switch (cmh.cmsg_type) { +#ifdef INET + case SCTP_DSTADDRV4: + if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr))) < sizeof(struct in_addr)) { + *error = EINVAL; + return (NULL); + } + memset(&sin, 0, sizeof(struct sockaddr_in)); + sin.sin_family = AF_INET; + sin.sin_len = sizeof(struct sockaddr_in); + sin.sin_port = port; + m_copydata(control, at + CMSG_ALIGN(sizeof(struct cmsghdr)), sizeof(struct in_addr), (caddr_t)&sin.sin_addr); + addr = (struct sockaddr *)&sin; + break; +#endif +#ifdef INET6 + case SCTP_DSTADDRV6: + if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr))) < sizeof(struct in6_addr)) { + *error = EINVAL; + return (NULL); + } + memset(&sin6, 0, sizeof(struct sockaddr_in6)); + sin6.sin6_family = AF_INET6; + sin6.sin6_len = sizeof(struct sockaddr_in6); + sin6.sin6_port = port; + m_copydata(control, at + CMSG_ALIGN(sizeof(struct cmsghdr)), sizeof(struct in6_addr), (caddr_t)&sin6.sin6_addr); +#ifdef INET + if (IN6_IS_ADDR_V4MAPPED(&sin6.sin6_addr)) { + in6_sin6_2_sin(&sin, &sin6); + addr = (struct sockaddr *)&sin; + } else +#endif + addr = (struct sockaddr *)&sin6; + break; +#endif + default: + addr = NULL; + break; + } + if (addr) { + stcb = sctp_findassociation_ep_addr(inp_p, addr, net_p, NULL, NULL); + if (stcb != NULL) { + return (stcb); + } + } + } + at += CMSG_ALIGN(cmh.cmsg_len); + } + return (NULL); +} + static struct mbuf * sctp_add_cookie(struct sctp_inpcb *inp, struct mbuf *init, int init_offset, struct mbuf *initack, int initack_offset, struct sctp_state_cookie *stc_in, uint8_t ** signature) @@ -5989,19 +6273,26 @@ sctp_msg_append(struct sctp_tcb *stcb, sp->some_taken = 0; sp->data = m; sp->tail_mbuf = NULL; - sp->length = 0; - at = m; sctp_set_prsctp_policy(sp); /* * We could in theory (for sendall) sifa the length in, but we would * still have to hunt through the chain since we need to setup the * tail_mbuf */ - while (at) { + sp->length = 0; + for (at = m; at; at = SCTP_BUF_NEXT(at)) { if (SCTP_BUF_NEXT(at) == NULL) sp->tail_mbuf = at; sp->length += SCTP_BUF_LEN(at); - at = SCTP_BUF_NEXT(at); + } + if (srcv->sinfo_keynumber_valid) { + sp->auth_keyid = srcv->sinfo_keynumber; + } else { + sp->auth_keyid = stcb->asoc.authinfo.active_keyid; + } + if (sctp_auth_is_required_chunk(SCTP_DATA, stcb->asoc.peer_auth_chunks)) { + sctp_auth_key_acquire(stcb, sp->auth_keyid); + sp->holds_key_ref = 1; } SCTP_TCB_SEND_LOCK(stcb); sctp_snd_sb_alloc(stcb, sp->length); @@ -6478,7 +6769,9 @@ sctp_sendall(struct sctp_inpcb *inp, str memset(ca, 0, sizeof(struct sctp_copy_all)); ca->inp = inp; - memcpy(&ca->sndrcv, srcv, sizeof(struct sctp_nonpad_sndrcvinfo)); + if (srcv) { + memcpy(&ca->sndrcv, srcv, sizeof(struct sctp_nonpad_sndrcvinfo)); + } /* * take off the sendall flag, it would be bad if we failed to do * this :-0 @@ -12229,9 +12522,13 @@ sctp_copy_it_in(struct sctp_tcb *stcb, *error = 0; goto skip_copy; } - sp->auth_keyid = stcb->asoc.authinfo.active_keyid; + if (srcv->sinfo_keynumber_valid) { + sp->auth_keyid = srcv->sinfo_keynumber; + } else { + sp->auth_keyid = stcb->asoc.authinfo.active_keyid; + } if (sctp_auth_is_required_chunk(SCTP_DATA, stcb->asoc.peer_auth_chunks)) { - sctp_auth_key_acquire(stcb, stcb->asoc.authinfo.active_keyid); + sctp_auth_key_acquire(stcb, sp->auth_keyid); sp->holds_key_ref = 1; } *error = sctp_copy_one(sp, uio, resv_in_first); @@ -12263,8 +12560,8 @@ sctp_sosend(struct socket *so, struct thread *p ) { - int error, use_rcvinfo = 0; - struct sctp_sndrcvinfo srcv; + int error, use_sndinfo = 0; + struct sctp_sndrcvinfo sndrcvninfo; struct sockaddr *addr_to_use; #if defined(INET) && defined(INET6) @@ -12274,10 +12571,10 @@ sctp_sosend(struct socket *so, if (control) { /* process cmsg snd/rcv info (maybe a assoc-id) */ - if (sctp_find_cmsg(SCTP_SNDRCV, (void *)&srcv, control, - sizeof(srcv))) { + if (sctp_find_cmsg(SCTP_SNDRCV, (void *)&sndrcvninfo, control, + sizeof(sndrcvninfo))) { /* got one */ - use_rcvinfo = 1; + use_sndinfo = 1; } } addr_to_use = addr; @@ -12295,7 +12592,7 @@ sctp_sosend(struct socket *so, error = sctp_lower_sosend(so, addr_to_use, uio, top, control, flags, - use_rcvinfo ? &srcv : NULL + use_sndinfo ? &sndrcvninfo : NULL ,p ); return (error); @@ -12500,6 +12797,9 @@ sctp_lower_sosend(struct socket *so, SCTP_INP_WUNLOCK(inp); /* With the lock applied look again */ stcb = sctp_findassociation_ep_addr(&t_inp, addr, &net, NULL, NULL); + if ((stcb == NULL) && (control != NULL) && (port > 0)) { + stcb = sctp_findassociation_cmsgs(&t_inp, port, control, &net, &error); + } if (stcb == NULL) { SCTP_INP_WLOCK(inp); SCTP_INP_DECR_REF(inp); @@ -12507,6 +12807,9 @@ sctp_lower_sosend(struct socket *so, } else { hold_tcblock = 1; } + if (error) { + goto out_unlocked; + } if (t_inp != inp) { SCTP_LTRACE_ERR_RET(inp, stcb, net, SCTP_FROM_SCTP_OUTPUT, ENOTCONN); error = ENOTCONN; @@ -12555,6 +12858,7 @@ sctp_lower_sosend(struct socket *so, /* Error is setup for us in the call */ goto out_unlocked; } + hold_tcblock = 1; if (create_lock_applied) { SCTP_ASOC_CREATE_UNLOCK(inp); create_lock_applied = 0; @@ -12574,84 +12878,13 @@ sctp_lower_sosend(struct socket *so, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Wed Jun 15 23:56:41 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0325F106566B; Wed, 15 Jun 2011 23:56:41 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E7AA08FC14; Wed, 15 Jun 2011 23:56:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5FNueAD003894; Wed, 15 Jun 2011 23:56:40 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5FNuetC003892; Wed, 15 Jun 2011 23:56:40 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201106152356.p5FNuetC003892@svn.freebsd.org> From: Nathan Whitehorn Date: Wed, 15 Jun 2011 23:56:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223133 - head/release X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2011 23:56:41 -0000 Author: nwhitehorn Date: Wed Jun 15 23:56:40 2011 New Revision: 223133 URL: http://svn.freebsd.org/changeset/base/223133 Log: Make the bootonly CD smaller by discarding static libraries that are not useful without a toolchain. Modified: head/release/Makefile Modified: head/release/Makefile ============================================================================== --- head/release/Makefile Wed Jun 15 23:50:27 2011 (r223132) +++ head/release/Makefile Wed Jun 15 23:56:40 2011 (r223133) @@ -111,8 +111,7 @@ system: packagesystem # Install system -mkdir ${.OBJDIR}/release cd ${WORLDDIR} && ${IMAKE} installkernel installworld distribution \ - DESTDIR=${.OBJDIR}/release WITHOUT_RESCUE=1 - -rm ${.OBJDIR}/release/boot/kernel/*.symbols + DESTDIR=${.OBJDIR}/release WITHOUT_RESCUE=1 WITHOUT_KERNEL_SYMBOLS=1 # Copy distfiles mkdir ${.OBJDIR}/release/usr/freebsd-dist cp ${.OBJDIR}/*.txz ${.OBJDIR}/MANIFEST \ @@ -136,8 +135,9 @@ bootonly: packagesystem WITHOUT_BIND_DNSSEC=1 WITHOUT_BIND_ETC=1 WITHOUT_BIND_MTREE=1 \ WITHOUT_BIND_NAMED=1 WITHOUT_GAMES=1 WITHOUT_GROFF=1 \ WITHOUT_INSTALLLIB=1 WITHOUT_LIB32=1 WITHOUT_MAIL=1 \ - WITHOUT_NCP=1 WITHOUT_TOOLCHAIN=1 WITHOUT_RESCUE=1 WITHOUT_DICT=1 - -rm ${.OBJDIR}/bootonly/boot/kernel/*.symbols + WITHOUT_NCP=1 WITHOUT_TOOLCHAIN=1 WITHOUT_PROFILE=1 \ + WITHOUT_INSTALLIB=1 WITHOUT_RESCUE=1 WITHOUT_DICT=1 \ + WITHOUT_KERNEL_SYMBOLS=1 # Copy manifest only (no distfiles) to get checksums mkdir ${.OBJDIR}/bootonly/usr/freebsd-dist cp ${.OBJDIR}/MANIFEST ${.OBJDIR}/bootonly/usr/freebsd-dist From owner-svn-src-head@FreeBSD.ORG Thu Jun 16 02:16:53 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7DE54106566C; Thu, 16 Jun 2011 02:16:53 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6E64D8FC0A; Thu, 16 Jun 2011 02:16:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5G2GrGu007995; Thu, 16 Jun 2011 02:16:53 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5G2Grq5007993; Thu, 16 Jun 2011 02:16:53 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201106160216.p5G2Grq5007993@svn.freebsd.org> From: Craig Rodrigues Date: Thu, 16 Jun 2011 02:16:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223135 - head/usr.bin/tftp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2011 02:16:53 -0000 Author: rodrigc Date: Thu Jun 16 02:16:53 2011 New Revision: 223135 URL: http://svn.freebsd.org/changeset/base/223135 Log: Specify correct RFC2347 for TFTP options in diagnostic message. Modified: head/usr.bin/tftp/main.c Modified: head/usr.bin/tftp/main.c ============================================================================== --- head/usr.bin/tftp/main.c Thu Jun 16 01:52:42 2011 (r223134) +++ head/usr.bin/tftp/main.c Thu Jun 16 02:16:53 2011 (r223135) @@ -840,8 +840,8 @@ help(int argc, char *argv[]) printf("%-*s\t%s\n", (int)HELPINDENT, c->name, c->help); printf("\n[-] : You shouldn't use these ones anymore.\n"); - printf("[*] : RFC2834 options support required.\n"); - printf("[**] : Non-standard RFC2834 option.\n"); + printf("[*] : RFC2347 options support required.\n"); + printf("[**] : Non-standard RFC2347 option.\n"); return; } while (--argc > 0) { From owner-svn-src-head@FreeBSD.ORG Thu Jun 16 02:22:25 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F6D2106566B; Thu, 16 Jun 2011 02:22:25 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 001758FC14; Thu, 16 Jun 2011 02:22:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5G2MOUF008205; Thu, 16 Jun 2011 02:22:24 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5G2MOrQ008203; Thu, 16 Jun 2011 02:22:24 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201106160222.p5G2MOrQ008203@svn.freebsd.org> From: David Xu Date: Thu, 16 Jun 2011 02:22:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223136 - head/lib/libc/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2011 02:22:25 -0000 Author: davidxu Date: Thu Jun 16 02:22:24 2011 New Revision: 223136 URL: http://svn.freebsd.org/changeset/base/223136 Log: Use size of int to fetch sysctl kern.sched.cpusetsize because it had switched from long to int type in kernel. Fixed by: pluknet Modified: head/lib/libc/gen/sysconf.c Modified: head/lib/libc/gen/sysconf.c ============================================================================== --- head/lib/libc/gen/sysconf.c Thu Jun 16 02:16:53 2011 (r223135) +++ head/lib/libc/gen/sysconf.c Thu Jun 16 02:22:24 2011 (r223136) @@ -599,11 +599,11 @@ yesno: #ifdef _SC_CPUSET_SIZE case _SC_CPUSET_SIZE: - len = sizeof(lvalue); - if (sysctlbyname("kern.sched.cpusetsize", &lvalue, &len, NULL, + len = sizeof(value); + if (sysctlbyname("kern.sched.cpusetsize", &value, &len, NULL, 0) == -1) return (-1); - return (lvalue); + return ((long)value); #endif default: From owner-svn-src-head@FreeBSD.ORG Thu Jun 16 02:27:06 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B001106566B; Thu, 16 Jun 2011 02:27:06 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4B4D78FC18; Thu, 16 Jun 2011 02:27:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5G2R6Ov008369; Thu, 16 Jun 2011 02:27:06 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5G2R6js008366; Thu, 16 Jun 2011 02:27:06 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201106160227.p5G2R6js008366@svn.freebsd.org> From: Craig Rodrigues Date: Thu, 16 Jun 2011 02:27:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223137 - in head: libexec/tftpd usr.bin/tftp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2011 02:27:06 -0000 Author: rodrigc Date: Thu Jun 16 02:27:05 2011 New Revision: 223137 URL: http://svn.freebsd.org/changeset/base/223137 Log: Clarify that the TFTP blocksize (RFC2348) or non-standard TFTP rollover option can be used to transfer larger files. Modified: head/libexec/tftpd/tftpd.8 head/usr.bin/tftp/tftp.1 Modified: head/libexec/tftpd/tftpd.8 ============================================================================== --- head/libexec/tftpd/tftpd.8 Thu Jun 16 02:22:24 2011 (r223136) +++ head/libexec/tftpd/tftpd.8 Thu Jun 16 02:27:05 2011 (r223137) @@ -253,8 +253,9 @@ was introduced in support for the TFTP Blocksize Option (RFC2348) and the blksize2 option was introduced in .Fx 7.4 . -.Sh BUGS +.Sh NOTES Files larger than 33488896 octets (65535 blocks) cannot be transferred -without client and server supporting blocksize negotiation (RFC2348). +without client and server supporting the the TFTP blocksize option (RFC2348), +or the non-standard TFTP rollover option. .Pp Many tftp clients will not transfer files over 16744448 octets (32767 blocks). Modified: head/usr.bin/tftp/tftp.1 ============================================================================== --- head/usr.bin/tftp/tftp.1 Thu Jun 16 02:22:24 2011 (r223136) +++ head/usr.bin/tftp/tftp.1 Thu Jun 16 02:27:05 2011 (r223137) @@ -174,7 +174,7 @@ The .Nm command appeared in .Bx 4.3 . -.Sh BUGS +.Sh NOTES Because there is no user-login or validation within the .Tn TFTP @@ -185,4 +185,5 @@ exact methods are specific to each site difficult to document here. .Pp Files larger than 33488896 octets (65535 blocks) cannot be transferred -without client and server supporting blocksize negotiation (RFC1783). +without client and server supporting the TFTP blocksize option (RFC2348), +or the non-standard TFTP rollover option. From owner-svn-src-head@FreeBSD.ORG Thu Jun 16 05:26:03 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D173F106564A; Thu, 16 Jun 2011 05:26:03 +0000 (UTC) (envelope-from avatar@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A8FFB8FC15; Thu, 16 Jun 2011 05:26:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5G5Q3Sl013917; Thu, 16 Jun 2011 05:26:03 GMT (envelope-from avatar@svn.freebsd.org) Received: (from avatar@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5G5Q3RX013915; Thu, 16 Jun 2011 05:26:03 GMT (envelope-from avatar@svn.freebsd.org) Message-Id: <201106160526.p5G5Q3RX013915@svn.freebsd.org> From: Tai-hwa Liang Date: Thu, 16 Jun 2011 05:26:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223138 - head/sys/ufs/ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2011 05:26:03 -0000 Author: avatar Date: Thu Jun 16 05:26:03 2011 New Revision: 223138 URL: http://svn.freebsd.org/changeset/base/223138 Log: Fixing compilation bustage by introducing another forward declaration. Modified: head/sys/ufs/ffs/ffs_extern.h Modified: head/sys/ufs/ffs/ffs_extern.h ============================================================================== --- head/sys/ufs/ffs/ffs_extern.h Thu Jun 16 02:27:05 2011 (r223137) +++ head/sys/ufs/ffs/ffs_extern.h Thu Jun 16 05:26:03 2011 (r223138) @@ -33,6 +33,7 @@ #ifndef _UFS_FFS_EXTERN_H #define _UFS_FFS_EXTERN_H +enum vtype; struct buf; struct cg; struct fid; From owner-svn-src-head@FreeBSD.ORG Thu Jun 16 06:53:16 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D299106564A; Thu, 16 Jun 2011 06:53:16 +0000 (UTC) (envelope-from stefan@fafoe.narf.at) Received: from fep13.mx.upcmail.net (fep13.mx.upcmail.net [62.179.121.33]) by mx1.freebsd.org (Postfix) with ESMTP id 37F248FC08; Thu, 16 Jun 2011 06:53:14 +0000 (UTC) Received: from edge01.upcmail.net ([192.168.13.236]) by viefep13-int.chello.at (InterMail vM.8.01.02.02 201-2260-120-106-20100312) with ESMTP id <20110616065313.BBHX27705.viefep13-int.chello.at@edge01.upcmail.net>; Thu, 16 Jun 2011 08:53:13 +0200 Received: from mole.fafoe.narf.at ([213.47.85.26]) by edge01.upcmail.net with edge id wWtB1g05H0a5KZh01WtDlM; Thu, 16 Jun 2011 08:53:13 +0200 X-SourceIP: 213.47.85.26 Received: by mole.fafoe.narf.at (Postfix, from userid 1001) id AD3816D42B; Thu, 16 Jun 2011 08:53:11 +0200 (CEST) Date: Thu, 16 Jun 2011 08:53:11 +0200 From: Stefan Farfeleder To: Tai-hwa Liang Message-ID: <20110616065310.GA2542@mole.fafoe.narf.at> References: <201106160526.p5G5Q3RX013915@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201106160526.p5G5Q3RX013915@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Cloudmark-Analysis: v=1.1 cv=HQ3F56nxkum+cgCiDL7AXQpbvw7DWrWCBJRnYYnM0Zc= c=1 sm=0 a=wom5GMh1gUkA:10 a=Y6sN_8hR3U4A:10 a=dBRESv0yCI8A:10 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=BqI0uTjuG50fhkVmhDAA:9 a=CjuIK1q_8ugA:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223138 - head/sys/ufs/ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2011 06:53:16 -0000 On Thu, Jun 16, 2011 at 05:26:03AM +0000, Tai-hwa Liang wrote: > Author: avatar > Date: Thu Jun 16 05:26:03 2011 > New Revision: 223138 > URL: http://svn.freebsd.org/changeset/base/223138 > > Log: > Fixing compilation bustage by introducing another forward declaration. > > Modified: > head/sys/ufs/ffs/ffs_extern.h > > Modified: head/sys/ufs/ffs/ffs_extern.h > ============================================================================== > --- head/sys/ufs/ffs/ffs_extern.h Thu Jun 16 02:27:05 2011 (r223137) > +++ head/sys/ufs/ffs/ffs_extern.h Thu Jun 16 05:26:03 2011 (r223138) > @@ -33,6 +33,7 @@ > #ifndef _UFS_FFS_EXTERN_H > #define _UFS_FFS_EXTERN_H > > +enum vtype; > struct buf; > struct cg; > struct fid; > This is not valid C code. For some reason GCC allows it (with our compilation flags). Stefan From owner-svn-src-head@FreeBSD.ORG Thu Jun 16 06:54:31 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 581AF1065674; Thu, 16 Jun 2011 06:54:31 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-yw0-f54.google.com (mail-yw0-f54.google.com [209.85.213.54]) by mx1.freebsd.org (Postfix) with ESMTP id DDD9F8FC15; Thu, 16 Jun 2011 06:54:30 +0000 (UTC) Received: by ywf7 with SMTP id 7so907115ywf.13 for ; Wed, 15 Jun 2011 23:54:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=69/OlhL3zI0Bfl/2GTMjVxw8xbROnXpw2VUZgHZHdac=; b=jt19DxnvULXRxM8lDtJfH3DSy6JUrV4z4n8np68vS6cU0jIjYhLs+uPWQ7sDBOaNnj n5sSTZD10xMlF0+xuy+j+tjdqfZ78i2WJ5w3F+7X1L9rDOrBQzBl0RtEBpEJKJUe19qi F030WmI3mElfDhw2zyjC+qrMdUtJDftvr+NuU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=o1+jDjeddWN5uUW5DMBE32M2tBGN4OrFAhV5NSc/DHRwtANpeFMxbzvk2ZAIHo0MUT yykO93EYreRu8UYunz8GIhYVvu2jL1PDNekuG4ndP08Mgb5aBCoxg1y4vbbunAyzY117 iqBeJu5///L5s3A4q6Ar7swjOBpIwQQPjLTy8= MIME-Version: 1.0 Received: by 10.236.111.20 with SMTP id v20mr741036yhg.423.1308207270044; Wed, 15 Jun 2011 23:54:30 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.236.110.141 with HTTP; Wed, 15 Jun 2011 23:54:30 -0700 (PDT) In-Reply-To: <201106160222.p5G2MOrQ008203@svn.freebsd.org> References: <201106160222.p5G2MOrQ008203@svn.freebsd.org> Date: Thu, 16 Jun 2011 08:54:30 +0200 X-Google-Sender-Auth: qZ2BG0EuRHJp6xPxUA9jDLkr1PI Message-ID: From: Attilio Rao To: David Xu Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: base64 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223136 - head/lib/libc/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2011 06:54:31 -0000 VGhhbmtzIGZvciBmaXhpbmcgdGhpcyBndXlzLgoKQXR0aWxpbwoKMjAxMS82LzE2IERhdmlkIFh1 IDxkYXZpZHh1QGZyZWVic2Qub3JnPjoKPiBBdXRob3I6IGRhdmlkeHUKPiBEYXRlOiBUaHUgSnVu IDE2IDAyOjIyOjI0IDIwMTEKPiBOZXcgUmV2aXNpb246IDIyMzEzNgo+IFVSTDogaHR0cDovL3N2 bi5mcmVlYnNkLm9yZy9jaGFuZ2VzZXQvYmFzZS8yMjMxMzYKPgo+IExvZzoKPiDCoFVzZSBzaXpl IG9mIGludCB0byBmZXRjaCBzeXNjdGwga2Vybi5zY2hlZC5jcHVzZXRzaXplIGJlY2F1c2UgaXQg aGFkCj4gwqBzd2l0Y2hlZCBmcm9tIGxvbmcgdG8gaW50IHR5cGUgaW4ga2VybmVsLgo+Cj4gwqBG aXhlZCBieTogcGx1a25ldAo+Cj4gTW9kaWZpZWQ6Cj4gwqBoZWFkL2xpYi9saWJjL2dlbi9zeXNj b25mLmMKPgo+IE1vZGlmaWVkOiBoZWFkL2xpYi9saWJjL2dlbi9zeXNjb25mLmMKPiA9PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT0KPiAtLS0gaGVhZC9saWIvbGliYy9nZW4vc3lzY29uZi5jIFRodSBKdW4g MTYgMDI6MTY6NTMgMjAxMSDCoCDCoCDCoCDCoChyMjIzMTM1KQo+ICsrKyBoZWFkL2xpYi9saWJj L2dlbi9zeXNjb25mLmMgVGh1IEp1biAxNiAwMjoyMjoyNCAyMDExIMKgIMKgIMKgIMKgKHIyMjMx MzYpCj4gQEAgLTU5OSwxMSArNTk5LDExIEBAIHllc25vOgo+Cj4gwqAjaWZkZWYgX1NDX0NQVVNF VF9TSVpFCj4gwqAgwqAgwqAgwqBjYXNlIF9TQ19DUFVTRVRfU0laRToKPiAtIMKgIMKgIMKgIMKg IMKgIMKgIMKgIGxlbiA9IHNpemVvZihsdmFsdWUpOwo+IC0gwqAgwqAgwqAgwqAgwqAgwqAgwqAg aWYgKHN5c2N0bGJ5bmFtZSgia2Vybi5zY2hlZC5jcHVzZXRzaXplIiwgJmx2YWx1ZSwgJmxlbiwg TlVMTCwKPiArIMKgIMKgIMKgIMKgIMKgIMKgIMKgIGxlbiA9IHNpemVvZih2YWx1ZSk7Cj4gKyDC oCDCoCDCoCDCoCDCoCDCoCDCoCBpZiAoc3lzY3RsYnluYW1lKCJrZXJuLnNjaGVkLmNwdXNldHNp emUiLCAmdmFsdWUsICZsZW4sIE5VTEwsCj4gwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAw KSA9PSAtMSkKPiDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoHJldHVybiAoLTEp Owo+IC0gwqAgwqAgwqAgwqAgwqAgwqAgwqAgcmV0dXJuIChsdmFsdWUpOwo+ICsgwqAgwqAgwqAg wqAgwqAgwqAgwqAgcmV0dXJuICgobG9uZyl2YWx1ZSk7Cj4gwqAjZW5kaWYKPgo+IMKgIMKgIMKg IMKgZGVmYXVsdDoKPgoKCgotLSAKUGVhY2UgY2FuIG9ubHkgYmUgYWNoaWV2ZWQgYnkgdW5kZXJz dGFuZGluZyAtIEEuIEVpbnN0ZWluCg== From owner-svn-src-head@FreeBSD.ORG Thu Jun 16 07:05:57 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E0D4A106566C; Thu, 16 Jun 2011 07:05:57 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com [209.85.216.54]) by mx1.freebsd.org (Postfix) with ESMTP id 661308FC08; Thu, 16 Jun 2011 07:05:57 +0000 (UTC) Received: by qwc9 with SMTP id 9so794220qwc.13 for ; Thu, 16 Jun 2011 00:05:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=O/PDEYf5Gmq2d9PX4zc1bT+Sq/0G1JFQkMLMe6Gju/8=; b=SExDlvGh4dY8RGjhiiBTA2FOG65zaTU4GmJPm9WQiXAv647XAXza0XISok9QI9oEYb 4lhavY/FIgotjhDcHRApwRwL/GDIizelyE61jMobdSGwDYefBLDUWTAxu6IPpehUDrHE SCNyueWJn5L+tEwWyrUoq8ejWwRBGSE0dsjnc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=EJnmlJKytSGERcuWysvRmOics1H3xJb3pX/PqLVGriotbTTynrPDm0wEAnPlXwIEc/ MpyoyPcC9xmPDofB35n57VTzy5FxMXn1QG9C2Lttkn75Hx5Zlo2A8RfUGVN541+uaREV +Rzdg3YuqhxXjj/t4nG9qlmrs4gKfD1jCq/Ro= MIME-Version: 1.0 Received: by 10.229.35.1 with SMTP id n1mr432360qcd.84.1308207956664; Thu, 16 Jun 2011 00:05:56 -0700 (PDT) Sender: pluknet@gmail.com Received: by 10.229.99.197 with HTTP; Thu, 16 Jun 2011 00:05:56 -0700 (PDT) In-Reply-To: <201106160222.p5G2MOrQ008203@svn.freebsd.org> References: <201106160222.p5G2MOrQ008203@svn.freebsd.org> Date: Thu, 16 Jun 2011 11:05:56 +0400 X-Google-Sender-Auth: nWt26jNtGEhpn4SLLZhKK6sJPq8 Message-ID: From: Sergey Kandaurov To: David Xu Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223136 - head/lib/libc/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2011 07:05:58 -0000 On 16 June 2011 06:22, David Xu wrote: > Author: davidxu > Date: Thu Jun 16 02:22:24 2011 > New Revision: 223136 > URL: http://svn.freebsd.org/changeset/base/223136 > > Log: > =A0Use size of int to fetch sysctl kern.sched.cpusetsize because it had > =A0switched from long to int type in kernel. > > =A0Fixed by: pluknet > > Modified: > =A0head/lib/libc/gen/sysconf.c > > Modified: head/lib/libc/gen/sysconf.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/lib/libc/gen/sysconf.c Thu Jun 16 02:16:53 2011 =A0 =A0 =A0 =A0(= r223135) > +++ head/lib/libc/gen/sysconf.c Thu Jun 16 02:22:24 2011 =A0 =A0 =A0 =A0(= r223136) > @@ -599,11 +599,11 @@ yesno: > > =A0#ifdef _SC_CPUSET_SIZE > =A0 =A0 =A0 =A0case _SC_CPUSET_SIZE: > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 len =3D sizeof(lvalue); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (sysctlbyname("kern.sched.cpusetsize", &= lvalue, &len, NULL, > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 len =3D sizeof(value); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (sysctlbyname("kern.sched.cpusetsize", &= value, &len, NULL, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A00) =3D=3D -1) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return (-1); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (lvalue); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 return ((long)value); > =A0#endif > > =A0 =A0 =A0 =A0default: > Thanks! --=20 wbr, pluknet From owner-svn-src-head@FreeBSD.ORG Thu Jun 16 07:14:56 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E751106566C; Thu, 16 Jun 2011 07:14:56 +0000 (UTC) (envelope-from avatar@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D8CD68FC14; Thu, 16 Jun 2011 07:14:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5G7EtMv017114; Thu, 16 Jun 2011 07:14:55 GMT (envelope-from avatar@svn.freebsd.org) Received: (from avatar@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5G7Etfx017112; Thu, 16 Jun 2011 07:14:55 GMT (envelope-from avatar@svn.freebsd.org) Message-Id: <201106160714.p5G7Etfx017112@svn.freebsd.org> From: Tai-hwa Liang Date: Thu, 16 Jun 2011 07:14:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223139 - head/lib/libstand X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2011 07:14:56 -0000 Author: avatar Date: Thu Jun 16 07:14:55 2011 New Revision: 223139 URL: http://svn.freebsd.org/changeset/base/223139 Log: Unbreaking build on sparc64. Submitted by: Garrett Cooper Modified: head/lib/libstand/zalloc.c Modified: head/lib/libstand/zalloc.c ============================================================================== --- head/lib/libstand/zalloc.c Thu Jun 16 05:26:03 2011 (r223138) +++ head/lib/libstand/zalloc.c Thu Jun 16 07:14:55 2011 (r223139) @@ -154,7 +154,7 @@ zfree(MemPool *mp, void *ptr, iaddr_t by if ((char *)ptr < (char *)mp->mp_Base || (char *)ptr + bytes > (char *)mp->mp_End || ((iaddr_t)ptr & MEMNODE_SIZE_MASK) != 0) - panic("zfree(%p,%d): wild pointer", ptr, bytes); + panic("zfree(%p,%ju): wild pointer", ptr, bytes); /* * free the segment @@ -178,7 +178,7 @@ zfree(MemPool *mp, void *ptr, iaddr_t by * range check */ if ((char *)ptr + bytes > (char *)mn) - panic("zfree(%p,%d): corrupt memlist1",ptr, bytes); + panic("zfree(%p,%ju): corrupt memlist1",ptr, bytes); /* * merge against next area or create independant area @@ -209,7 +209,7 @@ zfree(MemPool *mp, void *ptr, iaddr_t by /* NOT REACHED */ } if ((char *)ptr < (char *)mn + mn->mr_Bytes) - panic("zfree(%p,%d): corrupt memlist2", ptr, bytes); + panic("zfree(%p,%ju): corrupt memlist2", ptr, bytes); } /* * We are beyond the last MemNode, append new MemNode. Merge against From owner-svn-src-head@FreeBSD.ORG Thu Jun 16 07:19:03 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 45C301065673; Thu, 16 Jun 2011 07:19:03 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-vx0-f182.google.com (mail-vx0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id B07478FC1B; Thu, 16 Jun 2011 07:19:02 +0000 (UTC) Received: by vxc34 with SMTP id 34so1329119vxc.13 for ; Thu, 16 Jun 2011 00:19:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=/EhxNhW3LXQtUw5ghNz9tWip8KYLsEpxLuPoTfvBHQU=; b=VkkoufB09PTH4Ct3djvrLCtPxEqkffTFqsVhs4vMMePoqNnLL20xtF/a8gg37zJW/N lNPbFvbR96iYHy2W+b5yKEnNTsSLITmTRoii1iNq2E7cZr+a9ABiUjVBDjuqEraCj++P rMy/6oBhlhlb+fFM0mFJNtQopDE39tlXLNClw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=xV7mHhzJsQz2HGeb6lvSVFyRCXzBJCKS2rlppNPUojpVPKz+15fb/lnZB5NCAXpfsF OEMj1ZMFb/ZFaWrg9BxnvoivHrcVFBvko1/gFLEm1vKgKWQ0boNRGGU8fhv9+JTQAxs0 tyrwI3waTHwHDsSEz5+YJQuC07akoFEIRRGuY= MIME-Version: 1.0 Received: by 10.220.210.69 with SMTP id gj5mr217725vcb.58.1308208741687; Thu, 16 Jun 2011 00:19:01 -0700 (PDT) Received: by 10.220.189.202 with HTTP; Thu, 16 Jun 2011 00:19:01 -0700 (PDT) In-Reply-To: <201106160714.p5G7Etfx017112@svn.freebsd.org> References: <201106160714.p5G7Etfx017112@svn.freebsd.org> Date: Thu, 16 Jun 2011 00:19:01 -0700 Message-ID: From: Garrett Cooper To: Tai-hwa Liang Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223139 - head/lib/libstand X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2011 07:19:03 -0000 On Thu, Jun 16, 2011 at 12:14 AM, Tai-hwa Liang wrote: > Author: avatar > Date: Thu Jun 16 07:14:55 2011 > New Revision: 223139 > URL: http://svn.freebsd.org/changeset/base/223139 > > Log: > =A0Unbreaking build on sparc64. > > =A0Submitted by: Garrett Cooper > > Modified: > =A0head/lib/libstand/zalloc.c > > Modified: head/lib/libstand/zalloc.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/lib/libstand/zalloc.c =A0Thu Jun 16 05:26:03 2011 =A0 =A0 =A0 = =A0(r223138) > +++ head/lib/libstand/zalloc.c =A0Thu Jun 16 07:14:55 2011 =A0 =A0 =A0 = =A0(r223139) > @@ -154,7 +154,7 @@ zfree(MemPool *mp, void *ptr, iaddr_t by > =A0 =A0 if ((char *)ptr < (char *)mp->mp_Base || > =A0 =A0 =A0 =A0(char *)ptr + bytes > (char *)mp->mp_End || > =A0 =A0 =A0 =A0((iaddr_t)ptr & MEMNODE_SIZE_MASK) !=3D 0) > - =A0 =A0 =A0 panic("zfree(%p,%d): wild pointer", ptr, bytes); > + =A0 =A0 =A0 panic("zfree(%p,%ju): wild pointer", ptr, bytes); All of those need to be cast to (uintmax_t). Sorry :(.. -Garrett From owner-svn-src-head@FreeBSD.ORG Thu Jun 16 07:22:21 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 123A2106564A; Thu, 16 Jun 2011 07:22:21 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 83FFD8FC0A; Thu, 16 Jun 2011 07:22:20 +0000 (UTC) Received: by vws18 with SMTP id 18so1336813vws.13 for ; Thu, 16 Jun 2011 00:22:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=Seza2/EW2OmUMtiF99qrc0g6KEPQhdfms/qp2kr1rmY=; b=ZhUu0cYOqAs9mcwb+G7JRKglwUZeNdwGMDv1gpGFjmVIK4mSBRlW+xfpVuoNB5JRXJ 2dIz2ghDdchLbzw6LTByMX71OHuuyrpInUIZ6ngBEZs9IBEZXGluMGwQqDLoKzzoiFkh /xDYOlQAX1SAMZzWbRR/IWzf5kpx8UQU5oDq4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=U5FBZl8rmaIBilijVOaL+yWaSUoWzGnfZ/4b6zYbeK410ReK1zyiNY79tOKagrVDNC f9IkzYduSQiZn9iZsdPUeMiOT9wUX3cbm/1xU8nINau38sT/7uA8ZBa4X64/enS1borK qN0zMaAO+P2w4cRWwIEyyDy0bs2mzJqkLwvZE= MIME-Version: 1.0 Received: by 10.220.177.9 with SMTP id bg9mr212541vcb.93.1308208939806; Thu, 16 Jun 2011 00:22:19 -0700 (PDT) Received: by 10.220.189.202 with HTTP; Thu, 16 Jun 2011 00:22:19 -0700 (PDT) In-Reply-To: References: <201106160714.p5G7Etfx017112@svn.freebsd.org> Date: Thu, 16 Jun 2011 00:22:19 -0700 Message-ID: From: Garrett Cooper To: Tai-hwa Liang Content-Type: multipart/mixed; boundary=90e6ba4fc6102630e004a5cf21cb Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223139 - head/lib/libstand X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2011 07:22:21 -0000 --90e6ba4fc6102630e004a5cf21cb Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Thu, Jun 16, 2011 at 12:19 AM, Garrett Cooper wrote= : > On Thu, Jun 16, 2011 at 12:14 AM, Tai-hwa Liang wrot= e: >> Author: avatar >> Date: Thu Jun 16 07:14:55 2011 >> New Revision: 223139 >> URL: http://svn.freebsd.org/changeset/base/223139 >> >> Log: >> =A0Unbreaking build on sparc64. >> >> =A0Submitted by: Garrett Cooper >> >> Modified: >> =A0head/lib/libstand/zalloc.c >> >> Modified: head/lib/libstand/zalloc.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/lib/libstand/zalloc.c =A0Thu Jun 16 05:26:03 2011 =A0 =A0 =A0 = =A0(r223138) >> +++ head/lib/libstand/zalloc.c =A0Thu Jun 16 07:14:55 2011 =A0 =A0 =A0 = =A0(r223139) >> @@ -154,7 +154,7 @@ zfree(MemPool *mp, void *ptr, iaddr_t by >> =A0 =A0 if ((char *)ptr < (char *)mp->mp_Base || >> =A0 =A0 =A0 =A0(char *)ptr + bytes > (char *)mp->mp_End || >> =A0 =A0 =A0 =A0((iaddr_t)ptr & MEMNODE_SIZE_MASK) !=3D 0) >> - =A0 =A0 =A0 panic("zfree(%p,%d): wild pointer", ptr, bytes); >> + =A0 =A0 =A0 panic("zfree(%p,%ju): wild pointer", ptr, bytes); > > All of those need to be cast to (uintmax_t). Sorry :(.. And you need to add #include to stand.h in order to get uintmax_t. Here's a proper patch for amd64.. Let me run this through make universe first though.. Thanks, -Garrett --90e6ba4fc6102630e004a5cf21cb Content-Type: text/x-patch; charset=US-ASCII; name="unbreak-libstand-zalloc-compile-take2.patch" Content-Disposition: attachment; filename="unbreak-libstand-zalloc-compile-take2.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_gozds20h0 SW5kZXg6IGxpYi9saWJzdGFuZC96YWxsb2MuYwo9PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBsaWIvbGlic3RhbmQv emFsbG9jLmMJKHJldmlzaW9uIDIyMzE0MCkKKysrIGxpYi9saWJzdGFuZC96YWxsb2MuYwkod29y a2luZyBjb3B5KQpAQCAtMTU0LDcgKzE1NCw3IEBACiAgICAgaWYgKChjaGFyICopcHRyIDwgKGNo YXIgKiltcC0+bXBfQmFzZSB8fCAKIAkoY2hhciAqKXB0ciArIGJ5dGVzID4gKGNoYXIgKiltcC0+ bXBfRW5kIHx8CiAJKChpYWRkcl90KXB0ciAmIE1FTU5PREVfU0laRV9NQVNLKSAhPSAwKQotCXBh bmljKCJ6ZnJlZSglcCwlanUpOiB3aWxkIHBvaW50ZXIiLCBwdHIsIGJ5dGVzKTsKKwlwYW5pYygi emZyZWUoJXAsJWp1KTogd2lsZCBwb2ludGVyIiwgcHRyLCAodWludG1heF90KWJ5dGVzKTsKIAog ICAgIC8qCiAgICAgICogZnJlZSB0aGUgc2VnbWVudApAQCAtMTc4LDcgKzE3OCw4IEBACiAJCSAq IHJhbmdlIGNoZWNrCiAJCSAqLwogCQlpZiAoKGNoYXIgKilwdHIgKyBieXRlcyA+IChjaGFyICop bW4pCi0JCSAgICBwYW5pYygiemZyZWUoJXAsJWp1KTogY29ycnVwdCBtZW1saXN0MSIscHRyLCBi eXRlcyk7CisJCSAgICBwYW5pYygiemZyZWUoJXAsJWp1KTogY29ycnVwdCBtZW1saXN0MSIsIHB0 ciwKKwkJICAgICAgICAodWludG1heF90KWJ5dGVzKTsKIAogCQkvKgogCQkgKiBtZXJnZSBhZ2Fp bnN0IG5leHQgYXJlYSBvciBjcmVhdGUgaW5kZXBlbmRhbnQgYXJlYQpAQCAtMjA5LDcgKzIxMCw4 IEBACiAJCS8qIE5PVCBSRUFDSEVEICovCiAJICAgIH0KIAkgICAgaWYgKChjaGFyICopcHRyIDwg KGNoYXIgKiltbiArIG1uLT5tcl9CeXRlcykKLQkJcGFuaWMoInpmcmVlKCVwLCVqdSk6IGNvcnJ1 cHQgbWVtbGlzdDIiLCBwdHIsIGJ5dGVzKTsKKwkJcGFuaWMoInpmcmVlKCVwLCVqdSk6IGNvcnJ1 cHQgbWVtbGlzdDIiLCBwdHIsCisJCSAgICAodWludG1heF90KWJ5dGVzKTsKIAl9CiAJLyoKIAkg KiBXZSBhcmUgYmV5b25kIHRoZSBsYXN0IE1lbU5vZGUsIGFwcGVuZCBuZXcgTWVtTm9kZS4gIE1l cmdlIGFnYWluc3QKSW5kZXg6IGxpYi9saWJzdGFuZC9zdGFuZC5oCj09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIGxp Yi9saWJzdGFuZC9zdGFuZC5oCShyZXZpc2lvbiAyMjMxNDApCisrKyBsaWIvbGlic3RhbmQvc3Rh bmQuaAkod29ya2luZyBjb3B5KQpAQCAtNjUsNiArNjUsNyBAQAogI2luY2x1ZGUgPHN5cy9jZGVm cy5oPgogI2luY2x1ZGUgPHN5cy9zdGF0Lmg+CiAjaW5jbHVkZSA8c3lzL2RpcmVudC5oPgorI2lu Y2x1ZGUgPHN0ZGludC5oPgogI2luY2x1ZGUgPHN0cmluZy5oPgogCiAjZGVmaW5lIENISyhmbXQs IGFyZ3MuLi4pCXByaW50ZigiJXMoJWQpOiAiIGZtdCAiXG4iLCBfX2Z1bmNfXywgX19MSU5FX18g LCAjI2FyZ3MpCg== --90e6ba4fc6102630e004a5cf21cb-- From owner-svn-src-head@FreeBSD.ORG Thu Jun 16 07:58:20 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 88A94106564A; Thu, 16 Jun 2011 07:58:20 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail01.syd.optusnet.com.au (mail01.syd.optusnet.com.au [211.29.132.182]) by mx1.freebsd.org (Postfix) with ESMTP id F05928FC16; Thu, 16 Jun 2011 07:58:19 +0000 (UTC) Received: from c122-106-165-191.carlnfd1.nsw.optusnet.com.au (c122-106-165-191.carlnfd1.nsw.optusnet.com.au [122.106.165.191]) by mail01.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p5G7wFeh022778 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 16 Jun 2011 17:58:16 +1000 Date: Thu, 16 Jun 2011 17:58:15 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Stefan Farfeleder In-Reply-To: <20110616065310.GA2542@mole.fafoe.narf.at> Message-ID: <20110616175314.R935@besplex.bde.org> References: <201106160526.p5G5Q3RX013915@svn.freebsd.org> <20110616065310.GA2542@mole.fafoe.narf.at> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Tai-hwa Liang , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223138 - head/sys/ufs/ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2011 07:58:20 -0000 On Thu, 16 Jun 2011, Stefan Farfeleder wrote: >> Log: >> Fixing compilation bustage by introducing another forward declaration. >> >> Modified: >> head/sys/ufs/ffs/ffs_extern.h >> >> Modified: head/sys/ufs/ffs/ffs_extern.h >> ============================================================================== >> --- head/sys/ufs/ffs/ffs_extern.h Thu Jun 16 02:27:05 2011 (r223137) >> +++ head/sys/ufs/ffs/ffs_extern.h Thu Jun 16 05:26:03 2011 (r223138) >> @@ -33,6 +33,7 @@ >> #ifndef _UFS_FFS_EXTERN_H >> #define _UFS_FFS_EXTERN_H >> >> +enum vtype; >> struct buf; >> struct cg; >> struct fid; This might unsort the declarations (it isn't clear if the declarations should be sorted on tag name or keyword name). > This is not valid C code. For some reason GCC allows it (with our > compilation flags). This is a bug in gcc-4.2.1. gcc-3.3.3 generates a warning for it even with no compilation flags, while gcc-4.2.1 doesn't generate a warning even with -Wall -std-c99. It takes -pedantic to generate the warning with gcc-4.2.1. TenDRA of course generates an error. It might be a style bug (like typedefing a struct) to use enums for anything. They are impossible to declare opaquely. Bruce From owner-svn-src-head@FreeBSD.ORG Thu Jun 16 08:16:51 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E56B7106566C; Thu, 16 Jun 2011 08:16:51 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail02.syd.optusnet.com.au (mail02.syd.optusnet.com.au [211.29.132.183]) by mx1.freebsd.org (Postfix) with ESMTP id 7F7938FC19; Thu, 16 Jun 2011 08:16:50 +0000 (UTC) Received: from c122-106-165-191.carlnfd1.nsw.optusnet.com.au (c122-106-165-191.carlnfd1.nsw.optusnet.com.au [122.106.165.191]) by mail02.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p5G8Gl93009601 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 16 Jun 2011 18:16:48 +1000 Date: Thu, 16 Jun 2011 18:16:47 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Garrett Cooper In-Reply-To: Message-ID: <20110616180803.D1005@besplex.bde.org> References: <201106160714.p5G7Etfx017112@svn.freebsd.org> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-2089999118-1308212207=:1005" Cc: Tai-hwa Liang , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223139 - head/lib/libstand X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2011 08:16:52 -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-2089999118-1308212207=:1005 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE On Thu, 16 Jun 2011, Garrett Cooper wrote: > On Thu, Jun 16, 2011 at 12:19 AM, Garrett Cooper wro= te: >> On Thu, Jun 16, 2011 at 12:14 AM, Tai-hwa Liang wro= te: >>> Author: avatar >>> Date: Thu Jun 16 07:14:55 2011 >>> New Revision: 223139 >>> URL: http://svn.freebsd.org/changeset/base/223139 >>> >>> Log: >>> =A0Unbreaking build on sparc64. Why not fix it on all arches? This seems to break it on all 32-bit arches. >>> =A0Submitted by: Garrett Cooper >>> >>> Modified: >>> =A0head/lib/libstand/zalloc.c >>> >>> Modified: head/lib/libstand/zalloc.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/lib/libstand/zalloc.c =A0Thu Jun 16 05:26:03 2011 =A0 =A0 =A0 = =A0(r223138) >>> +++ head/lib/libstand/zalloc.c =A0Thu Jun 16 07:14:55 2011 =A0 =A0 =A0 = =A0(r223139) >>> @@ -154,7 +154,7 @@ zfree(MemPool *mp, void *ptr, iaddr_t by >>> =A0 =A0 if ((char *)ptr < (char *)mp->mp_Base || >>> =A0 =A0 =A0 =A0(char *)ptr + bytes > (char *)mp->mp_End || >>> =A0 =A0 =A0 =A0((iaddr_t)ptr & MEMNODE_SIZE_MASK) !=3D 0) >>> - =A0 =A0 =A0 panic("zfree(%p,%d): wild pointer", ptr, bytes); >>> + =A0 =A0 =A0 panic("zfree(%p,%ju): wild pointer", ptr, bytes); >> >> All of those need to be cast to (uintmax_t). Sorry :(.. Indeed. There is no format letter for intptr_t, and perhaps iaddr_t is supposed to be opaque anyway. > And you need to add #include to stand.h in order to get > uintmax_t. Here's a proper patch for amd64.. This would add namespace pollution. stand.h doesn't use anything in . It depends on normal namespace pollution in an XXX section in for the declaration of uintptr_t. It and other headers should use __uintptr_t instead. Strangely, declares uintptr_t but not uintmax_t. Bruce --0-2089999118-1308212207=:1005-- From owner-svn-src-head@FreeBSD.ORG Thu Jun 16 08:31:07 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D9821065673; Thu, 16 Jun 2011 08:31:07 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F2E8B8FC1A; Thu, 16 Jun 2011 08:31:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5G8V6Vv019610; Thu, 16 Jun 2011 08:31:06 GMT (envelope-from sobomax@svn.freebsd.org) Received: (from sobomax@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5G8V63X019608; Thu, 16 Jun 2011 08:31:06 GMT (envelope-from sobomax@svn.freebsd.org) Message-Id: <201106160831.p5G8V63X019608@svn.freebsd.org> From: Maxim Sobolev Date: Thu, 16 Jun 2011 08:31:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223143 - head/sbin/hastd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2011 08:31:07 -0000 Author: sobomax Date: Thu Jun 16 08:31:06 2011 New Revision: 223143 URL: http://svn.freebsd.org/changeset/base/223143 Log: Revert r222688. Requested by: Mikolaj Golub Modified: head/sbin/hastd/proto_common.c Modified: head/sbin/hastd/proto_common.c ============================================================================== --- head/sbin/hastd/proto_common.c Thu Jun 16 07:27:13 2011 (r223142) +++ head/sbin/hastd/proto_common.c Thu Jun 16 08:31:06 2011 (r223143) @@ -194,8 +194,6 @@ int proto_common_recv(int sock, unsigned char *data, size_t size, int *fdp) { ssize_t done; - size_t total_done, recvsize; - unsigned char *dp; PJDLOG_ASSERT(sock >= 0); @@ -212,19 +210,9 @@ proto_common_recv(int sock, unsigned cha PJDLOG_ASSERT(data != NULL); PJDLOG_ASSERT(size > 0); - total_done = 0; - dp = data; do { - recvsize = size - total_done; - recvsize = recvsize < MAX_SEND_SIZE ? recvsize : MAX_SEND_SIZE; - done = recv(sock, dp, recvsize, MSG_WAITALL); - if (done == -1 && errno == EINTR) - continue; - if (done <= 0) - break; - total_done += done; - dp += done; - } while (total_done < size); + done = recv(sock, data, size, MSG_WAITALL); + } while (done == -1 && errno == EINTR); if (done == 0) { return (ENOTCONN); } else if (done < 0) { From owner-svn-src-head@FreeBSD.ORG Thu Jun 16 09:37:20 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A0B58106566C; Thu, 16 Jun 2011 09:37:20 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9177F8FC12; Thu, 16 Jun 2011 09:37:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5G9bKCk021960; Thu, 16 Jun 2011 09:37:20 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5G9bKmr021956; Thu, 16 Jun 2011 09:37:20 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201106160937.p5G9bKmr021956@svn.freebsd.org> From: Kevin Lo Date: Thu, 16 Jun 2011 09:37:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223145 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2011 09:37:20 -0000 Author: kevlo Date: Thu Jun 16 09:37:20 2011 New Revision: 223145 URL: http://svn.freebsd.org/changeset/base/223145 Log: Change i_len in ieee80211req to be unsigned and fix other signed/unsigned issues. Reviewed by: bschmidt Obtained from: NetBSD Modified: head/sys/net80211/ieee80211_acl.c head/sys/net80211/ieee80211_ioctl.c head/sys/net80211/ieee80211_ioctl.h Modified: head/sys/net80211/ieee80211_acl.c ============================================================================== --- head/sys/net80211/ieee80211_acl.c Thu Jun 16 08:44:26 2011 (r223144) +++ head/sys/net80211/ieee80211_acl.c Thu Jun 16 09:37:20 2011 (r223145) @@ -77,7 +77,7 @@ struct acl { struct aclstate { acl_lock_t as_lock; int as_policy; - int as_nacls; + uint32_t as_nacls; TAILQ_HEAD(, acl) as_list; /* list of all ACL's */ LIST_HEAD(, acl) as_hash[ACL_HASHSIZE]; struct ieee80211vap *as_vap; @@ -289,7 +289,8 @@ acl_getioctl(struct ieee80211vap *vap, s struct aclstate *as = vap->iv_as; struct acl *acl; struct ieee80211req_maclist *ap; - int error, space, i; + int error; + uint32_t i, space; switch (ireq->i_val) { case IEEE80211_MACCMD_POLICY: Modified: head/sys/net80211/ieee80211_ioctl.c ============================================================================== --- head/sys/net80211/ieee80211_ioctl.c Thu Jun 16 08:44:26 2011 (r223144) +++ head/sys/net80211/ieee80211_ioctl.c Thu Jun 16 09:37:20 2011 (r223145) @@ -143,7 +143,7 @@ static __noinline int ieee80211_ioctl_getchaninfo(struct ieee80211vap *vap, struct ieee80211req *ireq) { struct ieee80211com *ic = vap->iv_ic; - int space; + uint32_t space; space = __offsetof(struct ieee80211req_chaninfo, ic_chans[ic->ic_nchans]); @@ -207,7 +207,7 @@ ieee80211_ioctl_getstastats(struct ieee8 { struct ieee80211_node *ni; uint8_t macaddr[IEEE80211_ADDR_LEN]; - const int off = __offsetof(struct ieee80211req_sta_stats, is_stats); + const size_t off = __offsetof(struct ieee80211req_sta_stats, is_stats); int error; if (ireq->i_len < off) @@ -323,7 +323,7 @@ ieee80211_ioctl_getscanresults(struct ie if (req.space > ireq->i_len) req.space = ireq->i_len; if (req.space > 0) { - size_t space; + uint32_t space; void *p; space = req.space; @@ -458,7 +458,7 @@ get_sta_info(void *arg, struct ieee80211 static __noinline int getstainfo_common(struct ieee80211vap *vap, struct ieee80211req *ireq, - struct ieee80211_node *ni, int off) + struct ieee80211_node *ni, size_t off) { struct ieee80211com *ic = vap->iv_ic; struct stainforeq req; @@ -503,7 +503,7 @@ static __noinline int ieee80211_ioctl_getstainfo(struct ieee80211vap *vap, struct ieee80211req *ireq) { uint8_t macaddr[IEEE80211_ADDR_LEN]; - const int off = __offsetof(struct ieee80211req_sta_req, info); + const size_t off = __offsetof(struct ieee80211req_sta_req, info); struct ieee80211_node *ni; int error; Modified: head/sys/net80211/ieee80211_ioctl.h ============================================================================== --- head/sys/net80211/ieee80211_ioctl.h Thu Jun 16 08:44:26 2011 (r223144) +++ head/sys/net80211/ieee80211_ioctl.h Thu Jun 16 09:37:20 2011 (r223145) @@ -578,7 +578,7 @@ struct ieee80211req { char i_name[IFNAMSIZ]; /* if_name, e.g. "wi0" */ uint16_t i_type; /* req type */ int16_t i_val; /* Index or simple value */ - int16_t i_len; /* Index or simple value */ + uint16_t i_len; /* Index or simple value */ void *i_data; /* Extra data */ }; #define SIOCS80211 _IOW('i', 234, struct ieee80211req) From owner-svn-src-head@FreeBSD.ORG Thu Jun 16 11:43:17 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DCAD41065678; Thu, 16 Jun 2011 11:43:17 +0000 (UTC) (envelope-from avatar@mmlab.cse.yzu.edu.tw) Received: from www.mmlab.cse.yzu.edu.tw (www.mmlab.cse.yzu.edu.tw [140.138.150.166]) by mx1.freebsd.org (Postfix) with ESMTP id 48F048FC19; Thu, 16 Jun 2011 11:43:17 +0000 (UTC) Received: by www.mmlab.cse.yzu.edu.tw (qmail, from userid 1000) id 5E6B52EC686B; Thu, 16 Jun 2011 19:24:27 +0800 (CST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mmlab.cse.yzu.edu.tw; s=test; t=1308223467; bh=tun5da0OQEXwDzIyw/c/SX+KoMfFhCqWc92OiBosWFg=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References: MIME-Version:Content-Type; b=Ccy3uSNme4OaUfRS0zwJjSmoPk0F63IKkHNiUrcY5kgbZIv79f8aEo9B4cMfFA+Pv XF2LHvbYfWhLxmwiYYB0FiQFVU2IaXVVwV/a8KsKcMdXxUZ23mt9ZgNke376BWjGIe efMSOvUuGdSL5M9cKBT9EL5u8PS83BNzpQgbWMdc= Received: from localhost (localhost [127.0.0.1]) by www.mmlab.cse.yzu.edu.tw (qmail) with ESMTP id 5DEEF2EC6866; Thu, 16 Jun 2011 19:24:27 +0800 (CST) Date: Thu, 16 Jun 2011 19:24:27 +0800 (CST) From: Tai-hwa Liang To: Bruce Evans In-Reply-To: <20110616175314.R935@besplex.bde.org> Message-ID: <1106161923211.44181@www.mmlab.cse.yzu.edu.tw> References: <201106160526.p5G5Q3RX013915@svn.freebsd.org> <20110616065310.GA2542@mole.fafoe.narf.at> <20110616175314.R935@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Tai-hwa Liang , svn-src-head@freebsd.org, svn-src-all@freebsd.org, Stefan Farfeleder , src-committers@freebsd.org Subject: Re: svn commit: r223138 - head/sys/ufs/ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2011 11:43:18 -0000 On Thu, 16 Jun 2011, Bruce Evans wrote: > On Thu, 16 Jun 2011, Stefan Farfeleder wrote: > >>> Log: >>> Fixing compilation bustage by introducing another forward declaration. >>> >>> Modified: >>> head/sys/ufs/ffs/ffs_extern.h >>> >>> Modified: head/sys/ufs/ffs/ffs_extern.h >>> ============================================================================== >>> --- head/sys/ufs/ffs/ffs_extern.h Thu Jun 16 02:27:05 2011 >>> (r223137) >>> +++ head/sys/ufs/ffs/ffs_extern.h Thu Jun 16 05:26:03 2011 >>> (r223138) >>> @@ -33,6 +33,7 @@ >>> #ifndef _UFS_FFS_EXTERN_H >>> #define _UFS_FFS_EXTERN_H >>> >>> +enum vtype; >>> struct buf; >>> struct cg; >>> struct fid; > > This might unsort the declarations (it isn't clear if the declarations > should be sorted on tag name or keyword name). > >> This is not valid C code. For some reason GCC allows it (with our >> compilation flags). > > This is a bug in gcc-4.2.1. gcc-3.3.3 generates a warning for it even > with no compilation flags, while gcc-4.2.1 doesn't generate a warning > even with -Wall -std-c99. It takes -pedantic to generate the warning > with gcc-4.2.1. TenDRA of course generates an error. > > It might be a style bug (like typedefing a struct) to use enums for > anything. They are impossible to declare opaquely. Does that mean we have to #include in userland makefs/ffs/ffs_bswap.c? From owner-svn-src-head@FreeBSD.ORG Thu Jun 16 11:57:29 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 770F8106566C; Thu, 16 Jun 2011 11:57:29 +0000 (UTC) (envelope-from avatar@mmlab.cse.yzu.edu.tw) Received: from www.mmlab.cse.yzu.edu.tw (www.mmlab.cse.yzu.edu.tw [140.138.150.166]) by mx1.freebsd.org (Postfix) with ESMTP id D61A18FC27; Thu, 16 Jun 2011 11:57:28 +0000 (UTC) Received: by www.mmlab.cse.yzu.edu.tw (qmail, from userid 1000) id F14E52EC686B; Thu, 16 Jun 2011 19:57:27 +0800 (CST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mmlab.cse.yzu.edu.tw; s=test; t=1308225448; bh=xOQP7v/8pMku6Zpok4C492cQvgxdyH2mupO3/OGUTXI=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References: MIME-Version:Content-Type; b=hboVk6+YhzgAL47FNtu/jXE/VqlSJsp0B5QOQV9eaL3Y34C5/5Ih3i8gv3NBjbPkc pEyPf6McoheaUHJZf/5z3AdenibOz9On4JZBJ8HuRCNvcKXZtAftfowZr16bERifJA Wlm76J4M8SYjp0yYRICGU/QYEsehvhPdZ6+/iBj0= Received: from localhost (localhost [127.0.0.1]) by www.mmlab.cse.yzu.edu.tw (qmail) with ESMTP id F0C932EC6866; Thu, 16 Jun 2011 19:57:27 +0800 (CST) Date: Thu, 16 Jun 2011 19:57:27 +0800 (CST) From: Tai-hwa Liang To: Bruce Evans In-Reply-To: <20110616180803.D1005@besplex.bde.org> Message-ID: <11061619555315.44181@www.mmlab.cse.yzu.edu.tw> References: <201106160714.p5G7Etfx017112@svn.freebsd.org> <20110616180803.D1005@besplex.bde.org> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="3425325993-407207228-1308225447=:44181" Cc: Garrett Cooper , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223139 - head/lib/libstand X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2011 11:57:29 -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. --3425325993-407207228-1308225447=:44181 Content-Type: TEXT/PLAIN; charset=big5; format=flowed Content-Transfer-Encoding: 8BIT On Thu, 16 Jun 2011, Bruce Evans wrote: > On Thu, 16 Jun 2011, Garrett Cooper wrote: > >> On Thu, Jun 16, 2011 at 12:19 AM, Garrett Cooper >> wrote: >>> On Thu, Jun 16, 2011 at 12:14 AM, Tai-hwa Liang >>> wrote: >>>> Author: avatar >>>> Date: Thu Jun 16 07:14:55 2011 >>>> New Revision: 223139 >>>> URL: http://svn.freebsd.org/changeset/base/223139 >>>> >>>> Log: >>>>  Unbreaking build on sparc64. > > Why not fix it on all arches? This seems to break it on all 32-bit arches. > >>>>  Submitted by: Garrett Cooper >>>> >>>> Modified: >>>>  head/lib/libstand/zalloc.c >>>> >>>> Modified: head/lib/libstand/zalloc.c >>>> ============================================================================== >>>> --- head/lib/libstand/zalloc.c  Thu Jun 16 05:26:03 2011        (r223138) >>>> +++ head/lib/libstand/zalloc.c  Thu Jun 16 07:14:55 2011        (r223139) >>>> @@ -154,7 +154,7 @@ zfree(MemPool *mp, void *ptr, iaddr_t by >>>>     if ((char *)ptr < (char *)mp->mp_Base || >>>>        (char *)ptr + bytes > (char *)mp->mp_End || >>>>        ((iaddr_t)ptr & MEMNODE_SIZE_MASK) != 0) >>>> -       panic("zfree(%p,%d): wild pointer", ptr, bytes); >>>> +       panic("zfree(%p,%ju): wild pointer", ptr, bytes); >>> >>> All of those need to be cast to (uintmax_t). Sorry :(.. > > Indeed. There is no format letter for intptr_t, and perhaps iaddr_t is > supposed to be opaque anyway. > >> And you need to add #include to stand.h in order to get >> uintmax_t. Here's a proper patch for amd64.. > > This would add namespace pollution. stand.h doesn't use anything in > . It depends on normal namespace pollution in an XXX section > in for the declaration of uintptr_t. It and other headers > should use __uintptr_t instead. Strangely, declares > uintptr_t but not uintmax_t. What about casting to __uintmax_t instead? Index: zalloc.c =================================================================== --- zalloc.c (revision 223146) +++ zalloc.c (working copy) @@ -154,7 +154,7 @@ if ((char *)ptr < (char *)mp->mp_Base || (char *)ptr + bytes > (char *)mp->mp_End || ((iaddr_t)ptr & MEMNODE_SIZE_MASK) != 0) - panic("zfree(%p,%ju): wild pointer", ptr, bytes); + panic("zfree(%p,%ju): wild pointer", ptr, (__uintmax_t)bytes); /* * free the segment @@ -177,8 +177,10 @@ /* * range check */ - if ((char *)ptr + bytes > (char *)mn) - panic("zfree(%p,%ju): corrupt memlist1",ptr, bytes); + if ((char *)ptr + bytes > (char *)mn) { + panic("zfree(%p,%ju): corrupt memlist1", ptr, + (__uintmax_t)bytes); + } /* * merge against next area or create independant area @@ -208,8 +210,10 @@ return; /* NOT REACHED */ } - if ((char *)ptr < (char *)mn + mn->mr_Bytes) - panic("zfree(%p,%ju): corrupt memlist2", ptr, bytes); + if ((char *)ptr < (char *)mn + mn->mr_Bytes) { + panic("zfree(%p,%ju): corrupt memlist2", ptr, + (__uintmax_t)bytes); + } } /* * We are beyond the last MemNode, append new MemNode. Merge against --3425325993-407207228-1308225447=:44181-- From owner-svn-src-head@FreeBSD.ORG Thu Jun 16 12:28:37 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE333106564A; Thu, 16 Jun 2011 12:28:37 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ACAEE8FC13; Thu, 16 Jun 2011 12:28:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5GCSbtp029284; Thu, 16 Jun 2011 12:28:37 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5GCSbuw029278; Thu, 16 Jun 2011 12:28:37 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201106161228.p5GCSbuw029278@svn.freebsd.org> From: Ruslan Ermilov Date: Thu, 16 Jun 2011 12:28:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223148 - in head: . share/examples/etc share/man/man5 share/man/man7 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2011 12:28:37 -0000 Author: ru Date: Thu Jun 16 12:28:37 2011 New Revision: 223148 URL: http://svn.freebsd.org/changeset/base/223148 Log: It's a bit odd, but "make update" in src/ can also update the ports/, doc/, and now www/ trees, but only using the "cvsup" transport. When "make update" is run using a tree's makefile, it can also use "cvs" (except for www/) and "svn" (only src/). Clean up documentation and code regarding "make update": - Increase oddness by adding support for WWWSUPFILE and NO_WWWUPDATE to Makefile.inc1 (analogous to PORTSSUPFILE/NO_PORTSUPDATE and DOCSUPFILE/NO_DOCUPDATE; WWWSUPFILE already supported by www/Makefile). - Document all trees that support CVS_UPDATE. - Document all trees that support SUP_UPDATE. - Document SVN_UPDATE. - Document NO_WWWUPDATE. - make.conf(5) mistakenly said that *SUPFILE* had defaults. - Add an example entry for WWWSUPFILE. Modified: head/Makefile head/Makefile.inc1 head/share/examples/etc/make.conf head/share/man/man5/make.conf.5 head/share/man/man7/build.7 Modified: head/Makefile ============================================================================== --- head/Makefile Thu Jun 16 12:24:02 2011 (r223147) +++ head/Makefile Thu Jun 16 12:28:37 2011 (r223148) @@ -19,7 +19,7 @@ # kernel - buildkernel + installkernel. # kernel-toolchain - Builds the subset of world necessary to build a kernel # doxygen - Build API documentation of the kernel, needs doxygen. -# update - Convenient way to update your source tree (cvs). +# update - Convenient way to update your source tree(s). # check-old - List obsolete directories/files/libraries. # check-old-dirs - List obsolete directories. # check-old-files - List obsolete files. Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Jun 16 12:24:02 2011 (r223147) +++ head/Makefile.inc1 Thu Jun 16 12:28:37 2011 (r223148) @@ -12,6 +12,7 @@ # -DNO_KERNELOBJ do not run ${MAKE} obj in ${MAKE} buildkernel # -DNO_PORTSUPDATE do not update ports in ${MAKE} update # -DNO_DOCUPDATE do not update doc in ${MAKE} update +# -DNO_WWWUPDATE do not update www in ${MAKE} update # -DNO_CTF do not run the DTrace CTF conversion tools on built objects # LOCAL_DIRS="list of dirs" to add additional dirs to the SUBDIR list # TARGET="machine" to crossbuild world for a different machine type @@ -904,7 +905,7 @@ doxygen: # # update # -# Update the source tree, by running cvsup and/or running cvs to update to the +# Update the source tree(s), by running cvsup/cvs/svn to update to the # latest copy. # update: @@ -927,6 +928,9 @@ update: .if defined(DOCSUPFILE) && !defined(NO_DOCUPDATE) @${SUP} ${SUPFLAGS} ${DOCSUPFILE} .endif +.if defined(WWWSUPFILE) && !defined(NO_WWWUPDATE) + @${SUP} ${SUPFLAGS} ${WWWSUPFILE} +.endif .endif .if defined(CVS_UPDATE) @cd ${.CURDIR} ; \ Modified: head/share/examples/etc/make.conf ============================================================================== --- head/share/examples/etc/make.conf Thu Jun 16 12:24:02 2011 (r223147) +++ head/share/examples/etc/make.conf Thu Jun 16 12:28:37 2011 (r223148) @@ -188,6 +188,7 @@ #SUPFILE= /usr/share/examples/cvsup/standard-supfile #PORTSSUPFILE= /usr/share/examples/cvsup/ports-supfile #DOCSUPFILE= /usr/share/examples/cvsup/doc-supfile +#WWWSUPFILE= /usr/share/examples/cvsup/www-supfile # # top(1) uses a hash table for the user names. The size of this hash # can be tuned to match the number of local users. The table size should Modified: head/share/man/man5/make.conf.5 ============================================================================== --- head/share/man/man5/make.conf.5 Thu Jun 16 12:24:02 2011 (r223147) +++ head/share/man/man5/make.conf.5 Thu Jun 16 12:28:37 2011 (r223148) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 15, 2009 +.Dd June 16, 2011 .Dt MAKE.CONF 5 .Os .Sh NAME @@ -181,7 +181,11 @@ options. .Pq Vt bool Set this to use .Xr cvs 1 -to update your ports with +to update your +.Pa src , ports +and +.Pa doc +trees with .Dq Li "make update" . .It Va CXXFLAGS .Pq Vt str @@ -202,8 +206,8 @@ The documentation .Ar supfile to use when doing a .Dq Li "make update" . -This defaults to -.Pa /usr/share/examples/cvsup/doc\-supfile . +For example, +.Pa /usr/share/examples/cvsup/doc-supfile . .It Va INSTALL .Pq Vt str the default install command. @@ -259,14 +263,18 @@ Set this to not update the doc tree duri .Pq Vt bool Set this to not update the ports tree during .Dq Li "make update" . +.It Va NO_WWWUPDATE +.Pq Vt bool +Set this to not update the www tree during +.Dq Li "make update" . .It Va PORTSSUPFILE .Pq Vt str The ports .Ar supfile to use when doing a .Dq Li "make update" . -This defaults to -.Pa /usr/share/examples/cvsup/ports\-supfile . +For example, +.Pa /usr/share/examples/cvsup/ports-supfile . .It Va SUP .Pq Vt str The location of the @@ -281,24 +289,20 @@ The first .Ar supfile to use when doing a .Dq Li "make update" . -This defaults to -.Pa /usr/share/examples/cvsup/standard\-supfile . +For example, +.Pa /usr/share/examples/cvsup/standard-supfile . .It Va SUPFILE1 .Pq Vt str The second .Ar supfile to use when doing a .Dq Li "make update" . -This defaults to -.Pa /usr/share/examples/cvsup/secure\-supfile . .It Va SUPFILE2 .Pq Vt str The third .Ar supfile to use when doing a .Dq Li "make update" . -This defaults to -.Pa /usr/share/examples/cvsup/secure\-supfile . .It Va SUPFLAGS .Pq Vt str The flag for the @@ -315,16 +319,28 @@ The hostname of the sup server to use wh .Pq Vt bool Set this to use .Xr cvsup 1 -to update your ports with +to update your +.Pa src , ports , doc +and +.Pa www +trees with +.Dq Li "make update" . +.It Va SVN_UPDATE +.Pq Vt bool +Set this to use +.Xr svn 1 +to update your +.Pa src +tree with .Dq Li "make update" . .It Va WWWSUPFILE .Pq Vt str The www .Ar supfile to use when doing a -.Dq Li "make update" -This defaults to -.Pa /usr/share/examples/cvsup/www\-supfile . +.Dq Li "make update" . +For example, +.Pa /usr/share/examples/cvsup/www-supfile . .El .Ss "BUILDING THE KERNEL" The following list provides a name and short description for variables @@ -730,6 +746,7 @@ filter, or both. .Bl -tag -width ".Pa /usr/share/examples/etc/make.conf" -compact .It Pa /etc/make.conf .It Pa /usr/doc/Makefile +.It Pa /usr/ports/Makefile .It Pa /usr/share/examples/etc/make.conf .It Pa /usr/share/mk/sys.mk .It Pa /usr/src/Makefile Modified: head/share/man/man7/build.7 ============================================================================== --- head/share/man/man7/build.7 Thu Jun 16 12:24:02 2011 (r223147) +++ head/share/man/man7/build.7 Thu Jun 16 12:28:37 2011 (r223148) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 18, 2011 +.Dd June 16, 2011 .Dt BUILD 7 .Os .Sh NAME @@ -517,6 +517,10 @@ target. If set, the update process does not update the Ports tree as part of the .Dq make update target. +.It Va NO_WWWUPDATE +If set, the update process does not update the www tree as part of the +.Dq make update +target. .El .Pp Builds under directory From owner-svn-src-head@FreeBSD.ORG Thu Jun 16 14:06:49 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A09A106564A; Thu, 16 Jun 2011 14:06:49 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail06.syd.optusnet.com.au (mail06.syd.optusnet.com.au [211.29.132.187]) by mx1.freebsd.org (Postfix) with ESMTP id C7DAA8FC13; Thu, 16 Jun 2011 14:06:48 +0000 (UTC) Received: from c122-106-165-191.carlnfd1.nsw.optusnet.com.au (c122-106-165-191.carlnfd1.nsw.optusnet.com.au [122.106.165.191]) by mail06.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p5GE6hF2030993 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 17 Jun 2011 00:06:46 +1000 Date: Fri, 17 Jun 2011 00:06:43 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Tai-hwa Liang In-Reply-To: <11061619555315.44181@www.mmlab.cse.yzu.edu.tw> Message-ID: <20110616235239.D1926@besplex.bde.org> References: <201106160714.p5G7Etfx017112@svn.freebsd.org> <20110616180803.D1005@besplex.bde.org> <11061619555315.44181@www.mmlab.cse.yzu.edu.tw> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Garrett Cooper , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Bruce Evans Subject: Re: svn commit: r223139 - head/lib/libstand X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2011 14:06:49 -0000 On Thu, 16 Jun 2011, Tai-hwa Liang wrote: > On Thu, 16 Jun 2011, Bruce Evans wrote: > >> On Thu, 16 Jun 2011, Garrett Cooper wrote: >>> >>> And you need to add #include to stand.h in order to get >>> uintmax_t. Here's a proper patch for amd64.. >> >> This would add namespace pollution. stand.h doesn't use anything in >> . It depends on normal namespace pollution in an XXX section >> in for the declaration of uintptr_t. It and other headers >> should use __uintptr_t instead. Strangely, declares >> uintptr_t but not uintmax_t. > > What about casting to __uintmax_t instead? > > Index: zalloc.c > =================================================================== > --- zalloc.c (revision 223146) > +++ zalloc.c (working copy) > @@ -154,7 +154,7 @@ > if ((char *)ptr < (char *)mp->mp_Base || > (char *)ptr + bytes > (char *)mp->mp_End || > ((iaddr_t)ptr & MEMNODE_SIZE_MASK) != 0) > - panic("zfree(%p,%ju): wild pointer", ptr, bytes); > + panic("zfree(%p,%ju): wild pointer", ptr, (__uintmax_t)bytes); > ... zalloc.c is not the (header) implementation, so it should not use the implementation detail (anything beginning with __). The latest tinderbox errors for this are hard to understand. For amd64 they say: > /src/lib/libstand/zalloc.c: In function 'zfree': > /src/lib/libstand/zalloc.c:157: warning: format '%ju' expects type 'uintmax_t', but argument 3 has type 'iaddr_t' but amd64 seems to be just like sparc64 -- both seem to declare all the types as `unsigned long' at the lowest level. I would expect all 64-bit arches to do this, although this is logically wrong (it makes the largest integral type uintmax_t logically smaller than the standard bogus type unsigned long long). This logic error is partly intentional (it detects different type mismatches than uintmax_t = `unsigned long long' combined with uint64_t = `unsigned long' would). Bruce From owner-svn-src-head@FreeBSD.ORG Thu Jun 16 14:12:58 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 08201106566C; Thu, 16 Jun 2011 14:12:58 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail03.syd.optusnet.com.au (mail03.syd.optusnet.com.au [211.29.132.184]) by mx1.freebsd.org (Postfix) with ESMTP id 7B2BC8FC26; Thu, 16 Jun 2011 14:12:57 +0000 (UTC) Received: from c122-106-165-191.carlnfd1.nsw.optusnet.com.au (c122-106-165-191.carlnfd1.nsw.optusnet.com.au [122.106.165.191]) by mail03.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p5GECsJk012067 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 17 Jun 2011 00:12:55 +1000 Date: Fri, 17 Jun 2011 00:12:54 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Tai-hwa Liang In-Reply-To: <1106161923211.44181@www.mmlab.cse.yzu.edu.tw> Message-ID: <20110617000654.W1926@besplex.bde.org> References: <201106160526.p5G5Q3RX013915@svn.freebsd.org> <20110616065310.GA2542@mole.fafoe.narf.at> <20110616175314.R935@besplex.bde.org> <1106161923211.44181@www.mmlab.cse.yzu.edu.tw> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org, Stefan Farfeleder , Bruce Evans , Tai-hwa Liang Subject: Re: svn commit: r223138 - head/sys/ufs/ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2011 14:12:58 -0000 On Thu, 16 Jun 2011, Tai-hwa Liang wrote: > On Thu, 16 Jun 2011, Bruce Evans wrote: >> It might be a style bug (like typedefing a struct) to use enums for >> anything. They are impossible to declare opaquely. > > Does that mean we have to #include in userland > makefs/ffs/ffs_bswap.c? It means that you should implement headers properly, so that they don't depend on other headers to begin with or grow dependencies on other headers. Though the should-be-kernel-only header has some parts including `enum vtype' that have already escaped to userland, other headers shouldn't grow dependencies on these. Bruce From owner-svn-src-head@FreeBSD.ORG Thu Jun 16 15:12:28 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 032CC106564A; Thu, 16 Jun 2011 15:12:28 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 7F19B8FC0A; Thu, 16 Jun 2011 15:12:27 +0000 (UTC) Received: by vws18 with SMTP id 18so1756134vws.13 for ; Thu, 16 Jun 2011 08:12:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=PVMj6KjAvYQhaWruv6AeZL8IIXQ95YPtBX/Yui5OUOw=; b=oUIeQEJ7Ps3PBvz5mJ1HAMpLaGHcykdnKjMkVGATgX2kj1tfsGJrdG2hrc0xWhX9hJ 6DQmBw08s5ev++8dFOEuUQ7hEkHy0ZwXMqa6cSixCrcOn+VQX9v3ffY9tVbHjwhHG79U QoedczFK4dnhKpqPYJb2ftjcpxwCq12WW5g/o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=gGEyXK7vCV3sX4AIUNoMGIaxa+QUZY2dvNvHggRmPprbRh83p+uovd1lrfuY/GScvD BK0eOnVnHtK6rTkUV8iDHL3NFH2/DEb4HAvwtMSNeK4ebr0lv5cmxk4EufKn+KRsYkM4 Oy1aIGiPP7Z8dXFpF0YmZUJPNjD5G0/0KRELM= MIME-Version: 1.0 Received: by 10.220.48.136 with SMTP id r8mr21843vcf.93.1308237146606; Thu, 16 Jun 2011 08:12:26 -0700 (PDT) Received: by 10.220.189.202 with HTTP; Thu, 16 Jun 2011 08:12:26 -0700 (PDT) In-Reply-To: <20110616235239.D1926@besplex.bde.org> References: <201106160714.p5G7Etfx017112@svn.freebsd.org> <20110616180803.D1005@besplex.bde.org> <11061619555315.44181@www.mmlab.cse.yzu.edu.tw> <20110616235239.D1926@besplex.bde.org> Date: Thu, 16 Jun 2011 08:12:26 -0700 Message-ID: From: Garrett Cooper To: Bruce Evans Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Tai-hwa Liang , src-committers@freebsd.org Subject: Re: svn commit: r223139 - head/lib/libstand X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2011 15:12:28 -0000 On Thu, Jun 16, 2011 at 7:06 AM, Bruce Evans wrote: > On Thu, 16 Jun 2011, Tai-hwa Liang wrote: > >> On Thu, 16 Jun 2011, Bruce Evans wrote: >> >>> On Thu, 16 Jun 2011, Garrett Cooper wrote: >>>> >>>> And you need to add #include to stand.h in order to get >>>> uintmax_t. Here's a proper patch for amd64.. >>> >>> This would add namespace pollution. =A0stand.h doesn't use anything in >>> . =A0It depends on normal namespace pollution in an XXX secti= on >>> in for the declaration of uintptr_t. =A0It and other head= ers >>> should use __uintptr_t instead. =A0Strangely, declares >>> uintptr_t but not uintmax_t. >> >> =A0What about casting to __uintmax_t instead? >> >> Index: zalloc.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 >> --- zalloc.c =A0 =A0(revision 223146) >> +++ zalloc.c =A0 =A0(working copy) >> @@ -154,7 +154,7 @@ >> =A0 =A0if ((char *)ptr < (char *)mp->mp_Base || >> =A0 =A0 =A0 =A0(char *)ptr + bytes > (char *)mp->mp_End || >> =A0 =A0 =A0 =A0((iaddr_t)ptr & MEMNODE_SIZE_MASK) !=3D 0) >> - =A0 =A0 =A0 panic("zfree(%p,%ju): wild pointer", ptr, bytes); >> + =A0 =A0 =A0 panic("zfree(%p,%ju): wild pointer", ptr, (__uintmax_t)byt= es); >> ... > > zalloc.c is not the (header) implementation, so it should not use the > implementation detail (anything beginning with __). > > The latest tinderbox errors for this are hard to understand. =A0For amd64 > they say: > >> /src/lib/libstand/zalloc.c: In function 'zfree': >> /src/lib/libstand/zalloc.c:157: warning: format '%ju' expects type >> 'uintmax_t', but argument 3 has type 'iaddr_t' > > but amd64 seems to be just like sparc64 -- both seem to declare all the > types as `unsigned long' at the lowest level. =A0I would expect all 64-bi= t > arches to do this, although this is logically wrong (it makes the largest > integral type uintmax_t logically smaller than the standard bogus type > unsigned long long). =A0This logic error is partly intentional (it detect= s > different type mismatches than uintmax_t =3D `unsigned long long' combine= d > with uint64_t =3D `unsigned long' would). My second patch when applied gets one past tinderbox on powerpc.. waiting for powerpc64 and sparc64 to complete. Namespace pollution is one thing, but stdint.h isn't that bad IMHO -- I just find it funny that iaddr_t had to be typedef'ed to uintptr_t in the first place. Thanks! -Garrett From owner-svn-src-head@FreeBSD.ORG Thu Jun 16 15:23:55 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3755E1065687; Thu, 16 Jun 2011 15:23:55 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id A65E38FC19; Thu, 16 Jun 2011 15:23:54 +0000 (UTC) Received: by vws18 with SMTP id 18so1769849vws.13 for ; Thu, 16 Jun 2011 08:23:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=OpM/7Zl6BfLIYht2At9GyZt8We9Rgtxzci9/8x4L38I=; b=kYqvZGj1kU/LKAKhdNTAStnvi5nh0wrX08X96NNLEn+OOa00eRhifxLK8viHVMbWun az0EZ80N0f8bCa4TNyJcJRmLE56ZSB/STSjbaqShouinLpShaj74MZnDrWeQeJOEdeja 2Iz+rQNJe/qUBY6tjpfhfrUX69AehYKeNWFhk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=Hh/6uDf8GwZ3zdBoHKcrvcsYhrOyE9y27vheFBMdjMKjSinWMNNN2Y+pFRKSUzA+h8 vPY7qxIPh/0kNW9xU7hDbJUU2dt8YwSpt36J2G42/wGEOgq1ptzGWlE21aer2Ozh0rUJ vFFgBYkGTN91K/CRHzRXPrPmST5kzprK/6LKU= MIME-Version: 1.0 Received: by 10.220.210.69 with SMTP id gj5mr397098vcb.58.1308237833488; Thu, 16 Jun 2011 08:23:53 -0700 (PDT) Received: by 10.220.189.202 with HTTP; Thu, 16 Jun 2011 08:23:53 -0700 (PDT) In-Reply-To: References: <201106160714.p5G7Etfx017112@svn.freebsd.org> <20110616180803.D1005@besplex.bde.org> <11061619555315.44181@www.mmlab.cse.yzu.edu.tw> <20110616235239.D1926@besplex.bde.org> Date: Thu, 16 Jun 2011 08:23:53 -0700 Message-ID: From: Garrett Cooper To: Bruce Evans Content-Type: multipart/mixed; boundary=0022154700ae58cacb04a5d5dba8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Tai-hwa Liang , src-committers@freebsd.org Subject: Re: svn commit: r223139 - head/lib/libstand X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2011 15:23:55 -0000 --0022154700ae58cacb04a5d5dba8 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Thu, Jun 16, 2011 at 8:12 AM, Garrett Cooper wrote: > On Thu, Jun 16, 2011 at 7:06 AM, Bruce Evans wrote= : >> On Thu, 16 Jun 2011, Tai-hwa Liang wrote: >> >>> On Thu, 16 Jun 2011, Bruce Evans wrote: >>> >>>> On Thu, 16 Jun 2011, Garrett Cooper wrote: >>>>> >>>>> And you need to add #include to stand.h in order to get >>>>> uintmax_t. Here's a proper patch for amd64.. >>>> >>>> This would add namespace pollution. =A0stand.h doesn't use anything in >>>> . =A0It depends on normal namespace pollution in an XXX sect= ion >>>> in for the declaration of uintptr_t. =A0It and other hea= ders >>>> should use __uintptr_t instead. =A0Strangely, declares >>>> uintptr_t but not uintmax_t. >>> >>> =A0What about casting to __uintmax_t instead? >>> >>> Index: zalloc.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 >>> --- zalloc.c =A0 =A0(revision 223146) >>> +++ zalloc.c =A0 =A0(working copy) >>> @@ -154,7 +154,7 @@ >>> =A0 =A0if ((char *)ptr < (char *)mp->mp_Base || >>> =A0 =A0 =A0 =A0(char *)ptr + bytes > (char *)mp->mp_End || >>> =A0 =A0 =A0 =A0((iaddr_t)ptr & MEMNODE_SIZE_MASK) !=3D 0) >>> - =A0 =A0 =A0 panic("zfree(%p,%ju): wild pointer", ptr, bytes); >>> + =A0 =A0 =A0 panic("zfree(%p,%ju): wild pointer", ptr, (__uintmax_t)by= tes); >>> ... >> >> zalloc.c is not the (header) implementation, so it should not use the >> implementation detail (anything beginning with __). >> >> The latest tinderbox errors for this are hard to understand. =A0For amd6= 4 >> they say: >> >>> /src/lib/libstand/zalloc.c: In function 'zfree': >>> /src/lib/libstand/zalloc.c:157: warning: format '%ju' expects type >>> 'uintmax_t', but argument 3 has type 'iaddr_t' >> >> but amd64 seems to be just like sparc64 -- both seem to declare all the >> types as `unsigned long' at the lowest level. =A0I would expect all 64-b= it >> arches to do this, although this is logically wrong (it makes the larges= t >> integral type uintmax_t logically smaller than the standard bogus type >> unsigned long long). =A0This logic error is partly intentional (it detec= ts >> different type mismatches than uintmax_t =3D `unsigned long long' combin= ed >> with uint64_t =3D `unsigned long' would). > > =A0 =A0My second patch when applied gets one past tinderbox on powerpc.. > waiting for powerpc64 and sparc64 to complete. Namespace pollution is > one thing, but stdint.h isn't that bad IMHO -- I just find it funny > that iaddr_t had to be typedef'ed to uintptr_t in the first place. This needs to be committed to unbreak ia64 and mips64*. Still waiting to see what happens with sparc64, but amd64 and powerpc64 were oddly happy without this, even though they should have failed along with ia64 and mips64* (the format string should have been %zu for a size_t type). Will rerun universe once it completes on amd64, ia64 and sparc64 though later on today.. Thanks! -Garrett --0022154700ae58cacb04a5d5dba8 Content-Type: text/x-patch; charset=US-ASCII; name="fix-libstand-zalloc_malloc-ia64+mips64.patch" Content-Disposition: attachment; filename="fix-libstand-zalloc_malloc-ia64+mips64.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_gozuw1d90 SW5kZXg6IGxpYi9saWJzdGFuZC96YWxsb2NfbWFsbG9jLmMKPT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gbGliL2xp YnN0YW5kL3phbGxvY19tYWxsb2MuYwkocmV2aXNpb24gMjIzMTQwKQorKysgbGliL2xpYnN0YW5k L3phbGxvY19tYWxsb2MuYwkod29ya2luZyBjb3B5KQpAQCAtMTEwLDcgKzExMCw3IEBACiAJICAg IHJldHVybjsKIAl9CiAJaWYgKCooKHNpZ25lZCBjaGFyICopcmVzICsgcmVzLT5nYV9CeXRlcyAt IDEpICE9IC0yKQotCSAgICBwYW5pYygiZnJlZTogZ3VhcmQyIGZhaWwgQCAlcCArICVkIGZyb20g JXM6JWQiLCBwdHIsIHJlcy0+Z2FfQnl0ZXMgLSBNQUxMT0NBTElHTiwgZmlsZSwgbGluZSk7CisJ ICAgIHBhbmljKCJmcmVlOiBndWFyZDIgZmFpbCBAICVwICsgJXp1IGZyb20gJXM6JWQiLCBwdHIs IHJlcy0+Z2FfQnl0ZXMgLSBNQUxMT0NBTElHTiwgZmlsZSwgbGluZSk7CiAJKigoc2lnbmVkIGNo YXIgKilyZXMgKyByZXMtPmdhX0J5dGVzIC0gMSkgPSAtMTsKICNlbmRpZgogCg== --0022154700ae58cacb04a5d5dba8-- From owner-svn-src-head@FreeBSD.ORG Thu Jun 16 15:35:12 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A37C9106566B; Thu, 16 Jun 2011 15:35:12 +0000 (UTC) (envelope-from avatar@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9439B8FC16; Thu, 16 Jun 2011 15:35:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5GFZCii034906; Thu, 16 Jun 2011 15:35:12 GMT (envelope-from avatar@svn.freebsd.org) Received: (from avatar@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5GFZCb7034904; Thu, 16 Jun 2011 15:35:12 GMT (envelope-from avatar@svn.freebsd.org) Message-Id: <201106161535.p5GFZCb7034904@svn.freebsd.org> From: Tai-hwa Liang Date: Thu, 16 Jun 2011 15:35:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223151 - head/lib/libstand X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2011 15:35:12 -0000 Author: avatar Date: Thu Jun 16 15:35:12 2011 New Revision: 223151 URL: http://svn.freebsd.org/changeset/base/223151 Log: Using the correct format string(%zu) for size_t type. This should fix 64 bits builds. Submitted by: Garrett Cooper Modified: head/lib/libstand/zalloc_malloc.c Modified: head/lib/libstand/zalloc_malloc.c ============================================================================== --- head/lib/libstand/zalloc_malloc.c Thu Jun 16 12:57:33 2011 (r223150) +++ head/lib/libstand/zalloc_malloc.c Thu Jun 16 15:35:12 2011 (r223151) @@ -110,7 +110,7 @@ Free(void *ptr, const char *file, int li return; } if (*((signed char *)res + res->ga_Bytes - 1) != -2) - panic("free: guard2 fail @ %p + %d from %s:%d", ptr, res->ga_Bytes - MALLOCALIGN, file, line); + panic("free: guard2 fail @ %p + %zu from %s:%d", ptr, res->ga_Bytes - MALLOCALIGN, file, line); *((signed char *)res + res->ga_Bytes - 1) = -1; #endif From owner-svn-src-head@FreeBSD.ORG Thu Jun 16 15:36:09 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E906B1065673; Thu, 16 Jun 2011 15:36:09 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D90F88FC0C; Thu, 16 Jun 2011 15:36:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5GFa9wx034971; Thu, 16 Jun 2011 15:36:09 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5GFa9F3034968; Thu, 16 Jun 2011 15:36:09 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201106161536.p5GFa9F3034968@svn.freebsd.org> From: Michael Tuexen Date: Thu, 16 Jun 2011 15:36:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223152 - in head: lib/libc/net sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2011 15:36:10 -0000 Author: tuexen Date: Thu Jun 16 15:36:09 2011 New Revision: 223152 URL: http://svn.freebsd.org/changeset/base/223152 Log: * Fix the handling of addresses in sctp_sendv(). * Add support for SCTP_SENDV_NOINFO. * Improve the error handling of sctp_sendv() and sctp_recv(). MFC after: 1 month Modified: head/lib/libc/net/sctp_sys_calls.c head/sys/netinet/sctp_uio.h Modified: head/lib/libc/net/sctp_sys_calls.c ============================================================================== --- head/lib/libc/net/sctp_sys_calls.c Thu Jun 16 15:35:12 2011 (r223151) +++ head/lib/libc/net/sctp_sys_calls.c Thu Jun 16 15:36:09 2011 (r223152) @@ -942,6 +942,12 @@ sctp_recvv(int sd, struct sctp_rcvinfo *rcvinfo; struct sctp_nxtinfo *nxtinfo; + if (((info != NULL) && (infolen == NULL)) | + ((info == NULL) && (infolen != NULL) && (*infolen != 0)) || + ((info != NULL) && (infotype == NULL))) { + errno = EINVAL; + return (-1); + } if (infotype) { *infotype = SCTP_RECVV_NOINFO; } @@ -1017,16 +1023,22 @@ sctp_sendv(int sd, { ssize_t ret; int i; - size_t addr_len; - struct sctp_sendv_spa *spa_info; + socklen_t addr_len; struct msghdr msg; + in_port_t port; + struct sctp_sendv_spa *spa_info; struct cmsghdr *cmsg; char *cmsgbuf; struct sockaddr *addr; struct sockaddr_in *addr_in; struct sockaddr_in6 *addr_in6; - if ((addrcnt < 0) || (iovcnt < 0)) { + if ((addrcnt < 0) || + (iovcnt < 0) || + ((addr == NULL) && (addrcnt > 0)) || + ((addr != NULL) && (addrcnt == 0)) || + ((iov == NULL) && (iovcnt > 0)) || + ((iov != NULL) && (iovcnt == 0))) { errno = EINVAL; return (-1); } @@ -1042,8 +1054,15 @@ sctp_sendv(int sd, msg.msg_controllen = 0; cmsg = (struct cmsghdr *)cmsgbuf; switch (infotype) { + case SCTP_SENDV_NOINFO: + if ((infolen != 0) || (info != NULL)) { + free(cmsgbuf); + errno = EINVAL; + return (-1); + } + break; case SCTP_SENDV_SNDINFO: - if (infolen < sizeof(struct sctp_sndinfo)) { + if ((info == NULL) || (infolen < sizeof(struct sctp_sndinfo))) { free(cmsgbuf); errno = EINVAL; return (-1); @@ -1056,7 +1075,7 @@ sctp_sendv(int sd, cmsg = (struct cmsghdr *)((caddr_t)cmsg + CMSG_SPACE(sizeof(struct sctp_sndinfo))); break; case SCTP_SENDV_PRINFO: - if (infolen < sizeof(struct sctp_prinfo)) { + if ((info == NULL) || (infolen < sizeof(struct sctp_prinfo))) { free(cmsgbuf); errno = EINVAL; return (-1); @@ -1069,7 +1088,7 @@ sctp_sendv(int sd, cmsg = (struct cmsghdr *)((caddr_t)cmsg + CMSG_SPACE(sizeof(struct sctp_prinfo))); break; case SCTP_SENDV_AUTHINFO: - if (infolen < sizeof(struct sctp_authinfo)) { + if ((info == NULL) || (infolen < sizeof(struct sctp_authinfo))) { free(cmsgbuf); errno = EINVAL; return (-1); @@ -1082,7 +1101,7 @@ sctp_sendv(int sd, cmsg = (struct cmsghdr *)((caddr_t)cmsg + CMSG_SPACE(sizeof(struct sctp_authinfo))); break; case SCTP_SENDV_SPA: - if (infolen < sizeof(struct sctp_sendv_spa)) { + if ((info == NULL) || (infolen < sizeof(struct sctp_sendv_spa))) { free(cmsgbuf); errno = EINVAL; return (-1); @@ -1119,52 +1138,74 @@ sctp_sendv(int sd, return (-1); } addr = addrs; - if (addrcnt == 1) { - msg.msg_name = addr; + msg.msg_name = NULL; + msg.msg_namelen = 0; + + for (i = 0; i < addrcnt; i++) { switch (addr->sa_family) { case AF_INET: - msg.msg_namelen = sizeof(struct sockaddr_in); + addr_len = (socklen_t) sizeof(struct sockaddr_in); + addr_in = (struct sockaddr_in *)addr; + if (addr_in->sin_len != addr_len) { + free(cmsgbuf); + errno = EINVAL; + return (-1); + } + if (i == 0) { + port = addr_in->sin_port; + } else { + if (port == addr_in->sin_port) { + cmsg->cmsg_level = IPPROTO_SCTP; + cmsg->cmsg_type = SCTP_DSTADDRV4; + cmsg->cmsg_len = CMSG_LEN(sizeof(struct in_addr)); + memcpy(CMSG_DATA(cmsg), &addr_in->sin_addr, sizeof(struct in_addr)); + msg.msg_controllen += CMSG_SPACE(sizeof(struct in_addr)); + cmsg = (struct cmsghdr *)((caddr_t)cmsg + CMSG_SPACE(sizeof(struct in_addr))); + } else { + free(cmsgbuf); + errno = EINVAL; + return (-1); + } + } break; case AF_INET6: - msg.msg_namelen = sizeof(struct sockaddr_in6); + addr_len = (socklen_t) sizeof(struct sockaddr_in6); + addr_in6 = (struct sockaddr_in6 *)addr; + if (addr_in6->sin6_len != addr_len) { + free(cmsgbuf); + errno = EINVAL; + return (-1); + } + if (i == 0) { + port = addr_in6->sin6_port; + } else { + if (port == addr_in6->sin6_port) { + cmsg->cmsg_level = IPPROTO_SCTP; + cmsg->cmsg_type = SCTP_DSTADDRV6; + cmsg->cmsg_len = CMSG_LEN(sizeof(struct in6_addr)); + memcpy(CMSG_DATA(cmsg), &addr_in6->sin6_addr, sizeof(struct in6_addr)); + msg.msg_controllen += CMSG_SPACE(sizeof(struct in6_addr)); + cmsg = (struct cmsghdr *)((caddr_t)cmsg + CMSG_SPACE(sizeof(struct in6_addr))); + } else { + free(cmsgbuf); + errno = EINVAL; + return (-1); + } + } break; default: free(cmsgbuf); errno = EINVAL; return (-1); } - } else { - msg.msg_name = NULL; - msg.msg_namelen = 0; - for (i = 0; i < addrcnt; i++) { - switch (addr->sa_family) { - case AF_INET: - addr_len = sizeof(struct sockaddr_in); - addr_in = (struct sockaddr_in *)addr; - cmsg->cmsg_level = IPPROTO_SCTP; - cmsg->cmsg_type = SCTP_DSTADDRV4; - cmsg->cmsg_len = CMSG_LEN(sizeof(struct in_addr)); - memcpy(CMSG_DATA(cmsg), &addr_in->sin_addr, sizeof(struct in_addr)); - msg.msg_controllen += CMSG_SPACE(sizeof(struct in_addr)); - cmsg = (struct cmsghdr *)((caddr_t)cmsg + CMSG_SPACE(sizeof(struct in_addr))); - break; - case AF_INET6: - addr_len = sizeof(struct sockaddr_in6); - addr_in6 = (struct sockaddr_in6 *)addr; - cmsg->cmsg_level = IPPROTO_SCTP; - cmsg->cmsg_type = SCTP_DSTADDRV6; - cmsg->cmsg_len = CMSG_LEN(sizeof(struct in6_addr)); - memcpy(CMSG_DATA(cmsg), &addr_in6->sin6_addr, sizeof(struct in6_addr)); - msg.msg_controllen += CMSG_SPACE(sizeof(struct in6_addr)); - cmsg = (struct cmsghdr *)((caddr_t)cmsg + CMSG_SPACE(sizeof(struct in6_addr))); - break; - default: - free(cmsgbuf); - errno = EINVAL; - return (-1); - } - addr = (struct sockaddr *)((caddr_t)addr + addr_len); + if (i == 0) { + msg.msg_name = addr; + msg.msg_namelen = addr_len; } + addr = (struct sockaddr *)((caddr_t)addr + addr_len); + } + if (msg.msg_controllen == 0) { + msg.msg_control = NULL; } if (msg.msg_controllen == 0) { msg.msg_control = NULL; Modified: head/sys/netinet/sctp_uio.h ============================================================================== --- head/sys/netinet/sctp_uio.h Thu Jun 16 15:35:12 2011 (r223151) +++ head/sys/netinet/sctp_uio.h Thu Jun 16 15:36:09 2011 (r223152) @@ -201,6 +201,7 @@ struct sctp_recvv_rn { #define SCTP_RECVV_NXTINFO 2 #define SCTP_RECVV_RN 3 +#define SCTP_SENDV_NOINFO 0 #define SCTP_SENDV_SNDINFO 1 #define SCTP_SENDV_PRINFO 2 #define SCTP_SENDV_AUTHINFO 3 From owner-svn-src-head@FreeBSD.ORG Thu Jun 16 15:53:14 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 89C9D106564A; Thu, 16 Jun 2011 15:53:14 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7AA798FC0A; Thu, 16 Jun 2011 15:53:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5GFrEj6035558; Thu, 16 Jun 2011 15:53:14 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5GFrEkg035556; Thu, 16 Jun 2011 15:53:14 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201106161553.p5GFrEkg035556@svn.freebsd.org> From: Alexander Motin Date: Thu, 16 Jun 2011 15:53:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223153 - head/share/misc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2011 15:53:14 -0000 Author: mav Date: Thu Jun 16 15:53:14 2011 New Revision: 223153 URL: http://svn.freebsd.org/changeset/base/223153 Log: Add Digitizer-related usage IDs from HUTRR30 and HUTRR34. Modified: head/share/misc/usb_hid_usages Modified: head/share/misc/usb_hid_usages ============================================================================== --- head/share/misc/usb_hid_usages Thu Jun 16 15:36:09 2011 (r223152) +++ head/share/misc/usb_hid_usages Thu Jun 16 15:53:14 2011 (r223153) @@ -989,9 +989,11 @@ 0x0B Armature 0x0C Multiple Point Digitizer 0x0D Free Space Wand + 0x0E Device Configuration 0x20 Stylus 0x21 Puck 0x22 Finger + 0x23 Device Settings 0x30 Tip Pressure 0x31 Barrel Pressure 0x32 In Range @@ -1015,6 +1017,14 @@ 0x44 Barrel Switch 0x45 Eraser 0x46 Tablet Pick + 0x47 Touch Valid + 0x48 Width + 0x49 Height + 0x51 Contact Identifier + 0x52 Device Mode + 0x53 Device Identifier + 0x54 Contact Count + 0x55 Contact Count Maximum 15 Physical Interface Device 0x00 Undefined From owner-svn-src-head@FreeBSD.ORG Thu Jun 16 15:55:24 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EC3AE106564A; Thu, 16 Jun 2011 15:55:24 +0000 (UTC) (envelope-from avatar@mmlab.cse.yzu.edu.tw) Received: from www.mmlab.cse.yzu.edu.tw (www.mmlab.cse.yzu.edu.tw [140.138.150.166]) by mx1.freebsd.org (Postfix) with ESMTP id AB3218FC17; Thu, 16 Jun 2011 15:55:24 +0000 (UTC) Received: by www.mmlab.cse.yzu.edu.tw (qmail, from userid 1000) id A96D02EC686B; Thu, 16 Jun 2011 23:55:23 +0800 (CST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mmlab.cse.yzu.edu.tw; s=test; t=1308239723; bh=FO+8xoIU1RsOhIHFOTfrVATig110AQV5YtevZ5IzuGo=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References: MIME-Version:Content-Type; b=OJUfLhmhIpKSxmrYAOeE1ZYC4/XrAZ3pYmLriVgcHNDrSKfQhqEf23ZuQ3RYgSAu/ P5ZjRrpmCIVTXlWXHDzHE5C1nx8dzlTY8De4Zv7ayo51ADKGVfOkGQmaihEJ8i3meD OofAn5guFgbRoaaUNK/ihdGuJdqOpvA73YYXAZxs= Received: from localhost (localhost [127.0.0.1]) by www.mmlab.cse.yzu.edu.tw (qmail) with ESMTP id A754B2EC6866; Thu, 16 Jun 2011 23:55:23 +0800 (CST) Date: Thu, 16 Jun 2011 23:55:23 +0800 (CST) From: Tai-hwa Liang To: Bruce Evans In-Reply-To: <20110617000654.W1926@besplex.bde.org> Message-ID: <1106162352252.45438@www.mmlab.cse.yzu.edu.tw> References: <201106160526.p5G5Q3RX013915@svn.freebsd.org> <20110616065310.GA2542@mole.fafoe.narf.at> <20110616175314.R935@besplex.bde.org> <1106161923211.44181@www.mmlab.cse.yzu.edu.tw> <20110617000654.W1926@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Stefan Farfeleder , src-committers@FreeBSD.org Subject: Re: svn commit: r223138 - head/sys/ufs/ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2011 15:55:25 -0000 On Fri, 17 Jun 2011, Bruce Evans wrote: > On Thu, 16 Jun 2011, Tai-hwa Liang wrote: >> On Thu, 16 Jun 2011, Bruce Evans wrote: >>> It might be a style bug (like typedefing a struct) to use enums for >>> anything. They are impossible to declare opaquely. >> >> Does that mean we have to #include in userland >> makefs/ffs/ffs_bswap.c? > > It means that you should implement headers properly, so that they don't > depend on other headers to begin with or grow dependencies on other > headers. Though the should-be-kernel-only header has some > parts including `enum vtype' that have already escaped to userland, other > headers shouldn't grow dependencies on these. How about wrapping offended sections with #ifdef _KERNEL? Should be less intrusive IMHO: Index: ffs_extern.h =================================================================== --- ffs_extern.h (revision 223146) +++ ffs_extern.h (working copy) @@ -33,7 +33,6 @@ #ifndef _UFS_FFS_EXTERN_H #define _UFS_FFS_EXTERN_H -enum vtype; struct buf; struct cg; struct fid; @@ -57,8 +56,10 @@ int ffs_balloc_ufs2(struct vnode *a_vp, off_t a_startoffset, int a_size, struct ucred *a_cred, int a_flags, struct buf **a_bpp); int ffs_blkatoff(struct vnode *, off_t, char **, struct buf **); +#ifdef _KERNEL void ffs_blkfree(struct ufsmount *, struct fs *, struct vnode *, ufs2_daddr_t, long, ino_t, enum vtype, struct workhead *); +#endif /* _KERNEL */ ufs2_daddr_t ffs_blkpref_ufs1(struct inode *, ufs_lbn_t, int, ufs1_daddr_t *); ufs2_daddr_t ffs_blkpref_ufs2(struct inode *, ufs_lbn_t, int, ufs2_daddr_t *); int ffs_checkfreefile(struct fs *, struct vnode *, ino_t); @@ -82,8 +83,10 @@ ufs2_daddr_t, int, int, int, struct ucred *, struct buf **); int ffs_sbupdate(struct ufsmount *, int, int); void ffs_setblock(struct fs *, u_char *, ufs1_daddr_t); +#ifdef _KERNEL int ffs_snapblkfree(struct fs *, struct vnode *, ufs2_daddr_t, long, ino_t, enum vtype, struct workhead *); +#endif /* _KERNEL */ void ffs_snapremove(struct vnode *vp); int ffs_snapshot(struct mount *mp, char *snapfile); void ffs_snapshot_mount(struct mount *mp); From owner-svn-src-head@FreeBSD.ORG Thu Jun 16 16:04:37 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F04F8106564A; Thu, 16 Jun 2011 16:04:37 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id B0A748FC12; Thu, 16 Jun 2011 16:04:37 +0000 (UTC) Received: from [10.30.101.53] ([209.117.142.2]) (authenticated bits=0) by harmony.bsdimp.com (8.14.4/8.14.3) with ESMTP id p5GFrXU7018410 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Thu, 16 Jun 2011 09:53:36 -0600 (MDT) (envelope-from imp@bsdimp.com) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: <201106161535.p5GFZCb7034904@svn.freebsd.org> Date: Thu, 16 Jun 2011 09:53:18 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201106161535.p5GFZCb7034904@svn.freebsd.org> To: Tai-hwa Liang X-Mailer: Apple Mail (2.1084) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (harmony.bsdimp.com [10.0.0.6]); Thu, 16 Jun 2011 09:53:36 -0600 (MDT) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r223151 - head/lib/libstand X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2011 16:04:38 -0000 On Jun 16, 2011, at 9:35 AM, Tai-hwa Liang wrote: > Author: avatar > Date: Thu Jun 16 15:35:12 2011 > New Revision: 223151 > URL: http://svn.freebsd.org/changeset/base/223151 >=20 > Log: > Using the correct format string(%zu) for size_t type. This should = fix 64 > bits builds. >=20 > Submitted by: Garrett Cooper How about we hold all fixes until it *ACTUALLY* builds on all universe = platforms? I hate to be cranky, but build breakage costs a lot of time. And for = stupid stuff like this? I'm inclined to force WARNS=3D0 until people = can actually fix it right. Warner From owner-svn-src-head@FreeBSD.ORG Thu Jun 16 17:30:50 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CB1911065670; Thu, 16 Jun 2011 17:30:50 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BBBD08FC1A; Thu, 16 Jun 2011 17:30:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5GHUoVN039112; Thu, 16 Jun 2011 17:30:50 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5GHUoor039110; Thu, 16 Jun 2011 17:30:50 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201106161730.p5GHUoor039110@svn.freebsd.org> From: Michael Tuexen Date: Thu, 16 Jun 2011 17:30:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223154 - head/lib/libc/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2011 17:30:50 -0000 Author: tuexen Date: Thu Jun 16 17:30:50 2011 New Revision: 223154 URL: http://svn.freebsd.org/changeset/base/223154 Log: Fix two typos and remove redundant code. MFC after: 1 month. Modified: head/lib/libc/net/sctp_sys_calls.c Modified: head/lib/libc/net/sctp_sys_calls.c ============================================================================== --- head/lib/libc/net/sctp_sys_calls.c Thu Jun 16 15:53:14 2011 (r223153) +++ head/lib/libc/net/sctp_sys_calls.c Thu Jun 16 17:30:50 2011 (r223154) @@ -1035,8 +1035,8 @@ sctp_sendv(int sd, if ((addrcnt < 0) || (iovcnt < 0) || - ((addr == NULL) && (addrcnt > 0)) || - ((addr != NULL) && (addrcnt == 0)) || + ((addrs == NULL) && (addrcnt > 0)) || + ((addrs != NULL) && (addrcnt == 0)) || ((iov == NULL) && (iovcnt > 0)) || ((iov != NULL) && (iovcnt == 0))) { errno = EINVAL; @@ -1207,9 +1207,6 @@ sctp_sendv(int sd, if (msg.msg_controllen == 0) { msg.msg_control = NULL; } - if (msg.msg_controllen == 0) { - msg.msg_control = NULL; - } msg.msg_iov = (struct iovec *)iov; msg.msg_iovlen = iovcnt; msg.msg_flags = 0; From owner-svn-src-head@FreeBSD.ORG Thu Jun 16 17:40:38 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 89ED8106566B; Thu, 16 Jun 2011 17:40:38 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-vx0-f182.google.com (mail-vx0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id 01FE28FC0C; Thu, 16 Jun 2011 17:40:37 +0000 (UTC) Received: by vxc34 with SMTP id 34so1909935vxc.13 for ; Thu, 16 Jun 2011 10:40:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=J5mcBUNxjBfQhW+5nw+/b5l4kgUGkrRcbBFWzGx762o=; b=X9J1ZkqH90w77DHkrhtRYqVtCQJoZtG4JBht6pWgQW0IT7aEUnX5rNIG5KuOVeAxM0 C0rQd7HIckigWbq/enlXh0GBayAIc5HIIAIOB6pUrxe5/gwgR62Aifo/OwoNKoWErpj+ j1zalTNlAfVhpKdsKznvqfGZ6YeXY39sUkXuk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=kk2oJvQzoKd83W4vqgYi/bkiqlknAriiDO2sfE/q1bRXYpQT+PtGfTqbUuY44Dlik2 sTPr6nOvVdpu/XznUn9tvmnX7lWURQMe0mX1dpqbzmg/F1UpdxXROOPP8h5zWu2aDwZZ KivgnC7W4tRdnvCKGnVMbNltHiBKlJv5/xlfE= MIME-Version: 1.0 Received: by 10.220.213.195 with SMTP id gx3mr465044vcb.23.1308246036999; Thu, 16 Jun 2011 10:40:36 -0700 (PDT) Received: by 10.220.189.202 with HTTP; Thu, 16 Jun 2011 10:40:36 -0700 (PDT) In-Reply-To: References: <201106161535.p5GFZCb7034904@svn.freebsd.org> Date: Thu, 16 Jun 2011 10:40:36 -0700 Message-ID: From: Garrett Cooper To: Warner Losh Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Tai-hwa Liang , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223151 - head/lib/libstand X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2011 17:40:38 -0000 On Thu, Jun 16, 2011 at 8:53 AM, Warner Losh wrote: > > On Jun 16, 2011, at 9:35 AM, Tai-hwa Liang wrote: > >> Author: avatar >> Date: Thu Jun 16 15:35:12 2011 >> New Revision: 223151 >> URL: http://svn.freebsd.org/changeset/base/223151 >> >> Log: >> =A0Using the correct format string(%zu) for size_t type. =A0This should = fix 64 >> =A0bits builds. >> >> =A0Submitted by: =A0 =A0 =A0 =A0Garrett Cooper > > How about we hold all fixes until it *ACTUALLY* builds on all universe pl= atforms? > > I hate to be cranky, but build breakage costs a lot of time. =A0And for s= tupid stuff like this? =A0I'm inclined to force WARNS=3D0 until people can = actually fix it right. This was stupid breakage on my part for not running this through universe first. The patch that builds upon this that I submitted in the other thread so far _does_ unbreak universe on ia64 and mips*. Still working on getting it to pass through amd64, i386, and sparc64 at least, which is going to be a few more hours because for some magic reason make -j doesn't work for me with universe. Thanks, -Garrett From owner-svn-src-head@FreeBSD.ORG Thu Jun 16 17:41:21 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F60D1065670; Thu, 16 Jun 2011 17:41:21 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 604428FC12; Thu, 16 Jun 2011 17:41:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5GHfLZZ039466; Thu, 16 Jun 2011 17:41:21 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5GHfL30039464; Thu, 16 Jun 2011 17:41:21 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201106161741.p5GHfL30039464@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 16 Jun 2011 17:41:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223155 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2011 17:41:21 -0000 Author: marcel Date: Thu Jun 16 17:41:21 2011 New Revision: 223155 URL: http://svn.freebsd.org/changeset/base/223155 Log: Even if the loaded module has no symbols, we still need to notify MD code about it and update the link map for GDB's use. Modified: head/sys/kern/link_elf.c Modified: head/sys/kern/link_elf.c ============================================================================== --- head/sys/kern/link_elf.c Thu Jun 16 17:30:50 2011 (r223154) +++ head/sys/kern/link_elf.c Thu Jun 16 17:41:21 2011 (r223155) @@ -950,11 +950,11 @@ link_elf_load_file(linker_class_t cls, c ef->ddbstrcnt = strcnt; ef->ddbstrtab = ef->strbase; +nosyms: error = link_elf_link_common_finish(lf); if (error != 0) goto out; -nosyms: *result = lf; out: From owner-svn-src-head@FreeBSD.ORG Thu Jun 16 18:00:27 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF9AD106566C; Thu, 16 Jun 2011 18:00:27 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D07C08FC0A; Thu, 16 Jun 2011 18:00:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5GI0Rei040066; Thu, 16 Jun 2011 18:00:27 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5GI0RZc040064; Thu, 16 Jun 2011 18:00:27 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201106161800.p5GI0RZc040064@svn.freebsd.org> From: Warner Losh Date: Thu, 16 Jun 2011 18:00:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223156 - head/lib/libstand X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2011 18:00:28 -0000 Author: imp Date: Thu Jun 16 18:00:27 2011 New Revision: 223156 URL: http://svn.freebsd.org/changeset/base/223156 Log: Setting warnings without make universe considered harmful. Revert to WARNS=0 until such time that the warnings at =2 are fixed for all platforms. Modified: head/lib/libstand/Makefile Modified: head/lib/libstand/Makefile ============================================================================== --- head/lib/libstand/Makefile Thu Jun 16 17:41:21 2011 (r223155) +++ head/lib/libstand/Makefile Thu Jun 16 18:00:27 2011 (r223156) @@ -15,7 +15,7 @@ NO_PIC= INCS= stand.h MAN= libstand.3 -WARNS?= 2 +WARNS?= 0 CFLAGS+= -ffreestanding -Wformat CFLAGS+= -I${.CURDIR} From owner-svn-src-head@FreeBSD.ORG Thu Jun 16 18:03:51 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D96F1065672; Thu, 16 Jun 2011 18:03:51 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from mail.icecube.wisc.edu (trout.icecube.wisc.edu [128.104.255.119]) by mx1.freebsd.org (Postfix) with ESMTP id 1B8618FC13; Thu, 16 Jun 2011 18:03:50 +0000 (UTC) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.icecube.wisc.edu (Postfix) with ESMTP id 360E058140; Thu, 16 Jun 2011 13:03:50 -0500 (CDT) X-Virus-Scanned: amavisd-new at icecube.wisc.edu Received: from mail.icecube.wisc.edu ([127.0.0.1]) by localhost (trout.icecube.wisc.edu [127.0.0.1]) (amavisd-new, port 10030) with ESMTP id SyRDx9BbvLjd; Thu, 16 Jun 2011 13:03:50 -0500 (CDT) Received: from wanderer.tachypleus.net (i3-dhcp-172-16-223-128.icecube.wisc.edu [172.16.223.128]) by mail.icecube.wisc.edu (Postfix) with ESMTP id E024A5811D; Thu, 16 Jun 2011 13:03:49 -0500 (CDT) Message-ID: <4DFA4585.4040500@freebsd.org> Date: Thu, 16 Jun 2011 13:03:49 -0500 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.17) Gecko/20110516 Thunderbird/3.1.10 MIME-Version: 1.0 To: Garrett Cooper References: <201106160714.p5G7Etfx017112@svn.freebsd.org> <20110616180803.D1005@besplex.bde.org> <11061619555315.44181@www.mmlab.cse.yzu.edu.tw> <20110616235239.D1926@besplex.bde.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Tai-hwa Liang , src-committers@freebsd.org, Bruce Evans Subject: Re: svn commit: r223139 - head/lib/libstand X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2011 18:03:51 -0000 On 06/16/11 10:23, Garrett Cooper wrote: > On Thu, Jun 16, 2011 at 8:12 AM, Garrett Cooper wrote: >> On Thu, Jun 16, 2011 at 7:06 AM, Bruce Evans wrote: >>> On Thu, 16 Jun 2011, Tai-hwa Liang wrote: >>> >>>> On Thu, 16 Jun 2011, Bruce Evans wrote: >>>> >>>>> On Thu, 16 Jun 2011, Garrett Cooper wrote: >>>>>> >>>>>> And you need to add #include to stand.h in order to get >>>>>> uintmax_t. Here's a proper patch for amd64.. >>>>> >>>>> This would add namespace pollution. stand.h doesn't use anything in >>>>> . It depends on normal namespace pollution in an XXX section >>>>> in for the declaration of uintptr_t. It and other headers >>>>> should use __uintptr_t instead. Strangely, declares >>>>> uintptr_t but not uintmax_t. >>>> >>>> What about casting to __uintmax_t instead? >>>> >>>> Index: zalloc.c >>>> =================================================================== >>>> --- zalloc.c (revision 223146) >>>> +++ zalloc.c (working copy) >>>> @@ -154,7 +154,7 @@ >>>> if ((char *)ptr< (char *)mp->mp_Base || >>>> (char *)ptr + bytes> (char *)mp->mp_End || >>>> ((iaddr_t)ptr& MEMNODE_SIZE_MASK) != 0) >>>> - panic("zfree(%p,%ju): wild pointer", ptr, bytes); >>>> + panic("zfree(%p,%ju): wild pointer", ptr, (__uintmax_t)bytes); >>>> ... >>> >>> zalloc.c is not the (header) implementation, so it should not use the >>> implementation detail (anything beginning with __). >>> >>> The latest tinderbox errors for this are hard to understand. For amd64 >>> they say: >>> >>>> /src/lib/libstand/zalloc.c: In function 'zfree': >>>> /src/lib/libstand/zalloc.c:157: warning: format '%ju' expects type >>>> 'uintmax_t', but argument 3 has type 'iaddr_t' >>> >>> but amd64 seems to be just like sparc64 -- both seem to declare all the >>> types as `unsigned long' at the lowest level. I would expect all 64-bit >>> arches to do this, although this is logically wrong (it makes the largest >>> integral type uintmax_t logically smaller than the standard bogus type >>> unsigned long long). This logic error is partly intentional (it detects >>> different type mismatches than uintmax_t = `unsigned long long' combined >>> with uint64_t = `unsigned long' would). >> >> My second patch when applied gets one past tinderbox on powerpc.. >> waiting for powerpc64 and sparc64 to complete. Namespace pollution is >> one thing, but stdint.h isn't that bad IMHO -- I just find it funny >> that iaddr_t had to be typedef'ed to uintptr_t in the first place. > > This needs to be committed to unbreak ia64 and mips64*. Still waiting > to see what happens with sparc64, but amd64 and powerpc64 were oddly > happy without this, even though they should have failed along with > ia64 and mips64* (the format string should have been %zu for a size_t > type). Both amd64 and powerpc64 use 32-bit bootloaders, and so libstand is built with a 32-bit toolchain. As such, bugs affecting 64-bit platforms don't show up for libstand builds on these systems. -Nathan From owner-svn-src-head@FreeBSD.ORG Thu Jun 16 18:13:02 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 88014106566B; Thu, 16 Jun 2011 18:13:02 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 0BFFA8FC13; Thu, 16 Jun 2011 18:13:01 +0000 (UTC) Received: from [10.30.101.53] ([209.117.142.2]) (authenticated bits=0) by harmony.bsdimp.com (8.14.4/8.14.3) with ESMTP id p5GI1oWr019868 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Thu, 16 Jun 2011 12:01:51 -0600 (MDT) (envelope-from imp@bsdimp.com) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: Date: Thu, 16 Jun 2011 12:01:38 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <43730304-8D75-47A3-B09C-67E61017592A@bsdimp.com> References: <201106161535.p5GFZCb7034904@svn.freebsd.org> To: Garrett Cooper X-Mailer: Apple Mail (2.1084) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (harmony.bsdimp.com [10.0.0.6]); Thu, 16 Jun 2011 12:01:52 -0600 (MDT) Cc: Tai-hwa Liang , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223151 - head/lib/libstand X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2011 18:13:02 -0000 On Jun 16, 2011, at 11:40 AM, Garrett Cooper wrote: > On Thu, Jun 16, 2011 at 8:53 AM, Warner Losh wrote: >>=20 >> On Jun 16, 2011, at 9:35 AM, Tai-hwa Liang wrote: >>=20 >>> Author: avatar >>> Date: Thu Jun 16 15:35:12 2011 >>> New Revision: 223151 >>> URL: http://svn.freebsd.org/changeset/base/223151 >>>=20 >>> Log: >>> Using the correct format string(%zu) for size_t type. This should = fix 64 >>> bits builds. >>>=20 >>> Submitted by: Garrett Cooper >>=20 >> How about we hold all fixes until it *ACTUALLY* builds on all = universe platforms? >>=20 >> I hate to be cranky, but build breakage costs a lot of time. And for = stupid stuff like this? I'm inclined to force WARNS=3D0 until people = can actually fix it right. >=20 > This was stupid breakage on my part for not running this through > universe first. The patch that builds upon this that I submitted in > the other thread so far _does_ unbreak universe on ia64 and mips*. > Still working on getting it to pass through amd64, i386, and sparc64 > at least, which is going to be a few more hours because for some magic > reason make -j doesn't work for me with universe. I've reverted to WARNS=3D0. Once the patches are in and work for make = universe, we can put it back to WARNS=3D2. Warner From owner-svn-src-head@FreeBSD.ORG Thu Jun 16 18:24:45 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3AB51106564A; Thu, 16 Jun 2011 18:24:45 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 0E7C98FC08; Thu, 16 Jun 2011 18:24:45 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id B519446B03; Thu, 16 Jun 2011 14:24:44 -0400 (EDT) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 51E018A01F; Thu, 16 Jun 2011 14:24:44 -0400 (EDT) From: John Baldwin To: Garrett Cooper Date: Thu, 16 Jun 2011 14:24:43 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110325; KDE/4.5.5; amd64; ; ) References: <201106161535.p5GFZCb7034904@svn.freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201106161424.43811.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Thu, 16 Jun 2011 14:24:44 -0400 (EDT) Cc: Tai-hwa Liang , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Warner Losh Subject: Re: svn commit: r223151 - head/lib/libstand X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2011 18:24:45 -0000 On Thursday, June 16, 2011 1:40:36 pm Garrett Cooper wrote: > On Thu, Jun 16, 2011 at 8:53 AM, Warner Losh wrote: > > > > On Jun 16, 2011, at 9:35 AM, Tai-hwa Liang wrote: > > > >> Author: avatar > >> Date: Thu Jun 16 15:35:12 2011 > >> New Revision: 223151 > >> URL: http://svn.freebsd.org/changeset/base/223151 > >> > >> Log: > >> Using the correct format string(%zu) for size_t type. This should fix 64 > >> bits builds. > >> > >> Submitted by: Garrett Cooper > > > > How about we hold all fixes until it *ACTUALLY* builds on all universe platforms? > > > > I hate to be cranky, but build breakage costs a lot of time. And for stupid stuff like this? I'm inclined to force WARNS=0 until people can actually fix it right. > > This was stupid breakage on my part for not running this through > universe first. The patch that builds upon this that I submitted in > the other thread so far _does_ unbreak universe on ia64 and mips*. > Still working on getting it to pass through amd64, i386, and sparc64 > at least, which is going to be a few more hours because for some magic > reason make -j doesn't work for me with universe. You probably want to do 'make JFLAG=-j6 tinderbox' rather than 'make -j6 tinderbox'. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Thu Jun 16 19:42:03 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B50FF106564A; Thu, 16 Jun 2011 19:42:03 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A5B888FC08; Thu, 16 Jun 2011 19:42:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5GJg3O7043184; Thu, 16 Jun 2011 19:42:03 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5GJg3wI043182; Thu, 16 Jun 2011 19:42:03 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201106161942.p5GJg3wI043182@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Thu, 16 Jun 2011 19:42:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223158 - head/sbin/geom/class/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2011 19:42:03 -0000 Author: ae Date: Thu Jun 16 19:42:03 2011 New Revision: 223158 URL: http://svn.freebsd.org/changeset/base/223158 Log: Add "alignment" param to the request before calling gpart_autofill(). Modified: head/sbin/geom/class/part/geom_part.c Modified: head/sbin/geom/class/part/geom_part.c ============================================================================== --- head/sbin/geom/class/part/geom_part.c Thu Jun 16 19:32:00 2011 (r223157) +++ head/sbin/geom/class/part/geom_part.c Thu Jun 16 19:42:03 2011 (r223158) @@ -927,6 +927,7 @@ gpart_restore(struct gctl_req *req, unsi gctl_ro_param(r, "size", -1, argv[3]); if (rl != 0 && label != NULL) gctl_ro_param(r, "label", -1, argv[4]); + gctl_ro_param(r, "alignment", -1, GPART_AUTOFILL); gctl_ro_param(r, "arg0", -1, s); error = gpart_autofill(r); if (error != 0) From owner-svn-src-head@FreeBSD.ORG Thu Jun 16 19:57:08 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5CF57106564A; Thu, 16 Jun 2011 19:57:08 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4D7E28FC13; Thu, 16 Jun 2011 19:57:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5GJv8qp043744; Thu, 16 Jun 2011 19:57:08 GMT (envelope-from bcr@svn.freebsd.org) Received: (from bcr@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5GJv8Bk043742; Thu, 16 Jun 2011 19:57:08 GMT (envelope-from bcr@svn.freebsd.org) Message-Id: <201106161957.p5GJv8Bk043742@svn.freebsd.org> From: Benedict Reuschling Date: Thu, 16 Jun 2011 19:57:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223160 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2011 19:57:08 -0000 Author: bcr (doc committer) Date: Thu Jun 16 19:57:07 2011 New Revision: 223160 URL: http://svn.freebsd.org/changeset/base/223160 Log: Fix some wording and grammar in the BUGS section. PR: docs/157901 Submitted by: Niclas Zeising (niclas dot zeising at gmail dot com) Reviewed by: mav MFC after: 3 days Modified: head/share/man/man4/snd_hda.4 Modified: head/share/man/man4/snd_hda.4 ============================================================================== --- head/share/man/man4/snd_hda.4 Thu Jun 16 19:47:56 2011 (r223159) +++ head/share/man/man4/snd_hda.4 Thu Jun 16 19:57:07 2011 (r223160) @@ -668,16 +668,20 @@ and A few Hardware/OEM vendors tend to screw up BIOS settings, thus rendering the .Nm -driver useless, which usually results in a state where the +driver useless. +This usually results in a state where the .Nm -driver seems to attach and work, but without any sound. Some of -that cases can be solved by tuning loader.conf variables. But before -trying to fix problem that way, make sure that problem is really exists -and the PCM audio device you are using really corresponds to expected +driver seems to attach and work, but no sound is played. +Some cases can be solved by tuning +.Pa loader.conf +variables. +Before trying to fix problem that way, make sure that there really is a problem +and that the PCM audio device in use really corresponds to the expected audio connector. .Pp -Some vendors use non-standardized General Purpose I/O (GPIO) pins of codec -to control external amplifiers. In some cases setting proper combination of -GPIO bits may be needed to make sound work on specific device. +Some vendors use non-standardized General Purpose I/O (GPIO) pins of the codec +to control external amplifiers. +In some cases setting a combination of GPIO bits may be needed to make +sound work on a specific device. .Pp HDMI and DisplayPort audio may also require support from video driver. From owner-svn-src-head@FreeBSD.ORG Thu Jun 16 20:42:07 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D576F106564A; Thu, 16 Jun 2011 20:42:07 +0000 (UTC) (envelope-from maxim.konovalov@gmail.com) Received: from mp2.macomnet.net (ipv6.irc.int.ru [IPv6:2a02:28:1:2::1b:2]) by mx1.freebsd.org (Postfix) with ESMTP id 4896F8FC15; Thu, 16 Jun 2011 20:42:07 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mp2.macomnet.net (8.14.4/8.14.3) with ESMTP id p5GKg58K082864; Fri, 17 Jun 2011 00:42:05 +0400 (MSD) (envelope-from maxim.konovalov@gmail.com) Date: Fri, 17 Jun 2011 00:42:05 +0400 (MSD) From: Maxim Konovalov To: Craig Rodrigues In-Reply-To: <201106152213.p5FMDMWP000491@svn.freebsd.org> Message-ID: References: <201106152213.p5FMDMWP000491@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r223124 - head/lib/libstand X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2011 20:42:07 -0000 > (2) If the "tftp.blksize" environment variable is set, then > take that value and use it when sending the TFTP RRQ packet, > instead of 1428. This allows us to set different values of > "tftp.blksize" in the loader, so that we can test out different > TFTP block sizes at run time. > Is it documented somewhere? -- Maxim Konovalov From owner-svn-src-head@FreeBSD.ORG Thu Jun 16 21:12:37 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C352106566C; Thu, 16 Jun 2011 21:12:37 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1BB808FC08; Thu, 16 Jun 2011 21:12:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5GLCawl046045; Thu, 16 Jun 2011 21:12:37 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5GLCaQK046041; Thu, 16 Jun 2011 21:12:36 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201106162112.p5GLCaQK046041@svn.freebsd.org> From: Michael Tuexen Date: Thu, 16 Jun 2011 21:12:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223162 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2011 21:12:37 -0000 Author: tuexen Date: Thu Jun 16 21:12:36 2011 New Revision: 223162 URL: http://svn.freebsd.org/changeset/base/223162 Log: Add SCTP_DEFAULT_PRINFO socket option. Fix the SCTP_DEFAULT_SNDINFO socket option: Don't clear the PR SCTP policy when setting sinfo_flags. MFC after: 1 month. Modified: head/sys/netinet/sctp.h head/sys/netinet/sctp_uio.h head/sys/netinet/sctp_usrreq.c Modified: head/sys/netinet/sctp.h ============================================================================== --- head/sys/netinet/sctp.h Thu Jun 16 20:58:23 2011 (r223161) +++ head/sys/netinet/sctp.h Thu Jun 16 21:12:36 2011 (r223162) @@ -118,6 +118,7 @@ struct sctp_paramhdr { #define SCTP_RECVRCVINFO 0x0000001f #define SCTP_RECVNXTINFO 0x00000020 #define SCTP_DEFAULT_SNDINFO 0x00000021 +#define SCTP_DEFAULT_PRINFO 0x00000022 /* * read-only options Modified: head/sys/netinet/sctp_uio.h ============================================================================== --- head/sys/netinet/sctp_uio.h Thu Jun 16 20:58:23 2011 (r223161) +++ head/sys/netinet/sctp_uio.h Thu Jun 16 21:12:36 2011 (r223162) @@ -162,6 +162,12 @@ struct sctp_prinfo { uint32_t pr_value; }; +struct sctp_default_prinfo { + uint16_t pr_policy; + uint32_t pr_value; + sctp_assoc_t pr_assoc_id; +}; + struct sctp_authinfo { uint16_t auth_keyid; }; Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Thu Jun 16 20:58:23 2011 (r223161) +++ head/sys/netinet/sctp_usrreq.c Thu Jun 16 21:12:36 2011 (r223162) @@ -3030,6 +3030,7 @@ flags_out: if (stcb) { info->snd_sid = stcb->asoc.def_send.sinfo_stream; info->snd_flags = stcb->asoc.def_send.sinfo_flags; + info->snd_flags &= 0xfff0; info->snd_ppid = stcb->asoc.def_send.sinfo_ppid; info->snd_context = stcb->asoc.def_send.sinfo_context; SCTP_TCB_UNLOCK(stcb); @@ -3038,6 +3039,7 @@ flags_out: SCTP_INP_RLOCK(inp); info->snd_sid = inp->def_send.sinfo_stream; info->snd_flags = inp->def_send.sinfo_flags; + info->snd_flags &= 0xfff0; info->snd_ppid = inp->def_send.sinfo_ppid; info->snd_context = inp->def_send.sinfo_context; SCTP_INP_RUNLOCK(inp); @@ -3051,6 +3053,33 @@ flags_out: } break; } + case SCTP_DEFAULT_PRINFO: + { + struct sctp_default_prinfo *info; + + SCTP_CHECK_AND_CAST(info, optval, struct sctp_default_prinfo, *optsize); + SCTP_FIND_STCB(inp, stcb, info->pr_assoc_id); + + if (stcb) { + info->pr_policy = PR_SCTP_POLICY(stcb->asoc.def_send.sinfo_flags); + info->pr_value = stcb->asoc.def_send.sinfo_timetolive; + SCTP_TCB_UNLOCK(stcb); + } else { + if (info->pr_assoc_id == SCTP_FUTURE_ASSOC) { + SCTP_INP_RLOCK(inp); + info->pr_policy = PR_SCTP_POLICY(inp->def_send.sinfo_flags); + info->pr_value = inp->def_send.sinfo_timetolive; + SCTP_INP_RUNLOCK(inp); + } else { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); + error = EINVAL; + } + } + if (error == 0) { + *optsize = sizeof(struct sctp_default_prinfo); + } + break; + } default: SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOPROTOOPT); error = ENOPROTOOPT; @@ -5043,6 +5072,7 @@ sctp_setopt(struct socket *so, int optna case SCTP_DEFAULT_SNDINFO: { struct sctp_sndinfo *info; + uint16_t policy; SCTP_CHECK_AND_CAST(info, optval, struct sctp_sndinfo, optsize); SCTP_FIND_STCB(inp, stcb, info->snd_assoc_id); @@ -5050,7 +5080,9 @@ sctp_setopt(struct socket *so, int optna if (stcb) { if (info->snd_sid < stcb->asoc.streamoutcnt) { stcb->asoc.def_send.sinfo_stream = info->snd_sid; + policy = PR_SCTP_POLICY(stcb->asoc.def_send.sinfo_flags); stcb->asoc.def_send.sinfo_flags = info->snd_flags; + stcb->asoc.def_send.sinfo_flags |= policy; stcb->asoc.def_send.sinfo_ppid = info->snd_ppid; stcb->asoc.def_send.sinfo_context = info->snd_context; } else { @@ -5063,7 +5095,9 @@ sctp_setopt(struct socket *so, int optna (info->snd_assoc_id == SCTP_ALL_ASSOC)) { SCTP_INP_WLOCK(inp); inp->def_send.sinfo_stream = info->snd_sid; + policy = PR_SCTP_POLICY(inp->def_send.sinfo_flags); inp->def_send.sinfo_flags = info->snd_flags; + inp->def_send.sinfo_flags |= policy; inp->def_send.sinfo_ppid = info->snd_ppid; inp->def_send.sinfo_context = info->snd_context; SCTP_INP_WUNLOCK(inp); @@ -5075,7 +5109,9 @@ sctp_setopt(struct socket *so, int optna SCTP_TCB_LOCK(stcb); if (info->snd_sid < stcb->asoc.streamoutcnt) { stcb->asoc.def_send.sinfo_stream = info->snd_sid; + policy = PR_SCTP_POLICY(stcb->asoc.def_send.sinfo_flags); stcb->asoc.def_send.sinfo_flags = info->snd_flags; + stcb->asoc.def_send.sinfo_flags |= policy; stcb->asoc.def_send.sinfo_ppid = info->snd_ppid; stcb->asoc.def_send.sinfo_context = info->snd_context; } @@ -5086,6 +5122,44 @@ sctp_setopt(struct socket *so, int optna } break; } + case SCTP_DEFAULT_PRINFO: + { + struct sctp_default_prinfo *info; + + SCTP_CHECK_AND_CAST(info, optval, struct sctp_default_prinfo, optsize); + SCTP_FIND_STCB(inp, stcb, info->pr_assoc_id); + + if (PR_SCTP_INVALID_POLICY(info->pr_policy)) { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); + error = EINVAL; + break; + } + if (stcb) { + stcb->asoc.def_send.sinfo_flags &= 0xfff0; + stcb->asoc.def_send.sinfo_flags |= info->pr_policy; + SCTP_TCB_UNLOCK(stcb); + } else { + if ((info->pr_assoc_id == SCTP_FUTURE_ASSOC) || + (info->pr_assoc_id == SCTP_ALL_ASSOC)) { + SCTP_INP_WLOCK(inp); + inp->def_send.sinfo_flags &= 0xfff0; + inp->def_send.sinfo_flags |= info->pr_policy; + SCTP_INP_WUNLOCK(inp); + } + if ((info->pr_assoc_id == SCTP_CURRENT_ASSOC) || + (info->pr_assoc_id == SCTP_ALL_ASSOC)) { + SCTP_INP_RLOCK(inp); + LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) { + SCTP_TCB_LOCK(stcb); + stcb->asoc.def_send.sinfo_flags &= 0xfff0; + stcb->asoc.def_send.sinfo_flags |= info->pr_policy; + SCTP_TCB_UNLOCK(stcb); + } + SCTP_INP_RUNLOCK(inp); + } + } + break; + } default: SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOPROTOOPT); error = ENOPROTOOPT; From owner-svn-src-head@FreeBSD.ORG Thu Jun 16 21:21:27 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 50D9E106566B; Thu, 16 Jun 2011 21:21:27 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id A83C18FC14; Thu, 16 Jun 2011 21:21:26 +0000 (UTC) Received: by vws18 with SMTP id 18so2127440vws.13 for ; Thu, 16 Jun 2011 14:21:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=xSJrg9jcJY7KUT1jlHqpiAhUMG6Wj8vTveuQaQnYIV0=; b=h562+bBqf5WGtZfG6BvQ99np9G5V27wTpqutHnBzCU3ueeqnSR52MWMQMkqRLg5wzy NE2MOyDB9CA3pNKfZLtQW9keMp5HDJ61LHGLX9VZjWwrr/BA0bQG80iS3JFoDnrKcLEQ b0w/x6VTorfML6z8Mz8eZ+sForlEAkxBI3J3s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=kN1Gil4RZkbu9v+91kWrCR2oFEPmweoXRyDXKBFEyC6kzK3DiD8GUx0/RjZH0Q1AqY KNKLDMw9V72qpmreAPu0eHu+n+FEu26MxRigwJJLZ/DoWcckbMKrbIwcZDkD3pa3J4Px Ke82bQ0f3YqllZj2F13nR1CGYsSBE5kVGtnb4= MIME-Version: 1.0 Received: by 10.220.48.136 with SMTP id r8mr165447vcf.93.1308259285829; Thu, 16 Jun 2011 14:21:25 -0700 (PDT) Received: by 10.220.189.202 with HTTP; Thu, 16 Jun 2011 14:21:25 -0700 (PDT) In-Reply-To: <201106161424.43811.jhb@freebsd.org> References: <201106161535.p5GFZCb7034904@svn.freebsd.org> <201106161424.43811.jhb@freebsd.org> Date: Thu, 16 Jun 2011 14:21:25 -0700 Message-ID: From: Garrett Cooper To: John Baldwin Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Tai-hwa Liang , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Warner Losh Subject: Re: svn commit: r223151 - head/lib/libstand X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2011 21:21:27 -0000 On Thu, Jun 16, 2011 at 11:24 AM, John Baldwin wrote: > On Thursday, June 16, 2011 1:40:36 pm Garrett Cooper wrote: >> On Thu, Jun 16, 2011 at 8:53 AM, Warner Losh wrote: >> > >> > On Jun 16, 2011, at 9:35 AM, Tai-hwa Liang wrote: >> > >> >> Author: avatar >> >> Date: Thu Jun 16 15:35:12 2011 >> >> New Revision: 223151 >> >> URL: http://svn.freebsd.org/changeset/base/223151 >> >> >> >> Log: >> >> =A0Using the correct format string(%zu) for size_t type. =A0This shou= ld fix > 64 >> >> =A0bits builds. >> >> >> >> =A0Submitted by: =A0 =A0 =A0 =A0Garrett Cooper >> > >> > How about we hold all fixes until it *ACTUALLY* builds on all universe > platforms? >> > >> > I hate to be cranky, but build breakage costs a lot of time. =A0And fo= r > stupid stuff like this? =A0I'm inclined to force WARNS=3D0 until people c= an > actually fix it right. >> >> This was stupid breakage on my part for not running this through >> universe first. The patch that builds upon this that I submitted in >> the other thread so far _does_ unbreak universe on ia64 and mips*. >> Still working on getting it to pass through amd64, i386, and sparc64 >> at least, which is going to be a few more hours because for some magic >> reason make -j doesn't work for me with universe. > > You probably want to do 'make JFLAG=3D-j6 tinderbox' rather than 'make -j= 6 > tinderbox'. Yeah, that works better :). It doesn't instantly bomb out like with make -j universe . Well, here goes to the all comprehensive take 3 (take 2 seems to have gone ok). Thanks! -Garrett From owner-svn-src-head@FreeBSD.ORG Thu Jun 16 21:27:40 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C921C106566B; Thu, 16 Jun 2011 21:27:40 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay04.stack.nl [IPv6:2001:610:1108:5010::107]) by mx1.freebsd.org (Postfix) with ESMTP id 646098FC0A; Thu, 16 Jun 2011 21:27:40 +0000 (UTC) Received: from turtle.stack.nl (turtle.stack.nl [IPv6:2001:610:1108:5010::132]) by mx1.stack.nl (Postfix) with ESMTP id 92B4A1DD417; Thu, 16 Jun 2011 23:27:38 +0200 (CEST) Received: by turtle.stack.nl (Postfix, from userid 1677) id 884DF174C4; Thu, 16 Jun 2011 23:27:38 +0200 (CEST) Date: Thu, 16 Jun 2011 23:27:38 +0200 From: Jilles Tjoelker To: "Bjoern A. Zeeb" Message-ID: <20110616212738.GA73657@stack.nl> References: <200705131412.l4DECf2N068712@repoman.freebsd.org> <20110612213330.D10590@maildrop.int.zabbadoz.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110612213330.D10590@maildrop.int.zabbadoz.net> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Daniel Eischen , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@FreeBSD.org Subject: Re: cvs commit: src Makefile.inc1 src/lib/libc Makefile src/lib/libc_r Makefile src/lib/libpthread Makefile pthread.map src/lib/libpthread/thread thr_private.h src/lib/librt Makefile src/lib/libthr Makefile pthread.map src/lib/libthread_db Makefile ... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2011 21:27:40 -0000 On Sun, Jun 12, 2011 at 09:38:42PM +0000, Bjoern A. Zeeb wrote: > http://svnweb.freebsd.org/base?view=revision&revision=169524 > I figured WITHOUT_SYMVER= hs been useless since 201001. I am no > longer able to do build worlds with WITHOUT_SYMVER= set in src.conf > on a system with symbol versioning. > I'd love someone to fix that and allow us to build libraries without > all the historic stuff in them. If we cannot get it back working our > libraries will grow bigger and bigger forever. > If one is building images for clean-state systems that will never run > anything older than the current CURRENT build, there is no need for > the extra size. Contrary to what people think, memory and direct > attached storage can still be expensive in some environments. > Anyone who understands the system can come up with patches to fix this? I think disabling symver completely is too much: it implies a new mutually incompatible set of binaries. What should be done instead is allowing to compile out the compatibility functions. This means all __sym_compat() directives and all functions referred to by them. A simple approach would use a yes/no #ifdef, while a more sophisticated approach would allow choosing the oldest version to retain compatibility with, for example freebsd7_semctl() in lib/libc/gen/semctl.c would be compiled in iff compatibility with FreeBSD 7.x was requested. With just symver, a binary for FreeBSD version for which compatibility was not compiled in will abort if and when it attempts to use a function that was changed in a later version. -- Jilles Tjoelker From owner-svn-src-head@FreeBSD.ORG Thu Jun 16 21:50:28 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E97E3106566B; Thu, 16 Jun 2011 21:50:28 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D8C7E8FC18; Thu, 16 Jun 2011 21:50:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5GLoS9l047180; Thu, 16 Jun 2011 21:50:28 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5GLoSWL047177; Thu, 16 Jun 2011 21:50:28 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201106162150.p5GLoSWL047177@svn.freebsd.org> From: Jilles Tjoelker Date: Thu, 16 Jun 2011 21:50:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223163 - in head: bin/sh tools/regression/bin/sh/expansion X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2011 21:50:29 -0000 Author: jilles Date: Thu Jun 16 21:50:28 2011 New Revision: 223163 URL: http://svn.freebsd.org/changeset/base/223163 Log: sh: Reduce unnecessary forks with eval. The eval special builtin now runs the code with EV_EXIT if it was run with EV_EXIT itself. In particular, this eliminates one fork when a command substitution contains an eval command that ends with an external program or a subshell. This is similar to what r220978 did for functions. Added: head/tools/regression/bin/sh/expansion/cmdsubst11.0 (contents, props changed) Modified: head/bin/sh/eval.c Modified: head/bin/sh/eval.c ============================================================================== --- head/bin/sh/eval.c Thu Jun 16 21:12:36 2011 (r223162) +++ head/bin/sh/eval.c Thu Jun 16 21:50:28 2011 (r223163) @@ -140,7 +140,7 @@ evalcmd(int argc, char **argv) STPUTC('\0', concat); p = grabstackstr(concat); } - evalstring(p, builtin_flags & EV_TESTED); + evalstring(p, builtin_flags); } else exitstatus = 0; return exitstatus; @@ -908,6 +908,7 @@ evalcommand(union node *cmd, int flags, dup2(pip[1], 1); close(pip[1]); } + flags &= ~EV_BACKCMD; } flags |= EV_EXIT; } Added: head/tools/regression/bin/sh/expansion/cmdsubst11.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/expansion/cmdsubst11.0 Thu Jun 16 21:50:28 2011 (r223163) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +# Not required by POSIX but useful for efficiency. + +[ $$ = $(eval '${SH} -c echo\ \$PPID') ] From owner-svn-src-head@FreeBSD.ORG Thu Jun 16 21:59:16 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F9E2106566C; Thu, 16 Jun 2011 21:59:16 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5FC598FC16; Thu, 16 Jun 2011 21:59:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5GLxGoS047471; Thu, 16 Jun 2011 21:59:16 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5GLxGQK047469; Thu, 16 Jun 2011 21:59:16 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201106162159.p5GLxGQK047469@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 16 Jun 2011 21:59:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223164 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2011 21:59:16 -0000 Author: kib Date: Thu Jun 16 21:59:16 2011 New Revision: 223164 URL: http://svn.freebsd.org/changeset/base/223164 Log: Fix silly typo that resulted in the a.out process stack to end at ~200MB instead of 3GB on amd64. Modified: head/sys/kern/imgact_aout.c Modified: head/sys/kern/imgact_aout.c ============================================================================== --- head/sys/kern/imgact_aout.c Thu Jun 16 21:50:28 2011 (r223163) +++ head/sys/kern/imgact_aout.c Thu Jun 16 21:59:16 2011 (r223164) @@ -103,7 +103,7 @@ struct sysentvec aout_sysvec = { #elif defined(__amd64__) -#define AOUT32_USRSTACK 0xbfc0000 +#define AOUT32_USRSTACK 0xbfc00000 #define AOUT32_PS_STRINGS \ (AOUT32_USRSTACK - sizeof(struct freebsd32_ps_strings)) From owner-svn-src-head@FreeBSD.ORG Thu Jun 16 22:00:59 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AADA2106566C; Thu, 16 Jun 2011 22:00:59 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9B19A8FC08; Thu, 16 Jun 2011 22:00:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5GM0x9b047577; Thu, 16 Jun 2011 22:00:59 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5GM0xfi047575; Thu, 16 Jun 2011 22:00:59 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201106162200.p5GM0xfi047575@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 16 Jun 2011 22:00:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223165 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2011 22:00:59 -0000 Author: kib Date: Thu Jun 16 22:00:59 2011 New Revision: 223165 URL: http://svn.freebsd.org/changeset/base/223165 Log: Do not trash the argv[0] pointer for an a.out process on amd64. Found with the binary provided by joerg. Modified: head/sys/kern/imgact_aout.c Modified: head/sys/kern/imgact_aout.c ============================================================================== --- head/sys/kern/imgact_aout.c Thu Jun 16 21:59:16 2011 (r223164) +++ head/sys/kern/imgact_aout.c Thu Jun 16 22:00:59 2011 (r223165) @@ -152,7 +152,7 @@ aout_fixup(register_t **stack_base, stru { *(char **)stack_base -= sizeof(uint32_t); - return (suword(*stack_base, imgp->args->argc)); + return (suword32(*stack_base, imgp->args->argc)); } static int From owner-svn-src-head@FreeBSD.ORG Thu Jun 16 22:03:17 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F36E1065680; Thu, 16 Jun 2011 22:03:17 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 052828FC1E; Thu, 16 Jun 2011 22:03:16 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id p5GM3DwC052683 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 17 Jun 2011 01:03:13 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id p5GM3D9Z048845; Fri, 17 Jun 2011 01:03:13 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id p5GM3DGj048844; Fri, 17 Jun 2011 01:03:13 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 17 Jun 2011 01:03:13 +0300 From: Kostik Belousov To: Jilles Tjoelker Message-ID: <20110616220313.GT48734@deviant.kiev.zoral.com.ua> References: <200705131412.l4DECf2N068712@repoman.freebsd.org> <20110612213330.D10590@maildrop.int.zabbadoz.net> <20110616212738.GA73657@stack.nl> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="yeOXabQBkPz8M8o8" Content-Disposition: inline In-Reply-To: <20110616212738.GA73657@stack.nl> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: Daniel Eischen , "Bjoern A. Zeeb" , svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-head@freebsd.org Subject: Re: cvs commit: src Makefile.inc1 src/lib/libc Makefile src/lib/libc_r Makefile src/lib/libpthread Makefile pthread.map src/lib/libpthread/thread thr_private.h src/lib/librt Makefile src/lib/libthr Makefile pthread.map src/lib/libthread_db Makefile ... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2011 22:03:17 -0000 --yeOXabQBkPz8M8o8 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jun 16, 2011 at 11:27:38PM +0200, Jilles Tjoelker wrote: > On Sun, Jun 12, 2011 at 09:38:42PM +0000, Bjoern A. Zeeb wrote: > > http://svnweb.freebsd.org/base?view=3Drevision&revision=3D169524 >=20 > > I figured WITHOUT_SYMVER=3D hs been useless since 201001. I am no > > longer able to do build worlds with WITHOUT_SYMVER=3D set in src.conf > > on a system with symbol versioning. >=20 > > I'd love someone to fix that and allow us to build libraries without > > all the historic stuff in them. If we cannot get it back working our > > libraries will grow bigger and bigger forever. >=20 > > If one is building images for clean-state systems that will never run > > anything older than the current CURRENT build, there is no need for > > the extra size. Contrary to what people think, memory and direct > > attached storage can still be expensive in some environments. >=20 > > Anyone who understands the system can come up with patches to fix this? >=20 > I think disabling symver completely is too much: it implies a new > mutually incompatible set of binaries. What should be done instead is > allowing to compile out the compatibility functions. This means all > __sym_compat() directives and all functions referred to by them. A > simple approach would use a yes/no #ifdef, while a more sophisticated > approach would allow choosing the oldest version to retain compatibility > with, for example freebsd7_semctl() in lib/libc/gen/semctl.c would be > compiled in iff compatibility with FreeBSD 7.x was requested. >=20 > With just symver, a binary for FreeBSD version for which compatibility > was not compiled in will abort if and when it attempts to use a function > that was changed in a later version. Preventing which behaviour was explicitely the goal of designing the symver mechanism at the first place. And, disabling symver does not removes the "compat cruft" from the system, it only makes the compat code not accessible. --yeOXabQBkPz8M8o8 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk36faAACgkQC3+MBN1Mb4hxOQCcDgPnqR8jyQ9t70dCF4jDyquv oyAAnRZQruWWrbmn6rKhofV6CRKqIvw7 =j3ZQ -----END PGP SIGNATURE----- --yeOXabQBkPz8M8o8-- From owner-svn-src-head@FreeBSD.ORG Thu Jun 16 22:05:56 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A5A7A1065674; Thu, 16 Jun 2011 22:05:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 95A4F8FC18; Thu, 16 Jun 2011 22:05:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5GM5uht047761; Thu, 16 Jun 2011 22:05:56 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5GM5uDA047758; Thu, 16 Jun 2011 22:05:56 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201106162205.p5GM5uDA047758@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 16 Jun 2011 22:05:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223166 - head/sys/compat/freebsd32 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2011 22:05:56 -0000 Author: kib Date: Thu Jun 16 22:05:56 2011 New Revision: 223166 URL: http://svn.freebsd.org/changeset/base/223166 Log: Implement compat32 for old lseek, for the a.out binaries on amd64. Modified: head/sys/compat/freebsd32/freebsd32_misc.c head/sys/compat/freebsd32/syscalls.master Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Thu Jun 16 22:00:59 2011 (r223165) +++ head/sys/compat/freebsd32/freebsd32_misc.c Thu Jun 16 22:05:56 2011 (r223166) @@ -1416,6 +1416,19 @@ freebsd32_pwrite(struct thread *td, stru return (pwrite(td, &ap)); } +#ifdef COMPAT_43 +int +ofreebsd32_lseek(struct thread *td, struct ofreebsd32_lseek_args *uap) +{ + struct lseek_args nuap; + + nuap.fd = uap->fd; + nuap.offset = uap->offset; + nuap.whence = uap->whence; + return (lseek(td, &nuap)); +} +#endif + int freebsd32_lseek(struct thread *td, struct freebsd32_lseek_args *uap) { Modified: head/sys/compat/freebsd32/syscalls.master ============================================================================== --- head/sys/compat/freebsd32/syscalls.master Thu Jun 16 22:00:59 2011 (r223165) +++ head/sys/compat/freebsd32/syscalls.master Thu Jun 16 22:05:56 2011 (r223166) @@ -89,7 +89,8 @@ 18 AUE_GETFSSTAT COMPAT4 { int freebsd32_getfsstat( \ struct statfs32 *buf, long bufsize, \ int flags); } -19 AUE_LSEEK OBSOL olseek +19 AUE_LSEEK COMPAT { int freebsd32_lseek(int fd, int offset, \ + int whence); } 20 AUE_GETPID NOPROTO { pid_t getpid(void); } 21 AUE_MOUNT NOPROTO { int mount(char *type, char *path, \ int flags, caddr_t data); } From owner-svn-src-head@FreeBSD.ORG Thu Jun 16 22:06:35 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 85C7E1065672; Thu, 16 Jun 2011 22:06:35 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 752E68FC13; Thu, 16 Jun 2011 22:06:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5GM6ZfD047829; Thu, 16 Jun 2011 22:06:35 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5GM6Z0x047824; Thu, 16 Jun 2011 22:06:35 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201106162206.p5GM6Z0x047824@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 16 Jun 2011 22:06:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223167 - head/sys/compat/freebsd32 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2011 22:06:35 -0000 Author: kib Date: Thu Jun 16 22:06:35 2011 New Revision: 223167 URL: http://svn.freebsd.org/changeset/base/223167 Log: Regen. Modified: head/sys/compat/freebsd32/freebsd32_proto.h head/sys/compat/freebsd32/freebsd32_syscall.h head/sys/compat/freebsd32/freebsd32_syscalls.c head/sys/compat/freebsd32/freebsd32_sysent.c Modified: head/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_proto.h Thu Jun 16 22:05:56 2011 (r223166) +++ head/sys/compat/freebsd32/freebsd32_proto.h Thu Jun 16 22:06:35 2011 (r223167) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 223166 2011-06-16 22:05:56Z kib */ #ifndef _FREEBSD32_SYSPROTO_H_ @@ -690,6 +690,11 @@ int freebsd32_posix_fallocate(struct thr #if !defined(PAD64_REQUIRED) && defined(__powerpc__) #define PAD64_REQUIRED #endif +struct ofreebsd32_lseek_args { + char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; + char offset_l_[PADL_(int)]; int offset; char offset_r_[PADR_(int)]; + char whence_l_[PADL_(int)]; int whence; char whence_r_[PADR_(int)]; +}; struct ofreebsd32_stat_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; char ub_l_[PADL_(struct ostat32 *)]; struct ostat32 * ub; char ub_r_[PADR_(struct ostat32 *)]; @@ -747,6 +752,7 @@ struct ofreebsd32_getdirentries_args { #ifdef PAD64_REQUIRED #else #endif +int ofreebsd32_lseek(struct thread *, struct ofreebsd32_lseek_args *); int ofreebsd32_stat(struct thread *, struct ofreebsd32_stat_args *); int ofreebsd32_lstat(struct thread *, struct ofreebsd32_lstat_args *); int ofreebsd32_sigaction(struct thread *, struct ofreebsd32_sigaction_args *); @@ -923,6 +929,7 @@ int freebsd7_freebsd32_shmctl(struct thr #define FREEBSD32_SYS_AUE_freebsd32_wait4 AUE_WAIT4 #define FREEBSD32_SYS_AUE_freebsd4_freebsd32_getfsstat AUE_GETFSSTAT +#define FREEBSD32_SYS_AUE_ofreebsd32_lseek AUE_LSEEK #define FREEBSD32_SYS_AUE_freebsd32_recvmsg AUE_RECVMSG #define FREEBSD32_SYS_AUE_freebsd32_sendmsg AUE_SENDMSG #define FREEBSD32_SYS_AUE_freebsd32_recvfrom AUE_RECVFROM Modified: head/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscall.h Thu Jun 16 22:05:56 2011 (r223166) +++ head/sys/compat/freebsd32/freebsd32_syscall.h Thu Jun 16 22:06:35 2011 (r223167) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 223166 2011-06-16 22:05:56Z kib */ #define FREEBSD32_SYS_syscall 0 @@ -25,7 +25,7 @@ #define FREEBSD32_SYS_chown 16 #define FREEBSD32_SYS_break 17 #define FREEBSD32_SYS_freebsd4_freebsd32_getfsstat 18 - /* 19 is obsolete olseek */ + /* 19 is old freebsd32_lseek */ #define FREEBSD32_SYS_getpid 20 #define FREEBSD32_SYS_mount 21 #define FREEBSD32_SYS_unmount 22 Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscalls.c Thu Jun 16 22:05:56 2011 (r223166) +++ head/sys/compat/freebsd32/freebsd32_syscalls.c Thu Jun 16 22:06:35 2011 (r223167) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 223166 2011-06-16 22:05:56Z kib */ const char *freebsd32_syscallnames[] = { @@ -29,7 +29,7 @@ const char *freebsd32_syscallnames[] = { "chown", /* 16 = chown */ "break", /* 17 = break */ "compat4.freebsd32_getfsstat", /* 18 = freebsd4 freebsd32_getfsstat */ - "obs_olseek", /* 19 = obsolete olseek */ + "compat.freebsd32_lseek", /* 19 = old freebsd32_lseek */ "getpid", /* 20 = getpid */ "mount", /* 21 = mount */ "unmount", /* 22 = unmount */ Modified: head/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_sysent.c Thu Jun 16 22:05:56 2011 (r223166) +++ head/sys/compat/freebsd32/freebsd32_sysent.c Thu Jun 16 22:06:35 2011 (r223167) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 223166 2011-06-16 22:05:56Z kib */ #include "opt_compat.h" @@ -66,7 +66,7 @@ struct sysent freebsd32_sysent[] = { { AS(chown_args), (sy_call_t *)chown, AUE_CHOWN, NULL, 0, 0, 0, SY_THR_STATIC }, /* 16 = chown */ { AS(obreak_args), (sy_call_t *)obreak, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 17 = break */ { compat4(AS(freebsd4_freebsd32_getfsstat_args),freebsd32_getfsstat), AUE_GETFSSTAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 18 = freebsd4 freebsd32_getfsstat */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 19 = obsolete olseek */ + { compat(AS(ofreebsd32_lseek_args),freebsd32_lseek), AUE_LSEEK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 19 = old freebsd32_lseek */ { 0, (sy_call_t *)getpid, AUE_GETPID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 20 = getpid */ { AS(mount_args), (sy_call_t *)mount, AUE_MOUNT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 21 = mount */ { AS(unmount_args), (sy_call_t *)unmount, AUE_UMOUNT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 22 = unmount */ From owner-svn-src-head@FreeBSD.ORG Thu Jun 16 22:07:53 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 63BE6106566B; Thu, 16 Jun 2011 22:07:53 +0000 (UTC) (envelope-from deischen@freebsd.org) Received: from mail.netplex.net (mail.netplex.net [204.213.176.10]) by mx1.freebsd.org (Postfix) with ESMTP id 179A58FC19; Thu, 16 Jun 2011 22:07:52 +0000 (UTC) Received: from sea.ntplx.net (sea.ntplx.net [204.213.176.11]) by mail.netplex.net (8.14.4/8.14.4/NETPLEX) with ESMTP id p5GLtBcM016832; Thu, 16 Jun 2011 17:55:11 -0400 X-Virus-Scanned: by AMaViS and Clam AntiVirus (mail.netplex.net) X-Greylist: Message whitelisted by DRAC access database, not delayed by milter-greylist-4.2.6 (mail.netplex.net [204.213.176.10]); Thu, 16 Jun 2011 17:55:11 -0400 (EDT) Date: Thu, 16 Jun 2011 17:55:11 -0400 (EDT) From: Daniel Eischen X-X-Sender: eischen@sea.ntplx.net To: Jilles Tjoelker In-Reply-To: <20110616212738.GA73657@stack.nl> Message-ID: References: <200705131412.l4DECf2N068712@repoman.freebsd.org> <20110612213330.D10590@maildrop.int.zabbadoz.net> <20110616212738.GA73657@stack.nl> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, "Bjoern A. Zeeb" , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: cvs commit: src Makefile.inc1 src/lib/libc Makefile src/lib/libc_r Makefile src/lib/libpthread Makefile pthread.map src/lib/libpthread/thread thr_private.h src/lib/librt Makefile src/lib/libthr Makefile pthread.map src/lib/libthread_db Makefile ... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Daniel Eischen List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2011 22:07:53 -0000 On Thu, 16 Jun 2011, Jilles Tjoelker wrote: > On Sun, Jun 12, 2011 at 09:38:42PM +0000, Bjoern A. Zeeb wrote: >> http://svnweb.freebsd.org/base?view=revision&revision=169524 > >> I figured WITHOUT_SYMVER= hs been useless since 201001. I am no >> longer able to do build worlds with WITHOUT_SYMVER= set in src.conf >> on a system with symbol versioning. > >> I'd love someone to fix that and allow us to build libraries without >> all the historic stuff in them. If we cannot get it back working our >> libraries will grow bigger and bigger forever. > >> If one is building images for clean-state systems that will never run >> anything older than the current CURRENT build, there is no need for >> the extra size. Contrary to what people think, memory and direct >> attached storage can still be expensive in some environments. > >> Anyone who understands the system can come up with patches to fix this? BTW, I didn't get bz's email quoted above. I'm sorry if I was CC'd and missed it. -- DE From owner-svn-src-head@FreeBSD.ORG Thu Jun 16 22:07:57 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3F39C1065672; Thu, 16 Jun 2011 22:07:57 +0000 (UTC) (envelope-from deischen@freebsd.org) Received: from mail.netplex.net (mail.netplex.net [204.213.176.10]) by mx1.freebsd.org (Postfix) with ESMTP id CE59E8FC0A; Thu, 16 Jun 2011 22:07:56 +0000 (UTC) Received: from sea.ntplx.net (sea.ntplx.net [204.213.176.11]) by mail.netplex.net (8.14.4/8.14.4/NETPLEX) with ESMTP id p5GLqWvf015402; Thu, 16 Jun 2011 17:52:32 -0400 X-Virus-Scanned: by AMaViS and Clam AntiVirus (mail.netplex.net) X-Greylist: Message whitelisted by DRAC access database, not delayed by milter-greylist-4.2.6 (mail.netplex.net [204.213.176.10]); Thu, 16 Jun 2011 17:52:32 -0400 (EDT) Date: Thu, 16 Jun 2011 17:52:32 -0400 (EDT) From: Daniel Eischen X-X-Sender: eischen@sea.ntplx.net To: Jilles Tjoelker In-Reply-To: <20110616212738.GA73657@stack.nl> Message-ID: References: <200705131412.l4DECf2N068712@repoman.freebsd.org> <20110612213330.D10590@maildrop.int.zabbadoz.net> <20110616212738.GA73657@stack.nl> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, "Bjoern A. Zeeb" , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: cvs commit: src Makefile.inc1 src/lib/libc Makefile src/lib/libc_r Makefile src/lib/libpthread Makefile pthread.map src/lib/libpthread/thread thr_private.h src/lib/librt Makefile src/lib/libthr Makefile pthread.map src/lib/libthread_db Makefile ... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Daniel Eischen List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2011 22:07:57 -0000 On Thu, 16 Jun 2011, Jilles Tjoelker wrote: > On Sun, Jun 12, 2011 at 09:38:42PM +0000, Bjoern A. Zeeb wrote: >> http://svnweb.freebsd.org/base?view=revision&revision=169524 > >> I figured WITHOUT_SYMVER= hs been useless since 201001. I am no >> longer able to do build worlds with WITHOUT_SYMVER= set in src.conf >> on a system with symbol versioning. > >> I'd love someone to fix that and allow us to build libraries without >> all the historic stuff in them. If we cannot get it back working our >> libraries will grow bigger and bigger forever. > >> If one is building images for clean-state systems that will never run >> anything older than the current CURRENT build, there is no need for >> the extra size. Contrary to what people think, memory and direct >> attached storage can still be expensive in some environments. > >> Anyone who understands the system can come up with patches to fix this? > > I think disabling symver completely is too much: it implies a new > mutually incompatible set of binaries. What should be done instead is > allowing to compile out the compatibility functions. This means all > __sym_compat() directives and all functions referred to by them. A > simple approach would use a yes/no #ifdef, while a more sophisticated > approach would allow choosing the oldest version to retain compatibility > with, for example freebsd7_semctl() in lib/libc/gen/semctl.c would be > compiled in iff compatibility with FreeBSD 7.x was requested. I like this approach. But if you can do that, then is it much more to remove symbol versioning completely? I've forgotten. I know there were some potential problems trying to install a symver-free world over a symver world. -- DE From owner-svn-src-head@FreeBSD.ORG Thu Jun 16 23:40:11 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 538931065673; Thu, 16 Jun 2011 23:40:11 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2970B8FC15; Thu, 16 Jun 2011 23:40:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5GNeB6q050630; Thu, 16 Jun 2011 23:40:11 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5GNeBIY050626; Thu, 16 Jun 2011 23:40:11 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201106162340.p5GNeBIY050626@svn.freebsd.org> From: Kirk McKusick Date: Thu, 16 Jun 2011 23:40:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223169 - in head: sys/ufs/ffs usr.sbin/makefs/ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2011 23:40:11 -0000 Author: mckusick Date: Thu Jun 16 23:40:10 2011 New Revision: 223169 URL: http://svn.freebsd.org/changeset/base/223169 Log: Drop the include of from usr.sbin/makefs/ffs/ffs_bswap.c and usr.sbin/makefs/ffs/ffs_subr.c as they have no need of anything in that file. No other programs or libraries include (nor should they as it is totally in-kernel interfaces). For added protection I enclosed the entire contents of in ifdef _KERNEL. Feedback from: Bruce Evans and Tai-hwa Liang Modified: head/sys/ufs/ffs/ffs_extern.h head/usr.sbin/makefs/ffs/ffs_bswap.c head/usr.sbin/makefs/ffs/ffs_subr.c Modified: head/sys/ufs/ffs/ffs_extern.h ============================================================================== --- head/sys/ufs/ffs/ffs_extern.h Thu Jun 16 23:36:01 2011 (r223168) +++ head/sys/ufs/ffs/ffs_extern.h Thu Jun 16 23:40:10 2011 (r223169) @@ -33,7 +33,10 @@ #ifndef _UFS_FFS_EXTERN_H #define _UFS_FFS_EXTERN_H -enum vtype; +#ifndef _KERNEL +#error "No user-serving parts inside" +#else + struct buf; struct cg; struct fid; @@ -168,7 +171,6 @@ void softdep_freework(struct workhead *) int ffs_rdonly(struct inode *); -#ifdef _KERNEL TAILQ_HEAD(snaphead, inode); struct snapdata { @@ -178,6 +180,7 @@ struct snapdata { daddr_t *sn_blklist; struct lock sn_lock; }; + #endif /* _KERNEL */ #endif /* !_UFS_FFS_EXTERN_H */ Modified: head/usr.sbin/makefs/ffs/ffs_bswap.c ============================================================================== --- head/usr.sbin/makefs/ffs/ffs_bswap.c Thu Jun 16 23:36:01 2011 (r223168) +++ head/usr.sbin/makefs/ffs/ffs_bswap.c Thu Jun 16 23:40:10 2011 (r223169) @@ -41,14 +41,6 @@ __FBSDID("$FreeBSD$"); #include #include "ffs/ufs_bswap.h" #include -/* XXX temporary */ -struct ufsmount; -struct bufobj; -struct mount; -struct vnode; -typedef int vfs_vget_t(struct mount *mp, ino_t ino, int flags, - struct vnode **vpp); -#include #if !defined(_KERNEL) #include Modified: head/usr.sbin/makefs/ffs/ffs_subr.c ============================================================================== --- head/usr.sbin/makefs/ffs/ffs_subr.c Thu Jun 16 23:36:01 2011 (r223168) +++ head/usr.sbin/makefs/ffs/ffs_subr.c Thu Jun 16 23:40:10 2011 (r223169) @@ -38,15 +38,8 @@ __FBSDID("$FreeBSD$"); #include #include -/* XXX temporary */ -struct ufsmount; -struct bufobj; -struct mount; -struct vnode; -typedef int vfs_vget_t(struct mount *mp, ino_t ino, int flags, - struct vnode **vpp); -#include #include "ffs/ufs_bswap.h" + void panic __P((const char *, ...)) __attribute__((__noreturn__,__format__(__printf__,1,2))); From owner-svn-src-head@FreeBSD.ORG Fri Jun 17 04:26:04 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B1211065672; Fri, 17 Jun 2011 04:26:04 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D65928FC17; Fri, 17 Jun 2011 04:26:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5H4Q31D059217; Fri, 17 Jun 2011 04:26:03 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5H4Q3MK059214; Fri, 17 Jun 2011 04:26:03 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201106170426.p5H4Q3MK059214@svn.freebsd.org> From: Marcel Moolenaar Date: Fri, 17 Jun 2011 04:26:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223170 - in head/sys/ia64: ia64 include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jun 2011 04:26:04 -0000 Author: marcel Date: Fri Jun 17 04:26:03 2011 New Revision: 223170 URL: http://svn.freebsd.org/changeset/base/223170 Log: Properly serialize the global shootdown with the instruction stream of the local processor. Also explicitly invalidate the ALAT. This is done on the other CPUs in the coherence domain by virtue of the ptc.ga instruction, but does not apply to the local CPU. Modified: head/sys/ia64/ia64/pmap.c head/sys/ia64/include/ia64_cpu.h Modified: head/sys/ia64/ia64/pmap.c ============================================================================== --- head/sys/ia64/ia64/pmap.c Thu Jun 16 23:40:10 2011 (r223169) +++ head/sys/ia64/ia64/pmap.c Fri Jun 17 04:26:03 2011 (r223170) @@ -559,10 +559,14 @@ pmap_invalidate_page(vm_offset_t va) } while (sem != tag); ia64_ptc_ga(va, PAGE_SHIFT << 2); + ia64_mf(); + ia64_srlz_i(); /* PTC.G leave exclusive */ atomic_store_rel_long(&pmap_ptc_g_sem, 0); + ia64_invala(); + intr_restore(is); critical_exit(); } Modified: head/sys/ia64/include/ia64_cpu.h ============================================================================== --- head/sys/ia64/include/ia64_cpu.h Thu Jun 16 23:40:10 2011 (r223169) +++ head/sys/ia64/include/ia64_cpu.h Fri Jun 17 04:26:03 2011 (r223170) @@ -266,7 +266,7 @@ ia64_ptc_e(uint64_t v) static __inline void ia64_ptc_g(uint64_t va, uint64_t log2size) { - __asm __volatile("ptc.g %0,%1;; srlz.i;;" :: "r"(va), "r"(log2size)); + __asm __volatile("ptc.g %0,%1;;" :: "r"(va), "r"(log2size)); } /* @@ -275,7 +275,7 @@ ia64_ptc_g(uint64_t va, uint64_t log2siz static __inline void ia64_ptc_ga(uint64_t va, uint64_t log2size) { - __asm __volatile("ptc.ga %0,%1;; srlz.i;;" :: "r"(va), "r"(log2size)); + __asm __volatile("ptc.ga %0,%1;;" :: "r"(va), "r"(log2size)); } /* @@ -288,6 +288,15 @@ ia64_ptc_l(uint64_t va, uint64_t log2siz } /* + * Invalidate the ALAT on the local processor. + */ +static __inline void +ia64_invala(void) +{ + __asm __volatile("invala;;"); +} + +/* * Unordered memory load. */ From owner-svn-src-head@FreeBSD.ORG Fri Jun 17 05:30:12 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9BF161065673; Fri, 17 Jun 2011 05:30:12 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8B4418FC0C; Fri, 17 Jun 2011 05:30:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5H5UC6R061903; Fri, 17 Jun 2011 05:30:12 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5H5UC7T061901; Fri, 17 Jun 2011 05:30:12 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201106170530.p5H5UC7T061901@svn.freebsd.org> From: Marcel Moolenaar Date: Fri, 17 Jun 2011 05:30:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223171 - head/sys/ia64/ia64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jun 2011 05:30:12 -0000 Author: marcel Date: Fri Jun 17 05:30:12 2011 New Revision: 223171 URL: http://svn.freebsd.org/changeset/base/223171 Log: Improve on style(9) Modified: head/sys/ia64/ia64/busdma_machdep.c Modified: head/sys/ia64/ia64/busdma_machdep.c ============================================================================== --- head/sys/ia64/ia64/busdma_machdep.c Fri Jun 17 04:26:03 2011 (r223170) +++ head/sys/ia64/ia64/busdma_machdep.c Fri Jun 17 05:30:12 2011 (r223171) @@ -51,21 +51,21 @@ __FBSDID("$FreeBSD$"); #define MAX_BPAGES 1024 struct bus_dma_tag { - bus_dma_tag_t parent; - bus_size_t alignment; - bus_size_t boundary; - bus_addr_t lowaddr; - bus_addr_t highaddr; + bus_dma_tag_t parent; + bus_size_t alignment; + bus_size_t boundary; + bus_addr_t lowaddr; + bus_addr_t highaddr; bus_dma_filter_t *filter; - void *filterarg; - bus_size_t maxsize; - u_int nsegments; - bus_size_t maxsegsz; - int flags; - int ref_count; - int map_count; - bus_dma_lock_t *lockfunc; - void *lockfuncarg; + void *filterarg; + bus_size_t maxsize; + u_int nsegments; + bus_size_t maxsegsz; + int flags; + int ref_count; + int map_count; + bus_dma_lock_t *lockfunc; + void *lockfuncarg; bus_dma_segment_t *segments; }; @@ -90,27 +90,27 @@ static int total_deferred; SYSCTL_NODE(_hw, OID_AUTO, busdma, CTLFLAG_RD, 0, "Busdma parameters"); SYSCTL_INT(_hw_busdma, OID_AUTO, free_bpages, CTLFLAG_RD, &free_bpages, 0, - "Free bounce pages"); + "Free bounce pages"); SYSCTL_INT(_hw_busdma, OID_AUTO, reserved_bpages, CTLFLAG_RD, &reserved_bpages, - 0, "Reserved bounce pages"); + 0, "Reserved bounce pages"); SYSCTL_INT(_hw_busdma, OID_AUTO, active_bpages, CTLFLAG_RD, &active_bpages, 0, - "Active bounce pages"); + "Active bounce pages"); SYSCTL_INT(_hw_busdma, OID_AUTO, total_bpages, CTLFLAG_RD, &total_bpages, 0, - "Total bounce pages"); + "Total bounce pages"); SYSCTL_INT(_hw_busdma, OID_AUTO, total_bounced, CTLFLAG_RD, &total_bounced, 0, - "Total bounce requests"); -SYSCTL_INT(_hw_busdma, OID_AUTO, total_deferred, CTLFLAG_RD, &total_deferred, 0, - "Total bounce requests that were deferred"); + "Total bounce requests"); +SYSCTL_INT(_hw_busdma, OID_AUTO, total_deferred, CTLFLAG_RD, &total_deferred, + 0, "Total bounce requests that were deferred"); struct bus_dmamap { - struct bp_list bpages; - int pagesneeded; - int pagesreserved; - bus_dma_tag_t dmat; - void *buf; /* unmapped buffer pointer */ - bus_size_t buflen; /* unmapped buffer length */ + struct bp_list bpages; + int pagesneeded; + int pagesreserved; + bus_dma_tag_t dmat; + void *buf; /* unmapped buffer pointer */ + bus_size_t buflen; /* unmapped buffer length */ bus_dmamap_callback_t *callback; - void *callback_arg; + void *callback_arg; STAILQ_ENTRY(bus_dmamap) links; }; @@ -121,12 +121,12 @@ static struct bus_dmamap nobounce_dmamap static void init_bounce_pages(void *dummy); static int alloc_bounce_pages(bus_dma_tag_t dmat, u_int numpages); static int reserve_bounce_pages(bus_dma_tag_t dmat, bus_dmamap_t map, - int commit); + int commit); static bus_addr_t add_bounce_page(bus_dma_tag_t dmat, bus_dmamap_t map, - vm_offset_t vaddr, bus_size_t size); + vm_offset_t vaddr, bus_size_t size); static void free_bounce_page(bus_dma_tag_t dmat, struct bounce_page *bpage); static __inline int run_filter(bus_dma_tag_t dmat, bus_addr_t paddr, - bus_size_t len); + bus_size_t len); /* * Return true if a match is made. @@ -144,16 +144,14 @@ run_filter(bus_dma_tag_t dmat, bus_addr_ retval = 0; bndy = dmat->boundary; - do { - if (((paddr > dmat->lowaddr && paddr <= dmat->highaddr) - || ((paddr & (dmat->alignment - 1)) != 0) - || ((paddr & bndy) != ((paddr + len) & bndy))) - && (dmat->filter == NULL - || (*dmat->filter)(dmat->filterarg, paddr) != 0)) + if (((paddr > dmat->lowaddr && paddr <= dmat->highaddr) || + (paddr & (dmat->alignment - 1)) != 0 || + (paddr & bndy) != ((paddr + len) & bndy)) && + (dmat->filter == NULL || + (*dmat->filter)(dmat->filterarg, paddr) != 0)) retval = 1; - - dmat = dmat->parent; + dmat = dmat->parent; } while (retval == 0 && dmat != NULL); return (retval); } @@ -195,16 +193,16 @@ dflt_lock(void *arg, bus_dma_lock_op_t o } #define BUS_DMA_MIN_ALLOC_COMP BUS_DMA_BUS4 + /* * Allocate a device specific dma_tag. */ int bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t alignment, - bus_size_t boundary, bus_addr_t lowaddr, - bus_addr_t highaddr, bus_dma_filter_t *filter, - void *filterarg, bus_size_t maxsize, int nsegments, - bus_size_t maxsegsz, int flags, bus_dma_lock_t *lockfunc, - void *lockfuncarg, bus_dma_tag_t *dmat) + bus_size_t boundary, bus_addr_t lowaddr, bus_addr_t highaddr, + bus_dma_filter_t *filter, void *filterarg, bus_size_t maxsize, + int nsegments, bus_size_t maxsegsz, int flags, bus_dma_lock_t *lockfunc, + void *lockfuncarg, bus_dma_tag_t *dmat) { bus_dma_tag_t newtag; int error = 0; @@ -250,7 +248,7 @@ bus_dma_tag_create(bus_dma_tag_t parent, newtag->boundary = parent->boundary; else if (parent->boundary != 0) newtag->boundary = MIN(parent->boundary, - newtag->boundary); + newtag->boundary); if (newtag->filter == NULL) { /* * Short circuit looking at our parent directly @@ -279,7 +277,7 @@ bus_dma_tag_create(bus_dma_tag_t parent, /* Performed initial allocation */ newtag->flags |= BUS_DMA_MIN_ALLOC_COMP; } - + if (error != 0) { free(newtag, M_DEVBUF); } else { @@ -347,7 +345,7 @@ bus_dmamap_create(bus_dma_tag_t dmat, in int maxpages; *mapp = (bus_dmamap_t)malloc(sizeof(**mapp), M_DEVBUF, - M_NOWAIT | M_ZERO); + M_NOWAIT | M_ZERO); if (*mapp == NULL) return (ENOMEM); @@ -408,7 +406,7 @@ bus_dmamap_destroy(bus_dma_tag_t dmat, b */ int bus_dmamem_alloc(bus_dma_tag_t dmat, void** vaddr, int flags, - bus_dmamap_t *mapp) + bus_dmamap_t *mapp) { int mflags; @@ -430,7 +428,7 @@ bus_dmamem_alloc(bus_dma_tag_t dmat, voi if (flags & BUS_DMA_ZERO) mflags |= M_ZERO; - /* + /* * XXX: * (dmat->alignment < dmat->maxsize) is just a quick hack; the exact * alignment guarantees of malloc need to be nailed down, and the @@ -489,15 +487,9 @@ bus_dmamem_free(bus_dma_tag_t dmat, void * first indicates if this is the first invocation of this function. */ static int -_bus_dmamap_load_buffer(bus_dma_tag_t dmat, - bus_dmamap_t map, - void *buf, bus_size_t buflen, - struct thread *td, - int flags, - bus_addr_t *lastaddrp, - bus_dma_segment_t *segs, - int *segp, - int first) +_bus_dmamap_load_buffer(bus_dma_tag_t dmat, bus_dmamap_t map, void *buf, + bus_size_t buflen, struct thread *td, int flags, bus_addr_t *lastaddrp, + bus_dma_segment_t *segs, int *segp, int first) { bus_size_t sgsize; bus_addr_t curaddr, lastaddr, baddr, bmask; @@ -607,7 +599,7 @@ _bus_dmamap_load_buffer(bus_dma_tag_t dm if (curaddr == lastaddr && (segs[seg].ds_len + sgsize) <= dmat->maxsegsz && (dmat->boundary == 0 || - (segs[seg].ds_addr & bmask) == (curaddr & bmask))) + (segs[seg].ds_addr & bmask) == (curaddr & bmask))) segs[seg].ds_len += sgsize; else { if (++seg >= dmat->nsegments) @@ -636,11 +628,11 @@ _bus_dmamap_load_buffer(bus_dma_tag_t dm */ int bus_dmamap_load(bus_dma_tag_t dmat, bus_dmamap_t map, void *buf, - bus_size_t buflen, bus_dmamap_callback_t *callback, - void *callback_arg, int flags) + bus_size_t buflen, bus_dmamap_callback_t *callback, void *callback_arg, + int flags) { - bus_addr_t lastaddr = 0; - int error, nsegs = 0; + bus_addr_t lastaddr = 0; + int error, nsegs = 0; if (map != NULL) { flags |= BUS_DMA_WAITOK; @@ -666,10 +658,8 @@ bus_dmamap_load(bus_dma_tag_t dmat, bus_ * Like _bus_dmamap_load(), but for mbufs. */ int -bus_dmamap_load_mbuf(bus_dma_tag_t dmat, bus_dmamap_t map, - struct mbuf *m0, - bus_dmamap_callback2_t *callback, void *callback_arg, - int flags) +bus_dmamap_load_mbuf(bus_dma_tag_t dmat, bus_dmamap_t map, struct mbuf *m0, + bus_dmamap_callback2_t *callback, void *callback_arg, int flags) { int nsegs, error; @@ -686,9 +676,8 @@ bus_dmamap_load_mbuf(bus_dma_tag_t dmat, for (m = m0; m != NULL && error == 0; m = m->m_next) { if (m->m_len > 0) { error = _bus_dmamap_load_buffer(dmat, map, - m->m_data, m->m_len, - NULL, flags, &lastaddr, - dmat->segments, &nsegs, first); + m->m_data, m->m_len, NULL, flags, + &lastaddr, dmat->segments, &nsegs, first); first = 0; } } @@ -707,9 +696,8 @@ bus_dmamap_load_mbuf(bus_dma_tag_t dmat, } int -bus_dmamap_load_mbuf_sg(bus_dma_tag_t dmat, bus_dmamap_t map, - struct mbuf *m0, bus_dma_segment_t *segs, - int *nsegs, int flags) +bus_dmamap_load_mbuf_sg(bus_dma_tag_t dmat, bus_dmamap_t map, struct mbuf *m0, + bus_dma_segment_t *segs, int *nsegs, int flags) { int error; @@ -726,9 +714,8 @@ bus_dmamap_load_mbuf_sg(bus_dma_tag_t dm for (m = m0; m != NULL && error == 0; m = m->m_next) { if (m->m_len > 0) { error = _bus_dmamap_load_buffer(dmat, map, - m->m_data, m->m_len, - NULL, flags, &lastaddr, - segs, nsegs, first); + m->m_data, m->m_len, NULL, flags, + &lastaddr, segs, nsegs, first); first = 0; } } @@ -744,10 +731,8 @@ bus_dmamap_load_mbuf_sg(bus_dma_tag_t dm * Like _bus_dmamap_load(), but for uios. */ int -bus_dmamap_load_uio(bus_dma_tag_t dmat, bus_dmamap_t map, - struct uio *uio, - bus_dmamap_callback2_t *callback, void *callback_arg, - int flags) +bus_dmamap_load_uio(bus_dma_tag_t dmat, bus_dmamap_t map, struct uio *uio, + bus_dmamap_callback2_t *callback, void *callback_arg, int flags) { bus_addr_t lastaddr; int nsegs, error, first, i; @@ -826,8 +811,7 @@ _bus_dmamap_sync(bus_dma_tag_t dmat, bus if (op & BUS_DMASYNC_PREWRITE) { while (bpage != NULL) { bcopy((void *)bpage->datavaddr, - (void *)bpage->vaddr, - bpage->datacount); + (void *)bpage->vaddr, bpage->datacount); bpage = STAILQ_NEXT(bpage, links); } total_bounced++; @@ -836,8 +820,7 @@ _bus_dmamap_sync(bus_dma_tag_t dmat, bus if (op & BUS_DMASYNC_POSTREAD) { while (bpage != NULL) { bcopy((void *)bpage->vaddr, - (void *)bpage->datavaddr, - bpage->datacount); + (void *)bpage->datavaddr, bpage->datacount); bpage = STAILQ_NEXT(bpage, links); } total_bounced++; @@ -870,15 +853,11 @@ alloc_bounce_pages(bus_dma_tag_t dmat, u struct bounce_page *bpage; bpage = (struct bounce_page *)malloc(sizeof(*bpage), M_DEVBUF, - M_NOWAIT | M_ZERO); - + M_NOWAIT | M_ZERO); if (bpage == NULL) break; bpage->vaddr = (vm_offset_t)contigmalloc(PAGE_SIZE, M_DEVBUF, - M_NOWAIT, 0ul, - dmat->lowaddr, - PAGE_SIZE, - dmat->boundary); + M_NOWAIT, 0ul, dmat->lowaddr, PAGE_SIZE, dmat->boundary); if (bpage->vaddr == 0) { free(bpage, M_DEVBUF); break; @@ -914,7 +893,7 @@ reserve_bounce_pages(bus_dma_tag_t dmat, static bus_addr_t add_bounce_page(bus_dma_tag_t dmat, bus_dmamap_t map, vm_offset_t vaddr, - bus_size_t size) + bus_size_t size) { struct bounce_page *bpage; @@ -974,8 +953,8 @@ free_bounce_page(bus_dma_tag_t dmat, str if ((map = STAILQ_FIRST(&bounce_map_waitinglist)) != NULL) { if (reserve_bounce_pages(map->dmat, map, 1) == 0) { STAILQ_REMOVE_HEAD(&bounce_map_waitinglist, links); - STAILQ_INSERT_TAIL(&bounce_map_callbacklist, - map, links); + STAILQ_INSERT_TAIL(&bounce_map_callbacklist, map, + links); busdma_swi_pending = 1; total_deferred++; swi_sched(vm_ih, 0); @@ -997,7 +976,7 @@ busdma_swi(void) dmat = map->dmat; (dmat->lockfunc)(dmat->lockfuncarg, BUS_DMA_LOCK); bus_dmamap_load(map->dmat, map, map->buf, map->buflen, - map->callback, map->callback_arg, /*flags*/0); + map->callback, map->callback_arg, /*flags*/0); (dmat->lockfunc)(dmat->lockfuncarg, BUS_DMA_UNLOCK); mtx_lock(&bounce_lock); } From owner-svn-src-head@FreeBSD.ORG Fri Jun 17 06:12:28 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CE40B106564A; Fri, 17 Jun 2011 06:12:28 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BE01F8FC1B; Fri, 17 Jun 2011 06:12:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5H6CSDx063556; Fri, 17 Jun 2011 06:12:28 GMT (envelope-from netchild@svn.freebsd.org) Received: (from netchild@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5H6CStR063554; Fri, 17 Jun 2011 06:12:28 GMT (envelope-from netchild@svn.freebsd.org) Message-Id: <201106170612.p5H6CStR063554@svn.freebsd.org> From: Alexander Leidinger Date: Fri, 17 Jun 2011 06:12:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223173 - head/usr.bin/kdump X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jun 2011 06:12:28 -0000 Author: netchild Date: Fri Jun 17 06:12:28 2011 New Revision: 223173 URL: http://svn.freebsd.org/changeset/base/223173 Log: Add 2-clause BSD license. Approved by: David Kirchner (initial author) Requested by: Otto Moerbeek MFC after: 1 week Modified: head/usr.bin/kdump/mksubr Modified: head/usr.bin/kdump/mksubr ============================================================================== --- head/usr.bin/kdump/mksubr Fri Jun 17 05:55:41 2011 (r223172) +++ head/usr.bin/kdump/mksubr Fri Jun 17 06:12:28 2011 (r223173) @@ -1,5 +1,28 @@ #!/bin/sh # +# Copyright (c) 2006 "David Kirchner" . 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$ # # Generates kdump_subr.c From owner-svn-src-head@FreeBSD.ORG Fri Jun 17 07:03:42 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C32D106564A; Fri, 17 Jun 2011 07:03:42 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7C5928FC0C; Fri, 17 Jun 2011 07:03:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5H73gAu065655; Fri, 17 Jun 2011 07:03:42 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5H73gks065653; Fri, 17 Jun 2011 07:03:42 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201106170703.p5H73gks065653@svn.freebsd.org> From: Michael Tuexen Date: Fri, 17 Jun 2011 07:03:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223178 - head/lib/libc/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jun 2011 07:03:42 -0000 Author: tuexen Date: Fri Jun 17 07:03:42 2011 New Revision: 223178 URL: http://svn.freebsd.org/changeset/base/223178 Log: Update the list of supported socket options for sctp_opt_info(). MFC after: 1 month. Modified: head/lib/libc/net/sctp_sys_calls.c Modified: head/lib/libc/net/sctp_sys_calls.c ============================================================================== --- head/lib/libc/net/sctp_sys_calls.c Fri Jun 17 06:59:49 2011 (r223177) +++ head/lib/libc/net/sctp_sys_calls.c Fri Jun 17 07:03:42 2011 (r223178) @@ -365,9 +365,6 @@ sctp_opt_info(int sd, sctp_assoc_t id, i case SCTP_DEFAULT_SEND_PARAM: ((struct sctp_assocparams *)arg)->sasoc_assoc_id = id; break; - case SCTP_SET_PEER_PRIMARY_ADDR: - ((struct sctp_setpeerprim *)arg)->sspp_assoc_id = id; - break; case SCTP_PRIMARY_ADDR: ((struct sctp_setprim *)arg)->ssp_assoc_id = id; break; @@ -407,6 +404,12 @@ sctp_opt_info(int sd, sctp_assoc_t id, i case SCTP_EVENT: ((struct sctp_event *)arg)->se_assoc_id = id; break; + case SCTP_DEFAULT_SNDINFO: + ((struct sctp_sndinfo *)arg)->snd_assoc_id = id; + break; + case SCTP_DEFAULT_PRINFO: + ((struct sctp_default_prinfo *)arg)->pr_assoc_id = id; + break; default: break; } From owner-svn-src-head@FreeBSD.ORG Fri Jun 17 07:06:42 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B9C7B106566B; Fri, 17 Jun 2011 07:06:42 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A9FFB8FC0C; Fri, 17 Jun 2011 07:06:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5H76gPY065824; Fri, 17 Jun 2011 07:06:42 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5H76gEx065822; Fri, 17 Jun 2011 07:06:42 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201106170706.p5H76gEx065822@svn.freebsd.org> From: Michael Tuexen Date: Fri, 17 Jun 2011 07:06:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223180 - head/lib/libc/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jun 2011 07:06:42 -0000 Author: tuexen Date: Fri Jun 17 07:06:42 2011 New Revision: 223180 URL: http://svn.freebsd.org/changeset/base/223180 Log: Add SCTP_MAX_BURST support to sctp_opt_info(). This only applies to 9.0 and higher, since the type of the values has changed since we introduced it. So it can't be MFCed. Modified: head/lib/libc/net/sctp_sys_calls.c Modified: head/lib/libc/net/sctp_sys_calls.c ============================================================================== --- head/lib/libc/net/sctp_sys_calls.c Fri Jun 17 07:05:47 2011 (r223179) +++ head/lib/libc/net/sctp_sys_calls.c Fri Jun 17 07:06:42 2011 (r223180) @@ -410,6 +410,9 @@ sctp_opt_info(int sd, sctp_assoc_t id, i case SCTP_DEFAULT_PRINFO: ((struct sctp_default_prinfo *)arg)->pr_assoc_id = id; break; + case SCTP_MAX_BURST: + ((struct sctp_assoc_value *)arg)->assoc_id = id; + break; default: break; } From owner-svn-src-head@FreeBSD.ORG Fri Jun 17 07:07:27 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 94C0E106564A; Fri, 17 Jun 2011 07:07:27 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6B7298FC1B; Fri, 17 Jun 2011 07:07:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5H77Rtl065884; Fri, 17 Jun 2011 07:07:27 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5H77R4H065881; Fri, 17 Jun 2011 07:07:27 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201106170707.p5H77R4H065881@svn.freebsd.org> From: Mikolaj Golub Date: Fri, 17 Jun 2011 07:07:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223181 - head/sbin/hastd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jun 2011 07:07:27 -0000 Author: trociny Date: Fri Jun 17 07:07:26 2011 New Revision: 223181 URL: http://svn.freebsd.org/changeset/base/223181 Log: In HAST we use two sockets - one for only sending the data and one for only receiving the data. In r220271 the unused directions were disabled using shutdown(2). Unfortunately, this broke automatic receive buffer sizing, which currently works only for connections in ETASBLISHED state. It was a root cause of the issue reported by users, when connection between primary and secondary could get stuck. Disable the code introduced in r220271 until the issue with automatic buffer sizing is not resolved. Reported by: Daniel Kalchev , danger, sobomax Tested by: Daniel Kalchev , danger Approved by: pjd (mentor) MFC after: 1 week Modified: head/sbin/hastd/primary.c head/sbin/hastd/secondary.c Modified: head/sbin/hastd/primary.c ============================================================================== --- head/sbin/hastd/primary.c Fri Jun 17 07:06:42 2011 (r223180) +++ head/sbin/hastd/primary.c Fri Jun 17 07:07:26 2011 (r223181) @@ -726,11 +726,13 @@ init_remote(struct hast_resource *res, s (void)hast_activemap_flush(res); } nv_free(nvin); +#ifdef notyet /* Setup directions. */ if (proto_send(out, NULL, 0) == -1) pjdlog_errno(LOG_WARNING, "Unable to set connection direction"); if (proto_recv(in, NULL, 0) == -1) pjdlog_errno(LOG_WARNING, "Unable to set connection direction"); +#endif pjdlog_info("Connected to %s.", res->hr_remoteaddr); if (inp != NULL && outp != NULL) { *inp = in; Modified: head/sbin/hastd/secondary.c ============================================================================== --- head/sbin/hastd/secondary.c Fri Jun 17 07:06:42 2011 (r223180) +++ head/sbin/hastd/secondary.c Fri Jun 17 07:07:26 2011 (r223181) @@ -183,9 +183,11 @@ init_remote(struct hast_resource *res, s unsigned char *map; size_t mapsize; +#ifdef notyet /* Setup direction. */ if (proto_send(res->hr_remoteout, NULL, 0) == -1) pjdlog_errno(LOG_WARNING, "Unable to set connection direction"); +#endif map = NULL; mapsize = 0; @@ -351,9 +353,11 @@ init_remote(struct hast_resource *res, s if (map != NULL) free(map); nv_free(nvout); +#ifdef notyet /* Setup direction. */ if (proto_recv(res->hr_remotein, NULL, 0) == -1) pjdlog_errno(LOG_WARNING, "Unable to set connection direction"); +#endif if (res->hr_secondary_localcnt > res->hr_primary_remotecnt && res->hr_primary_localcnt > res->hr_secondary_remotecnt) { /* Exit on split-brain. */ From owner-svn-src-head@FreeBSD.ORG Fri Jun 17 07:30:56 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B5CC31065673; Fri, 17 Jun 2011 07:30:56 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A59138FC14; Fri, 17 Jun 2011 07:30:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5H7UupK070718; Fri, 17 Jun 2011 07:30:56 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5H7Uux5070716; Fri, 17 Jun 2011 07:30:56 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201106170730.p5H7Uux5070716@svn.freebsd.org> From: Sergey Kandaurov Date: Fri, 17 Jun 2011 07:30:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223182 - head/sys/compat/linprocfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jun 2011 07:30:56 -0000 Author: pluknet Date: Fri Jun 17 07:30:56 2011 New Revision: 223182 URL: http://svn.freebsd.org/changeset/base/223182 Log: Return empty cmdline/environ string for processes with kernel address space. This is consistent with the behavior in linux. PR: kern/157871 Reported by: Petr Salinger Verified on: GNU/kFreeBSD debian 8.2-1-amd64 (by reporter) Reviewed by: kib (some time ago) MFC after: 2 weeks Modified: head/sys/compat/linprocfs/linprocfs.c Modified: head/sys/compat/linprocfs/linprocfs.c ============================================================================== --- head/sys/compat/linprocfs/linprocfs.c Fri Jun 17 07:07:26 2011 (r223181) +++ head/sys/compat/linprocfs/linprocfs.c Fri Jun 17 07:30:56 2011 (r223182) @@ -1049,6 +1049,15 @@ linprocfs_doproccmdline(PFS_FILL_ARGS) PROC_UNLOCK(p); return (ret); } + + /* + * Mimic linux behavior and pass only processes with usermode + * address space as valid. Return zero silently otherwize. + */ + if (p->p_vmspace == &vmspace0) { + PROC_UNLOCK(p); + return (0); + } if (p->p_args != NULL) { sbuf_bcpy(sb, p->p_args->ar_args, p->p_args->ar_length); PROC_UNLOCK(p); @@ -1073,6 +1082,15 @@ linprocfs_doprocenviron(PFS_FILL_ARGS) PROC_UNLOCK(p); return (ret); } + + /* + * Mimic linux behavior and pass only processes with usermode + * address space as valid. Return zero silently otherwize. + */ + if (p->p_vmspace == &vmspace0) { + PROC_UNLOCK(p); + return (0); + } PROC_UNLOCK(p); ret = linprocfs_doargv(td, p, sb, ps_string_env); From owner-svn-src-head@FreeBSD.ORG Fri Jun 17 10:21:25 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B030106564A; Fri, 17 Jun 2011 10:21:25 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E506B8FC15; Fri, 17 Jun 2011 10:21:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5HALOuv082517; Fri, 17 Jun 2011 10:21:24 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5HALO75082513; Fri, 17 Jun 2011 10:21:24 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201106171021.p5HALO75082513@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 17 Jun 2011 10:21:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223183 - in head: bin/sh tools/regression/bin/sh/builtins X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jun 2011 10:21:25 -0000 Author: jilles Date: Fri Jun 17 10:21:24 2011 New Revision: 223183 URL: http://svn.freebsd.org/changeset/base/223183 Log: sh: Skip variables with invalid names in "set", "export -p", "readonly -p". This ensures the output of these commands is valid shell input. Added: head/tools/regression/bin/sh/builtins/export1.0 (contents, props changed) head/tools/regression/bin/sh/builtins/set2.0 (contents, props changed) Modified: head/bin/sh/var.c Modified: head/bin/sh/var.c ============================================================================== --- head/bin/sh/var.c Fri Jun 17 07:30:56 2011 (r223182) +++ head/bin/sh/var.c Fri Jun 17 10:21:24 2011 (r223183) @@ -612,6 +612,12 @@ showvarscmd(int argc __unused, char **ar qsort(vars, n, sizeof(*vars), var_compare); for (i = 0; i < n; i++) { + /* + * Skip improper variable names so the output remains usable as + * shell input. + */ + if (!isassignment(vars[i])) + continue; s = strchr(vars[i], '='); s++; outbin(vars[i], s - vars[i], out1); @@ -683,6 +689,13 @@ exportcmd(int argc, char **argv) for (vp = *vpp ; vp ; vp = vp->next) { if (vp->flags & flag) { if (values) { + /* + * Skip improper variable names + * so the output remains usable + * as shell input. + */ + if (!isassignment(vp->text)) + continue; out1str(cmdname); out1c(' '); } Added: head/tools/regression/bin/sh/builtins/export1.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/export1.0 Fri Jun 17 10:21:24 2011 (r223183) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +env @badness=1 ${SH} -c 'v=`export -p`; eval "$v"' Added: head/tools/regression/bin/sh/builtins/set2.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/set2.0 Fri Jun 17 10:21:24 2011 (r223183) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +! env @badness=1 ${SH} -c 'v=`set`; eval "$v"' 2>&1 | grep @badness From owner-svn-src-head@FreeBSD.ORG Fri Jun 17 12:12:52 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6A6311065676; Fri, 17 Jun 2011 12:12:52 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5A6388FC12; Fri, 17 Jun 2011 12:12:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5HCCqm2090615; Fri, 17 Jun 2011 12:12:52 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5HCCqSP090613; Fri, 17 Jun 2011 12:12:52 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201106171212.p5HCCqSP090613@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 17 Jun 2011 12:12:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223185 - head/sbin/ipfw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jun 2011 12:12:52 -0000 Author: glebius Date: Fri Jun 17 12:12:52 2011 New Revision: 223185 URL: http://svn.freebsd.org/changeset/base/223185 Log: - Fix my braino in the 220835, when I used strtok(). It isn't applicable here, since modifies the string. Switch to strchr(). - Restore support for undocumented optional parameters of redir_port and redir_proto, that were disabled in 220835. - While here, change !isalpha() checks on optinal parameters for isdigit(). Submitted by: Alexander V. Chernikov PR: kern/143653 Modified: head/sbin/ipfw/nat.c Modified: head/sbin/ipfw/nat.c ============================================================================== --- head/sbin/ipfw/nat.c Fri Jun 17 11:13:37 2011 (r223184) +++ head/sbin/ipfw/nat.c Fri Jun 17 12:12:52 2011 (r223185) @@ -315,14 +315,19 @@ static int estimate_redir_addr(int *ac, char ***av) { size_t space = sizeof(struct cfg_redir); - char *sep; + char *sep = **av; + u_int c = 0; - if ((sep = strtok(**av, ",")) != NULL) { - space += sizeof(struct cfg_spool); - while ((sep = strtok(NULL, ",")) != NULL) - space += sizeof(struct cfg_spool); + while ((sep = strchr(sep, ',')) != NULL) { + c++; + sep++; } + if (c > 0) + c++; + + space += c * sizeof(struct cfg_spool); + return (space); } @@ -370,14 +375,19 @@ static int estimate_redir_port(int *ac, char ***av) { size_t space = sizeof(struct cfg_redir); - char *sep; + char *sep = **av; + u_int c = 0; - if ((sep = strtok(**av, ",")) != NULL) { - space += sizeof(struct cfg_spool); - while ((sep = strtok(NULL, ",")) != NULL) - space += sizeof(struct cfg_spool); + while ((sep = strchr(sep, ',')) != NULL) { + c++; + sep++; } + if (c > 0) + c++; + + space += c * sizeof(struct cfg_spool); + return (space); } @@ -465,10 +475,10 @@ setup_redir_port(char *buf, int *ac, cha * Extract remote address and optionally port. */ /* - * NB: isalpha(**av) => we've to check that next parameter is really an + * NB: isdigit(**av) => we've to check that next parameter is really an * option for this redirect entry, else stop here processing arg[cv]. */ - if (*ac != 0 && !isalpha(***av)) { + if (*ac != 0 && isdigit(***av)) { if ((sep = strchr(**av, ':')) != NULL) { if (StrToAddrAndPortRange(**av, &r->raddr, protoName, &portRange) != 0) @@ -584,7 +594,7 @@ setup_redir_proto(char *buf, int *ac, ch r->raddr.s_addr = INADDR_ANY; } else { /* see above in setup_redir_port() */ - if (!isalpha(***av)) { + if (isdigit(***av)) { StrToAddr(**av, &r->paddr); (*av)++; (*ac)--; @@ -592,7 +602,7 @@ setup_redir_proto(char *buf, int *ac, ch * Extract optional remote address. */ /* see above in setup_redir_port() */ - if (*ac != 0 && !isalpha(***av)) { + if (*ac != 0 && isdigit(***av)) { StrToAddr(**av, &r->raddr); (*av)++; (*ac)--; } @@ -774,6 +784,9 @@ ipfw_config_nat(int ac, char **av) av1++; ac1--; len += estimate_redir_port(&ac1, &av1); av1 += 2; ac1 -= 2; + /* Skip optional remoteIP/port */ + if (ac1 != 0 && isdigit(**av1)) + av1++; ac1--; break; case TOK_REDIR_PROTO: if (ac1 < 2) @@ -781,6 +794,11 @@ ipfw_config_nat(int ac, char **av) "not enough arguments"); len += sizeof(struct cfg_redir); av1 += 2; ac1 -= 2; + /* Skip optional remoteIP/port */ + if (ac1 != 0 && isdigit(**av1)) + av1++; ac1--; + if (ac1 != 0 && isdigit(**av1)) + av1++; ac1--; break; default: errx(EX_DATAERR, "unrecognised option ``%s''", av1[-1]); From owner-svn-src-head@FreeBSD.ORG Fri Jun 17 13:03:49 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D7166106566B; Fri, 17 Jun 2011 13:03:49 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C68D68FC1C; Fri, 17 Jun 2011 13:03:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5HD3nfM092057; Fri, 17 Jun 2011 13:03:49 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5HD3nto092050; Fri, 17 Jun 2011 13:03:49 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201106171303.p5HD3nto092050@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 17 Jun 2011 13:03:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223186 - in head: bin/sh tools/regression/bin/sh/builtins X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jun 2011 13:03:49 -0000 Author: jilles Date: Fri Jun 17 13:03:49 2011 New Revision: 223186 URL: http://svn.freebsd.org/changeset/base/223186 Log: sh: Add case statement fallthrough (with ';&' instead of ';;'). Replacing ;; with the new control operator ;& will cause the next list to be executed as well without checking its pattern, continuing until a list ends with ;; or until the end of the case statement. This is like omitting "break" in a C "switch" statement. The sequence ;& was formerly invalid. This feature is proposed for the next POSIX issue in Austin Group issue #449. Added: head/tools/regression/bin/sh/builtins/case9.0 (contents, props changed) Modified: head/bin/sh/eval.c head/bin/sh/mktokens head/bin/sh/nodetypes head/bin/sh/parser.c head/bin/sh/sh.1 Modified: head/bin/sh/eval.c ============================================================================== --- head/bin/sh/eval.c Fri Jun 17 12:12:52 2011 (r223185) +++ head/bin/sh/eval.c Fri Jun 17 13:03:49 2011 (r223186) @@ -386,6 +386,14 @@ evalcase(union node *n, int flags) for (cp = n->ncase.cases ; cp && evalskip == 0 ; cp = cp->nclist.next) { for (patp = cp->nclist.pattern ; patp ; patp = patp->narg.next) { if (casematch(patp, arglist.list->text)) { + while (cp->nclist.next && + cp->type == NCLISTFALLTHRU) { + if (evalskip != 0) + break; + evaltree(cp->nclist.body, + flags & ~EV_EXIT); + cp = cp->nclist.next; + } if (evalskip == 0) { evaltree(cp->nclist.body, flags); } Modified: head/bin/sh/mktokens ============================================================================== --- head/bin/sh/mktokens Fri Jun 17 12:12:52 2011 (r223185) +++ head/bin/sh/mktokens Fri Jun 17 13:03:49 2011 (r223186) @@ -50,6 +50,7 @@ TPIPE 0 "|" TLP 0 "(" TRP 1 ")" TENDCASE 1 ";;" +TFALLTHRU 1 ";&" TREDIR 0 redirection TWORD 0 word TIF 0 "if" Modified: head/bin/sh/nodetypes ============================================================================== --- head/bin/sh/nodetypes Fri Jun 17 12:12:52 2011 (r223185) +++ head/bin/sh/nodetypes Fri Jun 17 13:03:49 2011 (r223186) @@ -96,12 +96,13 @@ NCASE ncase # a case statement expr nodeptr # the word to switch on cases nodeptr # the list of cases (NCLIST nodes) -NCLIST nclist # a case +NCLIST nclist # a case ending with ;; type int next nodeptr # the next case in list pattern nodeptr # list of patterns for this case body nodeptr # code to execute for this case +NCLISTFALLTHRU nclist # a case ending with ;& NDEFUN narg # define a function. The "next" field contains # the body of the function. Modified: head/bin/sh/parser.c ============================================================================== --- head/bin/sh/parser.c Fri Jun 17 12:12:52 2011 (r223185) +++ head/bin/sh/parser.c Fri Jun 17 13:03:49 2011 (r223186) @@ -542,10 +542,13 @@ TRACE(("expecting DO got %s %s\n", tokna checkkwd = CHKNL | CHKKWD | CHKALIAS; if ((t = readtoken()) != TESAC) { - if (t != TENDCASE) - synexpect(TENDCASE); + if (t == TENDCASE) + ; + else if (t == TFALLTHRU) + cp->type = NCLISTFALLTHRU; else - checkkwd = CHKNL | CHKKWD, readtoken(); + synexpect(TENDCASE); + checkkwd = CHKNL | CHKKWD, readtoken(); } cpp = &cp->nclist.next; } @@ -931,8 +934,11 @@ xxreadtoken(void) pungetc(); RETURN(TPIPE); case ';': - if (pgetc() == ';') + c = pgetc(); + if (c == ';') RETURN(TENDCASE); + else if (c == '&') + RETURN(TFALLTHRU); pungetc(); RETURN(TSEMI); case '(': Modified: head/bin/sh/sh.1 ============================================================================== --- head/bin/sh/sh.1 Fri Jun 17 12:12:52 2011 (r223185) +++ head/bin/sh/sh.1 Fri Jun 17 13:03:49 2011 (r223186) @@ -32,7 +32,7 @@ .\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95 .\" $FreeBSD$ .\" -.Dd June 15, 2011 +.Dd June 17, 2011 .Dt SH 1 .Os .Sh NAME @@ -372,7 +372,7 @@ The following is a list of valid operato .It Control operators: .Bl -column "XXX" "XXX" "XXX" "XXX" "XXX" -offset center -compact .It Li & Ta Li && Ta Li ( Ta Li ) Ta Li \en -.It Li ;; Ta Li ; Ta Li | Ta Li || +.It Li ;; Ta Li ;& Ta Li ; Ta Li | Ta Li || .El .It Redirection operators: .Bl -column "XXX" "XXX" "XXX" "XXX" "XXX" -offset center -compact @@ -990,6 +990,11 @@ described later), separated by .Ql \&| characters. +If the selected list is terminated by the control operator +.Ql ;& +instead of +.Ql ;; , +execution continues with the next list. The exit code of the .Ic case command is the exit code of the last command executed in the list or Added: head/tools/regression/bin/sh/builtins/case9.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/case9.0 Fri Jun 17 13:03:49 2011 (r223186) @@ -0,0 +1,39 @@ +# $FreeBSD$ + +errors=0 + +f() { + result= + case $1 in + a) result=${result}a ;; + b) result=${result}b ;& + c) result=${result}c ;& + d) result=${result}d ;; + e) result=${result}e ;& + esac +} + +check() { + f "$1" + if [ "$result" != "$2" ]; then + printf "For %s, expected %s got %s\n" "$1" "$2" "$result" + errors=$((errors + 1)) + fi +} + +check '' '' +check a a +check b bcd +check c cd +check d d +check e e + +if ! (case 1 in + 1) false ;& + 2) true ;; +esac) then + echo "Subshell bad" + errors=$((errors + 1)) +fi + +exit $((errors != 0)) From owner-svn-src-head@FreeBSD.ORG Fri Jun 17 18:56:51 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5F3FD1065670; Fri, 17 Jun 2011 18:56:51 +0000 (UTC) (envelope-from joerg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4F43C8FC0A; Fri, 17 Jun 2011 18:56:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5HIupDD002931; Fri, 17 Jun 2011 18:56:51 GMT (envelope-from joerg@svn.freebsd.org) Received: (from joerg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5HIuplN002929; Fri, 17 Jun 2011 18:56:51 GMT (envelope-from joerg@svn.freebsd.org) Message-Id: <201106171856.p5HIuplN002929@svn.freebsd.org> From: Joerg Wunsch Date: Fri, 17 Jun 2011 18:56:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223197 - head/usr.sbin/fdread X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jun 2011 18:56:51 -0000 Author: joerg Date: Fri Jun 17 18:56:51 2011 New Revision: 223197 URL: http://svn.freebsd.org/changeset/base/223197 Log: Open the floppy disk device with O_RDONLY rather than O_RDWR. After all, this is the fd*read* command, and thus should be able to read even write-protected disks. MFC after: 1 week Modified: head/usr.sbin/fdread/fdread.c Modified: head/usr.sbin/fdread/fdread.c ============================================================================== --- head/usr.sbin/fdread/fdread.c Fri Jun 17 18:49:59 2011 (r223196) +++ head/usr.sbin/fdread/fdread.c Fri Jun 17 18:56:51 2011 (r223197) @@ -149,7 +149,7 @@ main(int argc, char **argv) err(EX_OSERR, "cannot create output file %s", fname); } - if ((fd = open(_devname, O_RDWR)) == -1) + if ((fd = open(_devname, O_RDONLY)) == -1) err(EX_OSERR, "cannot open device %s", _devname); return (numids? doreadid(fd, numids, trackno): doread(fd, of, _devname)); From owner-svn-src-head@FreeBSD.ORG Fri Jun 17 19:40:16 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id C4E081065677; Fri, 17 Jun 2011 19:40:16 +0000 (UTC) Date: Fri, 17 Jun 2011 19:40:16 +0000 From: Alexander Best To: Joerg Wunsch Message-ID: <20110617194016.GA67349@freebsd.org> References: <201106171856.p5HIuplN002929@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201106171856.p5HIuplN002929@svn.freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223197 - head/usr.sbin/fdread X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jun 2011 19:40:16 -0000 On Fri Jun 17 11, Joerg Wunsch wrote: > Author: joerg > Date: Fri Jun 17 18:56:51 2011 > New Revision: 223197 > URL: http://svn.freebsd.org/changeset/base/223197 any thoughts about switching the default from WITH_FLOPPY to WITHOUT_FLOPPY? i don't think too many people are using floppy disks nowadays. cheers. alex > > Log: > Open the floppy disk device with O_RDONLY rather than O_RDWR. After > all, this is the fd*read* command, and thus should be able to read > even write-protected disks. > > MFC after: 1 week > > Modified: > head/usr.sbin/fdread/fdread.c > > Modified: head/usr.sbin/fdread/fdread.c > ============================================================================== > --- head/usr.sbin/fdread/fdread.c Fri Jun 17 18:49:59 2011 (r223196) > +++ head/usr.sbin/fdread/fdread.c Fri Jun 17 18:56:51 2011 (r223197) > @@ -149,7 +149,7 @@ main(int argc, char **argv) > err(EX_OSERR, "cannot create output file %s", fname); > } > > - if ((fd = open(_devname, O_RDWR)) == -1) > + if ((fd = open(_devname, O_RDONLY)) == -1) > err(EX_OSERR, "cannot open device %s", _devname); > > return (numids? doreadid(fd, numids, trackno): doread(fd, of, _devname)); -- a13x From owner-svn-src-head@FreeBSD.ORG Fri Jun 17 20:06:52 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BFDAA106564A; Fri, 17 Jun 2011 20:06:52 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AFAB38FC13; Fri, 17 Jun 2011 20:06:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5HK6qrc005003; Fri, 17 Jun 2011 20:06:52 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5HK6qZs005000; Fri, 17 Jun 2011 20:06:52 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201106172006.p5HK6qZs005000@svn.freebsd.org> From: John Baldwin Date: Fri, 17 Jun 2011 20:06:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223198 - head/sys/dev/e1000 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jun 2011 20:06:52 -0000 Author: jhb Date: Fri Jun 17 20:06:52 2011 New Revision: 223198 URL: http://svn.freebsd.org/changeset/base/223198 Log: - Use a dedicated task to handle deferred transmits from the if_transmit method instead of reusing the existing per-queue interrupt task. Reusing the per-queue interrupt task could result in both an interrupt thread and the taskqueue thread trying to handle received packets on a single queue resulting in out-of-order packet processing. - Don't define igb_start() at all on 8.0 and where if_transmit is used. Replace last remaining call to igb_start() with a loop to kick off transmit on each queue instead. - Call ether_ifdetach() earlier in igb_detach(). - Drain tasks and free taskqueues during igb_detach(). Reviewed by: jfv MFC after: 1 week Modified: head/sys/dev/e1000/if_igb.c head/sys/dev/e1000/if_igb.h Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Fri Jun 17 18:56:51 2011 (r223197) +++ head/sys/dev/e1000/if_igb.c Fri Jun 17 20:06:52 2011 (r223198) @@ -170,13 +170,15 @@ static int igb_detach(device_t); static int igb_shutdown(device_t); static int igb_suspend(device_t); static int igb_resume(device_t); -static void igb_start(struct ifnet *); -static void igb_start_locked(struct tx_ring *, struct ifnet *ifp); #if __FreeBSD_version >= 800000 static int igb_mq_start(struct ifnet *, struct mbuf *); static int igb_mq_start_locked(struct ifnet *, struct tx_ring *, struct mbuf *); static void igb_qflush(struct ifnet *); +static void igb_deferred_mq_start(void *, int); +#else +static void igb_start(struct ifnet *); +static void igb_start_locked(struct tx_ring *, struct ifnet *ifp); #endif static int igb_ioctl(struct ifnet *, u_long, caddr_t); static void igb_init(void *); @@ -693,6 +695,8 @@ igb_detach(device_t dev) return (EBUSY); } + ether_ifdetach(adapter->ifp); + if (adapter->led_dev != NULL) led_destroy(adapter->led_dev); @@ -724,8 +728,6 @@ igb_detach(device_t dev) if (adapter->vlan_detach != NULL) EVENTHANDLER_DEREGISTER(vlan_unconfig, adapter->vlan_detach); - ether_ifdetach(adapter->ifp); - callout_drain(&adapter->timer); igb_free_pci_resources(adapter); @@ -784,14 +786,27 @@ igb_resume(device_t dev) { struct adapter *adapter = device_get_softc(dev); struct ifnet *ifp = adapter->ifp; +#if __FreeBSD_version >= 800000 + struct tx_ring *txr = adapter->tx_rings; +#endif IGB_CORE_LOCK(adapter); igb_init_locked(adapter); igb_init_manageability(adapter); if ((ifp->if_flags & IFF_UP) && - (ifp->if_drv_flags & IFF_DRV_RUNNING)) + (ifp->if_drv_flags & IFF_DRV_RUNNING)) { +#if __FreeBSD_version < 800000 igb_start(ifp); +#else + for (int i = 0; i < adapter->num_queues; i++, txr++) { + IGB_TX_LOCK(txr); + if (!drbr_empty(ifp, txr->br)) + igb_mq_start_locked(ifp, txr, NULL); + IGB_TX_UNLOCK(txr); + } +#endif + } IGB_CORE_UNLOCK(adapter); @@ -799,6 +814,7 @@ igb_resume(device_t dev) } +#if __FreeBSD_version < 800000 /********************************************************************* * Transmit entry point * @@ -875,7 +891,7 @@ igb_start(struct ifnet *ifp) return; } -#if __FreeBSD_version >= 800000 +#else /* __FreeBSD_version >= 800000 */ /* ** Multiqueue Transmit driver ** @@ -900,7 +916,7 @@ igb_mq_start(struct ifnet *ifp, struct m IGB_TX_UNLOCK(txr); } else { err = drbr_enqueue(ifp, txr->br, m); - taskqueue_enqueue(que->tq, &que->que_task); + taskqueue_enqueue(que->tq, &txr->txq_task); } return (err); @@ -961,6 +977,22 @@ igb_mq_start_locked(struct ifnet *ifp, s } /* + * Called from a taskqueue to drain queued transmit packets. + */ +static void +igb_deferred_mq_start(void *arg, int pending) +{ + struct tx_ring *txr = arg; + struct adapter *adapter = txr->adapter; + struct ifnet *ifp = adapter->ifp; + + IGB_TX_LOCK(txr); + if (!drbr_empty(ifp, txr->br)) + igb_mq_start_locked(ifp, txr, NULL); + IGB_TX_UNLOCK(txr); +} + +/* ** Flush all ring buffers */ static void @@ -978,7 +1010,7 @@ igb_qflush(struct ifnet *ifp) } if_qflush(ifp); } -#endif /* __FreeBSD_version >= 800000 */ +#endif /* __FreeBSD_version < 800000 */ /********************************************************************* * Ioctl entry point @@ -2180,6 +2212,7 @@ igb_allocate_legacy(struct adapter *adap { device_t dev = adapter->dev; struct igb_queue *que = adapter->queues; + struct tx_ring *txr = adapter->tx_rings; int error, rid = 0; /* Turn off all interrupts */ @@ -2198,6 +2231,10 @@ igb_allocate_legacy(struct adapter *adap return (ENXIO); } +#if __FreeBSD_version >= 800000 + TASK_INIT(&txr->txq_task, 0, igb_deferred_mq_start, txr); +#endif + /* * Try allocating a fast interrupt and the associated deferred * processing contexts. @@ -2268,9 +2305,13 @@ igb_allocate_msix(struct adapter *adapte */ if (adapter->num_queues > 1) bus_bind_intr(dev, que->res, i); +#if __FreeBSD_version >= 800000 + TASK_INIT(&que->txr->txq_task, 0, igb_deferred_mq_start, + que->txr); +#endif /* Make tasklet for deferred handling */ TASK_INIT(&que->que_task, 0, igb_handle_que, que); - que->tq = taskqueue_create_fast("igb_que", M_NOWAIT, + que->tq = taskqueue_create("igb_que", M_NOWAIT, taskqueue_thread_enqueue, &que->tq); taskqueue_start_threads(&que->tq, 1, PI_NET, "%s que", device_get_nameunit(adapter->dev)); @@ -2477,13 +2518,24 @@ igb_free_pci_resources(struct adapter *a else (adapter->msix != 0) ? (rid = 1):(rid = 0); + que = adapter->queues; if (adapter->tag != NULL) { + taskqueue_drain(que->tq, &adapter->link_task); bus_teardown_intr(dev, adapter->res, adapter->tag); adapter->tag = NULL; } if (adapter->res != NULL) bus_release_resource(dev, SYS_RES_IRQ, rid, adapter->res); + for (int i = 0; i < adapter->num_queues; i++, que++) { + if (que->tq != NULL) { +#if __FreeBSD_version >= 800000 + taskqueue_drain(que->tq, &que->txr->txq_task); +#endif + taskqueue_drain(que->tq, &que->que_task); + taskqueue_free(que->tq); + } + } mem: if (adapter->msix) pci_release_msi(dev); @@ -2744,10 +2796,11 @@ igb_setup_interface(device_t dev, struct ifp->if_softc = adapter; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = igb_ioctl; - ifp->if_start = igb_start; #if __FreeBSD_version >= 800000 ifp->if_transmit = igb_mq_start; ifp->if_qflush = igb_qflush; +#else + ifp->if_start = igb_start; #endif IFQ_SET_MAXLEN(&ifp->if_snd, adapter->num_tx_desc - 1); ifp->if_snd.ifq_drv_maxlen = adapter->num_tx_desc - 1; Modified: head/sys/dev/e1000/if_igb.h ============================================================================== --- head/sys/dev/e1000/if_igb.h Fri Jun 17 18:56:51 2011 (r223197) +++ head/sys/dev/e1000/if_igb.h Fri Jun 17 20:06:52 2011 (r223198) @@ -297,6 +297,7 @@ struct tx_ring { struct buf_ring *br; #endif bus_dma_tag_t txtag; + struct task txq_task; u32 bytes; u32 packets; From owner-svn-src-head@FreeBSD.ORG Fri Jun 17 20:25:40 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6DC9C106564A; Fri, 17 Jun 2011 20:25:40 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 4547B8FC18; Fri, 17 Jun 2011 20:25:40 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id EBC1C46B1A; Fri, 17 Jun 2011 16:25:39 -0400 (EDT) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 7BCA38A01F; Fri, 17 Jun 2011 16:25:39 -0400 (EDT) From: John Baldwin To: src-committers@freebsd.org Date: Fri, 17 Jun 2011 16:25:02 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110325; KDE/4.5.5; amd64; ; ) References: <201106172006.p5HK6qZs005000@svn.freebsd.org> In-Reply-To: <201106172006.p5HK6qZs005000@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201106171625.03191.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Fri, 17 Jun 2011 16:25:39 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r223198 - head/sys/dev/e1000 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jun 2011 20:25:40 -0000 On Friday, June 17, 2011 4:06:52 pm John Baldwin wrote: > Author: jhb > Date: Fri Jun 17 20:06:52 2011 > New Revision: 223198 > URL: http://svn.freebsd.org/changeset/base/223198 > > Log: > - Use a dedicated task to handle deferred transmits from the if_transmit > method instead of reusing the existing per-queue interrupt task. > Reusing the per-queue interrupt task could result in both an interrupt > thread and the taskqueue thread trying to handle received packets on a > single queue resulting in out-of-order packet processing. > - Don't define igb_start() at all on 8.0 and where if_transmit is used. > Replace last remaining call to igb_start() with a loop to kick off > transmit on each queue instead. > - Call ether_ifdetach() earlier in igb_detach(). > - Drain tasks and free taskqueues during igb_detach(). > > Reviewed by: jfv > MFC after: 1 week > > Modified: > head/sys/dev/e1000/if_igb.c > head/sys/dev/e1000/if_igb.h FYI, I ran into a workload where the concurrent reception of packets was breaking TCP. Specifically, the two threads could both attempt to process ACKs for a connection in the syncache. The first thread would "win" and create a connection, but the second thread had already done a pcb lookup and found the listen socket before waiting for a write lock on the TCP pcbinfo. As a result, the second thread also attempted to create a new connection based on the syncookie. However, it failed in in_pcbconnect_setup() with EADDRINUSE when it found the first connection in the PCB hash. When it failed, it dropped the ACK and sent a RST to the remote end causing the other end to drop the connection silently. Unfortunately, the first thread had created a valid socket which was returned to userland via accept(). That socket contained all the inflight data sent by the remote end before it received the RST. The net effect was that a user app would see a connection that only sent part of its data and then returned EOF. Note that a truly bidirectional application-level protocol would still break in this case with an EPIPE/SIGPIPE. However, if the remote peer is just opening a socket, dumping some data into it and then closing it without reading any data, it may close the socket before the RST arrives and thus encounter no errors completely unaware that the data it just sent over TCP was partially (or completely) lost. Note that that can still happen when using the syncache since we may fail to create a socket when expanding a syncache entry due to resource exhaustion giving similarly unpleasant failure semantics (i.e. the remote user app doesn't get an error and has no clue that their data is in fact lost). -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Fri Jun 17 20:47:44 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E6C73106566C; Fri, 17 Jun 2011 20:47:44 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BCAEC8FC08; Fri, 17 Jun 2011 20:47:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5HKli06006340; Fri, 17 Jun 2011 20:47:44 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5HKli7L006335; Fri, 17 Jun 2011 20:47:44 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201106172047.p5HKli7L006335@svn.freebsd.org> From: Ed Schouten Date: Fri, 17 Jun 2011 20:47:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223201 - in head: etc/periodic/monthly tools/build/mk tools/build/options usr.sbin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jun 2011 20:47:45 -0000 Author: ed Date: Fri Jun 17 20:47:44 2011 New Revision: 223201 URL: http://svn.freebsd.org/changeset/base/223201 Log: Don't omit ac(8) as part of WITHOUT_ACCT. The WITHOUT_ACCT switch is supposed to omit tools related to process accounting, namely accton and sa. ac(8) is just a simple tool that prints statistics based on data in the utx.log database. It has nothing to do with the former. Modified: head/etc/periodic/monthly/Makefile head/tools/build/mk/OptionalObsoleteFiles.inc head/tools/build/options/WITHOUT_ACCT head/usr.sbin/Makefile Modified: head/etc/periodic/monthly/Makefile ============================================================================== --- head/etc/periodic/monthly/Makefile Fri Jun 17 20:19:11 2011 (r223200) +++ head/etc/periodic/monthly/Makefile Fri Jun 17 20:47:44 2011 (r223201) @@ -2,12 +2,7 @@ .include -FILES= 999.local - -# NB: keep these sorted by MK_* knobs - -.if ${MK_ACCT} != "no" -FILES+= 200.accounting -.endif +FILES= 200.accounting \ + 999.local .include Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Fri Jun 17 20:19:11 2011 (r223200) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Fri Jun 17 20:47:44 2011 (r223201) @@ -8,10 +8,8 @@ .if ${MK_ACCT} == no OLD_FILES+=etc/periodic/daily/310.accounting OLD_FILES+=etc/periodic/monthly/200.accounting -OLD_FILES+=usr/sbin/ac OLD_FILES+=usr/sbin/accton OLD_FILES+=usr/sbin/sa -OLD_FILES+=usr/share/man/man8/ac.8.gz OLD_FILES+=usr/share/man/man8/accton.8.gz OLD_FILES+=usr/share/man/man8/sa.8.gz .endif Modified: head/tools/build/options/WITHOUT_ACCT ============================================================================== --- head/tools/build/options/WITHOUT_ACCT Fri Jun 17 20:19:11 2011 (r223200) +++ head/tools/build/options/WITHOUT_ACCT Fri Jun 17 20:47:44 2011 (r223201) @@ -1,5 +1,5 @@ .\" $FreeBSD$ Set to not build process accounting tools such as -.Xr ac 8 +.Xr accton 8 and -.Xr accton 8 . +.Xr sa 8 . Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Fri Jun 17 20:19:11 2011 (r223200) +++ head/usr.sbin/Makefile Fri Jun 17 20:47:44 2011 (r223201) @@ -3,7 +3,8 @@ .include -SUBDIR= adduser \ +SUBDIR= ac \ + adduser \ arp \ bootparamd \ burncd \ @@ -99,7 +100,6 @@ SUBDIR= adduser \ # NB: keep these sorted by MK_* knobs .if ${MK_ACCT} != "no" -SUBDIR+= ac SUBDIR+= accton SUBDIR+= sa .endif From owner-svn-src-head@FreeBSD.ORG Fri Jun 17 20:49:30 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 60AD81065670; Fri, 17 Jun 2011 20:49:30 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 50F2F8FC1D; Fri, 17 Jun 2011 20:49:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5HKnUuR006423; Fri, 17 Jun 2011 20:49:30 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5HKnU49006421; Fri, 17 Jun 2011 20:49:30 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201106172049.p5HKnU49006421@svn.freebsd.org> From: Ed Schouten Date: Fri, 17 Jun 2011 20:49:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223202 - head/share/man/man5 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jun 2011 20:49:30 -0000 Author: ed Date: Fri Jun 17 20:49:30 2011 New Revision: 223202 URL: http://svn.freebsd.org/changeset/base/223202 Log: Update manpage. Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Fri Jun 17 20:47:44 2011 (r223201) +++ head/share/man/man5/src.conf.5 Fri Jun 17 20:49:30 2011 (r223202) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 221733 2011-05-10 13:01:11Z ru .\" $FreeBSD$ -.Dd May 22, 2011 +.Dd June 17, 2011 .Dt SRC.CONF 5 .Os .Sh NAME @@ -78,11 +78,11 @@ The following list provides a name and s that can be used for source builds. .Bl -tag -width indent .It Va WITHOUT_ACCT -.\" from FreeBSD: head/tools/build/options/WITHOUT_ACCT 221540 2011-05-06 19:13:03Z ru +.\" from FreeBSD: head/tools/build/options/WITHOUT_ACCT 223201 2011-06-17 20:47:44Z ed Set to not build process accounting tools such as -.Xr ac 8 +.Xr accton 8 and -.Xr accton 8 . +.Xr sa 8 . .It Va WITHOUT_ACPI .\" from FreeBSD: head/tools/build/options/WITHOUT_ACPI 156932 2006-03-21 07:50:50Z ru Set to not build @@ -225,8 +225,8 @@ Set to not build the boot blocks and loa Set to not build the BSD licensed version of cpio based on .Xr libarchive 3 . .It Va WITH_BSD_GREP -.\" from FreeBSD: head/tools/build/options/WITH_BSD_GREP 211701 2010-08-23 10:04:26Z gabor -Build BSD-licensed grep instead of GNU grep. +.\" from FreeBSD: head/tools/build/options/WITH_BSD_GREP 222273 2011-05-25 01:04:12Z obrien +Install BSD-licensed grep as '[ef]grep' instead of GNU grep. .It Va WITHOUT_BSNMP .\" from FreeBSD: head/tools/build/options/WITHOUT_BSNMP 183306 2008-09-23 16:15:42Z sam Set to not build or install From owner-svn-src-head@FreeBSD.ORG Fri Jun 17 21:16:28 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D373A1065670; Fri, 17 Jun 2011 21:16:27 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C33218FC0C; Fri, 17 Jun 2011 21:16:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5HLGRiG007407; Fri, 17 Jun 2011 21:16:27 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5HLGRnM007405; Fri, 17 Jun 2011 21:16:27 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201106172116.p5HLGRnM007405@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 17 Jun 2011 21:16:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223206 - head/lib/libc/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jun 2011 21:16:28 -0000 Author: jilles Date: Fri Jun 17 21:16:27 2011 New Revision: 223206 URL: http://svn.freebsd.org/changeset/base/223206 Log: posix_spawn(3): Document r222511 (trying to close already closed fd). MFC after: 1 week Modified: head/lib/libc/gen/posix_spawn.3 Modified: head/lib/libc/gen/posix_spawn.3 ============================================================================== --- head/lib/libc/gen/posix_spawn.3 Fri Jun 17 21:03:21 2011 (r223205) +++ head/lib/libc/gen/posix_spawn.3 Fri Jun 17 21:16:27 2011 (r223206) @@ -34,7 +34,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 24, 2008 +.Dd June 17, 2011 .Dt POSIX_SPAWN 3 .Os .Sh NAME @@ -384,29 +384,28 @@ the child process exits with exit status .It If the .Fa file_actions -argument is not NULL, and specifies any close, dup2, or open actions to be +argument is not NULL, and specifies any dup2 or open actions to be performed, and if .Fn posix_spawn or .Fn posix_spawnp fails for any of the reasons that would cause -.Fn close , -.Fn dup2 , +.Fn dup2 or .Fn open to fail, an error value is returned as described by -.Fn close , -.Fn dup2 , +.Fn dup2 and .Fn open , respectively (or, if the error occurs after the calling process successfully returns, the child process exits with exit status 127). An open file action may, by itself, result in any of the errors described by -.Fn close -or .Fn dup2 , in addition to those described by .Fn open . +This implementation ignores any errors from +.Fn close , +including trying to close a descriptor that is not open. .El .Sh SEE ALSO .Xr close 2 , @@ -443,7 +442,13 @@ The and .Fn posix_spawnp functions conform to -.St -p1003.1-2001 . +.St -p1003.1-2001 , +except that they ignore all errors from +.Fn close . +A future update of the Standard is expected to require that these functions +not fail because a file descriptor to be closed (via +.Fn posix_spawn_file_actions_addclose ) +is not open. .Sh HISTORY The .Fn posix_spawn From owner-svn-src-head@FreeBSD.ORG Fri Jun 17 21:19:02 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3188B1065677; Fri, 17 Jun 2011 21:19:02 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2100F8FC0C; Fri, 17 Jun 2011 21:19:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5HLJ2sA007535; Fri, 17 Jun 2011 21:19:02 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5HLJ1TM007532; Fri, 17 Jun 2011 21:19:01 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201106172119.p5HLJ1TM007532@svn.freebsd.org> From: John Baldwin Date: Fri, 17 Jun 2011 21:19:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223207 - head/sys/dev/acpica X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jun 2011 21:19:02 -0000 Author: jhb Date: Fri Jun 17 21:19:01 2011 New Revision: 223207 URL: http://svn.freebsd.org/changeset/base/223207 Log: Don't create a device_t object or parse current resources (via _CRS) for ACPI Device() objects that do not have any device IDs available via the _HID or _CID methods. Without a device ID a device driver cannot attach to the device anyway. Namespace objects that are devices but not of type ACPI_TYPE_DEVICE are not affected. A few BIOSes have also attached a _CRS method to a PCI device to allocate resources that are not managed via a BAR. With the previous code those resources are allocated from acpi0 directly which can interfere with the new PCI-PCI bridge driver (since the PCI device in question may be behind a bridge and its resources should be allocated from that bridge's windows instead). The resources were also orphaned and and would end up associated with some other random device whose device_t reused the pointer of the original ACPI-enumerated device (after it was free'd by the ACPI PCI bus driver) in devinfo output which was confusing. If we want to handle _CRS on PCI devices we can adjust the ACPI PCI bus driver to do that in the future and associate the resources with the proper device object respecting PCI-PCI bridges, etc. Note that with this change the ACPI PCI bus driver no longer has to delete ACPI-enumerated device_t devices that mirror PCI devices since they should in general not exist. There are rare cases when a BIOS will give a PCI device a _HID (e.g. I've seen a PCI-ISA bridge given a _HID for a system resource device). In that case we leave both the ACPI and PCI-enumerated device_t objects around just as in the previous code. Modified: head/sys/dev/acpica/acpi.c head/sys/dev/acpica/acpi_pci.c Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Fri Jun 17 21:16:27 2011 (r223206) +++ head/sys/dev/acpica/acpi.c Fri Jun 17 21:19:01 2011 (r223207) @@ -151,6 +151,7 @@ static ACPI_STATUS acpi_sleep_disable(st static ACPI_STATUS acpi_EnterSleepState(struct acpi_softc *sc, int state); static void acpi_shutdown_final(void *arg, int howto); static void acpi_enable_fixed_events(struct acpi_softc *sc); +static BOOLEAN acpi_has_hid(ACPI_HANDLE handle); static int acpi_wake_sleep_prep(ACPI_HANDLE handle, int sstate); static int acpi_wake_run_prep(ACPI_HANDLE handle, int sstate); static int acpi_wake_prep_walk(int sstate); @@ -1855,6 +1856,13 @@ acpi_probe_child(ACPI_HANDLE handle, UIN break; if (acpi_parse_prw(handle, &prw) == 0) AcpiSetupGpeForWake(handle, prw.gpe_handle, prw.gpe_bit); + + /* + * Ignore devices that do not have a _HID or _CID. They should + * be discovered by other buses (e.g. the PCI bus driver). + */ + if (!acpi_has_hid(handle)) + break; /* FALLTHROUGH */ case ACPI_TYPE_PROCESSOR: case ACPI_TYPE_THERMAL: @@ -2043,6 +2051,30 @@ acpi_BatteryIsPresent(device_t dev) } /* + * Returns true if a device has at least one valid device ID. + */ +static BOOLEAN +acpi_has_hid(ACPI_HANDLE h) +{ + ACPI_DEVICE_INFO *devinfo; + BOOLEAN ret; + + if (h == NULL || + ACPI_FAILURE(AcpiGetObjectInfo(h, &devinfo))) + return (FALSE); + + ret = FALSE; + if ((devinfo->Valid & ACPI_VALID_HID) != 0) + ret = TRUE; + else if ((devinfo->Valid & ACPI_VALID_CID) != 0) + if (devinfo->CompatibleIdList.Count > 0) + ret = TRUE; + + AcpiOsFree(devinfo); + return (ret); +} + +/* * Match a HID string against a handle */ BOOLEAN Modified: head/sys/dev/acpica/acpi_pci.c ============================================================================== --- head/sys/dev/acpica/acpi_pci.c Fri Jun 17 21:16:27 2011 (r223206) +++ head/sys/dev/acpica/acpi_pci.c Fri Jun 17 21:19:01 2011 (r223207) @@ -209,38 +209,24 @@ acpi_pci_update_device(ACPI_HANDLE handl device_t child; /* - * Lookup and remove the unused device that acpi0 creates when it walks - * the namespace creating devices. + * Occasionally a PCI device may show up as an ACPI device + * with a _HID. (For example, the TabletPC TC1000 has a + * second PCI-ISA bridge that has a _HID for an + * acpi_sysresource device.) In that case, leave ACPI-CA's + * device data pointing at the ACPI-enumerated device. */ child = acpi_get_device(handle); if (child != NULL) { - if (device_is_alive(child)) { - /* - * The TabletPC TC1000 has a second PCI-ISA bridge - * that has a _HID for an acpi_sysresource device. - * In that case, leave ACPI-CA's device data pointing - * at the ACPI-enumerated device. - */ - device_printf(child, - "Conflicts with PCI device %d:%d:%d\n", - pci_get_bus(pci_child), pci_get_slot(pci_child), - pci_get_function(pci_child)); - return; - } KASSERT(device_get_parent(child) == devclass_get_device(devclass_find("acpi"), 0), ("%s: child (%s)'s parent is not acpi0", __func__, acpi_name(handle))); - device_delete_child(device_get_parent(child), child); + return; } /* * Update ACPI-CA to use the PCI enumerated device_t for this handle. */ - status = AcpiDetachData(handle, acpi_fake_objhandler); - if (ACPI_FAILURE(status)) - printf("WARNING: Unable to detach object data from %s - %s\n", - acpi_name(handle), AcpiFormatException(status)); status = AcpiAttachData(handle, acpi_fake_objhandler, pci_child); if (ACPI_FAILURE(status)) printf("WARNING: Unable to attach object data to %s - %s\n", From owner-svn-src-head@FreeBSD.ORG Fri Jun 17 21:20:42 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 02C85106566C; Fri, 17 Jun 2011 21:20:42 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E71F58FC19; Fri, 17 Jun 2011 21:20:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5HLKfvV007631; Fri, 17 Jun 2011 21:20:41 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5HLKfVo007628; Fri, 17 Jun 2011 21:20:41 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201106172120.p5HLKfVo007628@svn.freebsd.org> From: Ed Schouten Date: Fri, 17 Jun 2011 21:20:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223208 - head/tools/build/mk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jun 2011 21:20:42 -0000 Author: ed Date: Fri Jun 17 21:20:41 2011 New Revision: 223208 URL: http://svn.freebsd.org/changeset/base/223208 Log: Don't remove the periodic script for ac(8) when setting WITHOUT_ACCT. Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Fri Jun 17 21:19:01 2011 (r223207) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Fri Jun 17 21:20:41 2011 (r223208) @@ -7,7 +7,6 @@ .if ${MK_ACCT} == no OLD_FILES+=etc/periodic/daily/310.accounting -OLD_FILES+=etc/periodic/monthly/200.accounting OLD_FILES+=usr/sbin/accton OLD_FILES+=usr/sbin/sa OLD_FILES+=usr/share/man/man8/accton.8.gz From owner-svn-src-head@FreeBSD.ORG Fri Jun 17 21:30:21 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B3A1B1065673; Fri, 17 Jun 2011 21:30:21 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9925D8FC18; Fri, 17 Jun 2011 21:30:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5HLULoU008150; Fri, 17 Jun 2011 21:30:21 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5HLULOm008143; Fri, 17 Jun 2011 21:30:21 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201106172130.p5HLULOm008143@svn.freebsd.org> From: Ed Schouten Date: Fri, 17 Jun 2011 21:30:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223209 - in head: etc/periodic/monthly share/mk tools/build/mk tools/build/options usr.bin usr.sbin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jun 2011 21:30:21 -0000 Author: ed Date: Fri Jun 17 21:30:21 2011 New Revision: 223209 URL: http://svn.freebsd.org/changeset/base/223209 Log: Add WITHOUT_UTMPX switch to the build system. This knob removes the tools that are exclusively used to view and maintain the databases maintained by utmpx, namely last, users, who, wtmpcvt, ac, lastlogin and utxrm. The tool w is not in this list, because it has some other functionality which is unrelated to utmpx; it is hardlinked to the uptime tool. Added: head/tools/build/options/WITHOUT_UTMPX (contents, props changed) Modified: head/etc/periodic/monthly/Makefile head/share/mk/bsd.own.mk head/tools/build/mk/OptionalObsoleteFiles.inc head/usr.bin/Makefile head/usr.sbin/Makefile Modified: head/etc/periodic/monthly/Makefile ============================================================================== --- head/etc/periodic/monthly/Makefile Fri Jun 17 21:20:41 2011 (r223208) +++ head/etc/periodic/monthly/Makefile Fri Jun 17 21:30:21 2011 (r223209) @@ -2,7 +2,12 @@ .include -FILES= 200.accounting \ - 999.local +FILES= 999.local + +# NB: keep these sorted by MK_* knobs + +.if ${MK_UTMPX} != "no" +FILES+= 200.accounting +.endif .include Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Fri Jun 17 21:20:41 2011 (r223208) +++ head/share/mk/bsd.own.mk Fri Jun 17 21:30:21 2011 (r223209) @@ -383,6 +383,7 @@ __DEFAULT_YES_OPTIONS = \ TEXTPROC \ TOOLCHAIN \ USB \ + UTMPX \ WIRELESS \ WPA_SUPPLICANT_EAPOL \ ZFS \ Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Fri Jun 17 21:20:41 2011 (r223208) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Fri Jun 17 21:30:21 2011 (r223209) @@ -3326,6 +3326,24 @@ OLD_FILES+=usr/share/man/man8/telnetd.8. # to be filled in #.endif +.if ${MK_UTMPX} == no +OLD_FILES+=etc/periodic/monthly/200.accounting +OLD_FILES+=usr/bin/last +OLD_FILES+=usr/bin/users +OLD_FILES+=usr/bin/who +OLD_FILES+=usr/bin/wtmpcvt +OLD_FILES+=usr/sbin/ac +OLD_FILES+=usr/sbin/lastlogin +OLD_FILES+=usr/sbin/utxrm +OLD_FILES+=usr/share/man/man1/last.1.gz +OLD_FILES+=usr/share/man/man1/users.1.gz +OLD_FILES+=usr/share/man/man1/who.1.gz +OLD_FILES+=usr/share/man/man1/wtmpcvt.1.gz +OLD_FILES+=usr/share/man/man8/ac.8.gz +OLD_FILES+=usr/share/man/man8/lastlogin.8.gz +OLD_FILES+=usr/share/man/man8/utxrm.8.gz +.endif + .if ${MK_WIRELESS} == no OLD_FILES+=etc/regdomain.xml OLD_FILES+=usr/sbin/ancontrol Added: head/tools/build/options/WITHOUT_UTMPX ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITHOUT_UTMPX Fri Jun 17 21:30:21 2011 (r223209) @@ -0,0 +1,10 @@ +.\" $FreeBSD$ +Set to not build user accounting tools such as +.Xr last 1 , +.Xr users 1 , +.Xr who 1 , +.Xr wtmpcvt 1 , +.Xr ac 8 , +.Xr lastlogin 8 +and +.Xr utxrm 8 . Modified: head/usr.bin/Makefile ============================================================================== --- head/usr.bin/Makefile Fri Jun 17 21:20:41 2011 (r223208) +++ head/usr.bin/Makefile Fri Jun 17 21:30:21 2011 (r223209) @@ -74,7 +74,6 @@ SUBDIR= alias \ ktrace \ ktrdump \ lam \ - last \ lastcomm \ ldd \ leave \ @@ -170,7 +169,6 @@ SUBDIR= alias \ unzip \ units \ unvis \ - users \ uudecode \ uuencode \ vi \ @@ -182,10 +180,8 @@ SUBDIR= alias \ what \ whereis \ which \ - who \ whois \ write \ - wtmpcvt \ xargs \ xinstall \ ${_xlint} \ @@ -338,6 +334,13 @@ SUBDIR+= usbhidaction SUBDIR+= usbhidctl .endif +.if ${MK_UTMPX} != "no" +SUBDIR+= last +SUBDIR+= users +SUBDIR+= who +SUBDIR+= wtmpcvt +.endif + .include SUBDIR:= ${SUBDIR:O} Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Fri Jun 17 21:20:41 2011 (r223208) +++ head/usr.sbin/Makefile Fri Jun 17 21:30:21 2011 (r223209) @@ -3,8 +3,7 @@ .include -SUBDIR= ac \ - adduser \ +SUBDIR= adduser \ arp \ bootparamd \ burncd \ @@ -35,7 +34,6 @@ SUBDIR= ac \ inetd \ iostat \ kldxref \ - lastlogin \ mailwrapper \ makefs \ manctl \ @@ -90,7 +88,6 @@ SUBDIR= ac \ trpt \ tzsetup \ ugidfw \ - utxrm \ vipw \ wake \ watch \ @@ -299,6 +296,12 @@ SUBDIR+= usbconfig SUBDIR+= usbdump .endif +.if ${MK_UTMPX} != "no" +SUBDIR+= ac +SUBDIR+= lastlogin +SUBDIR+= utxrm +.endif + .if ${MK_WIRELESS} != "no" SUBDIR+= ancontrol SUBDIR+= wlandebug From owner-svn-src-head@FreeBSD.ORG Fri Jun 17 21:31:14 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F3F9106566C; Fri, 17 Jun 2011 21:31:14 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4BF598FC16; Fri, 17 Jun 2011 21:31:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5HLVEJi008315; Fri, 17 Jun 2011 21:31:14 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5HLVErZ008313; Fri, 17 Jun 2011 21:31:14 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201106172131.p5HLVErZ008313@svn.freebsd.org> From: Ed Schouten Date: Fri, 17 Jun 2011 21:31:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223210 - head/share/man/man5 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jun 2011 21:31:14 -0000 Author: ed Date: Fri Jun 17 21:31:13 2011 New Revision: 223210 URL: http://svn.freebsd.org/changeset/base/223210 Log: Regenerate src.conf.5. Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Fri Jun 17 21:30:21 2011 (r223209) +++ head/share/man/man5/src.conf.5 Fri Jun 17 21:31:13 2011 (r223210) @@ -916,6 +916,17 @@ When set, it also enforces the following .It Va WITHOUT_USB .\" from FreeBSD: head/tools/build/options/WITHOUT_USB 156932 2006-03-21 07:50:50Z ru Set to not build USB-related programs and libraries. +.It Va WITHOUT_UTMPX +.\" from FreeBSD: head/tools/build/options/WITHOUT_UTMPX 223209 2011-06-17 21:30:21Z ed +Set to not build user accounting tools such as +.Xr last 1 , +.Xr users 1 , +.Xr who 1 , +.Xr wtmpcvt 1 , +.Xr ac 8 , +.Xr lastlogin 8 +and +.Xr utxrm 8 . .It Va WITHOUT_WIRELESS .\" from FreeBSD: head/tools/build/options/WITHOUT_WIRELESS 183242 2008-09-21 22:02:26Z sam Set to not build programs used for 802.11 wireless networks; especially From owner-svn-src-head@FreeBSD.ORG Fri Jun 17 21:41:06 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A105B106564A; Fri, 17 Jun 2011 21:41:06 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 912378FC18; Fri, 17 Jun 2011 21:41:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5HLf6rI009156; Fri, 17 Jun 2011 21:41:06 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5HLf6Rx009154; Fri, 17 Jun 2011 21:41:06 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201106172141.p5HLf6Rx009154@svn.freebsd.org> From: Jung-uk Kim Date: Fri, 17 Jun 2011 21:41:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223211 - head/sys/x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jun 2011 21:41:06 -0000 Author: jkim Date: Fri Jun 17 21:41:06 2011 New Revision: 223211 URL: http://svn.freebsd.org/changeset/base/223211 Log: Teach the compiler how to shift TSC value efficiently. As noted in r220631, some times compiler inserts redundant instructions to preserve unused upper 32 bits even when it is casted to a 32-bit value. Unfortunately, it seems the problem becomes more serious when it is shifted, especially on amd64. Modified: head/sys/x86/x86/tsc.c Modified: head/sys/x86/x86/tsc.c ============================================================================== --- head/sys/x86/x86/tsc.c Fri Jun 17 21:31:13 2011 (r223210) +++ head/sys/x86/x86/tsc.c Fri Jun 17 21:41:06 2011 (r223211) @@ -461,7 +461,7 @@ init_TSC_tc(void) tsc_timecounter.tc_quality = 1000; init: - for (shift = 0; shift < 32 && (tsc_freq >> shift) > max_freq; shift++) + for (shift = 0; shift < 31 && (tsc_freq >> shift) > max_freq; shift++) ; if (shift > 0) { tsc_timecounter.tc_get_timecount = tsc_get_timecount_low; @@ -579,6 +579,9 @@ tsc_get_timecount(struct timecounter *tc static u_int tsc_get_timecount_low(struct timecounter *tc) { + uint32_t rv; - return (rdtsc() >> (int)(intptr_t)tc->tc_priv); + __asm __volatile("rdtsc; shrd %%cl, %%edx, %0" + : "=a" (rv) : "c" ((int)(intptr_t)tc->tc_priv) : "edx"); + return (rv); } From owner-svn-src-head@FreeBSD.ORG Fri Jun 17 21:44:13 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C2765106566C; Fri, 17 Jun 2011 21:44:13 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B269E8FC0A; Fri, 17 Jun 2011 21:44:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5HLiDfo009297; Fri, 17 Jun 2011 21:44:13 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5HLiDdP009295; Fri, 17 Jun 2011 21:44:13 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201106172144.p5HLiDdP009295@svn.freebsd.org> From: "David E. O'Brien" Date: Fri, 17 Jun 2011 21:44:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223212 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jun 2011 21:44:13 -0000 Author: obrien Date: Fri Jun 17 21:44:13 2011 New Revision: 223212 URL: http://svn.freebsd.org/changeset/base/223212 Log: Add comment from CSRG rev 7.27 (1992/06/23 19:56:55; author: mckusick) Modified: head/sys/kern/sys_process.c Modified: head/sys/kern/sys_process.c ============================================================================== --- head/sys/kern/sys_process.c Fri Jun 17 21:41:06 2011 (r223211) +++ head/sys/kern/sys_process.c Fri Jun 17 21:44:13 2011 (r223212) @@ -829,6 +829,15 @@ kern_ptrace(struct thread *td, int req, case PT_ATTACH: /* security check done above */ + /* + * It would be nice if the tracing relationship was separate + * from the parent relationship but that would require + * another set of links in the proc struct or for "wait" + * to scan the entire proc table. To make life easier, + * we just re-parent the process we're trying to trace. + * The old parent is remembered so we can put things back + * on a "detach". + */ p->p_flag |= P_TRACED; p->p_oppid = p->p_pptr->p_pid; if (p->p_pptr != td->td_proc) { From owner-svn-src-head@FreeBSD.ORG Sat Jun 18 00:10:21 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 690351065673; Sat, 18 Jun 2011 00:10:21 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 58CE88FC1B; Sat, 18 Jun 2011 00:10:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5I0ALAX013798; Sat, 18 Jun 2011 00:10:21 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5I0ALTH013796; Sat, 18 Jun 2011 00:10:21 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201106180010.p5I0ALTH013796@svn.freebsd.org> From: Xin LI Date: Sat, 18 Jun 2011 00:10:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223214 - head/lib/libc/db/man X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jun 2011 00:10:21 -0000 Author: delphij Date: Sat Jun 18 00:10:21 2011 New Revision: 223214 URL: http://svn.freebsd.org/changeset/base/223214 Log: The flags argument of mpool_get() is meaningful, document it. MFC after: 2 weeks Modified: head/lib/libc/db/man/mpool.3 Modified: head/lib/libc/db/man/mpool.3 ============================================================================== --- head/lib/libc/db/man/mpool.3 Fri Jun 17 22:01:10 2011 (r223213) +++ head/lib/libc/db/man/mpool.3 Sat Jun 18 00:10:21 2011 (r223214) @@ -28,7 +28,7 @@ .\" @(#)mpool.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd February 25, 1999 +.Dd June 17, 2011 .Dt MPOOL 3 .Os .Sh NAME @@ -147,7 +147,14 @@ is returned and is set. The .Fa flags -argument is not currently used. +argument is specified by +.Em or Ns 'ing +any of the following values: +.Bl -tag -width indent +.It Dv MPOOL_IGNOREPIN +The page returned is not pinned; +page will otherwise be pinned on return. +.El .Pp The .Fn mpool_put From owner-svn-src-head@FreeBSD.ORG Sat Jun 18 00:29:10 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B5EDB1065676; Sat, 18 Jun 2011 00:29:10 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A5C368FC13; Sat, 18 Jun 2011 00:29:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5I0TAjd014360; Sat, 18 Jun 2011 00:29:10 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5I0TACr014358; Sat, 18 Jun 2011 00:29:10 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201106180029.p5I0TACr014358@svn.freebsd.org> From: Xin LI Date: Sat, 18 Jun 2011 00:29:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223215 - head/lib/libc/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jun 2011 00:29:10 -0000 Author: delphij Date: Sat Jun 18 00:29:10 2011 New Revision: 223215 URL: http://svn.freebsd.org/changeset/base/223215 Log: Sync with OpenBSD (zap rcsid). MFC after: 2 weeks Modified: head/lib/libc/gen/ftw.c Modified: head/lib/libc/gen/ftw.c ============================================================================== --- head/lib/libc/gen/ftw.c Sat Jun 18 00:10:21 2011 (r223214) +++ head/lib/libc/gen/ftw.c Sat Jun 18 00:29:10 2011 (r223215) @@ -1,4 +1,4 @@ -/* $OpenBSD: ftw.c,v 1.4 2004/07/07 16:05:23 millert Exp $ */ +/* $OpenBSD: ftw.c,v 1.5 2005/08/08 08:05:34 espie Exp $ */ /* * Copyright (c) 2003, 2004 Todd C. Miller @@ -20,12 +20,6 @@ * Materiel Command, USAF, under agreement number F39502-99-1-0512. */ -#if 0 -#if defined(LIBC_SCCS) && !defined(lint) -static const char rcsid[] = "$OpenBSD: ftw.c,v 1.4 2004/07/07 16:05:23 millert Exp $"; -#endif /* LIBC_SCCS and not lint */ -#endif - #include __FBSDID("$FreeBSD$"); From owner-svn-src-head@FreeBSD.ORG Sat Jun 18 00:33:35 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 03C45106566B; Sat, 18 Jun 2011 00:33:35 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E679C8FC08; Sat, 18 Jun 2011 00:33:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5I0XYoa014535; Sat, 18 Jun 2011 00:33:34 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5I0XYuc014532; Sat, 18 Jun 2011 00:33:34 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201106180033.p5I0XYuc014532@svn.freebsd.org> From: Xin LI Date: Sat, 18 Jun 2011 00:33:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223216 - head/lib/libc/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jun 2011 00:33:35 -0000 Author: delphij Date: Sat Jun 18 00:33:34 2011 New Revision: 223216 URL: http://svn.freebsd.org/changeset/base/223216 Log: Sync with OpenBSD, primarily make the code easier to read, and a license change to standard OpenBSD ISC license. Obtained from: OpenBSD MFC after: 2 weeks Modified: head/lib/libc/gen/basename.3 head/lib/libc/gen/basename.c Modified: head/lib/libc/gen/basename.3 ============================================================================== --- head/lib/libc/gen/basename.3 Sat Jun 18 00:29:10 2011 (r223215) +++ head/lib/libc/gen/basename.3 Sat Jun 18 00:33:34 2011 (r223216) @@ -1,33 +1,22 @@ +.\" $OpenBSD: basename.3,v 1.20 2007/05/31 19:19:28 jmc Exp $ .\" .\" Copyright (c) 1997 Todd C. Miller -.\" 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. -.\" 3. The name of the author may not be used to endorse or promote products -.\" derived from this software without specific prior written permission. +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. .\" -.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, -.\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY -.\" AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL -.\" THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -.\" EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -.\" PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -.\" OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -.\" WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -.\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -.\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.\" $OpenBSD: basename.3,v 1.12 2000/04/18 03:01:25 aaron Exp $ .\" $FreeBSD$ .\" -.Dd October 6, 2009 +.Dd March 31, 2010 .Dt BASENAME 3 .Os .Sh NAME @@ -42,8 +31,7 @@ .Sh DESCRIPTION The .Fn basename -function -returns the last component from the pathname pointed to by +function returns the last component from the pathname pointed to by .Fa path , deleting any trailing .Sq \&/ @@ -111,4 +99,15 @@ function first appeared in and .Fx 4.2 . .Sh AUTHORS -.An "Todd C. Miller" Aq Todd.Miller@courtesan.com +.An Todd C. Miller +.Sh CAVEATS +.Fn basename +returns a pointer to internal static storage space that will be overwritten +by subsequent calls. +.Pp +Other vendor implementations of +.Fn basename +may modify the contents of the string passed to +.Fn basename ; +this should be taken into account when writing code which calls this function +if portability is desired. Modified: head/lib/libc/gen/basename.c ============================================================================== --- head/lib/libc/gen/basename.c Sat Jun 18 00:29:10 2011 (r223215) +++ head/lib/libc/gen/basename.c Sat Jun 18 00:33:34 2011 (r223216) @@ -1,35 +1,21 @@ +/* $OpenBSD: basename.c,v 1.14 2005/08/08 08:05:33 espie Exp $ */ + /* - * Copyright (c) 1997 Todd C. Miller - * All rights reserved. + * Copyright (c) 1997, 2004 Todd C. Miller * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#if 0 -#ifndef lint -static char rcsid[] = "$OpenBSD: basename.c,v 1.4 1999/05/30 17:10:30 espie Exp $"; -#endif /* not lint */ -#endif #include __FBSDID("$FreeBSD$"); @@ -40,27 +26,28 @@ __FBSDID("$FreeBSD$"); #include char * -basename_r(path, bname) - const char *path; - char *bname; +basename_r(const char *path, char *bname) { const char *endp, *startp; + size_t len; /* Empty or NULL string gets treated as "." */ if (path == NULL || *path == '\0') { - (void)strcpy(bname, "."); - return(bname); + bname[0] = '.'; + bname[1] = '\0'; + return (bname); } - /* Strip trailing slashes */ + /* Strip any trailing slashes */ endp = path + strlen(path) - 1; while (endp > path && *endp == '/') endp--; /* All slashes becomes "/" */ if (endp == path && *endp == '/') { - (void)strcpy(bname, "/"); - return(bname); + bname[0] = '/'; + bname[1] = '\0'; + return (bname); } /* Find the start of the base */ @@ -68,18 +55,18 @@ basename_r(path, bname) while (startp > path && *(startp - 1) != '/') startp--; - if (endp - startp + 2 > MAXPATHLEN) { + len = endp - startp + 1; + if (len >= MAXPATHLEN) { errno = ENAMETOOLONG; - return(NULL); + return (NULL); } - (void)strncpy(bname, startp, endp - startp + 1); - bname[endp - startp + 1] = '\0'; - return(bname); + memcpy(bname, startp, len); + bname[len] = '\0'; + return (bname); } char * -basename(path) - const char *path; +basename(const char *path) { static char *bname = NULL; From owner-svn-src-head@FreeBSD.ORG Sat Jun 18 00:53:51 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A72D6106564A; Sat, 18 Jun 2011 00:53:51 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 96E2F8FC15; Sat, 18 Jun 2011 00:53:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5I0rppu015268; Sat, 18 Jun 2011 00:53:51 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5I0rpBi015266; Sat, 18 Jun 2011 00:53:51 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201106180053.p5I0rpBi015266@svn.freebsd.org> From: "David E. O'Brien" Date: Sat, 18 Jun 2011 00:53:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223217 - head/lib/libc/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jun 2011 00:53:51 -0000 Author: obrien Date: Sat Jun 18 00:53:51 2011 New Revision: 223217 URL: http://svn.freebsd.org/changeset/base/223217 Log: Note how wait(3) is implemented. Modified: head/lib/libc/sys/wait.2 Modified: head/lib/libc/sys/wait.2 ============================================================================== --- head/lib/libc/sys/wait.2 Sat Jun 18 00:33:34 2011 (r223216) +++ head/lib/libc/sys/wait.2 Sat Jun 18 00:53:51 2011 (r223217) @@ -66,6 +66,19 @@ the .Fa status area contains termination information about the process that exited as defined below. +The +.Fn wait +call is the same as +.Fn wait4 +with a +.Fa wpid +value of -1, +with an +.Fa options +value of zero, +and a +.Fa rusage +value of zero. .Pp The .Fn wait4 From owner-svn-src-head@FreeBSD.ORG Sat Jun 18 01:26:28 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 398A9106564A for ; Sat, 18 Jun 2011 01:26:28 +0000 (UTC) (envelope-from peterjeremy@acm.org) Received: from fallbackmx07.syd.optusnet.com.au (fallbackmx07.syd.optusnet.com.au [211.29.132.9]) by mx1.freebsd.org (Postfix) with ESMTP id BDB378FC16 for ; Sat, 18 Jun 2011 01:26:27 +0000 (UTC) Received: from mail17.syd.optusnet.com.au (mail17.syd.optusnet.com.au [211.29.132.198]) by fallbackmx07.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p5HNI2pY015916 for ; Sat, 18 Jun 2011 09:18:03 +1000 Received: from server.vk2pj.dyndns.org (c220-239-116-103.belrs4.nsw.optusnet.com.au [220.239.116.103]) by mail17.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p5HNHxtg028220 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 18 Jun 2011 09:18:00 +1000 X-Bogosity: Ham, spamicity=0.000000 Received: from server.vk2pj.dyndns.org (localhost.vk2pj.dyndns.org [127.0.0.1]) by server.vk2pj.dyndns.org (8.14.4/8.14.4) with ESMTP id p5HNHwFQ040546; Sat, 18 Jun 2011 09:17:58 +1000 (EST) (envelope-from peter@server.vk2pj.dyndns.org) Received: (from peter@localhost) by server.vk2pj.dyndns.org (8.14.4/8.14.4/Submit) id p5HNHw66040545; Sat, 18 Jun 2011 09:17:58 +1000 (EST) (envelope-from peter) Date: Sat, 18 Jun 2011 09:17:57 +1000 From: Peter Jeremy To: Nathan Whitehorn Message-ID: <20110617231757.GA40286@server.vk2pj.dyndns.org> References: <201106152338.p5FNcFlN003175@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="3V7upXqbjpZ4EhLz" Content-Disposition: inline In-Reply-To: <201106152338.p5FNcFlN003175@svn.freebsd.org> X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r223129 - head/release X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jun 2011 01:26:28 -0000 --3V7upXqbjpZ4EhLz Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2011-Jun-15 23:38:15 +0000, Nathan Whitehorn wr= ote: >Log: > Do not install the rescue tools onto the install CD. Since it is read > only, they are very unlikely to be needed and take up a great deal of > space. If I've correctly understood this change, I'm not sure this is a positive move. Based on a quick test, removing /rescue saves about 4MB (in reality, the saving should be less because /rescue removes the need for /stand). OTOH, it renders the install CD useless as a recovery "fixit" disk - whilst the CD is unlikely to need recovery itself, it was useful for recovering hard disks --=20 Peter Jeremy --3V7upXqbjpZ4EhLz Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (FreeBSD) iEYEARECAAYFAk374KUACgkQ/opHv/APuIdDNgCeOVhnEU436v4sByDeMW6WNefF VNoAoKaJ7iJjIVlE0mXV00k/mmdwgIZd =D1ro -----END PGP SIGNATURE----- --3V7upXqbjpZ4EhLz-- From owner-svn-src-head@FreeBSD.ORG Sat Jun 18 02:25:08 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8926E106566B; Sat, 18 Jun 2011 02:25:08 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 608188FC0A; Sat, 18 Jun 2011 02:25:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5I2P844018019; Sat, 18 Jun 2011 02:25:08 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5I2P8No018017; Sat, 18 Jun 2011 02:25:08 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201106180225.p5I2P8No018017@svn.freebsd.org> From: Warner Losh Date: Sat, 18 Jun 2011 02:25:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223218 - head/sys/dev/pccbb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jun 2011 02:25:08 -0000 Author: imp Date: Sat Jun 18 02:25:08 2011 New Revision: 223218 URL: http://svn.freebsd.org/changeset/base/223218 Log: After we get a good power signal, always wait about 10ms before proceeding. On boot, some laptops with certain cards in them sometimes fail on boot, but if the card is inserted after boot it works. Experiments show that small delays here makes things more reliable. It is believed that some combinations need a little more time before the power on the card is really stable enough to be reliable once the power is stable in the bridge. Modified: head/sys/dev/pccbb/pccbb.c Modified: head/sys/dev/pccbb/pccbb.c ============================================================================== --- head/sys/dev/pccbb/pccbb.c Sat Jun 18 00:53:51 2011 (r223217) +++ head/sys/dev/pccbb/pccbb.c Sat Jun 18 02:25:08 2011 (r223218) @@ -800,24 +800,36 @@ cbb_power(device_t brdev, int volts) * We have a shortish timeout of 500ms here. Some bridges do * not generate a POWER_CYCLE event for 16-bit cards. In * those cases, we have to cope the best we can, and having - * only a short delay is better than the alternatives. + * only a short delay is better than the alternatives. Others + * raise the power cycle a smidge before it is really ready. + * We deal with those below. */ sane = 10; while (!(cbb_get(sc, CBB_SOCKET_STATE) & CBB_STATE_POWER_CYCLE) && cnt == sc->powerintr && sane-- > 0) msleep(&sc->powerintr, &sc->mtx, 0, "-", hz / 20); mtx_unlock(&sc->mtx); + + /* + * Relax for 10ms. Some bridges appear to assert this signal + * right away, but before the card has stabilized. Other + * cards need need more time to cope up reliabily. + * Experiments with troublesome setups show this to be a + * "cheap" way to enhance reliabilty. We need not do this for + * "off" since we don't touch the card after we turn it off. + */ + pause("cbbPwr", min(hz / 100, 1)); + /* * The TOPIC95B requires a little bit extra time to get its * act together, so delay for an additional 100ms. Also as * documented below, it doesn't seem to set the POWER_CYCLE * bit, so don't whine if it never came on. */ - if (sc->chipset == CB_TOPIC95) { + if (sc->chipset == CB_TOPIC95) pause("cbb95B", hz / 10); - } else if (sane <= 0) { + else if (sane <= 0) device_printf(sc->dev, "power timeout, doom?\n"); - } } /* From owner-svn-src-head@FreeBSD.ORG Sat Jun 18 03:16:51 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4B9D106566C; Sat, 18 Jun 2011 03:16:51 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C4F298FC12; Sat, 18 Jun 2011 03:16:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5I3Gpr0019804; Sat, 18 Jun 2011 03:16:51 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5I3Gp6o019802; Sat, 18 Jun 2011 03:16:51 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201106180316.p5I3Gp6o019802@svn.freebsd.org> From: Warner Losh Date: Sat, 18 Jun 2011 03:16:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223219 - head/sys/dev/pccbb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jun 2011 03:16:51 -0000 Author: imp Date: Sat Jun 18 03:16:51 2011 New Revision: 223219 URL: http://svn.freebsd.org/changeset/base/223219 Log: More expeirmentation suggests that 10ms isn't as reliable as previously thought, but 100ms seems to be. Likely there's a good middle ground, but for now be conservative. Modified: head/sys/dev/pccbb/pccbb.c Modified: head/sys/dev/pccbb/pccbb.c ============================================================================== --- head/sys/dev/pccbb/pccbb.c Sat Jun 18 02:25:08 2011 (r223218) +++ head/sys/dev/pccbb/pccbb.c Sat Jun 18 03:16:51 2011 (r223219) @@ -811,14 +811,14 @@ cbb_power(device_t brdev, int volts) mtx_unlock(&sc->mtx); /* - * Relax for 10ms. Some bridges appear to assert this signal + * Relax for 100ms. Some bridges appear to assert this signal * right away, but before the card has stabilized. Other * cards need need more time to cope up reliabily. * Experiments with troublesome setups show this to be a * "cheap" way to enhance reliabilty. We need not do this for * "off" since we don't touch the card after we turn it off. */ - pause("cbbPwr", min(hz / 100, 1)); + pause("cbbPwr", min(hz / 10, 1)); /* * The TOPIC95B requires a little bit extra time to get its From owner-svn-src-head@FreeBSD.ORG Sat Jun 18 07:47:16 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 23672106566C; Sat, 18 Jun 2011 07:47:16 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1409F8FC08; Sat, 18 Jun 2011 07:47:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5I7lFk9027800; Sat, 18 Jun 2011 07:47:15 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5I7lFsQ027798; Sat, 18 Jun 2011 07:47:15 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201106180747.p5I7lFsQ027798@svn.freebsd.org> From: Ed Schouten Date: Sat, 18 Jun 2011 07:47:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223222 - head/usr.bin/users X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jun 2011 07:47:16 -0000 Author: ed Date: Sat Jun 18 07:47:15 2011 New Revision: 223222 URL: http://svn.freebsd.org/changeset/base/223222 Log: Let the size of the namebuf depend on the size of the ut_user field. Modified: head/usr.bin/users/users.c Modified: head/usr.bin/users/users.c ============================================================================== --- head/usr.bin/users/users.c Sat Jun 18 05:13:48 2011 (r223221) +++ head/usr.bin/users/users.c Sat Jun 18 07:47:15 2011 (r223222) @@ -50,7 +50,7 @@ static const char rcsid[] = #include #include -typedef char namebuf[MAXLOGNAME]; +typedef char namebuf[sizeof(((struct utmpx *)0)->ut_user) + 1]; int scmp(const void *, const void *); static void usage(void); From owner-svn-src-head@FreeBSD.ORG Sat Jun 18 09:34:04 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 14E18106566C; Sat, 18 Jun 2011 09:34:04 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 04BB98FC16; Sat, 18 Jun 2011 09:34:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5I9Y34g030927; Sat, 18 Jun 2011 09:34:03 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5I9Y3KG030924; Sat, 18 Jun 2011 09:34:03 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201106180934.p5I9Y3KG030924@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 18 Jun 2011 09:34:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223223 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jun 2011 09:34:04 -0000 Author: bz Date: Sat Jun 18 09:34:03 2011 New Revision: 223223 URL: http://svn.freebsd.org/changeset/base/223223 Log: gre(4) was using a field in the softc to detect possible recursion. On MP systems this is not a usable solution anymore and could easily lead to false positives triggering enough logging that even using the console was no longer usable (multiple parallel ping -f can do). Switch to the suggested solution of using mbuf tags to carry per packet state between gre_output() invocations. Contrary to the proposed solution modelled after gif(4) only allocate one mbuf tag per packet rather than per packet and per gre_output() pass through. As the sysctl to control the possible valid (gre in gre) nestings does no sanity checks, make sure to always allocate space in the mbuf tag for at least one, and at most 255 possible gre interfaces to detect loops in addition to the counter. Submitted by: Cristian KLEIN (cristi net.utcluj.ro) (original version) PR: kern/114714 Reviewed by: Cristian KLEIN (cristi net.utcluj.ro) Reviewed bu: Wooseog Choi (ben_choi hotmail.com) Sponsored by: Sandvine Incorporated MFC after: 1 week Modified: head/sys/net/if_gre.c head/sys/net/if_gre.h Modified: head/sys/net/if_gre.c ============================================================================== --- head/sys/net/if_gre.c Sat Jun 18 07:47:15 2011 (r223222) +++ head/sys/net/if_gre.c Sat Jun 18 09:34:03 2011 (r223223) @@ -48,6 +48,7 @@ #include #include #include +#include #include #include #include @@ -91,6 +92,14 @@ #define GRENAME "gre" +#define MTAG_COOKIE_GRE 1307983903 +#define MTAG_GRE_NESTING 1 +struct mtag_gre_nesting { + uint16_t count; + uint16_t max; + struct ifnet *ifp[]; +}; + /* * gre_mtx protects all global variables in if_gre.c. * XXX: gre_softc data not protected yet. @@ -196,7 +205,6 @@ gre_clone_create(ifc, unit, params) sc->g_proto = IPPROTO_GRE; GRE2IFP(sc)->if_flags |= IFF_LINK0; sc->encap = NULL; - sc->called = 0; sc->gre_fibnum = curthread->td_proc->p_fibnum; sc->wccp_ver = WCCP_V1; sc->key = 0; @@ -240,23 +248,77 @@ gre_output(struct ifnet *ifp, struct mbu struct gre_softc *sc = ifp->if_softc; struct greip *gh; struct ip *ip; + struct m_tag *mtag; + struct mtag_gre_nesting *gt; + size_t len; u_short gre_ip_id = 0; uint8_t gre_ip_tos = 0; u_int16_t etype = 0; struct mobile_h mob_h; u_int32_t af; - int extra = 0; + int extra = 0, max; /* - * gre may cause infinite recursion calls when misconfigured. - * We'll prevent this by introducing upper limit. + * gre may cause infinite recursion calls when misconfigured. High + * nesting level may cause stack exhaustion. We'll prevent this by + * detecting loops and by introducing upper limit. */ - if (++(sc->called) > max_gre_nesting) { - printf("%s: gre_output: recursively called too many " - "times(%d)\n", if_name(GRE2IFP(sc)), sc->called); - m_freem(m); - error = EIO; /* is there better errno? */ - goto end; + mtag = m_tag_locate(m, MTAG_COOKIE_GRE, MTAG_GRE_NESTING, NULL); + if (mtag != NULL) { + struct ifnet **ifp2; + + gt = (struct mtag_gre_nesting *)(mtag + 1); + gt->count++; + if (gt->count > min(gt->max,max_gre_nesting)) { + printf("%s: hit maximum recursion limit %u on %s\n", + __func__, gt->count - 1, ifp->if_xname); + m_freem(m); + error = EIO; /* is there better errno? */ + goto end; + } + + ifp2 = gt->ifp; + for (max = gt->count - 1; max > 0; max--) { + if (*ifp2 == ifp) + break; + ifp2++; + } + if (*ifp2 == ifp) { + printf("%s: detected loop with nexting %u on %s\n", + __func__, gt->count-1, ifp->if_xname); + m_freem(m); + error = EIO; /* is there better errno? */ + goto end; + } + *ifp2 = ifp; + + } else { + /* + * Given that people should NOT increase max_gre_nesting beyond + * their real needs, we allocate once per packet rather than + * allocating an mtag once per passing through gre. + * + * Note: the sysctl does not actually check for saneness, so we + * limit the maximum numbers of possible recursions here. + */ + max = imin(max_gre_nesting, 256); + /* If someone sets the sysctl <= 0, we want at least 1. */ + max = imax(max, 1); + len = sizeof(struct mtag_gre_nesting) + + max * sizeof(struct ifnet *); + mtag = m_tag_alloc(MTAG_COOKIE_GRE, MTAG_GRE_NESTING, len, + M_NOWAIT); + if (mtag == NULL) { + m_freem(m); + error = ENOMEM; + goto end; + } + gt = (struct mtag_gre_nesting *)(mtag + 1); + bzero(gt, len); + gt->count = 1; + gt->max = max; + *gt->ifp = ifp; + m_tag_prepend(m, mtag); } if (!((ifp->if_flags & IFF_UP) && @@ -444,7 +506,6 @@ gre_output(struct ifnet *ifp, struct mbu error = ip_output(m, NULL, &sc->route, IP_FORWARDING, (struct ip_moptions *)NULL, (struct inpcb *)NULL); end: - sc->called = 0; if (error) ifp->if_oerrors++; return (error); Modified: head/sys/net/if_gre.h ============================================================================== --- head/sys/net/if_gre.h Sat Jun 18 07:47:15 2011 (r223222) +++ head/sys/net/if_gre.h Sat Jun 18 09:34:03 2011 (r223223) @@ -61,8 +61,6 @@ struct gre_softc { const struct encaptab *encap; /* encapsulation cookie */ - int called; /* infinite recursion preventer */ - uint32_t key; /* key included in outgoing GRE packets */ /* zero means none */ From owner-svn-src-head@FreeBSD.ORG Sat Jun 18 09:46:40 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 111BF106564A; Sat, 18 Jun 2011 09:46:40 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 014F88FC16; Sat, 18 Jun 2011 09:46:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5I9kdSV031325; Sat, 18 Jun 2011 09:46:39 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5I9kdFA031323; Sat, 18 Jun 2011 09:46:39 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201106180946.p5I9kdFA031323@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 18 Jun 2011 09:46:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223224 - head/usr.sbin/jls X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jun 2011 09:46:40 -0000 Author: bz Date: Sat Jun 18 09:46:39 2011 New Revision: 223224 URL: http://svn.freebsd.org/changeset/base/223224 Log: Add a missing ',' to separate arguments lost for r222465 only found in case a complete world is built without INET support. MFC after: 10 days X-MFC with: 222465 Modified: head/usr.sbin/jls/jls.c Modified: head/usr.sbin/jls/jls.c ============================================================================== --- head/usr.sbin/jls/jls.c Sat Jun 18 09:34:03 2011 (r223223) +++ head/usr.sbin/jls/jls.c Sat Jun 18 09:46:39 2011 (r223224) @@ -404,7 +404,7 @@ print_jail(int pflags, int jflags) (!ip4_ok || params[1].jp_valuelen == 0) ? "-" : inet_ntoa(*(struct in_addr *)params[1].jp_value), #else - "-" + "-", #endif (char *)params[2-!ip4_ok].jp_value, (char *)params[3-!ip4_ok].jp_value); From owner-svn-src-head@FreeBSD.ORG Sat Jun 18 10:36:06 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 56C751065672; Sat, 18 Jun 2011 10:36:06 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4651C8FC15; Sat, 18 Jun 2011 10:36:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5IAa6wK036232; Sat, 18 Jun 2011 10:36:06 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5IAa695036230; Sat, 18 Jun 2011 10:36:06 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201106181036.p5IAa695036230@svn.freebsd.org> From: Michael Tuexen Date: Sat, 18 Jun 2011 10:36:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223225 - head/lib/libc/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jun 2011 10:36:06 -0000 Author: tuexen Date: Sat Jun 18 10:36:05 2011 New Revision: 223225 URL: http://svn.freebsd.org/changeset/base/223225 Log: Document the latest changes to sctp_opt_info() in the code. This makes sctp_opt_info() compiliant with the latest version of the socket API ID. Modified: head/lib/libc/net/sctp_opt_info.3 Modified: head/lib/libc/net/sctp_opt_info.3 ============================================================================== --- head/lib/libc/net/sctp_opt_info.3 Sat Jun 18 09:46:39 2011 (r223224) +++ head/lib/libc/net/sctp_opt_info.3 Sat Jun 18 10:36:05 2011 (r223225) @@ -32,7 +32,7 @@ .\" From: @(#)send.2 8.2 (Berkeley) 2/21/94 .\" $FreeBSD$ .\" -.Dd December 15, 2006 +.Dd June 18, 2011 .Dt SCTP_OPT_INFO 3 .Os .Sh NAME @@ -76,14 +76,30 @@ socket options. .Pp .Dv SCTP_PRIMARY_ADDR .Pp -.Dv SCTP_SET_PEER_PRIMARY_ADDR +.Dv SCTP_PEER_ADDR_PARAMS .Pp -.Dv SCTP_STATUS +.Dv SCTP_DEFAULT_SEND_PARAM .Pp -.Dv SCTP_GET_PEER_ADDR_INFO +.Dv SCTP_MAX_SEG .Pp .Dv SCTP_AUTH_ACTIVE_KEY .Pp +.Dv SCTP_DELAYED_SACK +.Pp +.Dv SCTP_MAX_BURST +.Pp +.Dv SCTP_CONTEXT +.Pp +.Dv SCTP_EVENT +.Pp +.Dv SCTP_DEFAULT_SNDINFO +.Pp +.Dv SCTP_DEFAULT_PRINFO +.Pp +.Dv SCTP_STATUS +.Pp +.Dv SCTP_GET_PEER_ADDR_INFO +.Pp .Dv SCTP_PEER_AUTH_CHUNKS .Pp .Dv SCTP_LOCAL_AUTH_CHUNKS @@ -115,3 +131,14 @@ is not a socket. .Sh SEE ALSO .Xr getsockopt 2 , .Xr sctp 4 +.Sh BUGS +Because the structure used for +.Fa arg +of the +.Dv SCTP_MAX_BURST +socket option has changed in FreeBSD 9.0 and higher, +using +.Dv SCTP_MAX_BURST +as +.Fa opt +is only supported in FreeBSD 9.0 and higher. From owner-svn-src-head@FreeBSD.ORG Sat Jun 18 10:48:00 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD2EC106564A; Sat, 18 Jun 2011 10:48:00 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ACE078FC12; Sat, 18 Jun 2011 10:48:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5IAm0ms036634; Sat, 18 Jun 2011 10:48:00 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5IAm0R8036632; Sat, 18 Jun 2011 10:48:00 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201106181048.p5IAm0R8036632@svn.freebsd.org> From: Marius Strobl Date: Sat, 18 Jun 2011 10:48:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223226 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jun 2011 10:48:00 -0000 Author: marius Date: Sat Jun 18 10:48:00 2011 New Revision: 223226 URL: http://svn.freebsd.org/changeset/base/223226 Log: Add an entry for r221407 forgotten in said revision. Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Sat Jun 18 10:36:05 2011 (r223225) +++ head/UPDATING Sat Jun 18 10:48:00 2011 (r223226) @@ -52,6 +52,18 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9. 20110513: Support for sun4v architecture is officially dropped +20110503: + Several KPI breaking changes have been committed to the mii(4) layer, + the PHY drivers and consequently some Ethernet drivers using mii(4). + This means that miibus.ko and the modules of the affected Ethernet + drivers need to be recompiled. + + Note to kernel developers: Given that the OUI bit reversion problem + was fixed as part of these changes all mii(4) commits related to OUIs, + i.e. to sys/dev/mii/miidevs, PHY driver probing and vendor specific + handling, no longer can be merged verbatim to stable/8 and previous + branches. + 20110430: Users of the Atheros AR71xx SoC code now need to add 'device ar71xx_pci' into their kernel configurations along with 'device pci'. From owner-svn-src-head@FreeBSD.ORG Sat Jun 18 11:05:30 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7951C106566B; Sat, 18 Jun 2011 11:05:30 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 690618FC14; Sat, 18 Jun 2011 11:05:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5IB5UjX037236; Sat, 18 Jun 2011 11:05:30 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5IB5UbI037234; Sat, 18 Jun 2011 11:05:30 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201106181105.p5IB5UbI037234@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 18 Jun 2011 11:05:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223227 - head/etc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jun 2011 11:05:30 -0000 Author: jilles Date: Sat Jun 18 11:05:30 2011 New Revision: 223227 URL: http://svn.freebsd.org/changeset/base/223227 Log: rc.subr: Eliminate about 100 forks from the boot sequence. With the current sh, placing eval in a command substitution always results in a fork(), even if it is the only command and only executes a single simple command. Therefore, avoid it where it can be avoided easily. Side effect: values starting with a hyphen and all whitespace are preserved. The values are defaults and names for rc.conf variables and messages to be given about obsolete ones. MFC after: 2 weeks Modified: head/etc/rc.subr Modified: head/etc/rc.subr ============================================================================== --- head/etc/rc.subr Sat Jun 18 10:48:00 2011 (r223226) +++ head/etc/rc.subr Sat Jun 18 11:05:30 2011 (r223227) @@ -1062,7 +1062,7 @@ load_rc_config() # Set defaults if defined. for _var in $rcvar $rcvars; do - _defval=`eval echo "\\\$${_var}_defval"` + eval _defval=\$${_var}_defval if [ -n "$_defval" ]; then eval : \${$_var:=\$${_var}_defval} fi @@ -1070,9 +1070,9 @@ load_rc_config() # check obsolete rc.conf variables for _var in $rcvars_obsolete; do - _v=`eval echo \\$$_var` - _msg=`eval echo \\$${_var}_obsolete_msg` - _new=`eval echo \\$${_var}_newvar` + eval _v=\$$_var + eval _msg=\$${_var}_obsolete_msg + eval _new=\$${_var}_newvar case $_v in "") ;; @@ -1765,7 +1765,7 @@ check_kern_features() _echoonce() { local _var _msg _mode - _var=`eval echo \\$$1` + eval _var=\$$1 _msg=$2 _mode=$3 From owner-svn-src-head@FreeBSD.ORG Sat Jun 18 11:07:10 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 211D31065673; Sat, 18 Jun 2011 11:07:10 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0F9C28FC0A; Sat, 18 Jun 2011 11:07:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5IB79iI037327; Sat, 18 Jun 2011 11:07:09 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5IB79A0037322; Sat, 18 Jun 2011 11:07:09 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201106181107.p5IB79A0037322@svn.freebsd.org> From: Marius Strobl Date: Sat, 18 Jun 2011 11:07:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223228 - in head/lib/libthr/arch/sparc64: . include sparc64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jun 2011 11:07:10 -0000 Author: marius Date: Sat Jun 18 11:07:09 2011 New Revision: 223228 URL: http://svn.freebsd.org/changeset/base/223228 Log: Merge from r161730: o Set TP using inline assembly to avoid dead code elimination. o Eliminate _tcb. Merge from r161840: Stylize: avoid using a global register variable. Merge from r157461: Simplify _get_curthread() and _tcb_ctor because libc and rtld now already allocate thread pointer space in tls block for initial thread. Merge from r177853: Replace function _umtx_op with _umtx_op_err, the later function directly returns errno, because errno can be mucked by user's signal handler and most of pthread api heavily depends on errno to be correct, this change should improve stability of the thread library. MFC after: 1 week Added: head/lib/libthr/arch/sparc64/sparc64/_umtx_op_err.S (contents, props changed) Modified: head/lib/libthr/arch/sparc64/Makefile.inc head/lib/libthr/arch/sparc64/include/pthread_md.h head/lib/libthr/arch/sparc64/sparc64/pthread_md.c Modified: head/lib/libthr/arch/sparc64/Makefile.inc ============================================================================== --- head/lib/libthr/arch/sparc64/Makefile.inc Sat Jun 18 11:05:30 2011 (r223227) +++ head/lib/libthr/arch/sparc64/Makefile.inc Sat Jun 18 11:07:09 2011 (r223228) @@ -1,3 +1,3 @@ # $FreeBSD$ -SRCS+= pthread_md.c +SRCS+= _umtx_op_err.S pthread_md.c Modified: head/lib/libthr/arch/sparc64/include/pthread_md.h ============================================================================== --- head/lib/libthr/arch/sparc64/include/pthread_md.h Sat Jun 18 11:05:30 2011 (r223227) +++ head/lib/libthr/arch/sparc64/include/pthread_md.h Sat Jun 18 11:07:09 2011 (r223228) @@ -50,10 +50,6 @@ struct tcb { void *tcb_spare[1]; }; -register struct tcb *_tp __asm("%g7"); - -#define _tcb (_tp) - /* * The tcb constructors. */ @@ -64,26 +60,25 @@ void _tcb_dtor(struct tcb *); static __inline void _tcb_set(struct tcb *tcb) { - _tp = tcb; + + __asm __volatile("mov %0, %%g7" : : "r" (tcb)); } -/* - * Get the current tcb. - */ static __inline struct tcb * _tcb_get(void) { - return (_tcb); -} + register struct tcb *tp __asm("%g7"); -extern struct pthread *_thr_initial; + return (tp); +} static __inline struct pthread * _get_curthread(void) { - if (_thr_initial) - return (_tcb->tcb_thread); - return (NULL); + + return (_tcb_get()->tcb_thread); } +#define HAS__UMTX_OP_ERR 1 + #endif /* _PTHREAD_MD_H_ */ Added: head/lib/libthr/arch/sparc64/sparc64/_umtx_op_err.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libthr/arch/sparc64/sparc64/_umtx_op_err.S Sat Jun 18 11:07:09 2011 (r223228) @@ -0,0 +1,38 @@ +/*- + * Copyright (c) 2011 Marius Strobl + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +#include + +ENTRY(_umtx_op_err) + mov SYS__umtx_op, %g1 + retl + ta %xcc, ST_SYSCALL +END(_umtx_op_err) Modified: head/lib/libthr/arch/sparc64/sparc64/pthread_md.c ============================================================================== --- head/lib/libthr/arch/sparc64/sparc64/pthread_md.c Sat Jun 18 11:05:30 2011 (r223227) +++ head/lib/libthr/arch/sparc64/sparc64/pthread_md.c Sat Jun 18 11:07:09 2011 (r223228) @@ -24,10 +24,11 @@ * 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 +__FBSDID("$FreeBSD$"); + #include #include @@ -37,13 +38,11 @@ struct tcb * _tcb_ctor(struct pthread *thread, int initial) { struct tcb *tcb; - void *oldtls; if (initial) - oldtls = _tp; + tcb = _tcb_get(); else - oldtls = NULL; - tcb = _rtld_allocate_tls(oldtls, sizeof(struct tcb), 16); + tcb = _rtld_allocate_tls(NULL, sizeof(struct tcb), 16); if (tcb) tcb->tcb_thread = thread; return (tcb); @@ -52,5 +51,6 @@ _tcb_ctor(struct pthread *thread, int in void _tcb_dtor(struct tcb *tcb) { + _rtld_free_tls(tcb, sizeof(struct tcb), 16); } From owner-svn-src-head@FreeBSD.ORG Sat Jun 18 11:08:10 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 43D34106566B; Sat, 18 Jun 2011 11:08:10 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail07.syd.optusnet.com.au (mail07.syd.optusnet.com.au [211.29.132.188]) by mx1.freebsd.org (Postfix) with ESMTP id D41578FC0C; Sat, 18 Jun 2011 11:08:09 +0000 (UTC) Received: from c122-106-165-191.carlnfd1.nsw.optusnet.com.au (c122-106-165-191.carlnfd1.nsw.optusnet.com.au [122.106.165.191]) by mail07.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p5IB86gs013726 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 18 Jun 2011 21:08:07 +1000 Date: Sat, 18 Jun 2011 21:08:06 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Jung-uk Kim In-Reply-To: <201106172141.p5HLf6Rx009154@svn.freebsd.org> Message-ID: <20110618195655.M889@besplex.bde.org> References: <201106172141.p5HLf6Rx009154@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r223211 - head/sys/x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jun 2011 11:08:10 -0000 On Fri, 17 Jun 2011, Jung-uk Kim wrote: > Log: > Teach the compiler how to shift TSC value efficiently. As noted in r220631, > some times compiler inserts redundant instructions to preserve unused upper > 32 bits even when it is casted to a 32-bit value. Unfortunately, it seems > the problem becomes more serious when it is shifted, especially on amd64. Er, I tried to point out how to optimize this code before (but didn't reply to your reply), and it's not by using more asm. > Modified: head/sys/x86/x86/tsc.c > ============================================================================== > --- head/sys/x86/x86/tsc.c Fri Jun 17 21:31:13 2011 (r223210) > +++ head/sys/x86/x86/tsc.c Fri Jun 17 21:41:06 2011 (r223211) > @@ -461,7 +461,7 @@ init_TSC_tc(void) > tsc_timecounter.tc_quality = 1000; > > init: > - for (shift = 0; shift < 32 && (tsc_freq >> shift) > max_freq; shift++) > + for (shift = 0; shift < 31 && (tsc_freq >> shift) > max_freq; shift++) > ; > if (shift > 0) { > tsc_timecounter.tc_get_timecount = tsc_get_timecount_low; shift == 32 (or even shift == 31) is unreachable. A shift of 31 will shift 2GHz down to 1 Hz, or support physically impossible frequencies like 2**33 GHz. OTOH, shifts of up to 63 are supported by the slow gcc code. > @@ -579,6 +579,9 @@ tsc_get_timecount(struct timecounter *tc > static u_int > tsc_get_timecount_low(struct timecounter *tc) > { > + uint32_t rv; > > - return (rdtsc() >> (int)(intptr_t)tc->tc_priv); > + __asm __volatile("rdtsc; shrd %%cl, %%edx, %0" > + : "=a" (rv) : "c" ((int)(intptr_t)tc->tc_priv) : "edx"); Lexical style bug (indentation of second line of the asm). > + return (rv); > } Just return the shift of the low 32 bits (and change tc_counter_mask to match) like I said. This loses only the accidental ability for the timecounter to work for more than a few seconds when interrupts are stopped by something like ddb, since any shift count that loses too many of the low 32 bits will not work for other reasons. For example, suppose that the TSC frequency is 8G-1Hz, which is unavailable except possible in research labs. This must be shifted by 1 to fit in 32 bits. If we use only the low 32 bits, then we end up with only 31 significant bits and tsc_get_timecount_low() wraps after ~2 seconds instead of after the best possible for this shift of ~4 seconds. If we shift by 7 more, as we do in the SMP case, then if we start with 32 bits then we end up with 24 bits, but the wrap still takes 2 seconds; if we start with 64 bits then we end up with 32 bits and the wrap takes 4*2**7 = 512 seconds. But wrap times longer than 1/HZ times a few are not needed. 2 seconds is already at least 100 or 1000 times longer than needed, depending on HZ. The case where the unscaled frequency is 4G-1Hz and !SMP gives a shift count of 0 and a wrap time of ~4 seconds. Whatever is done to make that case work (say, not allowing a fully tickless kernel with HZ = 0), works almost as well up to an unscaled frequency of 8GHz which is still far off. No one will notice these micro-optimizations, but I agree that the redundant instructions are ugly. I get the following on i386 for the original version with an old source tree: % #APP % rdtsc % #NO_APP % movl 8(%ebp), %ecx % movl 28(%ecx), %ecx % shrdl %edx, %eax % shrl %cl, %edx % testb $32, %cl % je .L3 % movl %edx, %eax % xorl %edx, %edx % .L3: The last 4 instructions are not redundant, but are needed to support shifts of up to 63 (maybe 64). I tried masking the shift count with 0x1f so that the shift count is known to be < 32, this just gave an extra instruction for the masking. It's even worse with rdtsc() converted to u_int first like I want: % movl %ebx, (%esp) % movl %esi, 4(%esp) % #APP % rdtsc % #NO_APP % movl %eax, %ebx % movl 8(%ebp), %eax % movl 4(%esp), %esi % movl 28(%eax), %ecx % movl %ebx, %eax % movl (%esp), %ebx % # some frame pointer epilogue reordered here % shrl %cl, %eax The second case may be what you already fixed on amd64 (only?) -- use rdtsc32() instead of (u_int)rdtsc(). I've always thought that the dynamic shift is overengineered, and now like it even less. The following is efficent and works well enough in all currently physically possible cases: % /* % * Don't really need a separate one for `low', but now it costs less % * (1 shift instruction at runtime and some space). Must change % * tc_counter_mask to match. % */ % u_int % tsc_get_timecount_low(struct timecounter *tc) % { % #ifdef SMP % /* % * Works up to 1024 GHz, assuming that nontemporalness scales with % * freq. I think 8 is too many. But now do extra for SMP indep. % * of freq. % */ % return (((u_int)rdtsc()) >> 8); /* gens rdtsc; shrl $8,%eax */ % #else % /* Works up to 8 GHz. */ % return (((u_int)rdtsc()) >> 1); /* gens rdtsc; shrl %eax */ % #endif % } Bruce From owner-svn-src-head@FreeBSD.ORG Sat Jun 18 11:27:45 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4FB8C106567B; Sat, 18 Jun 2011 11:27:45 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2599B8FC17; Sat, 18 Jun 2011 11:27:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5IBRj1B038279; Sat, 18 Jun 2011 11:27:45 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5IBRjhJ038277; Sat, 18 Jun 2011 11:27:45 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201106181127.p5IBRjhJ038277@svn.freebsd.org> From: Marius Strobl Date: Sat, 18 Jun 2011 11:27:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223235 - head/sys/sparc64/sparc64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jun 2011 11:27:45 -0000 Author: marius Date: Sat Jun 18 11:27:44 2011 New Revision: 223235 URL: http://svn.freebsd.org/changeset/base/223235 Log: - As with stray vector interrupts limit the reporting of stray level interrupts. Bringup on additional machine models repeatedly reveals firmware that enables interrupts behind our back, causing the console to be flooded otherwise. - As with the regular interrupt counters using uint16_t instead of u_long for counting the stray vector interrupts should be more than sufficient. - Cache the interrupt vector in intr_stray_vector(). Modified: head/sys/sparc64/sparc64/intr_machdep.c Modified: head/sys/sparc64/sparc64/intr_machdep.c ============================================================================== --- head/sys/sparc64/sparc64/intr_machdep.c Sat Jun 18 11:27:28 2011 (r223234) +++ head/sys/sparc64/sparc64/intr_machdep.c Sat Jun 18 11:27:44 2011 (r223235) @@ -83,10 +83,11 @@ CTASSERT((1 << IV_SHIFT) == sizeof(struc ih_func_t *intr_handlers[PIL_MAX]; uint16_t pil_countp[PIL_MAX]; +static uint16_t pil_stray_count[PIL_MAX]; struct intr_vector intr_vectors[IV_MAX]; uint16_t intr_countp[IV_MAX]; -static u_long intr_stray_count[IV_MAX]; +static uint16_t intr_stray_count[IV_MAX]; static const char *const pil_names[] = { "stray", @@ -199,22 +200,32 @@ intr_setup(int pri, ih_func_t *ihf, int static void intr_stray_level(struct trapframe *tf) { + uint64_t level; - printf("stray level interrupt %ld\n", tf->tf_level); + level = tf->tf_level; + if (pil_stray_count[level] < MAX_STRAY_LOG) { + printf("stray level interrupt %ld\n", level); + pil_stray_count[level]++; + if (pil_stray_count[level] >= MAX_STRAY_LOG) + printf("got %d stray level interrupt %ld's: not " + "logging anymore\n", MAX_STRAY_LOG, level); + } } static void intr_stray_vector(void *cookie) { struct intr_vector *iv; + u_int vec; iv = cookie; - if (intr_stray_count[iv->iv_vec] < MAX_STRAY_LOG) { - printf("stray vector interrupt %d\n", iv->iv_vec); - intr_stray_count[iv->iv_vec]++; - if (intr_stray_count[iv->iv_vec] >= MAX_STRAY_LOG) - printf("got %d stray interrupt %d's: not logging " - "anymore\n", MAX_STRAY_LOG, iv->iv_vec); + vec = iv->iv_vec; + if (intr_stray_count[vec] < MAX_STRAY_LOG) { + printf("stray vector interrupt %d\n", vec); + intr_stray_count[vec]++; + if (intr_stray_count[vec] >= MAX_STRAY_LOG) + printf("got %d stray vector interrupt %d's: not " + "logging anymore\n", MAX_STRAY_LOG, vec); } } From owner-svn-src-head@FreeBSD.ORG Sat Jun 18 12:05:10 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BF94A1065672; Sat, 18 Jun 2011 12:05:10 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail08.syd.optusnet.com.au (mail08.syd.optusnet.com.au [211.29.132.189]) by mx1.freebsd.org (Postfix) with ESMTP id 44A1C8FC0A; Sat, 18 Jun 2011 12:05:09 +0000 (UTC) Received: from c122-106-165-191.carlnfd1.nsw.optusnet.com.au (c122-106-165-191.carlnfd1.nsw.optusnet.com.au [122.106.165.191]) by mail08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p5IC56V2005940 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 18 Jun 2011 22:05:07 +1000 Date: Sat, 18 Jun 2011 22:05:06 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Jung-uk Kim In-Reply-To: <201106081913.09272.jkim@FreeBSD.org> Message-ID: <20110618210815.W889@besplex.bde.org> References: <201106081938.p58JcWuB044252@svn.freebsd.org> <20110609055112.P2870@besplex.bde.org> <201106081913.09272.jkim@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Bruce Evans Subject: Re: svn commit: r222866 - head/sys/x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jun 2011 12:05:10 -0000 Long ago, On Wed, 8 Jun 2011, Jung-uk Kim wrote: > On Wednesday 08 June 2011 04:55 pm, Bruce Evans wrote: >> On Wed, 8 Jun 2011, Jung-uk Kim wrote: >>> Log: >>> Introduce low-resolution TSC timecounter "TSC-low". It replaces >>> the normal TSC timecounter if TSC frequency is higher than ~4.29 >>> MHz (or 2^32-1 Hz) or > >> It should be a separate timecounter so that the user can choose it >> independently, at least in the SMP case where it is very low (at >> most ~4.29 GHz >> 8 ~= 17 MHz). > > As I noted in the log, it is still higher than the previous default > ACPI-fast, which is ~3.68 MHz and I've never heard of any complaint > about ACPI-fast being too low. ;-) That's because it is too low to measure itself being low :-). > Nothing prevents us from making a separate timecounter, though. In > fact, we can do the same for ACPI-fast/ACPI-safe. However, that'll > only confuse users, IMHO. TSC/TSC-low sort of corresponds to ACPI-fast/ACPI-safe. Users can switch between the latter. What they can't do is run both concurrently, either to compare them or use the best one that works in the current context. That would be more developers and is not implemented mainly because it has more complexity (only a tiny amount of extra overhead I think, provided you don't try to keep the 2 times coherent -- just an extra windup for each active timecounter). >>> static void tsc_levels_changed(void *arg, int unit); >>> >>> static struct timecounter tsc_timecounter = { >>> @@ -392,11 +393,19 @@ test_smp_tsc(void) >>> static void >>> init_TSC_tc(void) >> >> This seems to only be called once at boot time. So the lowness may >> be much lower than necessary if the levels are reduced >> significantly later. > > It'll only happen when the CPU is started at the highest frequency and > TSC is not invariant. In this case, its quality will be set to 800 > and HPET or ACPI timecounter will be selected by default. I don't > see much problem with the default choice here. Can the CPU be started at a low frequency and throttled up later? I agree that the non-invariant case is not very important. >>> { >>> + uint64_t max_freq; >>> + int shift; >>> >>> if ((cpu_feature & CPUID_TSC) == 0 || tsc_disabled) >>> return; >>> >>> /* >>> + * Limit timecounter frequency to fit in an int and prevent it >>> from + * overflowing too fast. >>> + */ >>> + max_freq = UINT_MAX; >>> + >>> + /* >>> * We can not use the TSC if we support APM. Precise >>> timekeeping * on an APM'ed machine is at best a fools pursuit, >>> since * any and all of the time spent in various SMM code can't >>> @@ -418,13 +427,27 @@ init_TSC_tc(void) >>> * We can not use the TSC in SMP mode unless the TSCs on all >>> CPUs are * synchronized. If the user is sure that the system has >>> synchronized * TSCs, set kern.timecounter.smp_tsc tunable to a >>> non-zero value. + * We also limit the frequency even lower to >>> avoid "temporal anomalies" + * as much as possible. >>> */ >>> - if (smp_cpus > 1) >>> + if (smp_cpus > 1) { >>> tsc_timecounter.tc_quality = test_smp_tsc(); >>> + max_freq >>= 8; >>> + } >> >> This gives especially low lowness if the levels are reduced >> significantly. Maybe as low as 100 MHz >> 8 = ~390 KHz = lower than >> an i8254. > > I don't remember any SMP-capable x86 ever running at 100 MHz unless it > is seriously under-clocked. Even if it existed, it won't be > available today. :-P Doesn't throttling give underclocking? Maybe not as low as 100 MHz, but quite low. Only a possible problem for the non-invariant case anyway. >> OTOH, maybe the temporal anomalies scale with the TSC frequency, so >> you need to right shift by a few irrespective of the TSC frequency. >> A shift count of 8 seems too much, but if the initial TSC frequency >> is already < 2**32 shifted by 8, then the final shift is 0. This is my main point. How can it be right to reduce the extra shift for SMP (if this shift is needed at all) just because the initial TSC frequency is low? All instructions are clocked, so non-temporalness within a core scales with the current frequency. Oops, this leads back to my previous point that the scaling should depend on the current frequency and not just on the initial frequency. Across cores, it isn't so clear what the non-temporalness scales with. The non-temporalness is FUD so its scaling could be anything :-). >> ... >> Perhaps the levels can also be increased significantly later. Then >> the timecounter frequency may exceed 4.29 GHz despite its scaling. > > Again, it can only happen when the CPU was started at low frequency > and the TSC is not invariant. For that case, TSC won't be selected > by default unless both HPET and ACPI timers are disabled/unavailable. But users can select it, and since user's can't control the scaling or even select between TSC/TSC-low, TSC-low must be scaled properly initially to have the best chance of working later. >>> @@ -520,8 +545,15 @@ SYSCTL_PROC(_machdep, OID_AUTO, tsc_freq >>> 0, 0, sysctl_machdep_tsc_freq, "QU", "Time Stamp Counter >>> frequency"); >>> >>> static u_int >>> -tsc_get_timecount(struct timecounter *tc) >>> +tsc_get_timecount(struct timecounter *tc __unused) >>> { >>> >>> return (rdtsc32()); >>> } >>> + >>> +static u_int >>> +tsc_get_timecount_lowres(struct timecounter *tc) >>> +{ >>> + >>> + return (rdtsc() >> (int)(intptr_t)tc->tc_priv); >> >> This forces a slow 64-bit shift (shrdl; shrl) in all cases. > > Yes, it does, unfortunately. > > I have no clue why AMD didn't implement native 64-bit RDTSC (and > RDMSR/WRMSR) in the first place. :-( I didn't notice before that it still goes to a register pair on amd64. >> rdtsc32() with a scaled tc_counter_mask should work OK (essentially >> the same as the non-low timecounter except for reduced accuracy; >> the only loss is an decrease in the time until counter overflow to >> the same as for the non-low timecounter). > > I thought about that but I didn't like that idea, i.e., losing > resolution and accuracy at the same time. But it doesn't lose any more resolution or accuracy than any shift necessarily uses. It only loses wrap time, which is of no interest for a small reduction. See another reply. The shift of 8 for SMP still seems far too much. clock_gettime() with a TSC timecounter on an old 2GHz system takes about 250 nS. I hope it takes only 1/2 that on a newer system. nanouptime() in the kernel takes more like 30 nS on the old system. It should at least try to have enough resulution for sequential calls to it to never return the same time (even ACPI-fast has this property -- about 1000 nS per call and a resolution of about 250 nS). rdtsc on old Athlons takes only 12 (9?) cycles so you could almost use it to time individual instructions (modulo out of order execution). THe invariant versions have to be much slower for synchronization :-(. They take at least 42 cycles AFAIR. A shift count of 5 would lose less resolution than an invariant TSC really has so it would be good if it is enough to hide the nontemporalness. A shift count of 6 would be OK too. But a shift count of 8 lets you execute about 4 nanouptime()'s for every change in the time returned. OTOH, 256 cycles at 4 GHz is about 64 uS and clock_gettime() unfortunately takes longer (except on Linux? :-(), so a shift count of 8 is OK for it. My clock measurement program (mostly an old program by Wollman) shows the following histogram of times for a non-invariant TSC timecounter on a 2GHz UP system: % min 273, max 265102, mean 273.998217, std 79.069534 % 1th: 273 (1727219 observations) % 2th: 274 (265607 observations) % 3th: 275 (6984 observations) % 4th: 280 (11 observations) % 5th: 290 (8 observations) The variance is small, and differences of a single nS can be seen clearly. With the SMP shift of 8 on a 4GHz system, the minimum difference would be 64 nS so it would be impossible to see the details of the distribution about the mean of 273.998 nS. Bruce From owner-svn-src-head@FreeBSD.ORG Sat Jun 18 12:05:38 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 309561065678; Sat, 18 Jun 2011 12:05:38 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail03.syd.optusnet.com.au (mail03.syd.optusnet.com.au [211.29.132.184]) by mx1.freebsd.org (Postfix) with ESMTP id A82EB8FC19; Sat, 18 Jun 2011 12:05:37 +0000 (UTC) Received: from c122-106-165-191.carlnfd1.nsw.optusnet.com.au (c122-106-165-191.carlnfd1.nsw.optusnet.com.au [122.106.165.191]) by mail03.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p5IC5YrR032142 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 18 Jun 2011 22:05:35 +1000 Date: Sat, 18 Jun 2011 22:05:34 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Jung-uk Kim In-Reply-To: <201106082344.p58NixUl052580@svn.freebsd.org> Message-ID: <20110618220513.O889@besplex.bde.org> References: <201106082344.p58NixUl052580@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r222884 - head/sys/x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jun 2011 12:05:38 -0000 On Wed, 8 Jun 2011, Jung-uk Kim wrote: > Log: > Tidy up r222866. > > - Re-add accidentally removed atomic op. for sysctl(9) handler. > - Remove a period(`.') at the end of a debugging message. > - Consistently spell "low" for "TSC-low" timecounter throughout. > > Pointed out by: bde Thanks. Bruce From owner-svn-src-head@FreeBSD.ORG Sat Jun 18 12:13:28 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7ADCF106566C; Sat, 18 Jun 2011 12:13:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6A9FF8FC14; Sat, 18 Jun 2011 12:13:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5ICDS8a040579; Sat, 18 Jun 2011 12:13:28 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5ICDSFu040577; Sat, 18 Jun 2011 12:13:28 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201106181213.p5ICDSFu040577@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 18 Jun 2011 12:13:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223254 - head/sys/amd64/ia32 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jun 2011 12:13:28 -0000 Author: kib Date: Sat Jun 18 12:13:28 2011 New Revision: 223254 URL: http://svn.freebsd.org/changeset/base/223254 Log: Fix vfork. Add comments. Modified: head/sys/amd64/ia32/ia32_sigtramp.S Modified: head/sys/amd64/ia32/ia32_sigtramp.S ============================================================================== --- head/sys/amd64/ia32/ia32_sigtramp.S Sat Jun 18 12:13:27 2011 (r223253) +++ head/sys/amd64/ia32/ia32_sigtramp.S Sat Jun 18 12:13:28 2011 (r223254) @@ -79,8 +79,20 @@ ia32_osigcode: jmp 1b +/* + * The lcall $7,$0 emulator cannot use the call gate that does an + * inter-privilege transition. The reason is that the call gate + * does not disable interrupts, and, before the swapgs is + * executed, we would have a window where the ring 0 code is + * executed with the wrong gsbase. + * + * Instead, reflect the lcall $7,$0 back to ring 3 trampoline + * which sets up the frame for int $0x80. + */ ALIGN_TEXT lcall_tramp: + cmpl $SYS_vfork,%eax + je 2f pushl %ebp movl %esp,%ebp pushl 0x24(%ebp) /* arg 6 */ @@ -91,8 +103,19 @@ lcall_tramp: pushl 0x10(%ebp) /* arg 1 */ pushl 0xc(%ebp) /* gap */ int $0x80 - leave + leavel +1: lretl +2: + /* + * vfork handling is special and relies on the libc stub saving + * the return ip in %ecx. If vfork failed, then there is no + * child which can corrupt the frame created by call gate. + */ + int $0x80 + jb 1b + addl $8,%esp + jmpl *%ecx #endif ALIGN_TEXT From owner-svn-src-head@FreeBSD.ORG Sat Jun 18 13:03:07 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 341271065670; Sat, 18 Jun 2011 13:03:07 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E87958FC0C; Sat, 18 Jun 2011 13:03:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5ID36Qr042375; Sat, 18 Jun 2011 13:03:06 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5ID36CW042373; Sat, 18 Jun 2011 13:03:06 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201106181303.p5ID36CW042373@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 18 Jun 2011 13:03:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223259 - head/share/man/man9 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jun 2011 13:03:07 -0000 Author: bz Date: Sat Jun 18 13:03:06 2011 New Revision: 223259 URL: http://svn.freebsd.org/changeset/base/223259 Log: Correct a typo in the function name. MFC after: 1 week Modified: head/share/man/man9/device_get_sysctl.9 Modified: head/share/man/man9/device_get_sysctl.9 ============================================================================== --- head/share/man/man9/device_get_sysctl.9 Sat Jun 18 12:35:08 2011 (r223258) +++ head/share/man/man9/device_get_sysctl.9 Sat Jun 18 13:03:06 2011 (r223259) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 23, 2006 +.Dd June 18, 2011 .Dt DEVICE_GET_SYSCTL 9 .Os .Sh NAME @@ -49,7 +49,7 @@ This node can be accessed with the .Fn device_get_sysctl_tree function. The context for the node can be obtained with the -.Fn device_get_sysctl_ctl +.Fn device_get_sysctl_ctx function. .Sh SEE ALSO .Xr device 9 From owner-svn-src-head@FreeBSD.ORG Sat Jun 18 13:08:46 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A39B106566C; Sat, 18 Jun 2011 13:08:46 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6A6838FC08; Sat, 18 Jun 2011 13:08:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5ID8kSj042564; Sat, 18 Jun 2011 13:08:46 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5ID8kCS042562; Sat, 18 Jun 2011 13:08:46 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201106181308.p5ID8kCS042562@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 18 Jun 2011 13:08:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223260 - head/share/man/man9 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jun 2011 13:08:46 -0000 Author: bz Date: Sat Jun 18 13:08:46 2011 New Revision: 223260 URL: http://svn.freebsd.org/changeset/base/223260 Log: Install symlinks for m_tag_* mbuf tag functions to the mbuf_tags.9 man page. MFC after: 1 week Modified: head/share/man/man9/Makefile Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Sat Jun 18 13:03:06 2011 (r223259) +++ head/share/man/man9/Makefile Sat Jun 18 13:08:46 2011 (r223260) @@ -860,6 +860,22 @@ MLINKS+=\ mbuf.9 mtod.9 \ mbuf.9 M_TRAILINGSPACE.9 \ mbuf.9 M_WRITABLE.9 +MLINKS+=\ + mbuf_tags.9 m_tag_alloc.9 \ + mbuf_tags.9 m_tag_copy.9 \ + mbuf_tags.9 m_tag_copy_chain.9 \ + mbuf_tags.9 m_tag_delete.9 \ + mbuf_tags.9 m_tag_delete_chain.9 \ + mbuf_tags.9 m_tag_delete_nonpersistent.9 \ + mbuf_tags.9 m_tag_find.9 \ + mbuf_tags.9 m_tag_first.9 \ + mbuf_tags.9 m_tag_free.9 \ + mbuf_tags.9 m_tag_get.9 \ + mbuf_tags.9 m_tag_init.9 \ + mbuf_tags.9 m_tag_locate.9 \ + mbuf_tags.9 m_tag_next.9 \ + mbuf_tags.9 m_tag_prepend.9 \ + mbuf_tags.9 m_tag_unlink.9 MLINKS+=MD5.9 MD5Init.9 \ MD5.9 MD5Transform.9 MLINKS+=mdchain.9 md_append_record.9 \ From owner-svn-src-head@FreeBSD.ORG Sat Jun 18 13:54:36 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A6992106566C; Sat, 18 Jun 2011 13:54:36 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7DDE18FC19; Sat, 18 Jun 2011 13:54:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5IDsadk044033; Sat, 18 Jun 2011 13:54:36 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5IDsaL3044031; Sat, 18 Jun 2011 13:54:36 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201106181354.p5IDsaL3044031@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 18 Jun 2011 13:54:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223261 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jun 2011 13:54:36 -0000 Author: bz Date: Sat Jun 18 13:54:36 2011 New Revision: 223261 URL: http://svn.freebsd.org/changeset/base/223261 Log: Remove a these days incorrect comment left from before new-arp. MFC after: 1 week Modified: head/sys/netinet/if_ether.c Modified: head/sys/netinet/if_ether.c ============================================================================== --- head/sys/netinet/if_ether.c Sat Jun 18 13:08:46 2011 (r223260) +++ head/sys/netinet/if_ether.c Sat Jun 18 13:54:36 2011 (r223261) @@ -759,7 +759,7 @@ match: } } else LLE_WUNLOCK(la); - } /* end of FIB loop */ + } reply: if (op != ARPOP_REQUEST) goto drop; From owner-svn-src-head@FreeBSD.ORG Sat Jun 18 13:56:34 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 076F41065675; Sat, 18 Jun 2011 13:56:34 +0000 (UTC) (envelope-from benl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E80228FC17; Sat, 18 Jun 2011 13:56:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5IDuXAO044203; Sat, 18 Jun 2011 13:56:33 GMT (envelope-from benl@svn.freebsd.org) Received: (from benl@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5IDuXhW044171; Sat, 18 Jun 2011 13:56:33 GMT (envelope-from benl@svn.freebsd.org) Message-Id: <201106181356.p5IDuXhW044171@svn.freebsd.org> From: Ben Laurie Date: Sat, 18 Jun 2011 13:56:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223262 - in head: cddl/contrib/opensolaris/lib/libdtrace/common contrib/binutils/bfd contrib/binutils/gas contrib/binutils/gas/config contrib/binutils/ld contrib/binutils/opcodes contr... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jun 2011 13:56:34 -0000 Author: benl Date: Sat Jun 18 13:56:33 2011 New Revision: 223262 URL: http://svn.freebsd.org/changeset/base/223262 Log: Fix clang warnings. Approved by: philip (mentor) Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c head/contrib/binutils/bfd/coffcode.h head/contrib/binutils/bfd/opncls.c head/contrib/binutils/bfd/peicode.h head/contrib/binutils/gas/config/obj-elf.c head/contrib/binutils/gas/frags.c head/contrib/binutils/gas/subsegs.c head/contrib/binutils/ld/ldexp.c head/contrib/binutils/ld/sysdep.h head/contrib/binutils/opcodes/i386-dis.c head/contrib/gcc/cfg.c head/contrib/gcc/output.h head/contrib/gcc/rtl.h head/contrib/gcc/tree.h head/contrib/gperf/src/gen-perf.cc head/contrib/gperf/src/key-list.cc head/lib/libc/db/btree/bt_split.c head/lib/libprocstat/libprocstat.c head/lib/msun/ld80/e_rem_pio2l.h head/libexec/rtld-elf/rtld.c head/sbin/ipfw/ipfw2.c head/sys/boot/i386/libi386/biosacpi.c head/sys/cddl/contrib/opensolaris/uts/common/sys/ctf_api.h head/sys/sys/diskpc98.h head/sys/sys/param.h head/usr.bin/ldd/sods.c head/usr.bin/xlint/lint1/decl.c head/usr.bin/xlint/lint1/scan.l head/usr.bin/xlint/lint2/msg.c head/usr.bin/xlint/lint2/read.c Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c Sat Jun 18 13:54:36 2011 (r223261) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c Sat Jun 18 13:56:33 2011 (r223262) @@ -45,6 +45,7 @@ #include #include #include +#include #include @@ -811,15 +812,14 @@ dt_basename(char *str) ulong_t dt_popc(ulong_t x) { -#ifdef _ILP32 +#if defined(_ILP32) x = x - ((x >> 1) & 0x55555555UL); x = (x & 0x33333333UL) + ((x >> 2) & 0x33333333UL); x = (x + (x >> 4)) & 0x0F0F0F0FUL; x = x + (x >> 8); x = x + (x >> 16); return (x & 0x3F); -#endif -#ifdef _LP64 +#elif defined(_LP64) x = x - ((x >> 1) & 0x5555555555555555ULL); x = (x & 0x3333333333333333ULL) + ((x >> 2) & 0x3333333333333333ULL); x = (x + (x >> 4)) & 0x0F0F0F0F0F0F0F0FULL; @@ -827,6 +827,8 @@ dt_popc(ulong_t x) x = x + (x >> 16); x = x + (x >> 32); return (x & 0x7F); +#else +# warning need td_popc() implementation #endif } @@ -958,7 +960,7 @@ dtrace_uaddr2str(dtrace_hdl_t *dtp, pid_ P = dt_proc_grab(dtp, pid, PGRAB_RDONLY | PGRAB_FORCE, 0); if (P == NULL) { - (void) snprintf(c, sizeof (c), "0x%llx", addr); + (void) snprintf(c, sizeof (c), "0x%jx", (uintmax_t)addr); return (dt_string2str(c, str, nbytes)); } @@ -976,10 +978,10 @@ dtrace_uaddr2str(dtrace_hdl_t *dtp, pid_ (void) snprintf(c, sizeof (c), "%s`%s", obj, name); } } else if (Pobjname(P, addr, objname, sizeof (objname)) != 0) { - (void) snprintf(c, sizeof (c), "%s`0x%llx", - dt_basename(objname), addr); + (void) snprintf(c, sizeof (c), "%s`0x%jx", + dt_basename(objname), (uintmax_t)addr); } else { - (void) snprintf(c, sizeof (c), "0x%llx", addr); + (void) snprintf(c, sizeof (c), "0x%jx", (uintmax_t)addr); } dt_proc_unlock(dtp, P); Modified: head/contrib/binutils/bfd/coffcode.h ============================================================================== --- head/contrib/binutils/bfd/coffcode.h Sat Jun 18 13:54:36 2011 (r223261) +++ head/contrib/binutils/bfd/coffcode.h Sat Jun 18 13:56:33 2011 (r223262) @@ -3240,7 +3240,7 @@ coff_compute_section_file_positions (bfd incremented in coff_set_section_contents. This is right for SVR3.2. */ if (strcmp (current->name, _LIB) == 0) - bfd_set_section_vma (abfd, current, 0); + (void) bfd_set_section_vma (abfd, current, 0); #endif previous = current; Modified: head/contrib/binutils/bfd/opncls.c ============================================================================== --- head/contrib/binutils/bfd/opncls.c Sat Jun 18 13:54:36 2011 (r223261) +++ head/contrib/binutils/bfd/opncls.c Sat Jun 18 13:56:33 2011 (r223262) @@ -231,7 +231,7 @@ bfd_fopen (const char *filename, const c then it may have been opened with special flags that make it unsafe to close and reopen the file. */ if (fd == -1) - bfd_set_cacheable (nbfd, TRUE); + (void) bfd_set_cacheable (nbfd, TRUE); return nbfd; } Modified: head/contrib/binutils/bfd/peicode.h ============================================================================== --- head/contrib/binutils/bfd/peicode.h Sat Jun 18 13:54:36 2011 (r223261) +++ head/contrib/binutils/bfd/peicode.h Sat Jun 18 13:56:33 2011 (r223262) @@ -607,7 +607,7 @@ pe_ILF_make_a_section (pe_ILF_vars * var bfd_set_section_flags (vars->abfd, sec, flags | extra_flags); - bfd_set_section_alignment (vars->abfd, sec, 2); + (void) bfd_set_section_alignment (vars->abfd, sec, 2); /* Check that we will not run out of space. */ BFD_ASSERT (vars->data + size < vars->bim->buffer + vars->bim->size); Modified: head/contrib/binutils/gas/config/obj-elf.c ============================================================================== --- head/contrib/binutils/gas/config/obj-elf.c Sat Jun 18 13:54:36 2011 (r223261) +++ head/contrib/binutils/gas/config/obj-elf.c Sat Jun 18 13:56:33 2011 (r223262) @@ -1636,7 +1636,7 @@ obj_elf_init_stab_section (segT seg) /* Force the section to align to a longword boundary. Without this, UnixWare ar crashes. */ - bfd_set_section_alignment (stdoutput, seg, 2); + (void) bfd_set_section_alignment (stdoutput, seg, 2); /* Make space for this first symbol. */ p = frag_more (12); Modified: head/contrib/binutils/gas/frags.c ============================================================================== --- head/contrib/binutils/gas/frags.c Sat Jun 18 13:54:36 2011 (r223261) +++ head/contrib/binutils/gas/frags.c Sat Jun 18 13:56:33 2011 (r223262) @@ -146,7 +146,7 @@ frag_new (int old_frags_var_max_size /* This will align the obstack so the next struct we allocate on it will begin at a correct boundary. */ - obstack_finish (&frchain_now->frch_obstack); + (void) obstack_finish (&frchain_now->frch_obstack); frchP = frchain_now; know (frchP); former_last_fragP = frchP->frch_last; Modified: head/contrib/binutils/gas/subsegs.c ============================================================================== --- head/contrib/binutils/gas/subsegs.c Sat Jun 18 13:54:36 2011 (r223261) +++ head/contrib/binutils/gas/subsegs.c Sat Jun 18 13:56:33 2011 (r223262) @@ -67,7 +67,7 @@ subseg_change (register segT seg, regist { seginfo = xcalloc (1, sizeof (*seginfo)); seginfo->bfd_section = seg; - bfd_set_section_userdata (stdoutput, seg, seginfo); + (void) bfd_set_section_userdata (stdoutput, seg, seginfo); } } @@ -169,7 +169,7 @@ subseg_get (const char *segname, int for secptr->output_section = secptr; seginfo = xcalloc (1, sizeof (*seginfo)); seginfo->bfd_section = secptr; - bfd_set_section_userdata (stdoutput, secptr, seginfo); + (void) bfd_set_section_userdata (stdoutput, secptr, seginfo); } return secptr; } Modified: head/contrib/binutils/ld/ldexp.c ============================================================================== --- head/contrib/binutils/ld/ldexp.c Sat Jun 18 13:54:36 2011 (r223261) +++ head/contrib/binutils/ld/ldexp.c Sat Jun 18 13:56:33 2011 (r223262) @@ -1112,9 +1112,9 @@ exp_get_fill (etree_type *tree, fill_typ fill = xmalloc (4 + sizeof (*fill) - 1); val = expld.result.value; fill->data[0] = (val >> 24) & 0xff; - fill->data[1] = (val >> 16) & 0xff; - fill->data[2] = (val >> 8) & 0xff; - fill->data[3] = (val >> 0) & 0xff; + __PAST_END(fill->data, 1) = (val >> 16) & 0xff; + __PAST_END(fill->data, 2) = (val >> 8) & 0xff; + __PAST_END(fill->data, 3) = (val >> 0) & 0xff; fill->size = 4; } return fill; Modified: head/contrib/binutils/ld/sysdep.h ============================================================================== --- head/contrib/binutils/ld/sysdep.h Sat Jun 18 13:54:36 2011 (r223261) +++ head/contrib/binutils/ld/sysdep.h Sat Jun 18 13:56:33 2011 (r223262) @@ -54,6 +54,9 @@ extern char *strrchr (); /* for MAXPATHLEN */ #ifdef HAVE_SYS_PARAM_H #include +#ifndef __PAST_END +# define __PAST_END(array, offset) (((typeof(*(array)) *)(array))[offset]) +#endif #endif #ifdef PATH_MAX # define LD_PATHMAX PATH_MAX Modified: head/contrib/binutils/opcodes/i386-dis.c ============================================================================== --- head/contrib/binutils/opcodes/i386-dis.c Sat Jun 18 13:54:36 2011 (r223261) +++ head/contrib/binutils/opcodes/i386-dis.c Sat Jun 18 13:56:33 2011 (r223262) @@ -3203,7 +3203,7 @@ ckprefix (void) rex_used = 0; while (1) { - FETCH_DATA (the_info, codep + 1); + (void) FETCH_DATA (the_info, codep + 1); newrex = 0; switch (*codep) { @@ -3606,7 +3606,7 @@ print_insn (bfd_vma pc, disassemble_info insn_codep = codep; sizeflag = priv.orig_sizeflag; - FETCH_DATA (info, codep + 1); + (void) FETCH_DATA (info, codep + 1); two_source_ops = (*codep == 0x62) || (*codep == 0xc8); if (((prefixes & PREFIX_FWAIT) @@ -3628,7 +3628,7 @@ print_insn (bfd_vma pc, disassemble_info if (*codep == 0x0f) { unsigned char threebyte; - FETCH_DATA (info, codep + 2); + (void) FETCH_DATA (info, codep + 2); threebyte = *++codep; dp = &dis386_twobyte[threebyte]; need_modrm = twobyte_has_modrm[*codep]; @@ -3639,7 +3639,7 @@ print_insn (bfd_vma pc, disassemble_info codep++; if (dp->name == NULL && dp->op[0].bytemode == IS_3BYTE_OPCODE) { - FETCH_DATA (info, codep + 2); + (void) FETCH_DATA (info, codep + 2); op = *codep++; switch (threebyte) { @@ -3724,7 +3724,7 @@ print_insn (bfd_vma pc, disassemble_info } else if (need_modrm) { - FETCH_DATA (info, codep + 1); + (void) FETCH_DATA (info, codep + 1); modrm.mod = (*codep >> 6) & 3; modrm.reg = (*codep >> 3) & 7; modrm.rm = *codep & 7; @@ -4890,7 +4890,7 @@ OP_E (int bytemode, int sizeflag) if (base == 4) { havesib = 1; - FETCH_DATA (the_info, codep + 1); + (void) FETCH_DATA (the_info, codep + 1); index = (*codep >> 3) & 7; if (address_mode == mode_64bit || index != 0x4) /* When INDEX == 0x4 in 32 bit mode, SCALE is ignored. */ @@ -5147,7 +5147,7 @@ get64 (void) unsigned int a; unsigned int b; - FETCH_DATA (the_info, codep + 8); + (void) FETCH_DATA (the_info, codep + 8); a = *codep++ & 0xff; a |= (*codep++ & 0xff) << 8; a |= (*codep++ & 0xff) << 16; @@ -5169,7 +5169,7 @@ get32 (void) { bfd_signed_vma x = 0; - FETCH_DATA (the_info, codep + 4); + (void) FETCH_DATA (the_info, codep + 4); x = *codep++ & (bfd_signed_vma) 0xff; x |= (*codep++ & (bfd_signed_vma) 0xff) << 8; x |= (*codep++ & (bfd_signed_vma) 0xff) << 16; @@ -5182,7 +5182,7 @@ get32s (void) { bfd_signed_vma x = 0; - FETCH_DATA (the_info, codep + 4); + (void) FETCH_DATA (the_info, codep + 4); x = *codep++ & (bfd_signed_vma) 0xff; x |= (*codep++ & (bfd_signed_vma) 0xff) << 8; x |= (*codep++ & (bfd_signed_vma) 0xff) << 16; @@ -5198,7 +5198,7 @@ get16 (void) { int x = 0; - FETCH_DATA (the_info, codep + 2); + (void) FETCH_DATA (the_info, codep + 2); x = *codep++ & 0xff; x |= (*codep++ & 0xff) << 8; return x; @@ -6018,7 +6018,7 @@ OP_3DNowSuffix (int bytemode ATTRIBUTE_U { const char *mnemonic; - FETCH_DATA (the_info, codep + 1); + (void) FETCH_DATA (the_info, codep + 1); /* AMD 3DNow! instructions are specified by an opcode suffix in the place where an 8-bit immediate would normally go. ie. the last byte of the instruction. */ @@ -6054,7 +6054,7 @@ OP_SIMD_Suffix (int bytemode ATTRIBUTE_U { unsigned int cmp_type; - FETCH_DATA (the_info, codep + 1); + (void) FETCH_DATA (the_info, codep + 1); obufp = obuf + strlen (obuf); cmp_type = *codep++ & 0xff; if (cmp_type < 8) Modified: head/contrib/gcc/cfg.c ============================================================================== --- head/contrib/gcc/cfg.c Sat Jun 18 13:54:36 2011 (r223261) +++ head/contrib/gcc/cfg.c Sat Jun 18 13:56:33 2011 (r223262) @@ -830,7 +830,7 @@ dump_cfg_bb_info (FILE *file, basic_bloc else fprintf (file, ", "); first = false; - fprintf (file, bb_bitnames[i]); + fputs (bb_bitnames[i], file); } if (!first) fprintf (file, ")"); Modified: head/contrib/gcc/output.h ============================================================================== --- head/contrib/gcc/output.h Sat Jun 18 13:54:36 2011 (r223261) +++ head/contrib/gcc/output.h Sat Jun 18 13:56:33 2011 (r223262) @@ -109,13 +109,14 @@ extern void output_addr_const (FILE *, r /* Output a string of assembler code, substituting numbers, strings and fixed syntactic prefixes. */ -#if GCC_VERSION >= 3004 +#if GCC_VERSION >= 3004 && !defined(__clang__) #define ATTRIBUTE_ASM_FPRINTF(m, n) __attribute__ ((__format__ (__asm_fprintf__, m, n))) ATTRIBUTE_NONNULL(m) /* This is a magic identifier which allows GCC to figure out the type of HOST_WIDE_INT for %wd specifier checks. You must issue this typedef before using the __asm_fprintf__ format attribute. */ typedef HOST_WIDE_INT __gcc_host_wide_int__; #else +/* FIXME(benl): what about %wd? */ #define ATTRIBUTE_ASM_FPRINTF(m, n) ATTRIBUTE_NONNULL(m) #endif Modified: head/contrib/gcc/rtl.h ============================================================================== --- head/contrib/gcc/rtl.h Sat Jun 18 13:54:36 2011 (r223261) +++ head/contrib/gcc/rtl.h Sat Jun 18 13:56:33 2011 (r223262) @@ -22,6 +22,11 @@ Software Foundation, 51 Franklin Street, #ifndef GCC_RTL_H #define GCC_RTL_H +#include +#ifndef __PAST_END +# define __PAST_END(array, offset) (((typeof(*(array)) *)(array))[offset]) +#endif + #include "statistics.h" #include "machmode.h" #include "input.h" @@ -565,12 +570,12 @@ extern void rtvec_check_failed_bounds (r #define RTL_CHECK1(RTX, N, C1) ((RTX)->u.fld[N]) #define RTL_CHECK2(RTX, N, C1, C2) ((RTX)->u.fld[N]) -#define RTL_CHECKC1(RTX, N, C) ((RTX)->u.fld[N]) +#define RTL_CHECKC1(RTX, N, C) __PAST_END((RTX)->u.fld, N) #define RTL_CHECKC2(RTX, N, C1, C2) ((RTX)->u.fld[N]) -#define RTVEC_ELT(RTVEC, I) ((RTVEC)->elem[I]) +#define RTVEC_ELT(RTVEC, I) __PAST_END((RTVEC)->elem, I) #define XWINT(RTX, N) ((RTX)->u.hwint[N]) #define XCWINT(RTX, N, C) ((RTX)->u.hwint[N]) -#define XCMWINT(RTX, N, C, M) ((RTX)->u.hwint[N]) +#define XCMWINT(RTX, N, C, M) __PAST_END((RTX)->u.hwint, N) #define XCNMWINT(RTX, N, C, M) ((RTX)->u.hwint[N]) #define XCNMPRV(RTX, C, M) (&(RTX)->u.rv) #define BLOCK_SYMBOL_CHECK(RTX) (&(RTX)->u.block_sym) Modified: head/contrib/gcc/tree.h ============================================================================== --- head/contrib/gcc/tree.h Sat Jun 18 13:54:36 2011 (r223261) +++ head/contrib/gcc/tree.h Sat Jun 18 13:56:33 2011 (r223262) @@ -22,6 +22,11 @@ Software Foundation, 51 Franklin Street, #ifndef GCC_TREE_H #define GCC_TREE_H +#include +#ifndef __PAST_END +# define __PAST_END(array, offset) (((typeof(*(array)) *)(array))[offset]) +#endif + #include "hashtab.h" #include "machmode.h" #include "input.h" @@ -830,12 +835,12 @@ extern void omp_clause_range_check_faile #define TREE_RANGE_CHECK(T, CODE1, CODE2) (T) #define EXPR_CHECK(T) (T) #define NON_TYPE_CHECK(T) (T) -#define TREE_VEC_ELT_CHECK(T, I) ((T)->vec.a[I]) -#define TREE_OPERAND_CHECK(T, I) ((T)->exp.operands[I]) -#define TREE_OPERAND_CHECK_CODE(T, CODE, I) ((T)->exp.operands[I]) +#define TREE_VEC_ELT_CHECK(T, I) __PAST_END((T)->vec.a, I) +#define TREE_OPERAND_CHECK(T, I) __PAST_END((T)->exp.operands, I) +#define TREE_OPERAND_CHECK_CODE(T, CODE, I) __PAST_END((T)->exp.operands, I) #define TREE_RTL_OPERAND_CHECK(T, CODE, I) (*(rtx *) &((T)->exp.operands[I])) #define PHI_NODE_ELT_CHECK(T, i) ((T)->phi.a[i]) -#define OMP_CLAUSE_ELT_CHECK(T, i) ((T)->omp_clause.ops[i]) +#define OMP_CLAUSE_ELT_CHECK(T, i) __PAST_END((T)->omp_clause.ops, i) #define OMP_CLAUSE_RANGE_CHECK(T, CODE1, CODE2) (T) #define OMP_CLAUSE_SUBCODE_CHECK(T, CODE) (T) Modified: head/contrib/gperf/src/gen-perf.cc ============================================================================== --- head/contrib/gperf/src/gen-perf.cc Sat Jun 18 13:54:36 2011 (r223261) +++ head/contrib/gperf/src/gen-perf.cc Sat Jun 18 13:56:33 2011 (r223262) @@ -246,7 +246,7 @@ Gen_Perf::change (List_Node *prior, List { if (option[DEBUG]) { - fprintf (stderr, " by changing asso_value['%c'] (char #%zd) to %d\n", + fprintf (stderr, " by changing asso_value['%c'] (char #%td) to %d\n", *p, p - union_set + 1, asso_values[(unsigned char)(*p)]); fflush (stderr); } Modified: head/contrib/gperf/src/key-list.cc ============================================================================== --- head/contrib/gperf/src/key-list.cc Sat Jun 18 13:54:36 2011 (r223261) +++ head/contrib/gperf/src/key-list.cc Sat Jun 18 13:56:33 2011 (r223262) @@ -1441,7 +1441,7 @@ Key_List::output_lookup_array (void) if (option[DEBUG]) fprintf (stderr, - "dup_ptr[%zd]: hash_value = %d, index = %d, count = %d\n", + "dup_ptr[%td]: hash_value = %d, index = %d, count = %d\n", dup_ptr - duplicates, dup_ptr->hash_value, dup_ptr->index, dup_ptr->count); Modified: head/lib/libc/db/btree/bt_split.c ============================================================================== --- head/lib/libc/db/btree/bt_split.c Sat Jun 18 13:54:36 2011 (r223261) +++ head/lib/libc/db/btree/bt_split.c Sat Jun 18 13:56:33 2011 (r223262) @@ -37,6 +37,7 @@ static char sccsid[] = "@(#)bt_split.c 8 __FBSDID("$FreeBSD$"); #include +#include #include #include @@ -482,7 +483,7 @@ bt_rroot(BTREE *t, PAGE *h, PAGE *l, PAG WR_RINTERNAL(dest, l->flags & P_RLEAF ? NEXTINDEX(l) : rec_total(l), l->pgno); - h->linp[1] = h->upper -= NRINTERNAL; + __PAST_END(h->linp, 1) = h->upper -= NRINTERNAL; dest = (char *)h + h->upper; WR_RINTERNAL(dest, r->flags & P_RLEAF ? NEXTINDEX(r) : rec_total(r), r->pgno); @@ -534,7 +535,7 @@ bt_broot(BTREE *t, PAGE *h, PAGE *l, PAG case P_BLEAF: bl = GETBLEAF(r, 0); nbytes = NBINTERNAL(bl->ksize); - h->linp[1] = h->upper -= nbytes; + __PAST_END(h->linp, 1) = h->upper -= nbytes; dest = (char *)h + h->upper; WR_BINTERNAL(dest, bl->ksize, r->pgno, 0); memmove(dest, bl->bytes, bl->ksize); @@ -550,7 +551,7 @@ bt_broot(BTREE *t, PAGE *h, PAGE *l, PAG case P_BINTERNAL: bi = GETBINTERNAL(r, 0); nbytes = NBINTERNAL(bi->ksize); - h->linp[1] = h->upper -= nbytes; + __PAST_END(h->linp, 1) = h->upper -= nbytes; dest = (char *)h + h->upper; memmove(dest, bi, nbytes); ((BINTERNAL *)dest)->pgno = r->pgno; Modified: head/lib/libprocstat/libprocstat.c ============================================================================== --- head/lib/libprocstat/libprocstat.c Sat Jun 18 13:54:36 2011 (r223261) +++ head/lib/libprocstat/libprocstat.c Sat Jun 18 13:56:33 2011 (r223262) @@ -1283,7 +1283,7 @@ vntype2psfsttype(int type) static char * getmnton(kvm_t *kd, struct mount *m) { - static struct mount mnt; + struct mount mnt; static struct mtab { struct mtab *next; struct mount *m; @@ -1302,7 +1302,7 @@ getmnton(kvm_t *kd, struct mount *m) err(1, NULL); mt->m = m; bcopy(&mnt.mnt_stat.f_mntonname[0], &mt->mntonname[0], MNAMELEN); - mnt.mnt_stat.f_mntonname[MNAMELEN] = '\0'; + mt->mntonname[MNAMELEN] = '\0'; mt->next = mhead; mhead = mt; return (mt->mntonname); Modified: head/lib/msun/ld80/e_rem_pio2l.h ============================================================================== --- head/lib/msun/ld80/e_rem_pio2l.h Sat Jun 18 13:54:36 2011 (r223261) +++ head/lib/msun/ld80/e_rem_pio2l.h Sat Jun 18 13:56:33 2011 (r223262) @@ -82,7 +82,7 @@ __ieee754_rem_pio2l(long double x, long u.e = x; expsign = u.xbits.expsign; ex = expsign & 0x7fff; - if (ex < BIAS + 25 || ex == BIAS + 25 && u.bits.manh < 0xc90fdaa2) { + if (ex < BIAS + 25 || (ex == BIAS + 25 && u.bits.manh < 0xc90fdaa2)) { /* |x| ~< 2^25*(pi/2), medium size */ /* Use a specialized rint() to get fn. Assume round-to-nearest. */ fn = x*invpio2+0x1.8p63; Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Sat Jun 18 13:54:36 2011 (r223261) +++ head/libexec/rtld-elf/rtld.c Sat Jun 18 13:56:33 2011 (r223262) @@ -928,8 +928,8 @@ digest_dynamic1(Obj_Entry *obj, int earl obj->textrel = true; if (dynp->d_un.d_val & DF_BIND_NOW) obj->bind_now = true; - if (dynp->d_un.d_val & DF_STATIC_TLS) - ; + /*if (dynp->d_un.d_val & DF_STATIC_TLS) + ;*/ break; #ifdef __mips__ case DT_MIPS_LOCAL_GOTNO: @@ -958,8 +958,8 @@ digest_dynamic1(Obj_Entry *obj, int earl obj->z_noopen = true; if ((dynp->d_un.d_val & DF_1_ORIGIN) && trust) obj->z_origin = true; - if (dynp->d_un.d_val & DF_1_GLOBAL) - /* XXX */; + /*if (dynp->d_un.d_val & DF_1_GLOBAL) + XXX ;*/ if (dynp->d_un.d_val & DF_1_BIND_NOW) obj->bind_now = true; if (dynp->d_un.d_val & DF_1_NODELETE) Modified: head/sbin/ipfw/ipfw2.c ============================================================================== --- head/sbin/ipfw/ipfw2.c Sat Jun 18 13:54:36 2011 (r223261) +++ head/sbin/ipfw/ipfw2.c Sat Jun 18 13:56:33 2011 (r223262) @@ -21,6 +21,7 @@ */ #include +#include #include #include #include @@ -3567,7 +3568,7 @@ read_options: } if (lookup_key[j] <= 0) errx(EX_USAGE, "format: cannot lookup on %s", *av); - c->d[1] = j; // i converted to option + __PAST_END(c->d, 1) = j; // i converted to option av++; cmd->arg1 = strtoul(*av, &p, 0); if (p && *p) Modified: head/sys/boot/i386/libi386/biosacpi.c ============================================================================== --- head/sys/boot/i386/libi386/biosacpi.c Sat Jun 18 13:54:36 2011 (r223261) +++ head/sys/boot/i386/libi386/biosacpi.c Sat Jun 18 13:56:33 2011 (r223262) @@ -61,7 +61,7 @@ biosacpi_detect(void) return; /* export values from the RSDP */ - sprintf(buf, "%p", VTOP(rsdp)); + sprintf(buf, "%u", VTOP(rsdp)); setenv("hint.acpi.0.rsdp", buf, 1); revision = rsdp->Revision; if (revision == 0) Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/ctf_api.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/sys/ctf_api.h Sat Jun 18 13:54:36 2011 (r223261) +++ head/sys/cddl/contrib/opensolaris/uts/common/sys/ctf_api.h Sat Jun 18 13:56:33 2011 (r223262) @@ -65,7 +65,7 @@ typedef long ctf_id_t; * filling in ctf_sect_t structures and passing them to ctf_bufopen(): */ typedef struct ctf_sect { - char *cts_name; /* section name (if any) */ + const char *cts_name; /* section name (if any) */ ulong_t cts_type; /* section type (ELF SHT_... value) */ ulong_t cts_flags; /* section flags (ELF SHF_... value) */ #if defined(sun) Modified: head/sys/sys/diskpc98.h ============================================================================== --- head/sys/sys/diskpc98.h Sat Jun 18 13:54:36 2011 (r223261) +++ head/sys/sys/diskpc98.h Sat Jun 18 13:56:33 2011 (r223262) @@ -36,8 +36,11 @@ #include #define DOSBBSECTOR 0 /* DOS boot block relative sector number */ +#undef DOSPARTOFF #define DOSPARTOFF 0 +#undef DOSPARTSIZE #define DOSPARTSIZE 32 +#undef NDOSPART #define NDOSPART 16 #define DOSMAGICOFFSET 510 #define DOSMAGIC 0xAA55 @@ -52,6 +55,7 @@ #define DOSMID_386BSD (PC98_MID_386BSD | PC98_MID_BOOTABLE) #define DOSSID_386BSD (PC98_SID_386BSD | PC98_SID_ACTIVE) +#undef DOSPTYP_386BSD #define DOSPTYP_386BSD (DOSSID_386BSD << 8 | DOSMID_386BSD) struct pc98_partition { Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Sat Jun 18 13:54:36 2011 (r223261) +++ head/sys/sys/param.h Sat Jun 18 13:56:33 2011 (r223262) @@ -319,4 +319,10 @@ __END_DECLS #define member2struct(s, m, x) \ ((struct s *)(void *)((char *)(x) - offsetof(struct s, m))) +/* + * Access a variable length array that has been declared as a fixed + * length array. + */ +#define __PAST_END(array, offset) (((typeof(*(array)) *)(array))[offset]) + #endif /* _SYS_PARAM_H_ */ Modified: head/usr.bin/ldd/sods.c ============================================================================== --- head/usr.bin/ldd/sods.c Sat Jun 18 13:54:36 2011 (r223261) +++ head/usr.bin/ldd/sods.c Sat Jun 18 13:56:33 2011 (r223262) @@ -142,6 +142,24 @@ main(int argc, char *argv[]) } #endif +static inline const void *align_struct(const void *expr) +{ + assert(!(((int)expr) & 3)); + return expr; +} + +static inline const void *align_long(const void *expr) +{ + assert(!(((int)expr) & 3)); + return expr; +} + +static inline const void *align_short(const void *expr) +{ + assert(!(((int)expr) & 1)); + return expr; +} + #ifdef STANDALONE static #endif @@ -182,7 +200,7 @@ dump_file(const char *fname) file_base = (const char *) objbase; /* Makes address arithmetic easier */ - if (IS_ELF(*(const Elf32_Ehdr*) file_base)) { + if (IS_ELF(*(const Elf32_Ehdr*) align_struct(file_base))) { warnx("%s: this is an ELF program; use objdump to examine", fname); ++error_count; munmap(objbase, sb.st_size); @@ -190,7 +208,7 @@ dump_file(const char *fname) return; } - ex = (const struct exec *) file_base; + ex = (const struct exec *) align_struct(file_base); printf("%s: a_midmag = 0x%lx\n", fname, (long)ex->a_midmag); printf(" magic = 0x%lx = 0%lo, netmagic = 0x%lx = 0%lo\n", @@ -214,8 +232,9 @@ dump_file(const char *fname) text_base = file_base + N_TXTOFF(*ex); data_base = file_base + N_DATOFF(*ex); - rel_base = (const struct relocation_info *) (file_base + N_RELOFF(*ex)); - sym_base = (const struct nlist *) (file_base + N_SYMOFF(*ex)); + rel_base = (const struct relocation_info *) + align_struct(file_base + N_RELOFF(*ex)); + sym_base = (const struct nlist *) align_struct(file_base + N_SYMOFF(*ex)); str_base = file_base + N_STROFF(*ex); rel_count = (ex->a_trsize + ex->a_drsize) / sizeof rel_base[0]; @@ -276,19 +295,20 @@ dump_file(const char *fname) printf(" Object file, origin = %lx\n", origin); if (N_GETFLAG(*ex) & EX_DYNAMIC) { - dyn = (const struct _dynamic *) data_base; + dyn = (const struct _dynamic *) align_struct(data_base); printf(" Dynamic version = %d\n", dyn->d_version); sdt = (const struct section_dispatch_table *) - (text_addr + (unsigned long) dyn->d_un.d_sdt); + align_struct(text_addr + (unsigned long) dyn->d_un.d_sdt); - rtrel_base = - (const struct relocation_info *) (text_addr + sdt->sdt_rel); + rtrel_base = (const struct relocation_info *) + align_struct(text_addr + sdt->sdt_rel); rtrel_count = (sdt->sdt_hash - sdt->sdt_rel) / sizeof rtrel_base[0]; assert(rtrel_count * sizeof rtrel_base[0] == (size_t)(sdt->sdt_hash - sdt->sdt_rel)); - rtsym_base = (const struct nzlist *) (text_addr + sdt->sdt_nzlist); + rtsym_base = (const struct nzlist *) + align_struct(text_addr + sdt->sdt_nzlist); rtsym_count = (sdt->sdt_strings - sdt->sdt_nzlist) / sizeof rtsym_base[0]; assert(rtsym_count * sizeof rtsym_base[0] == @@ -352,11 +372,13 @@ dump_rels(const char *label, const struc break; case 2: snprintf(contents, sizeof contents, " [%04x]", - *(unsigned const short *)(text_addr + r->r_address)); + *(unsigned const short *) + align_short(text_addr + r->r_address)); break; case 4: snprintf(contents, sizeof contents, "[%08lx]", - *(unsigned const long *)(text_addr + r->r_address)); + *(unsigned const long *) + align_long(text_addr + r->r_address)); break; } } else @@ -429,7 +451,7 @@ dump_sods(void) sod_offset = sdt->sdt_sods; printf(" Shared object dependencies:\n"); while (sod_offset != 0) { - const struct sod *sodp = (const struct sod *) (text_addr + sod_offset); + const struct sod *sodp = (const struct sod *) align_struct((text_addr + sod_offset)); const char *name = (const char *) (text_addr + sodp->sod_name); if (sodp->sod_library) Modified: head/usr.bin/xlint/lint1/decl.c ============================================================================== --- head/usr.bin/xlint/lint1/decl.c Sat Jun 18 13:54:36 2011 (r223261) +++ head/usr.bin/xlint/lint1/decl.c Sat Jun 18 13:56:33 2011 (r223262) @@ -415,9 +415,6 @@ tdeferr(type_t *td, tspec_t t) case UINT: case INT: break; - - case NTSPEC: /* this value unused */ - break; } /* Anything other is not accepted. */ Modified: head/usr.bin/xlint/lint1/scan.l ============================================================================== --- head/usr.bin/xlint/lint1/scan.l Sat Jun 18 13:54:36 2011 (r223261) +++ head/usr.bin/xlint/lint1/scan.l Sat Jun 18 13:56:33 2011 (r223262) @@ -580,9 +580,6 @@ icon(int base) case CHAR: case UNSIGN: break; - - case NTSPEC: /* this value unused */ - break; } if (typ != QUAD && typ != UQUAD) { Modified: head/usr.bin/xlint/lint2/msg.c ============================================================================== --- head/usr.bin/xlint/lint2/msg.c Sat Jun 18 13:54:36 2011 (r223261) +++ head/usr.bin/xlint/lint2/msg.c Sat Jun 18 13:56:33 2011 (r223262) @@ -32,6 +32,7 @@ */ #include +__FBSDID("$FreeBSD$"); #if defined(__RCSID) && !defined(lint) __RCSID("$NetBSD: msg.c,v 1.6 2002/01/21 19:49:52 tv Exp $"); #endif @@ -127,7 +128,7 @@ mkpos(pos_t *posp) if (len > blen) buf = xrealloc(buf, blen = len); if (line != 0) { - (void)sprintf(buf, "%s%s(%hu)", + (void)sprintf(buf, "%s%s(%d)", fn, qm ? "?" : "", line); } else { (void)sprintf(buf, "%s", fn); Modified: head/usr.bin/xlint/lint2/read.c ============================================================================== --- head/usr.bin/xlint/lint2/read.c Sat Jun 18 13:54:36 2011 (r223261) +++ head/usr.bin/xlint/lint2/read.c Sat Jun 18 13:56:33 2011 (r223262) @@ -696,8 +696,6 @@ inptype(const char *cp, const char **epp case SIGNED: case NOTSPEC: break; - case NTSPEC: - abort(); } *epp = cp; @@ -901,8 +899,6 @@ gettlen(const char *cp, const char **epp case UQUAD: case LONG: break; - case NTSPEC: - abort(); } *epp = cp; From owner-svn-src-head@FreeBSD.ORG Sat Jun 18 14:36:09 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F173106566C; Sat, 18 Jun 2011 14:36:09 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail07.syd.optusnet.com.au (mail07.syd.optusnet.com.au [211.29.132.188]) by mx1.freebsd.org (Postfix) with ESMTP id 1177E8FC08; Sat, 18 Jun 2011 14:36:08 +0000 (UTC) Received: from c122-106-165-191.carlnfd1.nsw.optusnet.com.au (c122-106-165-191.carlnfd1.nsw.optusnet.com.au [122.106.165.191]) by mail07.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p5IEa6Yf008814 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 19 Jun 2011 00:36:07 +1000 Date: Sun, 19 Jun 2011 00:36:06 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ben Laurie In-Reply-To: <201106181356.p5IDuXhW044171@svn.freebsd.org> Message-ID: <20110619000207.V7011@besplex.bde.org> References: <201106181356.p5IDuXhW044171@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223262 - in head: cddl/contrib/opensolaris/lib/libdtrace/common contrib/binutils/bfd contrib/binutils/gas contrib/binutils/gas/config contrib/binutils/ld contrib/binutils/opcodes contr... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jun 2011 14:36:09 -0000 On Sat, 18 Jun 2011, Ben Laurie wrote: > Author: benl > Date: Sat Jun 18 13:56:33 2011 > New Revision: 223262 > URL: http://svn.freebsd.org/changeset/base/223262 > > Log: > Fix clang warnings. > > Approved by: philip (mentor) Most of these seem to be bugs in clang, so source code can only be broken by avoiding the warnings there. In particular: - casting to void is a large style bug in gnu code. Warnings in vendor code shouldn't be fixed anyway. - it is an old gcc bug to warn about use of the extremely unsurprising precedence of AND operators over OR operators. This bug is not much of a problem since it is controlled by -Wparentheses. -Wparentheses is impiled by -Wall, which is enables at WARNS >= 2. But it is a new clang bug to make this warning unconditional (it can be turned off or configured off, but this is not supported in FreeBSD or documented in clang.1). So it is now fatal at WARNS >=1, since WARNS >=1 turns warnings into errors. Bruce From owner-svn-src-head@FreeBSD.ORG Sat Jun 18 16:19:53 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 24742106564A; Sat, 18 Jun 2011 16:19:53 +0000 (UTC) (envelope-from minimarmot@gmail.com) Received: from mail-gw0-f54.google.com (mail-gw0-f54.google.com [74.125.83.54]) by mx1.freebsd.org (Postfix) with ESMTP id 96F428FC0C; Sat, 18 Jun 2011 16:19:52 +0000 (UTC) Received: by gwb15 with SMTP id 15so262336gwb.13 for ; Sat, 18 Jun 2011 09:19:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=qSc68n57df8mGfbHUY3SraDr01FkQAUaWHGBnHd9BTk=; b=M9pts1orPLdm2PXIt6CHQ+WflZWdtrzZCoAU8lsemKeX/27M43FPqXpDaPVACiVi/x dAU9QLqfCUgakco5HGLXOTITtG5s72Li/7HCGPn8fk73BXyjTsQaYuiXOSV3LCvIkuru aFvldnqzSxOH2a58pkBpFIaXxUJciazW3PRCU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=SXOv1JI/yaZEtu6vEChTWF3uHo4lxSLFua8sL1A0pZcmqrxar6+cEgWCcw+x6CjxHt h9dLLAKM0wVjUJ2C6lcsptoNFPJwKUcxKMkhcL9vqlKMuTjIO5q2wnmMDEolEDM427wX dFE4rFPYrTdiGf1sWG8a0K1jkZnKaLlebJYLE= MIME-Version: 1.0 Received: by 10.236.143.2 with SMTP id k2mr1383087yhj.500.1308412494722; Sat, 18 Jun 2011 08:54:54 -0700 (PDT) Received: by 10.236.108.1 with HTTP; Sat, 18 Jun 2011 08:54:54 -0700 (PDT) In-Reply-To: <201106181356.p5IDuXhW044171@svn.freebsd.org> References: <201106181356.p5IDuXhW044171@svn.freebsd.org> Date: Sat, 18 Jun 2011 11:54:54 -0400 Message-ID: From: Ben Kaduk To: Ben Laurie Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223262 - in head: cddl/contrib/opensolaris/lib/libdtrace/common contrib/binutils/bfd contrib/binutils/gas contrib/binutils/gas/config contrib/binutils/ld contrib/binutils/opcodes contr... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jun 2011 16:19:53 -0000 On Sat, Jun 18, 2011 at 9:56 AM, Ben Laurie wrote: > Author: benl > Date: Sat Jun 18 13:56:33 2011 > New Revision: 223262 > URL: http://svn.freebsd.org/changeset/base/223262 > > Log: > =A0Fix clang warnings. > > =A0Approved by: =A0philip (mentor) > > > Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.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/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c =A0 =A0 = =A0 =A0Sat Jun 18 13:54:36 2011 =A0 =A0 =A0 =A0(r223261) > +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c =A0 =A0 = =A0 =A0Sat Jun 18 13:56:33 2011 =A0 =A0 =A0 =A0(r223262) > @@ -45,6 +45,7 @@ > =A0#include > =A0#include > =A0#include > +#include > > =A0#include > > @@ -811,15 +812,14 @@ dt_basename(char *str) > =A0ulong_t > =A0dt_popc(ulong_t x) > =A0{ > -#ifdef _ILP32 > +#if defined(_ILP32) > =A0 =A0 =A0 =A0x =3D x - ((x >> 1) & 0x55555555UL); > =A0 =A0 =A0 =A0x =3D (x & 0x33333333UL) + ((x >> 2) & 0x33333333UL); > =A0 =A0 =A0 =A0x =3D (x + (x >> 4)) & 0x0F0F0F0FUL; > =A0 =A0 =A0 =A0x =3D x + (x >> 8); > =A0 =A0 =A0 =A0x =3D x + (x >> 16); > =A0 =A0 =A0 =A0return (x & 0x3F); > -#endif > -#ifdef _LP64 > +#elif defined(_LP64) > =A0 =A0 =A0 =A0x =3D x - ((x >> 1) & 0x5555555555555555ULL); > =A0 =A0 =A0 =A0x =3D (x & 0x3333333333333333ULL) + ((x >> 2) & 0x33333333= 33333333ULL); > =A0 =A0 =A0 =A0x =3D (x + (x >> 4)) & 0x0F0F0F0F0F0F0F0FULL; > @@ -827,6 +827,8 @@ dt_popc(ulong_t x) > =A0 =A0 =A0 =A0x =3D x + (x >> 16); > =A0 =A0 =A0 =A0x =3D x + (x >> 32); > =A0 =A0 =A0 =A0return (x & 0x7F); > +#else > +# warning need td_popc() implementation We seem to still be in dt_popc(), here. -Ben Kaduk > =A0#endif > =A0} > From owner-svn-src-head@FreeBSD.ORG Sat Jun 18 16:47:02 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: by hub.freebsd.org (Postfix, from userid 1033) id ED8131065670; Sat, 18 Jun 2011 16:47:02 +0000 (UTC) Date: Sat, 18 Jun 2011 16:47:02 +0000 From: Alexey Dokuchaev To: Peter Jeremy Message-ID: <20110618164702.GA82496@FreeBSD.org> References: <201106152338.p5FNcFlN003175@svn.freebsd.org> <20110617231757.GA40286@server.vk2pj.dyndns.org> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <20110617231757.GA40286@server.vk2pj.dyndns.org> User-Agent: Mutt/1.4.2.1i Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Nathan Whitehorn Subject: Re: svn commit: r223129 - head/release X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jun 2011 16:47:03 -0000 On Sat, Jun 18, 2011 at 09:17:57AM +1000, Peter Jeremy wrote: > On 2011-Jun-15 23:38:15 +0000, Nathan Whitehorn wrote: > >Log: > > Do not install the rescue tools onto the install CD. Since it is read > > only, they are very unlikely to be needed and take up a great deal of > > space. > > If I've correctly understood this change, I'm not sure this is a > positive move. > > Based on a quick test, removing /rescue saves about 4MB (in reality, > the saving should be less because /rescue removes the need for > /stand). OTOH, it renders the install CD useless as a recovery > "fixit" disk - whilst the CD is unlikely to need recovery itself, it > was useful for recovering hard disks I think we would be far better off with an image which would provide a release (without packages) + full fixit functionality. Existing set of images is quite suboptimal: install image cannot be used as fixit disc, fixit disc cannot be used for installation. People who want packages will probably just burn DVD image; CD users more likely to go with ports. Having single installation image with everything but packages included is a clear winner for CD format. ./danfe From owner-svn-src-head@FreeBSD.ORG Sat Jun 18 17:45:39 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84A0F106568B; Sat, 18 Jun 2011 17:45:39 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id EFBBD8FC1F; Sat, 18 Jun 2011 17:45:35 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id p5IHjVwS012566 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 18 Jun 2011 20:45:31 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id p5IHjViN061336; Sat, 18 Jun 2011 20:45:31 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id p5IHjVGD061335; Sat, 18 Jun 2011 20:45:31 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 18 Jun 2011 20:45:31 +0300 From: Kostik Belousov To: Ben Laurie Message-ID: <20110618174531.GW48734@deviant.kiev.zoral.com.ua> References: <201106181356.p5IDuXhW044171@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="NuRQJEdGmwFx3/6L" Content-Disposition: inline In-Reply-To: <201106181356.p5IDuXhW044171@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223262 - in head: cddl/contrib/opensolaris/lib/libdtrace/common contrib/binutils/bfd contrib/binutils/gas contrib/binutils/gas/config contrib/binutils/ld contrib/binutils/opcodes contr... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jun 2011 17:45:39 -0000 --NuRQJEdGmwFx3/6L Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable > Modified: head/sys/sys/param.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/param.h Sat Jun 18 13:54:36 2011 (r223261) > +++ head/sys/sys/param.h Sat Jun 18 13:56:33 2011 (r223262) > @@ -319,4 +319,10 @@ __END_DECLS > #define member2struct(s, m, x) \ > ((struct s *)(void *)((char *)(x) - offsetof(struct s, m))) > =20 > +/* > + * Access a variable length array that has been declared as a fixed > + * length array. > + */ > +#define __PAST_END(array, offset) (((typeof(*(array)) *)(array))[offset]) > + > #endif /* _SYS_PARAM_H_ */ The "typeof" there should be "__typeof", most likely. --NuRQJEdGmwFx3/6L Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk385DsACgkQC3+MBN1Mb4jwMACfZdxx8gSpFEBmV0j/GZcLkSqg XxkAoMUit6sCX3HSDTAncU5uYW8OMSdJ =p8gE -----END PGP SIGNATURE----- --NuRQJEdGmwFx3/6L-- From owner-svn-src-head@FreeBSD.ORG Sat Jun 18 18:20:23 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 724A5106566C; Sat, 18 Jun 2011 18:20:23 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) by mx1.freebsd.org (Postfix) with ESMTP id 27B4B8FC13; Sat, 18 Jun 2011 18:20:23 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 4BCF025D3860; Sat, 18 Jun 2011 18:20:22 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 6C5ED15A1F11; Sat, 18 Jun 2011 18:20:21 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id 7O0ZTswyUWc1; Sat, 18 Jun 2011 18:20:20 +0000 (UTC) Received: from orange-en1.sbone.de (orange-en1.sbone.de [IPv6:fde9:577b:c1a9:31:cabc:c8ff:fecf:e8e3]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id D8C4E15A1F10; Sat, 18 Jun 2011 18:20:19 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Bjoern A. Zeeb" In-Reply-To: <20110618164702.GA82496@FreeBSD.org> Date: Sat, 18 Jun 2011 18:20:17 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <6DE038C6-44D9-477C-8B4A-7E03BF75EC66@lists.zabbadoz.net> References: <201106152338.p5FNcFlN003175@svn.freebsd.org> <20110617231757.GA40286@server.vk2pj.dyndns.org> <20110618164702.GA82496@FreeBSD.org> To: Alexey Dokuchaev X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Nathan Whitehorn , Peter Jeremy Subject: Re: svn commit: r223129 - head/release X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jun 2011 18:20:23 -0000 On Jun 18, 2011, at 4:47 PM, Alexey Dokuchaev wrote: > On Sat, Jun 18, 2011 at 09:17:57AM +1000, Peter Jeremy wrote: >> On 2011-Jun-15 23:38:15 +0000, Nathan Whitehorn = wrote: >>> Log: >>> Do not install the rescue tools onto the install CD. Since it is = read >>> only, they are very unlikely to be needed and take up a great deal = of >>> space. >>=20 >> If I've correctly understood this change, I'm not sure this is a >> positive move. >>=20 >> Based on a quick test, removing /rescue saves about 4MB (in reality, >> the saving should be less because /rescue removes the need for >> /stand). OTOH, it renders the install CD useless as a recovery >> "fixit" disk - whilst the CD is unlikely to need recovery itself, it >> was useful for recovering hard disks >=20 > I think we would be far better off with an image which would provide a > release (without packages) + full fixit functionality. Existing set = of > images is quite suboptimal: install image cannot be used as fixit = disc, > fixit disc cannot be used for installation. People who want packages = will > probably just burn DVD image; CD users more likely to go with ports. = Having > single installation image with everything but packages included is a = clear > winner for CD format. has anyone of you tried on of the latest snapshots and knows how things look these days? /bz --=20 Bjoern A. Zeeb You have to have visions! Stop bit received. Insert coin for new address family. From owner-svn-src-head@FreeBSD.ORG Sat Jun 18 19:41:06 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 002281065670; Sat, 18 Jun 2011 19:41:05 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E408B8FC08; Sat, 18 Jun 2011 19:41:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5IJf59j054336; Sat, 18 Jun 2011 19:41:05 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5IJf5qV054330; Sat, 18 Jun 2011 19:41:05 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201106181941.p5IJf5qV054330@svn.freebsd.org> From: Doug Barton Date: Sat, 18 Jun 2011 19:41:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223264 - in head: etc/defaults etc/rc.d share/man/man5 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jun 2011 19:41:06 -0000 Author: dougb Date: Sat Jun 18 19:41:05 2011 New Revision: 223264 URL: http://svn.freebsd.org/changeset/base/223264 Log: Add rc.d/kld to load kernel modules after local disks are up. This method is many times faster than doing it in /boot/loader.conf. Added: head/etc/rc.d/kld (contents, props changed) Modified: head/etc/defaults/rc.conf head/etc/rc.d/Makefile head/etc/rc.d/var head/share/man/man5/rc.conf.5 Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Sat Jun 18 15:23:08 2011 (r223263) +++ head/etc/defaults/rc.conf Sat Jun 18 19:41:05 2011 (r223264) @@ -38,6 +38,7 @@ ddb_enable="NO" # Set to YES to load dd ddb_config="/etc/ddb.conf" # ddb(8) config file. devd_enable="YES" # Run devd, to trigger programs on device tree changes. devd_flags="" # Additional flags for devd(8). +#kld_list="" # Kernel modules to load after local disks are mounted kldxref_enable="NO" # Build linker.hints files with kldxref(8). kldxref_clobber="NO" # Overwrite old linker.hints at boot. kldxref_module_path="" # Override kern.module_path. A ';'-delimited list. Modified: head/etc/rc.d/Makefile ============================================================================== --- head/etc/rc.d/Makefile Sat Jun 18 15:23:08 2011 (r223263) +++ head/etc/rc.d/Makefile Sat Jun 18 19:41:05 2011 (r223264) @@ -18,7 +18,7 @@ FILES= DAEMON FILESYSTEMS LOGIN NETWORKI ip6addrctl ipfilter ipfs ipfw ipmon \ ipnat ipsec ipxrouted \ jail \ - kadmind kerberos keyserv kldxref kpasswdd \ + kadmind kerberos keyserv kld kldxref kpasswdd \ ldconfig local localpkg lockd lpd \ mixer motd mountcritlocal mountcritremote mountlate \ mdconfig mdconfig2 mountd moused mroute6d mrouted msgs \ Added: head/etc/rc.d/kld ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/etc/rc.d/kld Sat Jun 18 19:41:05 2011 (r223264) @@ -0,0 +1,53 @@ +#!/bin/sh + +# Copyright (c) 2011 Douglas Barton +# 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$ +# +# PROVIDE: kld +# REQUIRE: FILESYSTEMS +# KEYWORD: nojail + +. /etc/rc.subr + +name="kld" + +start_cmd="${name}_start" +stop_cmd=':' + +kld_start() +{ + [ -n "$kld_list" ] || return + + local _kld + + echo 'Loading kernel modules:' + for _kld in $kld_list ; do + load_kld -e ${_kld}.ko $_kld + done +} + +load_rc_config $name +run_rc_command "$1" Modified: head/etc/rc.d/var ============================================================================== --- head/etc/rc.d/var Sat Jun 18 15:23:08 2011 (r223263) +++ head/etc/rc.d/var Sat Jun 18 19:41:05 2011 (r223264) @@ -28,7 +28,7 @@ # # PROVIDE: var -# REQUIRE: FILESYSTEMS +# REQUIRE: FILESYSTEMS kld . /etc/rc.subr Modified: head/share/man/man5/rc.conf.5 ============================================================================== --- head/share/man/man5/rc.conf.5 Sat Jun 18 15:23:08 2011 (r223263) +++ head/share/man/man5/rc.conf.5 Sat Jun 18 19:41:05 2011 (r223264) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 27, 2011 +.Dd June 18, 2011 .Dt RC.CONF 5 .Os .Sh NAME @@ -196,6 +196,14 @@ Configuration file for .Xr ddb 8 . Default .Pa /etc/ddb.conf . +.It Va kld_list +.Pq Vt str +A list of kernel modules to load right after the local +disks are mounted. +Loading modules at this point in the boot process is +much faster than doing it via +.Pa /boot/loader.conf +for those modules not necessary for mounting local disk. .It Va kldxref_enable .Pq Vt bool Set to From owner-svn-src-head@FreeBSD.ORG Sat Jun 18 20:34:05 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F94F106564A; Sat, 18 Jun 2011 20:34:05 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from agogare.doit.wisc.edu (agogare.doit.wisc.edu [144.92.197.211]) by mx1.freebsd.org (Postfix) with ESMTP id 401E18FC14; Sat, 18 Jun 2011 20:34:04 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII; format=flowed Received: from avs-daemon.smtpauth2.wiscmail.wisc.edu by smtpauth2.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) id <0LN0003006GSGV00@smtpauth2.wiscmail.wisc.edu>; Sat, 18 Jun 2011 15:34:04 -0500 (CDT) Received: from comporellon.tachypleus.net (adsl-75-50-89-112.dsl.mdsnwi.sbcglobal.net [75.50.89.112]) by smtpauth2.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) with ESMTPSA id <0LN000EKX6GQH110@smtpauth2.wiscmail.wisc.edu>; Sat, 18 Jun 2011 15:34:03 -0500 (CDT) Date: Sat, 18 Jun 2011 15:34:02 -0500 From: Nathan Whitehorn In-reply-to: <20110617231757.GA40286@server.vk2pj.dyndns.org> To: Peter Jeremy Message-id: <4DFD0BBA.1010502@freebsd.org> X-Spam-Report: AuthenticatedSender=yes, SenderIP=75.50.89.112 X-Spam-PmxInfo: Server=avs-14, Version=5.6.0.2009776, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2011.6.18.202415, SenderIP=75.50.89.112 References: <201106152338.p5FNcFlN003175@svn.freebsd.org> <20110617231757.GA40286@server.vk2pj.dyndns.org> User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.17) Gecko/20110429 Thunderbird/3.1.10 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r223129 - head/release X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jun 2011 20:34:05 -0000 On 06/17/11 18:17, Peter Jeremy wrote: > On 2011-Jun-15 23:38:15 +0000, Nathan Whitehorn wrote: >> Log: >> Do not install the rescue tools onto the install CD. Since it is read >> only, they are very unlikely to be needed and take up a great deal of >> space. > If I've correctly understood this change, I'm not sure this is a > positive move. > > Based on a quick test, removing /rescue saves about 4MB (in reality, > the saving should be less because /rescue removes the need for > /stand). OTOH, it renders the install CD useless as a recovery > "fixit" disk - whilst the CD is unlikely to need recovery itself, it > was useful for recovering hard disks Since all of our install CDs for 9.0 (even the boot-only ones!) will be live CDs, the full versions of everything in /rescue are on the CD in their usual locations in /bin, /sbin, etc. and these can be used just as well for fixing a system as the /rescue tools. -Nathan From owner-svn-src-head@FreeBSD.ORG Sat Jun 18 20:48:38 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 401391065670; Sat, 18 Jun 2011 20:48:38 +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 D2C978FC18; Sat, 18 Jun 2011 20:48:37 +0000 (UTC) Received: from turtle.stack.nl (turtle.stack.nl [IPv6:2001:610:1108:5010::132]) by mx1.stack.nl (Postfix) with ESMTP id CAA00359411; Sat, 18 Jun 2011 22:48:36 +0200 (CEST) Received: by turtle.stack.nl (Postfix, from userid 1677) id B35161742A; Sat, 18 Jun 2011 22:48:36 +0200 (CEST) Date: Sat, 18 Jun 2011 22:48:36 +0200 From: Jilles Tjoelker To: Ben Laurie Message-ID: <20110618204836.GA46582@stack.nl> References: <201106181356.p5IDuXhW044171@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201106181356.p5IDuXhW044171@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r223262 - in head: cddl/contrib/opensolaris/lib/libdtrace/common contrib/binutils/bfd contrib/binutils/gas contrib/binutils/gas/config contrib/binutils/ld contrib/binutils/opcodes contr... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jun 2011 20:48:38 -0000 On Sat, Jun 18, 2011 at 01:56:33PM +0000, Ben Laurie wrote: > Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c > ============================================================================== > --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c Sat Jun 18 13:54:36 2011 (r223261) > +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c Sat Jun 18 13:56:33 2011 (r223262) > @@ -45,6 +45,7 @@ > #include > #include > #include > +#include > > #include > > @@ -811,15 +812,14 @@ dt_basename(char *str) > ulong_t > dt_popc(ulong_t x) > { > -#ifdef _ILP32 > +#if defined(_ILP32) > x = x - ((x >> 1) & 0x55555555UL); > x = (x & 0x33333333UL) + ((x >> 2) & 0x33333333UL); > x = (x + (x >> 4)) & 0x0F0F0F0FUL; > x = x + (x >> 8); > x = x + (x >> 16); > return (x & 0x3F); > -#endif > -#ifdef _LP64 > +#elif defined(_LP64) > x = x - ((x >> 1) & 0x5555555555555555ULL); > x = (x & 0x3333333333333333ULL) + ((x >> 2) & 0x3333333333333333ULL); > x = (x + (x >> 4)) & 0x0F0F0F0F0F0F0F0FULL; > @@ -827,6 +827,8 @@ dt_popc(ulong_t x) > x = x + (x >> 16); > x = x + (x >> 32); > return (x & 0x7F); > +#else > +# warning need td_popc() implementation > #endif > } This commit uncovers breakage that had been present for a while. If I compile this on stable/8 i386 for head i386, _ILP32 is not defined and the warning is hit, breaking the build. Apparently, the code had been broken for a while but I do not use dtrace so I would not have noticed. The tinderboxes have now also noticed the problem so it is not something weird about my system. -- Jilles Tjoelker From owner-svn-src-head@FreeBSD.ORG Sat Jun 18 21:08:27 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A7868106567D; Sat, 18 Jun 2011 21:08:27 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 97AC88FC14; Sat, 18 Jun 2011 21:08:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5IL8R1w057118; Sat, 18 Jun 2011 21:08:27 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5IL8RDk057116; Sat, 18 Jun 2011 21:08:27 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201106182108.p5IL8RDk057116@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 18 Jun 2011 21:08:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223267 - head/usr.sbin/mfiutil X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jun 2011 21:08:27 -0000 Author: bz Date: Sat Jun 18 21:08:27 2011 New Revision: 223267 URL: http://svn.freebsd.org/changeset/base/223267 Log: Add 'show logstate' to usage(). MFC after: 1 week Modified: head/usr.sbin/mfiutil/mfiutil.c Modified: head/usr.sbin/mfiutil/mfiutil.c ============================================================================== --- head/usr.sbin/mfiutil/mfiutil.c Sat Jun 18 19:58:09 2011 (r223266) +++ head/usr.sbin/mfiutil/mfiutil.c Sat Jun 18 21:08:27 2011 (r223267) @@ -58,6 +58,7 @@ usage(void) fprintf(stderr, " show drives - list physical drives\n"); fprintf(stderr, " show events - display event log\n"); fprintf(stderr, " show firmware - list firmware images\n"); + fprintf(stderr, " show logstate - display event log sequence numbers\n"); fprintf(stderr, " show volumes - list logical volumes\n"); fprintf(stderr, " show patrol - display patrol read status\n"); fprintf(stderr, " show progress - display status of active operations\n"); From owner-svn-src-head@FreeBSD.ORG Sat Jun 18 21:10:03 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B3FF91065670; Sat, 18 Jun 2011 21:10:03 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9E9348FC16; Sat, 18 Jun 2011 21:10:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5ILA3VO057206; Sat, 18 Jun 2011 21:10:03 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5ILA3cL057205; Sat, 18 Jun 2011 21:10:03 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201106182110.p5ILA3cL057205@svn.freebsd.org> From: Kirk McKusick Date: Sat, 18 Jun 2011 21:10:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223268 - head/sys/ufs/ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jun 2011 21:10:03 -0000 Author: mckusick Date: Sat Jun 18 21:10:03 2011 New Revision: 223268 URL: http://svn.freebsd.org/changeset/base/223268 Log: Fixed dereference of a NULL pointer. Reported by: Peter Holm Modified: head/sys/ufs/ffs/ffs_snapshot.c Modified: head/sys/ufs/ffs/ffs_snapshot.c ============================================================================== --- head/sys/ufs/ffs/ffs_snapshot.c Sat Jun 18 21:08:27 2011 (r223267) +++ head/sys/ufs/ffs/ffs_snapshot.c Sat Jun 18 21:10:03 2011 (r223268) @@ -1918,7 +1918,8 @@ retry: if (savedcbp) { vp = savedcbp->b_vp; bawrite(savedcbp); - if ((vtype == VDIR || dopersistence) && ip->i_effnlink > 0) + if ((vtype == VDIR || dopersistence) && + VTOI(vp)->i_effnlink > 0) (void) ffs_syncvnode(vp, MNT_WAIT); } /* From owner-svn-src-head@FreeBSD.ORG Sat Jun 18 21:29:26 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4ED8D1065672; Sat, 18 Jun 2011 21:29:26 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3EA648FC12; Sat, 18 Jun 2011 21:29:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5ILTQS7057803; Sat, 18 Jun 2011 21:29:26 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5ILTQOT057801; Sat, 18 Jun 2011 21:29:26 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201106182129.p5ILTQOT057801@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 18 Jun 2011 21:29:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223269 - head/lib/libprocstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jun 2011 21:29:26 -0000 Author: jilles Date: Sat Jun 18 21:29:25 2011 New Revision: 223269 URL: http://svn.freebsd.org/changeset/base/223269 Log: libprocstat: Correct format for size_t (should be %zu, not %zd). Modified: head/lib/libprocstat/libprocstat.c Modified: head/lib/libprocstat/libprocstat.c ============================================================================== --- head/lib/libprocstat/libprocstat.c Sat Jun 18 21:10:03 2011 (r223268) +++ head/lib/libprocstat/libprocstat.c Sat Jun 18 21:29:25 2011 (r223269) @@ -191,7 +191,7 @@ procstat_getprocs(struct procstat *procs len = *count * sizeof(*p); p = malloc(len); if (p == NULL) { - warnx("malloc(%zd)", len); + warnx("malloc(%zu)", len); goto fail; } bcopy(p0, p, len); @@ -213,7 +213,7 @@ procstat_getprocs(struct procstat *procs } p = malloc(len); if (p == NULL) { - warnx("malloc(%zd)", len); + warnx("malloc(%zu)", len); goto fail; } error = sysctl(name, 4, p, &len, NULL, 0); @@ -426,7 +426,7 @@ procstat_getfiles_kvm(struct procstat *p nfiles = filed.fd_lastfile + 1; ofiles = malloc(nfiles * sizeof(struct file *)); if (ofiles == NULL) { - warn("malloc(%zd)", nfiles * sizeof(struct file *)); + warn("malloc(%zu)", nfiles * sizeof(struct file *)); goto do_mmapped; } if (!kvm_read_all(kd, (unsigned long)filed.fd_ofiles, ofiles, From owner-svn-src-head@FreeBSD.ORG Sat Jun 18 21:46:11 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C9207106566B; Sat, 18 Jun 2011 21:46:11 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B8FE18FC0A; Sat, 18 Jun 2011 21:46:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5ILkBa2058327; Sat, 18 Jun 2011 21:46:11 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5ILkB6e058325; Sat, 18 Jun 2011 21:46:11 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201106182146.p5ILkB6e058325@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 18 Jun 2011 21:46:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223270 - head/lib/libprocstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jun 2011 21:46:11 -0000 Author: jilles Date: Sat Jun 18 21:46:11 2011 New Revision: 223270 URL: http://svn.freebsd.org/changeset/base/223270 Log: libprocstat: Remove spaces between function name and open parenthesis. Modified: head/lib/libprocstat/libprocstat.c Modified: head/lib/libprocstat/libprocstat.c ============================================================================== --- head/lib/libprocstat/libprocstat.c Sat Jun 18 21:29:25 2011 (r223269) +++ head/lib/libprocstat/libprocstat.c Sat Jun 18 21:46:11 2011 (r223270) @@ -271,11 +271,11 @@ procstat_freefiles(struct procstat *proc } free(head); if (procstat->vmentries != NULL) { - free (procstat->vmentries); + free(procstat->vmentries); procstat->vmentries = NULL; } if (procstat->files != NULL) { - free (procstat->files); + free(procstat->files); procstat->files = NULL; } } From owner-svn-src-head@FreeBSD.ORG Sat Jun 18 21:53:36 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76A051065673; Sat, 18 Jun 2011 21:53:36 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4FB8F8FC18; Sat, 18 Jun 2011 21:53:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5ILraHG058572; Sat, 18 Jun 2011 21:53:36 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5ILraiE058570; Sat, 18 Jun 2011 21:53:36 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201106182153.p5ILraiE058570@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 18 Jun 2011 21:53:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223271 - head/usr.bin/fstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jun 2011 21:53:36 -0000 Author: jilles Date: Sat Jun 18 21:53:36 2011 New Revision: 223271 URL: http://svn.freebsd.org/changeset/base/223271 Log: fuser: Fix skipping "SIG" on signal names (-s). The code did !strncasecmp(str, "sig", 4) which is not useful. Also change "sig" to "SIG" matching the uppercase signal names as of r218285. This has little effect because fuser does not enable locale. Modified: head/usr.bin/fstat/fuser.c Modified: head/usr.bin/fstat/fuser.c ============================================================================== --- head/usr.bin/fstat/fuser.c Sat Jun 18 21:46:11 2011 (r223270) +++ head/usr.bin/fstat/fuser.c Sat Jun 18 21:53:36 2011 (r223271) @@ -358,9 +358,8 @@ str2sig(const char *str) { int i; -#define SIGPREFIX "sig" - if (!strncasecmp(str, SIGPREFIX, sizeof(SIGPREFIX))) - str += sizeof(SIGPREFIX); + if (!strncasecmp(str, "SIG", 3)) + str += 3; for (i = 1; i < sys_nsig; i++) { if (!strcasecmp(sys_signame[i], str)) return (i); From owner-svn-src-head@FreeBSD.ORG Sat Jun 18 22:16:55 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CEDD91065670; Sat, 18 Jun 2011 22:16:55 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A543F8FC13; Sat, 18 Jun 2011 22:16:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5IMGt5N059518; Sat, 18 Jun 2011 22:16:55 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5IMGtaR059515; Sat, 18 Jun 2011 22:16:55 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201106182216.p5IMGtaR059515@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 18 Jun 2011 22:16:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223276 - head/lib/libprocstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jun 2011 22:16:55 -0000 Author: jilles Date: Sat Jun 18 22:16:55 2011 New Revision: 223276 URL: http://svn.freebsd.org/changeset/base/223276 Log: libprocstat: Fix typo in error messages. Modified: head/lib/libprocstat/libprocstat.c Modified: head/lib/libprocstat/libprocstat.c ============================================================================== --- head/lib/libprocstat/libprocstat.c Sat Jun 18 22:12:53 2011 (r223275) +++ head/lib/libprocstat/libprocstat.c Sat Jun 18 22:16:55 2011 (r223276) @@ -229,7 +229,7 @@ procstat_getprocs(struct procstat *procs *count = len / sizeof(*p); return (p); } else { - warnx("unknown access method"); + warnx("unknown access method: %d", procstat->type); return (NULL); } fail: @@ -726,7 +726,7 @@ procstat_get_pipe_info(struct procstat * } else if (procstat->type == PROCSTAT_SYSCTL) { return (procstat_get_pipe_info_sysctl(fst, ps, errbuf)); } else { - warnx("unknow access method: %d", procstat->type); + warnx("unknown access method: %d", procstat->type); snprintf(errbuf, _POSIX2_LINE_MAX, "error"); return (1); } @@ -790,7 +790,7 @@ procstat_get_pts_info(struct procstat *p } else if (procstat->type == PROCSTAT_SYSCTL) { return (procstat_get_pts_info_sysctl(fst, pts, errbuf)); } else { - warnx("unknow access method: %d", procstat->type); + warnx("unknown access method: %d", procstat->type); snprintf(errbuf, _POSIX2_LINE_MAX, "error"); return (1); } @@ -852,7 +852,7 @@ procstat_get_vnode_info(struct procstat } else if (procstat->type == PROCSTAT_SYSCTL) { return (procstat_get_vnode_info_sysctl(fst, vn, errbuf)); } else { - warnx("unknow access method: %d", procstat->type); + warnx("unknown access method: %d", procstat->type); snprintf(errbuf, _POSIX2_LINE_MAX, "error"); return (1); } @@ -1059,7 +1059,7 @@ procstat_get_socket_info(struct procstat } else if (procstat->type == PROCSTAT_SYSCTL) { return (procstat_get_socket_info_sysctl(fst, sock, errbuf)); } else { - warnx("unknow access method: %d", procstat->type); + warnx("unknown access method: %d", procstat->type); snprintf(errbuf, _POSIX2_LINE_MAX, "error"); return (1); } From owner-svn-src-head@FreeBSD.ORG Sat Jun 18 22:26:58 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D376F106564A; Sat, 18 Jun 2011 22:26:58 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C34FC8FC14; Sat, 18 Jun 2011 22:26:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5IMQwJJ059849; Sat, 18 Jun 2011 22:26:58 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5IMQwoV059847; Sat, 18 Jun 2011 22:26:58 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201106182226.p5IMQwoV059847@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 18 Jun 2011 22:26:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223277 - head/sys/cam/ata X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jun 2011 22:26:58 -0000 Author: kib Date: Sat Jun 18 22:26:58 2011 New Revision: 223277 URL: http://svn.freebsd.org/changeset/base/223277 Log: Fix a typo in adagetattr() from r223089. In particular, this restores the ability to use ahci(4) for kernel dumps. Modified: head/sys/cam/ata/ata_da.c Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Sat Jun 18 22:16:55 2011 (r223276) +++ head/sys/cam/ata/ata_da.c Sat Jun 18 22:26:58 2011 (r223277) @@ -818,7 +818,7 @@ adagetattr(struct bio *bp) int ret = -1; struct cam_periph *periph; - if (bp->bio_disk == NULL || bp->bio_disk->d_drv1) + if (bp->bio_disk == NULL || bp->bio_disk->d_drv1 == NULL) return ENXIO; periph = (struct cam_periph *)bp->bio_disk->d_drv1; if (periph->path == NULL) From owner-svn-src-head@FreeBSD.ORG Sat Jun 18 22:32:56 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C03A1065688; Sat, 18 Jun 2011 22:32:56 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 430DD8FC17; Sat, 18 Jun 2011 22:32:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5IMWuA0060055; Sat, 18 Jun 2011 22:32:56 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5IMWu87060053; Sat, 18 Jun 2011 22:32:56 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201106182232.p5IMWu87060053@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 18 Jun 2011 22:32:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223278 - head/sbin/ddb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jun 2011 22:32:56 -0000 Author: pjd Date: Sat Jun 18 22:32:55 2011 New Revision: 223278 URL: http://svn.freebsd.org/changeset/base/223278 Log: Correct subcommand name 'unset' -> 'unscript'. Modified: head/sbin/ddb/ddb.8 Modified: head/sbin/ddb/ddb.8 ============================================================================== --- head/sbin/ddb/ddb.8 Sat Jun 18 22:26:58 2011 (r223277) +++ head/sbin/ddb/ddb.8 Sat Jun 18 22:32:55 2011 (r223278) @@ -126,7 +126,7 @@ it is advisable to enclose in quotes. .It Cm scripts List currently defined scripts. -.It Cm unset Ar scriptname +.It Cm unscript Ar scriptname Delete the script named .Ar scriptname . .El From owner-svn-src-head@FreeBSD.ORG Sat Jun 18 23:01:26 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9CA59106566C; Sat, 18 Jun 2011 23:01:26 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8C1968FC0C; Sat, 18 Jun 2011 23:01:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5IN1Q82062310; Sat, 18 Jun 2011 23:01:26 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5IN1QQY062308; Sat, 18 Jun 2011 23:01:26 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201106182301.p5IN1QQY062308@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 18 Jun 2011 23:01:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223279 - head/lib/libprocstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jun 2011 23:01:26 -0000 Author: jilles Date: Sat Jun 18 23:01:26 2011 New Revision: 223279 URL: http://svn.freebsd.org/changeset/base/223279 Log: libprocstat: For MAP_PRIVATE, do not consider the file open for writing. If a file is mapped with with MAP_PRIVATE, no write permission is required and changes do not end up in the file. Therefore, tools like fuser and fstat should not show the file as open for writing. The protection as displayed by procstat -v still includes write in this case, and shows 'C' for copy-on-write. Modified: head/lib/libprocstat/libprocstat.c Modified: head/lib/libprocstat/libprocstat.c ============================================================================== --- head/lib/libprocstat/libprocstat.c Sat Jun 18 22:32:55 2011 (r223278) +++ head/lib/libprocstat/libprocstat.c Sat Jun 18 23:01:26 2011 (r223279) @@ -522,7 +522,8 @@ do_mmapped: fflags = 0; if (prot & VM_PROT_READ) fflags = PS_FST_FFLAG_READ; - if (prot & VM_PROT_WRITE) + if ((vmentry.eflags & MAP_ENTRY_COW) == 0 && + prot & VM_PROT_WRITE) fflags |= PS_FST_FFLAG_WRITE; /* @@ -696,7 +697,8 @@ procstat_getfiles_sysctl(struct procstat fflags = 0; if (kve->kve_protection & KVME_PROT_READ) fflags = PS_FST_FFLAG_READ; - if (kve->kve_protection & KVME_PROT_WRITE) + if ((kve->kve_flags & KVME_FLAG_COW) == 0 && + kve->kve_protection & KVME_PROT_WRITE) fflags |= PS_FST_FFLAG_WRITE; offset = kve->kve_offset; refcount = kve->kve_ref_count; From owner-svn-src-head@FreeBSD.ORG Sat Jun 18 23:02:53 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C1B4D1065674; Sat, 18 Jun 2011 23:02:53 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AE6E98FC08; Sat, 18 Jun 2011 23:02:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5IN2rOg062567; Sat, 18 Jun 2011 23:02:53 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5IN2rWH062556; Sat, 18 Jun 2011 23:02:53 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201106182302.p5IN2rWH062556@svn.freebsd.org> From: Rick Macklem Date: Sat, 18 Jun 2011 23:02:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223280 - in head/sys: fs/nfs fs/nfsclient modules/dtrace modules/dtrace/dtnfscl modules/dtrace/dtraceall sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jun 2011 23:02:53 -0000 Author: rmacklem Date: Sat Jun 18 23:02:53 2011 New Revision: 223280 URL: http://svn.freebsd.org/changeset/base/223280 Log: Add DTrace support to the new NFS client. This is essentially cloned from the old NFS client, plus additions for NFSv4. A review of this code is in progress, however it was felt by the reviewer that it could go in now, before code slush. Any changes required by the review can be committed as bug fixes later. Added: head/sys/fs/nfsclient/nfs_clkdtrace.c (contents, props changed) head/sys/fs/nfsclient/nfs_kdtrace.h (contents, props changed) head/sys/modules/dtrace/dtnfscl/ head/sys/modules/dtrace/dtnfscl/Makefile (contents, props changed) Modified: head/sys/fs/nfs/nfs_commonkrpc.c head/sys/fs/nfs/nfsport.h head/sys/fs/nfs/nfsproto.h head/sys/fs/nfsclient/nfs_clbio.c head/sys/fs/nfsclient/nfs_clnode.c head/sys/fs/nfsclient/nfs_clport.c head/sys/fs/nfsclient/nfs_clsubs.c head/sys/fs/nfsclient/nfs_clvnops.c head/sys/modules/dtrace/Makefile head/sys/modules/dtrace/dtraceall/dtraceall.c head/sys/sys/dtrace_bsd.h Modified: head/sys/fs/nfs/nfs_commonkrpc.c ============================================================================== --- head/sys/fs/nfs/nfs_commonkrpc.c Sat Jun 18 23:01:26 2011 (r223279) +++ head/sys/fs/nfs/nfs_commonkrpc.c Sat Jun 18 23:02:53 2011 (r223280) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); */ #include "opt_inet6.h" +#include "opt_kdtrace.h" #include "opt_kgssapi.h" #include "opt_nfs.h" @@ -64,6 +65,28 @@ __FBSDID("$FreeBSD$"); #include +#ifdef KDTRACE_HOOKS +#include + +dtrace_nfsclient_nfs23_start_probe_func_t + dtrace_nfscl_nfs234_start_probe; + +dtrace_nfsclient_nfs23_done_probe_func_t + dtrace_nfscl_nfs234_done_probe; + +/* + * Registered probes by RPC type. + */ +uint32_t nfscl_nfs2_start_probes[NFS_NPROCS + 1]; +uint32_t nfscl_nfs2_done_probes[NFS_NPROCS + 1]; + +uint32_t nfscl_nfs3_start_probes[NFS_NPROCS + 1]; +uint32_t nfscl_nfs3_done_probes[NFS_NPROCS + 1]; + +uint32_t nfscl_nfs4_start_probes[NFS_NPROCS + 1]; +uint32_t nfscl_nfs4_done_probes[NFS_NPROCS + 1]; +#endif + NFSSTATESPINLOCK; NFSREQSPINLOCK; extern struct nfsstats newnfsstats; @@ -568,6 +591,29 @@ newnfs_request(struct nfsrv_descript *nd if ((nd->nd_flag & ND_NFSV4) && procnum == NFSV4PROC_COMPOUND) MALLOC(rep, struct nfsreq *, sizeof(struct nfsreq), M_NFSDREQ, M_WAITOK); +#ifdef KDTRACE_HOOKS + if (dtrace_nfscl_nfs234_start_probe != NULL) { + uint32_t probe_id; + int probe_procnum; + + if (nd->nd_flag & ND_NFSV4) { + probe_id = + nfscl_nfs4_start_probes[nd->nd_procnum]; + probe_procnum = nd->nd_procnum; + } else if (nd->nd_flag & ND_NFSV3) { + probe_id = nfscl_nfs3_start_probes[procnum]; + probe_procnum = procnum; + } else { + probe_id = + nfscl_nfs2_start_probes[nd->nd_procnum]; + probe_procnum = procnum; + } + if (probe_id != 0) + (dtrace_nfscl_nfs234_start_probe) + (probe_id, vp, nd->nd_mreq, cred, + probe_procnum); + } +#endif } trycnt = 0; tryagain: @@ -762,6 +808,27 @@ tryagain: } } +#ifdef KDTRACE_HOOKS + if (nmp != NULL && dtrace_nfscl_nfs234_done_probe != NULL) { + uint32_t probe_id; + int probe_procnum; + + if (nd->nd_flag & ND_NFSV4) { + probe_id = nfscl_nfs4_done_probes[nd->nd_procnum]; + probe_procnum = nd->nd_procnum; + } else if (nd->nd_flag & ND_NFSV3) { + probe_id = nfscl_nfs3_done_probes[procnum]; + probe_procnum = procnum; + } else { + probe_id = nfscl_nfs2_done_probes[nd->nd_procnum]; + probe_procnum = procnum; + } + if (probe_id != 0) + (dtrace_nfscl_nfs234_done_probe)(probe_id, vp, + nd->nd_mreq, cred, probe_procnum, 0); + } +#endif + m_freem(nd->nd_mreq); AUTH_DESTROY(auth); if (rep != NULL) Modified: head/sys/fs/nfs/nfsport.h ============================================================================== --- head/sys/fs/nfs/nfsport.h Sat Jun 18 23:01:26 2011 (r223279) +++ head/sys/fs/nfs/nfsport.h Sat Jun 18 23:02:53 2011 (r223280) @@ -267,6 +267,7 @@ * NFS_V3NPROCS is one greater than the last V3 op and NFS_NPROCS is * one greater than the last number. */ +#ifndef NFS_V3NPROCS #define NFS_V3NPROCS 22 #define NFSPROC_LOOKUPP 22 @@ -293,6 +294,7 @@ * Must be defined as one higher than the last Proc# above. */ #define NFSV4_NPROCS 41 +#endif /* NFS_V3NPROCS */ /* * Stats structure @@ -358,7 +360,9 @@ struct ext_nfsstats { /* * Define NFS_NPROCS as NFSV4_NPROCS for the experimental kernel code. */ +#ifndef NFS_NPROCS #define NFS_NPROCS NFSV4_NPROCS +#endif #include #include Modified: head/sys/fs/nfs/nfsproto.h ============================================================================== --- head/sys/fs/nfs/nfsproto.h Sat Jun 18 23:01:26 2011 (r223279) +++ head/sys/fs/nfs/nfsproto.h Sat Jun 18 23:02:53 2011 (r223280) @@ -226,6 +226,48 @@ #define NFSPROC_COMMIT 21 /* + * The lower numbers -> 21 are used by NFSv2 and v3. These define higher + * numbers used by NFSv4. + * NFS_V3NPROCS is one greater than the last V3 op and NFS_NPROCS is + * one greater than the last number. + */ +#ifndef NFS_V3NPROCS +#define NFS_V3NPROCS 22 + +#define NFSPROC_LOOKUPP 22 +#define NFSPROC_SETCLIENTID 23 +#define NFSPROC_SETCLIENTIDCFRM 24 +#define NFSPROC_LOCK 25 +#define NFSPROC_LOCKU 26 +#define NFSPROC_OPEN 27 +#define NFSPROC_CLOSE 28 +#define NFSPROC_OPENCONFIRM 29 +#define NFSPROC_LOCKT 30 +#define NFSPROC_OPENDOWNGRADE 31 +#define NFSPROC_RENEW 32 +#define NFSPROC_PUTROOTFH 33 +#define NFSPROC_RELEASELCKOWN 34 +#define NFSPROC_DELEGRETURN 35 +#define NFSPROC_RETDELEGREMOVE 36 +#define NFSPROC_RETDELEGRENAME1 37 +#define NFSPROC_RETDELEGRENAME2 38 +#define NFSPROC_GETACL 39 +#define NFSPROC_SETACL 40 + +/* + * Must be defined as one higher than the last Proc# above. + */ +#define NFSV4_NPROCS 41 +#endif /* NFS_V3NPROCS */ + +/* + * Define NFS_NPROCS as NFSV4_NPROCS for the experimental kernel code. + */ +#ifndef NFS_NPROCS +#define NFS_NPROCS NFSV4_NPROCS +#endif + +/* * NFSPROC_NOOP is a fake op# that can't be the same as any V2/3/4 Procedure * or Operation#. Since the NFS V4 Op #s go higher, use NFSV4OP_NOPS, which * is one greater than the highest Op#. Modified: head/sys/fs/nfsclient/nfs_clbio.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clbio.c Sat Jun 18 23:01:26 2011 (r223279) +++ head/sys/fs/nfsclient/nfs_clbio.c Sat Jun 18 23:02:53 2011 (r223280) @@ -35,6 +35,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_kdtrace.h" + #include #include #include @@ -55,6 +57,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include extern int newnfs_directio_allow_mmap; extern struct nfsstats newnfsstats; @@ -399,6 +402,7 @@ nfs_bioread_check_cons(struct vnode *vp, goto out; } np->n_attrstamp = 0; + KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp); error = VOP_GETATTR(vp, &vattr, cred); if (error) goto out; @@ -915,6 +919,7 @@ ncl_write(struct vop_write_args *ap) #endif flush_and_restart: np->n_attrstamp = 0; + KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp); error = ncl_vinvalbuf(vp, V_SAVE, td, 1); if (error) return (error); @@ -928,6 +933,7 @@ flush_and_restart: */ if (ioflag & IO_APPEND) { np->n_attrstamp = 0; + KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp); error = VOP_GETATTR(vp, &vattr, cred); if (error) return (error); @@ -1748,6 +1754,7 @@ ncl_doio(struct vnode *vp, struct buf *b mtx_lock(&np->n_mtx); np->n_flag |= NWRITEERR; np->n_attrstamp = 0; + KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp); mtx_unlock(&np->n_mtx); } bp->b_dirtyoff = bp->b_dirtyend = 0; Added: head/sys/fs/nfsclient/nfs_clkdtrace.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/fs/nfsclient/nfs_clkdtrace.c Sat Jun 18 23:02:53 2011 (r223280) @@ -0,0 +1,600 @@ +/*- + * Copyright (c) 2009 Robert N. M. Watson + * All rights reserved. + * + * This software was developed at the University of Cambridge Computer + * Laboratory with support from a grant from Google, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include + +/* + * dtnfscl is a DTrace provider that tracks the intent to perform RPCs + * in the NFS client, as well as acess to and maintenance of the access and + * attribute caches. This is not quite the same as RPCs, because NFS may + * issue multiple RPC transactions in the event that authentication fails, + * there's a jukebox error, or none at all if the access or attribute cache + * hits. However, it cleanly represents the logical layer between RPC + * transmission and vnode/vfs operations, providing access to state linking + * the two. + */ + +static int dtnfsclient_unload(void); +static void dtnfsclient_getargdesc(void *, dtrace_id_t, void *, + dtrace_argdesc_t *); +static void dtnfsclient_provide(void *, dtrace_probedesc_t *); +static void dtnfsclient_destroy(void *, dtrace_id_t, void *); +static void dtnfsclient_enable(void *, dtrace_id_t, void *); +static void dtnfsclient_disable(void *, dtrace_id_t, void *); +static void dtnfsclient_load(void *); + +static dtrace_pattr_t dtnfsclient_attr = { +{ DTRACE_STABILITY_STABLE, DTRACE_STABILITY_STABLE, DTRACE_CLASS_COMMON }, +{ DTRACE_STABILITY_PRIVATE, DTRACE_STABILITY_PRIVATE, DTRACE_CLASS_UNKNOWN }, +{ DTRACE_STABILITY_PRIVATE, DTRACE_STABILITY_PRIVATE, DTRACE_CLASS_UNKNOWN }, +{ DTRACE_STABILITY_STABLE, DTRACE_STABILITY_STABLE, DTRACE_CLASS_COMMON }, +{ DTRACE_STABILITY_STABLE, DTRACE_STABILITY_STABLE, DTRACE_CLASS_COMMON }, +}; + +/* + * Description of NFSv4, NFSv3 and (optional) NFSv2 probes for a procedure. + */ +struct dtnfsclient_rpc { + char *nr_v4_name; + char *nr_v3_name; /* Or NULL if none. */ + char *nr_v2_name; /* Or NULL if none. */ + + /* + * IDs for the start and done cases, for NFSv2, NFSv3 and NFSv4. + */ + uint32_t nr_v2_id_start, nr_v2_id_done; + uint32_t nr_v3_id_start, nr_v3_id_done; + uint32_t nr_v4_id_start, nr_v4_id_done; +}; + +/* + * This table is indexed by NFSv3 procedure number, but also used for NFSv2 + * procedure names and NFSv4 operations. + */ +static struct dtnfsclient_rpc dtnfsclient_rpcs[NFS_NPROCS + 1] = { + { "null", "null", "null" }, + { "getattr", "getattr", "getattr" }, + { "setattr", "setattr", "setattr" }, + { "lookup", "lookup", "lookup" }, + { "access", "access", "noop" }, + { "readlink", "readlink", "readlink" }, + { "read", "read", "read" }, + { "write", "write", "write" }, + { "create", "create", "create" }, + { "mkdir", "mkdir", "mkdir" }, + { "symlink", "symlink", "symlink" }, + { "mknod", "mknod" }, + { "remove", "remove", "remove" }, + { "rmdir", "rmdir", "rmdir" }, + { "rename", "rename", "rename" }, + { "link", "link", "link" }, + { "readdir", "readdir", "readdir" }, + { "readdirplus", "readdirplus" }, + { "fsstat", "fsstat", "statfs" }, + { "fsinfo", "fsinfo" }, + { "pathconf", "pathconf" }, + { "commit", "commit" }, + { "lookupp" }, + { "setclientid" }, + { "setclientidcfrm" }, + { "lock" }, + { "locku" }, + { "open" }, + { "close" }, + { "openconfirm" }, + { "lockt" }, + { "opendowngrade" }, + { "renew" }, + { "putrootfh" }, + { "releaselckown" }, + { "delegreturn" }, + { "retdelegremove" }, + { "retdelegrename1" }, + { "retdelegrename2" }, + { "getacl" }, + { "setacl" }, + { "noop", "noop", "noop" } +}; + +/* + * Module name strings. + */ +static char *dtnfsclient_accesscache_str = "accesscache"; +static char *dtnfsclient_attrcache_str = "attrcache"; +static char *dtnfsclient_nfs2_str = "nfs2"; +static char *dtnfsclient_nfs3_str = "nfs3"; +static char *dtnfsclient_nfs4_str = "nfs4"; + +/* + * Function name strings. + */ +static char *dtnfsclient_flush_str = "flush"; +static char *dtnfsclient_load_str = "load"; +static char *dtnfsclient_get_str = "get"; + +/* + * Name strings. + */ +static char *dtnfsclient_done_str = "done"; +static char *dtnfsclient_hit_str = "hit"; +static char *dtnfsclient_miss_str = "miss"; +static char *dtnfsclient_start_str = "start"; + +static dtrace_pops_t dtnfsclient_pops = { + dtnfsclient_provide, + NULL, + dtnfsclient_enable, + dtnfsclient_disable, + NULL, + NULL, + dtnfsclient_getargdesc, + NULL, + NULL, + dtnfsclient_destroy +}; + +static dtrace_provider_id_t dtnfsclient_id; + +/* + * Most probes are generated from the above RPC table, but for access and + * attribute caches, we have specific IDs we recognize and handle specially + * in various spots. + */ +extern uint32_t nfscl_accesscache_flush_done_id; +extern uint32_t nfscl_accesscache_get_hit_id; +extern uint32_t nfscl_accesscache_get_miss_id; +extern uint32_t nfscl_accesscache_load_done_id; + +extern uint32_t nfscl_attrcache_flush_done_id; +extern uint32_t nfscl_attrcache_get_hit_id; +extern uint32_t nfscl_attrcache_get_miss_id; +extern uint32_t nfscl_attrcache_load_done_id; + +/* + * When tracing on a procedure is enabled, the DTrace ID for an RPC event is + * stored in one of these two NFS client-allocated arrays; 0 indicates that + * the event is not being traced so probes should not be called. + * + * For simplicity, we allocate both v2, v3 and v4 arrays as NFS_NPROCS + 1, and + * the v2, v3 arrays are simply sparse. + */ +extern uint32_t nfscl_nfs2_start_probes[NFS_NPROCS + 1]; +extern uint32_t nfscl_nfs2_done_probes[NFS_NPROCS + 1]; + +extern uint32_t nfscl_nfs3_start_probes[NFS_NPROCS + 1]; +extern uint32_t nfscl_nfs3_done_probes[NFS_NPROCS + 1]; + +extern uint32_t nfscl_nfs4_start_probes[NFS_NPROCS + 1]; +extern uint32_t nfscl_nfs4_done_probes[NFS_NPROCS + 1]; + +/* + * Look up a DTrace probe ID to see if it's associated with a "done" event -- + * if so, we will return a fourth argument type of "int". + */ +static int +dtnfs234_isdoneprobe(dtrace_id_t id) +{ + int i; + + for (i = 0; i < NFS_NPROCS + 1; i++) { + if (dtnfsclient_rpcs[i].nr_v4_id_done == id || + dtnfsclient_rpcs[i].nr_v3_id_done == id || + dtnfsclient_rpcs[i].nr_v2_id_done == id) + return (1); + } + return (0); +} + +static void +dtnfsclient_getargdesc(void *arg, dtrace_id_t id, void *parg, + dtrace_argdesc_t *desc) +{ + const char *p = NULL; + + if (id == nfscl_accesscache_flush_done_id || + id == nfscl_attrcache_flush_done_id || + id == nfscl_attrcache_get_miss_id) { + switch (desc->dtargd_ndx) { + case 0: + p = "struct vnode *"; + break; + default: + desc->dtargd_ndx = DTRACE_ARGNONE; + break; + } + } else if (id == nfscl_accesscache_get_hit_id || + id == nfscl_accesscache_get_miss_id) { + switch (desc->dtargd_ndx) { + case 0: + p = "struct vnode *"; + break; + case 1: + p = "uid_t"; + break; + case 2: + p = "uint32_t"; + break; + default: + desc->dtargd_ndx = DTRACE_ARGNONE; + break; + } + } else if (id == nfscl_accesscache_load_done_id) { + switch (desc->dtargd_ndx) { + case 0: + p = "struct vnode *"; + break; + case 1: + p = "uid_t"; + break; + case 2: + p = "uint32_t"; + break; + case 3: + p = "int"; + break; + default: + desc->dtargd_ndx = DTRACE_ARGNONE; + break; + } + } else if (id == nfscl_attrcache_get_hit_id) { + switch (desc->dtargd_ndx) { + case 0: + p = "struct vnode *"; + break; + case 1: + p = "struct vattr *"; + break; + default: + desc->dtargd_ndx = DTRACE_ARGNONE; + break; + } + } else if (id == nfscl_attrcache_load_done_id) { + switch (desc->dtargd_ndx) { + case 0: + p = "struct vnode *"; + break; + case 1: + p = "struct vattr *"; + break; + case 2: + p = "int"; + break; + default: + desc->dtargd_ndx = DTRACE_ARGNONE; + break; + } + } else { + switch (desc->dtargd_ndx) { + case 0: + p = "struct vnode *"; + break; + case 1: + p = "struct mbuf *"; + break; + case 2: + p = "struct ucred *"; + break; + case 3: + p = "int"; + break; + case 4: + if (dtnfs234_isdoneprobe(id)) { + p = "int"; + break; + } + /* FALLSTHROUGH */ + default: + desc->dtargd_ndx = DTRACE_ARGNONE; + break; + } + } + if (p != NULL) + strlcpy(desc->dtargd_native, p, sizeof(desc->dtargd_native)); +} + +static void +dtnfsclient_provide(void *arg, dtrace_probedesc_t *desc) +{ + int i; + + if (desc != NULL) + return; + + /* + * Register access cache probes. + */ + if (dtrace_probe_lookup(dtnfsclient_id, dtnfsclient_accesscache_str, + dtnfsclient_flush_str, dtnfsclient_done_str) == 0) { + nfscl_accesscache_flush_done_id = dtrace_probe_create( + dtnfsclient_id, dtnfsclient_accesscache_str, + dtnfsclient_flush_str, dtnfsclient_done_str, 0, NULL); + } + if (dtrace_probe_lookup(dtnfsclient_id, dtnfsclient_accesscache_str, + dtnfsclient_get_str, dtnfsclient_hit_str) == 0) { + nfscl_accesscache_get_hit_id = dtrace_probe_create( + dtnfsclient_id, dtnfsclient_accesscache_str, + dtnfsclient_get_str, dtnfsclient_hit_str, 0, NULL); + } + if (dtrace_probe_lookup(dtnfsclient_id, dtnfsclient_accesscache_str, + dtnfsclient_get_str, dtnfsclient_miss_str) == 0) { + nfscl_accesscache_get_miss_id = dtrace_probe_create( + dtnfsclient_id, dtnfsclient_accesscache_str, + dtnfsclient_get_str, dtnfsclient_miss_str, 0, NULL); + } + if (dtrace_probe_lookup(dtnfsclient_id, dtnfsclient_accesscache_str, + dtnfsclient_load_str, dtnfsclient_done_str) == 0) { + nfscl_accesscache_load_done_id = dtrace_probe_create( + dtnfsclient_id, dtnfsclient_accesscache_str, + dtnfsclient_load_str, dtnfsclient_done_str, 0, NULL); + } + + /* + * Register attribute cache probes. + */ + if (dtrace_probe_lookup(dtnfsclient_id, dtnfsclient_attrcache_str, + dtnfsclient_flush_str, dtnfsclient_done_str) == 0) { + nfscl_attrcache_flush_done_id = dtrace_probe_create( + dtnfsclient_id, dtnfsclient_attrcache_str, + dtnfsclient_flush_str, dtnfsclient_done_str, 0, NULL); + } + if (dtrace_probe_lookup(dtnfsclient_id, dtnfsclient_attrcache_str, + dtnfsclient_get_str, dtnfsclient_hit_str) == 0) { + nfscl_attrcache_get_hit_id = dtrace_probe_create( + dtnfsclient_id, dtnfsclient_attrcache_str, + dtnfsclient_get_str, dtnfsclient_hit_str, 0, NULL); + } + if (dtrace_probe_lookup(dtnfsclient_id, dtnfsclient_attrcache_str, + dtnfsclient_get_str, dtnfsclient_miss_str) == 0) { + nfscl_attrcache_get_miss_id = dtrace_probe_create( + dtnfsclient_id, dtnfsclient_attrcache_str, + dtnfsclient_get_str, dtnfsclient_miss_str, 0, NULL); + } + if (dtrace_probe_lookup(dtnfsclient_id, dtnfsclient_attrcache_str, + dtnfsclient_load_str, dtnfsclient_done_str) == 0) { + nfscl_attrcache_load_done_id = dtrace_probe_create( + dtnfsclient_id, dtnfsclient_attrcache_str, + dtnfsclient_load_str, dtnfsclient_done_str, 0, NULL); + } + + /* + * Register NFSv2 RPC procedures; note sparseness check for each slot + * in the NFSv3, NFSv4 procnum-indexed array. + */ + for (i = 0; i < NFS_NPROCS + 1; i++) { + if (dtnfsclient_rpcs[i].nr_v2_name != NULL && + dtrace_probe_lookup(dtnfsclient_id, dtnfsclient_nfs2_str, + dtnfsclient_rpcs[i].nr_v2_name, dtnfsclient_start_str) == + 0) { + dtnfsclient_rpcs[i].nr_v2_id_start = + dtrace_probe_create(dtnfsclient_id, + dtnfsclient_nfs2_str, + dtnfsclient_rpcs[i].nr_v2_name, + dtnfsclient_start_str, 0, + &nfscl_nfs2_start_probes[i]); + } + if (dtnfsclient_rpcs[i].nr_v2_name != NULL && + dtrace_probe_lookup(dtnfsclient_id, dtnfsclient_nfs2_str, + dtnfsclient_rpcs[i].nr_v2_name, dtnfsclient_done_str) == + 0) { + dtnfsclient_rpcs[i].nr_v2_id_done = + dtrace_probe_create(dtnfsclient_id, + dtnfsclient_nfs2_str, + dtnfsclient_rpcs[i].nr_v2_name, + dtnfsclient_done_str, 0, + &nfscl_nfs2_done_probes[i]); + } + } + + /* + * Register NFSv3 RPC procedures; note sparseness check for each slot + * in the NFSv4 procnum-indexed array. + */ + for (i = 0; i < NFS_NPROCS + 1; i++) { + if (dtnfsclient_rpcs[i].nr_v3_name != NULL && + dtrace_probe_lookup(dtnfsclient_id, dtnfsclient_nfs3_str, + dtnfsclient_rpcs[i].nr_v3_name, dtnfsclient_start_str) == + 0) { + dtnfsclient_rpcs[i].nr_v3_id_start = + dtrace_probe_create(dtnfsclient_id, + dtnfsclient_nfs3_str, + dtnfsclient_rpcs[i].nr_v3_name, + dtnfsclient_start_str, 0, + &nfscl_nfs3_start_probes[i]); + } + if (dtnfsclient_rpcs[i].nr_v3_name != NULL && + dtrace_probe_lookup(dtnfsclient_id, dtnfsclient_nfs3_str, + dtnfsclient_rpcs[i].nr_v3_name, dtnfsclient_done_str) == + 0) { + dtnfsclient_rpcs[i].nr_v3_id_done = + dtrace_probe_create(dtnfsclient_id, + dtnfsclient_nfs3_str, + dtnfsclient_rpcs[i].nr_v3_name, + dtnfsclient_done_str, 0, + &nfscl_nfs3_done_probes[i]); + } + } + + /* + * Register NFSv4 RPC procedures. + */ + for (i = 0; i < NFS_NPROCS + 1; i++) { + if (dtrace_probe_lookup(dtnfsclient_id, dtnfsclient_nfs4_str, + dtnfsclient_rpcs[i].nr_v4_name, dtnfsclient_start_str) == + 0) { + dtnfsclient_rpcs[i].nr_v4_id_start = + dtrace_probe_create(dtnfsclient_id, + dtnfsclient_nfs4_str, + dtnfsclient_rpcs[i].nr_v4_name, + dtnfsclient_start_str, 0, + &nfscl_nfs4_start_probes[i]); + } + if (dtrace_probe_lookup(dtnfsclient_id, dtnfsclient_nfs4_str, + dtnfsclient_rpcs[i].nr_v4_name, dtnfsclient_done_str) == + 0) { + dtnfsclient_rpcs[i].nr_v4_id_done = + dtrace_probe_create(dtnfsclient_id, + dtnfsclient_nfs4_str, + dtnfsclient_rpcs[i].nr_v4_name, + dtnfsclient_done_str, 0, + &nfscl_nfs4_done_probes[i]); + } + } +} + +static void +dtnfsclient_destroy(void *arg, dtrace_id_t id, void *parg) +{ +} + +static void +dtnfsclient_enable(void *arg, dtrace_id_t id, void *parg) +{ + uint32_t *p = parg; + void *f = dtrace_probe; + + if (id == nfscl_accesscache_flush_done_id) + dtrace_nfscl_accesscache_flush_done_probe = f; + else if (id == nfscl_accesscache_get_hit_id) + dtrace_nfscl_accesscache_get_hit_probe = f; + else if (id == nfscl_accesscache_get_miss_id) + dtrace_nfscl_accesscache_get_miss_probe = f; + else if (id == nfscl_accesscache_load_done_id) + dtrace_nfscl_accesscache_load_done_probe = f; + else if (id == nfscl_attrcache_flush_done_id) + dtrace_nfscl_attrcache_flush_done_probe = f; + else if (id == nfscl_attrcache_get_hit_id) + dtrace_nfscl_attrcache_get_hit_probe = f; + else if (id == nfscl_attrcache_get_miss_id) + dtrace_nfscl_attrcache_get_miss_probe = f; + else if (id == nfscl_attrcache_load_done_id) + dtrace_nfscl_attrcache_load_done_probe = f; + else + *p = id; +} + +static void +dtnfsclient_disable(void *arg, dtrace_id_t id, void *parg) +{ + uint32_t *p = parg; + + if (id == nfscl_accesscache_flush_done_id) + dtrace_nfscl_accesscache_flush_done_probe = NULL; + else if (id == nfscl_accesscache_get_hit_id) + dtrace_nfscl_accesscache_get_hit_probe = NULL; + else if (id == nfscl_accesscache_get_miss_id) + dtrace_nfscl_accesscache_get_miss_probe = NULL; + else if (id == nfscl_accesscache_load_done_id) + dtrace_nfscl_accesscache_load_done_probe = NULL; + else if (id == nfscl_attrcache_flush_done_id) + dtrace_nfscl_attrcache_flush_done_probe = NULL; + else if (id == nfscl_attrcache_get_hit_id) + dtrace_nfscl_attrcache_get_hit_probe = NULL; + else if (id == nfscl_attrcache_get_miss_id) + dtrace_nfscl_attrcache_get_miss_probe = NULL; + else if (id == nfscl_attrcache_load_done_id) + dtrace_nfscl_attrcache_load_done_probe = NULL; + else + *p = 0; +} + +static void +dtnfsclient_load(void *dummy) +{ + + if (dtrace_register("nfscl", &dtnfsclient_attr, + DTRACE_PRIV_USER, NULL, &dtnfsclient_pops, NULL, + &dtnfsclient_id) != 0) + return; + + dtrace_nfscl_nfs234_start_probe = + (dtrace_nfsclient_nfs23_start_probe_func_t)dtrace_probe; + dtrace_nfscl_nfs234_done_probe = + (dtrace_nfsclient_nfs23_done_probe_func_t)dtrace_probe; +} + + +static int +dtnfsclient_unload() +{ + + dtrace_nfscl_nfs234_start_probe = NULL; + dtrace_nfscl_nfs234_done_probe = NULL; + + return (dtrace_unregister(dtnfsclient_id)); +} + +static int +dtnfsclient_modevent(module_t mod __unused, int type, void *data __unused) +{ + int error = 0; + + switch (type) { + case MOD_LOAD: + break; + + case MOD_UNLOAD: + break; + + case MOD_SHUTDOWN: + break; + + default: + error = EOPNOTSUPP; + break; + } + + return (error); +} + +SYSINIT(dtnfsclient_load, SI_SUB_DTRACE_PROVIDER, SI_ORDER_ANY, + dtnfsclient_load, NULL); +SYSUNINIT(dtnfsclient_unload, SI_SUB_DTRACE_PROVIDER, SI_ORDER_ANY, + dtnfsclient_unload, NULL); + +DEV_MODULE(dtnfscl, dtnfsclient_modevent, NULL); +MODULE_VERSION(dtnfscl, 1); +MODULE_DEPEND(dtnfscl, dtrace, 1, 1, 1); +MODULE_DEPEND(dtnfscl, opensolaris, 1, 1, 1); +MODULE_DEPEND(dtnfscl, nfscl, 1, 1, 1); +MODULE_DEPEND(dtnfscl, nfscommon, 1, 1, 1); Modified: head/sys/fs/nfsclient/nfs_clnode.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clnode.c Sat Jun 18 23:01:26 2011 (r223279) +++ head/sys/fs/nfsclient/nfs_clnode.c Sat Jun 18 23:02:53 2011 (r223280) @@ -35,6 +35,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_kdtrace.h" + #include #include #include @@ -53,6 +55,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -300,7 +303,9 @@ ncl_invalcaches(struct vnode *vp) mtx_lock(&np->n_mtx); for (i = 0; i < NFS_ACCESSCACHESIZE; i++) np->n_accesscache[i].stamp = 0; + KDTRACE_NFS_ACCESSCACHE_FLUSH_DONE(vp); np->n_attrstamp = 0; + KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp); mtx_unlock(&np->n_mtx); } Modified: head/sys/fs/nfsclient/nfs_clport.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clport.c Sat Jun 18 23:01:26 2011 (r223279) +++ head/sys/fs/nfsclient/nfs_clport.c Sat Jun 18 23:02:53 2011 (r223280) @@ -34,6 +34,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_kdtrace.h" + /* * generally, I don't like #includes inside .h files, but it seems to * be the easiest way to handle the port. @@ -43,6 +45,26 @@ __FBSDID("$FreeBSD$"); #include #include +#include + +#ifdef KDTRACE_HOOKS +dtrace_nfsclient_attrcache_flush_probe_func_t + dtrace_nfscl_attrcache_flush_done_probe; +uint32_t nfscl_attrcache_flush_done_id; + +dtrace_nfsclient_attrcache_get_hit_probe_func_t + dtrace_nfscl_attrcache_get_hit_probe; +uint32_t nfscl_attrcache_get_hit_id; + +dtrace_nfsclient_attrcache_get_miss_probe_func_t + dtrace_nfscl_attrcache_get_miss_probe; +uint32_t nfscl_attrcache_get_miss_id; + +dtrace_nfsclient_attrcache_load_probe_func_t + dtrace_nfscl_attrcache_load_done_probe; +uint32_t nfscl_attrcache_load_done_id; +#endif /* !KDTRACE_HOOKS */ + extern u_int32_t newnfs_true, newnfs_false, newnfs_xdrneg1; extern struct vop_vector newnfs_vnodeops; extern struct vop_vector newnfs_fifoops; @@ -407,6 +429,7 @@ nfscl_loadattrcache(struct vnode **vpp, */ vap->va_size = np->n_size; np->n_attrstamp = 0; + KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp); } else if (np->n_flag & NMODIFIED) { /* * We've modified the file: Use the larger @@ -439,9 +462,11 @@ nfscl_loadattrcache(struct vnode **vpp, * We detect this by for the mtime moving back. We invalidate the * attrcache when this happens. */ - if (timespeccmp(&mtime_save, &vap->va_mtime, >)) + if (timespeccmp(&mtime_save, &vap->va_mtime, >)) { /* Size changed or mtime went backwards */ np->n_attrstamp = 0; + KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp); + } if (vaper != NULL) { NFSBCOPY((caddr_t)vap, (caddr_t)vaper, sizeof(*vap)); if (np->n_flag & NCHG) { @@ -451,6 +476,10 @@ nfscl_loadattrcache(struct vnode **vpp, vaper->va_mtime = np->n_mtim; } } +#ifdef KDTRACE_HOOKS + if (np->n_attrstamp != 0) + KDTRACE_NFS_ATTRCACHE_LOAD_DONE(vp, vap, 0); +#endif NFSUNLOCKNODE(np); return (0); } Modified: head/sys/fs/nfsclient/nfs_clsubs.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clsubs.c Sat Jun 18 23:01:26 2011 (r223279) +++ head/sys/fs/nfsclient/nfs_clsubs.c Sat Jun 18 23:02:53 2011 (r223280) @@ -35,6 +35,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_kdtrace.h" + /* * These functions support the macros and help fiddle mbuf chains for * the nfs op functions. They do things like create the rpc header and @@ -68,6 +70,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -238,6 +241,7 @@ ncl_getattrcache(struct vnode *vp, struc #ifdef NFS_ACDEBUG mtx_unlock(&Giant); /* ncl_printf() */ #endif + KDTRACE_NFS_ATTRCACHE_GET_MISS(vp); return( ENOENT); } newnfsstats.attrcache_hits++; @@ -267,6 +271,7 @@ ncl_getattrcache(struct vnode *vp, struc #ifdef NFS_ACDEBUG mtx_unlock(&Giant); /* ncl_printf() */ #endif + KDTRACE_NFS_ATTRCACHE_GET_HIT(vp, vap); return (0); } Modified: head/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvnops.c Sat Jun 18 23:01:26 2011 (r223279) +++ head/sys/fs/nfsclient/nfs_clvnops.c Sat Jun 18 23:02:53 2011 (r223280) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); * vnode op calls for Sun NFS version 2, 3 and 4 */ +#include "opt_kdtrace.h" #include "opt_inet.h" #include @@ -70,6 +71,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -77,6 +79,24 @@ __FBSDID("$FreeBSD$"); #include +#ifdef KDTRACE_HOOKS +#include + +dtrace_nfsclient_accesscache_flush_probe_func_t + dtrace_nfscl_accesscache_flush_done_probe; +uint32_t nfscl_accesscache_flush_done_id; + +dtrace_nfsclient_accesscache_get_probe_func_t + dtrace_nfscl_accesscache_get_hit_probe, + dtrace_nfscl_accesscache_get_miss_probe; +uint32_t nfscl_accesscache_get_hit_id; +uint32_t nfscl_accesscache_get_miss_id; + +dtrace_nfsclient_accesscache_load_probe_func_t *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sat Jun 18 23:43:29 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3490E106564A; Sat, 18 Jun 2011 23:43:29 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 23C468FC0C; Sat, 18 Jun 2011 23:43:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5INhT3f068784; Sat, 18 Jun 2011 23:43:29 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5INhTvI068781; Sat, 18 Jun 2011 23:43:29 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201106182343.p5INhTvI068781@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 18 Jun 2011 23:43:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223281 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jun 2011 23:43:29 -0000 Author: jilles Date: Sat Jun 18 23:43:28 2011 New Revision: 223281 URL: http://svn.freebsd.org/changeset/base/223281 Log: sh: Add do-nothing -h option. POSIX requires a -h option to sh and set, to locate and remember utilities invoked by functions as they are defined. Given that this locate-and-remember process is optional elsewhere, it seems safe enough to make this option do nothing. POSIX does not specify a long name for this option. Follow ksh in calling it "trackall". Modified: head/bin/sh/options.h head/bin/sh/sh.1 Modified: head/bin/sh/options.h ============================================================================== --- head/bin/sh/options.h Sat Jun 18 23:02:53 2011 (r223280) +++ head/bin/sh/options.h Sat Jun 18 23:43:28 2011 (r223281) @@ -62,8 +62,9 @@ struct shparam { #define privileged optlist[15].val #define Tflag optlist[16].val #define Pflag optlist[17].val +#define hflag optlist[18].val -#define NOPTS 18 +#define NOPTS 19 struct optent { const char *name; @@ -91,6 +92,7 @@ struct optent optlist[NOPTS] = { { "privileged", 'p', 0 }, { "trapsasync", 'T', 0 }, { "physical", 'P', 0 }, + { "trackall", 'h', 0 }, }; #else extern struct optent optlist[NOPTS]; Modified: head/bin/sh/sh.1 ============================================================================== --- head/bin/sh/sh.1 Sat Jun 18 23:02:53 2011 (r223280) +++ head/bin/sh/sh.1 Sat Jun 18 23:43:28 2011 (r223281) @@ -32,7 +32,7 @@ .\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95 .\" $FreeBSD$ .\" -.Dd June 17, 2011 +.Dd June 18, 2011 .Dt SH 1 .Os .Sh NAME @@ -241,6 +241,10 @@ tested, all commands of the function are well. .It Fl f Li noglob Disable pathname expansion. +.It Fl h Li trackall +A do-nothing option for +.Tn POSIX +compliance. .It Fl I Li ignoreeof Ignore .Dv EOF Ap s From owner-svn-src-head@FreeBSD.ORG Sat Jun 18 23:58:59 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE8D2106566B; Sat, 18 Jun 2011 23:58:59 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B4A678FC0A; Sat, 18 Jun 2011 23:58:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5INwxm7069335; Sat, 18 Jun 2011 23:58:59 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5INwxAF069331; Sat, 18 Jun 2011 23:58:59 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201106182358.p5INwxAF069331@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 18 Jun 2011 23:58:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223282 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jun 2011 23:59:00 -0000 Author: jilles Date: Sat Jun 18 23:58:59 2011 New Revision: 223282 URL: http://svn.freebsd.org/changeset/base/223282 Log: sh: Remove special support for background simple commands. It expands the arguments in the parent shell process, which is incorrect. Modified: head/bin/sh/eval.c head/bin/sh/nodetypes head/bin/sh/parser.c Modified: head/bin/sh/eval.c ============================================================================== --- head/bin/sh/eval.c Sat Jun 18 23:43:28 2011 (r223281) +++ head/bin/sh/eval.c Sat Jun 18 23:58:59 2011 (r223282) @@ -894,14 +894,13 @@ evalcommand(union node *cmd, int flags, } /* Fork off a child process if necessary. */ - if (cmd->ncmd.backgnd - || ((cmdentry.cmdtype == CMDNORMAL || cmdentry.cmdtype == CMDUNKNOWN) + if (((cmdentry.cmdtype == CMDNORMAL || cmdentry.cmdtype == CMDUNKNOWN) && ((flags & EV_EXIT) == 0 || have_traps())) || ((flags & EV_BACKCMD) != 0 && (cmdentry.cmdtype != CMDBUILTIN || !safe_builtin(cmdentry.u.index, argc, argv)))) { jp = makejob(cmd, 1); - mode = cmd->ncmd.backgnd; + mode = FORK_FG; if (flags & EV_BACKCMD) { mode = FORK_NOJOB; if (pipe(pip) < 0) @@ -1068,8 +1067,7 @@ parent: /* parent process gets here (if backcmd->fd = pip[0]; close(pip[1]); backcmd->jp = jp; - } else - exitstatus = 0; + } out: if (lastarg) Modified: head/bin/sh/nodetypes ============================================================================== --- head/bin/sh/nodetypes Sat Jun 18 23:43:28 2011 (r223281) +++ head/bin/sh/nodetypes Sat Jun 18 23:58:59 2011 (r223282) @@ -56,7 +56,6 @@ NSEMI nbinary # two commands separated NCMD ncmd # a simple command type int - backgnd int # set to run command in background args nodeptr # the arguments redirect nodeptr # list of file redirections Modified: head/bin/sh/parser.c ============================================================================== --- head/bin/sh/parser.c Sat Jun 18 23:43:28 2011 (r223281) +++ head/bin/sh/parser.c Sat Jun 18 23:58:59 2011 (r223282) @@ -240,8 +240,8 @@ list(int nlflag, int erflag) n2 = andor(); tok = readtoken(); if (tok == TBACKGND) { - if (n2->type == NCMD || n2->type == NPIPE) { - n2->ncmd.backgnd = 1; + if (n2->type == NPIPE) { + n2->npipe.backgnd = 1; } else if (n2->type == NREDIR) { n2->type = NBACKGND; } else { @@ -689,7 +689,6 @@ simplecmd(union node **rpp, union node * *rpp = NULL; n = (union node *)stalloc(sizeof (struct ncmd)); n->type = NCMD; - n->ncmd.backgnd = 0; n->ncmd.args = args; n->ncmd.redirect = redir; return n;