]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
16 years agoInline __ieee754__rem_pio2(). With gcc4-2, this gives an average
bde [Mon, 18 Feb 2008 14:02:12 +0000 (14:02 +0000)]
Inline __ieee754__rem_pio2().  With gcc4-2, this gives an average
optimization of about 10% for cos(x), sin(x) and tan(x) on
|x| < 2**19*pi/2.  We didn't do this before because __ieee754__rem_pio2()
is too large and complicated for gcc-3.3 to inline very well.  We don't
do this for float precision because it interferes with optimization
of the usual (?) case (|x| < 9pi/4) which is manually inlined for float
precision only.

This has some rough edges:
- some static data is duplicated unnecessarily.  There isn't much after
  the recent move of large tables to k_rem_pio2.c, and some static data
  is duplicated to good affect (all the data static const, so that the
  compiler can evaluate expressions like 2*pio2 at compile time and
  generate even more static data for the constant for this).
- extern inline is used (for the same reason as in previous inlining of
  k_cosf.c etc.), but C99 apparently doesn't allow extern inline
  functions with static data, and gcc will eventually warn about this.

Convert to __FBSDID().

Indent __ieee754_rem_pio2()'s declaration consistently (its style was
made inconsistent with fdlibm a while ago, so complete this).

Fix __ieee754_rem_pio2()'s return type to match its prototype.  Someone
changed too many ints to int32_t's when fixing the assumption that all
ints are int32_t's.

16 years agoAdd a work-around to make it possible again to remount
yar [Mon, 18 Feb 2008 10:24:47 +0000 (10:24 +0000)]
Add a work-around to make it possible again to remount
NFS root r/w.

The real solution would be to bring the whole nmount(2)
framework, including FS drivers and userland tools, into
a consistent state at last; but things should work in the
meantime, too.

Reported by: kris

16 years agoAdd a remark on a questionable property of vfs_mergeopts().
yar [Mon, 18 Feb 2008 10:10:42 +0000 (10:10 +0000)]
Add a remark on a questionable property of vfs_mergeopts().

16 years agoremove Vette Dinsdag. It was on the wrong day of the week, and not really a term...
edwin [Mon, 18 Feb 2008 07:09:17 +0000 (07:09 +0000)]
remove Vette Dinsdag. It was on the wrong day of the week, and not really a term I'm familiar with. Of course this can happen since naming of events and happenings during Carnaval are very localized

Approved by: grog@

16 years agogetopt(3) returns -1, not EOF.
kevlo [Mon, 18 Feb 2008 03:19:25 +0000 (03:19 +0000)]
getopt(3) returns -1, not EOF.

16 years agoSome basic regression tests for {sin,cos,tan}{,f,l}().
das [Mon, 18 Feb 2008 02:00:16 +0000 (02:00 +0000)]
Some basic regression tests for {sin,cos,tan}{,f,l}().

16 years agoMake the human readable numbers printed with the -h option a bit
mpp [Mon, 18 Feb 2008 01:36:40 +0000 (01:36 +0000)]
Make the human readable numbers printed with the -h option a bit
more human readable by telling the human print routines to use
a smaller buffer to format the value.

This makes it so a value that was previously being printed
as 600000K will now print as 586M.

16 years agoBack out rev. 1.74 because the kernel isn't ready yet
yar [Mon, 18 Feb 2008 00:23:28 +0000 (00:23 +0000)]
Back out rev. 1.74 because the kernel isn't ready yet
to see NFS specific string options.

16 years agoDon't forget to prepare string options for nmount(2).
yar [Mon, 18 Feb 2008 00:05:50 +0000 (00:05 +0000)]
Don't forget to prepare string options for nmount(2).
Otherwise things won't work as intended, e.g., it'll
be impossible to upgrade NFS root mount to read-write.

Reported by: kris

16 years agoThere are 3 tests here, not 2.
das [Sun, 17 Feb 2008 22:45:53 +0000 (22:45 +0000)]
There are 3 tests here, not 2.

16 years agoPrevent the NFS client from losing MNT_ROOTFS on the root
yar [Sun, 17 Feb 2008 22:32:08 +0000 (22:32 +0000)]
Prevent the NFS client from losing MNT_ROOTFS on the root
file system.  In particular, stop overwriting mount point
flags in nfs_mountdiskless() because now they are set
elsewhere.  (They were _initialized_ by that function in
the 4.4BSD days, when mount structures were not allocated
in a centralized manner -- see rev. 1.1 of this file.)

Fix nfs_mount(), which happened to depend on the loss of
MNT_ROOTFS when it came to update handling.

Also note that mountnfs() no longer handles updates.  Now
they shouldn't reach this function, so printf a diagnostic
message if that happens due to a coding error.

16 years agoUse volatile hacks to make sure exp() generates an underflow
das [Sun, 17 Feb 2008 21:53:19 +0000 (21:53 +0000)]
Use volatile hacks to make sure exp() generates an underflow
exception when it's supposed to. Previously, gcc -O2 was optimizing
away the statement that generated it.

16 years agoMove the $FreeBSD$ tag in a comment as __FBSDID doesn't work.
marcel [Sun, 17 Feb 2008 20:38:22 +0000 (20:38 +0000)]
Move the $FreeBSD$ tag in a comment as __FBSDID doesn't work.

16 years agoHook the U-Boot library up to the build.
marcel [Sun, 17 Feb 2008 20:34:35 +0000 (20:34 +0000)]
Hook the U-Boot library up to the build.

