]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
13 years agoAdd regression tests for logarithmic functions in the math library.
David Schultz [Sun, 5 Dec 2010 22:18:35 +0000 (22:18 +0000)]
Add regression tests for logarithmic functions in the math library.

13 years agoBring in the changes from NetBSD 1.13 that we did not already have, with
Doug Barton [Sun, 5 Dec 2010 22:16:51 +0000 (22:16 +0000)]
Bring in the changes from NetBSD 1.13 that we did not already have, with
some differences.

"Sort options. Use more mdoc macros. Some nit fixes. Bump date."

Obtained from: wiz@NetBSD.org

13 years agoBump __FreeBSD_version for the addition of log2(). This is mainly for the
David Schultz [Sun, 5 Dec 2010 22:12:07 +0000 (22:12 +0000)]
Bump __FreeBSD_version for the addition of log2().  This is mainly for the
benefit of ports such as opencity and inkscape that have workarounds for
the lack of a log2() in the base system.

13 years agoAdd log2() and log2f().
David Schultz [Sun, 5 Dec 2010 22:11:22 +0000 (22:11 +0000)]
Add log2() and log2f().

13 years agoAdd a "kernel" log function, based on e_log.c, which is useful for
David Schultz [Sun, 5 Dec 2010 22:11:03 +0000 (22:11 +0000)]
Add a "kernel" log function, based on e_log.c, which is useful for
implementing accurate logarithms in different bases.  This is based
on an approach bde coded up years ago.

This function should always be inlined; it will be used in only a few
places, and rudimentary tests show a 40% performance improvement in
implementations of log2() and log10() on amd64.

The kernel takes a reduced argument x and returns the same polynomial
approximation as e_log.c, but omitting the low-order term. The low-order
term is much larger than the rest of the approximation, so the caller of
the kernel function can scale it to the appropriate base in extra precision
and obtain a much more accurate answer than by using log(x)/log(b).

13 years agoBring in the change from NetBSD 1.12:
Doug Barton [Sun, 5 Dec 2010 22:01:01 +0000 (22:01 +0000)]
Bring in the change from NetBSD 1.12:

"document default format."

Obtained from: yamt@NetBSD.org

13 years agosh: Avoid marking a job as done before it is fully created.
Jilles Tjoelker [Sun, 5 Dec 2010 21:53:29 +0000 (21:53 +0000)]
sh: Avoid marking a job as done before it is fully created.

In r208489, I added code to reap zombies when forking new processes, to
limit the amount of zombies. However, this can lead to marking a job as done
or stopped if it consists of multiple processes and the first process ends
very quickly. Fix this by only checking for zombies before forking the first
process of a job and not marking any jobs without processes as done or
stopped.

13 years agoBring in the following changes from NetBSD. See the discussion at:
Doug Barton [Sun, 5 Dec 2010 21:53:12 +0000 (21:53 +0000)]
Bring in the following changes from NetBSD. See the discussion at:
http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=44128

1.29
"Don't printf time_t with %d; fixes PR 44128 from yamt. With this change it
successfully prints mtimes after 2038."

1.30
"Improve previous with comments."

Obtained from: dholland@NetBSD.org (both)

13 years agoFix an "unused variable" error that gets us all the way to WARNS=6
Doug Barton [Sun, 5 Dec 2010 21:33:05 +0000 (21:33 +0000)]
Fix an "unused variable" error that gets us all the way to WARNS=6

13 years agoBring in the update from NetBSD 1.28:
Doug Barton [Sun, 5 Dec 2010 21:29:20 +0000 (21:29 +0000)]
Bring in the update from NetBSD 1.28:

"Fix WARNS=4 issues (-Wcast-qual -Wsign-compare)"

Because of code differences I had to hand-apply parts of the patch,
so responsibility for errors goes to me.

Obtained from: lukem@NetBSD.org

13 years agoBring in the update from NetBSD 1.19, the documentation of readlink -f
Doug Barton [Sun, 5 Dec 2010 21:17:02 +0000 (21:17 +0000)]
Bring in the update from NetBSD 1.19, the documentation of readlink -f

"PR/34662: martijnb at atlas dot ipv6 dot stack dot nl: readlink doesn't
grok -f, and there's no alternative (+fix)

Patch applied with minor tweak (%y -> %R, as it was already taken) plus
some nits from myself. Thanks!"

Obtained from: elad@NetBSD.org

13 years agoBring in a new feature, adding a -f option to readlink to print the path
Doug Barton [Sun, 5 Dec 2010 21:11:45 +0000 (21:11 +0000)]
Bring in a new feature, adding a -f option to readlink to print the path
of the target, similar to realpath(1). See the discussion at:
http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=34662

This brings in the following changes:
1.24
"PR/34662: martijnb at atlas dot ipv6 dot stack dot nl: readlink doesn't
grok -f, and there's no alternative (+fix)

Patch applied with minor tweak (%y -> %R, as it was already taken) plus
some nits from myself. Thanks!"

Obtained from: elad@NetBSD.org

1.25
"Fix a segfault when doing 'stat -f %R' on the stdin file handle, instead
fake the filename '(stdin)' like the %N format."

Obtained from: mlelstv@NetBSD.org

1.27
"The ofmt variable is actually a bit mask (not the character that was
in the format string) so that we can "or" it with the bits in the
formats variable.  This fixes the missing " -> " in front of the real
path (when you use %SR).

Also, the ?: needs another space."

Obtained from: atatat@NetBSD.org

I am purposely omitting the following changes:
1.23 A humanize_number(3) clone that should better be implemented by
actually using humanize_number(3)
1.26 This is the removal of license clause 3 and 4, already handled
by imp in r203971

