kmacy [Tue, 26 Dec 2006 02:48:42 +0000 (02:48 +0000)]
turn non-INVARIANT KASSERT into an empty but real C
statement so that syntax errors will still be caught
even if INVARIANTS aren't enabled in the config file
ru [Mon, 25 Dec 2006 08:59:09 +0000 (08:59 +0000)]
Pull up current -mdoc version from vendor.
- New Darwin, FreeBSD, and NetBSD versions.
- DragonFly support including the new .Dx macro.
- New .St strings: -isoC-amd1, -isoC-tcor1, -isoC-tcor2, and -ieee1275-94.
jkoshy [Mon, 25 Dec 2006 02:22:22 +0000 (02:22 +0000)]
Keep shadow copies of the `e_shnum', `e_phnum' and `e_shstrndx'
members of the ELF Executable Header inside the library-private
`struct _Elf' descriptor and only update the underlying Elf{32,64}_Ehdr
structure on an elf_update(3) call. These fields of the Ehdr
structure are technically `out of bounds' for an application program
per the ELF(3) API, but we've seen applications that initialize
a new Ehdr structure using memcpy(), messing up the library's
invariants. [1]
Implement elf_getphnum() and handle ELF objects with more than
64K program header table entries.
jkoshy [Mon, 25 Dec 2006 02:06:32 +0000 (02:06 +0000)]
Use strncpy() instead of strlcpy() when copying members of
a `struct ar_hdr'. These members do not use NUL-termination
while strlcpy() expects its source buffer to be NUL-terminated.
marius [Sun, 24 Dec 2006 22:24:39 +0000 (22:24 +0000)]
Fix a typo in __fpu_ftox() that caused long double to long (and long long)
conversion of negative numbers to always result in -1.
While at it, rearrange the nearby comment so it fits in 80 chars per line,
like the rest of this file does.
yar [Sun, 24 Dec 2006 08:52:13 +0000 (08:52 +0000)]
Note that rev. 1.221 introduced a local workaround for a general problem.
Add a pointer to the relevant PR for future reference. The whole comment
will be OK to remove as soon as the general solution is applied.
kmacy [Sun, 24 Dec 2006 08:03:27 +0000 (08:03 +0000)]
- remove all calls to sched_pin and sched_unpin as they are only useful to
pmap on i386
- check for change in executable status in pmap_enter
- pmap_qenter and pmap_qremove only need to invalidate the range if one
of the pages has been referenced
- remove pmap_kenter/pmap_kremove as they were only used by pmap_qenter
and pmap_qremove
- in pmap_copy don't copy wired bit to destination pmap
- mpte was unused in pmap_enter_object - remove
- pmap_enter_quick_locked is not called on the kernel_pmap, remove check
- move pmap_remove_write specific logic out of tte_clear_phys_bit
- in pmap_protect check for removal of execute bit
- panic in the presence of a wired page in pmap_remove_all
- pmap_zero_range can call hwblkclr if offset is zero and size is PAGE_SIZE
- tte_clear_virt_bit is only used by pmap_change_wiring - thus it can be
greatly simplified
- pmap_invalidate_page need only be called in tte_clear_phys_bit if there
is a match with flags
- lock the pmap in tte_clear_phys_bit so that clearing the page bits is
atomic with invalidating the page
- these changes result in 100s reduction in buildworld from a malloc backed
disk to a malloc backed disk - ~2.5%
yar [Sat, 23 Dec 2006 18:54:49 +0000 (18:54 +0000)]
Dynamically resize the Disk column. It was too narrow for modern
disk device names such as da0s1b. So we also get rid of the nasty
constant 5 scattered over the code.
Implementing this change is a good chance to improve other bits
around it: init saved lengths early, always check return value from
kvm_getswapinfo().
alfred [Sat, 23 Dec 2006 17:18:18 +0000 (17:18 +0000)]
Fix a deadlock in detach/shutdown.
The problem was that I was acquiring the driver sx lock and then waiting
for a taskqueue to drain, however the taskqueue itself would try to
acquire the lock as well leading to a deadlock.
To fix the problem roll my own exclusive lock that allows for lock
cancellation. This is a normal exclusive lock, however if someone
marks it as "dead" then all waiters who request an error return will
get back an error instead of continuing to wait for the lock.
In this particular case, the shutdown and detach functions kill the
lock while the async task thread tries to acquire the lock but will
abort if the lock returns an error.
The other option was to drop the driver lock mid-detach and mid-shutdown,
mid-detach was a ok, however mid-shutdown was not.
While I'm here, fix a bug in what appears to be the mii link status
word in the softc going out to lunch. Explicitly set the status
word to 1 after initializing the mii. This would result in an interface
that would never respond to "if_start" requests as the mii interface
would always look down.
yar [Sat, 23 Dec 2006 15:40:41 +0000 (15:40 +0000)]
Fix the swap display further:
1) Resize the Used column to avoid screen overflow if BLOCKSIZE is long.
2) Track the current swap configuration so that its changes don't break
the display.
yar [Sat, 23 Dec 2006 14:25:17 +0000 (14:25 +0000)]
Start fixing the "swap" display by saving one horizontal position.
Now the display won't overflow the 80-char row if BLOCKSIZE=1024.
The new spacing is also consistent with the "pigs" display.
davidxu [Sat, 23 Dec 2006 03:30:50 +0000 (03:30 +0000)]
Fix a panic when rebooting a SMP machine, when option STOP_NMI is used,
nmi handler is used to stop other processors, nmi hander calls trap(),
however, trap() now accepts a pointer rather than a reference, this was
changed by kmacy@.
jasone [Sat, 23 Dec 2006 00:18:51 +0000 (00:18 +0000)]
Implement chunk allocation/deallocation hysteresis by caching one spare
chunk per arena, rather than immediately deallocating all unused chunks.
This fixes a potential performance issue when allocating/deallocating
an object of size (4kB..1MB] in a loop.
rwatson [Fri, 22 Dec 2006 23:36:13 +0000 (23:36 +0000)]
Forced commit to recognize the repo-copy of vfs_syscalls.c to
vfs_extattr.c. This follows a naming convention similar to the break-out
of the extended attribute system calls (etc) in NetBSD.
rwatson [Fri, 22 Dec 2006 23:34:47 +0000 (23:34 +0000)]
Move src/sys/sys/mac_policy.h, the kernel interface between the MAC
Framework and security modules, to src/sys/security/mac/mac_policy.h,
completing the removal of kernel-only MAC Framework include files from
src/sys/sys. Update the MAC Framework and MAC policy modules. Delete
the old mac_policy.h.
Third party policy modules will need similar updating.
imp [Fri, 22 Dec 2006 05:54:19 +0000 (05:54 +0000)]
Avoid 'bogus' uninitialized warning by initializing rather than
playing cute games. It is much simpler, clearer and easier to follow
and understand. Besides, gcc4 likes it better.
imp [Fri, 22 Dec 2006 00:57:26 +0000 (00:57 +0000)]
ACPIIO_BATT_GET_UNITS would always return ENXIO. However, it should never
return an error since it returns a count of battery devices in the system.
Set it to 0 explicitly, since it is the only switch branch that doesn't set
it.
yar [Thu, 21 Dec 2006 21:35:49 +0000 (21:35 +0000)]
Allow this module to get its options from the kernel build directory
instead of always hard coding them in CFLAGS. POLA is kept here:
The module file built with GENERIC stays the same.
rrs [Thu, 21 Dec 2006 19:58:04 +0000 (19:58 +0000)]
The prepend function did not handle non-pkthdr's correctly.
It always called MH_ALIGN for small lengths being
prepended (less than MHLEN). This meant that if you did
a prepend on a non M_PKTHDR the system would panic with
the KASSERT in MH_ALIGN. Instead we are not aware of
this and do a MH_ALIGN or M_ALIGN as appropriate.
ceri [Thu, 21 Dec 2006 19:08:25 +0000 (19:08 +0000)]
Correct the description of minpoll and maxpoll.
Note that while later versions of the ntpd documentation use the term
"dual logarithm", the text added here is consistent with the remainder
of the current document.
rwatson [Thu, 21 Dec 2006 09:51:34 +0000 (09:51 +0000)]
Remove mac_enforce_subsystem debugging sysctls. Enforcement on
subsystems will be a property of policy modules, which may require
access control check entry points to be invoked even when not actively
enforcing (i.e., to track information flow without providing
protection).
Obtained from: TrustedBSD Project
Suggested by: Christopher dot Vance at sparta dot com
marcel [Thu, 21 Dec 2006 05:40:46 +0000 (05:40 +0000)]
Unbreak 64-bit little-endian systems that do require alignment.
The fix involves using le16dec(), le32dec(), le16enc() and
le32enc(). This eliminates invalid casts and duplicated logic.
rwatson [Wed, 20 Dec 2006 23:41:59 +0000 (23:41 +0000)]
Comment LABEL_TO_SLOT() macro, including observing that we'd like to improve
this policy API to avoid encoding struct label binary layout in policy
modules.