16 years agoCorrect the description of getmnt_silent: unknown options are silently
yar [Sun, 17 Feb 2008 20:25:25 +0000 (20:25 +0000)]
Correct the description of getmnt_silent: unknown options are silently
ignored if this variable is non-zero, which is quite logical given the
variable's name.

16 years agoFix a race condition in arena_ralloc() for shrinking in-place large
jasone [Sun, 17 Feb 2008 18:34:17 +0000 (18:34 +0000)]
Fix a race condition in arena_ralloc() for shrinking in-place large
reallocation, when junk filling is enabled.  Junk filling must occur
prior to shrinking, since any deallocated trailing pages are immediately
available for use by other threads.

Reported by: Mats Palmgren <mats.palmgren@bredband.net>

16 years agoRemove support for lazy deallocation. Benchmarks across a wide range of
jasone [Sun, 17 Feb 2008 17:09:24 +0000 (17:09 +0000)]
Remove support for lazy deallocation.  Benchmarks across a wide range of
allocation patterns, number of CPUs, and MALLOC_OPTIONS settings indicate
that lazy deallocation has the potential to worsen throughput dramatically.
Performance degradation occurs when multiple threads try to clear the lazy
free cache simultaneously.  Various experiments to avoid this bottleneck
failed to completely solve this problem, while adding yet more complexity.

16 years agoMake sysctl_kern_arnd return a random buffer instead of a random long,
antoine [Sun, 17 Feb 2008 16:44:48 +0000 (16:44 +0000)]
Make sysctl_kern_arnd return a random buffer instead of a random long,
as it is expected by userland (stack protector guard setup for example).

PR: 119129
Approved by: rwatson (mentor)
MFC after: 1 month

16 years agoOnly print sense data diagnostics if debugging is enabled with the
gibbs [Sun, 17 Feb 2008 16:00:36 +0000 (16:00 +0000)]
Only print sense data diagnostics if debugging is enabled with the
AHD_SHOW_SENSE flag.

16 years agoSwitch from conditionally dropping Giant in exit1() to asserting it is
kris [Sun, 17 Feb 2008 15:28:28 +0000 (15:28 +0000)]
Switch from conditionally dropping Giant in exit1() to asserting it is
not held, which appears to be always true.

16 years agoRemove superfluous setting of the transport_version field of our
gibbs [Sun, 17 Feb 2008 15:22:26 +0000 (15:22 +0000)]
Remove superfluous setting of the transport_version field of our
path inquiry response - a likely holdover from the port of this code
from the aic7xxx driver.

16 years agoRemove custom queue macros in Coda, replacing them with queue(9) tailq
rwatson [Sun, 17 Feb 2008 14:33:28 +0000 (14:33 +0000)]
Remove custom queue macros in Coda, replacing them with queue(9) tailq
macros.  The only semantic change was the need to add a vc_opened field
to struct vcomm since we can no longer use the request queue returning
to an uninitialized state to hold whether or not the device is open.

MFC after: 1 month

16 years agoRemove namecache performance-tuning todo for Coda: we now use the FreeBSD
rwatson [Sun, 17 Feb 2008 12:40:27 +0000 (12:40 +0000)]
Remove namecache performance-tuning todo for Coda: we now use the FreeBSD
name cache.

MFC after: 1 month

16 years agoHook up sinl(), cosl(), and tanl() to the build.
das [Sun, 17 Feb 2008 07:33:51 +0000 (07:33 +0000)]
Hook up sinl(), cosl(), and tanl() to the build.

16 years agoAdd implementations of sinl(), cosl(), and tanl().
das [Sun, 17 Feb 2008 07:33:12 +0000 (07:33 +0000)]
Add implementations of sinl(), cosl(), and tanl().

Submitted by: Steve Kargl <sgk@apl.washington.edu>

16 years agoDocumentation for sinl(), cosl(), and tanl().
das [Sun, 17 Feb 2008 07:32:44 +0000 (07:32 +0000)]
Documentation for sinl(), cosl(), and tanl().

16 years agoAdd kernel functions for 128-bit long doubles. These could be improved
das [Sun, 17 Feb 2008 07:32:31 +0000 (07:32 +0000)]
Add kernel functions for 128-bit long doubles. These could be improved
a bit, but access to a freebsd/sparc64 machine is needed.

Submitted by: bde and Steve Kargl <sgk@apl.washington.edu> (earlier version)

16 years agoAdd kernel functions for 80-bit long doubles. Many thanks to Steve and
das [Sun, 17 Feb 2008 07:32:14 +0000 (07:32 +0000)]
Add kernel functions for 80-bit long doubles. Many thanks to Steve and
Bruce for putting lots of effort into these; getting them right isn't
easy, and they went through many iterations.

Submitted by: Steve Kargl <sgk@apl.washington.edu> with revisions from bde

16 years agoAdd more pi for long doubles. Also, avoid storing multiple copies
das [Sun, 17 Feb 2008 07:31:59 +0000 (07:31 +0000)]
Add more pi for long doubles. Also, avoid storing multiple copies
of the pi/2 array, as it is unlikely to vary, except in Indiana.

16 years agoAdvertise to CAM the ability of 790X controllers to negotiate information
gibbs [Sun, 17 Feb 2008 06:14:59 +0000 (06:14 +0000)]
Advertise to CAM the ability of 790X controllers to negotiate information
unit transfers (packetized/U320 protocol) and QAS.

