]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
16 years agoWe should also save and restore the MXCSR as on amd64, but detecting
David Schultz [Sat, 28 Jun 2008 17:58:06 +0000 (17:58 +0000)]
We should also save and restore the MXCSR as on amd64, but detecting
whether the CPU supports SSE or not here is rather odious.

16 years agoTwo FP-related setjmp/longjmp changes:
David Schultz [Sat, 28 Jun 2008 17:55:43 +0000 (17:55 +0000)]
Two FP-related setjmp/longjmp changes:

1. Save and restore the control part of the MXCSR in addition to the
   i387 control word to ensure that the two are consistent.

   Note that standards don't require longjmp to restore either control
   word, and none of Linux, MacOS X 10.3 and earlier, NetBSD, OpenBSD,
   or Solaris do it. However, it is historical FreeBSD behavior, and
   bde points out that it is needed to make longjmping out of a signal
   handler work properly, given the way FreeBSD clobbers the FPU state
   on signal handler entry.

2. Don't clobber the FPU exception flags in longjmp. C99 requires them
   to remain unchanged.

16 years agoWhite space fixes.
David E. O'Brien [Sat, 28 Jun 2008 15:28:17 +0000 (15:28 +0000)]
White space fixes.

16 years agoReduce diff to vendor.
David E. O'Brien [Sat, 28 Jun 2008 15:17:02 +0000 (15:17 +0000)]
Reduce diff to vendor.

16 years agoRemove stray "miibus0" reference from ancient kernel config file times.
Philip Paeps [Sat, 28 Jun 2008 13:38:53 +0000 (13:38 +0000)]
Remove stray "miibus0" reference from ancient kernel config file times.

MFC after: 1 day

16 years agoModify the DoParseCommand() to work on (const char *) instead of just
Mike Makonnen [Sat, 28 Jun 2008 12:31:30 +0000 (12:31 +0000)]
Modify the DoParseCommand() to work on (const char *) instead of just
(char *). This is a slightly simplified version of the patch in the PR. It
fixes compilitation issues with -O3.

PR: misc/124385

16 years agoStyle fix (space into tab).
Remko Lodder [Sat, 28 Jun 2008 08:36:47 +0000 (08:36 +0000)]
Style fix (space into tab).

Approved by: imp (mentor, implicit)

16 years agoFix a typo in the cosl() prototype.
David Schultz [Sat, 28 Jun 2008 01:43:24 +0000 (01:43 +0000)]
Fix a typo in the cosl() prototype.

16 years agoImprove r180011 by explicitly adding the condition codes to the
Marius Strobl [Fri, 27 Jun 2008 22:17:14 +0000 (22:17 +0000)]
Improve r180011 by explicitly adding the condition codes to the
clobber list.

Suggested by: Christoph Mallon

16 years agoAdd explicit PCI IDs for the following Adaptec RAID Series 2 adapters:
Ed Maste [Fri, 27 Jun 2008 19:34:47 +0000 (19:34 +0000)]
Add explicit PCI IDs for the following Adaptec RAID Series 2 adapters:

  Adaptec RAID 2045
  Adaptec RAID 2405
  Adaptec RAID 2445
  Adaptec RAID 2805

Without this change these devices are supported by the driver's family
support, but they then appear as "Adaptec RAID Controller" in boot
messages and the dev.aac.0.%desc sysctl.

16 years ago- markup fixes
Daniel Gerzo [Fri, 27 Jun 2008 16:32:04 +0000 (16:32 +0000)]
- markup fixes
- advise to use rc script to SIGHUP mountd
- add information about possiblity of using /prefix network notation [1]

PR: docs/124373
Reviewed by: jhb
Obtained from: NetBSD [1]
MFC after: 3 days

16 years agoBackout r179941. The nfsclient knob always confuses me. I should have
Mike Makonnen [Fri, 27 Jun 2008 15:45:17 +0000 (15:45 +0000)]
Backout r179941. The nfsclient knob always confuses me. I should have
double-checked my setup before commiting.

Noticed by: Florian Smeets
Pointy hat to: mtm

16 years agoFixing NO_INET6 build.
Tai-hwa Liang [Fri, 27 Jun 2008 15:29:48 +0000 (15:29 +0000)]
Fixing NO_INET6 build.

16 years agoInstead of using .POSIX:, use the cool looking "@:" rule.
David E. O'Brien [Fri, 27 Jun 2008 14:59:23 +0000 (14:59 +0000)]
Instead of using .POSIX:, use the cool looking "@:" rule.

Submitted by: ru

16 years agoNote that the .POSIX special target disables the "Remaking Makefiles" feature.
David E. O'Brien [Fri, 27 Jun 2008 14:35:33 +0000 (14:35 +0000)]
Note that the .POSIX special target disables the "Remaking Makefiles" feature.

16 years agoInclude <sys/pcpu.h> for curthread.
Doug Rabson [Fri, 27 Jun 2008 14:35:05 +0000 (14:35 +0000)]
Include <sys/pcpu.h> for curthread.

16 years agoAdd the missing support for Asus Eee PC in acpi_asus(4).
Rui Paulo [Fri, 27 Jun 2008 12:04:36 +0000 (12:04 +0000)]
Add the missing support for Asus Eee PC in acpi_asus(4).
This includes hotkeys support and sysctl variables to control camera
and card reader. These new sysctls don't have CTFLAG_ANYBODY set.

