]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
18 years agoMake sure the interrupt is masked before processing it, or bad things
cognet [Mon, 3 Oct 2005 14:17:16 +0000 (14:17 +0000)]
Make sure the interrupt is masked before processing it, or bad things
can happen.

18 years agoIf a thread already tries to allocate a new memory range, wait for it
cognet [Mon, 3 Oct 2005 14:16:41 +0000 (14:16 +0000)]
If a thread already tries to allocate a new memory range, wait for it
instead of trying to do the same.

18 years agoProvide a dump_avail[] variable, which contains the page ranges to be
cognet [Mon, 3 Oct 2005 14:15:50 +0000 (14:15 +0000)]
Provide a dump_avail[] variable, which contains the page ranges to be
dumped.

For iq31244_machdep.c, attempt to recognize hints provided by the elf
trampoline.

18 years agoo Move a lot of parameter checking from netisr_poll() to
glebius [Mon, 3 Oct 2005 14:15:26 +0000 (14:15 +0000)]
o Move a lot of parameter checking from netisr_poll() to
  dedicated sysctl handlers. Protect manipulations with
  poll_mtx. The affected sysctls are:
  - kern.polling.burst_max
  - kern.polling.each_burst
  - kern.polling.user_frac
  - kern.polling.reg_frac
o Use CTLFLAG_RD on MIBs that supposed to be read-only.
o u_int32t -> uint32_t
o Remove unneeded locking from poll_switch().

18 years ago- Provide the kernel l1pt physical address, for userland.
cognet [Mon, 3 Oct 2005 14:13:50 +0000 (14:13 +0000)]
- Provide the kernel l1pt physical address, for userland.
- Use the new API for pmap_copy_page() and pmap_zero_page().
- Just write-back the pages in pmap_qenter(), and invalidate it in
pmap_qremove().
- Nuke the cache flushing in pmap_enter_quick(), it's not needed anymore.

18 years agoAdd a new API to let platform-specific ports provide functions for big
cognet [Mon, 3 Oct 2005 14:12:10 +0000 (14:12 +0000)]
Add a new API to let platform-specific ports provide functions for big
copy/zeroing.

18 years agoExport the virtual and physical address in which the kernel was loaded,
cognet [Mon, 3 Oct 2005 14:10:55 +0000 (14:10 +0000)]
Export the virtual and physical address in which the kernel was loaded,
needed for userland when reading kernel dumps.

18 years agoMakefile magic for the ELF trampoline.
cognet [Mon, 3 Oct 2005 14:09:58 +0000 (14:09 +0000)]
Makefile magic for the ELF trampoline.

18 years agoImport a small ELF trampoline, in which the kernel is embedded, and that
cognet [Mon, 3 Oct 2005 14:09:36 +0000 (14:09 +0000)]
Import a small ELF trampoline, in which the kernel is embedded, and that
is able to load the kernel into memory, symbol table included. This is
needed to be able to access the symbol table from DDB without a boot
loader.

18 years ago*blush*
cognet [Mon, 3 Oct 2005 14:07:57 +0000 (14:07 +0000)]
*blush*
Don't try to dereference map if it's NULL.
While I'm there, increase the minimum value to write-back/invalidate the
whole dcache in bus_dmamap_sync().

18 years agoOnly save the registers that are used.
cognet [Mon, 3 Oct 2005 14:07:09 +0000 (14:07 +0000)]
Only save the registers that are used.

18 years agoasm versions of in_cksum_hdr() and in_pseudo().
cognet [Mon, 3 Oct 2005 14:06:44 +0000 (14:06 +0000)]
asm versions of in_cksum_hdr() and in_pseudo().

18 years agoDefine KERNELDUMP_ARM_VERSION.
cognet [Mon, 3 Oct 2005 14:06:00 +0000 (14:06 +0000)]
Define KERNELDUMP_ARM_VERSION.

18 years agoImplement savectx().
cognet [Mon, 3 Oct 2005 14:05:38 +0000 (14:05 +0000)]
Implement savectx().

Obtained from: NetBSD

18 years agoKernel dump for arm, ripped from the ia64/amd64 version.
cognet [Mon, 3 Oct 2005 14:05:03 +0000 (14:05 +0000)]
Kernel dump for arm, ripped from the ia64/amd64 version.

18 years agoIf sufficiently bad things happen during a call to kern_execve(), it is
cperciva [Mon, 3 Oct 2005 12:49:54 +0000 (12:49 +0000)]
If sufficiently bad things happen during a call to kern_execve(), it is
possible for do_execve() to call exit1() rather than returning.  As a
result, the sequence "allocate memory; call kern_execve; free memory"
can end up leaking memory.

This commit documents this astonishing behaviour and adds a call to
exec_free_args() before the exit1() call in do_execve().  Since all
the users of kern_execve() in the tree use exec_free_args() to free
the command-line arguments after kern_execve() returns, this should
be safe, and it fixes the memory leak which can otherwise occur.

Submitted by: Peter Holm
MFC after: 3 days
Security: Local denial of service