16 years agoFix quoting for the dnsbl example -- m4 misparses quoted strings with
gshapiro [Sun, 17 Feb 2008 05:38:29 +0000 (05:38 +0000)]
Fix quoting for the dnsbl example -- m4 misparses quoted strings with
commas due to our deconstruction of the line in cf/feature/dnsbl.m4.

PR: 120038
Submitted by: mattijs vreeling
MFC after: 1 week

16 years agoUse better examples (and comment them out for safety).
gshapiro [Sun, 17 Feb 2008 05:22:08 +0000 (05:22 +0000)]
Use better examples (and comment them out for safety).

PR:             118837
Submitted by:   Matthew Seaman
MFC after:      1 week

16 years agoSwitch libmilter from select(2) to poll(2) so milters are not limited
gshapiro [Sun, 17 Feb 2008 05:14:47 +0000 (05:14 +0000)]
Switch libmilter from select(2) to poll(2) so milters are not limited
by the size of FD_SETSIZE.

PR: 118824
Submitted by: vsevolod
MFC after: 3 weeks

16 years agoFix typo in comment.
imp [Sun, 17 Feb 2008 02:46:54 +0000 (02:46 +0000)]
Fix typo in comment.

16 years agoMFp4 (e500):
marcel [Sat, 16 Feb 2008 22:40:55 +0000 (22:40 +0000)]
MFp4 (e500):

Add support for U-Boot. This uses the U-Boot API as developed by
Rafal and which is (will be) part of U-Boot 1.3.2 and later.

Credits to: raj@

16 years agoMFp4 (e500):
marcel [Sat, 16 Feb 2008 22:13:11 +0000 (22:13 +0000)]
MFp4 (e500):

Add support for U-Boot. This uses the U-Boot API as developed by
Rafal and which is (will be) part of U-Boot 1.3.2 and later.

Credits to: raj@

16 years agoRe-sort options. While here:
marcel [Sat, 16 Feb 2008 18:30:58 +0000 (18:30 +0000)]
Re-sort options. While here:
o  remove COMPAT_FREEBSD5
o  add INVARIANTS
o  add WITNESS

16 years agoEnable option WITNESS_SKIPSPIN by default.
marcel [Sat, 16 Feb 2008 17:59:27 +0000 (17:59 +0000)]
Enable option WITNESS_SKIPSPIN by default.

16 years agoNew release notes: AMD 6.1.5, awk 20071023, CVS 1.11.12, OpenPAM
bmah [Sat, 16 Feb 2008 15:52:39 +0000 (15:52 +0000)]
New release notes:  AMD 6.1.5, awk 20071023, CVS 1.11.12, OpenPAM
Hydrangea.

Updated release notes:  ncurses 5.6-20080209.

16 years agoCreate a thread to handle passive cooling for 1st zone which has _PSV,
ume [Sat, 16 Feb 2008 07:15:34 +0000 (07:15 +0000)]
Create a thread to handle passive cooling for 1st zone which has _PSV,
_TSP, _TC1 and _TC2.

Contirmed by: "Alexandre \"Sunny\" Kovalenko" <alex.kovalenko_at_verizon.net>
Reviewed by: njl
MFC after: 1 week

16 years agoAllow the user to override the current active cooling state if state
rpaulo [Sat, 16 Feb 2008 02:09:05 +0000 (02:09 +0000)]
Allow the user to override the current active cooling state if state
is currently TZ_ACTIVE_NONE.

Submitted by:   Andriy Gapon <avg at icyb.net.ua>
Reviewed by:    njl (mentor)
Approved by:    njl (mentor)
Requested by:   njl (mentor)
MFC after:      3 days