While there add entries to devd.conf related to the Eee volume keys.

Reviewed by: phillip
MFC after: 1 week
Also tested by: lme (previous version)

16 years agoAdd USB ids for the Epson DX7400 / CX7300 multifunction scanner printer
Luigi Rizzo [Fri, 27 Jun 2008 10:30:08 +0000 (10:30 +0000)]
Add USB ids for the Epson DX7400 / CX7300 multifunction scanner printer
card reader. Tested operation of the scanner part with Sane,
card and printer correctly recognised as /dev/da0 and /dev/ulpt0

MFC after: 3 days

16 years agoSupport for filtering on major device number was removed in rev. 1.7 or
Mike Makonnen [Fri, 27 Jun 2008 09:09:50 +0000 (09:09 +0000)]
Support for filtering on major device number was removed in rev. 1.7 or
rule.c. Update man page example accordingly.

Submitted by: Mateusz Guzik <mjguzik@gmail.com>
PR: docs/124892

16 years agoRework the lifetime management of the kernel implementation of POSIX
John Baldwin [Fri, 27 Jun 2008 05:39:04 +0000 (05:39 +0000)]
Rework the lifetime management of the kernel implementation of POSIX
semaphores.  Specifically, semaphores are now represented as new file
descriptor type that is set to close on exec.  This removes the need for
all of the manual process reference counting (and fork, exec, and exit
event handlers) as the normal file descriptor operations handle all of
that for us nicely.  It is also suggested as one possible implementation
in the spec and at least one other OS (OS X) uses this approach.

Some bugs that were fixed as a result include:
- References to a named semaphore whose name is removed still work after
  the sem_unlink() operation.  Prior to this patch, if a semaphore's name
  was removed, valid handles from sem_open() would get EINVAL errors from
  sem_getvalue(), sem_post(), etc.  This fixes that.
- Unnamed semaphores created with sem_init() were not cleaned up when a
  process exited or exec'd.  They were only cleaned up if the process
  did an explicit sem_destroy().  This could result in a leak of semaphore
  objects that could never be cleaned up.
- On the other hand, if another process guessed the id (kernel pointer to
  'struct ksem' of an unnamed semaphore (created via sem_init)) and had
  write access to the semaphore based on UID/GID checks, then that other
  process could manipulate the semaphore via sem_destroy(), sem_post(),
  sem_wait(), etc.
- As part of the permission check (UID/GID), the umask of the proces
  creating the semaphore was not honored.  Thus if your umask denied group
  read/write access but the explicit mode in the sem_init() call allowed
  it, the semaphore would be readable/writable by other users in the
  same group, for example.  This includes access via the previous bug.
- If the module refused to unload because there were active semaphores,
  then it might have deregistered one or more of the semaphore system
  calls before it noticed that there was a problem.  I'm not sure if
  this actually happened as the order that modules are discovered by the
  kernel linker depends on how the actual .ko file is linked.  One can
  make the order deterministic by using a single module with a mod_event
  handler that explicitly registers syscalls (and deregisters during
  unload after any checks).  This also fixes a race where even if the
  sem_module unloaded first it would have destroyed locks that the
  syscalls might be trying to access if they are still executing when
  they are unloaded.

  XXX: By the way, deregistering system calls doesn't do any blocking
  to drain any threads from the calls.
- Some minor fixes to errno values on error.  For example, sem_init()
  isn't documented to return ENFILE or EMFILE if we run out of semaphores
  the way that sem_open() can.  Instead, it should return ENOSPC in that
  case.

Other changes:
- Kernel semaphores now use a hash table to manage the namespace of
  named semaphores nearly in a similar fashion to the POSIX shared memory
  object file descriptors.  Kernel semaphores can now also have names
  longer than 14 chars (up to MAXPATHLEN) and can include subdirectories
  in their pathname.
- The UID/GID permission checks for access to a named semaphore are now
  done via vaccess() rather than a home-rolled set of checks.
- Now that kernel semaphores have an associated file object, the various
  MAC checks for POSIX semaphores accept both a file credential and an
  active credential.  There is also a new posixsem_check_stat() since it
  is possible to fstat() a semaphore file descriptor.
- A small set of regression tests (using the ksem API directly) is present
  in src/tools/regression/posixsem.

Reported by: kris (1)
Tested by: kris
Reviewed by: rwatson (lightly)
MFC after: 1 month

16 years agoIntroduce locking around use of ifindex_table, whose use was previously
Robert Watson [Thu, 26 Jun 2008 23:05:28 +0000 (23:05 +0000)]
Introduce locking around use of ifindex_table, whose use was previously
unsynchronized.  While races were extremely rare, we've now had a
couple of reports of panics in environments involving large numbers of
IPSEC tunnels being added very quickly on an active system.

- Add accessor functions ifnet_byindex(), ifaddr_byindex(),
  ifdev_byindex() to replace existing accessor macros.  These functions
  now acquire the ifnet lock before derefencing the table.
- Add IFNET_WLOCK_ASSERT().
- Add static accessor functions ifnet_setbyindex(), ifdev_setbyindex(),
  which set values in the table either asserting of acquiring the ifnet
  lock.