13 years agoBring in the change from NetBSD 1.22:
Doug Barton [Sun, 5 Dec 2010 20:47:53 +0000 (20:47 +0000)]
Bring in the change from NetBSD 1.22:

"Fix a trivial truncation case, and eliminate a corner case that might
print a nul character."

I am purposely bypassing the following versions:
1.19 A build infrastructure change that does not apply to us
1.20 A feature I am not interested in, but don't object if someone else
wants to pick it up
1.21 A build infrastructure change that does not apply to us

Obtained from: atatat@NetBSD.org

13 years agosh: jobs -p: Do not ask the kernel for the pgid.
Jilles Tjoelker [Sun, 5 Dec 2010 16:09:03 +0000 (16:09 +0000)]
sh: jobs -p: Do not ask the kernel for the pgid.

The getpgid() call will fail if the first process in the job has already
terminated, resulting in output of "-1".

The pgid of a job is always the pid of the first process in the job and
other code already relies on this.

13 years agoUse proper bounds checking on VPA.
Ed Schouten [Sun, 5 Dec 2010 10:15:23 +0000 (10:15 +0000)]
Use proper bounds checking on VPA.

We must check against tp->t_cursor.tp_row, not row, to figure out
whether we must clamp the cursor position.

Submitted by: luigi
MFC after: 3 weeks

13 years agoAdd my own documentation for the change in our r216196, aka NetBSD's 1.18
Doug Barton [Sun, 5 Dec 2010 09:35:07 +0000 (09:35 +0000)]
Add my own documentation for the change in our r216196, aka NetBSD's 1.18
For -L if stat(2) fails, fall back to lstat(2).

.Dd purposely not bumped because more changes are coming.

13 years agoBring in the change from NetBSD 1.18:
Doug Barton [Sun, 5 Dec 2010 09:33:04 +0000 (09:33 +0000)]
Bring in the change from NetBSD 1.18:

"If using stat (the -L flag) and it fails, fall back to lstat().  It
may be the case that we're examining a broken symlink, and anything is
better than nothing."

The changes in 1.14 through 1.17 were not relevant to us.

Obtained from: atatat@NetBSD.org

13 years agoFor 6000 series and newer devices the DC calibration results are no
Bernhard Schmidt [Sun, 5 Dec 2010 09:00:32 +0000 (09:00 +0000)]
For 6000 series and newer devices the DC calibration results are no
longer requested of the boot firmware. Instead of sending those results
to the runtime firmware the firmware is told to do the DC calibration
itself.

MFC after: 1 week