16 years agoSkip validation of the C3 state if we disabled C3 by software (i.e.,
rpaulo [Sat, 16 Feb 2008 02:00:25 +0000 (02:00 +0000)]
Skip validation of the C3 state if we disabled C3 by software (i.e.,
via quirk).

Submitted by: Andriy Gapon <avg at icyb.net.ua>
Reviewed by: njl (mentor)
Approved by: njl (mentor)
Requested by: njl (mentor)
MFC after: 3 days

16 years agoAllow underscore in domain names while resolving. While having underscore
delphij [Sat, 16 Feb 2008 00:16:49 +0000 (00:16 +0000)]
Allow underscore in domain names while resolving.  While having underscore
is a violation of RFC 1034 [STD 13], it is accepted by certain name servers
as well as other popular operating systems' resolver library.

Bugs are mine.

Obtained from: ume
MFC after: 2 weeks

16 years ago- fix typo
danger [Fri, 15 Feb 2008 23:56:33 +0000 (23:56 +0000)]
- fix typo

Submitted by: Constantine A. Murenin <cnst@FreeBSD.org>
MFC after: 3 days

16 years agoRemove a superfluous line in run_interrupt_driven_config_hooks(),
antoine [Fri, 15 Feb 2008 21:54:21 +0000 (21:54 +0000)]
Remove a superfluous line in run_interrupt_driven_config_hooks(),
next_entry is already initialized during TAILQ_FOREACH_SAFE().

PR: kern/119604
Approved by: rwatson (mentor)
MFC after: 1 month

16 years ago- Make Disk_Names() behave as documented in libdisk(3): return an array
antoine [Fri, 15 Feb 2008 21:19:15 +0000 (21:19 +0000)]
- Make Disk_Names() behave as documented in libdisk(3): return an array
of disk names, where you must free each pointer, as well as the array
by hand. [1]
- Destaticize "disks" in Disk_Names, it has no reasons to be static.

PR: kern/96077 [1]
PR: kern/114110 [1]
MFC after: 1 month
Approved by: rwatson (mentor)

16 years agoBump __FreeBSD_version in order to signal introduction of lockmgr_args()
attilio [Fri, 15 Feb 2008 21:08:18 +0000 (21:08 +0000)]
Bump __FreeBSD_version in order to signal introduction of lockmgr_args()
and LK_INTERNAL removal.

16 years ago- Introduce lockmgr_args() in the lockmgr space. This function performs
attilio [Fri, 15 Feb 2008 21:04:36 +0000 (21:04 +0000)]
- Introduce lockmgr_args() in the lockmgr space.  This function performs
  the same operation of lockmgr() but accepting a custom wmesg, prio and
  timo for the particular lock instance, overriding default values
  lkp->lk_wmesg, lkp->lk_prio and lkp->lk_timo.
- Use lockmgr_args() in order to implement BUF_TIMELOCK()
- Cleanup BUF_LOCK()
- Remove LK_INTERNAL as it is nomore used in the lockmgr namespace

Tested by: Andrea Barberio <insomniac at slackware dot it>

16 years agoAdd privilege PRIV_NNPFS_DEBUG for use with Arla/nnpfs. This privilege
rwatson [Fri, 15 Feb 2008 20:26:17 +0000 (20:26 +0000)]
Add privilege PRIV_NNPFS_DEBUG for use with Arla/nnpfs.  This privilege
will authorize debugging system calls.

MFC after: 1 month

16 years agoAdd myself and the mentorship relation of des.
olli [Fri, 15 Feb 2008 18:40:45 +0000 (18:40 +0000)]
Add myself and the mentorship relation of des.

Approved by: des (mentor)

16 years agoThe possibly interruptible msleep in coda_call() means well, but is
rwatson [Fri, 15 Feb 2008 13:31:35 +0000 (13:31 +0000)]
The possibly interruptible msleep in coda_call() means well, but is
fundamentally fairly confused about how signals work and when it is
appropriate for upcalls to be interrupted.  In particular, we should
be exempting certain upcalls from interruption, we should not always
eventually time out sleeping on a upcall, and we should not be
interrupting the sleep for certain signals that we currently are
(including SIGINFO).  This code needs to be reworked in the style of
NFS interruptible mounts.

MFC after: 1 month

16 years agoSpell replys as replies.
rwatson [Fri, 15 Feb 2008 12:11:45 +0000 (12:11 +0000)]
Spell replys as replies.

MFC after: 1 month

16 years agoReorder and clean up make_coda_node(), annotate weaknesses in the
rwatson [Fri, 15 Feb 2008 11:58:11 +0000 (11:58 +0000)]
Reorder and clean up make_coda_node(), annotate weaknesses in the
implementation.

MFC after: 1 month

16 years agoSigh, the weak reference for ceill(), floorl() and truncl() was in
bde [Fri, 15 Feb 2008 07:01:40 +0000 (07:01 +0000)]
Sigh, the weak reference for ceill(), floorl() and truncl() was in
unreachable code due to a missing include.  This kept arm and powerpc
broken.

Reported by: sam, grehan

16 years agoTeach the dump and minidump code to respect the maxioszie attribute of
scottl [Fri, 15 Feb 2008 06:26:25 +0000 (06:26 +0000)]
Teach the dump and minidump code to respect the maxioszie attribute of
the disk; the hard-coded assumption of 64K doesn't work in all cases.

16 years agoAdd open_to_operation, a security regression test that opens files with
rwatson [Thu, 14 Feb 2008 20:57:38 +0000 (20:57 +0000)]
Add open_to_operation, a security regression test that opens files with
various open flags and then tests various operations to make sure that
they are properly constrained by open flags.  Various I/O mechansms
are tried, including aio if compiled into the kernel or loaded as a
module.  There's more to be done here but it's a useful start, running
about 220 individual tests.

This is in support of FreeBSD-SA-08:03.sendfile.

16 years agoNo network addresses in the system isn't a good excuse
yar [Thu, 14 Feb 2008 20:12:23 +0000 (20:12 +0000)]
No network addresses in the system isn't a good excuse
for rpcbind(8) to crash.

The crash was due to a boolean variable initialized
improperly.  Besides fixing the initialization, pick
a better name for the variable so that its meaning is
clear and no more coding errors appear around it.

16 years agoMake netstat -rn more resilient to having the routing table change out from
jhb [Thu, 14 Feb 2008 20:01:52 +0000 (20:01 +0000)]
Make netstat -rn more resilient to having the routing table change out from
under it while running.  Note that this is still not perfect:
- Try to do something intelligent if kvm_read() fails to read a routing
  table structure such as an rtentry, radix_node, or ifnet.
- Don't follow left and right node pointers in radix_nodes unless
  RNF_ACTIVE is set in rn_flags.  This avoids walking through freed
  radix_nodes.

MFC after: 1 week

16 years agoSome language and mdoc style improvements.
brueffer [Thu, 14 Feb 2008 19:39:09 +0000 (19:39 +0000)]
Some language and mdoc style improvements.

16 years agoOn Montecito processors, the instruction cache is in fact not
marcel [Thu, 14 Feb 2008 18:46:50 +0000 (18:46 +0000)]
On Montecito processors, the instruction cache is in fact not
coherent with the data caches. Implement a quick fix to allow
us to boot on Montecito, while I'm working on a better fix in
the mean time.

Commit made on Montecito-based Itanium...

16 years agoIn the new order of things dictated by nmount(2), a read-only mount
yar [Thu, 14 Feb 2008 17:04:31 +0000 (17:04 +0000)]
In the new order of things dictated by nmount(2), a read-only mount
is to be requested via a "ro" option.  At the same time, MNT_RDONLY
is gradually becoming an indicator of the current state of the FS
instead of a command flag.  Today passing MNT_RDONLY alone to the
kernel's mount machinery will lead to various glitches.  (See the
PRs for examples.)