- Use accessor functions throughout if.c to modify and read
  ifindex_table.
- Rework ifnet attach/detach to lock around ifindex_table modification.

Note that these changes simply close races around use of ifindex_table,
and make no attempt to solve the probem of disappearing ifnets.  Further
refinement of this work, including with respect to ifindex_table
resizing, is still required.

In a future change, the ifnet lock should be converted from a mutex to an
rwlock in order to reduce contention.

Reviewed and tested by: brooks

16 years agochange a variable name ot stop it from colliding with other names in
Julian Elischer [Thu, 26 Jun 2008 22:59:49 +0000 (22:59 +0000)]
change a variable name ot stop it from colliding with other names in
some situations. (i.e. in vimage)

MFC after: 1 week

16 years agoSomeone cut and pasted a bunch of stuff here so lots of
Julian Elischer [Thu, 26 Jun 2008 22:45:04 +0000 (22:45 +0000)]
Someone cut and pasted a bunch of stuff here so lots of
indents were spaces when they should have been tabs,
screwing up diffs and patches..

Whitespace commit as my first SVN commit. (yay)

MFC after: 1 week

16 years agoTweak the output of event log messages from the controller:
John Baldwin [Thu, 26 Jun 2008 22:36:38 +0000 (22:36 +0000)]
Tweak the output of event log messages from the controller:
- Each log entry contains a text description in the "description" field of
  the entry.  The existing decode logic always ended up duplicating
  information that was already in the description string.  This made the
  logs overly verbose.  Now we just print out the description string.
- Add some simple parsing of the timestamp and event classes.

Reviewed by: ambrisko, scottl
MFC after: 2 weeks

16 years agoAdjust the handling of pending log events during boot:
John Baldwin [Thu, 26 Jun 2008 22:33:24 +0000 (22:33 +0000)]
Adjust the handling of pending log events during boot:
- Fetch events from the controller in batches of 15 rather than a single
  event at a time.
- When fetching events from the controller, honor the event class and
  locale settings (via hw.mfi tunables).  This also allows the firmware to
  skip over unwanted log entries resulting in fewer requests to the
  controller if there many unwanted log entries since the last clean
  shutdown.
- Don't drop the driver mutex while decoding an event.
- If we get an error other than MFI_STAT_NOT_FOUND (basically EOF for
  hitting the end of the event log) then emit a warning and bail on
  processing further log entries.

Reviewed by: ambrisko, scottl
MFC after: 2 weeks

16 years agoFix compile on 64-bit platforms.
John Baldwin [Thu, 26 Jun 2008 21:26:34 +0000 (21:26 +0000)]
Fix compile on 64-bit platforms.

16 years agoRemove the non-existent rt2860 subdir. Note, the ralfw module is not used in
Andrew Thompson [Thu, 26 Jun 2008 18:58:01 +0000 (18:58 +0000)]
Remove the non-existent rt2860 subdir. Note, the ralfw module is not used in
the build yet.

PR: kern/125015
Submitted by: Dan Cojocar

16 years agoAs reported by Alexey Shuvaev, -dumpl overwrote files after
Tim Kientzle [Thu, 26 Jun 2008 15:46:01 +0000 (15:46 +0000)]
As reported by Alexey Shuvaev, -dumpl overwrote files after
linking them, with predictably bad results.

16 years agoChange SEM_VALUE_MAX (maximum value of a POSIX semaphore) from UINT_MAX
John Baldwin [Thu, 26 Jun 2008 13:51:25 +0000 (13:51 +0000)]
Change SEM_VALUE_MAX (maximum value of a POSIX semaphore) from UINT_MAX
to INT_MAX.  Otherwise, a process could create a semaphore (or increase
its value via ksem_post()) beyond INT_MAX and sem_getvalue() would return
a negative value.  sem_getvalue() is only supposed to return a negative
value if that is the number of waiters for that semaphore.

MFC after: 2 weeks

16 years agoAdd missing counter increments for posix shm checks.
John Baldwin [Thu, 26 Jun 2008 13:49:32 +0000 (13:49 +0000)]
Add missing counter increments for posix shm checks.

16 years ago- add description of the MLINK error
Daniel Gerzo [Thu, 26 Jun 2008 12:15:38 +0000 (12:15 +0000)]
- add description of the MLINK error

PR: docs/123019
MFC after: 3 days

16 years agoSome tests won't build at WARNS level 6 due to aliasing violations.
Dag-Erling Smørgrav [Thu, 26 Jun 2008 11:58:26 +0000 (11:58 +0000)]
Some tests won't build at WARNS level 6 due to aliasing violations.
Add missing -I. so the tests will build when ${.OBJDIR} != ${.CURDIR}.
${.OBJDIR} does not need to be spelled out.

16 years agoAdd regression test for CRC32 check. The test file has been modified to
Dag-Erling Smørgrav [Thu, 26 Jun 2008 11:50:11 +0000 (11:50 +0000)]
Add regression test for CRC32 check.  The test file has been modified to
include an invalid checksum for file2.

Approved by: kientzle

16 years agoImplement CRC32 verification. Note that you have to read until EOF to
Dag-Erling Smørgrav [Thu, 26 Jun 2008 11:48:19 +0000 (11:48 +0000)]
Implement CRC32 verification.  Note that you have to read until EOF to
trigger the check.