13 years agoMFamd64 r204214: Enforce stronger alignment semantics (require that the
Colin Percival [Sun, 5 Dec 2010 03:20:55 +0000 (03:20 +0000)]
MFamd64 r204214: Enforce stronger alignment semantics (require that the
end of segments be aligned, not just the start of segments) in order to
allow Xen's blkfront driver to operate correctly.

PR: kern/152818
MFC after: 3 days

13 years agoSwitch which software-reserved bit is used to designate a locked PTE
Nathan Whitehorn [Sun, 5 Dec 2010 01:17:53 +0000 (01:17 +0000)]
Switch which software-reserved bit is used to designate a locked PTE
to correspond to the definition used by the PAPR spec so that its PTE
insertion algorithm will properly respect it.

13 years agoUse correct field to track statistics counting error as bad header length.
Bjoern A. Zeeb [Sun, 5 Dec 2010 01:09:48 +0000 (01:09 +0000)]
Use correct field to track statistics counting error as bad header length.
This assimilates the code to what ip_input has been doing since r1.1 in
this case.

Submitted by: Rozhuk Ivan (rozhuk.im gmail.com)
MFC after: 4 days

13 years agoRemove gratuitous i386/amd64 inconsistency in favour of the less verbose
Colin Percival [Sat, 4 Dec 2010 23:36:40 +0000 (23:36 +0000)]
Remove gratuitous i386/amd64 inconsistency in favour of the less verbose
version of declaring a variable initialized to zero.

13 years agoRemove unnecessary #includes which seem to have been accidentally added
Colin Percival [Sat, 4 Dec 2010 23:24:35 +0000 (23:24 +0000)]
Remove unnecessary #includes which seem to have been accidentally added
as part of CVS r1.76 (in January 2006).

13 years agoDe-orbit usbdevs(8) which hasn't worked with the new USB stack for a long
Ulrich Spörlein [Sat, 4 Dec 2010 21:54:23 +0000 (21:54 +0000)]
De-orbit usbdevs(8) which hasn't worked with the new USB stack for a long
time now. usbconfig(8) should be an adequate replacement.

13 years agoFix a bug where also the number of non-renegable gap reports
Michael Tuexen [Sat, 4 Dec 2010 19:29:49 +0000 (19:29 +0000)]
Fix a bug where also the number of non-renegable gap reports
was considered to be potentially renegable.

MFC after: 1 day.

13 years agoAdd MAKEDEV.8
Doug Barton [Sat, 4 Dec 2010 18:52:05 +0000 (18:52 +0000)]
Add MAKEDEV.8

Submitted by: Alex Kozlov <spam@rm-rf.kiev.ua>

13 years agoFix comment intentation.
Edward Tomasz Napierala [Sat, 4 Dec 2010 17:41:58 +0000 (17:41 +0000)]
Fix comment intentation.

13 years agotraceroute6(8): make WARNS=3 clean
Ulrich Spörlein [Sat, 4 Dec 2010 14:19:35 +0000 (14:19 +0000)]
traceroute6(8): make WARNS=3 clean

13 years agotraceroute(8): make WARNS=3 clean
Ulrich Spörlein [Sat, 4 Dec 2010 14:19:27 +0000 (14:19 +0000)]
traceroute(8): make WARNS=3 clean

Also fixes an operator precedence bug for TCP tracerouting

13 years agoDocument two more ways to find duplicates in the obsolete file list.
Ulrich Spörlein [Sat, 4 Dec 2010 11:40:40 +0000 (11:40 +0000)]
Document two more ways to find duplicates in the obsolete file list.

Remove the only duplicate found by the optional files check. Fix typos,
while here.

Suggested by: netchild

13 years agoMove most of the remaining USD/PSD/SMM papers into share/doc
Ulrich Spörlein [Sat, 4 Dec 2010 10:11:20 +0000 (10:11 +0000)]
Move most of the remaining USD/PSD/SMM papers into share/doc

13 years agoRemove stale link.
Jaakko Heinonen [Sat, 4 Dec 2010 08:44:56 +0000 (08:44 +0000)]
Remove stale link.

PR: 151252

13 years agoCorrect build error.
Jack F Vogel [Sat, 4 Dec 2010 06:38:21 +0000 (06:38 +0000)]
Correct build error.

13 years agoUpdate to version 9.6-ESV-R3, the latest from ISC, which addresses
Doug Barton [Sat, 4 Dec 2010 05:58:56 +0000 (05:58 +0000)]
Update to version 9.6-ESV-R3, the latest from ISC, which addresses
the following security vulnerabilities.

For more information regarding these issues please see:
http://www.isc.org/announcement/guidance-regarding-dec-1st-2010-security-advisories

1. Cache incorrectly allows ncache and rrsig for the same type

   http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2010-3613

   Affects resolver operators whose servers are open to potential
   attackers. Triggering the bug will cause the server to crash.

   This bug applies even if you do not have DNSSEC enabled.

2. Key algorithm rollover

   http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2010-3614

   Affects resolver operators who are validating with DNSSEC, and
   querying zones which are in a key rollover period. The bug will
   cause answers to incorrectly be marked as insecure.

13 years agoAdd an abstraction layer to the 64-bit AIM MMU's page table manipulation
Nathan Whitehorn [Sat, 4 Dec 2010 02:42:52 +0000 (02:42 +0000)]
Add an abstraction layer to the 64-bit AIM MMU's page table manipulation
logic to support modifying the page table through a hypervisor. This
uses KOBJ inheritance to provide subclasses of the base 64-bit AIM MMU
class with additional methods for page table manipulation.

Many thanks to Peter Grehan for suggesting this design and implementing
the MMU KOBJ inheritance mechanism.

13 years agoRemove the bogus test in the TX context setup for IPV6,
Jack F Vogel [Sat, 4 Dec 2010 02:04:02 +0000 (02:04 +0000)]
Remove the bogus test in the TX context setup for IPV6,
the size can be smaller than the constant when you are
doing HW TAGGING, and you still need to process this
packet in a normal way. I'm not sure where the notion
to just return came from, but its wrong.

MFC after: 3 days

13 years agoSmall cut and paste bug in flow control string fixed.
Jack F Vogel [Sat, 4 Dec 2010 01:59:58 +0000 (01:59 +0000)]
Small cut and paste bug in flow control string fixed.
Second, correct the discard/refresh_mbufs code to behave
more like igb, there have been panics due to discards and
this should fix them.

MFC after: 3 days

13 years agoThis small little change is a bug that drove me nuts
Jack F Vogel [Sat, 4 Dec 2010 01:43:38 +0000 (01:43 +0000)]
This small little change is a bug that drove me nuts
finding. The test to compare the mbuf m_len against
a fixed value and then returning needs to be removed.

When using VLANS and doing HW_TAGGING, and IPV6, the
ICMP6 packets actually fail this condition, the constant
assumes that the tag is IN the frame, and its not, so
the length is actually tiny. Furthermore, I'm not sure
what the point was to just return??

MFC after: 3 days

13 years agoVendor import of BIND 9.6-ESV-R3
Doug Barton [Sat, 4 Dec 2010 00:42:21 +0000 (00:42 +0000)]
Vendor import of BIND 9.6-ESV-R3

13 years agosh(1): Clean up documentation of built-in commands.
Jilles Tjoelker [Fri, 3 Dec 2010 23:24:27 +0000 (23:24 +0000)]
sh(1): Clean up documentation of built-in commands.

Make sure all built-in commands are in the subsection named such, except
exp, let and wordexp which are deliberately undocumented. The text said only
built-ins that really need to be a built-in were documented there but in
fact almost all of them were already documented.

13 years agoRegenerate manual pages for OpenSSL 0.9.8q.
Simon L. B. Nielsen [Fri, 3 Dec 2010 23:07:45 +0000 (23:07 +0000)]
Regenerate manual pages for OpenSSL 0.9.8q.

13 years agoMerge OpenSSL 0.9.8q into head.
Simon L. B. Nielsen [Fri, 3 Dec 2010 22:59:54 +0000 (22:59 +0000)]
Merge OpenSSL 0.9.8q into head.

Security: CVE-2010-4180
Security: http://www.openssl.org/news/secadv_20101202.txt
MFC after: 3 days

13 years agoRevert r216161. It is not necessary because we zero-fill BSS anyway.
Jung-uk Kim [Fri, 3 Dec 2010 22:27:51 +0000 (22:27 +0000)]
Revert r216161.  It is not necessary because we zero-fill BSS anyway.

Requested by: jhb

13 years agoExplicitly initialize TSC frequency. To calibrate TSC frequency, we use
Jung-uk Kim [Fri, 3 Dec 2010 21:54:10 +0000 (21:54 +0000)]
Explicitly initialize TSC frequency.  To calibrate TSC frequency, we use
DELAY(9) and it may use TSC in turn if TSC frequency is non-zero.

MFC after: 3 days

13 years agoDo not change CPU ticker frequency if TSC is P-state invariant. Note this
Jung-uk Kim [Fri, 3 Dec 2010 21:06:30 +0000 (21:06 +0000)]
Do not change CPU ticker frequency if TSC is P-state invariant.  Note this
change was meant to be committed with r184102 (and its subsequent MFCs) but
it fell off somehow.

Pointyhat to: jkim
MFC after: 3 days

13 years agoTrim whitespaces at the end of lines. Use the commit to record
Konstantin Belousov [Fri, 3 Dec 2010 20:39:06 +0000 (20:39 +0000)]
Trim whitespaces at the end of lines. Use the commit to record
proper log message for r216150.

MFC after: 1 week

If unix socket has a unix socket attached as the rights that has a
unix socket attached as the rights that has a unix socket attached as
the rights ... Kernel may overflow the stack on attempt to close such
socket.

Only close the rights file in the context of the current close if the
file is not unix domain socket. Otherwise, postpone the work to
taskqueue, preventing unlimited recursion.

The pass of the unix domain sockets over the SCM_RIGHTS message
control is not widely used, and more, the close of the socket with
still attached rights is mostly an application failure. The change
should not affect the performance of typical users of SCM_RIGHTS.

Reviewed by: jeff, rwatson

13 years ago1. Fix off by one errors in calls to MIPS_DIRECT_MAPPABLE, reported by alc@
Jayachandran C. [Fri, 3 Dec 2010 19:22:18 +0000 (19:22 +0000)]
1. Fix off by one errors in calls to MIPS_DIRECT_MAPPABLE, reported by alc@
2. Remove unnecessary #defines from vmparam.h

Submitted by: alc (2)
Reviewed by: alc (1)

13 years agoDocument the fact that passing in a count of zero to the bus_space functions
Rebecca Cran [Fri, 3 Dec 2010 18:30:55 +0000 (18:30 +0000)]
Document the fact that passing in a count of zero to the bus_space functions
will result in undefined behaviour.
Taken from NetBSD's bus_space(9).

13 years agoProvide a simple IOMMU framework on PowerPC, which is required to support
Nathan Whitehorn [Fri, 3 Dec 2010 16:37:37 +0000 (16:37 +0000)]
Provide a simple IOMMU framework on PowerPC, which is required to support
PPC hypervisors.

13 years agoExtend the unix gc regression test to cover the case of r216150.
Konstantin Belousov [Fri, 3 Dec 2010 16:17:53 +0000 (16:17 +0000)]
Extend the unix gc regression test to cover the case of r216150.

Requested and reviewed by: rwatson
MFC after: 1 week

13 years agoReviewed by: jeff, rwatson
Konstantin Belousov [Fri, 3 Dec 2010 16:15:44 +0000 (16:15 +0000)]
Reviewed by: jeff, rwatson
MFC after: 1 week

13 years agoAdd SLIST_SWAP() macro.
Konstantin Belousov [Fri, 3 Dec 2010 16:07:50 +0000 (16:07 +0000)]
Add SLIST_SWAP() macro.

MFC after: 1 week

13 years agoFixup for r216141, dump_add_page needs to be non-static now.
Jayachandran C. [Fri, 3 Dec 2010 14:20:20 +0000 (14:20 +0000)]
Fixup for r216141, dump_add_page needs to be non-static now.
Add it to sys/mips/include/md_var.h, make dump_drop_page non-static too
for completeness.

13 years ago * Recommend a overwrite of whole geli provider before use.
Xin LI [Fri, 3 Dec 2010 10:06:19 +0000 (10:06 +0000)]
 * Recommend a overwrite of whole geli provider before use.
 * Correct a typo while I'm there.

Reviewed by: pjd
MFC after: 2 weeks

13 years agoo Mount the device async when we're doing the copy.
Warner Losh [Fri, 3 Dec 2010 07:39:29 +0000 (07:39 +0000)]
o Mount the device async when we're doing the copy.
o Create a sparse file instead of a fully zerod one.  This trades the
  possibiltiy of running out of space during the build for the speed
  gain not having do write all those zeros...

Submitted by: n_hibma

13 years ago_WITHOUT_SRCCONF has too much baggage. Instead, use the simpler
Warner Losh [Fri, 3 Dec 2010 07:33:43 +0000 (07:33 +0000)]
_WITHOUT_SRCCONF has too much baggage.  Instead, use the simpler
SRCCONF=/dev/null.

13 years agoRevert r216134. This checkin broke platforms where bus_space are macros:
Rebecca Cran [Fri, 3 Dec 2010 07:09:23 +0000 (07:09 +0000)]
Revert r216134. This checkin broke platforms where bus_space are macros:
they need to be a single statement, and do { } while (0) doesn't work in this
situation so revert until a solution can be devised.

13 years agoExplain some of the reasons that fpsetprec() is unlikely to work as
David Schultz [Fri, 3 Dec 2010 07:01:07 +0000 (07:01 +0000)]
Explain some of the reasons that fpsetprec() is unlikely to work as
one might expect.  (These functions have already been deprecated for
many years.)

PR: 133583

13 years agoTo make minidumps work properly on mips for memory that's direct
Warner Losh [Fri, 3 Dec 2010 04:39:48 +0000 (04:39 +0000)]
To make minidumps work properly on mips for memory that's direct
mapped and entered via vm_page_setup, keep track of it like we do
for amd64.

# A separate commit will be made to move this to a capability-based ifdef
# rather than arch-based ifdef.

Submitted by: alc@
MFC after: 1 week

13 years agoAdd ability to decompress different format manual pages.
Gordon Tetlow [Fri, 3 Dec 2010 02:07:34 +0000 (02:07 +0000)]
Add ability to decompress different format manual pages.
Add support for .so directive in manual pages.

Approved by: mentor (wes@)

13 years agoAdd some basic regression tests for nearbyint().
David Schultz [Fri, 3 Dec 2010 00:44:31 +0000 (00:44 +0000)]
Add some basic regression tests for nearbyint().

13 years agoChanges the meaning of each characters '<' and '>' that it could be
Weongyo Jeong [Fri, 3 Dec 2010 00:44:07 +0000 (00:44 +0000)]
Changes the meaning of each characters '<' and '>' that it could be
confused with USB OUT or USB IN packets though it just represents USB
submit or done.  To know the USB packet direction, the endpoint address
should be referred.

Requested by: jkim

13 years agoDisable gcc's built-in rint() function when compiling s_nearbyint.c.
David Schultz [Fri, 3 Dec 2010 00:05:49 +0000 (00:05 +0000)]
Disable gcc's built-in rint() function when compiling s_nearbyint.c.
It results in incorrect optimizations that break nearbyint().

PR: 143358
Reviewed by: bde

13 years agoImport OpenSSL 0.9.8q.
Simon L. B. Nielsen [Thu, 2 Dec 2010 22:36:51 +0000 (22:36 +0000)]
Import OpenSSL 0.9.8q.

13 years agoDisallow passing in a count of zero bytes to the bus_space(9) functions.
Rebecca Cran [Thu, 2 Dec 2010 22:19:30 +0000 (22:19 +0000)]
Disallow passing in a count of zero bytes to the bus_space(9) functions.

Passing a count of zero on i386 and amd64 for [I386|AMD64]_BUS_SPACE_MEM
causes a crash/hang since the 'loop' instruction decrements the counter
before checking if it's zero.

PR: kern/80980
Discussed with: jhb

13 years agoAdd a note about the magic number 20. Actually, 22.75 entries fit in
Ivan Voras [Thu, 2 Dec 2010 19:47:27 +0000 (19:47 +0000)]
Add a note about the magic number 20. Actually, 22.75 entries fit in
a 512 byte sector but when choosing magic numbers, 20 looks nicer.

Discussed with: marcel

13 years agoDocument loader tunable hw.re.prefer_iomap.
Pyun YongHyeon [Thu, 2 Dec 2010 18:37:34 +0000 (18:37 +0000)]
Document loader tunable hw.re.prefer_iomap.

13 years agoDecode IPC_CREAT and IPC_EXCL for semget(2).
Xin LI [Thu, 2 Dec 2010 18:24:22 +0000 (18:24 +0000)]
Decode IPC_CREAT and IPC_EXCL for semget(2).

PR: bin/152781
Submitted by: Anton Yuzhaninov <citrin citrin ru>
MFC after: 2 weeks

13 years agoReplace pointer to "struct uidinfo" with pointer to "struct ucred"
Edward Tomasz Napierala [Thu, 2 Dec 2010 17:37:16 +0000 (17:37 +0000)]
Replace pointer to "struct uidinfo" with pointer to "struct ucred"
in "struct vm_object".  This is required to make it possible to account
for per-jail swap usage.

Reviewed by: kib@
Tested by: pho@
Sponsored by: FreeBSD Foundation

13 years agoUnbreak amd64<->i386 cross builds.
Nathan Whitehorn [Thu, 2 Dec 2010 17:36:47 +0000 (17:36 +0000)]
Unbreak amd64<->i386 cross builds.

13 years agoDefine bswap macros for constants to allow the compiler to pre-compute
Nathan Whitehorn [Thu, 2 Dec 2010 15:10:27 +0000 (15:10 +0000)]
Define bswap macros for constants to allow the compiler to pre-compute
byte-swapped versions of compile-time constants. This allows use of
bswap() and htole*() in initializers, which is required to cross-build
btxld.

Obtained from: sparc64

13 years agoRemove two unused variables, left over from the refactoring in r180104.
Gavin Atkinson [Thu, 2 Dec 2010 13:40:21 +0000 (13:40 +0000)]
Remove two unused variables, left over from the refactoring in r180104.

PR: bin/152551
Submitted by: Henning Petersen <henning.petersen t-online.de>
MFC after: 2 weeks

13 years agoFor non-stopped threads, td_frame pointer is undefined. As a
Konstantin Belousov [Thu, 2 Dec 2010 12:44:51 +0000 (12:44 +0000)]
For non-stopped threads, td_frame pointer is undefined.  As a
consequence, fill_regs() and fill_fpregs() access random data, usually
on the thread kernel stack. Most often the td_frame points to the
previous frame saved by last kernel entry sequence, but this is not
guaranteed.

For /proc/<pid>/{regs,fpregs} read access, require the thread to be in
stopped state. Otherwise, return EBUSY as is done for write case.

Reported and tested by: pho
Approved by: des (procfs maintainer)
MFC after: 1 week

13 years agoRemove more duplicates.
Ulrich Spörlein [Thu, 2 Dec 2010 10:46:05 +0000 (10:46 +0000)]
Remove more duplicates.

Just so that I can lookup the command for the next time:

for t in `make -V TARGETS universe`; do
  __MAKE_CONF=/dev/null make -f Makefile.inc1 -m $PWD/share/mk TARGET=$t \
  -V OLD_FILES -V OLD_LIBS -V OLD_DIRS delete-old | \
  xargs -n1|sort|uniq -c|egrep -v "^ *1 ";
done

13 years agoImport a clean-room implementation of the experimental H-TCP congestion control
Lawrence Stewart [Thu, 2 Dec 2010 06:40:21 +0000 (06:40 +0000)]
Import a clean-room implementation of the experimental H-TCP congestion control
algorithm based on the Internet-Draft "draft-leith-tcp-htcp-06.txt". It is
implemented as a kernel module compatible with the recently committed modular
congestion control framework.

H-TCP was designed to provide increased throughput in fast and long-distance
networks. It attempts to maintain fairness when competing with legacy NewReno
TCP in lower speed scenarios where NewReno is able to operate adequately. The
paper "H-TCP: A framework for congestion control in high-speed and long-distance
networks" provides additional detail.

In collaboration with: David Hayes <dahayes at swin edu au> and
Grenville Armitage <garmitage at swin edu au>
Sponsored by: FreeBSD Foundation
Reviewed by: rpaulo (older patch from a few weeks ago)
MFC after: 3 months

13 years agoImport a clean-room implementation of the experimental CUBIC congestion control
Lawrence Stewart [Thu, 2 Dec 2010 06:05:44 +0000 (06:05 +0000)]
Import a clean-room implementation of the experimental CUBIC congestion control
algorithm based on the Internet-Draft "draft-rhee-tcpm-cubic-02.txt". It is
implemented as a kernel module compatible with the recently committed modular
congestion control framework.

CUBIC was designed for provide increased throughput in fast and long-distance
networks. It attempts to maintain fairness when competing with legacy NewReno
TCP in lower speed scenarios where NewReno is able to operate adequately. The
paper "CUBIC: A New TCP-Friendly High-Speed TCP Variant" provides additional
detail.

In collaboration with: David Hayes <dahayes at swin edu au> and
Grenville Armitage <garmitage at swin edu au>
Sponsored by: FreeBSD Foundation
Reviewed by: rpaulo (older patch from a few weeks ago)
MFC after: 3 months

13 years agoThe driver-XXX.c files used for host CPU detection with -march=native
Nathan Whitehorn [Thu, 2 Dec 2010 04:58:07 +0000 (04:58 +0000)]
The driver-XXX.c files used for host CPU detection with -march=native
should not be compiled in the cross-tools case (where -march=native makes
no sense). This fixes cross-building x86 toolchains on non-x86 systems.

13 years agoremoved tag is '-', not '+'.
Warner Losh [Thu, 2 Dec 2010 04:28:01 +0000 (04:28 +0000)]
removed tag is '-', not '+'.
remove extra return.

13 years agoIf RX lockup workaround is enabled, fxp(4) will periodically reset
Pyun YongHyeon [Thu, 2 Dec 2010 03:53:29 +0000 (03:53 +0000)]
If RX lockup workaround is enabled, fxp(4) will periodically reset
the controller to workaround silicon bug of i82557. Each reset will
re-establish link which in turn triggers MII status change
callback. The callback will try to reconfigure controller if the
controller is not i82557 to enable flow-control. This caused
endless link UP/DOWN when the workaround was enabled on non-i82557
controller.

To fix the issue, apply RX lockup workaround only for i82557.
Previously it blindly checked undocumented EEPROM location such
that it sometimes enabled the workaround for other controllers. At
this time, only i82557 is known to have the silicon bug.
This fixes a regression introduced in r215906 which enabled flow
control support for all controllers except i82557.

Reported by: Karl Denninger (karl <> denninger dot net)
Tested by: Karl Denninger (karl <> denninger dot net)
MFC after: 3 days

13 years agoAdd build infrastructure for the forthcoming CC algorithm modules.
Lawrence Stewart [Thu, 2 Dec 2010 03:10:35 +0000 (03:10 +0000)]
Add build infrastructure for the forthcoming CC algorithm modules.

Sponsored by: FreeBSD Foundation
Submitted by: David Hayes <dahayes at swin edu au>
MFC after: 3 months

13 years agoGeneral cleanup of the NewReno CC module (no functional changes):
Lawrence Stewart [Thu, 2 Dec 2010 02:32:46 +0000 (02:32 +0000)]
General cleanup of the NewReno CC module (no functional changes):

- Remove superfluous includes and unhelpful comments.

- Alphabetically order functions.

- Make functions static.

Sponsored by: FreeBSD Foundation
MFC after: 9 weeks
X-MFC with: r215166

13 years agoDon't error out while searching for empty directories.
Kevin Lo [Thu, 2 Dec 2010 01:46:06 +0000 (01:46 +0000)]
Don't error out while searching for empty directories.

Submitted by: Bakul Shah <bakul at bitblocks dot com>

13 years ago- Reinstantiate the after_idle hook call in tcp_output(), which got lost
Lawrence Stewart [Thu, 2 Dec 2010 01:36:00 +0000 (01:36 +0000)]
- Reinstantiate the after_idle hook call in tcp_output(), which got lost
  somewhere along the way due to mismerging r211464 in our development tree.

- Capture the essence of r211464 in NewReno's after_idle() hook. We don't
  use V_ss_fltsz/V_ss_fltsz_local yet which needs to be revisited.

Sponsored by: FreeBSD Foundation
Submitted by: David Hayes <dahayes at swin edu au>
MFC after: 9 weeks
X-MFC with: r215166

13 years agoRemove useless NULL checks for M_WAITOK mallocs.
Edward Tomasz Napierala [Thu, 2 Dec 2010 01:14:45 +0000 (01:14 +0000)]
Remove useless NULL checks for M_WAITOK mallocs.

13 years agoSet ssthresh appropriately on RTO. This change was accidentally not ported from
Lawrence Stewart [Thu, 2 Dec 2010 01:01:37 +0000 (01:01 +0000)]
Set ssthresh appropriately on RTO. This change was accidentally not ported from
the pre modular CC stack.

Sponsored by: FreeBSD Foundation
Submitted by: David Hayes <dahayes at swin edu au>
MFC after: 9 weeks
X-MFC with: r215166

13 years agoPass NULL instead of 0 for the th pointer value. NULL != 0 on all platforms.
Lawrence Stewart [Thu, 2 Dec 2010 00:47:55 +0000 (00:47 +0000)]
Pass NULL instead of 0 for the th pointer value. NULL != 0 on all platforms.

Submitted by: David Hayes <dahayes at swin edu au>
MFC after: 9 weeks
X-MFC with: r215166

13 years agosh(1): Document that command's -p option also works with -v/-V.
Jilles Tjoelker [Wed, 1 Dec 2010 23:26:32 +0000 (23:26 +0000)]
sh(1): Document that command's -p option also works with -v/-V.

This was implemented in r201343.

13 years agoJournal start looks up .sujournal file by doing lookup on the root dvp.
Konstantin Belousov [Wed, 1 Dec 2010 21:19:11 +0000 (21:19 +0000)]
Journal start looks up .sujournal file by doing lookup on the root dvp.
As result, failed softdep_mount() might leave up to two vnodes on the
mp mountlist, preventing mnt_ref from going to zero.

Call ffs_flushfiles() after failed softdep_mount() to clean mountlist.

Initial report by: Garrett Cooper
Reproduced and tested by: pho

13 years ago- Report an error when a label with invalid name is attempted to be
Jaakko Heinonen [Wed, 1 Dec 2010 19:24:07 +0000 (19:24 +0000)]
- Report an error when a label with invalid name is attempted to be
  created with glabel(8).
- Fix a typo in an error message.
- Fix comment typos.

Approved by: pjd

13 years agoClosing file descriptors when it's done
Kevin Lo [Wed, 1 Dec 2010 08:07:32 +0000 (08:07 +0000)]
Closing file descriptors when it's done

13 years agophys_avail[] is correctly defined as an array of vm_paddr_t's in
Alan Cox [Wed, 1 Dec 2010 05:52:27 +0000 (05:52 +0000)]
phys_avail[] is correctly defined as an array of vm_paddr_t's in
machdep.c.  Use that same type, and not vm_offset_t, in this include file.

13 years agoAdd smp_all.c to the cam module build to un-break it.
Kenneth D. Merry [Wed, 1 Dec 2010 05:39:02 +0000 (05:39 +0000)]
Add smp_all.c to the cam module build to un-break it.

Reported by: jkim

13 years agoAdd interrupt describing and binding to CIU.
Juli Mallett [Wed, 1 Dec 2010 05:24:29 +0000 (05:24 +0000)]
Add interrupt describing and binding to CIU.

13 years agoExplicitly UP and DOWN the usbus interfaces (IFT_USB) when it's attached
Weongyo Jeong [Wed, 1 Dec 2010 03:51:06 +0000 (03:51 +0000)]
Explicitly UP and DOWN the usbus interfaces (IFT_USB) when it's attached
or detached.  Normally it should be changed through user land ioctl(2)
system calls but it looks there's no apps for USB and no need.

With this patch, libpcap would detect the usbus interfaces correctly and
tcpdump(1) could dump the USB packets into PCAP format with -w option.
However it couldn't print the output to console because there's no
printer-routine at tcpdump(1).

13 years agoCorrect an error in the allocation of the vm_page_dump array in
Alan Cox [Wed, 1 Dec 2010 03:35:19 +0000 (03:35 +0000)]
Correct an error in the allocation of the vm_page_dump array in
vm_page_startup().  Specifically, the dump_avail array should be used
instead of the phys_avail array to calculate the size of vm_page_dump.  For
example, the pages for the message buffer are allocated prior to
vm_page_startup() by subtracting them from the last entry in the phys_avail
array, but the first thing that vm_page_startup() does after creating the
vm_page_dump array is to set the bits corresponding to the message buffer
pages in that array.  However, these bits might not actually exist in the
array, because the size of the array is determined by the current value in
the last entry of the phys_avail array.  In general, the only reason why
this doesn't always result in an out-of-bounds array access is that the size
of the vm_page_dump array is rounded up to the next page boundary.  This
change eliminates that dependence on rounding (and luck).

MFC after: 6 weeks

13 years agoDon't print usbus[0-9] interfaces that it's not the interesting
Weongyo Jeong [Wed, 1 Dec 2010 03:24:38 +0000 (03:24 +0000)]
Don't print usbus[0-9] interfaces that it's not the interesting
interface type for ifconfig(8).

13 years agoAdd Serial Management Protocol (SMP) passthrough support to CAM.
Kenneth D. Merry [Tue, 30 Nov 2010 22:39:46 +0000 (22:39 +0000)]
Add Serial Management Protocol (SMP) passthrough support to CAM.

This includes support in the kernel, camcontrol(8), libcam and the mps(4)
driver for SMP passthrough.

The CAM SCSI probe code has been modified to fetch Inquiry VPD page 0x00
to determine supported pages, and will now fetch page 0x83 in addition to
page 0x80 if supported.

Add two new CAM CCBs, XPT_SMP_IO, and XPT_GDEV_ADVINFO.  The SMP CCB is
intended for SMP requests and responses.  The ADVINFO is currently used to
fetch cached VPD page 0x83 data from the transport layer, but is intended
to be extensible to fetch other types of device-specific data.

SMP-only devices are not currently represented in the CAM topology, and so
the current semantics are that the SIM will route SMP CCBs to either the
addressed device, if it contains an SMP target, or its parent, if it
contains an SMP target.  (This is noted in cam_ccb.h, since it will change
later once we have the ability to have SMP-only devices in CAM's topology.)

smp_all.c,
smp_all.h: New helper routines for SMP.  This includes
SMP request building routines, response parsing
routines, error decoding routines, and structure
definitions for a number of SMP commands.

libcam/Makefile: Add smp_all.c to libcam, so that SMP functionality
is available to userland applications.

camcontrol.8,
camcontrol.c: Add smp passthrough support to camcontrol.  Several
new subcommands are now available:

'smpcmd' functions much like 'cmd', except that it
allows the user to send generic SMP commands.

'smprg' sends the SMP report general command, and
displays the decoded output.  It will automatically
fetch extended output if it is available.

'smppc' sends the SMP phy control command, with any
number of potential options.  Among other things,
this allows the user to reset a phy on a SAS
expander, or disable a phy on an expander.

'smpmaninfo' sends the SMP report manufacturer
information and displays the decoded output.

'smpphylist' displays a list of phys on an
expander, and the CAM devices attached to those
phys, if any.

cam.h,
cam.c: Add a status value for SMP errors
(CAM_SMP_STATUS_ERROR).

Add a missing description for CAM_SCSI_IT_NEXUS_LOST.

Add support for SMP commands to cam_error_string().

cam_ccb.h: Rename the CAM_DIR_RESV flag to CAM_DIR_BOTH.  SMP
commands are by nature bi-directional, and we may
need to support bi-directional SCSI commands later.

Add the XPT_SMP_IO CCB.  Since SMP commands are
bi-directional, there are pointers for both the
request and response.

Add a fill routine for SMP CCBs.

Add the XPT_GDEV_ADVINFO CCB.  This is currently
used to fetch cached page 0x83 data from the
transport later, but is extensible to fetch many
other types of data.

cam_periph.c: Add support in cam_periph_mapmem() for XPT_SMP_IO
and XPT_GDEV_ADVINFO CCBs.

cam_xpt.c: Add support for executing XPT_SMP_IO CCBs.

cam_xpt_internal.h: Add fields for VPD pages 0x00 and 0x83 in struct
cam_ed.

scsi_all.c: Add scsi_get_sas_addr(), a function that parses
VPD page 0x83 data and pulls out a SAS address.

scsi_all.h: Add VPD page 0x00 and 0x83 structures, and a
prototype for scsi_get_sas_addr().

scsi_pass.c: Add support for mapping buffers in XPT_SMP_IO and
XPT_GDEV_ADVINFO CCBs.

scsi_xpt.c: In the SCSI probe code, first ask the device for
VPD page 0x00.  If any VPD pages are supported,
that page is required to be implemented.  Based on
the response, we may probe for the serial number
(page 0x80) or device id (page 0x83).

Add support for the XPT_GDEV_ADVINFO CCB.

sys/conf/files: Add smp_all.c.

mps.c: Add support for passing in a uio in mps_map_command(),
so we can map a S/G list at once.

Add support for SMP passthrough commands in
mps_data_cb().  SMP is a special case, because the
first buffer in the S/G list is outbound and the
second buffer is inbound.

Add support for warning the user if the busdma code
comes back with more buffers than will work for the
command.  This will, for example, help the user
determine why an SMP command failed if busdma comes
back with three buffers.

mps_pci.c: Add sys/uio.h.

mps_sas.c: Add the SAS address and the parent handle to the
list of fields we pull from device page 0 and cache
in struct mpssas_target.  These are needed for SMP
passthrough.

Add support for the XPT_SMP_IO CCB.  For now, this
CCB is routed to the addressed device if it supports
SMP, or to its parent if it does not and the parent
does.  This is necessary because CAM does not
currently support SMP-only nodes in the topology.

Make SMP passthrough support conditional on
__FreeBSD_version >= 900026.  This will make it
easier to MFC this change to the driver without
MFCing the CAM changes as well.

mps_user.c: Un-staticize mpi_init_sge() so we can use it for
the SMP passthrough code.

mpsvar.h: Add a uio and iovecs into struct mps_command for
SMP passthrough commands.

Add a cm_max_segs field to struct mps_command so
that we can warn the user if busdma comes back with
too many segments.

Clear the cm_reply when a command gets freed.  If
it is not cleared, reply frames will eventually get
freed into the pool multiple times and corrupt the
pool.  (This fix is from scottl.)

Add a prototype for mpi_init_sge().

sys/param.h: Bump __FreeBSD_version to 900026 for the for the
inclusion of the XPT_GDEV_ADVINFO and XPT_SMP_IO
CAM CCBs.

13 years agoUpdate the documentation to reflect changes to the implementation in
David Schultz [Tue, 30 Nov 2010 21:26:21 +0000 (21:26 +0000)]
Update the documentation to reflect changes to the implementation in
r197752, which is related to handling of null buffer pointers.  Also
make a few minor wording changes.

Reported by: jh@

13 years ago- Remove the remaining support for older (in this case pre-7.0-RELEASE)
Marius Strobl [Tue, 30 Nov 2010 21:08:59 +0000 (21:08 +0000)]
- Remove the remaining support for older (in this case pre-7.0-RELEASE)
  versions of FreeBSD. In fact we are already missing a lot of conditional
  code necessary to support older versions of FreeBSD, including alternatives
  for vital functionality not yet provided by the respective subsystem back
  then (see for example r199663). So this change shouldn't actually break
  this driver on versions of FreeBSD that were supported before. Besides,
  this driver also isn't maintained as an multi-release version outside of
  the main repository, so removing the conditional code shouldn't be a
  problem in that regard either.
- Sprinkle some more const on tables.

13 years agoDon't panic when we read an empty ACL from ZFS. Apparently this may happen
Edward Tomasz Napierala [Tue, 30 Nov 2010 21:04:05 +0000 (21:04 +0000)]
Don't panic when we read an empty ACL from ZFS.  Apparently this may happen
with filesystems created under MacOS X ZFS port.  This is kind of filesystem
corruption (we don't allow for setting empty ACLs), so make acl_get_file(3)
and related syscalls fail with EINVAL in that case.  In theory, we could
return empty ACL to userland, but I'm afraid this would break some code.

MFC after: 3 days