Therefore mount the root FS with a "ro" option instead of the
MNT_RDONLY flag.  (Note that MNT_RDONLY still is added to the mount
flags internally, by vfs_donmount(), if "ro" was specified.)

To be able to pass "ro" cleanly to kernel_vmount(), teach the latter
function to accept options with NULL values.

Also correct the comment explaining how mount_arg() handles length
of -1.

PR: bin/106636 kern/120319
Submitted by: Jaakko Heinonen <see PR kern/120319 for email> (originally)

16 years agoNow that mxge supports MSI-X interrupts, reverse the logic and flag
gallatin [Thu, 14 Feb 2008 16:24:14 +0000 (16:24 +0000)]
Now that mxge supports MSI-X interrupts, reverse the logic and flag
legacy interrupts rather than MSI as a special case.  Prior to this
commit, the interrupt handler was doing the slow handshaking with
the device to ensure the legacy interrupt was lowered in both
the legacy and MSI-X case.  This handshaking was not
required for MSI-X.

16 years agoOops, the weak reference for ceill(), floorl() and truncl() was in the
bde [Thu, 14 Feb 2008 15:10:34 +0000 (15:10 +0000)]
Oops, the weak reference for ceill(), floorl() and truncl() was in the
wrong file.  This broke arm and powerpc.

Reported by: grehan

16 years agoDon't attach to non Core CPUs. This is needed because on the PIII,
rpaulo [Thu, 14 Feb 2008 14:14:59 +0000 (14:14 +0000)]
Don't attach to non Core CPUs. This is needed because on the PIII,
querying the number of sensors returns > 0.

PR: 120541
Approved by: njl (mentor)

16 years agoUse the expression fabs(x+0.0)+fabs(y+0.0) instad of a+b (where a is
bde [Thu, 14 Feb 2008 13:44:03 +0000 (13:44 +0000)]
Use the expression fabs(x+0.0)+fabs(y+0.0) instad of a+b (where a is
|x| or |y| and b is |y| or |x|) when mixing NaN arg(s).

hypot*() had its own foot shooting for mixing NaNs -- it swaps the
args so that |x| in bits is largest, but does this before quieting
signaling NaNs, so on amd64 (where the result of adding NaNs depends
on the order) it gets inconsistent results if setting the quiet bit
makes a difference, just like a similar ia64 and i387 hardware comparison.
The usual fix (see e_powf.c 1.13 for more details) of mixing using
(a+0.0)+-(b+0.0) doesn't work on amd64 if the args are swapped (since
the rder makes a difference with SSE). Fortunately, the original args
are unchanged and don't need to be swapped when we let the hardware
decide the mixing after quieting them, but we need to take their
absolute value.

hypotf() doesn't seem to have any real bugs masked by this non-bug.
On amd64, its maximum error in 2^32 trials on amd64 is now 0.8422 ulps,
and on i386 the maximum error is unchanged and about the same, except
with certain CFLAGS it magically drops to 0.5 (perfect rounding).

Convert to __FBSDID().

16 years agoForced commit to note that the minus sign in the fancy expression
bde [Thu, 14 Feb 2008 12:56:35 +0000 (12:56 +0000)]
Forced commit to note that the minus sign in the fancy expression
(x+0.0)-(y+0.0) for mixing NaNs documented in a previous log message
didn't actually get committed.  Apparently, adding 0.0 uniformizes
the order enough to give consistent results.

16 years ago_pthread_mutex_isowned_np(): use a more reliable method; the current code
des [Thu, 14 Feb 2008 12:37:58 +0000 (12:37 +0000)]
_pthread_mutex_isowned_np(): use a more reliable method; the current code
will work in simple cases, but may fail in more complicated ones.

Reviewed by: davidxu

16 years agoFix sendfile(2) write-only file permission bypass.
simon [Thu, 14 Feb 2008 11:44:31 +0000 (11:44 +0000)]
Fix sendfile(2) write-only file permission bypass.

Security: FreeBSD-SA-08:03.sendfile
Submitted by: kib

16 years agoFix the hi+lo decomposition for 2/(3ln2). The decomposition needs to
bde [Thu, 14 Feb 2008 10:23:51 +0000 (10:23 +0000)]
Fix the hi+lo decomposition for 2/(3ln2).  The decomposition needs to
be into 12+24 bits of precision for extra-precision multiplication,
but was into 13+24 bits.  On i386 with -O1 the bug was hidden by
accidental extra precision, but on amd64, in 2^32 trials the bug
caused about 200000 errors of more than 1 ulp, with a maximum error
of about 80 ulps.  Now the maximum error in 2^32 trials on amd64
is 0.8573 ulps.  It is still 0.8316 ulps on i386 with -O1.

The nearby decomposition of 1/ln2 and the decomposition of 2/(3ln2) in
the double precision version seem to be sub-optimal but not broken.

16 years agoDocument the hw.skc.jumbo_disable tunable. While here, correct some things
brueffer [Thu, 14 Feb 2008 10:01:48 +0000 (10:01 +0000)]
Document the hw.skc.jumbo_disable tunable.  While here, correct some things
in the SYSCTLS section.