Requested by: ache
Approved by: kientzle

16 years agoAllow the tests to build without libdmalloc.
Dag-Erling Smørgrav [Thu, 26 Jun 2008 10:53:05 +0000 (10:53 +0000)]
Allow the tests to build without libdmalloc.

16 years agoRe-implement the client side of rpc.lockd in the kernel. This implementation
Doug Rabson [Thu, 26 Jun 2008 10:21:54 +0000 (10:21 +0000)]
Re-implement the client side of rpc.lockd in the kernel. This implementation
provides the correct semantics for flock(2) style locks which are used by the
lockf(1) command line tool and the pidfile(3) library. It also implements
recovery from server restarts and ensures that dirty cache blocks are written
to the server before obtaining locks (allowing multiple clients to use file
locking to safely share data).

Sponsored by: Isilon Systems
PR: 94256
MFC after: 2 weeks

16 years agoMark the section describing return values with an appropriate section flag.
Daniel Gerzo [Thu, 26 Jun 2008 08:24:59 +0000 (08:24 +0000)]
Mark the section describing return values with an appropriate section flag.

PR: docs/122818
MFC after: 3 days

16 years agoFix a fallout from SSP commit, and make this compile again.
Ruslan Ermilov [Thu, 26 Jun 2008 07:56:16 +0000 (07:56 +0000)]
Fix a fallout from SSP commit, and make this compile again.
Bonus: including kern.mk just to pick kernel warning flags
was an extremely bad idea anyway, because it also picked
up CFLAGS (it probably wasn't the case at the time of CVS
rev. 1.1, I haven't checked).  Remove duplicate CWARNFLAGS
from CFLAGS.

16 years agoFix a chicken-and-egg problem: this files implements SSP support,
Ruslan Ermilov [Thu, 26 Jun 2008 07:52:45 +0000 (07:52 +0000)]
Fix a chicken-and-egg problem: this files implements SSP support,
so we cannot compile it with -fstack-protector[-all] flags (or
it will self-recurse); this is ensured in sys/conf/files.  This
OTOH means that checking for defines __SSP__ and __SSP_ALL__ to
determine if we should be compiling the support is impossible
(which it was trying, resulting in an empty object file).  Fix
this by always compiling the symbols in this files.  It's good
because it allows us to always have SSP support, and then compile
with SSP selectively.

Repoted by: tinderbox

16 years agoGcc barfs in glob.c when run with -O3. To fix this make g_strchr() work on
Mike Makonnen [Thu, 26 Jun 2008 07:12:35 +0000 (07:12 +0000)]
Gcc barfs in glob.c when run with -O3. To fix this make g_strchr() work on
and return (const Char *) pointers instead of just (Char *) and get rid of
all the type casting.

PR: kern/124334

16 years agoThe signature for a pthread function requires that it
Mike Makonnen [Thu, 26 Jun 2008 07:05:35 +0000 (07:05 +0000)]
The signature for a pthread function requires that it
return a pointer to a void. The send_thread() and disk_thread()
funtions; however, do not have a return value because they run for
the duration of the daemon's lifetime. This causes gcc to barf when
running with -O3. Make these functions return a null pointer to quiet it.

PR: bin/124342
Submitted by: Garrett Cooper <gcooper@FreeBSD.org> (minus his comments)
MFC after: 1 week

16 years agoFix 6-year old cut&paste error. The # could be escaped with '\', not
Maxim Sobolev [Thu, 26 Jun 2008 07:02:47 +0000 (07:02 +0000)]
Fix 6-year old cut&paste error. The # could be escaped with '\', not
with '\\'.

MFC after: 2 weeks

16 years agoSplit out the reference zip file for ease of maintenance.
Tim Kientzle [Thu, 26 Jun 2008 04:48:42 +0000 (04:48 +0000)]
Split out the reference zip file for ease of maintenance.

16 years agoRegen properly.
Ruslan Ermilov [Wed, 25 Jun 2008 21:42:23 +0000 (21:42 +0000)]
Regen properly.

16 years agoRegen.
Ruslan Ermilov [Wed, 25 Jun 2008 21:36:25 +0000 (21:36 +0000)]
Regen.

16 years agoEnable GCC stack protection (aka Propolice) for userland:
Ruslan Ermilov [Wed, 25 Jun 2008 21:33:28 +0000 (21:33 +0000)]
Enable GCC stack protection (aka Propolice) for userland:
- It is opt-out for now so as to give it maximum testing, but it may be
  turned opt-in for stable branches depending on the consensus.  You
  can turn it off with WITHOUT_SSP.
- WITHOUT_SSP was previously used to disable the build of GNU libssp.
  It is harmless to steal the knob as SSP symbols have been provided
  by libc for a long time, GNU libssp should not have been much used.
- SSP is disabled in a few corners such as system bootstrap programs
  (sys/boot), process bootstrap code (rtld, csu) and SSP symbols themselves.
- It should be safe to use -fstack-protector-all to build world, however
  libc will be automatically downgraded to -fstack-protector because it
  breaks rtld otherwise.
- This option is unavailable on ia64.

Enable GCC stack protection (aka Propolice) for kernel:
- It is opt-out for now so as to give it maximum testing.
- Do not compile your kernel with -fstack-protector-all, it won't work.

Submitted by: Jeremie Le Hen <jeremie@le-hen.org>

16 years agoUse "__asm __volatile" rather than "__asm" for instruction sequences
Marius Strobl [Wed, 25 Jun 2008 21:04:59 +0000 (21:04 +0000)]
Use "__asm __volatile" rather than "__asm" for instruction sequences
that modify condition codes (the carry bit, in this case). Without
"__volatile", the compiler might add the inline assembler instructions
between unrelated code which also uses condition codes, modifying the
latter.
This prevents the TCP pseudo header checksum calculation done in
tcp_output() from having effects on other conditions when compiled
with GCC 4.2.1 at "-O2" and "options INET6" left out. [1]

Reported & tested by: Boris Kochergin [1]
MFC after: 3 days

16 years agoGiven that sun4u uses sparc64/sparc64/in_cksum.c, use the sparc64
Marius Strobl [Wed, 25 Jun 2008 21:03:26 +0000 (21:03 +0000)]
Given that sun4u uses sparc64/sparc64/in_cksum.c, use the sparc64
<machine/in_cksum.h> here also.

MFC after: 3 days

16 years agosrc/compat/ is gone back in March.
Ruslan Ermilov [Wed, 25 Jun 2008 20:29:22 +0000 (20:29 +0000)]
src/compat/ is gone back in March.

Reported by: Mars G Miro

16 years agoDocument spindown constraints as given in the original commit
Bjoern A. Zeeb [Wed, 25 Jun 2008 18:11:22 +0000 (18:11 +0000)]
Document spindown constraints as given in the original commit
message[1] and later clarification provided by phk.

[1] http://docs.freebsd.org/cgi/mid.cgi?200803171033.m2HAXOeN055116

Reviewed by: brueffer, phk, ed

16 years agoRemove the unused M_MEMDEV from the kernel.
Ed Schouten [Wed, 25 Jun 2008 07:52:10 +0000 (07:52 +0000)]
Remove the unused M_MEMDEV from the kernel.

The M_MEMDEV memory allocation pool does not seem to be used. We can
live without it.

Approved by: philip (mentor)

16 years agoRemove the unused major/minor numbers from iodev and memdev.
Ed Schouten [Wed, 25 Jun 2008 07:45:31 +0000 (07:45 +0000)]
Remove the unused major/minor numbers from iodev and memdev.

Now that st_rdev is being automatically generated by the kernel, there
is no need to define static major/minor numbers for the iodev and
memdev. We still need the minor numbers for the memdev, however, to
distinguish between /dev/mem and /dev/kmem.

Approved by: philip (mentor)

16 years agoFix links to online gcc docs.
Alex Dupre [Wed, 25 Jun 2008 06:07:03 +0000 (06:07 +0000)]
Fix links to online gcc docs.

Reported by: Andre Guibert de Bruet <andy@siliconlandmark.com>
MFC after: 1 day

16 years agoPass the entry down into the core write loop, so we
Tim Kientzle [Wed, 25 Jun 2008 05:01:02 +0000 (05:01 +0000)]
Pass the entry down into the core write loop, so we
can include the filename when reporting errors.

Thanks to: Dan Nelson

16 years agoMonths in English are capitalized (even when abbreviated).
Garrett Wollman [Wed, 25 Jun 2008 04:56:08 +0000 (04:56 +0000)]
Months in English are capitalized (even when abbreviated).

16 years agoQuiet rc.d/syscons unless it has something to say.
Mike Makonnen [Tue, 24 Jun 2008 21:01:56 +0000 (21:01 +0000)]
Quiet rc.d/syscons unless it has something to say.

16 years agoEmit opcodes closer to GNU as(1) generated codes and micro-optimize.
Jung-uk Kim [Tue, 24 Jun 2008 20:12:44 +0000 (20:12 +0000)]
Emit opcodes closer to GNU as(1) generated codes and micro-optimize.

16 years agoEmit opcodes closer to GNU as(1) generated codes and micro-optimize.
Jung-uk Kim [Tue, 24 Jun 2008 20:12:12 +0000 (20:12 +0000)]
Emit opcodes closer to GNU as(1) generated codes and micro-optimize.

16 years agoMake it simpler to build netgraph modules outside of the kernel source
George V. Neville-Neil [Tue, 24 Jun 2008 18:49:49 +0000 (18:49 +0000)]
Make it simpler to build netgraph modules outside of the kernel source
tree.  This change follows similar ones in the device tree.

MFC after: 2 weeks

16 years agoIn -p mode, don't gaurd against '..' in paths. We continue to
Tim Kientzle [Tue, 24 Jun 2008 15:18:40 +0000 (15:18 +0000)]
In -p mode, don't gaurd against '..' in paths.  We continue to
check in -i mode unless --insecure is specified.

PR: bin/124924

16 years agoIn case of interface initialization failure remove struct in_ifaddr* from
Oleksandr Tymoshenko [Tue, 24 Jun 2008 13:58:28 +0000 (13:58 +0000)]
In case of interface initialization failure remove struct in_ifaddr* from
in_ifaddrhashtbl in in_ifinit because error handler in in_control removes
entries only for AF_INET addresses. If in_ifinit is called for the cloned
inteface that has just been created its address family is not AF_INET and
therefor LIST_REMOVE is not called for respective LIST_INSERT_HEAD and
freed entries remain in in_ifaddrhashtbl and lead to memory corruption.

PR: kern/124384

16 years agoAdd two commands to _umtx_op system call to allow a simple mutex to be
David Xu [Tue, 24 Jun 2008 07:32:12 +0000 (07:32 +0000)]
Add two commands to _umtx_op system call to allow a simple mutex to be
locked and unlocked completely in userland. by locking and unlocking mutex
in userland, it reduces the total time a mutex is locked by a thread,
in some application code, a mutex only protects a small piece of code, the
code's execution time is less than a simple system call, if a lock contention
happens, however in current implemenation, the lock holder has to extend its
locking time and enter kernel to unlock it, the change avoids this disadvantage,
it first sets mutex to free state and then enters kernel and wake one waiter
up. This improves performance dramatically in some sysbench mutex tests.

Tested by: kris
Sounds great: jeff

16 years agoFix test for waiting AIFs in aac_poll(). This seems to solve the
Ed Maste [Tue, 24 Jun 2008 03:26:41 +0000 (03:26 +0000)]
Fix test for waiting AIFs in aac_poll().  This seems to solve the
problem where Adaptec's arcconf monitoring tool hangs after producing
its expected output.

Submitted by: Adaptec, via driver ver 15317
MFC after: 1 week

16 years agoRehash and clean up BPF JIT compiler macros to match AT&T notations.
Jung-uk Kim [Mon, 23 Jun 2008 23:10:11 +0000 (23:10 +0000)]
Rehash and clean up BPF JIT compiler macros to match AT&T notations.

16 years agoRehash and clean up BPF JIT compiler macros to match AT&T notations.
Jung-uk Kim [Mon, 23 Jun 2008 23:09:52 +0000 (23:09 +0000)]
Rehash and clean up BPF JIT compiler macros to match AT&T notations.

16 years agoAdd a -q flag to swapon(8) to suppress informational messages. Use it in
Mike Makonnen [Mon, 23 Jun 2008 22:17:08 +0000 (22:17 +0000)]
Add a -q flag to swapon(8) to suppress informational messages. Use it in
rc.d.
Note: errors are not affected by this flag.

16 years agoThe sysctl(8) program exits on some errors and only emits warnings on
Mike Makonnen [Mon, 23 Jun 2008 22:06:28 +0000 (22:06 +0000)]
The sysctl(8) program exits on some errors and only emits warnings on
others. In the case where it displayed warnings it would still return
succesfully. Modify it so that it returns the number of sysctls that
it was not able to set.

Make use of this in rc.d to display only *unsuccessfull* attempts to
set sysctls.

16 years agoRemove the posixsem_check_destroy() MAC check. It is semantically identical
John Baldwin [Mon, 23 Jun 2008 21:37:53 +0000 (21:37 +0000)]
Remove the posixsem_check_destroy() MAC check.  It is semantically identical
to doing a MAC check for close(), but no other types of close() (including
close(2) and ksem_close(2)) have MAC checks.

Discussed with: rwatson

16 years agoRun savecore(8) only if there is a core dump to save. If there is
Mike Makonnen [Mon, 23 Jun 2008 20:54:32 +0000 (20:54 +0000)]
Run savecore(8) only if there is a core dump to save. If there is
no core dump hide the message to that effect behind $rc_quiet.

16 years agoImplement a "quiet" mode for rc.d/netif, which only outputs
Mike Makonnen [Mon, 23 Jun 2008 20:50:11 +0000 (20:50 +0000)]
Implement a "quiet" mode for rc.d/netif, which only outputs
the interface name of interfaces that were configured.

This change has the added benefit that ifn_start() and
ifn_stop() in network.subr no longer write to standard output.
Whether to output and what to output is now handled entirely
in rc.d/netif.

16 years ago+Computers can't cruise. Meandering is a foreign concept to them.
Poul-Henning Kamp [Mon, 23 Jun 2008 20:27:37 +0000 (20:27 +0000)]
+Computers can't cruise.  Meandering is a foreign concept to them.
+The computer assumes that all behavior is in pursuit of an ultimate
+goal.  Whenever a motorist changes his or her mind and veers off
+course, the GPS lady issues that snippy announcement: "Recalculating!"
+               -- Joel Achenbach (www.slate.com, 20 jun 2008)

16 years ago- Use bus_foo() rather than bus_space_foo() and retire the bus tag and handle
John Baldwin [Mon, 23 Jun 2008 18:16:25 +0000 (18:16 +0000)]
- Use bus_foo() rather than bus_space_foo() and retire the bus tag and handle
  from the softc.
- Rework the watchdog timer to match other NIC drivers:
  - Start a timer in fe_init() that runs once a second and checks a counter
    in the softc that is identical to the deprecated 'if_timer'.
  - Just adjust the softc tx timeout value when sending packets instead of
    scheduling the timer.
- Use IFQ_SET_MAXLEN().

Tested by: WATANABE Kazuhiro

16 years agoEnsure the channel is a number and not a range, the 'channel' command can be
Andrew Thompson [Mon, 23 Jun 2008 16:08:40 +0000 (16:08 +0000)]
Ensure the channel is a number and not a range, the 'channel' command can be
easily mixed up with 'chanlist' and would give unexpected results by fixing the
channel on the first number in the range.

16 years ago- Fix compile if WPI_DEBUG is not defined
Andrew Thompson [Mon, 23 Jun 2008 15:40:56 +0000 (15:40 +0000)]
- Fix compile if WPI_DEBUG is not defined
- Allow debug.wpi to be set from a tunable
- Put ring reset messages back under debug
- Add more debug output around channel init

16 years agoEnsure that KERNBASE is no less than the virtual address -2GB.
Alan Cox [Mon, 23 Jun 2008 15:22:53 +0000 (15:22 +0000)]
Ensure that KERNBASE is no less than the virtual address -2GB.

16 years agoSet the sysctl(8) value in the same shell, not a subshell. This was
Mike Makonnen [Mon, 23 Jun 2008 12:06:35 +0000 (12:06 +0000)]
Set the sysctl(8) value in the same shell, not a subshell. This was
causing calls to netoptions_init() to not properly set a global variable,
which ended up being in the parent shell.

16 years agoTurn execvpe() into an internal libc routine.
Ed Schouten [Mon, 23 Jun 2008 05:22:06 +0000 (05:22 +0000)]
Turn execvpe() into an internal libc routine.

Adding exevpe() has caused some ports to break. Even though execvpe() is
a useful routine, it does not conform to any standards.

This patch is a little bit different from the patch sent to the mailing
list. I forgot to remove execvpe from the Symbol.map (which does not
seem to miscompile libc, though).

Reviewed by: davidxu
Approved by: philip

16 years agoMove the diagnostic output when the rc.subr(8) glue automatically starts a
Mike Makonnen [Mon, 23 Jun 2008 05:09:09 +0000 (05:09 +0000)]
Move the diagnostic output when the rc.subr(8) glue automatically starts a
service behind $rc_quiet. Instead, output a warning if the pre-command
routine or the command itself failed. Arguably, it's more useful to know when
a command failed to start than it is to have an endless list of
"Starting ...." lines[1].

[1] - This change actually helped me to discover a bug in rc.d/{lockd,statd}
      (fixed in r179941) that used to fail silently before.

16 years agoMove a lot of diagnostic output behind $rc_quiet in scripts that
Mike Makonnen [Mon, 23 Jun 2008 04:46:54 +0000 (04:46 +0000)]
Move a lot of diagnostic output behind $rc_quiet in scripts that
implement their own start command.

16 years agoAlign the script more with rc.d/cleanvar (which doesn't output any
Mike Makonnen [Mon, 23 Jun 2008 04:42:58 +0000 (04:42 +0000)]
Align the script more with rc.d/cleanvar (which doesn't output any
diagnostics). Instead, move output behind $rc_quiet.

16 years agoRemove the -v flag from the command line to dumpon(8), and instead print
Mike Makonnen [Mon, 23 Jun 2008 04:39:36 +0000 (04:39 +0000)]
Remove the -v flag from the command line to dumpon(8), and instead print
diagnostic ouput only if the command fails.

16 years agoRemove pointless informational message.
Mike Makonnen [Mon, 23 Jun 2008 04:18:22 +0000 (04:18 +0000)]
Remove pointless informational message.

16 years agoArgh! s/nfs_client_enable/nfsclient_enable/g
Mike Makonnen [Mon, 23 Jun 2008 04:05:39 +0000 (04:05 +0000)]
Argh! s/nfs_client_enable/nfsclient_enable/g

16 years agoDo not print anything unless one of the net/routing options is set.
Mike Makonnen [Mon, 23 Jun 2008 04:00:45 +0000 (04:00 +0000)]
Do not print anything unless one of the net/routing options is set.

16 years agos/daemon processes/local packages/ for consisitency.
Mike Makonnen [Mon, 23 Jun 2008 03:49:30 +0000 (03:49 +0000)]
s/daemon processes/local packages/ for consisitency.

16 years agoAlways create opt_ah.h regardless of KERNBUILDDIR.
Andrew Thompson [Mon, 23 Jun 2008 00:51:34 +0000 (00:51 +0000)]
Always create opt_ah.h regardless of KERNBUILDDIR.

16 years agoAdd exit_delay parameter to control daemon exit delay after signal.
Alexander Motin [Sun, 22 Jun 2008 22:14:02 +0000 (22:14 +0000)]
Add exit_delay parameter to control daemon exit delay after signal.

PR: bin/58696
Submitted by: sp@alkor.ru

16 years agoIf S_IFIFO is passed to mknod(2), invoke kern_mkfifoat(9) to create a
Robert Watson [Sun, 22 Jun 2008 21:51:32 +0000 (21:51 +0000)]
If S_IFIFO is passed to mknod(2), invoke kern_mkfifoat(9) to create a
FIFO, as required by SUSv3.  No specific privilege check is performed
in this case, as FIFOs may be created by unprivileged processes
(subject to the normal file system name space restrictions that may be
in place).

Unlike the Apple implementation, we reject requests to create a FIFO
using mknod(2) if there is a non-zero dev argument to the system call,
which is permitted by the Open Group specification ("... undefined
...").  We might want to revise this if we find it causes
compatibility problems for applications in practice.

PR: kern/74242, kern/68459
Obtained from: Apple, Inc.
MFC after: 3 weeks

16 years agoUse strdup() instead of static buffer allocation to avoid 128 bytes limit
Alexander Motin [Sun, 22 Jun 2008 21:22:25 +0000 (21:22 +0000)]
Use strdup() instead of static buffer allocation to avoid 128 bytes limit
on -redirect_XXX arguments length.

PR: bin/86647
Submitted by: Stephen Hurd <shurd@sasktel.net>

16 years agoTeach fifo_create regression test to also try to use mknod(2) to create
Robert Watson [Sun, 22 Jun 2008 21:03:26 +0000 (21:03 +0000)]
Teach fifo_create regression test to also try to use mknod(2) to create
fifos, as this is required by the Single UNIX Specification, although
not currently implemented on FreeBSD.

While here, fix a bug in the directory timestamp checking test by
sleeping after querying the starting timestamp, rather than before.

16 years agoAdd support for VT8237 ISA bridge.
Oleksandr Tymoshenko [Sun, 22 Jun 2008 20:53:29 +0000 (20:53 +0000)]
Add support for VT8237 ISA bridge.

PR:     kern/120714
Event:  Bugathon#5

16 years agoAdd an abbreviation for adaptive mode, and document all the abreviations.
David E. O'Brien [Sun, 22 Jun 2008 17:52:57 +0000 (17:52 +0000)]
Add an abbreviation for adaptive mode, and document all the abreviations.

16 years agoOutput information only if /etc/rc.local exists.
Mike Makonnen [Sun, 22 Jun 2008 16:23:39 +0000 (16:23 +0000)]
Output information only if /etc/rc.local exists.

16 years agoDo not print anything unless at least one of the abi emulators is
Mike Makonnen [Sun, 22 Jun 2008 16:19:50 +0000 (16:19 +0000)]
Do not print anything unless at least one of the abi emulators is
enabled.

16 years agoSimplify this script with the added bonus that the bit about i386
Mike Makonnen [Sun, 22 Jun 2008 15:57:50 +0000 (15:57 +0000)]
Simplify this script with the added bonus that the bit about i386
initialization doesn't get printed unless ibcs2_enable is set.

16 years agoDon't say we're going to mount filesystems of a certain type unless
Mike Makonnen [Sun, 22 Jun 2008 15:40:19 +0000 (15:40 +0000)]
Don't say we're going to mount filesystems of a certain type unless
there actually are filesystems of that type to mount.

16 years agoDon't say we're going to [start|stop] local packages unless there actually
Mike Makonnen [Sun, 22 Jun 2008 15:34:40 +0000 (15:34 +0000)]
Don't say we're going to [start|stop] local packages unless there actually
are local (pre rc.d) scripts to run.

16 years agoGet pointer to devfs_ruleset struct after garbage collection has been
Oleksandr Tymoshenko [Sun, 22 Jun 2008 14:34:38 +0000 (14:34 +0000)]
Get pointer to devfs_ruleset struct after garbage collection has been
performed. Otherwise if ruleset is used by given mountpoint and is empty
it's freed by devfs_ruleset_reap and pointer becomes bogus.

Submitted by:   Mateusz Guzik <mjguzik@gmail.com>
PR:             kern/124853

16 years agoo The FreeBSD bus_dmamap_sync(9) supports ored together flags for quite
Marius Strobl [Sun, 22 Jun 2008 13:54:51 +0000 (13:54 +0000)]
o The FreeBSD bus_dmamap_sync(9) supports ored together flags for quite
  some time now so collapse calls accordingly.
o Given that gem_load_txmbuf() is allowed to fail resulting in a packet
  drop also for quite some time now implement the functionality of
  gem_txcksum() by means of m_pullup(9), which de-obfuscates the code
  and allows to always retrieve the correct length of the IP header.
o Add missing BUS_DMASYNC_PREREAD when syncing the control DMA maps in
  gem_rint() and gem_start_locked().
o Correct some bus_barrier(9) calls to do a read/write barrier as we
  do a read after a write. Add some missing ones in gem_mii_readreg()
  and gem_mii_writereg().
o According to the Apple GMAC driver, the GEM ASIC specification and
  the OpenSolaris eri(7D) the TX FIFO threshold has to be set to 0x4ff
  for the Gigabit variants and 0x100 for the ERI in order do avoid TX
  underruns.
o In gem_init_locked():
  - be conservative and enable the RX and TX MACs,
  - don't clear GEM_LINK otherwise we don't ever mark the link as up
    again if gem_init_locked() is called from gem_watchdog(),
  - remove superfluous setting of sc_ifflags.
o Don't bother to check whether the interface is running or whether its
  queue is empty before calling gem_start_locked() in gem_tint(), the
  former will check these anyway.
o Call gem_start_locked() in gem_watchdog() in order to try to get
  some more packets going.
o In gem_mii_writereg() after reseting the PCS restore its configuration.

GMAC testing: grehan, marcel
MFC after: 2 weeks

16 years agoPartially revert previous commit. DeleteLink() does not deletes permanent
Alexander Motin [Sun, 22 Jun 2008 11:39:42 +0000 (11:39 +0000)]
Partially revert previous commit. DeleteLink() does not deletes permanent
links so we should be aware of it and try to delete every link only once
or we will loop forever.