From pyunyh at gmail.com Wed Jul 1 00:57:19 2009
From: pyunyh at gmail.com (Pyun YongHyeon)
Date: Wed Jul 1 00:57:26 2009
Subject: svn commit: r195200 - in head/usr.sbin: . wake
In-Reply-To: <200906301851.n5UIpNJQ089171@svn.freebsd.org>
References: <200906301851.n5UIpNJQ089171@svn.freebsd.org>
Message-ID: <20090701005459.GC13137@michelle.cdnetworks.co.kr>
On Tue, Jun 30, 2009 at 06:51:23PM +0000, Martin Blapp wrote:
> Author: mbr
> Date: Tue Jun 30 18:51:22 2009
> New Revision: 195200
> URL: http://svn.freebsd.org/changeset/base/195200
>
> Log:
> Add wake, a tool to send Wake on LAN frames to hosts on a local Ethernet network
>
> Submitted by: Marc Balmer
> Reviewed by: rwatson
> Approved by: re
>
Nice! I guess I can now remove installed net/wol ports which does
not work as expected when system have multiple interfaces. And I
didn't understand why it requires perl to build such a simple
utility.
From kensmith at cse.Buffalo.EDU Wed Jul 1 01:56:56 2009
From: kensmith at cse.Buffalo.EDU (Ken Smith)
Date: Wed Jul 1 01:57:03 2009
Subject: svn commit: r195200 - in head/usr.sbin: . wake
In-Reply-To: <20090630.164009.2130804684.imp@bsdimp.com>
References: <0E6D4FB2-A485-40ED-A856-ACC311A90EFE@msys.ch>
<20090630.141340.289711551.imp@bsdimp.com>
<7B9C309F-63E3-4CB8-9871-DE2DEE010096@msys.ch>
<20090630.164009.2130804684.imp@bsdimp.com>
Message-ID: <1246413402.70460.23.camel@bauer.cse.buffalo.edu>
On Tue, 2009-06-30 at 16:40 -0600, M. Warner Losh wrote:
> I hate to be blunt, but this leaves a bad taste in everybody's mouth,
> even if at the end of the day you get your way.
Translation: I did it again. I hate it when that happens... :-(
Two things happened here that were a bit unfortunate, and Marc/Martin
(most likely unintentionally) tripped over it.
The first thing that left a bad taste in some peoples' mouth is this new
thing got approved past the point I had said many times was to be the
end of new things getting added. But people complained the warnings I
had given were buried in messages that had too much other information in
them instead of short and to-the-point messages. So deadlines for a few
things got extended in short and to-the-point messages yesterday and
this pending request fell into one of those categories.
The second thing that left a bad taste in some peoples' mouth is that
this apparently (strictly judging by the fallout discussions) didn't get
as much peer review as some people would have liked. Normally some
level of discussion happens on some public mailing lists (not private
email among a few potentially interested parties). And even after that
happens and the commit gets made there is some time for fallout
discussions to happen. Depending on the results of those potentially
lengthy discussions it might wind up being backed out. But because of
the stage of the release cycle we're in me having approved this can be
viewed as short-circuiting the normal public review because odds are it
will wind up staying despite some peoples' opinions due to the stage of
the release cycle we're in.
That second thing is one of the things that I think we're stuck with as
part of the release process, but I really need help from you folks on.
It's very much like the rant I made about the commit requests. And like
I said above I fell for this before, during the 7.0 release cycle.
During that release cycle it resulted in a rant with the subject line
"I'm not Head Dictator In Charge". People complain if we lock out *all*
new additions, even ones as relatively simple as a new command, too
early in the release cycle. So we *consider* allowing new stuff that
truly shouldn't impact the stability of the pending release until right
around now in the release cycle. But we need to be able to trust that
if you send in a commit request for something new like this that you've
already done the peer review type stuff. RE approval for something like
this doesn't trump normal peer review. The alternative is to flat out
lock out *all* new stuff no matter how seemingly simple it is earlier in
the release cycle just to avoid the problem that maybe someone will try
to sneak something through without sufficient peer review.
Thanks...
--
Ken Smith
- From there to here, from here to | kensmith@cse.buffalo.edu
there, funny things are everywhere. |
- Theodore Geisel |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part
Url : http://lists.freebsd.org/pipermail/svn-src-all/attachments/20090701/a8c372b6/attachment.pgp
From gad at FreeBSD.org Wed Jul 1 02:29:58 2009
From: gad at FreeBSD.org (Garance A Drosehn)
Date: Wed Jul 1 02:30:04 2009
Subject: svn commit: r195200 - in head/usr.sbin: . wake
In-Reply-To: <4A4A7F0B.1010001@freebsd.org>
References: <200906301851.n5UIpNJQ089171@svn.freebsd.org>
<4A4A626A.4080801@freebsd.org>
<5A796102-063B-4032-92C9-EC97AF2E5D5B@msys.ch>
<4A4A7F0B.1010001@freebsd.org>
Message-ID:
At 2:09 PM -0700 6/30/09, Sam Leffler wrote:
>
>I have yet to hear a compelling argument for why wake was chosen
>over an existing tool that's been successfully used for a while.
>OTOH this isn't something that'll keep me up at night; it just seems
>like an ill-advised rush job that completely violates the intent of
>the 8.0 code freeze..
>
> Sam
I agree completely with what Sam is saying here. I don't see why this
had to be done at the time it was done (WRT a code freeze), and without
any discussion about adding it to FreeBSD. I also agree that it won't
be keeping me up at night, because I'm about to go on vacation for 10-12
days here. But as Warner noted, "this leaves a bad taste in everybody's
mouth, even if at the end of the day you get your way"
--
Garance Alistair Drosehn = drosehn@rpi.edu
Senior Systems Programmer or gad@FreeBSD.org
Rensselaer Polytechnic Institute; Troy, NY; USA
From brooks at FreeBSD.org Wed Jul 1 02:47:36 2009
From: brooks at FreeBSD.org (Brooks Davis)
Date: Wed Jul 1 02:47:47 2009
Subject: svn commit: r195200 - in head/usr.sbin: . wake
In-Reply-To: <1246413402.70460.23.camel@bauer.cse.buffalo.edu>
References: <0E6D4FB2-A485-40ED-A856-ACC311A90EFE@msys.ch>
<20090630.141340.289711551.imp@bsdimp.com>
<7B9C309F-63E3-4CB8-9871-DE2DEE010096@msys.ch>
<20090630.164009.2130804684.imp@bsdimp.com>
<1246413402.70460.23.camel@bauer.cse.buffalo.edu>
Message-ID: <20090701022257.GA9820@lor.one-eyed-alien.net>
On Tue, Jun 30, 2009 at 09:56:42PM -0400, Ken Smith wrote:
> On Tue, 2009-06-30 at 16:40 -0600, M. Warner Losh wrote:
> > I hate to be blunt, but this leaves a bad taste in everybody's mouth,
> > even if at the end of the day you get your way.
>
> The second thing that left a bad taste in some peoples' mouth is that
> this apparently (strictly judging by the fallout discussions) didn't get
> as much peer review as some people would have liked. Normally some
> level of discussion happens on some public mailing lists (not private
> email among a few potentially interested parties). And even after that
> happens and the commit gets made there is some time for fallout
> discussions to happen. Depending on the results of those potentially
> lengthy discussions it might wind up being backed out. But because of
> the stage of the release cycle we're in me having approved this can be
> viewed as short-circuiting the normal public review because odds are it
> will wind up staying despite some peoples' opinions due to the stage of
> the release cycle we're in.
Given that it doesn't make any significant difference if it makes it
into the base for 8.0 (especially given that ports are still open). I'd
say the only right course of action is to back it out.
I personally wouldn't be surprised if some form of it made it in to a
future release, but basically nothing was right with this commit (zero
prior discussion, contained trivial bugs, last minute addition).
-- Brooks
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/svn-src-all/attachments/20090701/aa587ac1/attachment.pgp
From rnoland at FreeBSD.org Wed Jul 1 04:02:03 2009
From: rnoland at FreeBSD.org (Robert Noland)
Date: Wed Jul 1 04:02:10 2009
Subject: svn commit: r195200 - in head/usr.sbin: . wake
In-Reply-To: <1246413402.70460.23.camel@bauer.cse.buffalo.edu>
References: <0E6D4FB2-A485-40ED-A856-ACC311A90EFE@msys.ch>
<20090630.141340.289711551.imp@bsdimp.com>
<7B9C309F-63E3-4CB8-9871-DE2DEE010096@msys.ch>
<20090630.164009.2130804684.imp@bsdimp.com>
<1246413402.70460.23.camel@bauer.cse.buffalo.edu>
Message-ID: <1246420905.1855.19.camel@balrog.2hip.net>
On Tue, 2009-06-30 at 21:56 -0400, Ken Smith wrote:
> On Tue, 2009-06-30 at 16:40 -0600, M. Warner Losh wrote:
> > I hate to be blunt, but this leaves a bad taste in everybody's mouth,
> > even if at the end of the day you get your way.
>
> Translation: I did it again. I hate it when that happens... :-(
>
> Two things happened here that were a bit unfortunate, and Marc/Martin
> (most likely unintentionally) tripped over it.
>
> The first thing that left a bad taste in some peoples' mouth is this new
> thing got approved past the point I had said many times was to be the
> end of new things getting added. But people complained the warnings I
> had given were buried in messages that had too much other information in
> them instead of short and to-the-point messages. So deadlines for a few
> things got extended in short and to-the-point messages yesterday and
> this pending request fell into one of those categories.
If you missed the deadline because you chose to skim messages from the
release manager, then so be it... If people have work that they want to
get into the release, then they should be paying attention to mail from
re@. I know that I have work that I would have liked to gotten in, but
complications arose which made it obvious that resolving them within the
remaining time before the freeze was not practical.
> The second thing that left a bad taste in some peoples' mouth is that
> this apparently (strictly judging by the fallout discussions) didn't get
> as much peer review as some people would have liked. Normally some
> level of discussion happens on some public mailing lists (not private
> email among a few potentially interested parties). And even after that
> happens and the commit gets made there is some time for fallout
> discussions to happen. Depending on the results of those potentially
> lengthy discussions it might wind up being backed out. But because of
> the stage of the release cycle we're in me having approved this can be
> viewed as short-circuiting the normal public review because odds are it
> will wind up staying despite some peoples' opinions due to the stage of
> the release cycle we're in.
>
> That second thing is one of the things that I think we're stuck with as
> part of the release process, but I really need help from you folks on.
> It's very much like the rant I made about the commit requests. And like
> I said above I fell for this before, during the 7.0 release cycle.
> During that release cycle it resulted in a rant with the subject line
> "I'm not Head Dictator In Charge". People complain if we lock out *all*
> new additions, even ones as relatively simple as a new command, too
> early in the release cycle. So we *consider* allowing new stuff that
> truly shouldn't impact the stability of the pending release until right
> around now in the release cycle. But we need to be able to trust that
> if you send in a commit request for something new like this that you've
> already done the peer review type stuff. RE approval for something like
> this doesn't trump normal peer review. The alternative is to flat out
> lock out *all* new stuff no matter how seemingly simple it is earlier in
> the release cycle just to avoid the problem that maybe someone will try
> to sneak something through without sufficient peer review.
A feature freeze in my mind is exactly that. re@ should be approving
bug fixes only. No new work should be allowed beyond the freeze date.
There is always the next release. That or people should have been
paying attention and gotten things into the tree on time with
appropriate review.
robert.
> Thanks...
--
Robert Noland
FreeBSD
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: This is a digitally signed message part
Url : http://lists.freebsd.org/pipermail/svn-src-all/attachments/20090701/e8624081/attachment.pgp
From doconnor at gsoft.com.au Wed Jul 1 03:34:03 2009
From: doconnor at gsoft.com.au (Daniel O'Connor)
Date: Wed Jul 1 04:47:38 2009
Subject: svn commit: r194628 - head/lib/ncurses/ncurses
In-Reply-To: <9bbcef730906301432i13e283e0lb955fecc590f25de@mail.gmail.com>
References: <20090630.094632.195416436.imp@bsdimp.com>
<20090630.150658.1306326527.imp@bsdimp.com>
<9bbcef730906301432i13e283e0lb955fecc590f25de@mail.gmail.com>
Message-ID: <200907011303.28877.doconnor@gsoft.com.au>
On Wed, 1 Jul 2009, Ivan Voras wrote:
> > Looks like "setenv LESS -X" or "export LESS=-X" would do the same
> > thing, no? ?And work for "more" too...
>
> Would it be possible to set it by default in /etc/csh.login (or
> wherever is more appropriate) if the termcap change goes in?
How about vi? Can that be fixed (if it needs it)?
About the only use for clearing the screen is when you logout IMO, it is
so frustrating otherwise (IMO of course :)
--
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 188 bytes
Desc: This is a digitally signed message part.
Url : http://lists.freebsd.org/pipermail/svn-src-all/attachments/20090701/c2b6ae8a/attachment.pgp
From joel at FreeBSD.org Wed Jul 1 04:52:08 2009
From: joel at FreeBSD.org (Joel Dahl)
Date: Wed Jul 1 04:52:14 2009
Subject: svn commit: r195200 - in head/usr.sbin: . wake
In-Reply-To: <200906301851.n5UIpNJQ089171@svn.freebsd.org>
References: <200906301851.n5UIpNJQ089171@svn.freebsd.org>
Message-ID: <4A4AEB75.9070109@FreeBSD.org>
Martin Blapp skrev:
> Author: mbr
> Date: Tue Jun 30 18:51:22 2009
> New Revision: 195200
> URL: http://svn.freebsd.org/changeset/base/195200
>
> Log:
> Add wake, a tool to send Wake on LAN frames to hosts on a local Ethernet network
Nice. Now I can finally nuke net/wol from my systems.
--
Joel
From Martin.Blapp at t-systems.ch Wed Jul 1 05:15:40 2009
From: Martin.Blapp at t-systems.ch (Blapp, Martin)
Date: Wed Jul 1 05:15:47 2009
Subject: AW: svn commit: r195200 - in head/usr.sbin: . wake
In-Reply-To: <1246413402.70460.23.camel@bauer.cse.buffalo.edu>
References: <0E6D4FB2-A485-40ED-A856-ACC311A90EFE@msys.ch>
<20090630.141340.289711551.imp@bsdimp.com>
<7B9C309F-63E3-4CB8-9871-DE2DEE010096@msys.ch>
<20090630.164009.2130804684.imp@bsdimp.com>,
<1246413402.70460.23.camel@bauer.cse.buffalo.edu>
Message-ID: <509A7CA1EA3EA046B1A5BA2FCFDB3C8EECC53324B6@TSS-EXCH01.t-systems.ch>
Hi folks,
I really was not my or Marcs intention to skip any discussions. Rwatson told us that
if we like to see it in 8.0, we need to approve it by RE and commit it before the 1. of july,
and that's what I've done. Sorry if I've upset anyone.
Personally I think the tool is quite handy, better than net/wol (which doesn't seem to
work with different interfaces), wake doesn't need any strange libaries as dependencies
and it just a very short one (4k)
If the concensus is to back it out, I'll back it out.
--
Martin
From edwin at mavetju.org Wed Jul 1 05:42:15 2009
From: edwin at mavetju.org (Edwin Groothuis)
Date: Wed Jul 1 05:42:28 2009
Subject: svn commit: r195200 - in head/usr.sbin: . wake
In-Reply-To: <20090701005459.GC13137@michelle.cdnetworks.co.kr>
References: <200906301851.n5UIpNJQ089171@svn.freebsd.org>
<20090701005459.GC13137@michelle.cdnetworks.co.kr>
Message-ID: <20090701054213.GA52751@mavetju.org>
> Nice! I guess I can now remove installed net/wol ports which does
> not work as expected when system have multiple interfaces. And I
> didn't understand why it requires perl to build such a simple
> utility.
Have a look at the build process and you see exactly why it needs
perl. The question should have been: Why didn't they write it in a
.pod in the first place! :-P
Edwin
--
Edwin Groothuis Website: http://www.mavetju.org/
edwin@mavetju.org Weblog: http://www.mavetju.org/weblog/
From marc at msys.ch Wed Jul 1 06:13:18 2009
From: marc at msys.ch (Marc Balmer)
Date: Wed Jul 1 06:13:26 2009
Subject: AW: svn commit: r195200 - in head/usr.sbin: . wake
In-Reply-To: <509A7CA1EA3EA046B1A5BA2FCFDB3C8EECC53324B6@TSS-EXCH01.t-systems.ch>
References: <0E6D4FB2-A485-40ED-A856-ACC311A90EFE@msys.ch>
<20090630.141340.289711551.imp@bsdimp.com>
<7B9C309F-63E3-4CB8-9871-DE2DEE010096@msys.ch>
<20090630.164009.2130804684.imp@bsdimp.com>,
<1246413402.70460.23.camel@bauer.cse.buffalo.edu>
<509A7CA1EA3EA046B1A5BA2FCFDB3C8EECC53324B6@TSS-EXCH01.t-systems.ch>
Message-ID: <8F849918-CCA3-4979-8138-A86529850E38@msys.ch>
Am 01.07.2009 um 07:04 schrieb Blapp, Martin:
> Hi folks,
>
> I really was not my or Marcs intention to skip any discussions.
> Rwatson told us that
> if we like to see it in 8.0, we need to approve it by RE and commit
> it before the 1. of july,
> and that's what I've done. Sorry if I've upset anyone.
>
> Personally I think the tool is quite handy, better than net/wol
> (which doesn't seem to
> work with different interfaces), wake doesn't need any strange
> libaries as dependencies
> and it just a very short one (4k)
>
> If the concensus is to back it out, I'll back it out.
The only thing I can say is that this code has been around since quite
some time and is in use at many places without any problems. This is
nothing big, actually really small, but it is really useful. And
since Wake-on-LAN is now in almost all computers I think having a tool
to use it is justified. This little command can not make your computer
crash, nor cause any problems, so I really do not fully understand why
all the fuss around it (e.g. I find that some people are exaggerating
a little bit, given how small of an addition wake(8) actually is).
From marc at msys.ch Wed Jul 1 06:23:23 2009
From: marc at msys.ch (Marc Balmer)
Date: Wed Jul 1 06:23:30 2009
Subject: AW: svn commit: r195200 - in head/usr.sbin: . wake
In-Reply-To: <509A7CA1EA3EA046B1A5BA2FCFDB3C8EECC53324B6@TSS-EXCH01.t-systems.ch>
References: <0E6D4FB2-A485-40ED-A856-ACC311A90EFE@msys.ch>
<20090630.141340.289711551.imp@bsdimp.com>
<7B9C309F-63E3-4CB8-9871-DE2DEE010096@msys.ch>
<20090630.164009.2130804684.imp@bsdimp.com>,
<1246413402.70460.23.camel@bauer.cse.buffalo.edu>
<509A7CA1EA3EA046B1A5BA2FCFDB3C8EECC53324B6@TSS-EXCH01.t-systems.ch>
Message-ID: <19D06995-BE7C-41EC-83B3-DB694398CE2B@msys.ch>
Am 01.07.2009 um 07:04 schrieb Blapp, Martin:
>
> If the concensus is to back it out, I'll back it out.
That would be sad. After all there were very positive reactions from
folks that actually looked at the tool, the negative replies came from
folks that saw some process violated, iirc.... but hey, after all the
committ was approved by the _release_ engineers. I was under the
impression that the _release_ folks can give such approval.
It was not rush something very in new in, the code is proven and
wherever it show up, people immediately see the use of it. The point
is that I submittet this in an arbitrary point of my timeline, not
being aware of any dates at all, because starting with FreeBSD 8.0 we
want to switch a lot of POS terminals/servers to FreeBSD starting with
8.0, and for them we need wake(8). So I yes, I submited this to have
it in 8.0, but no, I was not really aware that this was close to a
timeline. Now that re@ approved it, where is the sense of removing it
from 8.0, just to add then for 9.0? (other that it means I will have
to wait for one more release cycle).
From brian at Awfulhak.org Wed Jul 1 07:25:30 2009
From: brian at Awfulhak.org (Brian Somers)
Date: Wed Jul 1 07:25:37 2009
Subject: svn commit: r195200 - in head/usr.sbin: . wake
In-Reply-To: <20090701014553.32117b64.stas@FreeBSD.org>
References: <200906301851.n5UIpNJQ089171@svn.freebsd.org>
<20090701014553.32117b64.stas@FreeBSD.org>
Message-ID: <20090630235624.13a526dc@dev.lan.Awfulhak.org>
On Wed, 1 Jul 2009 01:45:53 +0400 Stanislav Sedov wrote:
> > + p = (u_char *)&pkt;
> > + len = sizeof(pkt);
> > + bw = 0;
> > + while (len) {
> > + if ((bw = write(bpf, &pkt, sizeof(pkt))) == -1)
> > + return -1;
> > + len -= bw;
> > + p += bw;
> > + }
> > + return 0;
> > +}
>
> What the "p" pointer is used here for? I don't see any usage for it besides
> incrementing it in the loop. Am I missing something?
The write() has two bugs. It should be write(bpf, p, len).
--
Brian Somers
Don't _EVER_ lose your sense of humour !
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 306 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/svn-src-all/attachments/20090701/e8623adc/signature.pgp
From dfr at FreeBSD.org Wed Jul 1 07:34:29 2009
From: dfr at FreeBSD.org (Doug Rabson)
Date: Wed Jul 1 07:34:35 2009
Subject: svn commit: r195228 - head/sys/amd64/amd64
Message-ID: <200907010734.n617YS3P005059@svn.freebsd.org>
Author: dfr
Date: Wed Jul 1 07:34:28 2009
New Revision: 195228
URL: http://svn.freebsd.org/changeset/base/195228
Log:
Don't include rpcv2.h - it has been removed.
Submitted by: ed@
Approved by: re
Modified:
head/sys/amd64/amd64/genassym.c
Modified: head/sys/amd64/amd64/genassym.c
==============================================================================
--- head/sys/amd64/amd64/genassym.c Wed Jul 1 01:35:37 2009 (r195227)
+++ head/sys/amd64/amd64/genassym.c Wed Jul 1 07:34:28 2009 (r195228)
@@ -64,7 +64,6 @@ __FBSDID("$FreeBSD$");
#include
#include
#include
-#include
#include
#include
#include
From dfr at FreeBSD.org Wed Jul 1 07:35:57 2009
From: dfr at FreeBSD.org (Doug Rabson)
Date: Wed Jul 1 07:36:04 2009
Subject: svn commit: r195229 - head
Message-ID: <200907010735.n617Zva4005128@svn.freebsd.org>
Author: dfr
Date: Wed Jul 1 07:35:57 2009
New Revision: 195229
URL: http://svn.freebsd.org/changeset/base/195229
Log:
Add an entry documenting removal of the NFS_LEGACYRPC option.
Submitted by: Steve Kargl
Approved by: re
Modified:
head/UPDATING
Modified: head/UPDATING
==============================================================================
--- head/UPDATING Wed Jul 1 07:34:28 2009 (r195228)
+++ head/UPDATING Wed Jul 1 07:35:57 2009 (r195229)
@@ -22,6 +22,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8.
to maximize performance. (To disable malloc debugging, run
ln -s aj /etc/malloc.conf.)
+20090630:
+ Remove the old kernel RPC implementation and the NFS_LEGACYRPC
+ option. Kernel configurations may need to be adjusted.
+
20090629:
The network interface device nodes at /dev/net/ have
been removed. All ioctl operations can be performed the normal
From dfr at FreeBSD.org Wed Jul 1 07:37:22 2009
From: dfr at FreeBSD.org (Doug Rabson)
Date: Wed Jul 1 07:37:29 2009
Subject: svn commit: r195230 - head
Message-ID: <200907010737.n617bLLA005192@svn.freebsd.org>
Author: dfr
Date: Wed Jul 1 07:37:21 2009
New Revision: 195230
URL: http://svn.freebsd.org/changeset/base/195230
Log:
Add usr/include/nfs/rpcv2.h
Submitted by: pluknet at gmail dot com
Approved by: re
Modified:
head/ObsoleteFiles.inc
Modified: head/ObsoleteFiles.inc
==============================================================================
--- head/ObsoleteFiles.inc Wed Jul 1 07:35:57 2009 (r195229)
+++ head/ObsoleteFiles.inc Wed Jul 1 07:37:21 2009 (r195230)
@@ -14,6 +14,8 @@
# The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last.
#
+# 20090630: old kernel RPC implementation removal
+OLD_FILES+=usr/include/nfs/rpcv2.h
# 20090624: update usbdi(9)
OLD_FILES+=usr/share/man/man9/usbd_abort_default_pipe.9.gz
OLD_FILES+=usr/share/man/man9/usbd_abort_pipe.9.gz
From mav at FreeBSD.org Wed Jul 1 08:08:57 2009
From: mav at FreeBSD.org (Alexander Motin)
Date: Wed Jul 1 08:09:08 2009
Subject: svn commit: r195231 - head/sys/netgraph
Message-ID: <200907010808.n6188u1q005872@svn.freebsd.org>
Author: mav
Date: Wed Jul 1 08:08:56 2009
New Revision: 195231
URL: http://svn.freebsd.org/changeset/base/195231
Log:
Fix infinite loop in ng_iface, that happens when packet passes out via
two different ng interfaces sequentially due to tunnelling.
PR: kern/134557
Submitted by: Mikolaj Golub
Approved by: re (kensmith)
MFC after: 3 days
Modified:
head/sys/netgraph/ng_iface.c
Modified: head/sys/netgraph/ng_iface.c
==============================================================================
--- head/sys/netgraph/ng_iface.c Wed Jul 1 07:37:21 2009 (r195230)
+++ head/sys/netgraph/ng_iface.c Wed Jul 1 08:08:56 2009 (r195231)
@@ -382,7 +382,8 @@ ng_iface_output(struct ifnet *ifp, struc
}
/* Protect from deadly infinite recursion. */
- while ((mtag = m_tag_locate(m, MTAG_NGIF, MTAG_NGIF_CALLED, NULL))) {
+ mtag = NULL;
+ while ((mtag = m_tag_locate(m, MTAG_NGIF, MTAG_NGIF_CALLED, mtag))) {
if (*(struct ifnet **)(mtag + 1) == ifp) {
log(LOG_NOTICE, "Loop detected on %s\n", ifp->if_xname);
m_freem(m);
From mav at FreeBSD.org Wed Jul 1 08:43:06 2009
From: mav at FreeBSD.org (Alexander Motin)
Date: Wed Jul 1 08:43:14 2009
Subject: svn commit: r195232 - in stable/7/sys: . contrib/pf netgraph
Message-ID: <200907010843.n618h5Xm006670@svn.freebsd.org>
Author: mav
Date: Wed Jul 1 08:43:05 2009
New Revision: 195232
URL: http://svn.freebsd.org/changeset/base/195232
Log:
MFC rev.194699:
Mark ng_ether node hooks as HI_STACK. It is usually the last point when
netgraph may unroll the call stack, and I have found that in some cases 2K
guarantied there for i386 may be not enough for NIC driver and BPF.
Modified:
stable/7/sys/ (props changed)
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/netgraph/ng_ether.c
Modified: stable/7/sys/netgraph/ng_ether.c
==============================================================================
--- stable/7/sys/netgraph/ng_ether.c Wed Jul 1 08:08:56 2009 (r195231)
+++ stable/7/sys/netgraph/ng_ether.c Wed Jul 1 08:43:05 2009 (r195232)
@@ -403,7 +403,7 @@ ng_ether_newhook(node_p node, hook_p hoo
/* Disable hardware checksums while 'upper' hook is connected */
if (hookptr == &priv->upper)
priv->ifp->if_hwassist = 0;
-
+ NG_HOOK_HI_STACK(hook);
/* OK */
*hookptr = hook;
return (0);
From stas at FreeBSD.org Wed Jul 1 08:48:33 2009
From: stas at FreeBSD.org (Stanislav Sedov)
Date: Wed Jul 1 08:48:39 2009
Subject: svn commit: r195213 - head/usr.sbin/wake
In-Reply-To: <200906302209.n5UM9lBM093495@svn.freebsd.org>
References: <200906302209.n5UM9lBM093495@svn.freebsd.org>
Message-ID: <20090701124825.af0d205e.stas@FreeBSD.org>
On Tue, 30 Jun 2009 22:09:47 +0000 (UTC)
Martin Blapp mentioned:
> Author: mbr
> Date: Tue Jun 30 22:09:47 2009
> New Revision: 195213
> URL: http://svn.freebsd.org/changeset/base/195213
>
> Log:
> Compiles without higher warn level
>
> MAN= wake.8
>
> -WARNS?= 2
> -
I believe you wanted something like WARNS?=6 probably? Now you disabled
any warnings-related compiler flags entirely.
--
Stanislav Sedov
ST4096-RIPE
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/svn-src-all/attachments/20090701/37869c7c/attachment.pgp
From ed at 80386.nl Wed Jul 1 08:53:58 2009
From: ed at 80386.nl (Ed Schouten)
Date: Wed Jul 1 08:54:05 2009
Subject: svn commit: r195230 - head
In-Reply-To: <200907010737.n617bLLA005192@svn.freebsd.org>
References: <200907010737.n617bLLA005192@svn.freebsd.org>
Message-ID: <20090701085356.GE48776@hoeg.nl>
Hi Doug,
* Doug Rabson wrote:
> Author: dfr
> Date: Wed Jul 1 07:37:21 2009
> New Revision: 195230
> URL: http://svn.freebsd.org/changeset/base/195230
>
> Log:
> Add usr/include/nfs/rpcv2.h
>
> Submitted by: pluknet at gmail dot com
> Approved by: re
Not sure, but I think there were multiple header files that were
removed yesterday.
--
Ed Schouten
WWW: http://80386.nl/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/svn-src-all/attachments/20090701/32fdb879/attachment.pgp
From ed at 80386.nl Wed Jul 1 08:56:34 2009
From: ed at 80386.nl (Ed Schouten)
Date: Wed Jul 1 08:56:45 2009
Subject: svn commit: r195230 - head
In-Reply-To: <20090701085356.GE48776@hoeg.nl>
References: <200907010737.n617bLLA005192@svn.freebsd.org>
<20090701085356.GE48776@hoeg.nl>
Message-ID: <20090701085632.GF48776@hoeg.nl>
* Ed Schouten wrote:
> Not sure, but I think there were multiple header files that were
> removed yesterday.
Never mind. They were modified, not removed. Sorry for the noise!
--
Ed Schouten
WWW: http://80386.nl/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/svn-src-all/attachments/20090701/30b73b52/attachment.pgp
From rwatson at FreeBSD.org Wed Jul 1 08:58:57 2009
From: rwatson at FreeBSD.org (Robert Watson)
Date: Wed Jul 1 08:59:09 2009
Subject: AW: svn commit: r195200 - in head/usr.sbin: . wake
In-Reply-To: <509A7CA1EA3EA046B1A5BA2FCFDB3C8EECC53324B6@TSS-EXCH01.t-systems.ch>
References: <0E6D4FB2-A485-40ED-A856-ACC311A90EFE@msys.ch>
<20090630.141340.289711551.imp@bsdimp.com>
<7B9C309F-63E3-4CB8-9871-DE2DEE010096@msys.ch>
<20090630.164009.2130804684.imp@bsdimp.com>,
<1246413402.70460.23.camel@bauer.cse.buffalo.edu>
<509A7CA1EA3EA046B1A5BA2FCFDB3C8EECC53324B6@TSS-EXCH01.t-systems.ch>
Message-ID:
On Wed, 1 Jul 2009, Blapp, Martin wrote:
> I really was not my or Marcs intention to skip any discussions. Rwatson told
> us that if we like to see it in 8.0, we need to approve it by RE and commit
> it before the 1. of july, and that's what I've done. Sorry if I've upset
> anyone.
>
> Personally I think the tool is quite handy, better than net/wol (which
> doesn't seem to work with different interfaces), wake doesn't need any
> strange libaries as dependencies and it just a very short one (4k)
>
> If the concensus is to back it out, I'll back it out.
FWIW, I think having a wake-on-lan tool in the base system is pretty valuable
-- it's compact, useful, etc. Making sure we get the right tool, that it has
the right name, right license, no odd script dependencies, etc, are all
reasonable concerns, and could have been handled better by addressing them on
the lists before, rather than after, the commit (Marc's tool meets some but
not all of these requirements on face value). That said, I am caught a bit by
surprise at the level of my response, and was not aware of the NetBSD-side
discussion...
Robert N M Watson
Computer Laboratory
University of Cambridge
From maxim at macomnet.ru Wed Jul 1 11:25:39 2009
From: maxim at macomnet.ru (Maxim Konovalov)
Date: Wed Jul 1 11:25:51 2009
Subject: svn commit: r194681 - head/usr.sbin/wpa/ndis_events
In-Reply-To: <86ljn923dw.fsf@ds4.des.no>
References: <200906230555.n5N5tubJ065618@svn.freebsd.org>
<20090623080015.GK48776@hoeg.nl>
<20090623125125.F1156@mp2.macomnet.net> <86ljn923dw.fsf@ds4.des.no>
Message-ID: <20090701152300.N96900@mp2.macomnet.net>
On Tue, 30 Jun 2009, 16:38+0200, Dag-Erling Smrgrav wrote:
> Maxim Konovalov writes:
> > fixed, thanks.
>
> It still says
>
> static void
> usage()
>
> I know this is allowed by C99, but it's not allowed by style(9).
>
>From style(9):
static void
usage()
{
/* Insert an empty line if the function has no local variables. */
...
Apart from the empty line, what's wrong?
--
Maxim Konovalov
From brde at optusnet.com.au Wed Jul 1 11:44:24 2009
From: brde at optusnet.com.au (Bruce Evans)
Date: Wed Jul 1 11:44:35 2009
Subject: svn commit: r194538 - head/sys/sys
In-Reply-To: <86hbxx2341.fsf@ds4.des.no>
References: <200906201639.n5KGdPhO081114@svn.freebsd.org>
<20090620174158.GG2884@deviant.kiev.zoral.com.ua>
<20090623221248.GA5445@zim.MIT.EDU>
<20090623221053.GT2884@deviant.kiev.zoral.com.ua>
<20090623234549.GA6076@zim.MIT.EDU>
<20090625151849.W33864@delplex.bde.org> <86hbxx2341.fsf@ds4.des.no>
Message-ID: <20090701213032.Q39158@delplex.bde.org>
On Tue, 30 Jun 2009, [utf-8] Dag-Erling Smørgrav wrote:
> Bruce Evans writes:
>> Freestanding reserves fewer symbols for the implementation.
>
> IIRC, freestanding implementations are only required to provide
> and , and everything else is available to the
> application.
Also , , , and .
However, _FOO and __foo don't seem to be reserved -- these seem to
only be reserved in section 7 (library), and freestanding specifically
doesn't require anything in section 7 except the above headers. The
complete list seems to be just the standard contents of the above
headers, plus things like __STDC__, at least if the application doesn't
#undef these things before using them.
Bruce
From brde at optusnet.com.au Wed Jul 1 12:21:40 2009
From: brde at optusnet.com.au (Bruce Evans)
Date: Wed Jul 1 12:21:46 2009
Subject: svn commit: r194789 - head/usr.bin/usbhidctl
In-Reply-To: <8663ed2265.fsf@ds4.des.no>
References: <200906232316.n5NNG1iT094289@svn.freebsd.org>
<20090625154007.H33864@delplex.bde.org> <4A43B727.7010204@delphij.net>
<20090627033608.P35379@delplex.bde.org> <8663ed2265.fsf@ds4.des.no>
Message-ID: <20090701214927.V39172@delplex.bde.org>
On Tue, 30 Jun 2009, [utf-8] Dag-Erling Smørgrav wrote:
> Bruce Evans writes:
>> Actually, it is OK to use it in FreeBSD iff the system supports the
>> same program having different names, like reboot/halt/etc.
>
> I don't see the point - you would still need different usage messages
> for each version. Using your example:
>
> % reboot -h
> reboot: illegal option -- h
> usage: reboot [-dlnpq] [-k kernel]
> % halt -h
> halt: illegal option -- h
> usage: halt [-lnpq] [-k kernel]
>
> The code that implements this is needlessly complicated:
>
> static void
> usage()
> {
> (void)fprintf(stderr, "usage: %s [-%slnpq] [-k kernel]\n",
> getprogname(), dohalt ? "" : "d");
> exit(1);
> }
Yes, I missed that. I had only looked at an old version which was just
broken -- it always printed -[dnpq] (was also missing -l).
> The following is far more readable:
>
> static void
> usage(void)
> {
>
> (void)fprintf(stderr, dohalt ?
> "usage: halt [-lnpq] [-k kernel]\n" :
> "usage: reboot [-dlnpq] [-k kernel]\n");
> exit(1);
> }
However, this is broken since it doesn't handle the program being named
fasthalt or fastboot. The dohalt condition in the current version
barely works for these since fasthalt takes the same args as halt, etc.
I like using the `? :' operator in sub-expressions, but it only works
well for simpler statements than the above.
reboot in Lite2 uses it instead of getprogname(). reboot in Lite2
also has a home-made err() with another ?: instead of getprogname().
It uses "dohalt ? :", and this is actually correct since Lite2 doesn't
have fasthalt or fastboot, at least in reboot's own Makefile.
> BTW, there are numerous style issues in sbin/reboot/reboot.c.
Really? According to knfom, it is 94.772% knf (up from 94.520% in
~5.2 and 92.896% in Lite2). It is a small program so it is easy to
get right, but anything above 90% is a nice colour. (94.520% is due
to 7 lines fixed by indent(1) and 5 lines broken by indent(1)).
Bruce
From joerg at britannica.bec.de Wed Jul 1 12:29:44 2009
From: joerg at britannica.bec.de (Joerg Sonnenberger)
Date: Wed Jul 1 12:29:51 2009
Subject: svn commit: r194681 - head/usr.sbin/wpa/ndis_events
In-Reply-To: <20090701152300.N96900@mp2.macomnet.net>
References: <200906230555.n5N5tubJ065618@svn.freebsd.org>
<20090623080015.GK48776@hoeg.nl>
<20090623125125.F1156@mp2.macomnet.net> <86ljn923dw.fsf@ds4.des.no>
<20090701152300.N96900@mp2.macomnet.net>
Message-ID: <20090701122952.GA14519@britannica.bec.de>
On Wed, Jul 01, 2009 at 03:25:33PM +0400, Maxim Konovalov wrote:
> static void
> usage()
> {
> /* Insert an empty line if the function has no local variables. */
> ...
>
> Apart from the empty line, what's wrong?
It is K&R style. It should be
static void
usage(void)
{
...
Joerg
From rwatson at FreeBSD.org Wed Jul 1 12:36:11 2009
From: rwatson at FreeBSD.org (Robert Watson)
Date: Wed Jul 1 12:36:23 2009
Subject: svn commit: r195235 - in head/sys: kern security/audit
Message-ID: <200907011236.n61CaA9g012734@svn.freebsd.org>
Author: rwatson
Date: Wed Jul 1 12:36:10 2009
New Revision: 195235
URL: http://svn.freebsd.org/changeset/base/195235
Log:
udit the 'options' argument to wait4(2).
Approved by: re (kib)
MFC after: 3 days
Modified:
head/sys/kern/kern_exit.c
head/sys/security/audit/audit_bsm.c
Modified: head/sys/kern/kern_exit.c
==============================================================================
--- head/sys/kern/kern_exit.c Wed Jul 1 10:16:10 2009 (r195234)
+++ head/sys/kern/kern_exit.c Wed Jul 1 12:36:10 2009 (r195235)
@@ -804,6 +804,7 @@ kern_wait(struct thread *td, pid_t pid,
int error, nfound;
AUDIT_ARG_PID(pid);
+ AUDIT_ARG_VALUE(options);
q = td->td_proc;
if (pid == 0) {
Modified: head/sys/security/audit/audit_bsm.c
==============================================================================
--- head/sys/security/audit/audit_bsm.c Wed Jul 1 10:16:10 2009 (r195234)
+++ head/sys/security/audit/audit_bsm.c Wed Jul 1 12:36:10 2009 (r195235)
@@ -1498,6 +1498,10 @@ kaudit_to_bsm(struct kaudit_record *kar,
tok = au_to_arg32(0, "pid", ar->ar_arg_pid);
kau_write(rec, tok);
}
+ if (ARG_IS_VALID(kar, ARG_VALUE)) {
+ tok = au_to_arg32(0, "options", ar->ar_arg_value);
+ kau_write(rec, tok);
+ }
break;
case AUE_NULL:
From avg at FreeBSD.org Wed Jul 1 12:44:24 2009
From: avg at FreeBSD.org (Andriy Gapon)
Date: Wed Jul 1 12:44:35 2009
Subject: svn commit: r195236 - in stable/7/sys: . contrib/pf nfsserver
Message-ID: <200907011244.n61CiNVH012914@svn.freebsd.org>
Author: avg
Date: Wed Jul 1 12:44:23 2009
New Revision: 195236
URL: http://svn.freebsd.org/changeset/base/195236
Log:
MFC 185586 (kan): Change nfsserver slightly so that it does not trip
over the timestamp validation code on ZFS.
This should fix O_CREAT|O_EXCL open on NFS where a server is 64-bit
with v13 ZFS code.
PR: kern/135412
Pointed out by: Jaakko Heinonen
Tested by: Jaakko Heinonen, Danny Braniss
Modified:
stable/7/sys/ (props changed)
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/nfsserver/nfs_serv.c
Modified: stable/7/sys/nfsserver/nfs_serv.c
==============================================================================
--- stable/7/sys/nfsserver/nfs_serv.c Wed Jul 1 12:36:10 2009 (r195235)
+++ stable/7/sys/nfsserver/nfs_serv.c Wed Jul 1 12:44:23 2009 (r195236)
@@ -1656,13 +1656,12 @@ nfsrv_create(struct nfsrv_descript *nfsd
caddr_t bpos;
int error = 0, rdev, len, tsize, dirfor_ret = 1, diraft_ret = 1;
int v3 = (nfsd->nd_flag & ND_NFSV3), how, exclusive_flag = 0;
- caddr_t cp;
struct mbuf *mb, *mreq;
struct vnode *dirp = NULL;
nfsfh_t nfh;
fhandle_t *fhp;
u_quad_t tempsize;
- u_char cverf[NFSX_V3CREATEVERF];
+ struct timespec cverf;
struct mount *mp = NULL;
int tvfslocked;
int vfslocked;
@@ -1741,8 +1740,11 @@ nfsrv_create(struct nfsrv_descript *nfsd
nfsm_srvsattr(vap);
break;
case NFSV3CREATE_EXCLUSIVE:
- cp = nfsm_dissect_nonblock(caddr_t, NFSX_V3CREATEVERF);
- bcopy(cp, cverf, NFSX_V3CREATEVERF);
+ tl = nfsm_dissect_nonblock(u_int32_t *,
+ NFSX_V3CREATEVERF);
+ /* Unique bytes, endianness is not important. */
+ cverf.tv_sec = tl[0];
+ cverf.tv_nsec = tl[1];
exclusive_flag = 1;
break;
};
@@ -1788,8 +1790,7 @@ nfsrv_create(struct nfsrv_descript *nfsd
if (exclusive_flag) {
exclusive_flag = 0;
VATTR_NULL(vap);
- bcopy(cverf, (caddr_t)&vap->va_atime,
- NFSX_V3CREATEVERF);
+ vap->va_atime = cverf;
error = VOP_SETATTR(nd.ni_vp, vap, cred,
td);
}
@@ -1873,7 +1874,7 @@ nfsrv_create(struct nfsrv_descript *nfsd
}
if (v3) {
if (exclusive_flag && !error &&
- bcmp(cverf, (caddr_t)&vap->va_atime, NFSX_V3CREATEVERF))
+ bcmp(&cverf, &vap->va_atime, sizeof (cverf)))
error = EEXIST;
if (dirp == nd.ni_dvp)
diraft_ret = VOP_GETATTR(dirp, &diraft, cred, td);
From stas at FreeBSD.org Wed Jul 1 13:07:03 2009
From: stas at FreeBSD.org (Stanislav Sedov)
Date: Wed Jul 1 13:07:14 2009
Subject: svn commit: r195237 - head/usr.sbin/wake
Message-ID: <200907011307.n61D72ma013392@svn.freebsd.org>
Author: stas
Date: Wed Jul 1 13:07:02 2009
New Revision: 195237
URL: http://svn.freebsd.org/changeset/base/195237
Log:
- Fix the bug in write(2) called with incorrect parameters resulting in writes
always started from the start of the packet.
- Fix usage string (multiple addresses can be specified).
- Make the source more style(9) compliant.
- Improve error reporting (do not silently fail if something goes
wrong).
- Make functions static.
- Use warns level 6.
Approved by: re (kib)
Discussed with: Marc Balmer , brian, mbr
Modified:
head/usr.sbin/wake/Makefile
head/usr.sbin/wake/wake.c
Modified: head/usr.sbin/wake/Makefile
==============================================================================
--- head/usr.sbin/wake/Makefile Wed Jul 1 12:44:23 2009 (r195236)
+++ head/usr.sbin/wake/Makefile Wed Jul 1 13:07:02 2009 (r195237)
@@ -2,5 +2,6 @@
PROG= wake
MAN= wake.8
+WARNS?= 6
.include
Modified: head/usr.sbin/wake/wake.c
==============================================================================
--- head/usr.sbin/wake/wake.c Wed Jul 1 12:44:23 2009 (r195236)
+++ head/usr.sbin/wake/wake.c Wed Jul 1 13:07:02 2009 (r195237)
@@ -27,18 +27,6 @@
#include
__FBSDID("$FreeBSD$");
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include
-#include
-
#include
#include
#include
@@ -50,70 +38,89 @@ __FBSDID("$FreeBSD$");
#include
#include
-#define _PATH_BPF "/dev/bpf"
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include
+
+#define _PATH_BPF "/dev/bpf"
#ifndef SYNC_LEN
-#define SYNC_LEN 6
+#define SYNC_LEN 6
#endif
#ifndef DESTADDR_COUNT
-#define DESTADDR_COUNT 16
+#define DESTADDR_COUNT 16
#endif
-void usage(void);
+static void usage(void);
+static int wake(const char *iface, const char *host);
+static int bind_if_to_bpf(char const *ifname, int bpf);
+static int get_ether(char const *text, struct ether_addr *addr);
+static int send_wakeup(int bpf, struct ether_addr const *addr);
-int wake(const char *iface, const char *host);
-int bind_if_to_bpf(char const *ifname, int bpf);
-int get_ether(char const *text, struct ether_addr *addr);
-int send_wakeup(int bpf, struct ether_addr const *addr);
-
-void
+static void
usage(void)
{
- (void)fprintf(stderr, "usage: wake interface lladdr\n");
+
+ (void)fprintf(stderr, "usage: wake interface lladdr...\n");
exit(0);
}
-int
+static int
wake(const char *iface, const char *host)
{
- int res, bpf;
struct ether_addr macaddr;
+ int bpf, res;
bpf = open(_PATH_BPF, O_RDWR);
if (bpf == -1) {
- printf("no bpf\n");
- return -1;
+ warn("no bpf");
+ return (-1);
}
if (bind_if_to_bpf(iface, bpf) == -1 ||
get_ether(host, &macaddr) == -1) {
(void)close(bpf);
- return -1;
+ return (-1);
}
res = send_wakeup(bpf, &macaddr);
(void)close(bpf);
- return res;
+ return (res);
}
-int
+static int
bind_if_to_bpf(char const *ifname, int bpf)
{
struct ifreq ifr;
u_int dlt;
if (strlcpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name)) >=
- sizeof(ifr.ifr_name))
- return -1;
- if (ioctl(bpf, BIOCSETIF, &ifr) == -1)
- return -1;
- if (ioctl(bpf, BIOCGDLT, &dlt) == -1)
- return -1;
- if (dlt != DLT_EN10MB)
- return -1;
- return 0;
+ sizeof(ifr.ifr_name)) {
+ warnx("interface name too long: %s", ifname);
+ return (-1);
+ }
+ if (ioctl(bpf, BIOCSETIF, &ifr) == -1) {
+ warn("ioctl(%s)", "BIOCSETIF");
+ return (-1);
+ }
+ if (ioctl(bpf, BIOCGDLT, &dlt) == -1) {
+ warn("ioctl(%s)", "BIOCGDLT");
+ return (-1);
+ }
+ if (dlt != DLT_EN10MB) {
+ warnx("incompatible media");
+ return (-1);
+ }
+ return (0);
}
-int
+static int
get_ether(char const *text, struct ether_addr *addr)
{
struct ether_addr *paddr;
@@ -121,24 +128,26 @@ get_ether(char const *text, struct ether
paddr = ether_aton(text);
if (paddr != NULL) {
*addr = *paddr;
- return 0;
+ return (0);
}
- if (ether_hostton(text, addr))
- return -1;
- return 0;
+ if (ether_hostton(text, addr)) {
+ warnx("no match for host %s found", text);
+ return (-1);
+ }
+ return (0);
}
-int
+static int
send_wakeup(int bpf, struct ether_addr const *addr)
{
struct {
struct ether_header hdr;
u_char data[SYNC_LEN + ETHER_ADDR_LEN * DESTADDR_COUNT];
- } pkt;
- u_char *p;
- int i;
+ } __packed pkt;
ssize_t bw;
ssize_t len;
+ int i;
+ u_char *p;
(void)memset(pkt.hdr.ether_dhost, 0xff, sizeof(pkt.hdr.ether_dhost));
pkt.hdr.ether_type = htons(0);
@@ -150,12 +159,14 @@ send_wakeup(int bpf, struct ether_addr c
len = sizeof(pkt);
bw = 0;
while (len) {
- if ((bw = write(bpf, &pkt, sizeof(pkt))) == -1)
- return -1;
+ if ((bw = write(bpf, p, len)) == -1) {
+ warn("write()");
+ return (-1);
+ }
len -= bw;
p += bw;
}
- return 0;
+ return (0);
}
int
@@ -170,5 +181,5 @@ main(int argc, char *argv[])
if (wake(argv[1], argv[n]))
warnx("error sending Wake on LAN frame over %s to %s",
argv[1], argv[n]);
- return 0;
+ return (0);
}
From brde at optusnet.com.au Wed Jul 1 13:15:36 2009
From: brde at optusnet.com.au (Bruce Evans)
Date: Wed Jul 1 13:15:42 2009
Subject: svn commit: r195213 - head/usr.sbin/wake
In-Reply-To: <20090701124825.af0d205e.stas@FreeBSD.org>
References: <200906302209.n5UM9lBM093495@svn.freebsd.org>
<20090701124825.af0d205e.stas@FreeBSD.org>
Message-ID: <20090701223719.L39215@delplex.bde.org>
On Wed, 1 Jul 2009, Stanislav Sedov wrote:
> On Tue, 30 Jun 2009 22:09:47 +0000 (UTC)
> Martin Blapp mentioned:
>> Log:
>> Compiles without higher warn level
>>
>> MAN= wake.8
>>
>> -WARNS?= 2
>> -
>
> I believe you wanted something like WARNS?=6 probably? Now you disabled
> any warnings-related compiler flags entirely.
WARNS should only be set in near-top-level Makefile.inc's. Setting it
elsewhere is either a style bug to increase the warning level or a hack
to decrease the warning level. However, setting of WARNS in near-top-
level Makefile.inc's stalled several years ago at the same time as its
excessive setting in individual Makefiles. It is still not set at all
in usr.sbin/Makefile.inc, while in usr.bin its setting is commented
out "temporarily". Only the relatively simple bin directory has been
handled well -- bin/Makefile.inc and most files under it started uniformly
at WARNS=2, and bin/Makefile.inc has now reached WARNS=6, with only the
following bugs and hacks in leaf Makefiles:
% ./rmail/Makefile:WARNS?= 0
Apparently, sendmail isn't written in C yet.
% ./cat/Makefile:WARNS?= 6
Bogus override of the default to the same value. cat compiled happily
with the default WARNS of 6 for 6 years before this bug was committed
in 2009, after being fixed in 2001 to not set WARNS, so that it
automatically picked up the change of the default from 2 to 6 in 2003.
% ./csh/Makefile:WARNS?= 0
Csh was never written in C :-).
% ./ed/Makefile:WARNS?= 2
% ./pax/Makefile:WARNS?= 3
% ./pkill/Makefile:WARNS?= 5
% ./sh/Makefile:WARNS?= 2
Assorted hacks.
% ./uuidgen/Makefile:WARNS?= 6
Another bogus override of the default.
In usr.sbin, WARNS has never been turned on globally, and slightly more
than half of the makefiles don't set it locally either.
Bruce
From rwatson at FreeBSD.org Wed Jul 1 13:22:09 2009
From: rwatson at FreeBSD.org (Robert Watson)
Date: Wed Jul 1 13:22:15 2009
Subject: svn commit: r195238 - head/sys/kern
Message-ID: <200907011322.n61DM8fg013756@svn.freebsd.org>
Author: rwatson
Date: Wed Jul 1 13:22:08 2009
New Revision: 195238
URL: http://svn.freebsd.org/changeset/base/195238
Log:
Fix link(2) auditing: use the second audit record path for the new object
name.
Approved by: re (kib)
MFC after: 3 days
Modified:
head/sys/kern/vfs_syscalls.c
Modified: head/sys/kern/vfs_syscalls.c
==============================================================================
--- head/sys/kern/vfs_syscalls.c Wed Jul 1 13:07:02 2009 (r195237)
+++ head/sys/kern/vfs_syscalls.c Wed Jul 1 13:22:08 2009 (r195238)
@@ -1583,7 +1583,7 @@ kern_linkat(struct thread *td, int fd1,
VFS_UNLOCK_GIANT(vfslocked);
return (error);
}
- NDINIT_AT(&nd, CREATE, LOCKPARENT | SAVENAME | MPSAFE | AUDITVNODE1,
+ NDINIT_AT(&nd, CREATE, LOCKPARENT | SAVENAME | MPSAFE | AUDITVNODE2,
segflg, path2, fd2, td);
if ((error = namei(&nd)) == 0) {
lvfslocked = NDHASGIANT(&nd);
From brde at optusnet.com.au Wed Jul 1 13:58:07 2009
From: brde at optusnet.com.au (Bruce Evans)
Date: Wed Jul 1 13:58:14 2009
Subject: svn commit: r194681 - head/usr.sbin/wpa/ndis_events
In-Reply-To: <20090701152300.N96900@mp2.macomnet.net>
References: <200906230555.n5N5tubJ065618@svn.freebsd.org>
<20090623080015.GK48776@hoeg.nl>
<20090623125125.F1156@mp2.macomnet.net> <86ljn923dw.fsf@ds4.des.no>
<20090701152300.N96900@mp2.macomnet.net>
Message-ID: <20090701234518.E2035@besplex.bde.org>
On Wed, 1 Jul 2009, Maxim Konovalov wrote:
> On Tue, 30 Jun 2009, 16:38+0200, Dag-Erling Smrgrav wrote:
>
>> Maxim Konovalov writes:
>>> fixed, thanks.
>>
>> It still says
>>
>> static void
>> usage()
>>
>> I know this is allowed by C99, but it's not allowed by style(9).
>>
> From style(9):
>
> static void
> usage()
> {
> /* Insert an empty line if the function has no local variables. */
> ...
>
> Apart from the empty line, what's wrong?
style(9) hasn't been converted to its own religion yet :-). This isn't
exactly a bug, since an old-style Standard C function definition is
still Normal for usage(). Normal file order is a prototype for usage(),
then main() calling usage(), then usage(), so a separate prototype for
usage() is Normal. Then usage an old-style definition for usage() breaks
K&R support without affecting Standard C support.
Bruce
From des at des.no Wed Jul 1 14:08:44 2009
From: des at des.no (=?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?=)
Date: Wed Jul 1 14:08:56 2009
Subject: svn commit: r194628 - head/lib/ncurses/ncurses
In-Reply-To: <20090630193712.GA5446@roadrunner.spoerlein.net> ("Ulrich
=?utf-8?Q?Sp=C3=B6rlein=22's?= message of "Tue, 30 Jun 2009 21:37:12
+0200")
References: <86prcl23k8.fsf@ds4.des.no>
<20090630.085955.63054488.imp@bsdimp.com>
<20090630.094632.195416436.imp@bsdimp.com>
<20090630193712.GA5446@roadrunner.spoerlein.net>
Message-ID: <86vdmca42d.fsf@ds4.des.no>
Ulrich Sp?rlein writes:
> Btw, I do like the current behaviour, but if $PAGER can be coerced into
> not clearing screen after exit, I think more people could be persuaded.
cat >~/.termcap
my-xterm:\
ti@:te@:tc=xterm
^D
DES
--
Dag-Erling Sm?rgrav - des@des.no
From des at des.no Wed Jul 1 14:56:40 2009
From: des at des.no (=?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?=)
Date: Wed Jul 1 14:56:51 2009
Subject: svn commit: r194681 - head/usr.sbin/wpa/ndis_events
In-Reply-To: <20090701152300.N96900@mp2.macomnet.net> (Maxim Konovalov's
message of "Wed, 1 Jul 2009 15:25:33 +0400 (MSD)")
References: <200906230555.n5N5tubJ065618@svn.freebsd.org>
<20090623080015.GK48776@hoeg.nl>
<20090623125125.F1156@mp2.macomnet.net> <86ljn923dw.fsf@ds4.des.no>
<20090701152300.N96900@mp2.macomnet.net>
Message-ID: <86my7oa1uh.fsf@ds4.des.no>
Maxim Konovalov writes:
> From style(9):
>
> static void
> usage()
> ...
>
> Apart from the empty line, what's wrong?
Missing void. I wasn't aware that style(9) was incorrect in that
respect.
DES
--
Dag-Erling Sm?rgrav - des@des.no
From des at des.no Wed Jul 1 15:05:13 2009
From: des at des.no (=?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?=)
Date: Wed Jul 1 15:05:19 2009
Subject: svn commit: r194789 - head/usr.bin/usbhidctl
In-Reply-To: <20090701214927.V39172@delplex.bde.org> (Bruce Evans's message of
"Wed, 1 Jul 2009 22:19:58 +1000 (EST)")
References: <200906232316.n5NNG1iT094289@svn.freebsd.org>
<20090625154007.H33864@delplex.bde.org> <4A43B727.7010204@delphij.net>
<20090627033608.P35379@delplex.bde.org> <8663ed2265.fsf@ds4.des.no>
<20090701214927.V39172@delplex.bde.org>
Message-ID: <86iqica1g8.fsf@ds4.des.no>
Bruce Evans writes:
> "Dag-Erling Sm?rgrav" writes:
> > BTW, there are numerous style issues in sbin/reboot/reboot.c.
> Really? According to knfom, it is 94.772% knf (up from 94.520% in
> ~5.2 and 92.896% in Lite2). It is a small program so it is easy to
> get right, but anything above 90% is a nice colour. (94.520% is due
> to 7 lines fixed by indent(1) and 5 lines broken by indent(1)).
I guess it depends on your definition of "numerous".
The most obvious ones (since I was looking at usage()) were the missing
void in the definition of usage() and the missing blank line at the top
of the function. Other than that: #include directives are unordered,
local variables in main() are declared in the wrong order, geteuid() is
used as a predicate, and the required parentheses around the return
value in get_pageins() are missing.
I would also use fopen(3) and fprintf(3) instead of open(2) and write(2)
to write nextboot.conf, and I would check that argc is 0 after the
getopt(3) loop.
DES
--
Dag-Erling Sm?rgrav - des@des.no
From des at des.no Wed Jul 1 15:09:59 2009
From: des at des.no (=?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?=)
Date: Wed Jul 1 15:10:05 2009
Subject: svn commit: r194628 - head/lib/ncurses/ncurses
In-Reply-To: <86vdmca42d.fsf@ds4.des.no> ("Dag-Erling =?utf-8?Q?Sm=C3=B8rg?=
=?utf-8?Q?rav=22's?= message of "Wed, 01 Jul 2009 16:08:42 +0200")
References: <86prcl23k8.fsf@ds4.des.no>
<20090630.085955.63054488.imp@bsdimp.com>
<20090630.094632.195416436.imp@bsdimp.com>
<20090630193712.GA5446@roadrunner.spoerlein.net>
<86vdmca42d.fsf@ds4.des.no>
Message-ID: <86eit0a18a.fsf@ds4.des.no>
better yet:
if [ $TERM = xterm ] ; then
export TERMCAP=myterm:ti@:te@:tc=xterm:
export TERM=myterm
fi
DES
--
Dag-Erling Sm?rgrav - des@des.no
From rwatson at FreeBSD.org Wed Jul 1 15:37:24 2009
From: rwatson at FreeBSD.org (Robert Watson)
Date: Wed Jul 1 15:37:30 2009
Subject: svn commit: r195242 - in head/sys: kern security/audit
Message-ID: <200907011537.n61FbN8P016707@svn.freebsd.org>
Author: rwatson
Date: Wed Jul 1 15:37:23 2009
New Revision: 195242
URL: http://svn.freebsd.org/changeset/base/195242
Log:
Audit the file descriptor number passed to lseek(2).
Approved by: re (kib)
MFC after: 3 days
Modified:
head/sys/kern/vfs_syscalls.c
head/sys/security/audit/audit_bsm.c
Modified: head/sys/kern/vfs_syscalls.c
==============================================================================
--- head/sys/kern/vfs_syscalls.c Wed Jul 1 15:11:23 2009 (r195241)
+++ head/sys/kern/vfs_syscalls.c Wed Jul 1 15:37:23 2009 (r195242)
@@ -1924,6 +1924,7 @@ lseek(td, uap)
int error, noneg;
int vfslocked;
+ AUDIT_ARG_FD(uap->fd);
if ((error = fget(td, uap->fd, &fp)) != 0)
return (error);
if (!(fp->f_ops->fo_flags & DFLAG_SEEKABLE)) {
Modified: head/sys/security/audit/audit_bsm.c
==============================================================================
--- head/sys/security/audit/audit_bsm.c Wed Jul 1 15:11:23 2009 (r195241)
+++ head/sys/security/audit/audit_bsm.c Wed Jul 1 15:37:23 2009 (r195242)
@@ -679,7 +679,6 @@ kaudit_to_bsm(struct kaudit_record *kar,
case AUE_GETRESUID:
case AUE_GETRESGID:
case AUE_KQUEUE:
- case AUE_LSEEK:
case AUE_MODLOAD:
case AUE_MODUNLOAD:
case AUE_MSGSYS:
@@ -870,6 +869,7 @@ kaudit_to_bsm(struct kaudit_record *kar,
case AUE_FUTIMES:
case AUE_GETDIRENTRIES:
case AUE_GETDIRENTRIESATTR:
+ case AUE_LSEEK:
case AUE_POLL:
case AUE_READ:
case AUE_READV:
From trasz at FreeBSD.org Wed Jul 1 15:52:20 2009
From: trasz at FreeBSD.org (Edward Tomasz Napierala)
Date: Wed Jul 1 15:52:37 2009
Subject: svn commit: r195243 - head/bin/chmod
Message-ID: <200907011552.n61FqJL5016996@svn.freebsd.org>
Author: trasz
Date: Wed Jul 1 15:52:19 2009
New Revision: 195243
URL: http://svn.freebsd.org/changeset/base/195243
Log:
With NFSv4 ACLs, it is possible that applying a mode to an ACL which
is identical to the mode computed from that ACL will modify the ACL.
For example, mode computed from the following ACL is 0600:
user:kamila:rwx--------C--:------:allow
owner@:--x-----------:------:deny
owner@:rw-p---A-W-Co-:------:allow
group@:rwxp----------:------:deny
group@:--------------:------:allow
everyone@:rwxp---A-W-Co-:------:deny
everyone@:------a-R-c--s:------:allow
However, applying that mode (chmod 0600) changes the ACL into this:
user:kamila:rwx-----------:------:deny
user:kamila:rwx--------C--:------:allow
owner@:--x-----------:------:deny
owner@:rw-p---A-W-Co-:------:allow
group@:rwxp----------:------:deny
group@:--------------:------:allow
everyone@:rwxp---A-W-Co-:------:deny
everyone@:------a-R-c--s:------:allow
In chmod(1) utility, there is an optimisation, which makes it not
call chmod(2) if the mode of the file is the same as the new mode.
Disable that optimisation for files which may have NFSv4 ACLs.
Reviewed by: rwatson
Approved by: re (kib)
Modified:
head/bin/chmod/chmod.c
Modified: head/bin/chmod/chmod.c
==============================================================================
--- head/bin/chmod/chmod.c Wed Jul 1 15:37:23 2009 (r195242)
+++ head/bin/chmod/chmod.c Wed Jul 1 15:52:19 2009 (r195243)
@@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$");
#include
static void usage(void);
+static int may_have_nfs4acl(const FTSENT *ent);
int
main(int argc, char *argv[])
@@ -180,8 +181,14 @@ done: argv += optind;
break;
}
newmode = getmode(set, p->fts_statp->st_mode);
- if ((newmode & ALLPERMS) == (p->fts_statp->st_mode & ALLPERMS))
- continue;
+ /*
+ * With NFSv4 ACLs, it is possible that applying a mode
+ * identical to the one computed from an ACL will change
+ * that ACL.
+ */
+ if (may_have_nfs4acl(p) == 0 &&
+ (newmode & ALLPERMS) == (p->fts_statp->st_mode & ALLPERMS))
+ continue;
if ((*change_mode)(p->fts_accpath, newmode) && !fflag) {
warn("%s", p->fts_path);
rval = 1;
@@ -219,3 +226,24 @@ usage(void)
"usage: chmod [-fhv] [-R [-H | -L | -P]] mode file ...\n");
exit(1);
}
+
+static int
+may_have_nfs4acl(const FTSENT *ent)
+{
+ int ret;
+ static dev_t previous_dev = (dev_t)-1;
+ static int supports_acls = -1;
+
+ if (previous_dev != ent->fts_statp->st_dev) {
+ previous_dev = ent->fts_statp->st_dev;
+ supports_acls = 0;
+
+ ret = pathconf(ent->fts_accpath, _PC_ACL_NFS4);
+ if (ret > 0)
+ supports_acls = 1;
+ else if (ret < 0 && errno != EINVAL)
+ warn("%s", ent->fts_path);
+ }
+
+ return (supports_acls);
+}
From jhb at FreeBSD.org Wed Jul 1 15:52:29 2009
From: jhb at FreeBSD.org (John Baldwin)
Date: Wed Jul 1 15:52:37 2009
Subject: svn commit: r195181 - in head/sys: nfsclient nfsserver
In-Reply-To: <20090630144904.GA41936@troutmask.apl.washington.edu>
References: <200906300318.n5U3Ipr4066645@svn.freebsd.org>
<20090630051641.T22887@maildrop.int.zabbadoz.net>
<20090630144904.GA41936@troutmask.apl.washington.edu>
Message-ID: <4A4B863A.7090304@FreeBSD.org>
Steve Kargl wrote:
> On Tue, Jun 30, 2009 at 05:17:48AM +0000, bz0fbd@zabbadoz.net wrote:
>> On Tue, 30 Jun 2009, John Baldwin wrote:
>>
>>> Author: jhb
>>> Date: Tue Jun 30 03:18:51 2009
>>> New Revision: 195181
>>> URL: http://svn.freebsd.org/changeset/base/195181
>>>
>>> Log:
>>> Fix build with NFS_LEGACYRPC enabled after the socket upcall locking
>>> changes.
>> is this really a good idea, considering that NFS_LEGACYRPC is on the
>> "removal list" for 8.0?
>
> Yes.
>
> 1) This option definitely worked on April 18th.
> 2) The option was broken by a commit that was never tested! If anything
> this should remind committers to either get a code review or test
> their patch.
That isn't a completely fair assessment. The patch was most certainly
tested with NFS in the default configuration (!NFS_LEGACYRPC). It is
also a good idea to fix the option until such time as it is formally
removed, however.
--
John Baldwin
From jfv at FreeBSD.org Wed Jul 1 16:13:02 2009
From: jfv at FreeBSD.org (Jack F Vogel)
Date: Wed Jul 1 16:13:08 2009
Subject: svn commit: r195244 - head/sys/dev/ixgbe
Message-ID: <200907011613.n61GD1Um017439@svn.freebsd.org>
Author: jfv
Date: Wed Jul 1 16:13:01 2009
New Revision: 195244
URL: http://svn.freebsd.org/changeset/base/195244
Log:
Multiqueue RX is not correctly enabled on the new 82599
adapter, the SRRCTL register needs to be setup per queue.
Approved by: re
Modified:
head/sys/dev/ixgbe/ixgbe.c
Modified: head/sys/dev/ixgbe/ixgbe.c
==============================================================================
--- head/sys/dev/ixgbe/ixgbe.c Wed Jul 1 15:52:19 2009 (r195243)
+++ head/sys/dev/ixgbe/ixgbe.c Wed Jul 1 16:13:01 2009 (r195244)
@@ -46,7 +46,7 @@ int ixgbe_display_debug_stat
/*********************************************************************
* Driver version
*********************************************************************/
-char ixgbe_driver_version[] = "1.8.7";
+char ixgbe_driver_version[] = "1.8.8";
/*********************************************************************
* PCI Device ID Table
@@ -452,7 +452,7 @@ ixgbe_attach(device_t dev)
** system mbuf allocation. Tuning nmbclusters
** can alleviate this.
*/
- if ((adapter->num_queues > 1) && (nmbclusters > 0 )){
+ if (nmbclusters > 0 ) {
int s;
/* Calculate the total RX mbuf needs */
s = (ixgbe_rxd * adapter->num_queues) * ixgbe_total_ports;
@@ -3629,7 +3629,7 @@ ixgbe_initialize_receive_units(struct ad
struct rx_ring *rxr = adapter->rx_rings;
struct ixgbe_hw *hw = &adapter->hw;
struct ifnet *ifp = adapter->ifp;
- u32 rxctrl, fctrl, srrctl, rxcsum;
+ u32 bufsz, rxctrl, fctrl, srrctl, rxcsum;
u32 reta, mrqc = 0, hlreg, random[10];
@@ -3648,45 +3648,20 @@ ixgbe_initialize_receive_units(struct ad
fctrl |= IXGBE_FCTRL_PMCF;
IXGBE_WRITE_REG(hw, IXGBE_FCTRL, fctrl);
- srrctl = IXGBE_READ_REG(hw, IXGBE_SRRCTL(0));
- srrctl &= ~IXGBE_SRRCTL_BSIZEHDR_MASK;
- srrctl &= ~IXGBE_SRRCTL_BSIZEPKT_MASK;
-
- hlreg = IXGBE_READ_REG(hw, IXGBE_HLREG0);
/* Set for Jumbo Frames? */
+ hlreg = IXGBE_READ_REG(hw, IXGBE_HLREG0);
if (ifp->if_mtu > ETHERMTU) {
hlreg |= IXGBE_HLREG0_JUMBOEN;
- srrctl |= 4096 >> IXGBE_SRRCTL_BSIZEPKT_SHIFT;
+ bufsz = 4096 >> IXGBE_SRRCTL_BSIZEPKT_SHIFT;
} else {
hlreg &= ~IXGBE_HLREG0_JUMBOEN;
- srrctl |= 2048 >> IXGBE_SRRCTL_BSIZEPKT_SHIFT;
+ bufsz = 2048 >> IXGBE_SRRCTL_BSIZEPKT_SHIFT;
}
IXGBE_WRITE_REG(hw, IXGBE_HLREG0, hlreg);
- if (rxr->hdr_split) {
- /* Use a standard mbuf for the header */
- srrctl |= ((IXGBE_RX_HDR << IXGBE_SRRCTL_BSIZEHDRSIZE_SHIFT)
- & IXGBE_SRRCTL_BSIZEHDR_MASK);
- srrctl |= IXGBE_SRRCTL_DESCTYPE_HDR_SPLIT_ALWAYS;
- if (adapter->hw.mac.type == ixgbe_mac_82599EB) {
- /* PSRTYPE must be initialized in 82599 */
- u32 psrtype = IXGBE_PSRTYPE_TCPHDR |
- IXGBE_PSRTYPE_UDPHDR |
- IXGBE_PSRTYPE_IPV4HDR |
- IXGBE_PSRTYPE_IPV6HDR;
- psrtype |= (7 << 29);
- IXGBE_WRITE_REG(hw, IXGBE_PSRTYPE(0), psrtype);
- }
- } else
- srrctl |= IXGBE_SRRCTL_DESCTYPE_ADV_ONEBUF;
-
- if (adapter->hw.mac.type == ixgbe_mac_82599EB)
- srrctl |= IXGBE_SRRCTL_DROP_EN;
-
- IXGBE_WRITE_REG(hw, IXGBE_SRRCTL(0), srrctl);
-
for (int i = 0; i < adapter->num_queues; i++, rxr++) {
u64 rdba = rxr->rxdma.dma_paddr;
+
/* Setup the Base and Length of the Rx Descriptor Ring */
IXGBE_WRITE_REG(hw, IXGBE_RDBAL(i),
(rdba & 0x00000000ffffffffULL));
@@ -3694,6 +3669,29 @@ ixgbe_initialize_receive_units(struct ad
IXGBE_WRITE_REG(hw, IXGBE_RDLEN(i),
adapter->num_rx_desc * sizeof(union ixgbe_adv_rx_desc));
+ /* Set up the SRRCTL register */
+ srrctl = IXGBE_READ_REG(hw, IXGBE_SRRCTL(i));
+ srrctl &= ~IXGBE_SRRCTL_BSIZEHDR_MASK;
+ srrctl &= ~IXGBE_SRRCTL_BSIZEPKT_MASK;
+ srrctl |= bufsz;
+ if (rxr->hdr_split) {
+ /* Use a standard mbuf for the header */
+ srrctl |= ((IXGBE_RX_HDR <<
+ IXGBE_SRRCTL_BSIZEHDRSIZE_SHIFT)
+ & IXGBE_SRRCTL_BSIZEHDR_MASK);
+ srrctl |= IXGBE_SRRCTL_DESCTYPE_HDR_SPLIT_ALWAYS;
+ if (adapter->hw.mac.type == ixgbe_mac_82599EB) {
+ /* PSRTYPE must be initialized in 82599 */
+ u32 psrtype = IXGBE_PSRTYPE_TCPHDR |
+ IXGBE_PSRTYPE_UDPHDR |
+ IXGBE_PSRTYPE_IPV4HDR |
+ IXGBE_PSRTYPE_IPV6HDR;
+ IXGBE_WRITE_REG(hw, IXGBE_PSRTYPE(0), psrtype);
+ }
+ } else
+ srrctl |= IXGBE_SRRCTL_DESCTYPE_ADV_ONEBUF;
+ IXGBE_WRITE_REG(hw, IXGBE_SRRCTL(i), srrctl);
+
/* Setup the HW Rx Head and Tail Descriptor Pointers */
IXGBE_WRITE_REG(hw, IXGBE_RDH(i), 0);
IXGBE_WRITE_REG(hw, IXGBE_RDT(i), 0);
@@ -3722,10 +3720,7 @@ ixgbe_initialize_receive_units(struct ad
IXGBE_WRITE_REG(hw, IXGBE_RSSRK(i), random[i]);
/* Perform hash on these packet types */
- if (adapter->hw.mac.type == ixgbe_mac_82599EB)
- mrqc = IXGBE_MRQC_VMDQRSS32EN;
-
- mrqc |= IXGBE_MRQC_RSSEN
+ mrqc = IXGBE_MRQC_RSSEN
| IXGBE_MRQC_RSS_FIELD_IPV4
| IXGBE_MRQC_RSS_FIELD_IPV4_TCP
| IXGBE_MRQC_RSS_FIELD_IPV4_UDP
From rmacklem at FreeBSD.org Wed Jul 1 16:38:19 2009
From: rmacklem at FreeBSD.org (Rick Macklem)
Date: Wed Jul 1 16:38:31 2009
Subject: svn commit: r195245 - head/sys/rpc
Message-ID: <200907011638.n61GcIUM017951@svn.freebsd.org>
Author: rmacklem
Date: Wed Jul 1 16:38:18 2009
New Revision: 195245
URL: http://svn.freebsd.org/changeset/base/195245
Log:
Make sure that cr_error is set to ESHUTDOWN when closing the connection.
This is normally done by a loop in clnt_dg_close(), but requests that aren't
in the pending queue at the time of closing, don't get set. This avoids a
panic in xdrmbuf_create() when it is called with a NULL cr_mrep if
cr_error doesn't get set to ESHUTDOWN while closing.
Reviewed by: dfr
Approved by: re (Ken Smith), kib (mentor)
Modified:
head/sys/rpc/clnt_dg.c
Modified: head/sys/rpc/clnt_dg.c
==============================================================================
--- head/sys/rpc/clnt_dg.c Wed Jul 1 16:13:01 2009 (r195244)
+++ head/sys/rpc/clnt_dg.c Wed Jul 1 16:38:18 2009 (r195245)
@@ -547,11 +547,13 @@ get_reply:
tv -= time_waited;
if (tv > 0) {
- if (cu->cu_closing || cu->cu_closed)
+ if (cu->cu_closing || cu->cu_closed) {
error = 0;
- else
+ cr->cr_error = ESHUTDOWN;
+ } else {
error = msleep(cr, &cs->cs_lock,
cu->cu_waitflag, cu->cu_waitchan, tv);
+ }
} else {
error = EWOULDBLOCK;
}
From rmacklem at FreeBSD.org Wed Jul 1 16:42:04 2009
From: rmacklem at FreeBSD.org (Rick Macklem)
Date: Wed Jul 1 16:42:10 2009
Subject: svn commit: r195246 - head/sys/rpc/rpcsec_gss
Message-ID: <200907011642.n61Gg3oi018130@svn.freebsd.org>
Author: rmacklem
Date: Wed Jul 1 16:42:03 2009
New Revision: 195246
URL: http://svn.freebsd.org/changeset/base/195246
Log:
When unmounting an NFS mount using sec=krb5[ip], the umount system
call could get hung sleeping on "gsssta" if the credentials for a user
that had been accessing the mount point have expired. This happened
because rpc_gss_destroy_context() would end up calling itself when the
"destroy context" RPC was attempted, trying to refresh the credentials.
This patch just checks for this case in rpc_gss_refresh() and returns
without attempting the refresh, which avoids the recursive call to
rpc_gss_destroy_context() and the subsequent hang.
Reviewed by: dfr
Approved by: re (Ken Smith), kib (mentor)
Modified:
head/sys/rpc/rpcsec_gss/rpcsec_gss.c
Modified: head/sys/rpc/rpcsec_gss/rpcsec_gss.c
==============================================================================
--- head/sys/rpc/rpcsec_gss/rpcsec_gss.c Wed Jul 1 16:38:18 2009 (r195245)
+++ head/sys/rpc/rpcsec_gss/rpcsec_gss.c Wed Jul 1 16:42:03 2009 (r195246)
@@ -929,6 +929,20 @@ rpc_gss_refresh(AUTH *auth, void *msg)
{
struct rpc_msg *reply = (struct rpc_msg *) msg;
rpc_gss_options_ret_t options;
+ struct rpc_gss_data *gd;
+
+ gd = AUTH_PRIVATE(auth);
+
+ /*
+ * If the context is in DESTROYING state, then just return, since
+ * there is no point in refreshing the credentials.
+ */
+ mtx_lock(&gd->gd_lock);
+ if (gd->gd_state == RPCSEC_GSS_DESTROYING) {
+ mtx_unlock(&gd->gd_lock);
+ return (FALSE);
+ }
+ mtx_unlock(&gd->gd_lock);
/*
* If the error was RPCSEC_GSS_CREDPROBLEM of
From rwatson at FreeBSD.org Wed Jul 1 16:56:57 2009
From: rwatson at FreeBSD.org (Robert Watson)
Date: Wed Jul 1 16:57:03 2009
Subject: svn commit: r195247 - in head/sys: kern security/audit
Message-ID: <200907011656.n61Guuii018456@svn.freebsd.org>
Author: rwatson
Date: Wed Jul 1 16:56:56 2009
New Revision: 195247
URL: http://svn.freebsd.org/changeset/base/195247
Log:
When auditing unmount(2), capture FSID arguments as regular text strings
rather than as paths, which would lead to them being treated as relative
pathnames and hence confusingly converted into absolute pathnames.
Capture flags to unmount(2) via an argument token.
Approved by: re (audit argument blanket)
MFC after: 3 days
Modified:
head/sys/kern/vfs_mount.c
head/sys/security/audit/audit_bsm.c
Modified: head/sys/kern/vfs_mount.c
==============================================================================
--- head/sys/kern/vfs_mount.c Wed Jul 1 16:42:03 2009 (r195246)
+++ head/sys/kern/vfs_mount.c Wed Jul 1 16:56:56 2009 (r195247)
@@ -1113,6 +1113,7 @@ unmount(td, uap)
char *pathbuf;
int error, id0, id1;
+ AUDIT_ARG_VALUE(uap->flags);
if (jailed(td->td_ucred) || usermount == 0) {
error = priv_check(td, PRIV_VFS_UNMOUNT);
if (error)
@@ -1125,9 +1126,9 @@ unmount(td, uap)
free(pathbuf, M_TEMP);
return (error);
}
- AUDIT_ARG_UPATH(td, pathbuf, ARG_UPATH1);
mtx_lock(&Giant);
if (uap->flags & MNT_BYFSID) {
+ AUDIT_ARG_TEXT(pathbuf);
/* Decode the filesystem ID. */
if (sscanf(pathbuf, "FSID:%d:%d", &id0, &id1) != 2) {
mtx_unlock(&Giant);
@@ -1143,6 +1144,7 @@ unmount(td, uap)
}
mtx_unlock(&mountlist_mtx);
} else {
+ AUDIT_ARG_UPATH(td, pathbuf, ARG_UPATH1);
mtx_lock(&mountlist_mtx);
TAILQ_FOREACH_REVERSE(mp, &mountlist, mntlist, mnt_list) {
if (strcmp(mp->mnt_stat.f_mntonname, pathbuf) == 0)
Modified: head/sys/security/audit/audit_bsm.c
==============================================================================
--- head/sys/security/audit/audit_bsm.c Wed Jul 1 16:42:03 2009 (r195246)
+++ head/sys/security/audit/audit_bsm.c Wed Jul 1 16:56:56 2009 (r195247)
@@ -1070,7 +1070,15 @@ kaudit_to_bsm(struct kaudit_record *kar,
break;
case AUE_UMOUNT:
+ if (ARG_IS_VALID(kar, ARG_VALUE)) {
+ tok = au_to_arg32(1, "flags", ar->ar_arg_value);
+ kau_write(rec, tok);
+ }
UPATH1_VNODE1_TOKENS;
+ if (ARG_IS_VALID(kar, ARG_TEXT)) {
+ tok = au_to_text(ar->ar_arg_text);
+ kau_write(rec, tok);
+ }
break;
case AUE_MSGCTL:
From jhb at FreeBSD.org Wed Jul 1 17:20:08 2009
From: jhb at FreeBSD.org (John Baldwin)
Date: Wed Jul 1 17:20:21 2009
Subject: svn commit: r195249 - in head/sys: amd64/amd64 amd64/include
amd64/isa i386/i386 i386/include i386/isa kern sys
Message-ID: <200907011720.n61HK7c1018977@svn.freebsd.org>
Author: jhb
Date: Wed Jul 1 17:20:07 2009
New Revision: 195249
URL: http://svn.freebsd.org/changeset/base/195249
Log:
Improve the handling of cpuset with interrupts.
- For x86, change the interrupt source method to assign an interrupt source
to a specific CPU to return an error value instead of void, thus allowing
it to fail.
- If moving an interrupt to a CPU fails due to a lack of IDT vectors in the
destination CPU, fail the request with ENOSPC rather than panicing.
- For MSI interrupts on x86 (but not MSI-X), only allow cpuset to be used
on the first interrupt in a group. Moving the first interrupt in a group
moves the entire group.
- Use the icu_lock to protect intr_next_cpu() on x86 instead of the
intr_table_lock to fix a LOR introduced in the last set of MSI changes.
- Add a new privilege PRIV_SCHED_CPUSET_INTR for using cpuset with
interrupts. Previously, binding an interrupt to a CPU only performed a
privilege check if the interrupt had an interrupt thread. Interrupts
without a thread could be bound by non-root users as a result.
- If an interrupt event's assign_cpu method fails, then restore the original
cpuset mask for the associated interrupt thread.
Approved by: re (kib)
Modified:
head/sys/amd64/amd64/intr_machdep.c
head/sys/amd64/amd64/io_apic.c
head/sys/amd64/amd64/local_apic.c
head/sys/amd64/amd64/msi.c
head/sys/amd64/include/intr_machdep.h
head/sys/amd64/isa/atpic.c
head/sys/i386/i386/intr_machdep.c
head/sys/i386/i386/io_apic.c
head/sys/i386/i386/local_apic.c
head/sys/i386/i386/msi.c
head/sys/i386/include/intr_machdep.h
head/sys/i386/isa/atpic.c
head/sys/kern/kern_intr.c
head/sys/sys/priv.h
Modified: head/sys/amd64/amd64/intr_machdep.c
==============================================================================
--- head/sys/amd64/amd64/intr_machdep.c Wed Jul 1 17:06:56 2009 (r195248)
+++ head/sys/amd64/amd64/intr_machdep.c Wed Jul 1 17:20:07 2009 (r195249)
@@ -163,8 +163,8 @@ intr_lookup_source(int vector)
}
int
-intr_add_handler(const char *name, int vector, driver_filter_t filter,
- driver_intr_t handler, void *arg, enum intr_type flags, void **cookiep)
+intr_add_handler(const char *name, int vector, driver_filter_t filter,
+ driver_intr_t handler, void *arg, enum intr_type flags, void **cookiep)
{
struct intsrc *isrc;
int error;
@@ -302,7 +302,8 @@ static int
intr_assign_cpu(void *arg, u_char cpu)
{
#ifdef SMP
- struct intsrc *isrc;
+ struct intsrc *isrc;
+ int error;
/*
* Don't do anything during early boot. We will pick up the
@@ -311,10 +312,11 @@ intr_assign_cpu(void *arg, u_char cpu)
if (assign_cpu && cpu != NOCPU) {
isrc = arg;
mtx_lock(&intr_table_lock);
- isrc->is_pic->pic_assign_cpu(isrc, cpu_apic_ids[cpu]);
+ error = isrc->is_pic->pic_assign_cpu(isrc, cpu_apic_ids[cpu]);
mtx_unlock(&intr_table_lock);
- }
- return (0);
+ } else
+ error = 0;
+ return (error);
#else
return (EOPNOTSUPP);
#endif
@@ -371,7 +373,7 @@ intr_init(void *dummy __unused)
intrcnt_setname("???", 0);
intrcnt_index = 1;
STAILQ_INIT(&pics);
- mtx_init(&intr_table_lock, "intr sources", NULL, MTX_DEF | MTX_RECURSE);
+ mtx_init(&intr_table_lock, "intr sources", NULL, MTX_DEF);
mtx_init(&intrcnt_lock, "intrcnt", NULL, MTX_SPIN);
}
SYSINIT(intr_init, SI_SUB_INTR, SI_ORDER_FIRST, intr_init, NULL);
@@ -441,14 +443,14 @@ intr_next_cpu(void)
if (!assign_cpu)
return (cpu_apic_ids[0]);
- mtx_lock(&intr_table_lock);
+ mtx_lock_spin(&icu_lock);
apic_id = cpu_apic_ids[current_cpu];
do {
current_cpu++;
if (current_cpu > mp_maxid)
current_cpu = 0;
} while (!(intr_cpus & (1 << current_cpu)));
- mtx_unlock(&intr_table_lock);
+ mtx_unlock_spin(&icu_lock);
return (apic_id);
}
@@ -489,7 +491,6 @@ static void
intr_shuffle_irqs(void *arg __unused)
{
struct intsrc *isrc;
- u_int apic_id;
int i;
/* Don't bother on UP. */
@@ -505,13 +506,17 @@ intr_shuffle_irqs(void *arg __unused)
/*
* If this event is already bound to a CPU,
* then assign the source to that CPU instead
- * of picking one via round-robin.
+ * of picking one via round-robin. Note that
+ * this is careful to only advance the
+ * round-robin if the CPU assignment succeeds.
*/
if (isrc->is_event->ie_cpu != NOCPU)
- apic_id = isrc->is_event->ie_cpu;
- else
- apic_id = intr_next_cpu();
- isrc->is_pic->pic_assign_cpu(isrc, apic_id);
+ (void)isrc->is_pic->pic_assign_cpu(isrc,
+ isrc->is_event->ie_cpu);
+ else if (isrc->is_pic->pic_assign_cpu(isrc,
+ cpu_apic_ids[current_cpu]) == 0)
+ (void)intr_next_cpu();
+
}
}
mtx_unlock(&intr_table_lock);
Modified: head/sys/amd64/amd64/io_apic.c
==============================================================================
--- head/sys/amd64/amd64/io_apic.c Wed Jul 1 17:06:56 2009 (r195248)
+++ head/sys/amd64/amd64/io_apic.c Wed Jul 1 17:20:07 2009 (r195249)
@@ -120,7 +120,7 @@ static int ioapic_source_pending(struct
static int ioapic_config_intr(struct intsrc *isrc, enum intr_trigger trig,
enum intr_polarity pol);
static void ioapic_resume(struct pic *pic);
-static void ioapic_assign_cpu(struct intsrc *isrc, u_int apic_id);
+static int ioapic_assign_cpu(struct intsrc *isrc, u_int apic_id);
static void ioapic_program_intpin(struct ioapic_intsrc *intpin);
static STAILQ_HEAD(,ioapic) ioapic_list = STAILQ_HEAD_INITIALIZER(ioapic_list);
@@ -322,7 +322,7 @@ ioapic_program_intpin(struct ioapic_ints
mtx_unlock_spin(&icu_lock);
}
-static void
+static int
ioapic_assign_cpu(struct intsrc *isrc, u_int apic_id)
{
struct ioapic_intsrc *intpin = (struct ioapic_intsrc *)isrc;
@@ -342,7 +342,7 @@ ioapic_assign_cpu(struct intsrc *isrc, u
old_vector = intpin->io_vector;
old_id = intpin->io_cpu;
if (old_vector && apic_id == old_id)
- return;
+ return (0);
/*
* Allocate an APIC vector for this interrupt pin. Once
@@ -350,6 +350,9 @@ ioapic_assign_cpu(struct intsrc *isrc, u
*/
intpin->io_cpu = apic_id;
intpin->io_vector = apic_alloc_vector(apic_id, intpin->io_irq);
+ if (intpin->io_vector == 0)
+ return (ENOSPC);
+
if (bootverbose) {
printf("ioapic%u: routing intpin %u (", io->io_id,
intpin->io_intpin);
@@ -364,6 +367,7 @@ ioapic_assign_cpu(struct intsrc *isrc, u
*/
if (old_vector)
apic_free_vector(old_id, old_vector, intpin->io_irq);
+ return (0);
}
static void
@@ -372,7 +376,9 @@ ioapic_enable_intr(struct intsrc *isrc)
struct ioapic_intsrc *intpin = (struct ioapic_intsrc *)isrc;
if (intpin->io_vector == 0)
- ioapic_assign_cpu(isrc, intr_next_cpu());
+ if (ioapic_assign_cpu(isrc, intr_next_cpu()) != 0)
+ panic("Couldn't find an APIC vector for IRQ %d",
+ intpin->io_irq);
apic_enable_vector(intpin->io_cpu, intpin->io_vector);
}
@@ -496,7 +502,7 @@ ioapic_create(vm_paddr_t addr, int32_t a
io->io_pic = ioapic_template;
mtx_lock_spin(&icu_lock);
io->io_id = next_id++;
- io->io_apic_id = ioapic_read(apic, IOAPIC_ID) >> APIC_ID_SHIFT;
+ io->io_apic_id = ioapic_read(apic, IOAPIC_ID) >> APIC_ID_SHIFT;
if (apic_id != -1 && io->io_apic_id != apic_id) {
ioapic_write(apic, IOAPIC_ID, apic_id << APIC_ID_SHIFT);
mtx_unlock_spin(&icu_lock);
@@ -730,7 +736,7 @@ ioapic_set_triggermode(void *cookie, u_i
if (pin >= io->io_numintr || trigger == INTR_TRIGGER_CONFORM)
return (EINVAL);
if (io->io_pins[pin].io_irq >= NUM_IO_INTS)
- return (EINVAL);
+ return (EINVAL);
edgetrigger = (trigger == INTR_TRIGGER_EDGE);
if (io->io_pins[pin].io_edgetrigger == edgetrigger)
return (0);
Modified: head/sys/amd64/amd64/local_apic.c
==============================================================================
--- head/sys/amd64/amd64/local_apic.c Wed Jul 1 17:06:56 2009 (r195248)
+++ head/sys/amd64/amd64/local_apic.c Wed Jul 1 17:20:07 2009 (r195249)
@@ -139,7 +139,7 @@ static inthand_t *ioint_handlers[] = {
};
-static u_int32_t lapic_timer_divisors[] = {
+static u_int32_t lapic_timer_divisors[] = {
APIC_TDCR_1, APIC_TDCR_2, APIC_TDCR_4, APIC_TDCR_8, APIC_TDCR_16,
APIC_TDCR_32, APIC_TDCR_64, APIC_TDCR_128
};
@@ -797,7 +797,7 @@ apic_alloc_vector(u_int apic_id, u_int i
return (vector + APIC_IO_INTS);
}
mtx_unlock_spin(&icu_lock);
- panic("Couldn't find an APIC vector for IRQ %u", irq);
+ return (0);
}
/*
@@ -1058,7 +1058,7 @@ DB_SHOW_COMMAND(lapic, db_show_lapic)
static SLIST_HEAD(, apic_enumerator) enumerators =
SLIST_HEAD_INITIALIZER(enumerators);
static struct apic_enumerator *best_enum;
-
+
void
apic_register_enumerator(struct apic_enumerator *enumerator)
{
Modified: head/sys/amd64/amd64/msi.c
==============================================================================
--- head/sys/amd64/amd64/msi.c Wed Jul 1 17:06:56 2009 (r195248)
+++ head/sys/amd64/amd64/msi.c Wed Jul 1 17:20:07 2009 (r195249)
@@ -113,6 +113,8 @@ struct msi_intsrc {
u_int msi_vector:8; /* IDT vector. */
u_int msi_cpu:8; /* Local APIC ID. (g) */
u_int msi_count:8; /* Messages in this group. (g) */
+ u_int msi_maxcount:8; /* Alignment for this group. (g) */
+ int *msi_irqs; /* Group's IRQ list. (g) */
};
static void msi_create_source(void);
@@ -125,7 +127,7 @@ static int msi_vector(struct intsrc *isr
static int msi_source_pending(struct intsrc *isrc);
static int msi_config_intr(struct intsrc *isrc, enum intr_trigger trig,
enum intr_polarity pol);
-static void msi_assign_cpu(struct intsrc *isrc, u_int apic_id);
+static int msi_assign_cpu(struct intsrc *isrc, u_int apic_id);
struct pic msi_pic = { msi_enable_source, msi_disable_source, msi_eoi_source,
msi_enable_intr, msi_disable_intr, msi_vector,
@@ -195,32 +197,52 @@ msi_config_intr(struct intsrc *isrc, enu
return (ENODEV);
}
-static void
+static int
msi_assign_cpu(struct intsrc *isrc, u_int apic_id)
{
- struct msi_intsrc *msi = (struct msi_intsrc *)isrc;
+ struct msi_intsrc *sib, *msi = (struct msi_intsrc *)isrc;
int old_vector;
u_int old_id;
- int vector;
+ int i, vector;
+
+ /*
+ * Only allow CPUs to be assigned to the first message for an
+ * MSI group.
+ */
+ if (msi->msi_first != msi)
+ return (EINVAL);
/* Store information to free existing irq. */
old_vector = msi->msi_vector;
old_id = msi->msi_cpu;
if (old_id == apic_id)
- return;
- if (!msi->msi_msix && msi->msi_first->msi_count > 1)
- return;
+ return (0);
- /* Allocate IDT vector on this cpu. */
- vector = apic_alloc_vector(apic_id, msi->msi_irq);
+ /* Allocate IDT vectors on this cpu. */
+ if (msi->msi_count > 1) {
+ KASSERT(msi->msi_msix == 0, ("MSI-X message group"));
+ vector = apic_alloc_vectors(apic_id, msi->msi_irqs,
+ msi->msi_count, msi->msi_maxcount);
+ } else
+ vector = apic_alloc_vector(apic_id, msi->msi_irq);
if (vector == 0)
- return; /* XXX alloc_vector panics on failure. */
+ return (ENOSPC);
+
msi->msi_cpu = apic_id;
msi->msi_vector = vector;
if (bootverbose)
printf("msi: Assigning %s IRQ %d to local APIC %u vector %u\n",
msi->msi_msix ? "MSI-X" : "MSI", msi->msi_irq,
msi->msi_cpu, msi->msi_vector);
+ for (i = 1; i < msi->msi_count; i++) {
+ sib = (struct msi_intsrc *)intr_lookup_source(msi->msi_irqs[i]);
+ sib->msi_cpu = apic_id;
+ sib->msi_vector = vector + i;
+ if (bootverbose)
+ printf(
+ "msi: Assigning MSI IRQ %d to local APIC %u vector %u\n",
+ sib->msi_irq, sib->msi_cpu, sib->msi_vector);
+ }
pci_remap_msi_irq(msi->msi_dev, msi->msi_irq);
/*
@@ -228,6 +250,9 @@ msi_assign_cpu(struct intsrc *isrc, u_in
* to prevent races where we could miss an interrupt.
*/
apic_free_vector(old_id, old_vector, msi->msi_irq);
+ for (i = 1; i < msi->msi_count; i++)
+ apic_free_vector(old_id, old_vector + i, msi->msi_irqs[i]);
+ return (0);
}
void
@@ -268,7 +293,7 @@ msi_create_source(void)
msi_last_irq++;
mtx_unlock(&msi_lock);
- msi = malloc(sizeof(struct msi_intsrc), M_MSI, M_WAITOK | M_ZERO);
+ msi = malloc(sizeof(struct msi_intsrc), M_MSI, M_WAITOK | M_ZERO);
msi->msi_intsrc.is_pic = &msi_pic;
msi->msi_irq = irq;
intr_register_source(&msi->msi_intsrc);
@@ -276,21 +301,22 @@ msi_create_source(void)
}
/*
- * Try to allocate 'count' interrupt sources with contiguous IDT values. If
- * we allocate any new sources, then their IRQ values will be at the end of
- * the irqs[] array, with *newirq being the index of the first new IRQ value
- * and *newcount being the number of new IRQ values added.
+ * Try to allocate 'count' interrupt sources with contiguous IDT values.
*/
int
msi_alloc(device_t dev, int count, int maxcount, int *irqs)
{
struct msi_intsrc *msi, *fsrc;
u_int cpu;
- int cnt, i, vector;
+ int cnt, i, *mirqs, vector;
if (!msi_enabled)
return (ENXIO);
+ if (count > 1)
+ mirqs = malloc(count * sizeof(*mirqs), M_MSI, M_WAITOK);
+ else
+ mirqs = NULL;
again:
mtx_lock(&msi_lock);
@@ -317,6 +343,7 @@ again:
/* If we would exceed the max, give up. */
if (i + (count - cnt) > FIRST_MSI_INT + NUM_MSI_INTS) {
mtx_unlock(&msi_lock);
+ free(mirqs, M_MSI);
return (ENXIO);
}
mtx_unlock(&msi_lock);
@@ -337,6 +364,7 @@ again:
vector = apic_alloc_vectors(cpu, irqs, count, maxcount);
if (vector == 0) {
mtx_unlock(&msi_lock);
+ free(mirqs, M_MSI);
return (ENOSPC);
}
@@ -356,6 +384,10 @@ again:
("dead MSI has handlers"));
}
fsrc->msi_count = count;
+ fsrc->msi_maxcount = maxcount;
+ if (count > 1)
+ bcopy(irqs, mirqs, count * sizeof(*mirqs));
+ fsrc->msi_irqs = mirqs;
mtx_unlock(&msi_lock);
return (0);
@@ -413,6 +445,9 @@ msi_release(int *irqs, int count)
apic_free_vector(first->msi_cpu, first->msi_vector, first->msi_irq);
first->msi_vector = 0;
first->msi_count = 0;
+ first->msi_maxcount = 0;
+ free(first->msi_irqs, M_MSI);
+ first->msi_irqs = NULL;
mtx_unlock(&msi_lock);
return (0);
@@ -498,15 +533,23 @@ again:
/* Allocate an IDT vector. */
cpu = intr_next_cpu();
vector = apic_alloc_vector(cpu, i);
+ if (vector == 0) {
+ mtx_unlock(&msi_lock);
+ return (ENOSPC);
+ }
if (bootverbose)
printf("msi: routing MSI-X IRQ %d to local APIC %u vector %u\n",
msi->msi_irq, cpu, vector);
-
+
/* Setup source. */
msi->msi_cpu = cpu;
msi->msi_dev = dev;
+ msi->msi_first = msi;
msi->msi_vector = vector;
msi->msi_msix = 1;
+ msi->msi_count = 1;
+ msi->msi_maxcount = 1;
+ msi->msi_irqs = NULL;
KASSERT(msi->msi_intsrc.is_handlers == 0, ("dead MSI-X has handlers"));
mtx_unlock(&msi_lock);
@@ -536,10 +579,13 @@ msix_release(int irq)
KASSERT(msi->msi_dev != NULL, ("unowned message"));
/* Clear out the message. */
+ msi->msi_first = NULL;
msi->msi_dev = NULL;
apic_free_vector(msi->msi_cpu, msi->msi_vector, msi->msi_irq);
msi->msi_vector = 0;
msi->msi_msix = 0;
+ msi->msi_count = 0;
+ msi->msi_maxcount = 0;
mtx_unlock(&msi_lock);
return (0);
Modified: head/sys/amd64/include/intr_machdep.h
==============================================================================
--- head/sys/amd64/include/intr_machdep.h Wed Jul 1 17:06:56 2009 (r195248)
+++ head/sys/amd64/include/intr_machdep.h Wed Jul 1 17:20:07 2009 (r195249)
@@ -93,7 +93,7 @@ struct pic {
void (*pic_resume)(struct pic *);
int (*pic_config_intr)(struct intsrc *, enum intr_trigger,
enum intr_polarity);
- void (*pic_assign_cpu)(struct intsrc *, u_int apic_id);
+ int (*pic_assign_cpu)(struct intsrc *, u_int apic_id);
STAILQ_ENTRY(pic) pics;
};
Modified: head/sys/amd64/isa/atpic.c
==============================================================================
--- head/sys/amd64/isa/atpic.c Wed Jul 1 17:06:56 2009 (r195248)
+++ head/sys/amd64/isa/atpic.c Wed Jul 1 17:20:07 2009 (r195249)
@@ -143,7 +143,7 @@ static void atpic_resume(struct pic *pic
static int atpic_source_pending(struct intsrc *isrc);
static int atpic_config_intr(struct intsrc *isrc, enum intr_trigger trig,
enum intr_polarity pol);
-static void atpic_assign_cpu(struct intsrc *isrc, u_int apic_id);
+static int atpic_assign_cpu(struct intsrc *isrc, u_int apic_id);
static void i8259_init(struct atpic *pic, int slave);
static struct atpic atpics[] = {
@@ -357,7 +357,7 @@ atpic_config_intr(struct intsrc *isrc, e
return (0);
}
-static void
+static int
atpic_assign_cpu(struct intsrc *isrc, u_int apic_id)
{
Modified: head/sys/i386/i386/intr_machdep.c
==============================================================================
--- head/sys/i386/i386/intr_machdep.c Wed Jul 1 17:06:56 2009 (r195248)
+++ head/sys/i386/i386/intr_machdep.c Wed Jul 1 17:20:07 2009 (r195249)
@@ -290,7 +290,8 @@ static int
intr_assign_cpu(void *arg, u_char cpu)
{
#ifdef SMP
- struct intsrc *isrc;
+ struct intsrc *isrc;
+ int error;
/*
* Don't do anything during early boot. We will pick up the
@@ -299,10 +300,11 @@ intr_assign_cpu(void *arg, u_char cpu)
if (assign_cpu && cpu != NOCPU) {
isrc = arg;
mtx_lock(&intr_table_lock);
- isrc->is_pic->pic_assign_cpu(isrc, cpu_apic_ids[cpu]);
+ error = isrc->is_pic->pic_assign_cpu(isrc, cpu_apic_ids[cpu]);
mtx_unlock(&intr_table_lock);
- }
- return (0);
+ } else
+ error = 0;
+ return (error);
#else
return (EOPNOTSUPP);
#endif
@@ -359,7 +361,7 @@ intr_init(void *dummy __unused)
intrcnt_setname("???", 0);
intrcnt_index = 1;
STAILQ_INIT(&pics);
- mtx_init(&intr_table_lock, "intr sources", NULL, MTX_DEF | MTX_RECURSE);
+ mtx_init(&intr_table_lock, "intr sources", NULL, MTX_DEF);
mtx_init(&intrcnt_lock, "intrcnt", NULL, MTX_SPIN);
}
SYSINIT(intr_init, SI_SUB_INTR, SI_ORDER_FIRST, intr_init, NULL);
@@ -407,14 +409,14 @@ intr_next_cpu(void)
if (!assign_cpu)
return (cpu_apic_ids[0]);
- mtx_lock(&intr_table_lock);
+ mtx_lock_spin(&icu_lock);
apic_id = cpu_apic_ids[current_cpu];
do {
current_cpu++;
if (current_cpu > mp_maxid)
current_cpu = 0;
} while (!(intr_cpus & (1 << current_cpu)));
- mtx_unlock(&intr_table_lock);
+ mtx_unlock_spin(&icu_lock);
return (apic_id);
}
@@ -455,7 +457,6 @@ static void
intr_shuffle_irqs(void *arg __unused)
{
struct intsrc *isrc;
- u_int apic_id;
int i;
#ifdef XEN
@@ -463,8 +464,8 @@ intr_shuffle_irqs(void *arg __unused)
* Doesn't work yet
*/
return;
-#endif
-
+#endif
+
/* Don't bother on UP. */
if (mp_ncpus == 1)
return;
@@ -478,13 +479,17 @@ intr_shuffle_irqs(void *arg __unused)
/*
* If this event is already bound to a CPU,
* then assign the source to that CPU instead
- * of picking one via round-robin.
+ * of picking one via round-robin. Note that
+ * this is careful to only advance the
+ * round-robin if the CPU assignment succeeds.
*/
if (isrc->is_event->ie_cpu != NOCPU)
- apic_id = isrc->is_event->ie_cpu;
- else
- apic_id = intr_next_cpu();
- isrc->is_pic->pic_assign_cpu(isrc, apic_id);
+ (void)isrc->is_pic->pic_assign_cpu(isrc,
+ isrc->is_event->ie_cpu);
+ else if (isrc->is_pic->pic_assign_cpu(isrc,
+ cpu_apic_ids[current_cpu]) == 0)
+ (void)intr_next_cpu();
+
}
}
mtx_unlock(&intr_table_lock);
Modified: head/sys/i386/i386/io_apic.c
==============================================================================
--- head/sys/i386/i386/io_apic.c Wed Jul 1 17:06:56 2009 (r195248)
+++ head/sys/i386/i386/io_apic.c Wed Jul 1 17:20:07 2009 (r195249)
@@ -120,7 +120,7 @@ static int ioapic_source_pending(struct
static int ioapic_config_intr(struct intsrc *isrc, enum intr_trigger trig,
enum intr_polarity pol);
static void ioapic_resume(struct pic *pic);
-static void ioapic_assign_cpu(struct intsrc *isrc, u_int apic_id);
+static int ioapic_assign_cpu(struct intsrc *isrc, u_int apic_id);
static void ioapic_program_intpin(struct ioapic_intsrc *intpin);
static STAILQ_HEAD(,ioapic) ioapic_list = STAILQ_HEAD_INITIALIZER(ioapic_list);
@@ -322,7 +322,7 @@ ioapic_program_intpin(struct ioapic_ints
mtx_unlock_spin(&icu_lock);
}
-static void
+static int
ioapic_assign_cpu(struct intsrc *isrc, u_int apic_id)
{
struct ioapic_intsrc *intpin = (struct ioapic_intsrc *)isrc;
@@ -342,7 +342,7 @@ ioapic_assign_cpu(struct intsrc *isrc, u
old_vector = intpin->io_vector;
old_id = intpin->io_cpu;
if (old_vector && apic_id == old_id)
- return;
+ return (0);
/*
* Allocate an APIC vector for this interrupt pin. Once
@@ -350,6 +350,9 @@ ioapic_assign_cpu(struct intsrc *isrc, u
*/
intpin->io_cpu = apic_id;
intpin->io_vector = apic_alloc_vector(apic_id, intpin->io_irq);
+ if (intpin->io_vector == 0)
+ return (ENOSPC);
+
if (bootverbose) {
printf("ioapic%u: routing intpin %u (", io->io_id,
intpin->io_intpin);
@@ -364,6 +367,7 @@ ioapic_assign_cpu(struct intsrc *isrc, u
*/
if (old_vector)
apic_free_vector(old_id, old_vector, intpin->io_irq);
+ return (0);
}
static void
@@ -372,7 +376,9 @@ ioapic_enable_intr(struct intsrc *isrc)
struct ioapic_intsrc *intpin = (struct ioapic_intsrc *)isrc;
if (intpin->io_vector == 0)
- ioapic_assign_cpu(isrc, intr_next_cpu());
+ if (ioapic_assign_cpu(isrc, intr_next_cpu()) != 0)
+ panic("Couldn't find an APIC vector for IRQ %d",
+ intpin->io_irq);
apic_enable_vector(intpin->io_cpu, intpin->io_vector);
}
@@ -496,7 +502,7 @@ ioapic_create(vm_paddr_t addr, int32_t a
io->io_pic = ioapic_template;
mtx_lock_spin(&icu_lock);
io->io_id = next_id++;
- io->io_apic_id = ioapic_read(apic, IOAPIC_ID) >> APIC_ID_SHIFT;
+ io->io_apic_id = ioapic_read(apic, IOAPIC_ID) >> APIC_ID_SHIFT;
if (apic_id != -1 && io->io_apic_id != apic_id) {
ioapic_write(apic, IOAPIC_ID, apic_id << APIC_ID_SHIFT);
mtx_unlock_spin(&icu_lock);
Modified: head/sys/i386/i386/local_apic.c
==============================================================================
--- head/sys/i386/i386/local_apic.c Wed Jul 1 17:06:56 2009 (r195248)
+++ head/sys/i386/i386/local_apic.c Wed Jul 1 17:20:07 2009 (r195249)
@@ -139,7 +139,7 @@ static inthand_t *ioint_handlers[] = {
};
-static u_int32_t lapic_timer_divisors[] = {
+static u_int32_t lapic_timer_divisors[] = {
APIC_TDCR_1, APIC_TDCR_2, APIC_TDCR_4, APIC_TDCR_8, APIC_TDCR_16,
APIC_TDCR_32, APIC_TDCR_64, APIC_TDCR_128
};
@@ -799,7 +799,7 @@ apic_alloc_vector(u_int apic_id, u_int i
return (vector + APIC_IO_INTS);
}
mtx_unlock_spin(&icu_lock);
- panic("Couldn't find an APIC vector for IRQ %u", irq);
+ return (0);
}
/*
@@ -1062,7 +1062,7 @@ DB_SHOW_COMMAND(lapic, db_show_lapic)
static SLIST_HEAD(, apic_enumerator) enumerators =
SLIST_HEAD_INITIALIZER(enumerators);
static struct apic_enumerator *best_enum;
-
+
void
apic_register_enumerator(struct apic_enumerator *enumerator)
{
Modified: head/sys/i386/i386/msi.c
==============================================================================
--- head/sys/i386/i386/msi.c Wed Jul 1 17:06:56 2009 (r195248)
+++ head/sys/i386/i386/msi.c Wed Jul 1 17:20:07 2009 (r195249)
@@ -113,6 +113,8 @@ struct msi_intsrc {
u_int msi_vector:8; /* IDT vector. */
u_int msi_cpu:8; /* Local APIC ID. (g) */
u_int msi_count:8; /* Messages in this group. (g) */
+ u_int msi_maxcount:8; /* Alignment for this group. (g) */
+ int *msi_irqs; /* Group's IRQ list. (g) */
};
static void msi_create_source(void);
@@ -125,7 +127,7 @@ static int msi_vector(struct intsrc *isr
static int msi_source_pending(struct intsrc *isrc);
static int msi_config_intr(struct intsrc *isrc, enum intr_trigger trig,
enum intr_polarity pol);
-static void msi_assign_cpu(struct intsrc *isrc, u_int apic_id);
+static int msi_assign_cpu(struct intsrc *isrc, u_int apic_id);
struct pic msi_pic = { msi_enable_source, msi_disable_source, msi_eoi_source,
msi_enable_intr, msi_disable_intr, msi_vector,
@@ -195,32 +197,52 @@ msi_config_intr(struct intsrc *isrc, enu
return (ENODEV);
}
-static void
+static int
msi_assign_cpu(struct intsrc *isrc, u_int apic_id)
{
- struct msi_intsrc *msi = (struct msi_intsrc *)isrc;
+ struct msi_intsrc *sib, *msi = (struct msi_intsrc *)isrc;
int old_vector;
u_int old_id;
- int vector;
+ int i, vector;
+
+ /*
+ * Only allow CPUs to be assigned to the first message for an
+ * MSI group.
+ */
+ if (msi->msi_first != msi)
+ return (EINVAL);
/* Store information to free existing irq. */
old_vector = msi->msi_vector;
old_id = msi->msi_cpu;
if (old_id == apic_id)
- return;
- if (!msi->msi_msix && msi->msi_first->msi_count > 1)
- return;
+ return (0);
- /* Allocate IDT vector on this cpu. */
- vector = apic_alloc_vector(apic_id, msi->msi_irq);
+ /* Allocate IDT vectors on this cpu. */
+ if (msi->msi_count > 1) {
+ KASSERT(msi->msi_msix == 0, ("MSI-X message group"));
+ vector = apic_alloc_vectors(apic_id, msi->msi_irqs,
+ msi->msi_count, msi->msi_maxcount);
+ } else
+ vector = apic_alloc_vector(apic_id, msi->msi_irq);
if (vector == 0)
- return; /* XXX alloc_vector panics on failure. */
+ return (ENOSPC);
+
msi->msi_cpu = apic_id;
msi->msi_vector = vector;
if (bootverbose)
printf("msi: Assigning %s IRQ %d to local APIC %u vector %u\n",
msi->msi_msix ? "MSI-X" : "MSI", msi->msi_irq,
msi->msi_cpu, msi->msi_vector);
+ for (i = 1; i < msi->msi_count; i++) {
+ sib = (struct msi_intsrc *)intr_lookup_source(msi->msi_irqs[i]);
+ sib->msi_cpu = apic_id;
+ sib->msi_vector = vector + i;
+ if (bootverbose)
+ printf(
+ "msi: Assigning MSI IRQ %d to local APIC %u vector %u\n",
+ sib->msi_irq, sib->msi_cpu, sib->msi_vector);
+ }
pci_remap_msi_irq(msi->msi_dev, msi->msi_irq);
/*
@@ -228,6 +250,9 @@ msi_assign_cpu(struct intsrc *isrc, u_in
* to prevent races where we could miss an interrupt.
*/
apic_free_vector(old_id, old_vector, msi->msi_irq);
+ for (i = 1; i < msi->msi_count; i++)
+ apic_free_vector(old_id, old_vector + i, msi->msi_irqs[i]);
+ return (0);
}
void
@@ -268,7 +293,7 @@ msi_create_source(void)
msi_last_irq++;
mtx_unlock(&msi_lock);
- msi = malloc(sizeof(struct msi_intsrc), M_MSI, M_WAITOK | M_ZERO);
+ msi = malloc(sizeof(struct msi_intsrc), M_MSI, M_WAITOK | M_ZERO);
msi->msi_intsrc.is_pic = &msi_pic;
msi->msi_irq = irq;
intr_register_source(&msi->msi_intsrc);
@@ -276,21 +301,22 @@ msi_create_source(void)
}
/*
- * Try to allocate 'count' interrupt sources with contiguous IDT values. If
- * we allocate any new sources, then their IRQ values will be at the end of
- * the irqs[] array, with *newirq being the index of the first new IRQ value
- * and *newcount being the number of new IRQ values added.
+ * Try to allocate 'count' interrupt sources with contiguous IDT values.
*/
int
msi_alloc(device_t dev, int count, int maxcount, int *irqs)
{
struct msi_intsrc *msi, *fsrc;
u_int cpu;
- int cnt, i, vector;
+ int cnt, i, *mirqs, vector;
if (!msi_enabled)
return (ENXIO);
+ if (count > 1)
+ mirqs = malloc(count * sizeof(*mirqs), M_MSI, M_WAITOK);
+ else
+ mirqs = NULL;
again:
mtx_lock(&msi_lock);
@@ -317,6 +343,7 @@ again:
/* If we would exceed the max, give up. */
if (i + (count - cnt) > FIRST_MSI_INT + NUM_MSI_INTS) {
mtx_unlock(&msi_lock);
+ free(mirqs, M_MSI);
return (ENXIO);
}
mtx_unlock(&msi_lock);
@@ -337,6 +364,7 @@ again:
vector = apic_alloc_vectors(cpu, irqs, count, maxcount);
if (vector == 0) {
mtx_unlock(&msi_lock);
+ free(mirqs, M_MSI);
return (ENOSPC);
}
@@ -356,6 +384,10 @@ again:
("dead MSI has handlers"));
}
fsrc->msi_count = count;
+ fsrc->msi_maxcount = maxcount;
+ if (count > 1)
+ bcopy(irqs, mirqs, count * sizeof(*mirqs));
+ fsrc->msi_irqs = mirqs;
mtx_unlock(&msi_lock);
return (0);
@@ -413,6 +445,9 @@ msi_release(int *irqs, int count)
apic_free_vector(first->msi_cpu, first->msi_vector, first->msi_irq);
first->msi_vector = 0;
first->msi_count = 0;
+ first->msi_maxcount = 0;
+ free(first->msi_irqs, M_MSI);
+ first->msi_irqs = NULL;
mtx_unlock(&msi_lock);
return (0);
@@ -498,15 +533,23 @@ again:
/* Allocate an IDT vector. */
cpu = intr_next_cpu();
vector = apic_alloc_vector(cpu, i);
+ if (vector == 0) {
+ mtx_unlock(&msi_lock);
+ return (ENOSPC);
+ }
if (bootverbose)
printf("msi: routing MSI-X IRQ %d to local APIC %u vector %u\n",
msi->msi_irq, cpu, vector);
-
+
/* Setup source. */
msi->msi_cpu = cpu;
msi->msi_dev = dev;
+ msi->msi_first = msi;
msi->msi_vector = vector;
msi->msi_msix = 1;
+ msi->msi_count = 1;
+ msi->msi_maxcount = 1;
+ msi->msi_irqs = NULL;
KASSERT(msi->msi_intsrc.is_handlers == 0, ("dead MSI-X has handlers"));
mtx_unlock(&msi_lock);
@@ -536,10 +579,13 @@ msix_release(int irq)
KASSERT(msi->msi_dev != NULL, ("unowned message"));
/* Clear out the message. */
+ msi->msi_first = NULL;
msi->msi_dev = NULL;
apic_free_vector(msi->msi_cpu, msi->msi_vector, msi->msi_irq);
msi->msi_vector = 0;
msi->msi_msix = 0;
+ msi->msi_count = 0;
+ msi->msi_maxcount = 0;
mtx_unlock(&msi_lock);
return (0);
Modified: head/sys/i386/include/intr_machdep.h
==============================================================================
--- head/sys/i386/include/intr_machdep.h Wed Jul 1 17:06:56 2009 (r195248)
+++ head/sys/i386/include/intr_machdep.h Wed Jul 1 17:20:07 2009 (r195249)
@@ -93,7 +93,7 @@ struct pic {
void (*pic_resume)(struct pic *);
int (*pic_config_intr)(struct intsrc *, enum intr_trigger,
enum intr_polarity);
- void (*pic_assign_cpu)(struct intsrc *, u_int apic_id);
+ int (*pic_assign_cpu)(struct intsrc *, u_int apic_id);
STAILQ_ENTRY(pic) pics;
};
Modified: head/sys/i386/isa/atpic.c
==============================================================================
--- head/sys/i386/isa/atpic.c Wed Jul 1 17:06:56 2009 (r195248)
+++ head/sys/i386/isa/atpic.c Wed Jul 1 17:20:07 2009 (r195249)
@@ -161,7 +161,7 @@ static void atpic_resume(struct pic *pic
static int atpic_source_pending(struct intsrc *isrc);
static int atpic_config_intr(struct intsrc *isrc, enum intr_trigger trig,
enum intr_polarity pol);
-static void atpic_assign_cpu(struct intsrc *isrc, u_int apic_id);
+static int atpic_assign_cpu(struct intsrc *isrc, u_int apic_id);
static void i8259_init(struct atpic *pic, int slave);
static struct atpic atpics[] = {
@@ -389,7 +389,7 @@ atpic_config_intr(struct intsrc *isrc, e
#endif /* PC98 */
}
-static void
+static int
atpic_assign_cpu(struct intsrc *isrc, u_int apic_id)
{
Modified: head/sys/kern/kern_intr.c
==============================================================================
--- head/sys/kern/kern_intr.c Wed Jul 1 17:06:56 2009 (r195248)
+++ head/sys/kern/kern_intr.c Wed Jul 1 17:20:07 2009 (r195249)
@@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$");
#include
#include
#include
+#include
#include
#include
#include
@@ -304,9 +305,14 @@ intr_event_bind(struct intr_event *ie, u
if (ie->ie_assign_cpu == NULL)
return (EOPNOTSUPP);
+
+ error = priv_check(curthread, PRIV_SCHED_CPUSET_INTR);
+ if (error)
+ return (error);
+
/*
- * If we have any ithreads try to set their mask first since this
- * can fail.
+ * If we have any ithreads try to set their mask first to verify
+ * permissions, etc.
*/
mtx_lock(&ie->ie_lock);
if (ie->ie_thread != NULL) {
@@ -323,8 +329,22 @@ intr_event_bind(struct intr_event *ie, u
} else
mtx_unlock(&ie->ie_lock);
error = ie->ie_assign_cpu(ie->ie_source, cpu);
- if (error)
+ if (error) {
+ mtx_lock(&ie->ie_lock);
+ if (ie->ie_thread != NULL) {
+ CPU_ZERO(&mask);
+ if (ie->ie_cpu == NOCPU)
+ CPU_COPY(cpuset_root, &mask);
+ else
+ CPU_SET(cpu, &mask);
+ id = ie->ie_thread->it_thread->td_tid;
+ mtx_unlock(&ie->ie_lock);
+ (void)cpuset_setthread(id, &mask);
+ } else
+ mtx_unlock(&ie->ie_lock);
return (error);
+ }
+
mtx_lock(&ie->ie_lock);
ie->ie_cpu = cpu;
mtx_unlock(&ie->ie_lock);
Modified: head/sys/sys/priv.h
==============================================================================
--- head/sys/sys/priv.h Wed Jul 1 17:06:56 2009 (r195248)
+++ head/sys/sys/priv.h Wed Jul 1 17:20:07 2009 (r195249)
@@ -185,6 +185,7 @@
#define PRIV_SCHED_SET 204 /* Can set thread scheduler. */
#define PRIV_SCHED_SETPARAM 205 /* Can set thread scheduler params. */
#define PRIV_SCHED_CPUSET 206 /* Can manipulate cpusets. */
+#define PRIV_SCHED_CPUSET_INTR 207 /* Can adjust IRQ to CPU binding. */
/*
* POSIX semaphore privileges.
From np at FreeBSD.org Wed Jul 1 17:51:00 2009
From: np at FreeBSD.org (Navdeep Parhar)
Date: Wed Jul 1 17:51:16 2009
Subject: svn commit: r195250 - stable/7/sys/dev/cxgb
Message-ID: <200907011750.n61HoxPr019738@svn.freebsd.org>
Author: np
Date: Wed Jul 1 17:50:59 2009
New Revision: 195250
URL: http://svn.freebsd.org/changeset/base/195250
Log:
Fix cxgb's version checks in stable. This makes it select the
correct buffer size for freelist1.
Approved by: gnn (mentor)
Modified:
stable/7/sys/dev/cxgb/cxgb_sge.c
Modified: stable/7/sys/dev/cxgb/cxgb_sge.c
==============================================================================
--- stable/7/sys/dev/cxgb/cxgb_sge.c Wed Jul 1 17:20:07 2009 (r195249)
+++ stable/7/sys/dev/cxgb/cxgb_sge.c Wed Jul 1 17:50:59 2009 (r195250)
@@ -375,7 +375,7 @@ t3_sge_prep(adapter_t *adap, struct sge_
while (!powerof2(fl_q_size))
fl_q_size--;
-#if __FreeBSD_version > 700000
+#if __FreeBSD_version >= 700111
if (cxgb_use_16k_clusters)
jumbo_q_size = min(nmbjumbo16/(3*nqsets), JUMBO_Q_SIZE);
else
@@ -2377,7 +2377,7 @@ t3_sge_alloc_qset(adapter_t *sc, u_int i
q->fl[0].buf_size = (MCLBYTES - header_size);
q->fl[0].zone = zone_clust;
q->fl[0].type = EXT_CLUSTER;
-#if __FreeBSD_version > 800000
+#if __FreeBSD_version >= 700111
if (cxgb_use_16k_clusters) {
q->fl[1].buf_size = MJUM16BYTES - header_size;
q->fl[1].zone = zone_jumbo16;
From dfr at FreeBSD.org Wed Jul 1 18:12:51 2009
From: dfr at FreeBSD.org (Doug Rabson)
Date: Wed Jul 1 18:12:57 2009
Subject: svn commit: r195251 - head
Message-ID: <200907011812.n61ICoiG020256@svn.freebsd.org>
Author: dfr
Date: Wed Jul 1 18:12:50 2009
New Revision: 195251
URL: http://svn.freebsd.org/changeset/base/195251
Log:
Clarify the node about removing NFS_LEGACYRPC
Approved by: re
Modified:
head/UPDATING
Modified: head/UPDATING
==============================================================================
--- head/UPDATING Wed Jul 1 17:50:59 2009 (r195250)
+++ head/UPDATING Wed Jul 1 18:12:50 2009 (r195251)
@@ -23,8 +23,9 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8.
ln -s aj /etc/malloc.conf.)
20090630:
- Remove the old kernel RPC implementation and the NFS_LEGACYRPC
- option. Kernel configurations may need to be adjusted.
+ The NFS_LEGACYRPC option has been removed along with the old
+ kernel RPC implementation that this option selected. Kernel
+ configurations may need to be adjusted.
20090629:
The network interface device nodes at /dev/net/ have
From rwatson at FreeBSD.org Wed Jul 1 18:54:51 2009
From: rwatson at FreeBSD.org (Robert Watson)
Date: Wed Jul 1 18:55:05 2009
Subject: svn commit: r195252 - in head/sys: kern security/audit
Message-ID: <200907011854.n61IsnaF021004@svn.freebsd.org>
Author: rwatson
Date: Wed Jul 1 18:54:49 2009
New Revision: 195252
URL: http://svn.freebsd.org/changeset/base/195252
Log:
Define missing audit argument macro AUDIT_ARG_SOCKET(), and
capture the domain, type, and protocol arguments to socket(2)
and socketpair(2).
Approved by: re (audit argument blanket)
MFC after: 3 days
Modified:
head/sys/kern/uipc_syscalls.c
head/sys/security/audit/audit.h
Modified: head/sys/kern/uipc_syscalls.c
==============================================================================
--- head/sys/kern/uipc_syscalls.c Wed Jul 1 18:12:50 2009 (r195251)
+++ head/sys/kern/uipc_syscalls.c Wed Jul 1 18:54:49 2009 (r195252)
@@ -70,6 +70,7 @@ __FBSDID("$FreeBSD$");
#include
#endif
+#include
#include
#include
@@ -161,6 +162,7 @@ socket(td, uap)
struct file *fp;
int fd, error;
+ AUDIT_ARG_SOCKET(uap->domain, uap->type, uap->protocol);
#ifdef MAC
error = mac_socket_check_create(td->td_ucred, uap->domain, uap->type,
uap->protocol);
@@ -586,6 +588,7 @@ kern_socketpair(struct thread *td, int d
struct socket *so1, *so2;
int fd, error;
+ AUDIT_ARG_SOCKET(domain, type, protocol);
#ifdef MAC
/* We might want to have a separate check for socket pairs. */
error = mac_socket_check_create(td->td_ucred, domain, type,
Modified: head/sys/security/audit/audit.h
==============================================================================
--- head/sys/security/audit/audit.h Wed Jul 1 18:12:50 2009 (r195251)
+++ head/sys/security/audit/audit.h Wed Jul 1 18:54:49 2009 (r195252)
@@ -297,6 +297,11 @@ void audit_thread_free(struct thread *t
audit_arg_sgid((sgid)); \
} while (0)
+#define AUDIT_ARG_SOCKET(sodomain, sotype, soprotocol) do { \
+ if (AUDITING_TD(curthread)) \
+ audit_arg_socket((sodomain), (sotype), (soprotocol)); \
+} while (0)
+
#define AUDIT_ARG_SUID(suid) do { \
if (AUDITING_TD(curthread)) \
audit_arg_suid((suid)); \
@@ -375,6 +380,7 @@ void audit_thread_free(struct thread *t
#define AUDIT_ARG_RUID(ruid)
#define AUDIT_ARG_SIGNUM(signum)
#define AUDIT_ARG_SGID(sgid)
+#define AUDIT_ARG_SOCKET(sodomain, sotype, soprotocol)
#define AUDIT_ARG_SUID(suid)
#define AUDIT_ARG_TEXT(text)
#define AUDIT_ARG_UID(uid)
From rwatson at FreeBSD.org Wed Jul 1 19:55:12 2009
From: rwatson at FreeBSD.org (Robert Watson)
Date: Wed Jul 1 19:55:21 2009
Subject: svn commit: r195255 - head/sys/kern
Message-ID: <200907011955.n61JtBah022305@svn.freebsd.org>
Author: rwatson
Date: Wed Jul 1 19:55:11 2009
New Revision: 195255
URL: http://svn.freebsd.org/changeset/base/195255
Log:
Audit file descriptor numbers for various socket-related system calls.
Approved by: re (audit argument blanket)
MFC after: 3 days
Modified:
head/sys/kern/uipc_syscalls.c
Modified: head/sys/kern/uipc_syscalls.c
==============================================================================
--- head/sys/kern/uipc_syscalls.c Wed Jul 1 19:55:07 2009 (r195254)
+++ head/sys/kern/uipc_syscalls.c Wed Jul 1 19:55:11 2009 (r195255)
@@ -217,6 +217,7 @@ kern_bind(td, fd, sa)
struct file *fp;
int error;
+ AUDIT_ARG_FD(fd);
error = getsock(td->td_proc->p_fd, fd, &fp, NULL);
if (error)
return (error);
@@ -247,6 +248,7 @@ listen(td, uap)
struct file *fp;
int error;
+ AUDIT_ARG_FD(uap->s);
error = getsock(td->td_proc->p_fd, uap->s, &fp, NULL);
if (error == 0) {
so = fp->f_data;
@@ -340,6 +342,7 @@ kern_accept(struct thread *td, int s, st
return (EINVAL);
}
+ AUDIT_ARG_FD(s);
fdp = td->td_proc->p_fd;
error = getsock(fdp, s, &headfp, &fflag);
if (error)
@@ -530,6 +533,7 @@ kern_connect(td, fd, sa)
int error;
int interrupted = 0;
+ AUDIT_ARG_FD(fd);
error = getsock(td->td_proc->p_fd, fd, &fp, NULL);
if (error)
return (error);
@@ -738,6 +742,7 @@ kern_sendit(td, s, mp, flags, control, s
struct uio *ktruio = NULL;
#endif
+ AUDIT_ARG_FD(s);
error = getsock(td->td_proc->p_fd, s, &fp, NULL);
if (error)
return (error);
@@ -937,6 +942,7 @@ kern_recvit(td, s, mp, fromseg, controlp
if(controlp != NULL)
*controlp = 0;
+ AUDIT_ARG_FD(s);
error = getsock(td->td_proc->p_fd, s, &fp, NULL);
if (error)
return (error);
@@ -1252,6 +1258,7 @@ shutdown(td, uap)
struct file *fp;
int error;
+ AUDIT_ARG_FD(uap->s);
error = getsock(td->td_proc->p_fd, uap->s, &fp, NULL);
if (error == 0) {
so = fp->f_data;
@@ -1314,6 +1321,7 @@ kern_setsockopt(td, s, level, name, val,
panic("kern_setsockopt called with bad valseg");
}
+ AUDIT_ARG_FD(s);
error = getsock(td->td_proc->p_fd, s, &fp, NULL);
if (error == 0) {
so = fp->f_data;
@@ -1394,6 +1402,7 @@ kern_getsockopt(td, s, level, name, val,
panic("kern_getsockopt called with bad valseg");
}
+ AUDIT_ARG_FD(s);
error = getsock(td->td_proc->p_fd, s, &fp, NULL);
if (error == 0) {
so = fp->f_data;
@@ -1457,6 +1466,7 @@ kern_getsockname(struct thread *td, int
if (*alen < 0)
return (EINVAL);
+ AUDIT_ARG_FD(fd);
error = getsock(td->td_proc->p_fd, fd, &fp, NULL);
if (error)
return (error);
@@ -1556,6 +1566,7 @@ kern_getpeername(struct thread *td, int
if (*alen < 0)
return (EINVAL);
+ AUDIT_ARG_FD(fd);
error = getsock(td->td_proc->p_fd, fd, &fp, NULL);
if (error)
return (error);
@@ -1811,6 +1822,7 @@ kern_sendfile(struct thread *td, struct
* File offset must be positive. If it goes beyond EOF
* we send only the header/trailer and no payload data.
*/
+ AUDIT_ARG_FD(uap->fd);
if ((error = fgetvp_read(td, uap->fd, &vp)) != 0)
goto out;
vfslocked = VFS_LOCK_GIANT(vp->v_mount);
@@ -2285,6 +2297,7 @@ sctp_peeloff(td, uap)
u_int fflag;
fdp = td->td_proc->p_fd;
+ AUDIT_ARG_FD(uap->sd);
error = fgetsock(td, uap->sd, &head, &fflag);
if (error)
goto done2;
@@ -2392,6 +2405,7 @@ sctp_generic_sendmsg (td, uap)
}
}
+ AUDIT_ARG_FD(uap->sd);
error = getsock(td->td_proc->p_fd, uap->sd, &fp, NULL);
if (error)
goto sctp_bad;
@@ -2493,6 +2507,7 @@ sctp_generic_sendmsg_iov(td, uap)
}
}
+ AUDIT_ARG_FD(uap->sd);
error = getsock(td->td_proc->p_fd, uap->sd, &fp, NULL);
if (error)
goto sctp_bad1;
@@ -2591,6 +2606,8 @@ sctp_generic_recvmsg(td, uap)
#ifdef KTRACE
struct uio *ktruio = NULL;
#endif
+
+ AUDIT_ARG_FD(uap->sd);
error = getsock(td->td_proc->p_fd, uap->sd, &fp, NULL);
if (error) {
return (error);
From raj at FreeBSD.org Wed Jul 1 20:07:45 2009
From: raj at FreeBSD.org (Rafal Jaworowski)
Date: Wed Jul 1 20:07:53 2009
Subject: svn commit: r195256 - in head/sys/arm: at91 mv sa11x0
Message-ID: <200907012007.n61K7ick022628@svn.freebsd.org>
Author: raj
Date: Wed Jul 1 20:07:44 2009
New Revision: 195256
URL: http://svn.freebsd.org/changeset/base/195256
Log:
Map DPCPU pages into ARM kernel VA space.
DPCPU area was not properly mapped into kernel VA space, which caused page
fault on the first DPCPU access. This patch fixes the problem by mapping DPCPU
area into kernel VA space.
Submitted by: Michal Hajduk, Piotr Ziecik
Reviewed by: cognet, stas
Approved by: re (kib)
Obtained from: Semihalf
Modified:
head/sys/arm/at91/at91_machdep.c
head/sys/arm/mv/mv_machdep.c
head/sys/arm/sa11x0/assabet_machdep.c
Modified: head/sys/arm/at91/at91_machdep.c
==============================================================================
--- head/sys/arm/at91/at91_machdep.c Wed Jul 1 19:55:11 2009 (r195255)
+++ head/sys/arm/at91/at91_machdep.c Wed Jul 1 20:07:44 2009 (r195256)
@@ -301,6 +301,11 @@ initarm(void *arg, void *arg2)
/* Map the vector page. */
pmap_map_entry(l1pagetable, ARM_VECTORS_HIGH, systempage.pv_pa,
VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE);
+
+ /* Map the DPCPU pages */
+ pmap_map_chunk(l1pagetable, dpcpu.pv_va, dpcpu.pv_pa, DPCPU_SIZE,
+ VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE);
+
/* Map the stack pages */
pmap_map_chunk(l1pagetable, irqstack.pv_va, irqstack.pv_pa,
IRQ_STACK_SIZE * PAGE_SIZE, VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE);
Modified: head/sys/arm/mv/mv_machdep.c
==============================================================================
--- head/sys/arm/mv/mv_machdep.c Wed Jul 1 19:55:11 2009 (r195255)
+++ head/sys/arm/mv/mv_machdep.c Wed Jul 1 20:07:44 2009 (r195256)
@@ -528,9 +528,9 @@ initarm(void *mdp, void *unused __unused
L2_TABLE_SIZE_REAL * l2size,
VM_PROT_READ|VM_PROT_WRITE, PTE_PAGETABLE);
- /* Map allocated stacks and msgbuf */
- pmap_map_chunk(l1pagetable, irqstack.pv_va, irqstack.pv_pa,
- freemempos - irqstack.pv_va,
+ /* Map allocated DPCPU, stacks and msgbuf */
+ pmap_map_chunk(l1pagetable, dpcpu.pv_va, dpcpu.pv_pa,
+ freemempos - dpcpu.pv_va,
VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE);
/* Link and map the vector page */
Modified: head/sys/arm/sa11x0/assabet_machdep.c
==============================================================================
--- head/sys/arm/sa11x0/assabet_machdep.c Wed Jul 1 19:55:11 2009 (r195255)
+++ head/sys/arm/sa11x0/assabet_machdep.c Wed Jul 1 20:07:44 2009 (r195256)
@@ -313,6 +313,9 @@ initarm(void *arg, void *arg2)
pmap_map_chunk(l1pagetable, KERNBASE, KERNBASE,
((uint32_t)lastaddr - KERNBASE), VM_PROT_READ|VM_PROT_WRITE,
PTE_CACHE);
+ /* Map the DPCPU pages */
+ pmap_map_chunk(l1pagetable, dpcpu.pv_va, dpcpu.pv_pa, DPCPU_SIZE,
+ VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE);
/* Map the stack pages */
pmap_map_chunk(l1pagetable, irqstack.pv_va, irqstack.pv_pa,
IRQ_STACK_SIZE * PAGE_SIZE, VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE);
From trasz at FreeBSD.org Wed Jul 1 20:16:30 2009
From: trasz at FreeBSD.org (Edward Tomasz Napierala)
Date: Wed Jul 1 20:16:41 2009
Subject: svn commit: r195257 - head/sys/geom
Message-ID: <200907012016.n61KGTSe022828@svn.freebsd.org>
Author: trasz
Date: Wed Jul 1 20:16:29 2009
New Revision: 195257
URL: http://svn.freebsd.org/changeset/base/195257
Log:
Fix a panic which (reportedly) can happen when unmounting a filesystem
with I/O requests in flight on kernels compiled with "options INVARIANTS".
Also, make it obvious it's not right to call g_valid_obj() (and macros
using it, e.g. G_VALID_CONSUMER()) without topology lock held.
Approved by: re (kib)
Reported by: pho
Modified:
head/sys/geom/geom_subr.c
head/sys/geom/geom_vfs.c
Modified: head/sys/geom/geom_subr.c
==============================================================================
--- head/sys/geom/geom_subr.c Wed Jul 1 20:07:44 2009 (r195256)
+++ head/sys/geom/geom_subr.c Wed Jul 1 20:16:29 2009 (r195257)
@@ -1025,6 +1025,8 @@ g_valid_obj(void const *ptr)
struct g_consumer *cp;
struct g_provider *pp;
+ g_topology_assert();
+
LIST_FOREACH(mp, &g_classes, class) {
if (ptr == mp)
return (1);
Modified: head/sys/geom/geom_vfs.c
==============================================================================
--- head/sys/geom/geom_vfs.c Wed Jul 1 20:07:44 2009 (r195256)
+++ head/sys/geom/geom_vfs.c Wed Jul 1 20:16:29 2009 (r195257)
@@ -106,7 +106,7 @@ g_vfs_strategy(struct bufobj *bo, struct
int vfslocked;
cp = bo->bo_private;
- G_VALID_CONSUMER(cp);
+ /* G_VALID_CONSUMER(cp); We likely lack topology lock */
/*
* If the the provider has orphaned us, just return EXIO.
From jeff at FreeBSD.org Wed Jul 1 20:43:47 2009
From: jeff at FreeBSD.org (Jeff Roberson)
Date: Wed Jul 1 20:43:59 2009
Subject: svn commit: r195259 - head/sys/kern
Message-ID: <200907012043.n61Khkb2023448@svn.freebsd.org>
Author: jeff
Date: Wed Jul 1 20:43:46 2009
New Revision: 195259
URL: http://svn.freebsd.org/changeset/base/195259
Log:
- Use fd_lastfile + 1 as the upper bound on nd. This is more correct than
using the size of the descriptor array.
- A lock is not needed to fetch fd_lastfile. The results are stale the
instant it is dropped.
- Use a private mutex pool for select since the pool mutex is not used
as a leaf.
- Fetch the si_mtx pointer first before resorting to hashing to compute
the mutex address.
Reviewed by: McKusick
Approved by: re (kib)
Modified:
head/sys/kern/sys_generic.c
Modified: head/sys/kern/sys_generic.c
==============================================================================
--- head/sys/kern/sys_generic.c Wed Jul 1 20:42:17 2009 (r195258)
+++ head/sys/kern/sys_generic.c Wed Jul 1 20:43:46 2009 (r195259)
@@ -124,6 +124,7 @@ struct selfd {
};
static uma_zone_t selfd_zone;
+static struct mtx_pool *mtxpool_select;
#ifndef _SYS_SYSPROTO_H_
struct read_args {
@@ -794,11 +795,8 @@ kern_select(struct thread *td, int nd, f
if (nd < 0)
return (EINVAL);
fdp = td->td_proc->p_fd;
-
- FILEDESC_SLOCK(fdp);
- if (nd > td->td_proc->p_fd->fd_nfiles)
- nd = td->td_proc->p_fd->fd_nfiles; /* forgiving; slightly wrong */
- FILEDESC_SUNLOCK(fdp);
+ if (nd > fdp->fd_lastfile + 1)
+ nd = fdp->fd_lastfile + 1;
/*
* Allocate just enough bits for the non-null fd_sets. Use the
@@ -1373,7 +1371,9 @@ selrecord(selector, sip)
stp->st_free2 = NULL;
else
panic("selrecord: No free selfd on selq");
- mtxp = mtx_pool_find(mtxpool_sleep, sip);
+ mtxp = sip->si_mtx;
+ if (mtxp == NULL)
+ mtxp = mtx_pool_find(mtxpool_select, sip);
/*
* Initialize the sfp and queue it in the thread.
*/
@@ -1529,6 +1529,8 @@ SYSINIT(select, SI_SUB_SYSCALLS, SI_ORDE
static void
selectinit(void *dummy __unused)
{
+
selfd_zone = uma_zcreate("selfd", sizeof(struct selfd), NULL, NULL,
NULL, NULL, UMA_ALIGN_PTR, 0);
+ mtxpool_select = mtx_pool_create("select mtxpool", 128, MTX_DEF);
}
From gad at FreeBSD.org Wed Jul 1 22:01:44 2009
From: gad at FreeBSD.org (Garance A Drosehn)
Date: Wed Jul 1 22:01:50 2009
Subject: AW: svn commit: r195200 - in head/usr.sbin: . wake
In-Reply-To: <509A7CA1EA3EA046B1A5BA2FCFDB3C8EECC53324B6@TSS-EXCH01.t-systems.ch>
References: <0E6D4FB2-A485-40ED-A856-ACC311A90EFE@msys.ch>
<20090630.141340.289711551.imp@bsdimp.com>
<7B9C309F-63E3-4CB8-9871-DE2DEE010096@msys.ch>
<20090630.164009.2130804684.imp@bsdimp.com>,
<1246413402.70460.23.camel@bau er.cse.buffalo.edu>
<509A7CA1EA3EA046B1A5BA2FCFDB3C8EECC53324B6@TSS-EXCH01.t-systems.ch>
Message-ID:
At 7:04 AM +0200 7/1/09, Blapp, Martin wrote:
>Hi folks,
>
>I really was not my or Marcs intention to skip any discussions. Rwatson
>told us that if we like to see it in 8.0, we need to approve it by RE
>and commit it before the 1. of july, and that's what I've done. Sorry
>if I've upset anyone.
>
>Personally I think the tool is quite handy, better than net/wol (which
>doesn't seem to work with different interfaces), wake doesn't need any
>strange libaries as dependencies and it just a very short one (4k)
>
>If the concensus is to back it out, I'll back it out.
I have no strong opinion on the program itself, and it would be fine
with me if it is added after some decent code review, and after 8.0
is done. It sounds like this does have some advantages over 'wol',
but I see no urgent reason that this *must* be in 8.0-release.
For me, this is not a question of whether the utility is "nice", or
what the name of it should be. It's a question of whether it means
anything to announce a code freeze if we're constantly going to make
exceptions to it. And whether it's fair to rush in a command just
under the wire, which then means we'd have to go into an even bigger
debate to justify pulling the command out of the base system after
we've shipped an official stable-release with it in the system.
This is not a utility which is needed to install freebsd, or which is
needed before a new install of freebsd gets to the point where it can
install things via ports or packages. Please note that I'm not trying
to debate the wonderfulness of 'wake' itself. I'm trying to come up
with good guidelines which would be used for *any* command which is
shows up on the day before an already-announced code freeze.
--
Garance Alistair Drosehn = drosehn@rpi.edu
Senior Systems Programmer or gad@FreeBSD.org
Rensselaer Polytechnic Institute; Troy, NY; USA
From stas at FreeBSD.org Wed Jul 1 22:23:27 2009
From: stas at FreeBSD.org (Stanislav Sedov)
Date: Wed Jul 1 22:23:39 2009
Subject: svn commit: r195264 - head/usr.sbin/wake
Message-ID: <200907012223.n61MNQO2025697@svn.freebsd.org>
Author: stas
Date: Wed Jul 1 22:23:26 2009
New Revision: 195264
URL: http://svn.freebsd.org/changeset/base/195264
Log:
- Properly order headers, local variables and prototypes. [1]
- Remove unneeded headers.
- Return non-zero error code in usage().
Approved by: re (kib)
Suggested by: bde [1]
Modified:
head/usr.sbin/wake/wake.c
Modified: head/usr.sbin/wake/wake.c
==============================================================================
--- head/usr.sbin/wake/wake.c Wed Jul 1 22:20:44 2009 (r195263)
+++ head/usr.sbin/wake/wake.c Wed Jul 1 22:23:26 2009 (r195264)
@@ -27,28 +27,21 @@
#include
__FBSDID("$FreeBSD$");
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include
-#include
#include
#include
#include
#include
#include
-
#include
#include
+#include
+#include
+#include
+#include
+#include
+#include
+
#define _PATH_BPF "/dev/bpf"
#ifndef SYNC_LEN
@@ -59,18 +52,18 @@ __FBSDID("$FreeBSD$");
#define DESTADDR_COUNT 16
#endif
-static void usage(void);
-static int wake(const char *iface, const char *host);
static int bind_if_to_bpf(char const *ifname, int bpf);
static int get_ether(char const *text, struct ether_addr *addr);
static int send_wakeup(int bpf, struct ether_addr const *addr);
+static void usage(void);
+static int wake(const char *iface, const char *host);
static void
usage(void)
{
(void)fprintf(stderr, "usage: wake interface lladdr...\n");
- exit(0);
+ exit(1);
}
static int
@@ -144,10 +137,10 @@ send_wakeup(int bpf, struct ether_addr c
struct ether_header hdr;
u_char data[SYNC_LEN + ETHER_ADDR_LEN * DESTADDR_COUNT];
} __packed pkt;
+ u_char *p;
ssize_t bw;
ssize_t len;
int i;
- u_char *p;
(void)memset(pkt.hdr.ether_dhost, 0xff, sizeof(pkt.hdr.ether_dhost));
pkt.hdr.ether_type = htons(0);
From trasz at FreeBSD.org Wed Jul 1 22:30:37 2009
From: trasz at FreeBSD.org (Edward Tomasz Napierala)
Date: Wed Jul 1 22:30:49 2009
Subject: svn commit: r195265 - head/sys/ufs/ffs
Message-ID: <200907012230.n61MUaHn025853@svn.freebsd.org>
Author: trasz
Date: Wed Jul 1 22:30:36 2009
New Revision: 195265
URL: http://svn.freebsd.org/changeset/base/195265
Log:
Don't panic on attempt to set ACL on a block device file.
This is just a part of kern/125613.
PR: kern/125613
Submitted by: Jaakko Heinonen
Reviewed by: rwatson
Approved by: re (kib)
Modified:
head/sys/ufs/ffs/ffs_vnops.c
Modified: head/sys/ufs/ffs/ffs_vnops.c
==============================================================================
--- head/sys/ufs/ffs/ffs_vnops.c Wed Jul 1 22:23:26 2009 (r195264)
+++ head/sys/ufs/ffs/ffs_vnops.c Wed Jul 1 22:30:36 2009 (r195265)
@@ -1401,7 +1401,7 @@ struct vop_openextattr_args {
ip = VTOI(ap->a_vp);
fs = ip->i_fs;
- if (ap->a_vp->v_type == VCHR)
+ if (ap->a_vp->v_type == VCHR || ap->a_vp->v_type == VBLK)
return (EOPNOTSUPP);
return (ffs_open_ea(ap->a_vp, ap->a_cred, ap->a_td));
@@ -1429,7 +1429,7 @@ struct vop_closeextattr_args {
ip = VTOI(ap->a_vp);
fs = ip->i_fs;
- if (ap->a_vp->v_type == VCHR)
+ if (ap->a_vp->v_type == VCHR || ap->a_vp->v_type == VBLK)
return (EOPNOTSUPP);
if (ap->a_commit && (ap->a_vp->v_mount->mnt_flag & MNT_RDONLY))
@@ -1462,7 +1462,7 @@ vop_deleteextattr {
ip = VTOI(ap->a_vp);
fs = ip->i_fs;
- if (ap->a_vp->v_type == VCHR)
+ if (ap->a_vp->v_type == VCHR || ap->a_vp->v_type == VBLK)
return (EOPNOTSUPP);
if (strlen(ap->a_name) == 0)
@@ -1549,7 +1549,7 @@ vop_getextattr {
ip = VTOI(ap->a_vp);
fs = ip->i_fs;
- if (ap->a_vp->v_type == VCHR)
+ if (ap->a_vp->v_type == VCHR || ap->a_vp->v_type == VBLK)
return (EOPNOTSUPP);
error = extattr_check_cred(ap->a_vp, ap->a_attrnamespace,
@@ -1605,7 +1605,7 @@ vop_listextattr {
ip = VTOI(ap->a_vp);
fs = ip->i_fs;
- if (ap->a_vp->v_type == VCHR)
+ if (ap->a_vp->v_type == VCHR || ap->a_vp->v_type == VBLK)
return (EOPNOTSUPP);
error = extattr_check_cred(ap->a_vp, ap->a_attrnamespace,
@@ -1668,7 +1668,7 @@ vop_setextattr {
ip = VTOI(ap->a_vp);
fs = ip->i_fs;
- if (ap->a_vp->v_type == VCHR)
+ if (ap->a_vp->v_type == VCHR || ap->a_vp->v_type == VBLK)
return (EOPNOTSUPP);
if (strlen(ap->a_name) == 0)
From rwatson at FreeBSD.org Wed Jul 1 22:47:47 2009
From: rwatson at FreeBSD.org (Robert Watson)
Date: Wed Jul 1 22:47:54 2009
Subject: svn commit: r195267 - in head/sys: kern security/audit
Message-ID: <200907012247.n61Mljwl026219@svn.freebsd.org>
Author: rwatson
Date: Wed Jul 1 22:47:45 2009
New Revision: 195267
URL: http://svn.freebsd.org/changeset/base/195267
Log:
For access(2) and eaccess(2), audit the requested access mode.
Approved by: re (audit argument blanket)
MFC after: 3 days
Modified:
head/sys/kern/vfs_syscalls.c
head/sys/security/audit/audit_bsm.c
Modified: head/sys/kern/vfs_syscalls.c
==============================================================================
--- head/sys/kern/vfs_syscalls.c Wed Jul 1 22:45:19 2009 (r195266)
+++ head/sys/kern/vfs_syscalls.c Wed Jul 1 22:47:45 2009 (r195267)
@@ -2133,6 +2133,7 @@ kern_accessat(struct thread *td, int fd,
td->td_ucred = tmpcred;
} else
cred = tmpcred = td->td_ucred;
+ AUDIT_ARG_VALUE(mode);
NDINIT_AT(&nd, LOOKUP, FOLLOW | LOCKSHARED | LOCKLEAF | MPSAFE |
AUDITVNODE1, pathseg, path, fd, td);
if ((error = namei(&nd)) != 0)
Modified: head/sys/security/audit/audit_bsm.c
==============================================================================
--- head/sys/security/audit/audit_bsm.c Wed Jul 1 22:45:19 2009 (r195266)
+++ head/sys/security/audit/audit_bsm.c Wed Jul 1 22:47:45 2009 (r195267)
@@ -706,10 +706,8 @@ kaudit_to_bsm(struct kaudit_record *kar,
}
/* FALLTHROUGH */
- case AUE_ACCESS:
case AUE_CHDIR:
case AUE_CHROOT:
- case AUE_EACCESS:
case AUE_GETATTRLIST:
case AUE_JAIL:
case AUE_LUTIMES:
@@ -732,6 +730,15 @@ kaudit_to_bsm(struct kaudit_record *kar,
UPATH1_VNODE1_TOKENS;
break;
+ case AUE_ACCESS:
+ case AUE_EACCESS:
+ UPATH1_VNODE1_TOKENS;
+ if (ARG_IS_VALID(kar, ARG_VALUE)) {
+ tok = au_to_arg32(1, "mode", ar->ar_arg_value);
+ kau_write(rec, tok);
+ }
+ break;
+
case AUE_FHSTATFS:
case AUE_FHOPEN:
case AUE_FHSTAT:
From delphij at FreeBSD.org Thu Jul 2 00:36:01 2009
From: delphij at FreeBSD.org (Xin LI)
Date: Thu Jul 2 00:36:08 2009
Subject: svn commit: r195272 - in stable/7/usr.sbin/sysinstall: . help
Message-ID: <200907020036.n620a06g028508@svn.freebsd.org>
Author: delphij
Date: Thu Jul 2 00:36:00 2009
New Revision: 195272
URL: http://svn.freebsd.org/changeset/base/195272
Log:
MFC r180208 (peter):
Set magic fbsd:nokeywords property that allows files to bypass
keyword expansion. (file-specific replacement for CVSROOT/exclude)
Modified:
stable/7/usr.sbin/sysinstall/ (props changed)
stable/7/usr.sbin/sysinstall/help/anonftp.hlp (props changed)
stable/7/usr.sbin/sysinstall/help/configure.hlp (props changed)
stable/7/usr.sbin/sysinstall/help/distributions.hlp (props changed)
stable/7/usr.sbin/sysinstall/help/drives.hlp (props changed)
stable/7/usr.sbin/sysinstall/help/fixit.hlp (props changed)
stable/7/usr.sbin/sysinstall/help/html.hlp (props changed)
stable/7/usr.sbin/sysinstall/help/media.hlp (props changed)
stable/7/usr.sbin/sysinstall/help/network_device.hlp (props changed)
stable/7/usr.sbin/sysinstall/help/options.hlp (props changed)
stable/7/usr.sbin/sysinstall/help/partition.hlp (props changed)
stable/7/usr.sbin/sysinstall/help/securelevel.hlp (props changed)
stable/7/usr.sbin/sysinstall/help/shortcuts.hlp (props changed)
stable/7/usr.sbin/sysinstall/help/slice.hlp (props changed)
stable/7/usr.sbin/sysinstall/help/tcp.hlp (props changed)
stable/7/usr.sbin/sysinstall/help/usage.hlp (props changed)
stable/7/usr.sbin/sysinstall/help/usermgmt.hlp (props changed)
From delphij at FreeBSD.org Thu Jul 2 00:39:26 2009
From: delphij at FreeBSD.org (Xin LI)
Date: Thu Jul 2 00:39:32 2009
Subject: svn commit: r195273 - in stable/7/usr.sbin/sysinstall: . help
Message-ID: <200907020039.n620dPMp028673@svn.freebsd.org>
Author: delphij
Date: Thu Jul 2 00:39:25 2009
New Revision: 195273
URL: http://svn.freebsd.org/changeset/base/195273
Log:
MFC r195012:
Correct a typo (which you can use to in order -> which you can use in order
to).
PR: bin/136040
Submitted by: "Vikentii L. Karabin"
Modified:
stable/7/usr.sbin/sysinstall/ (props changed)
stable/7/usr.sbin/sysinstall/help/usage.hlp
Modified: stable/7/usr.sbin/sysinstall/help/usage.hlp
==============================================================================
--- stable/7/usr.sbin/sysinstall/help/usage.hlp Thu Jul 2 00:36:00 2009 (r195272)
+++ stable/7/usr.sbin/sysinstall/help/usage.hlp Thu Jul 2 00:39:25 2009 (r195273)
@@ -56,7 +56,7 @@ it's also useful when dealing with sub-s
that don't use menus and tend to scroll their output off the top of
the screen.
-FreeBSD also supports multiple "virtual consoles" which you can use to
+FreeBSD also supports multiple "virtual consoles" which you can use
in order to have several active sessions at once. Use ALT-F to
switch between screens, where `F' is the function key corresponding
to the screen you wish to see. By default, the system comes with 8
From delphij at FreeBSD.org Thu Jul 2 00:41:37 2009
From: delphij at FreeBSD.org (Xin LI)
Date: Thu Jul 2 00:41:49 2009
Subject: svn commit: r195274 - head/sys/dev/mpt
Message-ID: <200907020041.n620fbCI028759@svn.freebsd.org>
Author: delphij
Date: Thu Jul 2 00:41:37 2009
New Revision: 195274
URL: http://svn.freebsd.org/changeset/base/195274
Log:
Change explicit maximium numbers to the defined macro MPT_MAX_LUNS.
Approved by: re (kensmith)
Modified:
head/sys/dev/mpt/mpt_cam.c
Modified: head/sys/dev/mpt/mpt_cam.c
==============================================================================
--- head/sys/dev/mpt/mpt_cam.c Thu Jul 2 00:39:25 2009 (r195273)
+++ head/sys/dev/mpt/mpt_cam.c Thu Jul 2 00:41:37 2009 (r195274)
@@ -2152,7 +2152,7 @@ mpt_start(struct cam_sim *sim, union ccb
mpt_req->TargetID = tgt;
/* We assume a single level LUN type */
- if (ccb->ccb_h.target_lun >= 256) {
+ if (ccb->ccb_h.target_lun >= MPT_MAX_LUNS) {
mpt_req->LUN[0] = 0x40 | ((ccb->ccb_h.target_lun >> 8) & 0x3f);
mpt_req->LUN[1] = ccb->ccb_h.target_lun & 0xff;
} else {
@@ -4025,7 +4025,7 @@ mpt_scsi_send_tmf(struct mpt_softc *mpt,
tmf_req->MsgFlags = flags;
tmf_req->MsgContext =
htole32(mpt->tmf_req->index | scsi_tmf_handler_id);
- if (lun > 256) {
+ if (lun > MPT_MAX_LUNS) {
tmf_req->LUN[0] = 0x40 | ((lun >> 8) & 0x3f);
tmf_req->LUN[1] = lun & 0xff;
} else {
@@ -4499,7 +4499,7 @@ mpt_target_start_io(struct mpt_softc *mp
ta->Function = MPI_FUNCTION_TARGET_ASSIST;
ta->MsgContext = htole32(req->index | mpt->scsi_tgt_handler_id);
ta->ReplyWord = htole32(tgt->reply_desc);
- if (csio->ccb_h.target_lun > 256) {
+ if (csio->ccb_h.target_lun > MPT_MAX_LUNS) {
ta->LUN[0] =
0x40 | ((csio->ccb_h.target_lun >> 8) & 0x3f);
ta->LUN[1] = csio->ccb_h.target_lun & 0xff;
@@ -4651,7 +4651,7 @@ mpt_scsi_tgt_local(struct mpt_softc *mpt
ta->Function = MPI_FUNCTION_TARGET_ASSIST;
ta->MsgContext = htole32(req->index | mpt->scsi_tgt_handler_id);
ta->ReplyWord = htole32(tgt->reply_desc);
- if (lun > 256) {
+ if (lun > MPT_MAX_LUNS) {
ta->LUN[0] = 0x40 | ((lun >> 8) & 0x3f);
ta->LUN[1] = lun & 0xff;
} else {
From delphij at FreeBSD.org Thu Jul 2 00:43:11 2009
From: delphij at FreeBSD.org (Xin LI)
Date: Thu Jul 2 00:43:18 2009
Subject: svn commit: r195275 - head/sys/dev/mpt
Message-ID: <200907020043.n620hBFS028827@svn.freebsd.org>
Author: delphij
Date: Thu Jul 2 00:43:10 2009
New Revision: 195275
URL: http://svn.freebsd.org/changeset/base/195275
Log:
Use MPT_MAX_LUNS as maximium number of LUNs, not 7, for SAS and FC cases.
This matches Linux driver behavior.
Discussed with: scottl
Approved by: re (kensmith)
MFC after: 1 month
Modified:
head/sys/dev/mpt/mpt_cam.c
Modified: head/sys/dev/mpt/mpt_cam.c
==============================================================================
--- head/sys/dev/mpt/mpt_cam.c Thu Jul 2 00:41:37 2009 (r195274)
+++ head/sys/dev/mpt/mpt_cam.c Thu Jul 2 00:43:10 2009 (r195275)
@@ -3588,7 +3588,10 @@ mpt_action(struct cam_sim *sim, union cc
if (mpt->is_spi && cpi->max_target > 15) {
cpi->max_target = 15;
}
- cpi->max_lun = 7;
+ if (mpt->is_spi)
+ cpi->max_lun = 7;
+ else
+ cpi->max_lun = MPT_MAX_LUNS;
cpi->initiator_id = mpt->mpt_ini_id;
cpi->bus_id = cam_sim_bus(sim);
From delphij at FreeBSD.org Thu Jul 2 00:44:22 2009
From: delphij at FreeBSD.org (Xin LI)
Date: Thu Jul 2 00:44:28 2009
Subject: svn commit: r195276 - in stable/6/usr.sbin/sysinstall: . help
Message-ID: <200907020044.n620iLoD028934@svn.freebsd.org>
Author: delphij
Date: Thu Jul 2 00:44:21 2009
New Revision: 195276
URL: http://svn.freebsd.org/changeset/base/195276
Log:
MFC r180208 (peter):
Set magic fbsd:nokeywords property that allows files to bypass
keyword expansion. (file-specific replacement for CVSROOT/exclude)
Modified:
stable/6/usr.sbin/sysinstall/ (props changed)
stable/6/usr.sbin/sysinstall/help/anonftp.hlp (props changed)
stable/6/usr.sbin/sysinstall/help/configure.hlp (props changed)
stable/6/usr.sbin/sysinstall/help/distributions.hlp (props changed)
stable/6/usr.sbin/sysinstall/help/drives.hlp (props changed)
stable/6/usr.sbin/sysinstall/help/fixit.hlp (props changed)
stable/6/usr.sbin/sysinstall/help/html.hlp (props changed)
stable/6/usr.sbin/sysinstall/help/media.hlp (props changed)
stable/6/usr.sbin/sysinstall/help/network_device.hlp (props changed)
stable/6/usr.sbin/sysinstall/help/options.hlp (props changed)
stable/6/usr.sbin/sysinstall/help/partition.hlp (props changed)
stable/6/usr.sbin/sysinstall/help/securelevel.hlp (props changed)
stable/6/usr.sbin/sysinstall/help/shortcuts.hlp (props changed)
stable/6/usr.sbin/sysinstall/help/slice.hlp (props changed)
stable/6/usr.sbin/sysinstall/help/tcp.hlp (props changed)
stable/6/usr.sbin/sysinstall/help/usage.hlp (props changed)
stable/6/usr.sbin/sysinstall/help/usermgmt.hlp (props changed)
From delphij at FreeBSD.org Thu Jul 2 00:45:30 2009
From: delphij at FreeBSD.org (Xin LI)
Date: Thu Jul 2 00:45:46 2009
Subject: svn commit: r195277 - in stable/6/usr.sbin/sysinstall: . help
Message-ID: <200907020045.n620jSi6029008@svn.freebsd.org>
Author: delphij
Date: Thu Jul 2 00:45:28 2009
New Revision: 195277
URL: http://svn.freebsd.org/changeset/base/195277
Log:
MFC r195012:
Correct a typo (which you can use to in order -> which you can use in order
to).
PR: bin/136040
Submitted by: "Vikentii L. Karabin"
Modified:
stable/6/usr.sbin/sysinstall/ (props changed)
stable/6/usr.sbin/sysinstall/help/usage.hlp
Modified: stable/6/usr.sbin/sysinstall/help/usage.hlp
==============================================================================
--- stable/6/usr.sbin/sysinstall/help/usage.hlp Thu Jul 2 00:44:21 2009 (r195276)
+++ stable/6/usr.sbin/sysinstall/help/usage.hlp Thu Jul 2 00:45:28 2009 (r195277)
@@ -56,7 +56,7 @@ it's also useful when dealing with sub-s
that don't use menus and tend to scroll their output off the top of
the screen.
-FreeBSD also supports multiple "virtual consoles" which you can use to
+FreeBSD also supports multiple "virtual consoles" which you can use
in order to have several active sessions at once. Use ALT-F to
switch between screens, where `F' is the function key corresponding
to the screen you wish to see. By default, the system comes with 8
From bf1783 at googlemail.com Thu Jul 2 09:05:08 2009
From: bf1783 at googlemail.com (b. f.)
Date: Thu Jul 2 09:05:15 2009
Subject: svn commit: r195230 - head
Message-ID:
>Ed Schouten wrote:
>> Ed Schouten wrote:
>> Not sure, but I think there were multiple header files that were
>> removed yesterday.
>Never mind. They were modified, not removed. Sorry for the noise!
There are at least three that I think may need to be _removed_ from
ObsoleteFiles.inc:
previously removed from system in usb changes four months ago and
added to ObsoleteFiles.inc in r188948 by thompsa@ , re-added to base
by thompsa@ a few days ago in r194677 reshuffling:
/usr/include/dev/usb/usbdi.h
/usr/include/dev/usb/usbdi_util.h
previously removed from base and added to ObsoleteFiles.inc in Nov.
2006 (r164619); re-added a few days ago by thompsa@ (r194676):
/usr/include/libusb.h
Regards,
From dimitry at andric.com Thu Jul 2 09:10:54 2009
From: dimitry at andric.com (Dimitry Andric)
Date: Thu Jul 2 09:11:01 2009
Subject: svn commit: r195230 - head
In-Reply-To:
References:
Message-ID: <4A4C799A.4070803@andric.com>
On 2009-07-02 10:37, b. f. wrote:
> previously removed from system in usb changes four months ago and
> added to ObsoleteFiles.inc in r188948 by thompsa@ , re-added to base
> by thompsa@ a few days ago in r194677 reshuffling:
>
> /usr/include/dev/usb/usbdi.h
> /usr/include/dev/usb/usbdi_util.h
>
> previously removed from base and added to ObsoleteFiles.inc in Nov.
> 2006 (r164619); re-added a few days ago by thompsa@ (r194676):
>
> /usr/include/libusb.h
Indeed, it looks like every time after a 'make installworld', these
files re-appear, only to be deleted later by 'make delete-old'. :)
From rwatson at FreeBSD.org Thu Jul 2 09:15:31 2009
From: rwatson at FreeBSD.org (Robert Watson)
Date: Thu Jul 2 09:15:43 2009
Subject: svn commit: r195280 - in head/sys: kern security/audit
Message-ID: <200907020915.n629FUSc038910@svn.freebsd.org>
Author: rwatson
Date: Thu Jul 2 09:15:30 2009
New Revision: 195280
URL: http://svn.freebsd.org/changeset/base/195280
Log:
Clean up a number of aspects of token generation from audit arguments to
system calls:
- Centralize generation of argument tokens for VM addresses in a macro,
ADDR_TOKEN(), and properly encode 64-bit addresses in 64-bit arguments.
- Fix up argument numbers across a large number of syscalls so that they
match the numeric argument into the system call.
- Don't audit the address argument to ioctl(2) or ptrace(2), but do keep
generating tokens for mmap(2), minherit(2), since they relate to passing
object access across execve(2).
Approved by: re (audit argument blanket)
Obtained from: TrustedBSD Project
MFC after: 1 week
Modified:
head/sys/kern/sys_process.c
head/sys/security/audit/audit_bsm.c
Modified: head/sys/kern/sys_process.c
==============================================================================
--- head/sys/kern/sys_process.c Thu Jul 2 04:56:11 2009 (r195279)
+++ head/sys/kern/sys_process.c Thu Jul 2 09:15:30 2009 (r195280)
@@ -402,7 +402,6 @@ ptrace(struct thread *td, struct ptrace_
#endif
AUDIT_ARG_PID(uap->pid);
AUDIT_ARG_CMD(uap->req);
- AUDIT_ARG_ADDR(uap->addr);
AUDIT_ARG_VALUE(uap->data);
addr = &r;
switch (uap->req) {
Modified: head/sys/security/audit/audit_bsm.c
==============================================================================
--- head/sys/security/audit/audit_bsm.c Thu Jul 2 04:56:11 2009 (r195279)
+++ head/sys/security/audit/audit_bsm.c Thu Jul 2 09:15:30 2009 (r195280)
@@ -253,7 +253,7 @@ kau_free(struct au_record *rec)
} \
} while (0)
-#define EXTATTR_TOKENS do { \
+#define EXTATTR_TOKENS(namespace_argnum) do { \
if (ARG_IS_VALID(kar, ARG_VALUE)) { \
switch (ar->ar_arg_value) { \
case EXTATTR_NAMESPACE_USER: \
@@ -263,8 +263,8 @@ kau_free(struct au_record *rec)
tok = au_to_text(EXTATTR_NAMESPACE_SYSTEM_STRING);\
break; \
default: \
- tok = au_to_arg32(3, "attrnamespace", \
- ar->ar_arg_value); \
+ tok = au_to_arg32((namespace_argnum), \
+ "attrnamespace", ar->ar_arg_value); \
break; \
} \
kau_write(rec, tok); \
@@ -277,6 +277,24 @@ kau_free(struct au_record *rec)
} while (0)
/*
+ * Not all pointer arguments to system calls are of interest, but in some
+ * cases they reflect delegation of rights, such as mmap(2) falled by
+ * minherit(2) before execve(2), so do the best we can.
+ */
+#define ADDR_TOKEN(argnum, argname) do { \
+ if (ARG_IS_VALID(kar, ARG_ADDR)) { \
+ if (sizeof(void *) == sizeof(uint32_t)) \
+ tok = au_to_arg32((argnum), (argname), \
+ (uint32_t)(uintptr_t)ar->ar_arg_addr); \
+ else \
+ tok = au_to_arg64((argnum), (argname), \
+ (uint64_t)(uintptr_t)ar->ar_arg_addr); \
+ kau_write(rec, tok); \
+ } \
+} while (0)
+
+
+/*
* Implement auditing for the auditon() system call. The audit tokens that
* are generated depend on the command that was sent into the auditon()
* system call.
@@ -286,21 +304,20 @@ audit_sys_auditon(struct audit_record *a
{
struct au_token *tok;
+ tok = au_to_arg32(3, "length", ar->ar_arg_len);
+ kau_write(rec, tok);
switch (ar->ar_arg_cmd) {
case A_OLDSETPOLICY:
if ((size_t)ar->ar_arg_len == sizeof(int64_t)) {
- tok = au_to_arg32(3, "length", ar->ar_arg_len);
- kau_write(rec, tok);
tok = au_to_arg64(2, "policy",
ar->ar_arg_auditon.au_policy64);
kau_write(rec, tok);
break;
}
/* FALLTHROUGH */
+
case A_SETPOLICY:
- tok = au_to_arg32(3, "length", ar->ar_arg_len);
- kau_write(rec, tok);
- tok = au_to_arg32(1, "policy", ar->ar_arg_auditon.au_policy);
+ tok = au_to_arg32(2, "policy", ar->ar_arg_auditon.au_policy);
kau_write(rec, tok);
break;
@@ -315,8 +332,6 @@ audit_sys_auditon(struct audit_record *a
case A_OLDSETQCTRL:
if ((size_t)ar->ar_arg_len == sizeof(au_qctrl64_t)) {
- tok = au_to_arg32(3, "length", ar->ar_arg_len);
- kau_write(rec, tok);
tok = au_to_arg64(2, "setqctrl:aq_hiwater",
ar->ar_arg_auditon.au_qctrl64.aq64_hiwater);
kau_write(rec, tok);
@@ -335,8 +350,9 @@ audit_sys_auditon(struct audit_record *a
break;
}
/* FALLTHROUGH */
+
case A_SETQCTRL:
- tok = au_to_arg32(3, "setqctrl:aq_hiwater",
+ tok = au_to_arg32(2, "setqctrl:aq_hiwater",
ar->ar_arg_auditon.au_qctrl.aq_hiwater);
kau_write(rec, tok);
tok = au_to_arg32(2, "setqctrl:aq_lowater",
@@ -354,17 +370,15 @@ audit_sys_auditon(struct audit_record *a
break;
case A_SETUMASK:
- tok = au_to_arg32(3, "setumask:as_success",
+ tok = au_to_arg32(2, "setumask:as_success",
ar->ar_arg_auditon.au_auinfo.ai_mask.am_success);
kau_write(rec, tok);
- tok = au_to_arg32(3, "setumask:as_failure",
+ tok = au_to_arg32(2, "setumask:as_failure",
ar->ar_arg_auditon.au_auinfo.ai_mask.am_failure);
kau_write(rec, tok);
break;
case A_SETSMASK:
- tok = au_to_arg32(3, "length", ar->ar_arg_len);
- kau_write(rec, tok);
tok = au_to_arg32(2, "setsmask:as_success",
ar->ar_arg_auditon.au_auinfo.ai_mask.am_success);
kau_write(rec, tok);
@@ -375,23 +389,19 @@ audit_sys_auditon(struct audit_record *a
case A_OLDSETCOND:
if ((size_t)ar->ar_arg_len == sizeof(int64_t)) {
- tok = au_to_arg32(3, "length", ar->ar_arg_len);
- kau_write(rec, tok);
tok = au_to_arg64(2, "setcond",
ar->ar_arg_auditon.au_cond64);
kau_write(rec, tok);
break;
}
/* FALLTHROUGH */
+
case A_SETCOND:
- tok = au_to_arg32(3, "length", ar->ar_arg_len);
- kau_write(rec, tok);
- tok = au_to_arg32(3, "setcond", ar->ar_arg_auditon.au_cond);
+ tok = au_to_arg32(2, "setcond", ar->ar_arg_auditon.au_cond);
kau_write(rec, tok);
break;
case A_SETCLASS:
- tok = au_to_arg32(3, "length", ar->ar_arg_len);
kau_write(rec, tok);
tok = au_to_arg32(2, "setclass:ec_event",
ar->ar_arg_auditon.au_evclass.ec_number);
@@ -402,8 +412,6 @@ audit_sys_auditon(struct audit_record *a
break;
case A_SETPMASK:
- tok = au_to_arg32(3, "length", ar->ar_arg_len);
- kau_write(rec, tok);
tok = au_to_arg32(2, "setpmask:as_success",
ar->ar_arg_auditon.au_aupinfo.ap_mask.am_success);
kau_write(rec, tok);
@@ -413,8 +421,6 @@ audit_sys_auditon(struct audit_record *a
break;
case A_SETFSIZE:
- tok = au_to_arg32(3, "length", ar->ar_arg_len);
- kau_write(rec, tok);
tok = au_to_arg32(2, "setfsize:filesize",
ar->ar_arg_auditon.au_fstat.af_filesz);
kau_write(rec, tok);
@@ -530,13 +536,13 @@ kaudit_to_bsm(struct kaudit_record *kar,
case AUE_SOCKET:
case AUE_SOCKETPAIR:
if (ARG_IS_VALID(kar, ARG_SOCKINFO)) {
- tok = au_to_arg32(1,"domain",
+ tok = au_to_arg32(1, "domain",
ar->ar_arg_sockinfo.so_domain);
kau_write(rec, tok);
- tok = au_to_arg32(2,"type",
+ tok = au_to_arg32(2, "type",
ar->ar_arg_sockinfo.so_type);
kau_write(rec, tok);
- tok = au_to_arg32(3,"protocol",
+ tok = au_to_arg32(3, "protocol",
ar->ar_arg_sockinfo.so_protocol);
kau_write(rec, tok);
}
@@ -734,7 +740,7 @@ kaudit_to_bsm(struct kaudit_record *kar,
case AUE_EACCESS:
UPATH1_VNODE1_TOKENS;
if (ARG_IS_VALID(kar, ARG_VALUE)) {
- tok = au_to_arg32(1, "mode", ar->ar_arg_value);
+ tok = au_to_arg32(2, "mode", ar->ar_arg_value);
kau_write(rec, tok);
}
break;
@@ -784,7 +790,7 @@ kaudit_to_bsm(struct kaudit_record *kar,
case AUE_CLOSE:
if (ARG_IS_VALID(kar, ARG_FD)) {
- tok = au_to_arg32(2, "fd", ar->ar_arg_fd);
+ tok = au_to_arg32(1, "fd", ar->ar_arg_fd);
kau_write(rec, tok);
}
UPATH1_VNODE1_TOKENS;
@@ -792,7 +798,7 @@ kaudit_to_bsm(struct kaudit_record *kar,
case AUE_CORE:
if (ARG_IS_VALID(kar, ARG_SIGNUM)) {
- tok = au_to_arg32(0, "signal", ar->ar_arg_signum);
+ tok = au_to_arg32(1, "signal", ar->ar_arg_signum);
kau_write(rec, tok);
}
UPATH1_VNODE1_TOKENS;
@@ -807,7 +813,7 @@ kaudit_to_bsm(struct kaudit_record *kar,
/* extattrctl(2) filename parameter is in upath2/vnode2 */
UPATH2_TOKENS;
VNODE2_TOKENS;
- EXTATTR_TOKENS;
+ EXTATTR_TOKENS(4);
break;
case AUE_EXTATTR_GET_FILE:
@@ -819,7 +825,7 @@ kaudit_to_bsm(struct kaudit_record *kar,
case AUE_EXTATTR_LIST_LINK:
case AUE_EXTATTR_DELETE_LINK:
UPATH1_VNODE1_TOKENS;
- EXTATTR_TOKENS;
+ EXTATTR_TOKENS(2);
break;
case AUE_EXTATTR_GET_FD:
@@ -830,7 +836,7 @@ kaudit_to_bsm(struct kaudit_record *kar,
tok = au_to_arg32(2, "fd", ar->ar_arg_fd);
kau_write(rec, tok);
}
- EXTATTR_TOKENS;
+ EXTATTR_TOKENS(2);
break;
case AUE_FEXECVE:
@@ -945,11 +951,6 @@ kaudit_to_bsm(struct kaudit_record *kar,
tok = au_to_arg32(2, "cmd", ar->ar_arg_cmd);
kau_write(rec, tok);
}
- if (ARG_IS_VALID(kar, ARG_ADDR)) {
- tok = au_to_arg32(1, "arg",
- (u_int32_t)(uintptr_t)ar->ar_arg_addr);
- kau_write(rec, tok);
- }
if (ARG_IS_VALID(kar, ARG_VNODE1))
FD_VNODE1_TOKENS;
else {
@@ -995,11 +996,7 @@ kaudit_to_bsm(struct kaudit_record *kar,
break;
case AUE_LOADSHFILE:
- if (ARG_IS_VALID(kar, ARG_ADDR)) {
- tok = au_to_arg32(4, "base addr",
- (u_int32_t)(uintptr_t)ar->ar_arg_addr);
- kau_write(rec, tok);
- }
+ ADDR_TOKEN(4, "base addr");
UPATH1_VNODE1_TOKENS;
break;
@@ -1029,11 +1026,7 @@ kaudit_to_bsm(struct kaudit_record *kar,
case AUE_MLOCK:
case AUE_MUNLOCK:
case AUE_MINHERIT:
- if (ARG_IS_VALID(kar, ARG_ADDR)) {
- tok = au_to_arg32(1, "addr",
- (u_int32_t)(uintptr_t)ar->ar_arg_addr);
- kau_write(rec, tok);
- }
+ ADDR_TOKEN(1, "addr");
if (ARG_IS_VALID(kar, ARG_LEN)) {
tok = au_to_arg32(2, "len", ar->ar_arg_len);
kau_write(rec, tok);
@@ -1071,14 +1064,14 @@ kaudit_to_bsm(struct kaudit_record *kar,
case AUE_NFS_SVC:
if (ARG_IS_VALID(kar, ARG_CMD)) {
- tok = au_to_arg32(1, "request", ar->ar_arg_cmd);
+ tok = au_to_arg32(1, "flags", ar->ar_arg_cmd);
kau_write(rec, tok);
}
break;
case AUE_UMOUNT:
if (ARG_IS_VALID(kar, ARG_VALUE)) {
- tok = au_to_arg32(1, "flags", ar->ar_arg_value);
+ tok = au_to_arg32(2, "flags", ar->ar_arg_value);
kau_write(rec, tok);
}
UPATH1_VNODE1_TOKENS;
@@ -1113,11 +1106,7 @@ kaudit_to_bsm(struct kaudit_record *kar,
break;
case AUE_RESETSHFILE:
- if (ARG_IS_VALID(kar, ARG_ADDR)) {
- tok = au_to_arg32(1, "base addr",
- (u_int32_t)(uintptr_t)ar->ar_arg_addr);
- kau_write(rec, tok);
- }
+ ADDR_TOKEN(1, "base addr");
break;
case AUE_OPEN_RC:
@@ -1151,11 +1140,6 @@ kaudit_to_bsm(struct kaudit_record *kar,
tok = au_to_arg32(1, "request", ar->ar_arg_cmd);
kau_write(rec, tok);
}
- if (ARG_IS_VALID(kar, ARG_ADDR)) {
- tok = au_to_arg32(3, "addr",
- (u_int32_t)(uintptr_t)ar->ar_arg_addr);
- kau_write(rec, tok);
- }
if (ARG_IS_VALID(kar, ARG_VALUE)) {
tok = au_to_arg32(4, "data", ar->ar_arg_value);
kau_write(rec, tok);
@@ -1172,6 +1156,10 @@ kaudit_to_bsm(struct kaudit_record *kar,
tok = au_to_arg32(3, "uid", ar->ar_arg_uid);
kau_write(rec, tok);
}
+ if (ARG_IS_VALID(kar, ARG_GID)) {
+ tok = au_to_arg32(3, "gid", ar->ar_arg_gid);
+ kau_write(rec, tok);
+ }
UPATH1_VNODE1_TOKENS;
break;
@@ -1210,14 +1198,14 @@ kaudit_to_bsm(struct kaudit_record *kar,
case AUE_SETEGID:
if (ARG_IS_VALID(kar, ARG_EGID)) {
- tok = au_to_arg32(1, "gid", ar->ar_arg_egid);
+ tok = au_to_arg32(1, "egid", ar->ar_arg_egid);
kau_write(rec, tok);
}
break;
case AUE_SETEUID:
if (ARG_IS_VALID(kar, ARG_EUID)) {
- tok = au_to_arg32(1, "uid", ar->ar_arg_euid);
+ tok = au_to_arg32(1, "euid", ar->ar_arg_euid);
kau_write(rec, tok);
}
break;
@@ -1315,8 +1303,9 @@ kaudit_to_bsm(struct kaudit_record *kar,
tok = au_to_arg32(2, "who", ar->ar_arg_uid);
kau_write(rec, tok);
}
+ PROCESS_PID_TOKENS(2);
if (ARG_IS_VALID(kar, ARG_VALUE)) {
- tok = au_to_arg32(2, "priority", ar->ar_arg_value);
+ tok = au_to_arg32(3, "priority", ar->ar_arg_value);
kau_write(rec, tok);
}
break;
@@ -1509,12 +1498,9 @@ kaudit_to_bsm(struct kaudit_record *kar,
break;
case AUE_WAIT4:
- if (ARG_IS_VALID(kar, ARG_PID)) {
- tok = au_to_arg32(0, "pid", ar->ar_arg_pid);
- kau_write(rec, tok);
- }
+ PROCESS_PID_TOKENS(1);
if (ARG_IS_VALID(kar, ARG_VALUE)) {
- tok = au_to_arg32(0, "options", ar->ar_arg_value);
+ tok = au_to_arg32(3, "options", ar->ar_arg_value);
kau_write(rec, tok);
}
break;
From rwatson at FreeBSD.org Thu Jul 2 09:16:25 2009
From: rwatson at FreeBSD.org (Robert Watson)
Date: Thu Jul 2 09:16:32 2009
Subject: svn commit: r195281 - head/sys/kern
Message-ID: <200907020916.n629GPJB038971@svn.freebsd.org>
Author: rwatson
Date: Thu Jul 2 09:16:25 2009
New Revision: 195281
URL: http://svn.freebsd.org/changeset/base/195281
Log:
Audit file descriptor and command arguments to ioctl(2).
Approved by: re (audit argument blanket)
MFC after: 1 week
Modified:
head/sys/kern/sys_generic.c
Modified: head/sys/kern/sys_generic.c
==============================================================================
--- head/sys/kern/sys_generic.c Thu Jul 2 09:15:30 2009 (r195280)
+++ head/sys/kern/sys_generic.c Thu Jul 2 09:16:25 2009 (r195281)
@@ -693,6 +693,8 @@ kern_ioctl(struct thread *td, int fd, u_
int error;
int tmp;
+ AUDIT_ARG_FD(fd);
+ AUDIT_ARG_CMD(com);
if ((error = fget(td, fd, &fp)) != 0)
return (error);
if ((fp->f_flag & (FREAD | FWRITE)) == 0) {
From rwatson at FreeBSD.org Thu Jul 2 09:50:15 2009
From: rwatson at FreeBSD.org (Robert Watson)
Date: Thu Jul 2 09:50:26 2009
Subject: svn commit: r195282 - head/sys/security/audit
Message-ID: <200907020950.n629oE35039790@svn.freebsd.org>
Author: rwatson
Date: Thu Jul 2 09:50:13 2009
New Revision: 195282
URL: http://svn.freebsd.org/changeset/base/195282
Log:
Fix comment misthink.
Submitted by: b. f.
Approved by: re (audit argument blanket)
MFC after: 1 week
Modified:
head/sys/security/audit/audit_bsm.c
Modified: head/sys/security/audit/audit_bsm.c
==============================================================================
--- head/sys/security/audit/audit_bsm.c Thu Jul 2 09:16:25 2009 (r195281)
+++ head/sys/security/audit/audit_bsm.c Thu Jul 2 09:50:13 2009 (r195282)
@@ -278,7 +278,7 @@ kau_free(struct au_record *rec)
/*
* Not all pointer arguments to system calls are of interest, but in some
- * cases they reflect delegation of rights, such as mmap(2) falled by
+ * cases they reflect delegation of rights, such as mmap(2) followed by
* minherit(2) before execve(2), so do the best we can.
*/
#define ADDR_TOKEN(argnum, argname) do { \
From ariff at FreeBSD.org Thu Jul 2 10:02:11 2009
From: ariff at FreeBSD.org (Ariff Abdullah)
Date: Thu Jul 2 10:02:19 2009
Subject: svn commit: r195283 - head/sys/tools/sound
Message-ID: <200907021002.n62A2A7t040106@svn.freebsd.org>
Author: ariff
Date: Thu Jul 2 10:02:10 2009
New Revision: 195283
URL: http://svn.freebsd.org/changeset/base/195283
Log:
Slightly increase amount of bandwidth of resampling filter for
feeder_rate_quality=3. This have the benefit of reducing aliasing
artifacts due to alias masking.
Spectrogram analysis:
o Old preset (100:36:0.90)
http://people.freebsd.org/~ariff/z_comparison/z_q3_old.png
o New preset (100:36:0.92):
http://people.freebsd.org/~ariff/z_comparison/z_q3_new.png
Approved by: re (kib)
Modified:
head/sys/tools/sound/feeder_rate_mkfilter.awk
Modified: head/sys/tools/sound/feeder_rate_mkfilter.awk
==============================================================================
--- head/sys/tools/sound/feeder_rate_mkfilter.awk Thu Jul 2 09:50:13 2009 (r195282)
+++ head/sys/tools/sound/feeder_rate_mkfilter.awk Thu Jul 2 10:02:10 2009 (r195283)
@@ -592,7 +592,7 @@ BEGIN {
if (ARGC < 2) {
ARGC = 1;
ARGV[ARGC++] = "100:8:0.85";
- ARGV[ARGC++] = "100:36:0.90";
+ ARGV[ARGC++] = "100:36:0.92";
ARGV[ARGC++] = "100:164:0.97";
#ARGV[ARGC++] = "100:8";
#ARGV[ARGC++] = "100:16";
From jamie at FreeBSD.org Thu Jul 2 14:19:34 2009
From: jamie at FreeBSD.org (Jamie Gritton)
Date: Thu Jul 2 14:19:41 2009
Subject: svn commit: r195285 - head/sys/kern
Message-ID: <200907021419.n62EJXMe046649@svn.freebsd.org>
Author: jamie
Date: Thu Jul 2 14:19:33 2009
New Revision: 195285
URL: http://svn.freebsd.org/changeset/base/195285
Log:
Call prison_check from vfs_suser rather than re-implementing it.
Approved by: re (kib), bz (mentor)
Modified:
head/sys/kern/vfs_subr.c
Modified: head/sys/kern/vfs_subr.c
==============================================================================
--- head/sys/kern/vfs_subr.c Thu Jul 2 12:41:21 2009 (r195284)
+++ head/sys/kern/vfs_subr.c Thu Jul 2 14:19:33 2009 (r195285)
@@ -461,8 +461,7 @@ vfs_suser(struct mount *mp, struct threa
* If the file system was mounted outside the jail of the calling
* thread, deny immediately.
*/
- if (mp->mnt_cred->cr_prison != td->td_ucred->cr_prison &&
- !prison_ischild(td->td_ucred->cr_prison, mp->mnt_cred->cr_prison))
+ if (prison_check(td->td_ucred, mp->mnt_cred) != 0)
return (EPERM);
/*
From rwatson at FreeBSD.org Thu Jul 2 16:33:40 2009
From: rwatson at FreeBSD.org (Robert Watson)
Date: Thu Jul 2 16:33:51 2009
Subject: svn commit: r195291 - head/sys/security/audit
Message-ID: <200907021633.n62GXdLq049282@svn.freebsd.org>
Author: rwatson
Date: Thu Jul 2 16:33:38 2009
New Revision: 195291
URL: http://svn.freebsd.org/changeset/base/195291
Log:
Create audit records for AUE_POSIX_OPENPT, currently w/o arguments.
Approved by: re (audit argument blanket)
Modified:
head/sys/security/audit/audit_bsm.c
Modified: head/sys/security/audit/audit_bsm.c
==============================================================================
--- head/sys/security/audit/audit_bsm.c Thu Jul 2 15:59:32 2009 (r195290)
+++ head/sys/security/audit/audit_bsm.c Thu Jul 2 16:33:38 2009 (r195291)
@@ -690,6 +690,7 @@ kaudit_to_bsm(struct kaudit_record *kar,
case AUE_MSGSYS:
case AUE_NTP_ADJTIME:
case AUE_PIPE:
+ case AUE_POSIX_OPENPT:
case AUE_PROFILE:
case AUE_RTPRIO:
case AUE_SEMSYS:
From kib at FreeBSD.org Thu Jul 2 18:02:57 2009
From: kib at FreeBSD.org (Konstantin Belousov)
Date: Thu Jul 2 18:03:08 2009
Subject: svn commit: r195294 - in head/sys: fs/cd9660 kern nfsclient ufs/ffs
Message-ID: <200907021802.n62I2tR1051178@svn.freebsd.org>
Author: kib
Date: Thu Jul 2 18:02:55 2009
New Revision: 195294
URL: http://svn.freebsd.org/changeset/base/195294
Log:
In vn_vget_ino() and their inline equivalents, mnt_ref() the mount point
around the sequence that drop vnode lock and then busies the mount point.
Not having vlocked node or direct reference to the mp allows for the
forced unmount to proceed, making mp unmounted or reused.
Tested by: pho
Reviewed by: jeff
Approved by: re (kensmith)
MFC after: 2 weeks
Modified:
head/sys/fs/cd9660/cd9660_lookup.c
head/sys/kern/vfs_vnops.c
head/sys/nfsclient/nfs_vnops.c
head/sys/ufs/ffs/ffs_softdep.c
Modified: head/sys/fs/cd9660/cd9660_lookup.c
==============================================================================
--- head/sys/fs/cd9660/cd9660_lookup.c Thu Jul 2 16:41:46 2009 (r195293)
+++ head/sys/fs/cd9660/cd9660_lookup.c Thu Jul 2 18:02:55 2009 (r195294)
@@ -376,9 +376,11 @@ found:
ltype = VOP_ISLOCKED(pdp);
error = vfs_busy(mp, MBF_NOWAIT);
if (error != 0) {
+ vfs_ref(mp);
VOP_UNLOCK(pdp, 0);
error = vfs_busy(mp, 0);
vn_lock(pdp, ltype | LK_RETRY);
+ vfs_rel(mp);
if (error)
return (ENOENT);
if (pdp->v_iflag & VI_DOOMED) {
Modified: head/sys/kern/vfs_vnops.c
==============================================================================
--- head/sys/kern/vfs_vnops.c Thu Jul 2 16:41:46 2009 (r195293)
+++ head/sys/kern/vfs_vnops.c Thu Jul 2 18:02:55 2009 (r195294)
@@ -1307,9 +1307,11 @@ vn_vget_ino(struct vnode *vp, ino_t ino,
("vn_vget_ino: vp not locked"));
error = vfs_busy(mp, MBF_NOWAIT);
if (error != 0) {
+ vfs_ref(mp);
VOP_UNLOCK(vp, 0);
error = vfs_busy(mp, 0);
vn_lock(vp, ltype | LK_RETRY);
+ vfs_rel(mp);
if (error != 0)
return (ENOENT);
if (vp->v_iflag & VI_DOOMED) {
Modified: head/sys/nfsclient/nfs_vnops.c
==============================================================================
--- head/sys/nfsclient/nfs_vnops.c Thu Jul 2 16:41:46 2009 (r195293)
+++ head/sys/nfsclient/nfs_vnops.c Thu Jul 2 18:02:55 2009 (r195294)
@@ -1043,9 +1043,11 @@ nfs_lookup(struct vop_lookup_args *ap)
ltype = VOP_ISLOCKED(dvp);
error = vfs_busy(mp, MBF_NOWAIT);
if (error != 0) {
+ vfs_ref(mp);
VOP_UNLOCK(dvp, 0);
error = vfs_busy(mp, 0);
vn_lock(dvp, ltype | LK_RETRY);
+ vfs_rel(mp);
if (error == 0 && (dvp->v_iflag & VI_DOOMED)) {
vfs_unbusy(mp);
error = ENOENT;
Modified: head/sys/ufs/ffs/ffs_softdep.c
==============================================================================
--- head/sys/ufs/ffs/ffs_softdep.c Thu Jul 2 16:41:46 2009 (r195293)
+++ head/sys/ufs/ffs/ffs_softdep.c Thu Jul 2 18:02:55 2009 (r195294)
@@ -5104,9 +5104,11 @@ softdep_fsync(vp)
FFSV_FORCEINSMQ)) {
error = vfs_busy(mp, MBF_NOWAIT);
if (error != 0) {
+ vfs_ref(mp);
VOP_UNLOCK(vp, 0);
error = vfs_busy(mp, 0);
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
+ vfs_rel(mp);
if (error != 0)
return (ENOENT);
if (vp->v_iflag & VI_DOOMED) {
From ed at FreeBSD.org Thu Jul 2 18:24:38 2009
From: ed at FreeBSD.org (Ed Schouten)
Date: Thu Jul 2 18:24:45 2009
Subject: svn commit: r195295 - in head/sys: amd64/conf i386/conf ia64/conf
pc98/conf powerpc/conf sparc64/conf sun4v/conf
Message-ID: <200907021824.n62IObWJ051643@svn.freebsd.org>
Author: ed
Date: Thu Jul 2 18:24:37 2009
New Revision: 195295
URL: http://svn.freebsd.org/changeset/base/195295
Log:
Enable POSIX semaphores on all non-embedded architectures by default.
More applications (including Firefox) seem to depend on this nowadays,
so not having this enabled by default is a bad idea.
Proposed by: miwi
Patch by: Florian Smeets
Approved by: re (kib)
Modified:
head/sys/amd64/conf/GENERIC
head/sys/i386/conf/GENERIC
head/sys/ia64/conf/GENERIC
head/sys/pc98/conf/GENERIC
head/sys/powerpc/conf/GENERIC
head/sys/sparc64/conf/GENERIC
head/sys/sun4v/conf/GENERIC
Modified: head/sys/amd64/conf/GENERIC
==============================================================================
--- head/sys/amd64/conf/GENERIC Thu Jul 2 18:02:55 2009 (r195294)
+++ head/sys/amd64/conf/GENERIC Thu Jul 2 18:24:37 2009 (r195295)
@@ -65,6 +65,7 @@ options STACK # stack(9) support
options SYSVSHM # SYSV-style shared memory
options SYSVMSG # SYSV-style message queues
options SYSVSEM # SYSV-style semaphores
+options P1003_1B_SEMAPHORES # POSIX-style semaphores
options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions
options PRINTF_BUFR_SIZE=128 # Prevent printf output being interspersed.
options KBD_INSTALL_CDEV # install a CDEV entry in /dev
Modified: head/sys/i386/conf/GENERIC
==============================================================================
--- head/sys/i386/conf/GENERIC Thu Jul 2 18:02:55 2009 (r195294)
+++ head/sys/i386/conf/GENERIC Thu Jul 2 18:24:37 2009 (r195295)
@@ -66,6 +66,7 @@ options STACK # stack(9) support
options SYSVSHM # SYSV-style shared memory
options SYSVMSG # SYSV-style message queues
options SYSVSEM # SYSV-style semaphores
+options P1003_1B_SEMAPHORES # POSIX-style semaphores
options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions
options PRINTF_BUFR_SIZE=128 # Prevent printf output being interspersed.
options KBD_INSTALL_CDEV # install a CDEV entry in /dev
Modified: head/sys/ia64/conf/GENERIC
==============================================================================
--- head/sys/ia64/conf/GENERIC Thu Jul 2 18:02:55 2009 (r195294)
+++ head/sys/ia64/conf/GENERIC Thu Jul 2 18:24:37 2009 (r195295)
@@ -58,6 +58,7 @@ options STACK # stack(9) support
options SYSVMSG # SYSV-style message queues
options SYSVSEM # SYSV-style semaphores
options SYSVSHM # SYSV-style shared memory
+options P1003_1B_SEMAPHORES # POSIX-style semaphores
options UFS_ACL # Support for access control lists
options UFS_DIRHASH # Hash-based directory lookup scheme
options UFS_GJOURNAL # Enable gjournal-based UFS journaling
Modified: head/sys/pc98/conf/GENERIC
==============================================================================
--- head/sys/pc98/conf/GENERIC Thu Jul 2 18:02:55 2009 (r195294)
+++ head/sys/pc98/conf/GENERIC Thu Jul 2 18:24:37 2009 (r195295)
@@ -69,6 +69,7 @@ options STACK # stack(9) support
#options SYSVSHM # SYSV-style shared memory
#options SYSVMSG # SYSV-style message queues
#options SYSVSEM # SYSV-style semaphores
+options P1003_1B_SEMAPHORES # POSIX-style semaphores
options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions
options KBD_INSTALL_CDEV # install a CDEV entry in /dev
options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4)
Modified: head/sys/powerpc/conf/GENERIC
==============================================================================
--- head/sys/powerpc/conf/GENERIC Thu Jul 2 18:02:55 2009 (r195294)
+++ head/sys/powerpc/conf/GENERIC Thu Jul 2 18:24:37 2009 (r195295)
@@ -61,6 +61,7 @@ options STACK #stack(9) support
options SYSVSHM #SYSV-style shared memory
options SYSVMSG #SYSV-style message queues
options SYSVSEM #SYSV-style semaphores
+options P1003_1B_SEMAPHORES # POSIX-style semaphores
options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions
options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4)
options AUDIT # Security event auditing
Modified: head/sys/sparc64/conf/GENERIC
==============================================================================
--- head/sys/sparc64/conf/GENERIC Thu Jul 2 18:02:55 2009 (r195294)
+++ head/sys/sparc64/conf/GENERIC Thu Jul 2 18:24:37 2009 (r195295)
@@ -66,6 +66,7 @@ options STACK # stack(9) support
options SYSVSHM # SYSV-style shared memory
options SYSVMSG # SYSV-style message queues
options SYSVSEM # SYSV-style semaphores
+options P1003_1B_SEMAPHORES # POSIX-style semaphores
options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions
options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4)
options AUDIT # Security event auditing
Modified: head/sys/sun4v/conf/GENERIC
==============================================================================
--- head/sys/sun4v/conf/GENERIC Thu Jul 2 18:02:55 2009 (r195294)
+++ head/sys/sun4v/conf/GENERIC Thu Jul 2 18:24:37 2009 (r195295)
@@ -58,6 +58,7 @@ options STACK # stack(9) support
options SYSVSHM # SYSV-style shared memory
options SYSVMSG # SYSV-style message queues
options SYSVSEM # SYSV-style semaphores
+options P1003_1B_SEMAPHORES # POSIX-style semaphores
options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions
options AHC_REG_PRETTY_PRINT # Print register bitfields in debug
# output. Adds ~128k to driver.
From ed at 80386.nl Thu Jul 2 18:48:54 2009
From: ed at 80386.nl (Ed Schouten)
Date: Thu Jul 2 18:49:05 2009
Subject: svn commit: r195295 - in head/sys: amd64/conf i386/conf
ia64/conf pc98/conf powerpc/conf sparc64/conf sun4v/conf
In-Reply-To: <200907021824.n62IObWJ051643@svn.freebsd.org>
References: <200907021824.n62IObWJ051643@svn.freebsd.org>
Message-ID: <20090702184852.GO48776@hoeg.nl>
* Ed Schouten wrote:
> Log:
> Enable POSIX semaphores on all non-embedded architectures by default.
>
> More applications (including Firefox) seem to depend on this nowadays,
> so not having this enabled by default is a bad idea.
>
> Proposed by: miwi
> Patch by: Florian Smeets
> Approved by: re (kib)
MFC after: 2 weeks
--
Ed Schouten
WWW: http://80386.nl/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/svn-src-all/attachments/20090702/d0b3cfcf/attachment.pgp
From brian at Awfulhak.org Thu Jul 2 19:01:02 2009
From: brian at Awfulhak.org (Brian Somers)
Date: Thu Jul 2 19:01:29 2009
Subject: svn commit: r195295 - in head/sys: amd64/conf i386/conf
ia64/conf pc98/conf powerpc/conf sparc64/conf sun4v/conf
In-Reply-To: <200907021824.n62IObWJ051643@svn.freebsd.org>
References: <200907021824.n62IObWJ051643@svn.freebsd.org>
Message-ID: <20090702113215.38b4ece6@Awfulhak.org>
On Thu, 2 Jul 2009 18:24:37 +0000 (UTC), Ed Schouten wrote:
> Author: ed
> Date: Thu Jul 2 18:24:37 2009
> New Revision: 195295
> URL: http://svn.freebsd.org/changeset/base/195295
>
> Log:
> Enable POSIX semaphores on all non-embedded architectures by default.
>
> More applications (including Firefox) seem to depend on this nowadays,
> so not having this enabled by default is a bad idea.
>
> Proposed by: miwi
> Patch by: Florian Smeets
> Approved by: re (kib)
>
> Modified:
> head/sys/amd64/conf/GENERIC
> head/sys/i386/conf/GENERIC
> head/sys/ia64/conf/GENERIC
> head/sys/pc98/conf/GENERIC
> head/sys/powerpc/conf/GENERIC
> head/sys/sparc64/conf/GENERIC
> head/sys/sun4v/conf/GENERIC
Do you plan to MFC this? I can see it irritating quite a few
7.2^H3 users...
Cheers.
--
Brian Somers
Don't _EVER_ lose your sense of humour !
From ed at 80386.nl Thu Jul 2 19:12:29 2009
From: ed at 80386.nl (Ed Schouten)
Date: Thu Jul 2 19:12:40 2009
Subject: svn commit: r195295 - in head/sys: amd64/conf i386/conf
ia64/conf pc98/conf powerpc/conf sparc64/conf sun4v/conf
In-Reply-To: <20090702113215.38b4ece6@Awfulhak.org>
References: <200907021824.n62IObWJ051643@svn.freebsd.org>
<20090702113215.38b4ece6@Awfulhak.org>
Message-ID: <20090702191227.GQ48776@hoeg.nl>
* Brian Somers wrote:
> Do you plan to MFC this? I can see it irritating quite a few
> 7.2^H3 users...
Yes. I forgot to mention it in the commit message, but I will.
--
Ed Schouten
WWW: http://80386.nl/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/svn-src-all/attachments/20090702/49304f37/attachment.pgp
From bf1783 at googlemail.com Thu Jul 2 19:39:02 2009
From: bf1783 at googlemail.com (b. f.)
Date: Thu Jul 2 19:39:08 2009
Subject: svn commit: r195295 - in head/sys: amd64/conf i386/conf
ia64/conf pc98/conf powerpc/conf sparc64/conf sun4v/conf
Message-ID:
> Enable POSIX semaphores on all non-embedded architectures by default.
Are you claiming, then, that the warning regarding this option in
src/sys/conf/NOTES is outdated and no longer accurate? If so,
shouldn't the warning be removed? Or are there still reasons for
caution?
b.
From trasz at FreeBSD.org Thu Jul 2 20:05:22 2009
From: trasz at FreeBSD.org (Edward Tomasz Napierala)
Date: Thu Jul 2 20:05:37 2009
Subject: svn commit: r195296 - in head: sys/ufs/ufs tools/regression/acltools
Message-ID: <200907022005.n62K5LXo053614@svn.freebsd.org>
Author: trasz
Date: Thu Jul 2 20:05:21 2009
New Revision: 195296
URL: http://svn.freebsd.org/changeset/base/195296
Log:
Fix fpathconf(3) on fifos, in effect making ls(1) properly
display '+' on them. Taken from kern/125613, with cosmetic
changes.
PR: kern/125613
Submitted by: Jaakko Heinonen
Approved by: re (kib)
Modified:
head/sys/ufs/ufs/ufs_vnops.c
head/tools/regression/acltools/tools-posix.test
Modified: head/sys/ufs/ufs/ufs_vnops.c
==============================================================================
--- head/sys/ufs/ufs/ufs_vnops.c Thu Jul 2 18:24:37 2009 (r195295)
+++ head/sys/ufs/ufs/ufs_vnops.c Thu Jul 2 20:05:21 2009 (r195296)
@@ -112,6 +112,7 @@ static vop_symlink_t ufs_symlink;
static vop_whiteout_t ufs_whiteout;
static vop_close_t ufsfifo_close;
static vop_kqfilter_t ufsfifo_kqfilter;
+static vop_pathconf_t ufsfifo_pathconf;
/*
* A virgin directory (no blushing please).
@@ -2101,6 +2102,29 @@ ufsfifo_kqfilter(ap)
}
/*
+ * Return POSIX pathconf information applicable to fifos.
+ */
+static int
+ufsfifo_pathconf(ap)
+ struct vop_pathconf_args /* {
+ struct vnode *a_vp;
+ int a_name;
+ int *a_retval;
+ } */ *ap;
+{
+
+ switch (ap->a_name) {
+ case _PC_ACL_EXTENDED:
+ case _PC_ACL_PATH_MAX:
+ case _PC_MAC_PRESENT:
+ return (ufs_pathconf(ap));
+ default:
+ return (fifo_specops.vop_pathconf(ap));
+ }
+ /* NOTREACHED */
+}
+
+/*
* Return POSIX pathconf information applicable to ufs filesystems.
*/
static int
@@ -2520,6 +2544,7 @@ struct vop_vector ufs_fifoops = {
.vop_inactive = ufs_inactive,
.vop_kqfilter = ufsfifo_kqfilter,
.vop_markatime = ufs_markatime,
+ .vop_pathconf = ufsfifo_pathconf,
.vop_print = ufs_print,
.vop_read = VOP_PANIC,
.vop_reclaim = ufs_reclaim,
Modified: head/tools/regression/acltools/tools-posix.test
==============================================================================
--- head/tools/regression/acltools/tools-posix.test Thu Jul 2 18:24:37 2009 (r195295)
+++ head/tools/regression/acltools/tools-posix.test Thu Jul 2 20:05:21 2009 (r195296)
@@ -353,3 +353,37 @@ $ rmdir ddd/ddd
$ rm ddd/xxx
$ rmdir ddd
+# Test if we deal properly with fifos.
+$ mkfifo fff
+$ ls -l fff | cut -d' ' -f1
+> prw-r--r--
+
+$ setfacl -m u:42:r,g:43:w fff
+$ getfacl fff
+> # file: fff
+> # owner: root
+> # group: wheel
+> user::rw-
+> user:42:r--
+> group::r--
+> group:43:-w-
+> mask::rw-
+> other::r--
+
+$ ls -l fff | cut -d' ' -f1
+> prw-rw-r--+
+
+$ setfacl -bn fff
+$ getfacl fff
+> # file: fff
+> # owner: root
+> # group: wheel
+> user::rw-
+> group::r--
+> other::r--
+
+$ ls -l fff | cut -d' ' -f1
+> prw-r--r--
+
+$ rm fff
+
From jilles at stack.nl Fri Jul 3 14:23:36 2009
From: jilles at stack.nl (Jilles Tjoelker)
Date: Fri Jul 3 14:23:55 2009
Subject: svn commit: r195243 - head/bin/chmod
In-Reply-To: <200907011552.n61FqJL5016996@svn.freebsd.org>
References: <200907011552.n61FqJL5016996@svn.freebsd.org>
Message-ID: <20090703142334.GA53614@stack.nl>
On Wed, Jul 01, 2009 at 03:52:19PM +0000, Edward Tomasz Napierala wrote:
> + ret = pathconf(ent->fts_accpath, _PC_ACL_NFS4);
There doesn't seem to be anything like lpathconf() or
fpathconfat(AT_SYMLINK_NOFOLLOW), so this may not work properly for
symlinks (chmod -h).
--
Jilles Tjoelker
From kientzle at FreeBSD.org Fri Jul 3 17:54:34 2009
From: kientzle at FreeBSD.org (Tim Kientzle)
Date: Fri Jul 3 17:54:40 2009
Subject: svn commit: r195318 - head/usr.bin/cpio
Message-ID: <200907031754.n63HsXRn084493@svn.freebsd.org>
Author: kientzle
Date: Fri Jul 3 17:54:33 2009
New Revision: 195318
URL: http://svn.freebsd.org/changeset/base/195318
Log:
This fixes bsdcpio's -R option to accept numeric
user or group Ids as well as user or group names.
In particular, this fixes freesbie2, which uses
-R 0:0 to copy a bunch of files so that the result
will be owned by root.
Also fixes a related bug that mixed-up the uid
and gid specified by -R when in passthrough mode.
Thanks to Dominique Goncalves for reporting this
regression.
Approved by: re (kib)
Modified:
head/usr.bin/cpio/cmdline.c
head/usr.bin/cpio/cpio.c
Modified: head/usr.bin/cpio/cmdline.c
==============================================================================
--- head/usr.bin/cpio/cmdline.c Fri Jul 3 16:33:42 2009 (r195317)
+++ head/usr.bin/cpio/cmdline.c Fri Jul 3 17:54:33 2009 (r195318)
@@ -268,16 +268,36 @@ cpio_getopt(struct cpio *cpio)
* Parse the argument to the -R or --owner flag.
*
* The format is one of the following:
- * - Override user but not group
- * : - Override both, group is user's default group
- * : - Override both
- * : - Override group but not user
+ * - Override user but not group
+ * : - Override both, group is user's default group
+ * : - Override user but not group
+ * : - Override both
+ * : - Override group but not user
+ *
+ * Where uid/gid are decimal representations and groupname/username
+ * are names to be looked up in system database. Note that
+ * uid/gid parsing takes priority over username/groupname lookup,
+ * so this won't do a lookup for usernames or group names that
+ * consist entirely of digits.
*
* A period can be used instead of the colon.
*
- * Sets uid/gid as appropriate, -1 indicates uid/gid not specified.
+ * Sets uid/gid return as appropriate, -1 indicates uid/gid not specified.
*
*/
+static int
+decimal_parse(const char *p)
+{
+ /* TODO: guard against overflow. */
+ int n = 0;
+ for (; *p != '\0'; ++p) {
+ if (*p < '0' || *p > '9')
+ return (-1);
+ n = n * 10 + *p - '0';
+ }
+ return (n);
+}
+
int
owner_parse(const char *spec, int *uid, int *gid)
{
@@ -318,24 +338,34 @@ owner_parse(const char *spec, int *uid,
}
memcpy(user, u, ue - u);
user[ue - u] = '\0';
- pwent = getpwnam(user);
- if (pwent == NULL) {
- cpio_warnc(errno, "Couldn't lookup user ``%s''", user);
- return (1);
+ *uid = decimal_parse(user);
+ if (*uid < 0) {
+ /* Couldn't parse as integer, try username lookup. */
+ pwent = getpwnam(user);
+ if (pwent == NULL) {
+ cpio_warnc(errno,
+ "Couldn't lookup user ``%s''", user);
+ return (1);
+ }
+ *uid = pwent->pw_uid;
+ if (*ue != '\0' && *g == '\0')
+ *gid = pwent->pw_gid;
}
free(user);
- *uid = pwent->pw_uid;
- if (*ue != '\0' && *g == '\0')
- *gid = pwent->pw_gid;
}
if (*g != '\0') {
- struct group *grp;
- grp = getgrnam(g);
- if (grp != NULL)
- *gid = grp->gr_gid;
- else {
- cpio_warnc(errno, "Couldn't look up group ``%s''", g);
- return (1);
+ *gid = decimal_parse(g);
+ if (*gid < 0) {
+ /* Couldn't parse int, try group name lookup. */
+ struct group *grp;
+ grp = getgrnam(g);
+ if (grp != NULL)
+ *gid = grp->gr_gid;
+ else {
+ cpio_warnc(errno,
+ "Couldn't look up group ``%s''", g);
+ return (1);
+ }
}
}
return (0);
Modified: head/usr.bin/cpio/cpio.c
==============================================================================
--- head/usr.bin/cpio/cpio.c Fri Jul 3 16:33:42 2009 (r195317)
+++ head/usr.bin/cpio/cpio.c Fri Jul 3 17:54:33 2009 (r195318)
@@ -575,7 +575,7 @@ file_to_archive(struct cpio *cpio, const
if (cpio->uid_override >= 0)
st.st_uid = cpio->uid_override;
if (cpio->gid_override >= 0)
- st.st_gid = cpio->uid_override;
+ st.st_gid = cpio->gid_override;
archive_entry_copy_stat(entry, &st);
#if !defined(_WIN32) || defined(__CYGWIN__)
From brooks at FreeBSD.org Fri Jul 3 18:37:14 2009
From: brooks at FreeBSD.org (Brooks Davis)
Date: Fri Jul 3 18:37:20 2009
Subject: svn commit: r195318 - head/usr.bin/cpio
In-Reply-To: <200907031754.n63HsXRn084493@svn.freebsd.org>
References: <200907031754.n63HsXRn084493@svn.freebsd.org>
Message-ID: <20090703183609.GA45185@lor.one-eyed-alien.net>
On Fri, Jul 03, 2009 at 05:54:33PM +0000, Tim Kientzle wrote:
> Modified: head/usr.bin/cpio/cmdline.c
> ==============================================================================
> --- head/usr.bin/cpio/cmdline.c Fri Jul 3 16:33:42 2009 (r195317)
> +++ head/usr.bin/cpio/cmdline.c Fri Jul 3 17:54:33 2009 (r195318)
> @@ -268,16 +268,36 @@ cpio_getopt(struct cpio *cpio)
> * Parse the argument to the -R or --owner flag.
> *
> * The format is one of the following:
> - * - Override user but not group
> - * : - Override both, group is user's default group
> - * : - Override both
> - * : - Override group but not user
> + * - Override user but not group
> + * : - Override both, group is user's default group
> + * : - Override user but not group
> + * : - Override both
> + * : - Override group but not user
> + *
> + * Where uid/gid are decimal representations and groupname/username
> + * are names to be looked up in system database. Note that
> + * uid/gid parsing takes priority over username/groupname lookup,
> + * so this won't do a lookup for usernames or group names that
> + * consist entirely of digits.
Is this behavior specified somewhere? It is counter to the usual rule
that the system should attempt to resolve all strings as a name first.
For example, the following is from the chown manpage in POSIX.1-2008
If a numeric owner operand exists in the user database as a user
name, the user ID number associated with that user name shall be
used as the user ID.
Numeric usernames are a disaster, especially if they can't match the uid
for some reason, but following this rule consistently at least makes
things more sane if you're stuck with them.
-- Brooks
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/svn-src-all/attachments/20090703/d3e15e54/attachment.pgp
From danfe at FreeBSD.org Fri Jul 3 19:17:53 2009
From: danfe at FreeBSD.org (Alexey Dokuchaev)
Date: Fri Jul 3 19:18:04 2009
Subject: svn commit: r195318 - head/usr.bin/cpio
In-Reply-To: <200907031754.n63HsXRn084493@svn.freebsd.org>
References: <200907031754.n63HsXRn084493@svn.freebsd.org>
Message-ID: <20090703191753.GA48087@FreeBSD.org>
Tim Kientzle wrote:
> Author: kientzle
> Date: Fri Jul 3 17:54:33 2009
> New Revision: 195318
> URL: http://svn.freebsd.org/changeset/base/195318
>
> + * Where uid/gid are decimal representations and groupname/username
> + * are names to be looked up in system database. Note that ^^^^^^^
Bad indentation: "uid/gid" occupies seven characters, so wrap is
premature here (there are exactly seven ^ marks above).
> + * uid/gid parsing takes priority over username/groupname lookup,
> + * so this won't do a lookup for usernames or group names that
> + * consist entirely of digits.
> *
> * A period can be used instead of the colon.
> *
> - * Sets uid/gid as appropriate, -1 indicates uid/gid not specified.
> + * Sets uid/gid return as appropriate, -1 indicates uid/gid not specified.
> *
> */
> +static int
> +decimal_parse(const char *p)
> +{
> + /* TODO: guard against overflow. */
> + int n = 0;
> + for (; *p != '\0'; ++p) {
> + if (*p < '0' || *p > '9')
> + return (-1);
> + n = n * 10 + *p - '0';
> + }
> + return (n);
> +}
Roll own your own strtoul(3)? What kind of NIH is this? :-)
> +
> int
> owner_parse(const char *spec, int *uid, int *gid)
> {
> @@ -318,24 +338,34 @@ owner_parse(const char *spec, int *uid,
> }
> memcpy(user, u, ue - u);
> user[ue - u] = '\0';
> - pwent = getpwnam(user);
> - if (pwent == NULL) {
> - cpio_warnc(errno, "Couldn't lookup user ``%s''", user);
> - return (1);
> + *uid = decimal_parse(user);
> + if (*uid < 0) {
> + /* Couldn't parse as integer, try username lookup. */
> + pwent = getpwnam(user);
> + if (pwent == NULL) {
> + cpio_warnc(errno,
> + "Couldn't lookup user ``%s''", user);
> + return (1);
> + }
> + *uid = pwent->pw_uid;
> + if (*ue != '\0' && *g == '\0')
> + *gid = pwent->pw_gid;
Why not something simple like this:
if ((pwent = getpwnam(user)) != NULL)
uid = pwent->pw_uid;
else {
errno = 0;
uid = strtoul(user, &ep, 10);
if (errno || user[0] == '\0' || *ep != '\0')
cpio_warnc("invalid user: %s", user);
}
./danfe
From rpaulo at FreeBSD.org Fri Jul 3 21:12:38 2009
From: rpaulo at FreeBSD.org (Rui Paulo)
Date: Fri Jul 3 21:12:45 2009
Subject: svn commit: r195325 - in head: share/man/man4 sys/dev/acpi_support
Message-ID: <200907032112.n63LCcWv088541@svn.freebsd.org>
Author: rpaulo
Date: Fri Jul 3 21:12:37 2009
New Revision: 195325
URL: http://svn.freebsd.org/changeset/base/195325
Log:
acpi_hp.c:
- sysctl dev.acpi_hp.0.verbose to toggle debug output
- A modification so this can deal with different array lengths
when reading the CMI BIOS - now it works ok on HP Compaq nx7300
as well.
- Change behaviour to query only max_instance-1 CMI BIOS instances,
because all HPs seen so far are broken in that respect
(or there is a fundamental misunderstanding on my side, possible
as well). This way a disturbing ACPI Error Field exceeds Buffer
message is avoided.
- New bit to set on dev.acpi_hp.0.cmi_detail (0x8) to
also query the highest guid instance of CMI bios
acpi_hp.4:
- Document dev.acpi_hp.0.verbose sysctl in man page
- Document new bit for dev.acpi_hp.0.cmi_detail
- Add a section to manpage about hardware that has been reported
to work ok
Submitted by: Michael Gmelin
Approved by: re (kib)
MFC after: 2 weeks
Modified:
head/share/man/man4/acpi_hp.4
head/share/man/man4/acpi_wmi.4
head/sys/dev/acpi_support/acpi_hp.c
Modified: head/share/man/man4/acpi_hp.4
==============================================================================
--- head/share/man/man4/acpi_hp.4 Fri Jul 3 21:09:55 2009 (r195324)
+++ head/share/man/man4/acpi_hp.4 Fri Jul 3 21:12:37 2009 (r195325)
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd June 21, 2009
+.Dd June 30, 2009
.Dt ACPI_HP 4 i386
.Os
.Sh NAME
@@ -92,8 +92,8 @@ WWAN on air status changed to 0 (not on
WWAN on air status changed to 1 (on air)
.El
.Ss Xr devfs 8 Ss Device
-You can read /dev/hpcmi to see your current BIOS settings. The detail level
-can be adjusted by setting the sysctl
+You can read /dev/hpcmi to see your current BIOS settings.
+The detail level can be adjusted by setting the sysctl
.Va cmi_detail
as described below.
.Sh SYSCTL VARIABLES
@@ -166,13 +166,29 @@ Show a list of valid options for the BIO
.It Li 0x04
Show additional flags of BIOS setting (ReadOnly etc.)
.It Li 0x08
-Query highest BIOS entry instance. This is broken on many HP models and
-therefore disabled by default.
+Query highest BIOS entry instance.
+This is broken on many HP models and therefore disabled by default.
.El
+.It Va dev.acpi_hp.0.verbose
+(read-only)
+Set verbosity level
.El
.Pp
Defaults for these sysctls can be set in
.Xr sysctl.conf 5 .
+.Sh HARDWARE
+The
+.Nm
+driver has been reported to support the following hardware:
+.Pp
+.Bl -bullet -compact
+.It
+HP Compaq 8510p
+.It
+HP Compaq nx7300
+.El
+.Pp
+It should work on most HP laptops that feature a WMI enabled BIOS.
.Sh FILES
.Bl -tag -width ".Pa /dev/hpcmi"
.It Pa /dev/hpcmi
@@ -248,7 +264,7 @@ The
driver was written by
.An Michael Gmelin Aq freebsd@grem.de
.Pp
-It has been inspired by hp-wmi driver, which implements a subset of these
+It has been inspired by hp-wmi driver, which implements a subset of these
features (hotkeys) on Linux.
.Pp
.Bl -tag -width indent
Modified: head/share/man/man4/acpi_wmi.4
==============================================================================
--- head/share/man/man4/acpi_wmi.4 Fri Jul 3 21:09:55 2009 (r195324)
+++ head/share/man/man4/acpi_wmi.4 Fri Jul 3 21:12:37 2009 (r195325)
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd June 21, 2009
+.Dd June 30, 2009
.Dt ACPI_WMI 4 i386
.Os
.Sh NAME
@@ -48,7 +48,8 @@ acpi_wmi_load="YES"
The
.Nm
driver provides an interface for vendor specific WMI implementations
-(e.g. HP and Acer laptops). It creates /dev/wmistat, which can be read to get
+(e.g. HP and Acer laptops).
+It creates /dev/wmistat, which can be read to get
information about GUIDs found in the system.
.Sh FILES
.Bl -tag -width /dev/wmistat -compact
Modified: head/sys/dev/acpi_support/acpi_hp.c
==============================================================================
--- head/sys/dev/acpi_support/acpi_hp.c Fri Jul 3 21:09:55 2009 (r195324)
+++ head/sys/dev/acpi_support/acpi_hp.c Fri Jul 3 21:12:37 2009 (r195325)
@@ -92,6 +92,7 @@ ACPI_MODULE_NAME("HP")
#define ACPI_HP_METHOD_HDDTEMP 18
#define ACPI_HP_METHOD_DOCK 19
#define ACPI_HP_METHOD_CMI_DETAIL 20
+#define ACPI_HP_METHOD_VERBOSE 21
#define HP_MASK_WWAN_ON_AIR 0x1000000
#define HP_MASK_BLUETOOTH_ON_AIR 0x10000
@@ -121,6 +122,7 @@ struct acpi_hp_softc {
int has_cmi; /* CMI GUID found */
int cmi_detail; /* CMI detail level
(set by sysctl) */
+ int verbose; /* add debug output */
int wlan_enable_if_radio_on; /* set by sysctl */
int wlan_disable_if_radio_off; /* set by sysctl */
int bluetooth_enable_if_radio_on; /* set by sysctl */
@@ -275,6 +277,12 @@ static struct {
"(cat /dev/hpcmi)",
.access = CTLTYPE_INT | CTLFLAG_RW
},
+ {
+ .name = "verbose",
+ .method = ACPI_HP_METHOD_VERBOSE,
+ .description = "Verbosity level",
+ .access = CTLTYPE_INT | CTLFLAG_RW
+ },
{ NULL, 0, NULL, 0 }
};
@@ -334,10 +342,10 @@ MODULE_DEPEND(acpi_hp, acpi, 1, 1, 1);
static void
acpi_hp_evaluate_auto_on_off(struct acpi_hp_softc *sc)
{
- int wireless;
- int new_wlan_status;
- int new_bluetooth_status;
- int new_wwan_status;
+ int wireless;
+ int new_wlan_status;
+ int new_bluetooth_status;
+ int new_wwan_status;
wireless = acpi_hp_exec_wmi_command(sc->wmi_dev,
ACPI_HP_WMI_WIRELESS_COMMAND, 0, 0);
@@ -345,7 +353,8 @@ acpi_hp_evaluate_auto_on_off(struct acpi
new_bluetooth_status = -1;
new_wwan_status = -1;
- device_printf(sc->wmi_dev, "Wireless status is %x\n", wireless);
+ if (sc->verbose)
+ device_printf(sc->wmi_dev, "Wireless status is %x\n", wireless);
if (sc->wlan_disable_if_radio_off && !(wireless & HP_MASK_WLAN_RADIO)
&& (wireless & HP_MASK_WLAN_ENABLED)) {
acpi_hp_exec_wmi_command(sc->wmi_dev,
@@ -391,10 +400,11 @@ acpi_hp_evaluate_auto_on_off(struct acpi
new_wlan_status = (wireless & HP_MASK_WLAN_ON_AIR);
if ((new_wlan_status?1:0) != sc->was_wlan_on_air) {
sc->was_wlan_on_air = sc->was_wlan_on_air?0:1;
- device_printf(sc->wmi_dev,
- "WLAN on air changed to %i "
- "(new_wlan_status is %i)\n",
- sc->was_wlan_on_air, new_wlan_status);
+ if (sc->verbose)
+ device_printf(sc->wmi_dev,
+ "WLAN on air changed to %i "
+ "(new_wlan_status is %i)\n",
+ sc->was_wlan_on_air, new_wlan_status);
acpi_UserNotify("HP", sc->handle,
0xc0+sc->was_wlan_on_air);
}
@@ -404,9 +414,12 @@ acpi_hp_evaluate_auto_on_off(struct acpi
if ((new_bluetooth_status?1:0) != sc->was_bluetooth_on_air) {
sc->was_bluetooth_on_air = sc->was_bluetooth_on_air?
0:1;
- device_printf(sc->wmi_dev, "BLUETOOTH on air changed"
- " to %i (new_bluetooth_status is %i)\n",
- sc->was_bluetooth_on_air, new_bluetooth_status);
+ if (sc->verbose)
+ device_printf(sc->wmi_dev,
+ "BLUETOOTH on air changed"
+ " to %i (new_bluetooth_status is %i)\n",
+ sc->was_bluetooth_on_air,
+ new_bluetooth_status);
acpi_UserNotify("HP", sc->handle,
0xd0+sc->was_bluetooth_on_air);
}
@@ -415,9 +428,11 @@ acpi_hp_evaluate_auto_on_off(struct acpi
new_wwan_status = (wireless & HP_MASK_WWAN_ON_AIR);
if ((new_wwan_status?1:0) != sc->was_wwan_on_air) {
sc->was_wwan_on_air = sc->was_wwan_on_air?0:1;
- device_printf(sc->wmi_dev, "WWAN on air changed to %i"
- " (new_wwan_status is %i)\n",
- sc->was_wwan_on_air, new_wwan_status);
+ if (sc->verbose)
+ device_printf(sc->wmi_dev,
+ "WWAN on air changed to %i"
+ " (new_wwan_status is %i)\n",
+ sc->was_wwan_on_air, new_wwan_status);
acpi_UserNotify("HP", sc->handle,
0xe0+sc->was_wwan_on_air);
}
@@ -440,7 +455,7 @@ acpi_hp_attach(device_t dev)
struct acpi_hp_softc *sc;
struct acpi_softc *acpi_sc;
devclass_t wmi_devclass;
- int arg;
+ int arg;
ACPI_FUNCTION_TRACE((char *)(uintptr_t) __func__);
@@ -460,6 +475,7 @@ acpi_hp_attach(device_t dev)
sc->was_wwan_on_air = 0;
sc->cmi_detail = 0;
sc->cmi_order_size = -1;
+ sc->verbose = 0;
memset(sc->cmi_order, 0, sizeof(sc->cmi_order));
acpi_sc = acpi_device_get_parent_softc(dev);
@@ -553,7 +569,7 @@ acpi_hp_attach(device_t dev)
static int
acpi_hp_detach(device_t dev)
{
- int ret;
+ int ret;
ACPI_FUNCTION_TRACE((char *)(uintptr_t) __func__);
struct acpi_hp_softc *sc = device_get_softc(dev);
@@ -580,12 +596,12 @@ acpi_hp_detach(device_t dev)
static int
acpi_hp_sysctl(SYSCTL_HANDLER_ARGS)
{
- struct acpi_hp_softc *sc;
- int arg;
- int oldarg;
- int error = 0;
- int function;
- int method;
+ struct acpi_hp_softc *sc;
+ int arg;
+ int oldarg;
+ int error = 0;
+ int function;
+ int method;
ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
@@ -608,7 +624,7 @@ acpi_hp_sysctl(SYSCTL_HANDLER_ARGS)
static int
acpi_hp_sysctl_get(struct acpi_hp_softc *sc, int method)
{
- int val = 0;
+ int val = 0;
ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
ACPI_SERIAL_ASSERT(hp);
@@ -696,6 +712,9 @@ acpi_hp_sysctl_get(struct acpi_hp_softc
case ACPI_HP_METHOD_CMI_DETAIL:
val = sc->cmi_detail;
break;
+ case ACPI_HP_METHOD_VERBOSE:
+ val = sc->verbose;
+ break;
}
return (val);
@@ -707,7 +726,8 @@ acpi_hp_sysctl_set(struct acpi_hp_softc
ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
ACPI_SERIAL_ASSERT(hp);
- if (method != ACPI_HP_METHOD_CMI_DETAIL)
+ if (method != ACPI_HP_METHOD_CMI_DETAIL &&
+ method != ACPI_HP_METHOD_VERBOSE)
arg = arg?1:0;
if (arg != oldarg) {
@@ -759,6 +779,9 @@ acpi_hp_sysctl_set(struct acpi_hp_softc
sc->cmi_order_size = -1;
}
break;
+ case ACPI_HP_METHOD_VERBOSE:
+ sc->verbose = arg;
+ break;
}
}
@@ -794,15 +817,15 @@ acpi_hp_notify(ACPI_HANDLE h, UINT32 not
static int
acpi_hp_exec_wmi_command(device_t wmi_dev, int command, int is_write, int val)
{
- UINT32 params[5] = { 0x55434553,
- is_write?2:1,
- command,
- is_write?4:0,
- val};
- UINT32* result;
- ACPI_OBJECT *obj;
- ACPI_BUFFER in = { sizeof(params), ¶ms };
- ACPI_BUFFER out = { ACPI_ALLOCATE_BUFFER, NULL };
+ UINT32 params[5] = { 0x55434553,
+ is_write?2:1,
+ command,
+ is_write?4:0,
+ val};
+ UINT32* result;
+ ACPI_OBJECT *obj;
+ ACPI_BUFFER in = { sizeof(params), ¶ms };
+ ACPI_BUFFER out = { ACPI_ALLOCATE_BUFFER, NULL };
int retval;
if (ACPI_FAILURE(ACPI_WMI_EVALUATE_CALL(wmi_dev, ACPI_HP_WMI_BIOS_GUID,
@@ -827,7 +850,8 @@ acpi_hp_exec_wmi_command(device_t wmi_de
static __inline char*
acpi_hp_get_string_from_object(ACPI_OBJECT* obj, char* dst, size_t size) {
- int length;
+ int length;
+
dst[0] = 0;
if (obj->Type == ACPI_TYPE_STRING) {
length = obj->String.Length+1;
@@ -847,33 +871,32 @@ acpi_hp_get_string_from_object(ACPI_OBJE
* The block returned is ACPI_TYPE_PACKAGE which should contain the following
* elements:
* Index Meaning
- * 0 Setting Name [string]
- * 1 Value (comma separated, asterisk marks the current value) [string]
- * 2 Path within the bios hierarchy [string]
- * 3 IsReadOnly [int]
- * 4 DisplayInUI [int]
- * 5 RequiresPhysicalPresence [int]
- * 6 Sequence for ordering within the bios settings (absolute) [int]
- * 7 Length of prerequisites array [int]
- * 8 Prerequisite1 [string]
- * 9 Prerequisite2 [string]
- * 10 Prerequisite3 [string]
- * 11 Current value (in case of enum) [string] / Array length [int]
- * 12 Enum length [int] / Array values
- * 13ff Enum value at index x [string]
+ * 0 Setting Name [string]
+ * 1 Value (comma separated, asterisk marks the current value) [string]
+ * 2 Path within the bios hierarchy [string]
+ * 3 IsReadOnly [int]
+ * 4 DisplayInUI [int]
+ * 5 RequiresPhysicalPresence [int]
+ * 6 Sequence for ordering within the bios settings (absolute) [int]
+ * 7 Length of prerequisites array [int]
+ * 8..8+[7] PrerequisiteN [string]
+ * 9+[7] Current value (in case of enum) [string] / Array length [int]
+ * 10+[7] Enum length [int] / Array values
+ * 11+[7]ff Enum value at index x [string]
*/
static int
acpi_hp_get_cmi_block(device_t wmi_dev, const char* guid, UINT8 instance,
char* outbuf, size_t outsize, UINT32* sequence, int detail)
{
- ACPI_OBJECT *obj;
- ACPI_BUFFER out = { ACPI_ALLOCATE_BUFFER, NULL };
- int i;
- int outlen;
- int size = 255;
- int has_enums = 0;
- char string_buffer[size];
- int enumbase;
+ ACPI_OBJECT *obj;
+ ACPI_BUFFER out = { ACPI_ALLOCATE_BUFFER, NULL };
+ int i;
+ int outlen;
+ int size = 255;
+ int has_enums = 0;
+ int valuebase = 0;
+ char string_buffer[size];
+ int enumbase;
outlen = 0;
outbuf[0] = 0;
@@ -887,8 +910,13 @@ acpi_hp_get_cmi_block(device_t wmi_dev,
return (-EINVAL);
}
+ if (obj->Package.Count >= 8 &&
+ obj->Package.Elements[7].Type == ACPI_TYPE_INTEGER) {
+ valuebase = 8 + obj->Package.Elements[7].Integer.Value;
+ }
+
/* check if this matches our expectations based on limited knowledge */
- if (obj->Package.Count >= 13 &&
+ if (valuebase > 7 && obj->Package.Count > valuebase + 1 &&
obj->Package.Elements[0].Type == ACPI_TYPE_STRING &&
obj->Package.Elements[1].Type == ACPI_TYPE_STRING &&
obj->Package.Elements[2].Type == ACPI_TYPE_STRING &&
@@ -896,20 +924,12 @@ acpi_hp_get_cmi_block(device_t wmi_dev,
obj->Package.Elements[4].Type == ACPI_TYPE_INTEGER &&
obj->Package.Elements[5].Type == ACPI_TYPE_INTEGER &&
obj->Package.Elements[6].Type == ACPI_TYPE_INTEGER &&
- obj->Package.Elements[7].Type == ACPI_TYPE_INTEGER &&
- obj->Package.Elements[8].Type == ACPI_TYPE_STRING &&
- obj->Package.Elements[9].Type == ACPI_TYPE_STRING &&
- obj->Package.Elements[10].Type == ACPI_TYPE_STRING &&
- ((obj->Package.Elements[11].Type == ACPI_TYPE_STRING &&
- obj->Package.Elements[12].Type == ACPI_TYPE_INTEGER &&
- obj->Package.Count >=
- 13+obj->Package.Elements[12].Integer.Value) ||
- (obj->Package.Elements[11].Type == ACPI_TYPE_INTEGER &&
- obj->Package.Count >=
- 12+obj->Package.Elements[11].Integer.Value))
- ) {
- enumbase = obj->Package.Elements[11].Type == ACPI_TYPE_STRING?
- 12:11;
+ obj->Package.Elements[valuebase].Type == ACPI_TYPE_STRING &&
+ obj->Package.Elements[valuebase+1].Type == ACPI_TYPE_INTEGER &&
+ obj->Package.Count > valuebase +
+ obj->Package.Elements[valuebase+1].Integer.Value
+ ) {
+ enumbase = valuebase + 1;
if (detail & ACPI_HP_CMI_DETAIL_PATHS) {
strlcat(outbuf, acpi_hp_get_string_from_object(
&obj->Package.Elements[2], string_buffer, size),
@@ -924,11 +944,10 @@ acpi_hp_get_cmi_block(device_t wmi_dev,
outlen += 43;
while (strlen(outbuf) < outlen)
strlcat(outbuf, " ", outsize);
- if (enumbase == 12)
- strlcat(outbuf, acpi_hp_get_string_from_object(
- &obj->Package.Elements[11],
- string_buffer, size),
- outsize);
+ strlcat(outbuf, acpi_hp_get_string_from_object(
+ &obj->Package.Elements[valuebase], string_buffer,
+ size),
+ outsize);
outlen += 21;
while (strlen(outbuf) < outlen)
strlcat(outbuf, " ", outsize);
@@ -936,7 +955,7 @@ acpi_hp_get_cmi_block(device_t wmi_dev,
if (outbuf[i] == '\\')
outbuf[i] = '/';
if (detail & ACPI_HP_CMI_DETAIL_ENUMS) {
- for (i = enumbase+1; i < enumbase + 1 +
+ for (i = enumbase + 1; i < enumbase + 1 +
obj->Package.Elements[enumbase].Integer.Value;
++i) {
acpi_hp_get_string_from_object(
@@ -980,8 +999,8 @@ acpi_hp_get_cmi_block(device_t wmi_dev,
*/
static __inline int acpi_hp_hex_to_int(const UINT8 *hexin, UINT8 *byteout)
{
- unsigned int hi;
- unsigned int lo;
+ unsigned int hi;
+ unsigned int lo;
hi = hexin[0];
lo = hexin[1];
@@ -1010,10 +1029,10 @@ static __inline int acpi_hp_hex_to_int(c
static void
acpi_hp_hex_decode(char* buffer)
{
- int i;
- int length = strlen(buffer);
- UINT8 *uin;
- UINT8 uout;
+ int i;
+ int length = strlen(buffer);
+ UINT8 *uin;
+ UINT8 uout;
if (((int)length/2)*2 == length || length < 10) return;
@@ -1044,8 +1063,8 @@ acpi_hp_hex_decode(char* buffer)
static int
acpi_hp_hpcmi_open(struct cdev* dev, int flags, int mode, struct thread *td)
{
- struct acpi_hp_softc *sc;
- int ret;
+ struct acpi_hp_softc *sc;
+ int ret;
if (dev == NULL || dev->si_drv1 == NULL)
return (EBADF);
@@ -1076,8 +1095,8 @@ acpi_hp_hpcmi_open(struct cdev* dev, int
static int
acpi_hp_hpcmi_close(struct cdev* dev, int flags, int mode, struct thread *td)
{
- struct acpi_hp_softc *sc;
- int ret;
+ struct acpi_hp_softc *sc;
+ int ret;
if (dev == NULL || dev->si_drv1 == NULL)
return (EBADF);
@@ -1106,13 +1125,13 @@ acpi_hp_hpcmi_close(struct cdev* dev, in
static int
acpi_hp_hpcmi_read(struct cdev *dev, struct uio *buf, int flag)
{
- struct acpi_hp_softc *sc;
- int pos, i, l, ret;
- UINT8 instance;
- UINT8 maxInstance;
- UINT32 sequence;
- int linesize = 1025;
- char line[linesize];
+ struct acpi_hp_softc *sc;
+ int pos, i, l, ret;
+ UINT8 instance;
+ UINT8 maxInstance;
+ UINT32 sequence;
+ int linesize = 1025;
+ char line[linesize];
if (dev == NULL || dev->si_drv1 == NULL)
return (EBADF);
From kib at FreeBSD.org Fri Jul 3 22:17:38 2009
From: kib at FreeBSD.org (Konstantin Belousov)
Date: Fri Jul 3 22:17:44 2009
Subject: svn commit: r195329 - head/sys/vm
Message-ID: <200907032217.n63MHbUI090027@svn.freebsd.org>
Author: kib
Date: Fri Jul 3 22:17:37 2009
New Revision: 195329
URL: http://svn.freebsd.org/changeset/base/195329
Log:
When forking a vm space that has wired map entries, do not forget to
charge the objects created by vm_fault_copy_entry. The object charge
was set, but reserve not incremented.
Reported by: Greg Rivers
Reviewed by: alc (previous version)
Approved by: re (kensmith)
Modified:
head/sys/vm/vm_extern.h
head/sys/vm/vm_fault.c
head/sys/vm/vm_map.c
Modified: head/sys/vm/vm_extern.h
==============================================================================
--- head/sys/vm/vm_extern.h Fri Jul 3 21:51:44 2009 (r195328)
+++ head/sys/vm/vm_extern.h Fri Jul 3 22:17:37 2009 (r195329)
@@ -55,7 +55,8 @@ vm_map_t kmem_suballoc(vm_map_t, vm_offs
void swapout_procs(int);
int useracc(void *, int, int);
int vm_fault(vm_map_t, vm_offset_t, vm_prot_t, int);
-void vm_fault_copy_entry(vm_map_t, vm_map_t, vm_map_entry_t, vm_map_entry_t);
+void vm_fault_copy_entry(vm_map_t, vm_map_t, vm_map_entry_t, vm_map_entry_t,
+ vm_ooffset_t *);
void vm_fault_unwire(vm_map_t, vm_offset_t, vm_offset_t, boolean_t);
int vm_fault_wire(vm_map_t, vm_offset_t, vm_offset_t, boolean_t, boolean_t);
int vm_forkproc(struct thread *, struct proc *, struct thread *, struct vmspace *, int);
Modified: head/sys/vm/vm_fault.c
==============================================================================
--- head/sys/vm/vm_fault.c Fri Jul 3 21:51:44 2009 (r195328)
+++ head/sys/vm/vm_fault.c Fri Jul 3 22:17:37 2009 (r195329)
@@ -1126,11 +1126,9 @@ vm_fault_unwire(vm_map_t map, vm_offset_
* entry corresponding to a main map entry that is wired down).
*/
void
-vm_fault_copy_entry(dst_map, src_map, dst_entry, src_entry)
- vm_map_t dst_map;
- vm_map_t src_map;
- vm_map_entry_t dst_entry;
- vm_map_entry_t src_entry;
+vm_fault_copy_entry(vm_map_t dst_map, vm_map_t src_map,
+ vm_map_entry_t dst_entry, vm_map_entry_t src_entry,
+ vm_ooffset_t *fork_charge)
{
vm_object_t backing_object, dst_object, object;
vm_object_t src_object;
@@ -1161,13 +1159,16 @@ vm_fault_copy_entry(dst_map, src_map, ds
#endif
VM_OBJECT_LOCK(dst_object);
+ KASSERT(dst_entry->object.vm_object == NULL,
+ ("vm_fault_copy_entry: vm_object not NULL"));
dst_entry->object.vm_object = dst_object;
dst_entry->offset = 0;
- if (dst_entry->uip != NULL) {
- dst_object->uip = dst_entry->uip;
- dst_object->charge = dst_entry->end - dst_entry->start;
- dst_entry->uip = NULL;
- }
+ dst_object->uip = curthread->td_ucred->cr_ruidinfo;
+ uihold(dst_object->uip);
+ dst_object->charge = dst_entry->end - dst_entry->start;
+ KASSERT(dst_entry->uip == NULL,
+ ("vm_fault_copy_entry: leaked swp charge"));
+ *fork_charge += dst_object->charge;
prot = dst_entry->max_protection;
/*
Modified: head/sys/vm/vm_map.c
==============================================================================
--- head/sys/vm/vm_map.c Fri Jul 3 21:51:44 2009 (r195328)
+++ head/sys/vm/vm_map.c Fri Jul 3 22:17:37 2009 (r195329)
@@ -2909,7 +2909,8 @@ vm_map_copy_entry(
* Cause wired pages to be copied into the new map by
* simulating faults (the new pages are pageable)
*/
- vm_fault_copy_entry(dst_map, src_map, dst_entry, src_entry);
+ vm_fault_copy_entry(dst_map, src_map, dst_entry, src_entry,
+ fork_charge);
}
}
@@ -3073,6 +3074,7 @@ vmspace_fork(struct vmspace *vm1, vm_oof
MAP_ENTRY_IN_TRANSITION);
new_entry->wired_count = 0;
new_entry->object.vm_object = NULL;
+ new_entry->uip = NULL;
vm_map_entry_link(new_map, new_map->header.prev,
new_entry);
vmspace_map_entry_forked(vm1, vm2, new_entry);
From mav at FreeBSD.org Sat Jul 4 06:00:58 2009
From: mav at FreeBSD.org (Alexander Motin)
Date: Sat Jul 4 06:01:12 2009
Subject: svn commit: r195336 - in stable/7/sys: . contrib/pf netgraph
Message-ID: <200907040600.n6460vaU000179@svn.freebsd.org>
Author: mav
Date: Sat Jul 4 06:00:57 2009
New Revision: 195336
URL: http://svn.freebsd.org/changeset/base/195336
Log:
MFC rev.195335:
Fix infinite loop in ng_iface, that happens when packet passes out via
two different ng interfaces sequentially due to tunnelling.
PR: kern/134557
Submitted by: Mikolaj Golub
Modified:
stable/7/sys/ (props changed)
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/netgraph/ng_iface.c
Modified: stable/7/sys/netgraph/ng_iface.c
==============================================================================
--- stable/7/sys/netgraph/ng_iface.c Sat Jul 4 05:07:52 2009 (r195335)
+++ stable/7/sys/netgraph/ng_iface.c Sat Jul 4 06:00:57 2009 (r195336)
@@ -365,7 +365,8 @@ ng_iface_output(struct ifnet *ifp, struc
}
/* Protect from deadly infinite recursion. */
- while ((mtag = m_tag_locate(m, MTAG_NGIF, MTAG_NGIF_CALLED, NULL))) {
+ mtag = NULL;
+ while ((mtag = m_tag_locate(m, MTAG_NGIF, MTAG_NGIF_CALLED, mtag))) {
if (*(struct ifnet **)(mtag + 1) == ifp) {
log(LOG_NOTICE, "Loop detected on %s\n", ifp->if_xname);
m_freem(m);
From bms at incunabulum.net Sat Jul 4 09:45:25 2009
From: bms at incunabulum.net (Bruce Simpson)
Date: Sat Jul 4 09:45:31 2009
Subject: svn commit: r195295 - in head/sys: amd64/conf i386/conf
ia64/conf pc98/conf powerpc/conf sparc64/conf sun4v/conf
In-Reply-To: <200907021824.n62IObWJ051643@svn.freebsd.org>
References: <200907021824.n62IObWJ051643@svn.freebsd.org>
Message-ID: <4A4F24AF.3080900@incunabulum.net>
Ed Schouten wrote:
> Author: ed
> Date: Thu Jul 2 18:24:37 2009
> New Revision: 195295
> URL: http://svn.freebsd.org/changeset/base/195295
>
> Log:
> Enable POSIX semaphores on all non-embedded architectures by default.
>
> More applications (including Firefox) seem to depend on this nowadays,
> so not having this enabled by default is a bad idea.
>
Thank you. I didn't do this as normally we're pretty conservative about
this sort of change, but now they are fixed, it just plain makes sense.
I suspect Boost.Interprocess doesn't work on FreeBSD yet -- it needs
sem_t's shared between processes. Does anybody have work in progress for
this? We are in 8.0 freeze right now and it would be great to be able to
sort this out, IF someone has it up their sleeve. This was recently
bashed around on -STABLE.
cheers
BMS
From attilio at FreeBSD.org Sat Jul 4 11:11:22 2009
From: attilio at FreeBSD.org (Attilio Rao)
Date: Sat Jul 4 11:11:33 2009
Subject: svn commit: r195339 - head/usr.sbin/tzsetup
Message-ID: <200907041111.n64BBLH6011263@svn.freebsd.org>
Author: attilio
Date: Sat Jul 4 11:11:21 2009
New Revision: 195339
URL: http://svn.freebsd.org/changeset/base/195339
Log:
Add a new options (-s) that, when specified, skips the question about
adjusting the clock to UTC.
That avoids to write on /etc/wall_cmos_clock which is useful in some
cases (example: host user in a jail).
Sponsored by: Sandvine Incorporated
Initially submitted by: Matt Koivisto
Approved by: re (kib)
Modified:
head/usr.sbin/tzsetup/tzsetup.8
head/usr.sbin/tzsetup/tzsetup.c
Modified: head/usr.sbin/tzsetup/tzsetup.8
==============================================================================
--- head/usr.sbin/tzsetup/tzsetup.8 Sat Jul 4 10:15:01 2009 (r195338)
+++ head/usr.sbin/tzsetup/tzsetup.8 Sat Jul 4 11:11:21 2009 (r195339)
@@ -23,7 +23,7 @@
.\" SUCH DAMAGE.
.\"
.\" $FreeBSD$
-.Dd January 24, 1996
+.Dd July 4, 2009
.Dt TZSETUP 8
.Os
.Sh NAME
@@ -31,7 +31,7 @@
.Nd set local timezone
.Sh SYNOPSIS
.Nm
-.Op Fl n
+.Op Fl ns
.Op Ar default
.Sh DESCRIPTION
The
@@ -51,6 +51,9 @@ The following option is available:
.Bl -tag -offset indent -width Fl
.It Fl n
Do not create or copy files.
+.It Fl s
+Skip the initial question about adjusting the clock if not set to
+.Tn UTC .
.El
.Pp
It is possible to short-circuit the menu system by specifying a
Modified: head/usr.sbin/tzsetup/tzsetup.c
==============================================================================
--- head/usr.sbin/tzsetup/tzsetup.c Sat Jul 4 10:15:01 2009 (r195338)
+++ head/usr.sbin/tzsetup/tzsetup.c Sat Jul 4 11:11:21 2009 (r195339)
@@ -652,7 +652,7 @@ static void
usage(void)
{
- fprintf(stderr, "usage: tzsetup [-n]\n");
+ fprintf(stderr, "usage: tzsetup [-ns]\n");
exit(1);
}
@@ -666,14 +666,17 @@ int
main(int argc, char **argv)
{
char title[64], prompt[128];
- int c, fd;
+ int c, fd, skiputc;
- while ((c = getopt(argc, argv, "n")) != -1) {
+ skiputc = 0;
+ while ((c = getopt(argc, argv, "ns")) != -1) {
switch(c) {
case 'n':
reallydoit = 0;
break;
-
+ case 's':
+ skiputc = 1;
+ break;
default:
usage();
}
@@ -690,27 +693,30 @@ main(int argc, char **argv)
sort_countries();
make_menus();
- snprintf(title, sizeof(title),
- "Select local or UTC (Greenwich Mean Time) clock");
- snprintf(prompt, sizeof(prompt),
- "Is this machine's CMOS clock set to UTC? "
- "If it is set to local time,\n"
- "or you don't know, please choose NO here!");
init_dialog();
- if (!DIALOG_UTC(title, prompt, 7, 72)) {
- if (reallydoit)
- unlink(_PATH_WALL_CMOS_CLOCK);
- } else {
- if (reallydoit) {
- fd = open(_PATH_WALL_CMOS_CLOCK,
- O_WRONLY | O_CREAT | O_TRUNC,
- S_IRUSR | S_IRGRP | S_IROTH);
- if (fd < 0)
- err(1, "create %s", _PATH_WALL_CMOS_CLOCK);
- close(fd);
+ if (skiputc == 0) {
+ snprintf(title, sizeof(title),
+ "Select local or UTC (Greenwich Mean Time) clock");
+ snprintf(prompt, sizeof(prompt),
+ "Is this machine's CMOS clock set to UTC? "
+ "If it is set to local time,\n"
+ "or you don't know, please choose NO here!");
+ if (!DIALOG_UTC(title, prompt, 7, 72)) {
+ if (reallydoit)
+ unlink(_PATH_WALL_CMOS_CLOCK);
+ } else {
+ if (reallydoit) {
+ fd = open(_PATH_WALL_CMOS_CLOCK,
+ O_WRONLY | O_CREAT | O_TRUNC,
+ S_IRUSR | S_IRGRP | S_IROTH);
+ if (fd < 0)
+ err(1, "create %s",
+ _PATH_WALL_CMOS_CLOCK);
+ close(fd);
+ }
}
+ dialog_clear_norefresh();
}
- dialog_clear_norefresh();
if (optind == argc - 1) {
snprintf(title, sizeof(title), "Default timezone provided");
snprintf(prompt, sizeof(prompt),
From ed at FreeBSD.org Sat Jul 4 13:58:27 2009
From: ed at FreeBSD.org (Ed Schouten)
Date: Sat Jul 4 13:58:36 2009
Subject: svn commit: r195340 - in vendor/llvm/dist: . autoconf cmake docs
examples/BrainF examples/Fibonacci examples/HowToUseJIT
examples/Kaleidoscope examples/ModuleMaker
examples/ParallelJIT include/llvm...
Message-ID: <200907041358.n64DwQFg014366@svn.freebsd.org>
Author: ed
Date: Sat Jul 4 13:58:26 2009
New Revision: 195340
URL: http://svn.freebsd.org/changeset/base/195340
Log:
Import LLVM 74788.
Added:
vendor/llvm/dist/include/llvm/LLVMContext.h
vendor/llvm/dist/include/llvm/System/Errno.h
vendor/llvm/dist/include/llvm/Transforms/Utils/SSI.h
vendor/llvm/dist/lib/CompilerDriver/BuiltinOptions.cpp
vendor/llvm/dist/lib/CompilerDriver/Main.cpp
vendor/llvm/dist/lib/System/Errno.cpp
vendor/llvm/dist/lib/Target/ARM/Thumb1InstrInfo.cpp
vendor/llvm/dist/lib/Target/ARM/Thumb1InstrInfo.h
vendor/llvm/dist/lib/Target/ARM/Thumb1RegisterInfo.cpp
vendor/llvm/dist/lib/Target/ARM/Thumb1RegisterInfo.h
vendor/llvm/dist/lib/Target/ARM/Thumb2InstrInfo.cpp
vendor/llvm/dist/lib/Target/ARM/Thumb2InstrInfo.h
vendor/llvm/dist/lib/Target/ARM/Thumb2RegisterInfo.cpp
vendor/llvm/dist/lib/Target/ARM/Thumb2RegisterInfo.h
vendor/llvm/dist/lib/Transforms/Utils/SSI.cpp
vendor/llvm/dist/lib/VMCore/LLVMContext.cpp
vendor/llvm/dist/lib/VMCore/LLVMContextImpl.h
vendor/llvm/dist/test/Analysis/LoopDependenceAnalysis/
vendor/llvm/dist/test/Analysis/LoopDependenceAnalysis/dg.exp
vendor/llvm/dist/test/Analysis/LoopDependenceAnalysis/local-array.ll
vendor/llvm/dist/test/Analysis/LoopDependenceAnalysis/no-array.ll
vendor/llvm/dist/test/Analysis/LoopDependenceAnalysis/siv-strong1.ll
vendor/llvm/dist/test/Analysis/LoopDependenceAnalysis/siv-strong2.ll
vendor/llvm/dist/test/Analysis/LoopDependenceAnalysis/ziv1.ll
vendor/llvm/dist/test/Analysis/LoopDependenceAnalysis/ziv2.ll
vendor/llvm/dist/test/CodeGen/ARM/2009-06-30-RegScavengerAssert.ll
vendor/llvm/dist/test/CodeGen/ARM/2009-06-30-RegScavengerAssert2.ll
vendor/llvm/dist/test/CodeGen/ARM/2009-06-30-RegScavengerAssert3.ll
vendor/llvm/dist/test/CodeGen/ARM/2009-06-30-RegScavengerAssert4.ll
vendor/llvm/dist/test/CodeGen/ARM/2009-06-30-RegScavengerAssert5.ll
vendor/llvm/dist/test/CodeGen/ARM/2009-07-01-CommuteBug.ll
vendor/llvm/dist/test/CodeGen/PowerPC/available-externally.ll
vendor/llvm/dist/test/CodeGen/Thumb2/thumb2-cmn.ll
vendor/llvm/dist/test/CodeGen/Thumb2/thumb2-jumptbl.ll
vendor/llvm/dist/test/CodeGen/Thumb2/thumb2-ldr.ll
vendor/llvm/dist/test/CodeGen/Thumb2/thumb2-ldr_ext.ll
vendor/llvm/dist/test/CodeGen/Thumb2/thumb2-ldr_post.ll
vendor/llvm/dist/test/CodeGen/Thumb2/thumb2-ldr_pre.ll
vendor/llvm/dist/test/CodeGen/Thumb2/thumb2-ldrb.ll
vendor/llvm/dist/test/CodeGen/Thumb2/thumb2-ldrh.ll
vendor/llvm/dist/test/CodeGen/Thumb2/thumb2-sbc2.ll
vendor/llvm/dist/test/CodeGen/Thumb2/thumb2-str.ll
vendor/llvm/dist/test/CodeGen/Thumb2/thumb2-str_post.ll
vendor/llvm/dist/test/CodeGen/Thumb2/thumb2-str_pre.ll
vendor/llvm/dist/test/CodeGen/Thumb2/thumb2-strb.ll
vendor/llvm/dist/test/CodeGen/Thumb2/thumb2-strh.ll
vendor/llvm/dist/test/CodeGen/Thumb2/thumb2-sub.ll
vendor/llvm/dist/test/CodeGen/Thumb2/thumb2-sub2.ll
vendor/llvm/dist/test/CodeGen/Thumb2/thumb2-sub4.ll
vendor/llvm/dist/test/CodeGen/Thumb2/thumb2-sub5.ll
vendor/llvm/dist/test/CodeGen/Thumb2/thumb2-sxt_rot.ll
vendor/llvm/dist/test/CodeGen/Thumb2/thumb2-teq.ll
vendor/llvm/dist/test/CodeGen/Thumb2/thumb2-teq2.ll
vendor/llvm/dist/test/CodeGen/Thumb2/thumb2-tst.ll
vendor/llvm/dist/test/CodeGen/Thumb2/thumb2-tst2.ll
vendor/llvm/dist/test/CodeGen/Thumb2/thumb2-uxt_rot.ll
vendor/llvm/dist/test/CodeGen/Thumb2/thumb2-uxtb.ll
vendor/llvm/dist/test/CodeGen/Thumb2/tls1.ll
vendor/llvm/dist/test/CodeGen/Thumb2/tls2.ll
vendor/llvm/dist/test/CodeGen/X86/fast-isel-constpool.ll
vendor/llvm/dist/test/CodeGen/X86/fast-isel-gv.ll
vendor/llvm/dist/test/CodeGen/X86/inline-asm-fpstack3.ll
vendor/llvm/dist/test/CodeGen/X86/inline-asm-fpstack4.ll
vendor/llvm/dist/test/CodeGen/X86/inline-asm-fpstack5.ll
vendor/llvm/dist/test/Feature/mdnode2.ll
vendor/llvm/dist/test/Feature/mdnode3.ll
vendor/llvm/dist/test/FrontendC++/2009-06-30-ByrefBlock.cpp
vendor/llvm/dist/test/MC/AsmParser/directive_align.s
vendor/llvm/dist/test/MC/AsmParser/directive_symbol_attrs.s
vendor/llvm/dist/test/MC/AsmParser/exprs.s
vendor/llvm/dist/test/MC/AsmParser/x86_operands.s
vendor/llvm/dist/test/TableGen/ListArgs.td
vendor/llvm/dist/test/TableGen/ListArgsSimple.td
vendor/llvm/dist/test/Transforms/IndVarSimplify/loop_evaluate9.ll
vendor/llvm/dist/test/Transforms/InstCombine/2009-07-02-MaskedIntVector.ll
vendor/llvm/dist/test/Transforms/InstCombine/bitcast-scalar-to-vector.ll
vendor/llvm/dist/test/Transforms/LoopIndexSplit/non-iv-cmp-operand.ll
vendor/llvm/dist/test/Transforms/LoopSimplify/merge-exits.ll
vendor/llvm/dist/tools/llvm-mc/AsmExpr.cpp
vendor/llvm/dist/tools/llvm-mc/AsmExpr.h
vendor/llvm/dist/unittests/VMCore/PassManagerTest.cpp
vendor/llvm/dist/utils/crosstool/ARM/README
Deleted:
vendor/llvm/dist/lib/Target/ARM/ThumbInstrInfo.cpp
vendor/llvm/dist/lib/Target/ARM/ThumbInstrInfo.h
Modified:
vendor/llvm/dist/Makefile.config.in
vendor/llvm/dist/Makefile.rules
vendor/llvm/dist/autoconf/configure.ac
vendor/llvm/dist/cmake/config-ix.cmake
vendor/llvm/dist/configure
vendor/llvm/dist/docs/CodingStandards.html
vendor/llvm/dist/docs/CompilerDriver.html
vendor/llvm/dist/docs/FAQ.html
vendor/llvm/dist/docs/ReleaseNotes-2.6.html
vendor/llvm/dist/docs/TableGenFundamentals.html
vendor/llvm/dist/docs/WritingAnLLVMPass.html
vendor/llvm/dist/examples/BrainF/BrainF.cpp
vendor/llvm/dist/examples/BrainF/BrainF.h
vendor/llvm/dist/examples/BrainF/BrainFDriver.cpp
vendor/llvm/dist/examples/Fibonacci/fibonacci.cpp
vendor/llvm/dist/examples/HowToUseJIT/HowToUseJIT.cpp
vendor/llvm/dist/examples/Kaleidoscope/toy.cpp
vendor/llvm/dist/examples/ModuleMaker/ModuleMaker.cpp
vendor/llvm/dist/examples/ParallelJIT/ParallelJIT.cpp
vendor/llvm/dist/include/llvm-c/BitReader.h
vendor/llvm/dist/include/llvm-c/Core.h
vendor/llvm/dist/include/llvm-c/lto.h
vendor/llvm/dist/include/llvm/ADT/APInt.h
vendor/llvm/dist/include/llvm/ADT/FoldingSet.h
vendor/llvm/dist/include/llvm/ADT/PointerUnion.h
vendor/llvm/dist/include/llvm/ADT/Statistic.h
vendor/llvm/dist/include/llvm/ADT/Triple.h
vendor/llvm/dist/include/llvm/Analysis/DebugInfo.h
vendor/llvm/dist/include/llvm/Analysis/Dominators.h
vendor/llvm/dist/include/llvm/Analysis/IVUsers.h
vendor/llvm/dist/include/llvm/Analysis/LoopDependenceAnalysis.h
vendor/llvm/dist/include/llvm/Analysis/LoopInfo.h
vendor/llvm/dist/include/llvm/Analysis/ScalarEvolution.h
vendor/llvm/dist/include/llvm/Analysis/ScalarEvolutionExpander.h
vendor/llvm/dist/include/llvm/Analysis/ScalarEvolutionExpressions.h
vendor/llvm/dist/include/llvm/Assembly/Parser.h
vendor/llvm/dist/include/llvm/Bitcode/Archive.h
vendor/llvm/dist/include/llvm/Bitcode/BitstreamReader.h
vendor/llvm/dist/include/llvm/Bitcode/ReaderWriter.h
vendor/llvm/dist/include/llvm/CodeGen/AsmPrinter.h
vendor/llvm/dist/include/llvm/CodeGen/BinaryObject.h
vendor/llvm/dist/include/llvm/CodeGen/LiveIntervalAnalysis.h
vendor/llvm/dist/include/llvm/CodeGen/MachineFunction.h
vendor/llvm/dist/include/llvm/CodeGen/MachineInstrBuilder.h
vendor/llvm/dist/include/llvm/CodeGen/MachineLoopInfo.h
vendor/llvm/dist/include/llvm/CodeGen/MachineOperand.h
vendor/llvm/dist/include/llvm/CodeGen/RegisterScavenging.h
vendor/llvm/dist/include/llvm/CodeGen/SelectionDAG.h
vendor/llvm/dist/include/llvm/CodeGen/SelectionDAGNodes.h
vendor/llvm/dist/include/llvm/CodeGen/ValueTypes.h
vendor/llvm/dist/include/llvm/CodeGen/ValueTypes.td
vendor/llvm/dist/include/llvm/CompilerDriver/Main.inc
vendor/llvm/dist/include/llvm/Config/config.h.cmake
vendor/llvm/dist/include/llvm/Config/config.h.in
vendor/llvm/dist/include/llvm/Debugger/Debugger.h
vendor/llvm/dist/include/llvm/DerivedTypes.h
vendor/llvm/dist/include/llvm/Function.h
vendor/llvm/dist/include/llvm/Intrinsics.td
vendor/llvm/dist/include/llvm/LinkAllPasses.h
vendor/llvm/dist/include/llvm/LinkAllVMCore.h
vendor/llvm/dist/include/llvm/Linker.h
vendor/llvm/dist/include/llvm/MC/MCContext.h
vendor/llvm/dist/include/llvm/MC/MCInst.h
vendor/llvm/dist/include/llvm/MC/MCSection.h
vendor/llvm/dist/include/llvm/MC/MCStreamer.h
vendor/llvm/dist/include/llvm/MC/MCSymbol.h
vendor/llvm/dist/include/llvm/MC/MCValue.h
vendor/llvm/dist/include/llvm/Module.h
vendor/llvm/dist/include/llvm/Pass.h
vendor/llvm/dist/include/llvm/Support/SourceMgr.h
vendor/llvm/dist/include/llvm/Support/TypeBuilder.h
vendor/llvm/dist/include/llvm/Target/TargetCallingConv.td
vendor/llvm/dist/include/llvm/Target/TargetELFWriterInfo.h
vendor/llvm/dist/include/llvm/Target/TargetLowering.h
vendor/llvm/dist/include/llvm/Transforms/Scalar.h
vendor/llvm/dist/include/llvm/Transforms/Utils/Cloning.h
vendor/llvm/dist/include/llvm/Transforms/Utils/Local.h
vendor/llvm/dist/lib/Analysis/DebugInfo.cpp
vendor/llvm/dist/lib/Analysis/IPA/Andersens.cpp
vendor/llvm/dist/lib/Analysis/LoopDependenceAnalysis.cpp
vendor/llvm/dist/lib/Analysis/LoopInfo.cpp
vendor/llvm/dist/lib/Analysis/LoopPass.cpp
vendor/llvm/dist/lib/Analysis/ScalarEvolution.cpp
vendor/llvm/dist/lib/Analysis/ScalarEvolutionExpander.cpp
vendor/llvm/dist/lib/Analysis/ValueTracking.cpp
vendor/llvm/dist/lib/Archive/Archive.cpp
vendor/llvm/dist/lib/Archive/ArchiveInternals.h
vendor/llvm/dist/lib/Archive/ArchiveReader.cpp
vendor/llvm/dist/lib/Archive/ArchiveWriter.cpp
vendor/llvm/dist/lib/AsmParser/LLLexer.cpp
vendor/llvm/dist/lib/AsmParser/LLLexer.h
vendor/llvm/dist/lib/AsmParser/LLParser.cpp
vendor/llvm/dist/lib/AsmParser/LLParser.h
vendor/llvm/dist/lib/AsmParser/Parser.cpp
vendor/llvm/dist/lib/Bitcode/Reader/BitReader.cpp
vendor/llvm/dist/lib/Bitcode/Reader/BitcodeReader.cpp
vendor/llvm/dist/lib/Bitcode/Reader/BitcodeReader.h
vendor/llvm/dist/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
vendor/llvm/dist/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
vendor/llvm/dist/lib/CodeGen/AsmPrinter/DwarfDebug.h
vendor/llvm/dist/lib/CodeGen/CMakeLists.txt
vendor/llvm/dist/lib/CodeGen/ELF.h
vendor/llvm/dist/lib/CodeGen/ELFCodeEmitter.cpp
vendor/llvm/dist/lib/CodeGen/ELFCodeEmitter.h
vendor/llvm/dist/lib/CodeGen/ELFWriter.cpp
vendor/llvm/dist/lib/CodeGen/ELFWriter.h
vendor/llvm/dist/lib/CodeGen/LiveIntervalAnalysis.cpp
vendor/llvm/dist/lib/CodeGen/MachineFunction.cpp
vendor/llvm/dist/lib/CodeGen/MachineInstr.cpp
vendor/llvm/dist/lib/CodeGen/MachineLoopInfo.cpp
vendor/llvm/dist/lib/CodeGen/RegAllocLinearScan.cpp
vendor/llvm/dist/lib/CodeGen/RegisterScavenging.cpp
vendor/llvm/dist/lib/CodeGen/SelectionDAG/CMakeLists.txt
vendor/llvm/dist/lib/CodeGen/SelectionDAG/FastISel.cpp
vendor/llvm/dist/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
vendor/llvm/dist/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
vendor/llvm/dist/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodesEmit.cpp
vendor/llvm/dist/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
vendor/llvm/dist/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
vendor/llvm/dist/lib/CodeGen/SimpleRegisterCoalescing.cpp
vendor/llvm/dist/lib/CodeGen/TargetInstrInfoImpl.cpp
vendor/llvm/dist/lib/CodeGen/VirtRegRewriter.cpp
vendor/llvm/dist/lib/CompilerDriver/Action.cpp
vendor/llvm/dist/lib/CompilerDriver/CompilationGraph.cpp
vendor/llvm/dist/lib/CompilerDriver/Makefile
vendor/llvm/dist/lib/CompilerDriver/Tool.cpp
vendor/llvm/dist/lib/Debugger/Debugger.cpp
vendor/llvm/dist/lib/Debugger/ProgramInfo.cpp
vendor/llvm/dist/lib/ExecutionEngine/JIT/JIT.cpp
vendor/llvm/dist/lib/Linker/LinkArchives.cpp
vendor/llvm/dist/lib/Linker/LinkItems.cpp
vendor/llvm/dist/lib/Linker/Linker.cpp
vendor/llvm/dist/lib/MC/MCAsmStreamer.cpp
vendor/llvm/dist/lib/Makefile
vendor/llvm/dist/lib/Support/APInt.cpp
vendor/llvm/dist/lib/Support/Annotation.cpp
vendor/llvm/dist/lib/Support/SourceMgr.cpp
vendor/llvm/dist/lib/Support/SystemUtils.cpp
vendor/llvm/dist/lib/Support/Triple.cpp
vendor/llvm/dist/lib/System/CMakeLists.txt
vendor/llvm/dist/lib/System/ThreadLocal.cpp
vendor/llvm/dist/lib/System/Unix/Unix.h
vendor/llvm/dist/lib/System/Win32/ThreadLocal.inc
vendor/llvm/dist/lib/Target/ARM/ARM.h
vendor/llvm/dist/lib/Target/ARM/ARMAddressingModes.h
vendor/llvm/dist/lib/Target/ARM/ARMCodeEmitter.cpp
vendor/llvm/dist/lib/Target/ARM/ARMConstantIslandPass.cpp
vendor/llvm/dist/lib/Target/ARM/ARMISelDAGToDAG.cpp
vendor/llvm/dist/lib/Target/ARM/ARMISelLowering.cpp
vendor/llvm/dist/lib/Target/ARM/ARMISelLowering.h
vendor/llvm/dist/lib/Target/ARM/ARMInstrFormats.td
vendor/llvm/dist/lib/Target/ARM/ARMInstrInfo.cpp
vendor/llvm/dist/lib/Target/ARM/ARMInstrInfo.h
vendor/llvm/dist/lib/Target/ARM/ARMInstrInfo.td
vendor/llvm/dist/lib/Target/ARM/ARMInstrThumb.td
vendor/llvm/dist/lib/Target/ARM/ARMInstrThumb2.td
vendor/llvm/dist/lib/Target/ARM/ARMMachineFunctionInfo.h
vendor/llvm/dist/lib/Target/ARM/ARMRegisterInfo.cpp
vendor/llvm/dist/lib/Target/ARM/ARMRegisterInfo.h
vendor/llvm/dist/lib/Target/ARM/ARMSubtarget.h
vendor/llvm/dist/lib/Target/ARM/ARMTargetMachine.cpp
vendor/llvm/dist/lib/Target/ARM/ARMTargetMachine.h
vendor/llvm/dist/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
vendor/llvm/dist/lib/Target/ARM/CMakeLists.txt
vendor/llvm/dist/lib/Target/ARM/README.txt
vendor/llvm/dist/lib/Target/Alpha/Alpha.h
vendor/llvm/dist/lib/Target/Alpha/AlphaISelLowering.cpp
vendor/llvm/dist/lib/Target/Alpha/AlphaISelLowering.h
vendor/llvm/dist/lib/Target/Alpha/AlphaInstrInfo.cpp
vendor/llvm/dist/lib/Target/Alpha/AlphaTargetMachine.cpp
vendor/llvm/dist/lib/Target/Alpha/AlphaTargetMachine.h
vendor/llvm/dist/lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp
vendor/llvm/dist/lib/Target/Alpha/CMakeLists.txt
vendor/llvm/dist/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp
vendor/llvm/dist/lib/Target/CellSPU/CMakeLists.txt
vendor/llvm/dist/lib/Target/CellSPU/SPU.h
vendor/llvm/dist/lib/Target/CellSPU/SPUISelLowering.cpp
vendor/llvm/dist/lib/Target/CellSPU/SPUISelLowering.h
vendor/llvm/dist/lib/Target/CellSPU/SPUInstrInfo.cpp
vendor/llvm/dist/lib/Target/CellSPU/SPUTargetMachine.cpp
vendor/llvm/dist/lib/Target/CellSPU/SPUTargetMachine.h
vendor/llvm/dist/lib/Target/IA64/AsmPrinter/IA64AsmPrinter.cpp
vendor/llvm/dist/lib/Target/IA64/CMakeLists.txt
vendor/llvm/dist/lib/Target/IA64/IA64.h
vendor/llvm/dist/lib/Target/IA64/IA64ISelLowering.cpp
vendor/llvm/dist/lib/Target/IA64/IA64ISelLowering.h
vendor/llvm/dist/lib/Target/IA64/IA64TargetMachine.cpp
vendor/llvm/dist/lib/Target/IA64/IA64TargetMachine.h
vendor/llvm/dist/lib/Target/MSP430/MSP430.h
vendor/llvm/dist/lib/Target/MSP430/MSP430AsmPrinter.cpp
vendor/llvm/dist/lib/Target/MSP430/MSP430ISelLowering.cpp
vendor/llvm/dist/lib/Target/MSP430/MSP430ISelLowering.h
vendor/llvm/dist/lib/Target/MSP430/MSP430RegisterInfo.cpp
vendor/llvm/dist/lib/Target/MSP430/MSP430TargetMachine.cpp
vendor/llvm/dist/lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp
vendor/llvm/dist/lib/Target/Mips/CMakeLists.txt
vendor/llvm/dist/lib/Target/Mips/Mips.h
vendor/llvm/dist/lib/Target/Mips/MipsISelLowering.cpp
vendor/llvm/dist/lib/Target/Mips/MipsISelLowering.h
vendor/llvm/dist/lib/Target/Mips/MipsInstrInfo.cpp
vendor/llvm/dist/lib/Target/Mips/MipsTargetMachine.cpp
vendor/llvm/dist/lib/Target/Mips/MipsTargetMachine.h
vendor/llvm/dist/lib/Target/PIC16/PIC16.h
vendor/llvm/dist/lib/Target/PIC16/PIC16AsmPrinter.cpp
vendor/llvm/dist/lib/Target/PIC16/PIC16AsmPrinter.h
vendor/llvm/dist/lib/Target/PIC16/PIC16ISelLowering.cpp
vendor/llvm/dist/lib/Target/PIC16/PIC16ISelLowering.h
vendor/llvm/dist/lib/Target/PIC16/PIC16InstrInfo.td
vendor/llvm/dist/lib/Target/PIC16/PIC16TargetMachine.cpp
vendor/llvm/dist/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
vendor/llvm/dist/lib/Target/PowerPC/CMakeLists.txt
vendor/llvm/dist/lib/Target/PowerPC/PPC.h
vendor/llvm/dist/lib/Target/PowerPC/PPCCallingConv.td
vendor/llvm/dist/lib/Target/PowerPC/PPCCodeEmitter.cpp
vendor/llvm/dist/lib/Target/PowerPC/PPCFrameInfo.h
vendor/llvm/dist/lib/Target/PowerPC/PPCHazardRecognizers.cpp
vendor/llvm/dist/lib/Target/PowerPC/PPCISelLowering.cpp
vendor/llvm/dist/lib/Target/PowerPC/PPCISelLowering.h
vendor/llvm/dist/lib/Target/PowerPC/PPCInstr64Bit.td
vendor/llvm/dist/lib/Target/PowerPC/PPCInstrInfo.cpp
vendor/llvm/dist/lib/Target/PowerPC/PPCInstrInfo.td
vendor/llvm/dist/lib/Target/PowerPC/PPCJITInfo.cpp
vendor/llvm/dist/lib/Target/PowerPC/PPCRegisterInfo.cpp
vendor/llvm/dist/lib/Target/PowerPC/PPCRegisterInfo.h
vendor/llvm/dist/lib/Target/PowerPC/PPCRegisterInfo.td
vendor/llvm/dist/lib/Target/PowerPC/PPCSubtarget.h
vendor/llvm/dist/lib/Target/PowerPC/PPCTargetMachine.cpp
vendor/llvm/dist/lib/Target/PowerPC/PPCTargetMachine.h
vendor/llvm/dist/lib/Target/PowerPC/README.txt
vendor/llvm/dist/lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp
vendor/llvm/dist/lib/Target/Sparc/CMakeLists.txt
vendor/llvm/dist/lib/Target/Sparc/Sparc.h
vendor/llvm/dist/lib/Target/Sparc/SparcISelLowering.cpp
vendor/llvm/dist/lib/Target/Sparc/SparcISelLowering.h
vendor/llvm/dist/lib/Target/Sparc/SparcInstrInfo.cpp
vendor/llvm/dist/lib/Target/Sparc/SparcTargetMachine.cpp
vendor/llvm/dist/lib/Target/Sparc/SparcTargetMachine.h
vendor/llvm/dist/lib/Target/TargetELFWriterInfo.cpp
vendor/llvm/dist/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
vendor/llvm/dist/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h
vendor/llvm/dist/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp
vendor/llvm/dist/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp
vendor/llvm/dist/lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.h
vendor/llvm/dist/lib/Target/X86/CMakeLists.txt
vendor/llvm/dist/lib/Target/X86/X86.h
vendor/llvm/dist/lib/Target/X86/X86.td
vendor/llvm/dist/lib/Target/X86/X86ELFWriterInfo.cpp
vendor/llvm/dist/lib/Target/X86/X86ELFWriterInfo.h
vendor/llvm/dist/lib/Target/X86/X86FastISel.cpp
vendor/llvm/dist/lib/Target/X86/X86FloatingPoint.cpp
vendor/llvm/dist/lib/Target/X86/X86ISelLowering.cpp
vendor/llvm/dist/lib/Target/X86/X86ISelLowering.h
vendor/llvm/dist/lib/Target/X86/X86InstrBuilder.h
vendor/llvm/dist/lib/Target/X86/X86InstrInfo.cpp
vendor/llvm/dist/lib/Target/X86/X86InstrInfo.td
vendor/llvm/dist/lib/Target/X86/X86RegisterInfo.td
vendor/llvm/dist/lib/Target/X86/X86Subtarget.h
vendor/llvm/dist/lib/Target/X86/X86TargetMachine.cpp
vendor/llvm/dist/lib/Target/X86/X86TargetMachine.h
vendor/llvm/dist/lib/Target/XCore/XCore.h
vendor/llvm/dist/lib/Target/XCore/XCoreAsmPrinter.cpp
vendor/llvm/dist/lib/Target/XCore/XCoreISelLowering.cpp
vendor/llvm/dist/lib/Target/XCore/XCoreISelLowering.h
vendor/llvm/dist/lib/Target/XCore/XCoreTargetMachine.cpp
vendor/llvm/dist/lib/Transforms/IPO/GlobalOpt.cpp
vendor/llvm/dist/lib/Transforms/IPO/PartialInlining.cpp
vendor/llvm/dist/lib/Transforms/IPO/RaiseAllocations.cpp
vendor/llvm/dist/lib/Transforms/Scalar/CodeGenPrepare.cpp
vendor/llvm/dist/lib/Transforms/Scalar/GVN.cpp
vendor/llvm/dist/lib/Transforms/Scalar/IndVarSimplify.cpp
vendor/llvm/dist/lib/Transforms/Scalar/InstructionCombining.cpp
vendor/llvm/dist/lib/Transforms/Scalar/JumpThreading.cpp
vendor/llvm/dist/lib/Transforms/Scalar/LICM.cpp
vendor/llvm/dist/lib/Transforms/Scalar/LoopIndexSplit.cpp
vendor/llvm/dist/lib/Transforms/Scalar/LoopRotation.cpp
vendor/llvm/dist/lib/Transforms/Scalar/LoopStrengthReduce.cpp
vendor/llvm/dist/lib/Transforms/Scalar/LoopUnswitch.cpp
vendor/llvm/dist/lib/Transforms/Scalar/MemCpyOptimizer.cpp
vendor/llvm/dist/lib/Transforms/Scalar/Reassociate.cpp
vendor/llvm/dist/lib/Transforms/Scalar/Reg2Mem.cpp
vendor/llvm/dist/lib/Transforms/Scalar/SCCP.cpp
vendor/llvm/dist/lib/Transforms/Scalar/ScalarReplAggregates.cpp
vendor/llvm/dist/lib/Transforms/Scalar/SimplifyCFGPass.cpp
vendor/llvm/dist/lib/Transforms/Scalar/SimplifyLibCalls.cpp
vendor/llvm/dist/lib/Transforms/Scalar/TailDuplication.cpp
vendor/llvm/dist/lib/Transforms/Utils/CMakeLists.txt
vendor/llvm/dist/lib/Transforms/Utils/CloneModule.cpp
vendor/llvm/dist/lib/Transforms/Utils/LoopSimplify.cpp
vendor/llvm/dist/lib/Transforms/Utils/LowerAllocations.cpp
vendor/llvm/dist/lib/Transforms/Utils/SimplifyCFG.cpp
vendor/llvm/dist/lib/VMCore/AsmWriter.cpp
vendor/llvm/dist/lib/VMCore/CMakeLists.txt
vendor/llvm/dist/lib/VMCore/Core.cpp
vendor/llvm/dist/lib/VMCore/Function.cpp
vendor/llvm/dist/lib/VMCore/Module.cpp
vendor/llvm/dist/lib/VMCore/PassManager.cpp
vendor/llvm/dist/lib/VMCore/Type.cpp
vendor/llvm/dist/lib/VMCore/ValueTypes.cpp
vendor/llvm/dist/test/CodeGen/ARM/ldr.ll
vendor/llvm/dist/test/CodeGen/ARM/sxt_rot.ll
vendor/llvm/dist/test/CodeGen/Thumb2/load-global.ll
vendor/llvm/dist/test/CodeGen/Thumb2/thumb2-adc.ll
vendor/llvm/dist/test/CodeGen/Thumb2/thumb2-add2.ll
vendor/llvm/dist/test/CodeGen/Thumb2/thumb2-add5.ll
vendor/llvm/dist/test/CodeGen/Thumb2/thumb2-and.ll
vendor/llvm/dist/test/CodeGen/Thumb2/thumb2-bic.ll
vendor/llvm/dist/test/CodeGen/Thumb2/thumb2-cmp.ll
vendor/llvm/dist/test/CodeGen/Thumb2/thumb2-cmp2.ll
vendor/llvm/dist/test/CodeGen/Thumb2/thumb2-eor.ll
vendor/llvm/dist/test/CodeGen/Thumb2/thumb2-mvn2.ll
vendor/llvm/dist/test/CodeGen/Thumb2/thumb2-orn.ll
vendor/llvm/dist/test/CodeGen/Thumb2/thumb2-orr.ll
vendor/llvm/dist/test/CodeGen/Thumb2/thumb2-rsb.ll
vendor/llvm/dist/tools/Makefile
vendor/llvm/dist/tools/bugpoint/BugDriver.cpp
vendor/llvm/dist/tools/bugpoint/BugDriver.h
vendor/llvm/dist/tools/bugpoint/CrashDebugger.cpp
vendor/llvm/dist/tools/bugpoint/Miscompilation.cpp
vendor/llvm/dist/tools/bugpoint/OptimizerDriver.cpp
vendor/llvm/dist/tools/bugpoint/bugpoint.cpp
vendor/llvm/dist/tools/gold/gold-plugin.cpp
vendor/llvm/dist/tools/llc/llc.cpp
vendor/llvm/dist/tools/lli/lli.cpp
vendor/llvm/dist/tools/llvm-ar/llvm-ar.cpp
vendor/llvm/dist/tools/llvm-as/llvm-as.cpp
vendor/llvm/dist/tools/llvm-db/CLIDebugger.cpp
vendor/llvm/dist/tools/llvm-db/CLIDebugger.h
vendor/llvm/dist/tools/llvm-db/Commands.cpp
vendor/llvm/dist/tools/llvm-db/llvm-db.cpp
vendor/llvm/dist/tools/llvm-dis/llvm-dis.cpp
vendor/llvm/dist/tools/llvm-extract/llvm-extract.cpp
vendor/llvm/dist/tools/llvm-ld/llvm-ld.cpp
vendor/llvm/dist/tools/llvm-link/llvm-link.cpp
vendor/llvm/dist/tools/llvm-mc/AsmLexer.cpp
vendor/llvm/dist/tools/llvm-mc/AsmLexer.h
vendor/llvm/dist/tools/llvm-mc/AsmParser.cpp
vendor/llvm/dist/tools/llvm-mc/AsmParser.h
vendor/llvm/dist/tools/llvm-mc/CMakeLists.txt
vendor/llvm/dist/tools/llvm-mc/MC-X86Specific.cpp
vendor/llvm/dist/tools/llvm-mc/llvm-mc.cpp
vendor/llvm/dist/tools/llvm-nm/llvm-nm.cpp
vendor/llvm/dist/tools/llvm-prof/llvm-prof.cpp
vendor/llvm/dist/tools/llvm-ranlib/llvm-ranlib.cpp
vendor/llvm/dist/tools/llvmc/doc/LLVMC-Reference.rst
vendor/llvm/dist/tools/llvmc/example/mcc16/plugins/PIC16Base/PIC16Base.td
vendor/llvm/dist/tools/llvmc/example/mcc16/plugins/PIC16Base/PluginMain.cpp
vendor/llvm/dist/tools/lto/LTOCodeGenerator.cpp
vendor/llvm/dist/tools/lto/LTOCodeGenerator.h
vendor/llvm/dist/tools/lto/LTOModule.cpp
vendor/llvm/dist/tools/lto/LTOModule.h
vendor/llvm/dist/tools/lto/Makefile
vendor/llvm/dist/tools/lto/lto.cpp
vendor/llvm/dist/tools/opt/opt.cpp
vendor/llvm/dist/unittests/ADT/APIntTest.cpp
vendor/llvm/dist/unittests/ExecutionEngine/JIT/JITEventListenerTest.cpp
vendor/llvm/dist/unittests/MC/AsmStreamerTest.cpp
vendor/llvm/dist/unittests/VMCore/Makefile
vendor/llvm/dist/utils/NewNightlyTest.pl
vendor/llvm/dist/utils/TableGen/AsmWriterEmitter.cpp
vendor/llvm/dist/utils/TableGen/AsmWriterEmitter.h
vendor/llvm/dist/utils/TableGen/CallingConvEmitter.cpp
vendor/llvm/dist/utils/TableGen/CallingConvEmitter.h
vendor/llvm/dist/utils/TableGen/ClangDiagnosticsEmitter.cpp
vendor/llvm/dist/utils/TableGen/ClangDiagnosticsEmitter.h
vendor/llvm/dist/utils/TableGen/CodeEmitterGen.cpp
vendor/llvm/dist/utils/TableGen/CodeEmitterGen.h
vendor/llvm/dist/utils/TableGen/CodeGenDAGPatterns.cpp
vendor/llvm/dist/utils/TableGen/CodeGenDAGPatterns.h
vendor/llvm/dist/utils/TableGen/CodeGenTarget.cpp
vendor/llvm/dist/utils/TableGen/CodeGenTarget.h
vendor/llvm/dist/utils/TableGen/DAGISelEmitter.cpp
vendor/llvm/dist/utils/TableGen/DAGISelEmitter.h
vendor/llvm/dist/utils/TableGen/FastISelEmitter.cpp
vendor/llvm/dist/utils/TableGen/FastISelEmitter.h
vendor/llvm/dist/utils/TableGen/InstrEnumEmitter.cpp
vendor/llvm/dist/utils/TableGen/InstrEnumEmitter.h
vendor/llvm/dist/utils/TableGen/InstrInfoEmitter.cpp
vendor/llvm/dist/utils/TableGen/InstrInfoEmitter.h
vendor/llvm/dist/utils/TableGen/IntrinsicEmitter.cpp
vendor/llvm/dist/utils/TableGen/IntrinsicEmitter.h
vendor/llvm/dist/utils/TableGen/LLVMCConfigurationEmitter.cpp
vendor/llvm/dist/utils/TableGen/LLVMCConfigurationEmitter.h
vendor/llvm/dist/utils/TableGen/Record.cpp
vendor/llvm/dist/utils/TableGen/Record.h
vendor/llvm/dist/utils/TableGen/RegisterInfoEmitter.cpp
vendor/llvm/dist/utils/TableGen/RegisterInfoEmitter.h
vendor/llvm/dist/utils/TableGen/SubtargetEmitter.cpp
vendor/llvm/dist/utils/TableGen/SubtargetEmitter.h
vendor/llvm/dist/utils/TableGen/TGLexer.cpp
vendor/llvm/dist/utils/TableGen/TGParser.cpp
vendor/llvm/dist/utils/TableGen/TGValueTypes.cpp
vendor/llvm/dist/utils/TableGen/TableGen.cpp
vendor/llvm/dist/utils/TableGen/TableGenBackend.cpp
vendor/llvm/dist/utils/TableGen/TableGenBackend.h
Modified: vendor/llvm/dist/Makefile.config.in
==============================================================================
--- vendor/llvm/dist/Makefile.config.in Sat Jul 4 11:11:21 2009 (r195339)
+++ vendor/llvm/dist/Makefile.config.in Sat Jul 4 13:58:26 2009 (r195340)
@@ -223,7 +223,7 @@ RDYNAMIC := @RDYNAMIC@
#ENABLE_PROFILING = 1
@ENABLE_PROFILING@
-# When DISABLE_ASSERTIONS is enabled, builds of all of the LLVM code will
+# When DISABLE_ASSERTIONS is enabled, builds of all of the LLVM code will
# exclude assertion checks, otherwise they are included.
#DISABLE_ASSERTIONS = 1
@DISABLE_ASSERTIONS@
@@ -297,3 +297,14 @@ endif
# Location of the plugin header file for gold.
BINUTILS_INCDIR := @BINUTILS_INCDIR@
+
+# When ENABLE_LLVMC_DYNAMIC is enabled, LLVMC will link libCompilerDriver
+# dynamically. This is needed to make dynamic plugins work on some targets
+# (Windows).
+ENABLE_LLVMC_DYNAMIC = 0
+#@ENABLE_LLVMC_DYNAMIC@
+
+# When ENABLE_LLVMC_DYNAMIC_PLUGINS is enabled, LLVMC will have dynamic plugin
+# support (via the -load option).
+ENABLE_LLVMC_DYNAMIC_PLUGINS = 1
+#@ENABLE_LLVMC_DYNAMIC_PLUGINS@
Modified: vendor/llvm/dist/Makefile.rules
==============================================================================
--- vendor/llvm/dist/Makefile.rules Sat Jul 4 11:11:21 2009 (r195339)
+++ vendor/llvm/dist/Makefile.rules Sat Jul 4 13:58:26 2009 (r195340)
@@ -201,15 +201,19 @@ LIBRARYNAME := $(patsubst %,plugin_llvmc
CPP.Flags += -DLLVMC_PLUGIN_NAME=$(LLVMC_PLUGIN)
REQUIRES_EH := 1
+ifeq ($(ENABLE_LLVMC_DYNAMIC),1)
+ LD.Flags += -lCompilerDriver
+endif
+
# Build a dynamic library if the user runs `make` directly from the plugin
# directory.
ifndef LLVMC_BUILTIN_PLUGIN
-LOADABLE_MODULE = 1
+ LOADABLE_MODULE = 1
endif
# TableGen stuff...
ifneq ($(BUILT_SOURCES),)
-LLVMC_BUILD_AUTOGENERATED_INC=1
+ LLVMC_BUILD_AUTOGENERATED_INC=1
endif
endif # LLVMC_PLUGIN
@@ -217,10 +221,16 @@ endif # LLVMC_PLUGIN
ifdef LLVMC_BASED_DRIVER
TOOLNAME = $(LLVMC_BASED_DRIVER)
-LLVMLIBS = CompilerDriver.a
-LINK_COMPONENTS = support system
+
REQUIRES_EH := 1
+ifeq ($(ENABLE_LLVMC_DYNAMIC),1)
+ LD.Flags += -lCompilerDriver
+else
+ LLVMLIBS = CompilerDriver.a
+ LINK_COMPONENTS = support system
+endif
+
# Preprocessor magic that generates references to static variables in built-in
# plugins.
ifneq ($(LLVMC_BUILTIN_PLUGINS),)
@@ -502,8 +512,7 @@ ifeq ($(OS),Darwin)
else
ifeq ($(OS),Cygwin)
SharedLinkOptions=-shared -nostdlib -Wl,--export-all-symbols \
- -Wl,--enable-auto-import -Wl,--enable-auto-image-base \
- -Wl,--enable-runtime-pseudo-relocs
+ -Wl,--enable-auto-import -Wl,--enable-auto-image-base
else
SharedLinkOptions=-shared
endif
Modified: vendor/llvm/dist/autoconf/configure.ac
==============================================================================
--- vendor/llvm/dist/autoconf/configure.ac Sat Jul 4 11:11:21 2009 (r195339)
+++ vendor/llvm/dist/autoconf/configure.ac Sat Jul 4 13:58:26 2009 (r195340)
@@ -240,7 +240,7 @@ case "$llvm_cv_target_arch" in
x86_64) LLVM_NATIVE_ARCH="X86" ;;
*) LLVM_NATIVE_ARCH="$llvm_cv_target_arch" ;;
esac
-
+
dnl Define a substitution, ARCH, for the target architecture
AC_SUBST(ARCH,$llvm_cv_target_arch)
@@ -453,7 +453,7 @@ for a_target in $TARGETS_TO_BUILD; do
fi
done
-# Build the LLVM_TARGET and LLVM_ASM_PRINTER macro uses for
+# Build the LLVM_TARGET and LLVM_ASM_PRINTER macro uses for
# Targets.def and AsmPrinters.def.
LLVM_ENUM_TARGETS=""
LLVM_ENUM_ASM_PRINTERS=""
@@ -593,6 +593,35 @@ case "$enableval" in
*) AC_MSG_ERROR([Invalid setting for --enable-libffi. Use "yes" or "no"]) ;;
esac
+dnl Only Windows needs dynamic libCompilerDriver to support plugins.
+if test "$llvm_cv_os_type" = "Win32" ; then
+ llvmc_dynamic="yes"
+else
+ llvmc_dynamic="no"
+fi
+
+dnl --enable-llvmc-dynamic : should LLVMC link libCompilerDriver dynamically?
+AC_ARG_ENABLE(llvmc-dynamic,AS_HELP_STRING(
+--enable-llvmc-dynamic,
+[Link LLVMC dynamically (default is NO, unless on Win32)]),,
+enableval=$llvmc_dynamic)
+if test ${enableval} = "yes" && test "$ENABLE_PIC" -eq 1 ; then
+ AC_SUBST(ENABLE_LLVMC_DYNAMIC,[[ENABLE_LLVMC_DYNAMIC=1]])
+else
+ AC_SUBST(ENABLE_LLVMC_DYNAMIC,[[]])
+fi
+
+dnl --enable-llvmc-dynamic-plugins : should LLVMC support dynamic plugins?
+AC_ARG_ENABLE(llvmc-dynamic-plugins,AS_HELP_STRING(
+--enable-llvmc-dynamic-plugins,
+[Enable dynamic LLVMC plugins (default is YES)]),,
+enableval=yes)
+if test ${enableval} = "yes" ; then
+ AC_SUBST(ENABLE_LLVMC_DYNAMIC_PLUGINS,[[ENABLE_LLVMC_DYNAMIC_PLUGINS=1]])
+else
+ AC_SUBST(ENABLE_LLVMC_DYNAMIC_PLUGINS,[[]])
+fi
+
dnl===-----------------------------------------------------------------------===
dnl===
dnl=== SECTION 4: Check for programs we need and that they are the right version
@@ -914,7 +943,8 @@ AC_CHECK_FUNCS([backtrace ceilf floorf r
AC_CHECK_FUNCS([powf fmodf strtof round ])
AC_CHECK_FUNCS([getpagesize getrusage getrlimit setrlimit gettimeofday ])
AC_CHECK_FUNCS([isatty mkdtemp mkstemp ])
-AC_CHECK_FUNCS([mktemp realpath sbrk setrlimit strdup strerror strerror_r ])
+AC_CHECK_FUNCS([mktemp realpath sbrk setrlimit strdup ])
+AC_CHECK_FUNCS([strerror strerror_r strerror_s ])
AC_CHECK_FUNCS([strtoll strtoq sysconf malloc_zone_statistics ])
AC_CHECK_FUNCS([setjmp longjmp sigsetjmp siglongjmp])
AC_C_PRINTF_A
@@ -951,7 +981,7 @@ dnl atomic builtins are required for thr
AC_MSG_CHECKING(for GCC atomic builtins)
AC_LINK_IFELSE(
AC_LANG_SOURCE(
- [[int main() {
+ [[int main() {
volatile unsigned long val = 1;
__sync_synchronize();
__sync_val_compare_and_swap(&val, 1, 0);
Modified: vendor/llvm/dist/cmake/config-ix.cmake
==============================================================================
--- vendor/llvm/dist/cmake/config-ix.cmake Sat Jul 4 11:11:21 2009 (r195339)
+++ vendor/llvm/dist/cmake/config-ix.cmake Sat Jul 4 13:58:26 2009 (r195340)
@@ -44,6 +44,8 @@ check_include_file(windows.h HAVE_WINDOW
# library checks
include(CheckLibraryExists)
check_library_exists(pthread pthread_create "" HAVE_LIBPTHREAD)
+check_library_exists(pthread pthread_getspecific "" HAVE_PTHREAD_GETSPECIFIC)
+check_library_exists(pthread pthread_rwlock_init "" HAVE_PTHREAD_RWLOCK_INIT)
check_library_exists(dl dlopen "" HAVE_LIBDL)
# function checks
@@ -64,9 +66,10 @@ check_symbol_exists(mallinfo malloc.h HA
check_symbol_exists(malloc_zone_statistics malloc/malloc.h
HAVE_MALLOC_ZONE_STATISTICS)
check_symbol_exists(pthread_mutex_lock pthread.h HAVE_PTHREAD_MUTEX_LOCK)
-check_symbol_exists(pthread_rwlock_init pthread.h HAVE_PTHREAD_RWLOCK_INIT)
-check_symbol_exists(pthread_getspecific pthread.h HAVE_PTHREAD_GETSPECIFIC)
check_symbol_exists(strtoll stdlib.h HAVE_STRTOLL)
+check_symbol_exists(strerror string.h HAVE_STRERROR)
+check_symbol_exists(strerror_r string.h HAVE_STRERROR_R)
+check_symbol_exists(strerror_s string.h HAVE_STRERROR_S)
check_symbol_exists(__GLIBC__ stdio.h LLVM_USING_GLIBC)
if( LLVM_USING_GLIBC )
Modified: vendor/llvm/dist/configure
==============================================================================
--- vendor/llvm/dist/configure Sat Jul 4 11:11:21 2009 (r195339)
+++ vendor/llvm/dist/configure Sat Jul 4 13:58:26 2009 (r195340)
@@ -31356,9 +31356,119 @@ done
+for ac_func in mktemp realpath sbrk setrlimit strdup
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define $ac_func to an innocuous variant, in case declares $ac_func.
+ For example, HP-UX 11i declares gettimeofday. */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer to if __STDC__ is defined, since
+ exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include
+#else
+# include
+#endif
+
+#undef $ac_func
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined __stub_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
+int
+main ()
+{
+return $ac_func ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_var=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ eval "$as_ac_var=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval echo '${'$as_ac_var'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
-for ac_func in mktemp realpath sbrk setrlimit strdup strerror strerror_r
+for ac_func in strerror strerror_r strerror_s
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
{ echo "$as_me:$LINENO: checking for $ac_func" >&5
Modified: vendor/llvm/dist/docs/CodingStandards.html
==============================================================================
--- vendor/llvm/dist/docs/CodingStandards.html Sat Jul 4 11:11:21 2009 (r195339)
+++ vendor/llvm/dist/docs/CodingStandards.html Sat Jul 4 13:58:26 2009 (r195340)
@@ -50,6 +50,8 @@
Do not use 'using namespace std'
Provide a virtual method anchor for
classes in headers
+ Don't evaluate end() every time through a
+ loop
Prefer Preincrement
Avoid std::endl
@@ -661,6 +663,67 @@ increasing link times.
+
+
+
+
+
+
Because C++ doesn't have a standard "foreach" loop (though it can be emulated
+with macros and may be coming in C++'0x) we end up writing a lot of loops that
+manually iterate from begin to end on a variety of containers or through other
+data structures. One common mistake is to write a loop in this style:
+
+
+
+ BasicBlock *BB = ...
+ for (BasicBlock::iterator I = BB->begin(); I != BB->end(); ++I)
+ ... use I ...
+
+
+
+
The problem with this construct is that it evaluates "BB->end()"
+every time through the loop. Instead of writing the loop like this, we strongly
+prefer loops to be written so that they evaluate it once before the loop starts.
+A convenient way to do this is like so:
+
+
+
+ BasicBlock *BB = ...
+ for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ++I)
+ ... use I ...
+
+
+
+
The observant may quickly point out that these two loops may have different
+semantics: if the container (a basic block in this case) is being mutated, then
+"BB->end()" may change its value every time through the loop and the
+second loop may not in fact be correct. If you actually do depend on this
+behavior, please write the loop in the first form and add a comment indicating
+that you did it intentionally.
+
+
Why do we prefer the second form (when correct)? Writing the loop in the
+first form has two problems: First it may be less efficient than evaluating it
+at the start of the loop. In this case, the cost is probably minor: a few extra
+loads every time through the loop. However, if the base expression is more
+complex, then the cost can rise quickly. I've seen loops where the end
+expression was actually something like: "SomeMap[x]->end()" and map
+lookups really aren't cheap. By writing it in the second form consistently, you
+eliminate the issue entirely and don't even have to think about it.
+
+
The second (even bigger) issue is that writing the loop in the first form
+hints to the reader that the loop is mutating the container (a fact that a
+comment would handily confirm!). If you write the loop in the second form, it
+is immediately obvious without even looking at the body of the loop that the
+container isn't being modified, which makes it easier to read the code and
+understand what it does.
+
+
While the second form of the loop is a few extra keystrokes, we do strongly
+prefer it.
+
+
+
@@ -744,7 +807,7 @@ something.
Chris Lattner
LLVM Compiler Infrastructure
- Last modified: $Date: 2009-03-23 05:53:34 +0100 (Mon, 23 Mar 2009) $
+ Last modified: $Date: 2009-06-30 08:27:54 +0200 (Tue, 30 Jun 2009) $