thompsa [Sun, 23 Oct 2005 22:30:07 +0000 (22:30 +0000)]
If we have been called from ether_ifdetach() then do not try and clear the
promisc flag from the member interface, this is a no-op anyway since the
interface is disappearing. The driver may have already released
its resources such as miibus and this is likely to panic the kernel.
Submitted and tested by: Wojciech A. Koszek
MFC after: 2 weeks
csjp [Sun, 23 Oct 2005 16:15:02 +0000 (16:15 +0000)]
Restore the documentation about uid, gid or prison based rules requiring
that debug.mpsafenet be set to 0. It is still possible for dead locks to
occur while these filtering options are used due to the layering violation
inherent in their implementation.
yar [Sun, 23 Oct 2005 14:06:53 +0000 (14:06 +0000)]
Don't be lazy, set the "command" variable even if
/etc/defaults/rc.conf will provide foo_program, too.
By specifying "command" we explicitly say that we're
going to rely on rc.subr(8) default methods, and
rc.subr(8) will take advantage of this soon.
The majority of our rc.d scripts already set "command"
if appropriate, so fix just the non-compliant handful.
alc [Sun, 23 Oct 2005 07:41:56 +0000 (07:41 +0000)]
Previously, nothing prevented the page that was returned by pmap_extract()
from being reclaimed before it was wired. Use pmap_extract_and_hold()
instead of pmap_extract() and retain the hold on the page until it has been
wired.
davidxu [Sun, 23 Oct 2005 05:36:41 +0000 (05:36 +0000)]
Change _POSIX_REALTIME_SIGNALS to 200112L to indicates we support
realtime signals. Define missing _POSIX_TIMERS, it will be changed to
200112L once struct sigevent is fixed.
davidxu [Sun, 23 Oct 2005 04:22:56 +0000 (04:22 +0000)]
Implement POSIX timers. Current only CLOCK_REALTIME and CLOCK_MONOTONIC
clock are supported. I have plan to merge XSI timer ITIMER_REAL and other
two CPU timers into the new code, current three slots are available for
the XSI timers.
The SIGEV_THREAD notification type is not supported yet because our
sigevent struct lacks of two member fields:
sigev_notify_function
sigev_notify_attributes
I have found the sigevent is used in AIO, so I won't add the two members
unless the AIO code is adjusted.
davidxu [Sun, 23 Oct 2005 04:12:26 +0000 (04:12 +0000)]
1. Make ksiginfo_alloc and ksiginfo_free public.
2. Introduce flags KSI_EXT and KSI_INS. The flag KSI_EXT allows a ksiginfo
to be managed by outside code, the KSI_INS indicates sigqueue_add should
directly insert passed ksiginfo into queue other than copy it.
csjp [Sun, 23 Oct 2005 01:44:08 +0000 (01:44 +0000)]
Before we export network interface data through the ifmibdata structure,
OR the flags bits with the driver managed status flags. This fixes an
issue where RUNNING flags would not be reported to processes, which
conflicts with the flags information provided by ifconfig(8).
njl [Sun, 23 Oct 2005 00:28:39 +0000 (00:28 +0000)]
Add a hack to get around PCI link devices that report "present" but not
"functional" (i.e., if they are disabled). We should probe them anyway
since we may enable them later.
njl [Sun, 23 Oct 2005 00:20:13 +0000 (00:20 +0000)]
Import ACPI smart battery support. Newer systems (Acer, mostly) do not
support the CM-battery interface. Smart batteries can eventually be
supported without ACPI via a separate SMBus interface. The ACPI interface
uses the embedded controller for reading/writing to the SMBus, and normal
ASL definitions for locating the battery controller (since SMBus can't be
enumerated.) Also import definitions for the smart battery interface.
This was written by Hans Petter Selasky with minor cleanups from myself.
Submitted by: Hans Petter Selasky <hselasky / c2i.net>
njl [Sun, 23 Oct 2005 00:16:41 +0000 (00:16 +0000)]
Cleanups and support code for importing smart battery support.
* Use ACPI_BATT_UNKNOWN instead of constants
* Use maxunit instead of a count of devices since we may have sparse
battery devices in the future. Only userland should be using unit
numbers anyway, so provide a translation function. (Kernel use of
batteries should be restricted to looking up a device_t and calling
methods directly.
* Don't check acpi_BatteryIsPresent() in acpi_battery. Leave it up to
the hardware-specific driver (i.e. cmbat) since smart batteries seem
to not report the "battery present" flag.
* Convert mA to mW if the battery uses those units. CM-batteries only
used mW so this deficiency went unnoticed.
* Clean strings reported in the battery info from any control chars.
* Only dereference the unit from ioctl_arg if the full struct is present.
Unit wouldn't have been used later if it wasn't present but this is
cleaner. Translate the unit if it's not ACPI_BATTERY_ALL_UNITS.
* bzero structs before returning them to usermode for future compat.
Most of this work was submitted by Hans Petter Selasky and then majorly
reworked by myself.
Submitted by: Hans Petter Selasky <hselasky / c2i.net>
alc [Sat, 22 Oct 2005 18:46:38 +0000 (18:46 +0000)]
Use of the ZERO_COPY_SOCKETS options can result in an unusual state that
vm_object_backing_scan() was not written to handle. Specifically, a wired
page within a backing object that is shadowed by a page within the shadow
object. Handle this state by removing the wired page from the backing
object. The wired page will be freed by socow_iodone().
Stop masking errors: If a page is being freed by vm_object_backing_scan(),
assert that it is no longer mapped rather than quietly destroying any
mappings.
imp [Sat, 22 Oct 2005 07:26:05 +0000 (07:26 +0000)]
Turns out that we're asking for the MAC address at a bad time in the
attach routine. Go ahead and ask for it in the probe routine and be
just as wrong as all the other cards that ask for it there...
# this gets the RTL8019 on a SBC at work fully functional. 6.0 still treats
# the 8019 as a generic NE-2000, so these changes aren't relevant there.
wpaul [Sat, 22 Oct 2005 05:15:20 +0000 (05:15 +0000)]
Make the multiple DPC threads an option, and create only one by default.
This avoids the need for sched_bind() in the default case so that you
can start up the NDIS subsystem at boot time when only CPU 0 is running.
There are potentially ways to fix it so that the DPC threads aren't
started until after the other CPUs are launched, but doing it correctly
is tricky. You need to defer the startup of the ntoskrnl subsystem
(ntoskrnl_libinit()), not just defer ndis_attach().
For now, I don't think it will make much difference having just the
single DPC thread (I started out with just one anyway). Note that this
turns the KeSetTargetProcessorDpc() routine into a no-op, since the
CPU number in struct kdpc is now ignored.
imp [Sat, 22 Oct 2005 05:14:18 +0000 (05:14 +0000)]
In the ISA case, we call ed_probe_WD80x3 before we call
ed_probe_rtl80x9. In the pci case we call ed_probe_rtl80x9 first. In
the PCI case we were using the correct nic_offset by accident because
softc is initialized to zero. In the isa case we were using the wrong
value by accident, since ed_probe_WD80x3 sets the offset value to
0x10. This lead to the identification routines failing. Fix this
problem by always initalizing the nic_offset and asic_offset before
making ed_{asic,nic}_{in,out}* calls.
ade [Fri, 21 Oct 2005 19:42:43 +0000 (19:42 +0000)]
Specifically panic() in the case where pmap_insert_entry() fails to
get a new pv under high system load where the available pv entries
have been exhausted before the pagedaemon has a chance to wake up
to reclaim some.
Prior to this, the NULL pointer dereference ended up causing
secondary panics with rather less than useful resulting tracebacks.
dumbbell [Fri, 21 Oct 2005 09:15:26 +0000 (09:15 +0000)]
Apply the same fix to a potential race in the ISDOTDOT code
in reiserfs_lookup() that was used to fix an actual race in
ufs_lookup.c:1.78. This is not currently a hazard, but the
bug would be activated by marking reiserfs as MPSAFE.
wpaul [Fri, 21 Oct 2005 05:23:20 +0000 (05:23 +0000)]
Correct the macro definition for KeRaiseIrql(). The official API
is KeRaiseIrql(newirql, &oldirql), not oldirql = KeRaiseIrql(newirql).
(The macro ultimately translates to KfRaiseIrql() which does use
the latter API, so this has no effect on generated code.)
Also, wait for thread termination the right way: kthread_exit()
will ultimately do a wakeup(td->td_proc). This is the event we
should wait on. Eliminate the previous synchronization machinery
for this since it was never guaranteed to work correctly.
njl [Fri, 21 Oct 2005 01:54:00 +0000 (01:54 +0000)]
Adjust maxfilesize for UFS1 and old 4.4 FFS. For UFS1, increase the limit
to (max block - 1) * bsize. For DEV_BSIZE, this doubles the limit from
0.5 TB to 1 TB. For the old 4.4 FFS case, decrease the limit from 0.5 TB
to 2 GB - 1. Older systems had a 32 bit off_t so they couldn't access the
larger files anyway.
brooks [Thu, 20 Oct 2005 19:23:16 +0000 (19:23 +0000)]
Mention the possibility of non-interactive scripts for EDITOR and add a
BUGS section mentioning the requirement that such scripts run "sleep 1"
or equivalent to work reliably.
wpaul [Thu, 20 Oct 2005 17:45:58 +0000 (17:45 +0000)]
Use sched_bind() to make sure the DPC threads are bound to the correct
processor, to insure DPC thread 0 runs on CPU0, DPC thread 1 runs on
CPU1, and so on.
Elevate the priority of the workitem threads, though don't use as
high a priority as the DPC threads.
rwatson [Thu, 20 Oct 2005 17:41:47 +0000 (17:41 +0000)]
Add a "show malloc" command to DDB, which prints out the current stats for
available kernel malloc types. Quite useful for post-mortem debugging of
memory leaks without a dump device configured on a panicked box.
rwatson [Thu, 20 Oct 2005 16:39:33 +0000 (16:39 +0000)]
Add a "show uma" command to DDB, which prints out the current stats for
available UMA zones. Quite useful for post-mortem debugging of memory
leaks without a dump device configured on a panicked box.
wpaul [Thu, 20 Oct 2005 16:31:54 +0000 (16:31 +0000)]
Import a fixed version of driver_ndis.c from the vendor. The existing
version has a bug where it fails to properly cancel the polling loop
that periodically queries the BSSID (this is done to detect the
association/disassociation state). The timeout is supposed to fire
once a second, but the eloop_cancel_timeout() call uses a different
'user data' value than what was passed to eloop_register_timeout(),
so cancelling the timeouts fails. This results in an additional timeout
being created each time an EAPOL packet is received, which can lead
to dozens of unwanted timeouts firing every second instead of just one.
marius [Thu, 20 Oct 2005 11:14:34 +0000 (11:14 +0000)]
Use an ihandle_t to store the instance handle of an opened device
instead of a phandle_t (package handle). Since both are typedefed
to unsigned int, this is more or less cosmetic.
glebius [Thu, 20 Oct 2005 09:55:49 +0000 (09:55 +0000)]
Some more minor cleanups of em(4) driver:
- Destroy mutex in case of attach failure. [1]
- Lock properly em_watchdog(). [1]
- Lock properly em_sysctl_int_delay(). [1]
- Remove unused global adapter linked list.
- Remove unused dma_size field from struct em_dma_alloc.
- Do not touch interface statistics, that must be edited
only by upper layers. [1]
glebius [Thu, 20 Oct 2005 08:46:43 +0000 (08:46 +0000)]
Revamp interrupt handling in em(4) driver:
o Do not mask the RX overrun interrupt.
o Rewrite em_intr():
- Axe EM_MAX_INTR.
- Cycle acknowledging interrupts and processing
packets until zero interrupt cause register is
read.
- If RX overrun comes in log this fact. [ NetBSD also
resets adapter in this case, but my tests showed that
this is not needed and only pessimizes behavior under
heavy load. ]
- Since almost all functions is rewritten, style the
remaining lines.
This fixes em(4) interfaces wedging under high load.
In collaboration with: wpaul, cognet
Obtained from: NetBSD
peter [Thu, 20 Oct 2005 05:41:38 +0000 (05:41 +0000)]
Fix a well duplicated fencepost error that stopped crashdumps being
readable on certain random memory configurations. If the libkvm consumer
tried to read something that was in the very last pdpe, pde or pte slot,
it would bogusly fail.
njl [Thu, 20 Oct 2005 05:12:20 +0000 (05:12 +0000)]
Set the signal handlers before creating the thread. This is so it inherits
the parent's signal mask. Once daemon() forked, signals would be ignored
in the child thread. While I'm here, check the return value of daemon().
This fixes termination in the daemon case (bug introduced in last commit).
jdp [Wed, 19 Oct 2005 20:40:30 +0000 (20:40 +0000)]
Fix a bug in the kernel module runtime linker that made it impossible
to unload the usb.ko module after boot if it was originally preloaded
from "/boot/loader.conf". When processing preloaded modules, the
linker erroneously added self-dependencies the each module's reference
count. That prevented usb.ko's reference count from ever going to 0,
so it could not be unloaded.
suz [Wed, 19 Oct 2005 16:43:57 +0000 (16:43 +0000)]
sync with KAME regarding the following clarification in RFC3542:
- disable IPv6 operation if DAD fails for some EUI-64 link-local addresses.
- export get_hw_ifid() (and rename it) as a subroutine for this process.