Submitted by: yongari

16 years agoUse the expression (x+0.0)-(y+0.0) instead of x+y when mixing NaN arg(s).
bde [Thu, 14 Feb 2008 09:42:24 +0000 (09:42 +0000)]
Use the expression (x+0.0)-(y+0.0) instead of x+y when mixing NaN arg(s).
This uses 2 tricks to improve consistency so that more serious problems
aren't hidden in simple regression tests by noise for the NaNs:

- for a signaling NaN, adding 0.0 generates the invalid exception and
  converts to a quiet NaN, and doesn't have too many effects for other
  types of args (it converts -0 to +0 in some rounding modes, but that
  hopefully doesn't change the result after adding the NaN arg).  This
  avoids some inconsistencies on i386 and ia64.  On these arches, the
  result of an operation on 2 NaNs is apparently the largest or the
  smallest of the NaNs as bits (consistently largest or smallest for
  each arch, but the opposite).  I forget which way the comparison
  goes and if the sign bit affects it.  The quiet bit is is handled
  poorly by not always setting it before the comparision or ignoring
  it.  Thus if one of the args was originally a signaling NaN and the
  other was originally a quiet NaN, then the result depends too much
  on whether the signaling NaN has been quieted at this point, which
  in turn depends on optimizations and promotions.  E.g., passing float
  signaling NaNs to double functions must quiet them on conversion;
  on i387, loading a signaling NaN of type float or double (but not
  long double) into a register involves a conversion, so it quiets
  signaling NaNs, so if the addition has 2 register operands than it
  only sees quiet NaNs, but if the addition has a memory operand then
  it sees a signaling NaN iff it is in the memory operand.

- subtraction instead of addition is used to avoid a dubious optimization
  in old versions of gcc.  For SSE operations, mixing of NaNs apparently
  always gives the target operand.  This is not as good as the i387
  and ia64 behaviour.  It doesn't mix NaNs at all, and makes addition
  not quite commutative.  Old versions of gcc sometimes rewrite x+y
  to y+x and thus give different results (in bits) for NaNs.  gcc-3.3.3
  rewrites x+y to y+x for one of pow() and powf() but not the other,
  so starting from float NaN args x and y, powf(x, y) was almost always
  different from pow(x, y).

These tricks won't give consistency of 2-arg float and double functions
with long double ones on amd64, since long double ones use the i387
which has different semantics from SSE.

Convert to __FBSDID().

16 years agoPrefer NULL over integer 0 for pointer type.
yongari [Thu, 14 Feb 2008 01:25:01 +0000 (01:25 +0000)]
Prefer NULL over integer 0 for pointer type.

16 years agoNuke local jumbo allocator and switch to use of UMA backed page
yongari [Thu, 14 Feb 2008 01:10:48 +0000 (01:10 +0000)]
Nuke local jumbo allocator and switch to use of UMA backed page
allocator for jumbo frame.
 o Removed unneeded jlist lock which was used to manage jumbo
   buffers.
 o Don't reinitialize hardware if MTU was not changed.
 o Added additional check for minimal MTU size.
 o Added a new tunable hw.skc.jumbo_disable to disable jumbo frame
   support for the driver. The tunable could be set for systems that
   do not need to use jumbo frames and it would save
   (9K * number of Rx descriptors) bytes kernel memory.
 o Jumbo buffer allocation failure is no longer critical error for
   the operation of sk(4). If sk(4) encounter the allocation failure
   it just disables jumbo frame support and continues to work without
   user intervention.

With these changes jumbo frame performance of sk(4) was slightly
increased and users should not encounter jumbo buffer allocation
failure. Previously sk(4) tried to allocate physically contiguous
memory, 3388KB for 256 Rx descriptors. Sometimes that amount of
contiguous memory region could not be available for running systems
which in turn resulted in failure of loading the driver.

Tested by: Cy Schubert < Cy.Schubert () komquats dot com >

16 years agoRemove debugging code under OLD_DIAGNOSTIC; this is all >10 years old and
rwatson [Thu, 14 Feb 2008 00:55:03 +0000 (00:55 +0000)]
Remove debugging code under OLD_DIAGNOSTIC; this is all >10 years old and
hasn't been used in that time.

MFC after: 1 month

16 years agoIn Coda, flush the attribute cache for a cnode when its fid is
rwatson [Thu, 14 Feb 2008 00:30:06 +0000 (00:30 +0000)]
In Coda, flush the attribute cache for a cnode when its fid is
changed, as its synthesized inode number may have changed and we
want stat(2) to pick up the new inode number.

MFC after: 1 month

16 years agoAdd minimally invasive shims to ease MFCs of mxge back as far
gallatin [Thu, 14 Feb 2008 00:09:59 +0000 (00:09 +0000)]
Add minimally invasive shims to ease MFCs of mxge back as far
as RELENG_6

Sponsored by: Myricom, Inc.

16 years agoAdd KASSERT()'s to catch attempts to recurse on spin mutexes that aren't
jhb [Wed, 13 Feb 2008 23:39:05 +0000 (23:39 +0000)]
Add KASSERT()'s to catch attempts to recurse on spin mutexes that aren't
marked recursable either via mtx_lock_spin() or thread_lock().

MFC after: 1 week

16 years agoMark the syscons video spin mutex as recursable since it is currently
jhb [Wed, 13 Feb 2008 23:38:08 +0000 (23:38 +0000)]
Mark the syscons video spin mutex as recursable since it is currently
recursed in a few places.

MFC after: 1 week

16 years agoMark sleepqueue chain spin mutexes are recursable since the sleepq code
jhb [Wed, 13 Feb 2008 23:36:56 +0000 (23:36 +0000)]
Mark sleepqueue chain spin mutexes are recursable since the sleepq code
now recurses on them in sleepq_broadcast() and sleepq_signal() when
resuming threads that are fully asleep.

MFC after: 1 week

16 years agoAdd a couple of assertions and KTR logging to thread_lock_flags() to
jhb [Wed, 13 Feb 2008 23:33:50 +0000 (23:33 +0000)]
Add a couple of assertions and KTR logging to thread_lock_flags() to
match mtx_lock_spin_flags().

MFC after: 1 week

16 years agoMake the type of the firmware arrays match those
gallatin [Wed, 13 Feb 2008 21:58:46 +0000 (21:58 +0000)]
Make the type of the firmware arrays match those
in the other eth*_z8e.h files.

16 years agoUpdate manpage with lockmgr_assert() description.
attilio [Wed, 13 Feb 2008 21:54:16 +0000 (21:54 +0000)]
Update manpage with lockmgr_assert() description.

16 years agoAdd an automatic kernel module version dependency to prevent loading
jhb [Wed, 13 Feb 2008 21:34:06 +0000 (21:34 +0000)]
Add an automatic kernel module version dependency to prevent loading
modules using invalid ABI versions (e.g. a 7.x module with an 8.x kernel)
for a given kernel:
- Add a 'kernel' module version whose value is __FreeBSD_version.
- Add a version dependency on 'kernel' in every module that has an
  acceptable version range of __FreeBSD_version up to the end of the
  branch __FreeBSD_version is part of.  E.g. a module compiled on 701000
  would work on kernels with versions between 701000 and 799999 inclusive.

Discussed on: arch@
MFC after: 1 week

16 years agoBump __FreeBSD_version after the introduction of:
attilio [Wed, 13 Feb 2008 20:59:28 +0000 (20:59 +0000)]
Bump __FreeBSD_version after the introduction of:
- lockmgr_assert()
- BUF_ASSERT_*() family functions

which enriched the KPI.

16 years agoImprove conformance to the HTTP specification by using case-insensitive
cperciva [Wed, 13 Feb 2008 20:46:23 +0000 (20:46 +0000)]
Improve conformance to the HTTP specification by using case-insensitive
comparisons for header keywords.  Apparently some proxies use creative
capitalization.

Weird proxy found by: brooks
MFC after: 3 days

16 years ago- Add real assertions to lockmgr locking primitives.
attilio [Wed, 13 Feb 2008 20:44:19 +0000 (20:44 +0000)]
- Add real assertions to lockmgr locking primitives.
  A couple of notes for this:
  * WITNESS support, when enabled, is only used for shared locks in order
    to avoid problems with the "disowned" locks
  * KA_HELD and KA_UNHELD only exists in the lockmgr namespace in order
    to assert for a generic thread (not curthread) owning or not the
    lock.  Really, this kind of check is bogus but it seems very
    widespread in the consumers code.  So, for the moment, we cater this
    untrusted behaviour, until the consumers are not fixed and the
    options could be removed (hopefully during 8.0-CURRENT lifecycle)
  * Implementing KA_HELD and KA_UNHELD (not surported natively by
    WITNESS) made necessary the introduction of LA_MASKASSERT which
    specifies the range for default lock assertion flags
  * About other aspects, lockmgr_assert() follows exactly what other
    locking primitives offer about this operation.

- Build real assertions for buffer cache locks on the top of
  lockmgr_assert().  They can be used with the BUF_ASSERT_*(bp)
  paradigm.

- Add checks at lock destruction time and use a cookie for verifying
  lock integrity at any operation.

- Redefine BUF_LOCKFREE() in order to not use a direct assert but
  let it rely on the aforementioned destruction time check.

KPI results evidently broken, so __FreeBSD_version bumping and
manpage update result necessary and will be committed soon.

Side note: lockmgr_assert() will be used soon in order to implement
real assertions in the vnode namespace replacing the legacy and still
bogus "VOP_ISLOCKED()" way.

Tested by:      kris (earlier version)
Reviewed by:    jhb

16 years agoUpdate cache flushing behavior in light of recent namecache and
rwatson [Wed, 13 Feb 2008 19:50:17 +0000 (19:50 +0000)]
Update cache flushing behavior in light of recent namecache and
access cache improvements:

- Flush just access control state on CODA_PURGEUSER, not the full
  namecache for /coda.

- When replacing a fid on a cnode as a result of, e.g.,
  reintegration after offline operation, we no longer need to
  purge the namecache entries associated with its vnode.

MFC after: 1 month

16 years agoThe hptrr driver first appeared in 6.3, not 5.3.
brueffer [Wed, 13 Feb 2008 18:32:44 +0000 (18:32 +0000)]
The hptrr driver first appeared in 6.3, not 5.3.

PR: 120616
Submitted by: Josh Paetzel <josh@tcbug.org>
MFC after: 3 days

16 years agoForced commit to note that the lost log message for the previous commit
bde [Wed, 13 Feb 2008 18:16:43 +0000 (18:16 +0000)]
Forced commit to note that the lost log message for the previous commit
said that the previous commit was almost a null forced commit too.  It
just converted to __FBSDID().  I was going to change `huge' from its
double precision value of 1e300, but that seems to be unnecessary since
`huge' is only used to set FE_INEXACT, and any value with an exponent
larger than LDBL_MANT_DIG will do for that, while initializing a really
huge value in a portable way would require more code.

16 years agos_ceill.c
bde [Wed, 13 Feb 2008 17:38:16 +0000 (17:38 +0000)]
s_ceill.c
s_floorl.c
s_truncl.c

16 years agoUse RTFREE_LOCKED() instead of rtfree() when releasing a reference on the
jhb [Wed, 13 Feb 2008 16:57:58 +0000 (16:57 +0000)]
Use RTFREE_LOCKED() instead of rtfree() when releasing a reference on the
'rt' route in rtredirect() as 'rt' is always locked.

MFC after: 1 week
PR: kern/117913
Submitted by: Stefan Lambrev  stefan.lambrev of moneybookers.com

16 years agoOn arches where long double is the same as double, alias ceil(), floor()
bde [Wed, 13 Feb 2008 16:56:52 +0000 (16:56 +0000)]
On arches where long double is the same as double, alias ceil(), floor()
and trunc() to the corresponding long double functions.  This is not
just an optimization for these arches.  The full long double functions
have a wrong value for `huge', and the arches without full long doubles
depended on it being wrong.

16 years agoRemove coda_namecache from coda5 as well. We should probably GC coda5
rwatson [Wed, 13 Feb 2008 16:31:04 +0000 (16:31 +0000)]
Remove coda_namecache from coda5 as well.  We should probably GC coda5
entirely at this point as coda6 is considered the supported branch.

MFC after: 1 month

16 years agoRemove coda_namecache from "options vcoda", it is no longer required.
rwatson [Wed, 13 Feb 2008 16:15:47 +0000 (16:15 +0000)]
Remove coda_namecache from "options vcoda", it is no longer required.

MFC after: 1 month
Spotted by: Tinderbox

16 years agoImplement a rudimentary access cache for the Coda kernel module,
rwatson [Wed, 13 Feb 2008 15:45:12 +0000 (15:45 +0000)]
Implement a rudimentary access cache for the Coda kernel module,
modeled on the access cache found in NFS, smbfs, and the Linux coda
module.  This is a positive access cache of a single entry per file,
tracking recently granted rights, but unlike NFS and smbfs,
supporting explicit invalidation by the distributed file system.

For each cnode, maintain a C_ACCCACHE flag indicating the validity
of the cache, and a cached uid and mode tracking recently granted
positive access control decisions.

Prefer the cache to venus_access() in VOP_ACCESS() if it is valid,
and when we must fall back to venus_access(), update the cache.

Allow Venus to clear the access cache, either the whole cache on
CODA_FLUSH, or just entries for a specific uid on CODA_PURGEUSER.
Unlike the Coda module on Linux, we don't flush all entries on a
user purge using a generation number, we instead walk present
cnodes and clear only entries for the specific user, meaning it is
somewhat more expensive but won't hit all users.

Since the Coda module is agressive about not keeping around
unopened cnodes, the utility of the cache is somewhat limited for
files, but works will for directories.  We should make Coda less
agressive about GCing cnodes in VOP_INACTIVE() in order to improve
the effectiveness of in-kernel caching of attributes and access
rights.

MFC after: 1 month

16 years agoFix the C version of ceill(x) for -1 < x <= -0 in all rounding modes.
bde [Wed, 13 Feb 2008 15:22:53 +0000 (15:22 +0000)]
Fix the C version of ceill(x) for -1 < x <= -0 in all rounding modes.
The result should be -0, but was +0.

16 years ago- Remove duplicate tputs.3 from MLINK. As we use termcap in the bsae, remove
rafan [Wed, 13 Feb 2008 14:34:39 +0000 (14:34 +0000)]
- Remove duplicate tputs.3 from MLINK. As we use termcap in the bsae, remove
  the one links to curs_terminfo.

Submitted by: David Naylor <blackdragon at highveldmail.co.za>
MFC after: 3 days

16 years agoRemove now-unused Coda namecache.
rwatson [Wed, 13 Feb 2008 13:26:01 +0000 (13:26 +0000)]
Remove now-unused Coda namecache.

MFC after: 1 month

16 years agoRather than having the Coda module use its own namecache, use the global
rwatson [Wed, 13 Feb 2008 13:06:22 +0000 (13:06 +0000)]
Rather than having the Coda module use its own namecache, use the global
VFS namecache, as is done by the Coda module on Linux.  Unlike the Coda
namecache, the global VFS namecache isn't tagged by credential, so use
ore conservative flushing behavior (for now) when CODA_PURGEUSER is
issued by Venus.

This improves overall integration with the FreeBSD VFS, including
allowing __getcwd() to work better, procfs/procstat monitoring, and so
on.  This improves shell behavior in many cases, and improves ".."
handling.  It may lead to some slowdown until we've implemented a
specific access cache, which should net improve performance, but in the
mean time, lookup access control now always goes to Venus, whereas
previously it didn't.

MFC after: 1 month

16 years agoFix a lock leak in the ntfs locking scheme:
attilio [Wed, 13 Feb 2008 13:02:12 +0000 (13:02 +0000)]
Fix a lock leak in the ntfs locking scheme:
When ntfs_ntput() reaches 0 in the refcount the inode lockmgr is not
released and directly destroyed. Fix this by unlocking the lockmgr() even
in the case of zero-refcount.

Reported by: dougb, yar, Scot Hetzel <swhetzel at gmail dot com>
Submitted by: yar