Commit Graph

159757 Commits

Author SHA1 Message Date
David Schultz
e7780530fa 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).
2010-12-05 22:11:03 +00:00
Doug Barton
1c40e1f66c Bring in the change from NetBSD 1.12:
"document default format."

Obtained from:	yamt@NetBSD.org
2010-12-05 22:01:01 +00:00
Jilles Tjoelker
ff304d3732 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.
2010-12-05 21:53:29 +00:00
Doug Barton
da78facc72 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)
2010-12-05 21:53:12 +00:00
Doug Barton
d7233fd615 Fix an "unused variable" error that gets us all the way to WARNS=6 2010-12-05 21:33:05 +00:00
Doug Barton
9b3f439482 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
2010-12-05 21:29:20 +00:00
Doug Barton
d29003e79e 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
2010-12-05 21:17:02 +00:00
Doug Barton
b9f9338ea8 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
2010-12-05 21:11:45 +00:00
Doug Barton
578800b575 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
2010-12-05 20:47:53 +00:00
Jilles Tjoelker
5af61b5251 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.
2010-12-05 16:09:03 +00:00
Ed Schouten
9d67d2214f 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
2010-12-05 10:15:23 +00:00
Doug Barton
5c06c8a134 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.
2010-12-05 09:35:07 +00:00
Doug Barton
ccdbe8ce16 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
2010-12-05 09:33:04 +00:00
Bernhard Schmidt
2d5c617a52 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
2010-12-05 09:00:32 +00:00
Colin Percival
716d203d6b 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
2010-12-05 03:20:55 +00:00
Nathan Whitehorn
3b237732a5 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.
2010-12-05 01:17:53 +00:00
Bjoern A. Zeeb
08291968f2 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
2010-12-05 01:09:48 +00:00
Colin Percival
a39dc31fca Remove gratuitous i386/amd64 inconsistency in favour of the less verbose
version of declaring a variable initialized to zero.
2010-12-04 23:36:40 +00:00
Colin Percival
5c5590862f Remove unnecessary #includes which seem to have been accidentally added
as part of CVS r1.76 (in January 2006).
2010-12-04 23:24:35 +00:00
Ulrich Spörlein
a98447723d 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.
2010-12-04 21:54:23 +00:00
Michael Tuexen
d9c5cfea61 Fix a bug where also the number of non-renegable gap reports
was considered to be potentially renegable.

MFC after: 1 day.
2010-12-04 19:29:49 +00:00
Doug Barton
f028d7f4c7 Add MAKEDEV.8
Submitted by:	Alex Kozlov <spam@rm-rf.kiev.ua>
2010-12-04 18:52:05 +00:00
Edward Tomasz Napierala
a2f510e8ec Fix comment intentation. 2010-12-04 17:41:58 +00:00
Ulrich Spörlein
f42640a362 traceroute6(8): make WARNS=3 clean 2010-12-04 14:19:35 +00:00
Ulrich Spörlein
f02cd756de traceroute(8): make WARNS=3 clean
Also fixes an operator precedence bug for TCP tracerouting
2010-12-04 14:19:27 +00:00
Ulrich Spörlein
d180d7efa2 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
2010-12-04 11:40:40 +00:00
Ulrich Spörlein
cded07a878 Move most of the remaining USD/PSD/SMM papers into share/doc 2010-12-04 10:11:20 +00:00
Jaakko Heinonen
cdfaa45d48 Remove stale link.
PR:		151252
2010-12-04 08:44:56 +00:00
Jack F Vogel
1ce42f7249 Correct build error. 2010-12-04 06:38:21 +00:00
Doug Barton
c3c441cd46 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.
2010-12-04 05:58:56 +00:00
Nathan Whitehorn
bef5da7f98 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.
2010-12-04 02:42:52 +00:00
Jack F Vogel
aa8dea58c6 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
2010-12-04 02:04:02 +00:00
Jack F Vogel
9d43b64dbf 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
2010-12-04 01:59:58 +00:00
Jack F Vogel
43fcb978a7 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
2010-12-04 01:43:38 +00:00
Doug Barton
f805c4c116 Vendor import of BIND 9.6-ESV-R3 2010-12-04 00:42:21 +00:00
Jilles Tjoelker
25f6b31fac 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.
2010-12-03 23:24:27 +00:00
Simon L. B. Nielsen
c1ecc6cd22 Regenerate manual pages for OpenSSL 0.9.8q. 2010-12-03 23:07:45 +00:00
Simon L. B. Nielsen
72b8021a0a Merge OpenSSL 0.9.8q into head.
Security:	CVE-2010-4180
Security:	http://www.openssl.org/news/secadv_20101202.txt
MFC after:	3 days
2010-12-03 22:59:54 +00:00
Jung-uk Kim
2f7ab7e85d Revert r216161. It is not necessary because we zero-fill BSS anyway.
Requested by:	jhb
2010-12-03 22:27:51 +00:00
Jung-uk Kim
b14fe63392 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
2010-12-03 21:54:10 +00:00
Jung-uk Kim
e391a266ed 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
2010-12-03 21:06:30 +00:00
Konstantin Belousov
9f4ba450f2 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
2010-12-03 20:39:06 +00:00
Jayachandran C.
63ae6e6018 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)
2010-12-03 19:22:18 +00:00
Rebecca Cran
01688065e7 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).
2010-12-03 18:30:55 +00:00
Nathan Whitehorn
e2326639c2 Provide a simple IOMMU framework on PowerPC, which is required to support
PPC hypervisors.
2010-12-03 16:37:37 +00:00
Konstantin Belousov
b010326013 Extend the unix gc regression test to cover the case of r216150.
Requested and reviewed by:	rwatson
MFC after:	1 week
2010-12-03 16:17:53 +00:00
Konstantin Belousov
0cb64678bc Reviewed by: jeff, rwatson
MFC after:	1 week
2010-12-03 16:15:44 +00:00
Konstantin Belousov
4ac7bee807 Add SLIST_SWAP() macro.
MFC after:	1 week
2010-12-03 16:07:50 +00:00
Jayachandran C.
42b73858e9 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.
2010-12-03 14:20:20 +00:00
Xin LI
62ad217a9b * Recommend a overwrite of whole geli provider before use.
* Correct a typo while I'm there.

Reviewed by:	pjd
MFC after:	2 weeks
2010-12-03 10:06:19 +00:00