18 years agoUnlock Giant symmetrically with respect to lock acquire order as that's
rwatson [Mon, 3 Oct 2005 11:34:29 +0000 (11:34 +0000)]
Unlock Giant symmetrically with respect to lock acquire order as that's
generally nicer.

Spotted by: johan
MFC after: 1 week

18 years agoAcquire Giant conditionally in in_addmulti() and in_delmulti() based on
rwatson [Mon, 3 Oct 2005 11:09:39 +0000 (11:09 +0000)]
Acquire Giant conditionally in in_addmulti() and in_delmulti() based on
whether the interface being accessed is IFF_NEEDSGIANT or not.  This
avoids lock order reversals when calling into the interface ioctl
handler, which could potentially lead to deadlock.

The long term solution is to eliminate non-MPSAFE network drivers.

Discussed with: jhb
MFC after: 1 week

18 years agoAdd the lmcconfig tool for controlling the lmc driver. Add man pages and
scottl [Mon, 3 Oct 2005 07:09:41 +0000 (07:09 +0000)]
Add the lmcconfig tool for controlling the lmc driver.  Add man pages and
glue.

Submitted by: David Boggs

18 years agoReintroduce the lmc T1/E1/T3 WAN driver. This version is locked, supports
scottl [Mon, 3 Oct 2005 07:05:34 +0000 (07:05 +0000)]
Reintroduce the lmc T1/E1/T3 WAN driver.  This version is locked, supports
interface polling, compiles on 64-bit platforms, and compiles on NetBSD,
OpenBSD, BSD/OS, and Linux.  Woo!  Thanks to David Boggs for providing this
driver.

Altq, sppp, netgraph, and bpf are required for this driver to operate.
Userland tools and man pages will be committed next.

Submitted by: David Boggs

18 years agomake saved cpu level stackable.
ume [Mon, 3 Oct 2005 06:57:29 +0000 (06:57 +0000)]
make saved cpu level stackable.

18 years agoImprove handling flags that must be propagated
yar [Mon, 3 Oct 2005 02:24:21 +0000 (02:24 +0000)]
Improve handling flags that must be propagated
to the parent interface, such as IFF_PROMISC and
IFF_ALLMULTI.  In addition, vlan(4) gains ability
to migrate from one parent to another w/o losing
its own flags.

PR: kern/81978
MFC after: 2 weeks

18 years agoClean up consistency checks in if_setflag():
yar [Mon, 3 Oct 2005 02:14:51 +0000 (02:14 +0000)]
Clean up consistency checks in if_setflag():
. use KASSERT for all checks so that the source of an error can be detected;
. use __func__ instead of spelling function name each time;
. fix a typo.

18 years agoLog a message about entering or leaving permanently promiscuous mode,
yar [Mon, 3 Oct 2005 01:47:43 +0000 (01:47 +0000)]
Log a message about entering or leaving permanently promiscuous mode,
as it is done for usual promiscuous mode already.  This info is important
because promiscuous mode in the hands of a malicious party can jeopardize
the whole network.

18 years agoAlways wire the sysctl output buffer in sysctl_kern_proc() before
truckman [Sun, 2 Oct 2005 23:27:56 +0000 (23:27 +0000)]
Always wire the sysctl output buffer in sysctl_kern_proc() before
calling sysctl_out_proc().  -- fix from jhb

Move the code in fill_kinfo_thread() that gathers data from struct proc
into the new function fill_kinfo_proc_only().

Change all callers of fill_kinfo_thread() to call both
fill_kinfo_proc_only() and fill_kinfo() thread.  When gathering
data from a multi-threaded process, fill_kinfo_proc_only() only needs
to be called once.

Grab sched_lock before accessing the process thread list or calling
fill_kinfo_thread().

PR: kern/84684
MFC after: 3 days

18 years ago- Call db_setup_paging() for traceall.
cognet [Sun, 2 Oct 2005 22:57:31 +0000 (22:57 +0000)]
- Call db_setup_paging() for traceall.
- Make it so one can't call db_setup_paging() if it has already been called
before. traceall needs this, or else the db_setup_paging() call from
db_trace_thread() will reset the printed line number, and override its
argument.
This is not perfect for traceall, because even if one presses 'q' while in
the middle of printing a backtrace it will finish printing the backtrace
before exiting, as db_trace_thread() won't be notified it should stop, but
it is hard to do better without reworking the pager interface a lot more.

18 years agoNew release notes:
hrs [Sun, 2 Oct 2005 21:02:37 +0000 (21:02 +0000)]
New release notes:
gre(4) IPv6 over GRE support,
ipfw IPv6 support,
new sysctl net.inet6.ip6.stealth added,
g_label now supports Ext2FS and ReiserFS,
bsdiff(1) and bspatch(1) added,
ping(8) "sweeping ping" support,
wcsdup() function added,
rc.d/gbde_swap renamed to rc.d/encswap,
rc.d/geli and rc.d/geli2 added, and
portsnap(8) imported.

18 years agoUse available rc.subr features.
yar [Sun, 2 Oct 2005 19:17:49 +0000 (19:17 +0000)]
Use available rc.subr features.
Reduce code duplication.
Follow the current style of rc.d scripting.

18 years agoDo not packet filter in the bridge_start() routine, locally generated packets
thompsa [Sun, 2 Oct 2005 19:15:56 +0000 (19:15 +0000)]
Do not packet filter in the bridge_start() routine, locally generated packets
are already filtered by the higher layers.

Approved by: mlaier (mentor)
MFC after: 3 days

18 years agoRecord dependency on the newly introduced pfsync.
yar [Sun, 2 Oct 2005 19:12:42 +0000 (19:12 +0000)]
Record dependency on the newly introduced pfsync.

Start before routing for better system protection.
(pf used to start late during system boot, after
many a network daemon have started already, which
sucked from security POV.)

Remark: For maximum security, pf should start before
netif, but it would create a dependency loop because
pfsync has to start after netif, yet before pf.

Discussed with: mlaier on -pf
MFC after: 5 days

18 years agoAdd an rc.d script to start pfsync at the right moment of the
yar [Sun, 2 Oct 2005 18:59:02 +0000 (18:59 +0000)]
Add an rc.d script to start pfsync at the right moment of the
system boot, and hook it up in the system.

The separate script is needed because in the presence of various
interface lists in rc.conf ($network_interfaces, $cloned_interfaces,
$sppp_interfaces, $gif_interfaces, more to come) it is hard to start
them orderly, so that pfsync is brought up after its syncdev, which
is required for the proper startup of pfsync.

Discussed with: mlaier on -pf
MFC after: 5 days

18 years agoNew release notes:
hrs [Sun, 2 Oct 2005 16:14:41 +0000 (16:14 +0000)]
New release notes:
acpi_thermal(4) passive cooling support,
ichsmb(4) unloading bug fixed,
smbios(4) support on amd64,
hw.apic.enable_extint added,
sound(4) improvements,
MPSAFE: the bottom half of NFS, snd_als4000(4),
snd_cmi(4), snd_via8233(4), snd_via82c686(4),
and natm(4),
GEOM_ZERO class added,
umass(4) PLAY_* commands support,
moused(8) -H flag,
shared library version bump, and
pkg_version(1) -o and -O flags.

18 years ago* Fixed rate operation for es1370 chip to solve conflicting
netchild [Sun, 2 Oct 2005 15:56:36 +0000 (15:56 +0000)]
* Fixed rate operation for es1370 chip to solve conflicting
  sampling rate between playback and recording. This can be
  disabled / enabled via kernel hints
  (hint.pcm.<unit>.fixed_rate=0/4000-48000) or sysctl
  hw.snd.pcm<unit>.fixed_rate=0/4000-48000). Default to 48khz
  fixed rate. [1]
* Basic cleanup. *_es1371x_* -> *_es137x_*.
* Some locking fixes. [2]

Submitted by: Ariff Abdullah <skywizard@MyBSD.org.my>
Discussed with: yongari [2]
See also: http://lists.freebsd.org/pipermail/freebsd-multimedia/2005-September/002758.html [1]
Reported by: Jos Backus <jos at catnook.com> [1]

18 years agoUse rc.subr(8) appropriately:
yar [Sun, 2 Oct 2005 15:54:26 +0000 (15:54 +0000)]
Use rc.subr(8) appropriately:
- utilize default methods instead of rolling local ones;
- avoid to specify BEFORE conditions we don't really need
  (pflog will be REQUIRE'd by pf);
- omit extra decoration from warning messages, warn() will
  decorate them sufficiently.

18 years agoEmulate pcm mixer controller for any uaudio device without it.
netchild [Sun, 2 Oct 2005 15:51:19 +0000 (15:51 +0000)]
Emulate pcm mixer controller for any uaudio device without it.

Submitted by: Ariff Abdullah <skywizard@MyBSD.org.my>

18 years agoThe cmi9739_patch function which is referenced by ac97.c (rev. 1.56) now...
netchild [Sun, 2 Oct 2005 15:50:22 +0000 (15:50 +0000)]
The cmi9739_patch function which is referenced by ac97.c (rev. 1.56) now...

Submitted by: Ariff Abdullah <skywizard@MyBSD.org.my>
Pointy hat to: netchild (for not committing it with rev. 1.56 of ac97.c)

18 years agosys/dev/sound/pcm/sndstat.c:
netchild [Sun, 2 Oct 2005 15:43:57 +0000 (15:43 +0000)]
sys/dev/sound/pcm/sndstat.c:
   * General spl* cleanup. It doesn't serve any purpose anymore.
   * Nuke sndstat_busy(). Addition of sndstat_acquire() /
     sndstat_release() for sndstat exclusive access. [1]

sys/dev/sound/pcm/sound.c:
   * Remove duplicate SLIST_INIT()
   * Use sndstat_acquire() / release() to lock / release the entire
     sndstat during pcm_unregister(). This should fix LOR #159 [1]

sys/dev/sound/pcm/sound.h:
   * Definition of SD_F_SOFTVOL (part of feeder volume)
   * Nuke sndstat_busy(). Addition of sndstat_acquire() /
     sndstat_release() for exclusive sndstat access. [1]

Submitted by: Ariff Abdullah <skywizard@MyBSD.org.my>
LOR: 159 [1]
Discussed with: yongari [1]

18 years agoGeneral spl* cleanup. It doesn't serve any purpose anymore.
netchild [Sun, 2 Oct 2005 15:39:07 +0000 (15:39 +0000)]
General spl* cleanup. It doesn't serve any purpose anymore.

Submitted by: Ariff Abdullah <skywizard@MyBSD.org.my>

18 years agosys/dev/sound/pcm/ac97.c:
netchild [Sun, 2 Oct 2005 15:37:40 +0000 (15:37 +0000)]
sys/dev/sound/pcm/ac97.c:
   * Added codec id for CMI9761.
   * feeder_volume *whitelist* through ac97_fix_volume()

sys/dev/sound/pcm/ac97.h:
   * Added AC97_F_SOFTVOL definition.

sys/dev/sound/pcm/channel.c:
   * Slight changes for chn_setvolume() to conform with OSS.
   * FEEDER_VOLUME is now part of feeder building process.

sys/dev/sound/pcm/mixer.c:
   * General spl* cleanup. It doesn't serve any purpose anymore.
   * Main hook for feeder_volume.

Submitted by: Ariff Abdullah <skywizard@MyBSD.org.my>
Tested by: multimedia@

18 years agoSoft volume implementation for audio devices without pcm mixer controller.
netchild [Sun, 2 Oct 2005 15:31:03 +0000 (15:31 +0000)]
Soft volume implementation for audio devices without pcm mixer controller.

Submitted by: Ariff Abdullah <skywizard@MyBSD.org.my>
Tested by: multimedia@

18 years agoDocument that -q option is also applicable to the "change" command.
ru [Sun, 2 Oct 2005 12:55:34 +0000 (12:55 +0000)]
Document that -q option is also applicable to the "change" command.

PR: docs/85095
Submitted by: Rostislav Krasny

18 years agoAdd a DDB "traceall" function, which stack traces all known process
rwatson [Sun, 2 Oct 2005 11:41:12 +0000 (11:41 +0000)]
Add a DDB "traceall" function, which stack traces all known process
threads.  This is quite useful if generating a debug log for post-mortem
by another developer, in which case the person at the console may not
know which threads are of interest.  The output of this can be quite
long.

Discussed with: kris
MFC after: 3 days

18 years agoo Restore kerneldumpheader.architectureversion bytes swopping
maxim [Sun, 2 Oct 2005 11:31:45 +0000 (11:31 +0000)]
o Restore kerneldumpheader.architectureversion bytes swopping
mangled in rev. 1.72.

PR: bin/86805
Submitted by: Gavin Atkinson
MFC after: 3 days

18 years agoTwo fixes for the last commit.
glebius [Sun, 2 Oct 2005 10:57:33 +0000 (10:57 +0000)]
Two fixes for the last commit.

Submitted by: ru

18 years agoInclude kdb.h so that kdb_active is declared regardless of KDB being
rwatson [Sun, 2 Oct 2005 10:03:51 +0000 (10:03 +0000)]
Include kdb.h so that kdb_active is declared regardless of KDB being
included in the kernel.

MFC after: 0 days

18 years agoComplete removal of mac_create_root_mount/mpo_create_root_mount MAC
rwatson [Sun, 2 Oct 2005 09:53:00 +0000 (09:53 +0000)]
Complete removal of mac_create_root_mount/mpo_create_root_mount MAC
interfaces.

Obtained from: TrustedBSD Project
Submitted by: Chris Vance <Christopher dot Vance at SPARTA dot com>
MFC after: 3 days

18 years agoo Teach sysctl_drop() how to deal with the sockets in TIME_WAIT state.
maxim [Sun, 2 Oct 2005 08:43:57 +0000 (08:43 +0000)]
o Teach sysctl_drop() how to deal with the sockets in TIME_WAIT state.
This is a special case because tcp_twstart() destroys a tcp control
block via tcp_discardcb() so we cannot call tcp_drop(struct *tcpcb) on
such connections.  Use tcp_twclose() instead.

MFC after: 5 days

18 years agoAdd firewall-related xrefs to SEE ALSO.
yar [Sun, 2 Oct 2005 08:39:41 +0000 (08:39 +0000)]
Add firewall-related xrefs to SEE ALSO.

18 years agoAllow user to override default port numbers used by communication
bp [Sun, 2 Oct 2005 08:32:49 +0000 (08:32 +0000)]
Allow user to override default port numbers used by communication
protocols.  This is very useful for tunneled SMB connections.

MFC after: 4 weeks

18 years agoo Remove unfinished code and make it possible to override
maxim [Sun, 2 Oct 2005 07:03:00 +0000 (07:03 +0000)]
o Remove unfinished code and make it possible to override
bsdextended_script from rc.conf(5):

Not objected by: trhodes

18 years agoFixing WEP bustage in hostap mode since 5.2-RELEASE.
avatar [Sun, 2 Oct 2005 04:29:08 +0000 (04:29 +0000)]
Fixing WEP bustage in hostap mode since 5.2-RELEASE.

- WEP TX fix:

  The original code called software crypto, ieee80211_crypto_encap(),
which never worked since IEEE80211_KEY_SWCRYPT was never flagged due to
ieee80211_crypto_newkey() assumes that wi always supports hardware based
crypto regardless of operational mode(by virtue of IEEE80211_C_WEP).
This fix works around that issue by adding wi_key_alloc() to force
the use of s/w crypto.  Also if anyone ever decides to cleanup ioctl
handling where key changes wouldn't cause a call to wi_init() every time,
we'll need wi_key_alloc() to DTRT.

  In addition to that, this fix also adds code to wi_write_wep() to force
existing keys to be switched between h/w and s/w crypto such that an
operation mode change(sta <-> hostap) will flag IEEE80211_KEY_SWCRYPT
properly.

- WEP RX fix:

  Clear IEEE80211_F_DROPUNENC even in hostap mode.  Quote from Sam:

"This is really gross but I don't see an easy way around it.
By doing it we lose the ability to independently drop unencode
frames (and support mixed wep/!wep use).  We should really be
setting the EXCLUDE_UNENCRYPTED flag written in wi_write_wep
based on IEEE80211_F_DROPUNENC but with our clearing it we can't
depend on it being set properly."

Reported by: Holm Tiffe <holm at freibergnet dot de>
Submitted by: sam
MFC after: 3 days

18 years agoHonouring ic->ic_dtim_period.
avatar [Sun, 2 Oct 2005 03:55:07 +0000 (03:55 +0000)]
Honouring ic->ic_dtim_period.

Submitted by: sam
MFC after: 3 days

18 years agoFix the usage of rc_usage. The rc_usage function takes
yar [Sat, 1 Oct 2005 20:58:03 +0000 (20:58 +0000)]
Fix the usage of rc_usage.  The rc_usage function takes
a list of possible keywords, not all them in a single argument.
This also fixes the issue of extra delimiter characters appearing
on the help line from rc.d scripts not setting $extra_commands.

18 years agoNote that kern.polling.enable is deprecated.
glebius [Sat, 1 Oct 2005 20:53:51 +0000 (20:53 +0000)]
Note that kern.polling.enable is deprecated.

18 years agoSecond attempt at a work-around for fifo-related socket panics during
rwatson [Sat, 1 Oct 2005 20:15:41 +0000 (20:15 +0000)]
Second attempt at a work-around for fifo-related socket panics during
make -j with high levels of parallelism: acquire Giant in fifo I/O
routines.

Discussed with: ups
MFC after: 3 days

18 years agoMake sure the clone lists are sorted in the right order.
phk [Sat, 1 Oct 2005 19:21:03 +0000 (19:21 +0000)]
Make sure the clone lists are sorted in the right order.

Explosion triggered by: pjd
MFC: 3 days

18 years agoNow ifconfig is the one right way to turn polling on. Thus, remove
glebius [Sat, 1 Oct 2005 19:14:34 +0000 (19:14 +0000)]
Now ifconfig is the one right way to turn polling on. Thus, remove
the "if" clauses.

18 years agoCorrect previous commit to fix the sense of the TDP_NORUNNINGBUF
truckman [Sat, 1 Oct 2005 19:10:48 +0000 (19:10 +0000)]
Correct previous commit to fix the sense of the TDP_NORUNNINGBUF
check in ffs_copyonwrite() that is a precondition for calling
waitrunningbufspace().

Pointed out by: tegge
Pointy hat to: truckman
MFC after: 3 days

18 years ago- Catch up with the fact that HZ is 1000 now by default.
glebius [Sat, 1 Oct 2005 19:04:22 +0000 (19:04 +0000)]
- Catch up with the fact that HZ is 1000 now by default.
- Remove description of poll in trap feature.
- Tell that polling should be turned on and off with ifconfig.
- Move description of kern.polling.enable to the end and say
  that this a deprecated way of turning polling on.
- Remove note that idle poll has some problems in CURRENT. I failed
  to find them, while Sam and Luigi failed to remember what the
  problem actually were there.

18 years agoBig polling(4) cleanup.
glebius [Sat, 1 Oct 2005 18:56:19 +0000 (18:56 +0000)]
Big polling(4) cleanup.

o Axe poll in trap.

o Axe IFF_POLLING flag from if_flags.

o Rework revision 1.21 (Giant removal), in such a way that
  poll_mtx is not dropped during call to polling handler.
  This fixes problem with idle polling.

o Make registration and deregistration from polling in a
  functional way, insted of next tick/interrupt.

o Obsolete kern.polling.enable. Polling is turned on/off
  with ifconfig.

Detailed kern_poll.c changes:
  - Remove polling handler flags, introduced in 1.21. The are not
    needed now.
  - Forget and do not check if_flags, if_capenable and if_drv_flags.
  - Call all registered polling handlers unconditionally.
  - Do not drop poll_mtx, when entering polling handlers.
  - In ether_poll() NET_LOCK_GIANT prior to locking poll_mtx.
  - In netisr_poll() axe the block, where polling code asks drivers
    to unregister.
  - In netisr_poll() and ether_poll() do polling always, if any
    handlers are present.
  - In ether_poll_[de]register() remove a lot of error hiding code. Assert
    that arguments are correct, instead.
  - In ether_poll_[de]register() use standard return values in case of
    error or success.
  - Introduce poll_switch() that is a sysctl handler for kern.polling.enable.
    poll_switch() goes through interface list and enabled/disables polling.
    A message that kern.polling.enable is deprecated is printed.

Detailed driver changes:
  - On attach driver announces IFCAP_POLLING in if_capabilities, but
    not in if_capenable.
  - On detach driver calls ether_poll_deregister() if polling is enabled.
  - In polling handler driver obtains its lock and checks IFF_DRV_RUNNING
    flag. If there is no, then unlocks and returns.
  - In ioctl handler driver checks for IFCAP_POLLING flag requested to
    be set or cleared. Driver first calls ether_poll_[de]register(), then
    obtains driver lock and [dis/en]ables interrupts.
  - In interrupt handler driver checks IFCAP_POLLING flag in if_capenable.
    If present, then returns.This is important to protect from spurious
    interrupts.

Reviewed by: ru, sam, jhb

18 years agoCopy new process argument list in do_execve() before grabbing PROC_LOCK
truckman [Sat, 1 Oct 2005 08:33:56 +0000 (08:33 +0000)]
Copy new process argument list in do_execve() before grabbing PROC_LOCK
to avoid touching pageable memory while holding a mutex.

Simplify argument list replacement logic.

PR: kern/84935
Submitted by: "Antoine Pelisse" apelisse AT gmail.com (in a different form)
MFC after: 3 days

18 years agoUpdate for GNU cpio 2.6.
tjr [Sat, 1 Oct 2005 06:41:34 +0000 (06:41 +0000)]
Update for GNU cpio 2.6.

18 years agoMerge long_format() time formatting code and fixes for printf() format
tjr [Sat, 1 Oct 2005 06:37:41 +0000 (06:37 +0000)]
Merge long_format() time formatting code and fixes for printf() format
errors from old copyin.c.

18 years agoDefine HAVE_MKFIFO and HAVE_SETLOCALE here since the configure script
tjr [Sat, 1 Oct 2005 06:35:58 +0000 (06:35 +0000)]
Define HAVE_MKFIFO and HAVE_SETLOCALE here since the configure script
apparently fails to do it.

18 years agoMerge from old copyout.c rev 1.2: Output a zero rdev except for bdevs,
tjr [Sat, 1 Oct 2005 06:09:55 +0000 (06:09 +0000)]
Merge from old copyout.c rev 1.2: Output a zero rdev except for bdevs,
cdevs, fifos and sockets. Don't output a file if the major, minor or
totality of its rdev would be truncated.

18 years agoMerge from old copypass.c rev 1.3: If we must yell at the user than a
tjr [Sat, 1 Oct 2005 05:54:39 +0000 (05:54 +0000)]
Merge from old copypass.c rev 1.3: If we must yell at the user than a
file cannot be linked into place when requested (not required) to do it,
reassure them that cpio is still intelligent enough that it will perform
a full copy instead.

18 years agoMerge from old util.c rev 1.2: say "volume" instead of "tape".
tjr [Sat, 1 Oct 2005 05:52:40 +0000 (05:52 +0000)]
Merge from old util.c rev 1.2: say "volume" instead of "tape".

18 years agoMerge from old main.c rev 1.2: Don't set the umask until after we have
tjr [Sat, 1 Oct 2005 05:49:29 +0000 (05:49 +0000)]
Merge from old main.c rev 1.2: Don't set the umask until after we have
processed the arguments and opened the archive file.

18 years agoMerge from old tar.c rev 1.2: Recognize and skip 'x' and 'g' pax
tjr [Sat, 1 Oct 2005 05:42:44 +0000 (05:42 +0000)]
Merge from old tar.c rev 1.2: Recognize and skip 'x' and 'g' pax
extension entries.

18 years agoMerge from old copyin.c rev 1.5, copypass.c rev 1.2: Create fifos using
tjr [Sat, 1 Oct 2005 05:36:39 +0000 (05:36 +0000)]
Merge from old copyin.c rev 1.5, copypass.c rev 1.2: Create fifos using
mkfifo() instead of attempting to create them using mknod().

18 years agoUpdate for GNU cpio 2.6.
tjr [Sat, 1 Oct 2005 04:57:01 +0000 (04:57 +0000)]
Update for GNU cpio 2.6.

18 years agoRename isnumber() to cpio_isnumber() to avoid clashing with the
tjr [Sat, 1 Oct 2005 04:56:09 +0000 (04:56 +0000)]
Rename isnumber() to cpio_isnumber() to avoid clashing with the
<ctype.h> library function of the same name.

18 years agoRemove files no longer present in GNU cpio distribution. Most of these
tjr [Sat, 1 Oct 2005 04:47:43 +0000 (04:47 +0000)]
Remove files no longer present in GNU cpio distribution. Most of these
were actually moved into subdirectories.

18 years agoThis commit was generated by cvs2svn to compensate for changes in r150765,
tjr [Sat, 1 Oct 2005 04:37:08 +0000 (04:37 +0000)]
This commit was generated by cvs2svn to compensate for changes in r150765,
which included commits to RCS files with non-trunk default branches.

18 years agoImport GNU cpio 2.6 (trimmed)
tjr [Sat, 1 Oct 2005 04:37:08 +0000 (04:37 +0000)]
Import GNU cpio 2.6 (trimmed)

18 years agoAllow the root user to be aware of other credentials by virtue
trhodes [Fri, 30 Sep 2005 23:41:10 +0000 (23:41 +0000)]
Allow the root user to be aware of other credentials by virtue
of privilege.

Submitted by: rwatson

18 years agoUse ansi function definitions in preference to K&R to reduce diffs
imp [Fri, 30 Sep 2005 19:39:27 +0000 (19:39 +0000)]
Use ansi function definitions in preference to K&R to reduce diffs
with NetBSD (and cause it looks cooler).

18 years agoNot sporttings on other cards
imp [Fri, 30 Sep 2005 19:35:44 +0000 (19:35 +0000)]
Not sporttings on other cards

18 years agoThe NWFS code in RELENG_6 is broken due to a typo in
phk [Fri, 30 Sep 2005 18:21:05 +0000 (18:21 +0000)]
The NWFS code in RELENG_6 is broken due to a typo in
sys/fs/nwfs/nwfs_vfsop= s.c, introduced with the conversion to
nmount with revision 1.38. This causes mount_nwfs to fail with
the error message:

  mount_nwfs: mount error: /mnt/netware: syserr = No such file or directo=
ry

This is caused by a typo on line 178, which specifies "nwfw_args"
rather than "nwfs_args".

Submitted by: Antony Mawer <gnats@mawer.org>
Fat fingers: phk
PR: 86757
MFC: 3 days

18 years agoUn-staticize waitrunningbufspace() and call it before returning from
truckman [Fri, 30 Sep 2005 18:07:41 +0000 (18:07 +0000)]
Un-staticize waitrunningbufspace() and call it before returning from
ffs_copyonwrite() if any async writes were launched.

Restore the threads previous TDP_NORUNNINGBUF state before returning
from ffs_copyonwrite().

18 years agoMove some devstat collection to below where large IO operations are chopped
tegge [Fri, 30 Sep 2005 17:32:08 +0000 (17:32 +0000)]
Move some devstat collection to below where large IO operations are chopped
up.  This make iostat report operations passed down to the device driver
instead of operations passed down to GEOM disk.  The transfer size limit
imposed by the device driver is no longer hidden, improving the correlation
between iostat output and device driver workload.

18 years agoA minor overhaul: added comments, split cmds in 2, changed synopsis.
garys [Fri, 30 Sep 2005 17:31:39 +0000 (17:31 +0000)]
A minor overhaul: added comments, split cmds in 2, changed synopsis.

Split commands into two groups: one with optional count and one with
required argument.  Changed synopsis line accordingly.

Added some hopefully-helpful comments based on experiments, knowing
that not all hardware works the same.

PR:             docs/84101
Approved by:    keramida
MFC after:      3 days

18 years agociphy wasn't included here.
imp [Fri, 30 Sep 2005 14:54:17 +0000 (14:54 +0000)]
ciphy wasn't included here.

18 years agoAdd a more generic version of the mii_phy_match routine (mii_phy_match_gen)
imp [Fri, 30 Sep 2005 14:51:44 +0000 (14:51 +0000)]
Add a more generic version of the mii_phy_match routine (mii_phy_match_gen)
which can be used for phy that want to piggy back other data with their
table.

18 years agoAdd macros which follow the miidevs design pattern to make it easier
imp [Fri, 30 Sep 2005 14:45:10 +0000 (14:45 +0000)]
Add macros which follow the miidevs design pattern to make it easier
to construct tables for mii_phy_match.

18 years agoUse hw.machine_arch instead of hw.machine.
nyan [Fri, 30 Sep 2005 13:27:36 +0000 (13:27 +0000)]
Use hw.machine_arch instead of hw.machine.

18 years agoMFi386: revision 1.33.
nyan [Fri, 30 Sep 2005 13:24:14 +0000 (13:24 +0000)]
MFi386: revision 1.33.
  > Cause all flags passed by boot2 to set the respective loader(8)
  > boot_* variable.  The end effect is that all flags from boot2
  > are now passed to the kernel.

18 years agoUse 'PC Card'
nyan [Fri, 30 Sep 2005 13:17:54 +0000 (13:17 +0000)]
Use 'PC Card'

18 years agoReport any errors we might see when disabling the watchdog.
phk [Fri, 30 Sep 2005 08:30:20 +0000 (08:30 +0000)]
Report any errors we might see when disabling the watchdog.

Complain about extra arguments so people don't get surprised
if they type "watchdog 0"

18 years agoFox a LOR of sleep and sched_lock by using a timeout wait
davidxu [Fri, 30 Sep 2005 06:09:41 +0000 (06:09 +0000)]
Fox a LOR of sleep and sched_lock by using a timeout wait
when process reaches maximum number of threads.

MFC after: 3 days

18 years agoGive .Dd a tummy rub, forgotten on my last commit.
dougb [Fri, 30 Sep 2005 02:12:15 +0000 (02:12 +0000)]
Give .Dd a tummy rub, forgotten on my last commit.

18 years agoUn-staticize runningbufwakeup() and staticize updateproc.
truckman [Fri, 30 Sep 2005 01:30:01 +0000 (01:30 +0000)]
Un-staticize runningbufwakeup() and staticize updateproc.

Add a new private thread flag to indicate that the thread should
not sleep if runningbufspace is too large.

Set this flag on the bufdaemon and syncer threads so that they skip
the waitrunningbufspace() call in bufwrite() rather than than
checking the proc pointer vs. the known proc pointers for these two
threads.  A way of preventing these threads from being starved for
I/O but still placing limits on their outstanding I/O would be
desirable.

Set this flag in ffs_copyonwrite() to prevent bufwrite() calls from
blocking on the runningbufspace check while holding snaplk.  This
prevents snaplk from being held for an arbitrarily long period of
time if runningbufspace is high and greatly reduces the contention
for snaplk.  The disadvantage is that ffs_copyonwrite() can start
a large amount of I/O if there are a large number of snapshots,
which could cause a deadlock in other parts of the code.

Call runningbufwakeup() in ffs_copyonwrite() to decrement runningbufspace
before attempting to grab snaplk so that I/O requests waiting on
snaplk are not counted in runningbufspace as being in-progress.
Increment runningbufspace again before actually launching the
original I/O request.

Prior to the above two changes, the system could deadlock if enough
I/O requests were blocked by snaplk to prevent runningbufspace from
falling below lorunningspace and one of the bawrite() calls in
ffs_copyonwrite() blocked in waitrunningbufspace() while holding
snaplk.

See <http://www.holm.cc/stress/log/cons143.html>

18 years agoFor the sake of consistency and easier typing,
yar [Thu, 29 Sep 2005 23:53:29 +0000 (23:53 +0000)]
For the sake of consistency and easier typing,
introduce "-tunnel" as an alias for "deletetunnel".
The latter is overly long and prone to typos,  but
keep it for POLA since it costs nothing.

MFC after: 5 days

18 years agoForgot to touch .Dd in the previous commit.
yar [Thu, 29 Sep 2005 23:39:37 +0000 (23:39 +0000)]
Forgot to touch .Dd in the previous commit.

18 years agoDeprecate the useless argument to -vlandev.
yar [Thu, 29 Sep 2005 23:38:24 +0000 (23:38 +0000)]
Deprecate the useless argument to -vlandev.

Submitted by: Fredrik Lindberg <fli+freebsd-current at shapeshifter.se> (implementation)
Reviewed by: brooks
MFC after: 5 days

18 years ago- Fix "end_blk out of range" panic when INVARIANTS.
fjoe [Thu, 29 Sep 2005 22:45:16 +0000 (22:45 +0000)]
- Fix "end_blk out of range" panic when INVARIANTS.
- Do not allow rw access.

Submitted by: Dario Freni <saturnero at freesbie dot org>
MFC after: 3 days

18 years agoUse mkuzip(8) instead of create_compressed_fs.
fjoe [Thu, 29 Sep 2005 22:41:20 +0000 (22:41 +0000)]
Use mkuzip(8) instead of create_compressed_fs.

18 years agoAfter a rmdir()ed directory has been truncated, force an update of
truckman [Thu, 29 Sep 2005 21:50:26 +0000 (21:50 +0000)]
After a rmdir()ed directory has been truncated, force an update of
the directory's inode after queuing the dirrem that will decrement
the parent directory's link count.  This will force the update of
the parent directory's actual link to actually be scheduled.  Without
this change the parent directory's actual link count would not be
updated until ufs_inactive() cleared the inode of the newly removed
directory, which might be deferred indefinitely.  ufs_inactive()
will not be called as long as any process holds a reference to the
removed directory, and ufs_inactive() will not clear the inode if
the link count is non-zero, which could be the result of an earlier
system crash.

If a background fsck is run before the update of the parent directory's
actual link count has been performed, or at least scheduled by
putting the dirrem on the leaf directory's inodedep id_bufwait list,
fsck will corrupt the file system by decrementing the parent
directory's effective link count, which was previously correct
because it already took the removal of the leaf directory into
account, and setting the actual link count to the same value as the
effective link count after the dangling, removed, leaf directory
has been removed.  This happens because fsck acts based on the
actual link count, which will be too high when fsck creates the
file system snapshot that it references.

This change has the fortunate side effect of more quickly cleaning
up the large number dirrem structures that linger for an extended
time after the removal of a large directory tree.  It also fixes a
potential problem with the shutdown of the syncer thread timing out
if the system is rebooted immediately after removing a large directory
tree.

Submitted by: tegge
MFC after: 3 days

18 years agoDon't build pccardd anymore.
imp [Thu, 29 Sep 2005 21:32:57 +0000 (21:32 +0000)]
Don't build pccardd anymore.

18 years agoFix bad compile. Pointy hat to: imp
imp [Thu, 29 Sep 2005 20:41:04 +0000 (20:41 +0000)]
Fix bad compile.  Pointy hat to: imp