rrs [Sun, 6 Jun 2010 16:11:16 +0000 (16:11 +0000)]
1) Further enhance the INVARIANT lock validation (no locks) are
held by checking the create and inp locks as well.
2) Fix a bug in that when a socket is closed an INIT-ACK
is returned, we do NOT unlock the locked_tcb unless its
different (an unlikely scenario). If we blindly unlock as
we were doing before we can end up unlocking the actual
stcb thats about to be sent down to the free function which
requires the lock be held.
rrs [Sun, 6 Jun 2010 16:09:12 +0000 (16:09 +0000)]
Fix a bug in the sctp_inpcb_free. Basically if the socket
was setup to do an abortive close an association that was
in the accept_queue could get stuck and never freed. Now
we properly start the kill timer on the socket and turn
off the flag (same thing we do for the graceful close method).
MFC after: 1 week
rrs [Sun, 6 Jun 2010 16:07:40 +0000 (16:07 +0000)]
Fix a bug in sctp_abort_assoc(). DON'T call the sctp_inpcb_free
when the gone flag is set. You don't know what locks the
caller has set and there is already a kill timer running.
rwatson [Sun, 6 Jun 2010 15:27:08 +0000 (15:27 +0000)]
Rework tcpp output so that it generates a comma-delimited list of values,
optionally with a header if "-h" is passed. Toast CPU time measurement
in the server for now. Remove -C and -T, since we now always report
both connections/sec and Gb/sec.
nwhitehorn [Sun, 6 Jun 2010 14:09:48 +0000 (14:09 +0000)]
Some revisions of the Serverworks K2 SATA controller have a data
corruption bug where if an ATA command is issued before DMA is started,
data will become available to the controller before it knows what to do
with it. This results in either data corruption or a controller crash.
This patch remedies the problem by adopting the workaround employed
by Linux and Darwin: starting the DMA engine prior to sending the ATA
command.
alc [Sun, 6 Jun 2010 06:07:44 +0000 (06:07 +0000)]
Don't set PG_WRITEABLE in init_pte_prot() (and thus pmap_enter()) unless
the page is managed.
Don't set the machine-independent layer's dirty field for the page being
mapped in init_pte_prot(). (The dirty field is only supposed to set when
a mapping is removed or write-protected and the page was managed and
modified.)
Determine whether or not to perform dirty bit emulation based on whether
or not the page is managed, i.e., pageable, not based on whether the page
is being mapped into the kernel address space. Nearly all of the kernel
address space consists of unmanaged pages, so this has neglible impact on
the overhead of dirty bit emulation for the kernel address space. However,
there can also exist unmanaged pages in the user address space. Previously,
dirty bit emulation was unnecessarily performed on these pages.
yongari [Sat, 5 Jun 2010 23:29:24 +0000 (23:29 +0000)]
Fix a bug introduced in r199011. When bge(4) reuses loaded RX
buffers it should also reinitialize RX descriptors otherwise some
stale data could be passed to controller. This could end up with
mbuf double free or unexpected NULL pointer dereference in upper
stack. To fix the issue, save loaded buffer's length and
reinitialize RX descriptors with the saved value whenever bge(4)
reuses the loaded RX buffers.
While I'm here, increase the number of RX buffers to 512 from 256.
This simplifies RX buffer handling as well as giving more RX
buffers. Controller supports just fixed number of RX buffers
(i.e. 512) and bge(4) used to rely on hope that our CPU is fast
enough to keep up with the controller. With this change, bge(4)
will use 1MB for RX buffers but I don't think it would cause
problems in these days.
rrs [Sat, 5 Jun 2010 21:27:43 +0000 (21:27 +0000)]
This change does the following:
1) Fix the alignment of a comment.
2) Fix a BUG where we were NOT paying attention
to the RESEND marking on retransmitting control
chunks.. and worse we were not decrementing the
retran count that could cause us to loop forever.
3) Add in the valdiate_no_lock function on invariants
so that we will really check all ways out to be sure
a lock does not slip out locked.
rrs [Sat, 5 Jun 2010 21:20:28 +0000 (21:20 +0000)]
This does two changes:
1) Makes it so that the INVARIANT function validate nolocks is
available anywhere.
2) Fixes a BUG where a close has been done on a collision socket
and the cookie processing would return leaving a lock held.
MFC after: 1 week
nwhitehorn [Sat, 5 Jun 2010 16:25:25 +0000 (16:25 +0000)]
Partially revert r208162 while waiting for review on a more comprehensive
fix. On Apple OpenPICs, the low/high bit of the interrupt sense is only
respected for interrupt 0. We currently erroneously program all OpenPIC
interrupts level high instead of level low by default, which only matters
for some G5 systems where the SATA controllers use IRQ 0.
This change is a quick fix that will be reverted once the effect of
changing the default interrupt sense on embedded systems is known.
nwhitehorn [Sat, 5 Jun 2010 16:21:55 +0000 (16:21 +0000)]
Make sure that interrupt sense settings set after interrupts are enabled
are respected. This fixes loading the Apple onboard audio driver
(snd_ai2s) as a module after boot, which would previously cause a panic.
kib [Sat, 5 Jun 2010 16:00:53 +0000 (16:00 +0000)]
Use the fpu_kern_enter() interface to properly separate usermode FPU
context from in-kernel execution of padlock instructions and to handle
spurious FPUDNA exceptions that sometime are raised when doing padlock
calculations.
kib [Sat, 5 Jun 2010 15:59:59 +0000 (15:59 +0000)]
Introduce the x86 kernel interfaces to allow kernel code to use
FPU/SSE hardware. Caller should provide a save area that is chained
into the stack of the areas; pcb save_area for usermode FPU state is
on top. The pcb now contains a pointer to the current FPU saved area,
used during FPUDNA handling and context switches. There is also a
facility to allow the kernel thread to use pcb save_area.
Change the dreaded warnings "npxdna in kernel mode!" into the panics
when FPU usage is not registered.
trasz [Sat, 5 Jun 2010 08:50:39 +0000 (08:50 +0000)]
Don't try to copy a socket after "xxx is a socket (not copied)." message.
Previously, it would either try to copy it anyway and fail (without -R),
or create fifo instead of the socket (with -R).
Found with: Coverity Prevent
CID: 5623
MFC after: 2 weeks
mjacob [Sat, 5 Jun 2010 00:55:21 +0000 (00:55 +0000)]
I was getting panics in sleepq_add for the second sleep in isp_kthread.
I don't know why- but it occurred to me in looking at the second sleep
is that all I want is a pause- not an actual sleep. So do that instead.
cperciva [Fri, 4 Jun 2010 14:38:24 +0000 (14:38 +0000)]
Declare ip6 as (struct in6_addr *) instead of (struct in_addr *). This is
a harmless bug since we never actually use ip6 as anything other than an
opaque pointer.
Found with: Coverty Prevent(tm)
CID: 4319
MFC after: 1 month
jchandra [Fri, 4 Jun 2010 06:35:36 +0000 (06:35 +0000)]
Make vm_contig_grow_cache() extern, and use it when vm_phys_alloc_contig()
fails to allocate MIPS page table pages. The current usage of VM_WAIT in
case of vm_phys_alloc_contig() failure is not correct, because:
"There is no guarantee that any of the available free (or cached) pages
after the VM_WAIT will fall within the range of suitable physical
addresses. Every time this function sleeps and a single page is freed
(or cached) by someone else, this function will be reawakened. With
a little bad luck, you could spin indefinitely."
We also add low and high parameters to vm_contig_grow_cache() and
vm_contig_launder() so that we restrict vm_contig_launder() to the range
of pages we are interested in.
trasz [Thu, 3 Jun 2010 14:29:17 +0000 (14:29 +0000)]
_posix1e_acl_sort() never returns anything other than 0; change its
return type to void and update callers. This simplifies code and
fixes one place where the returned value was not actually checked.
marius [Thu, 3 Jun 2010 13:04:56 +0000 (13:04 +0000)]
- Mention that VTOC8 labels are found in Fujitsu SPARC64 machines as well.
- Add information regarding VTOC8 bootrstrap code and how it's handled with
r208777 in place.
- Document the mapping of partition types to VTOC8 tags.
- Add examples for VTOC8 to the respective section.
- Eliminated hard sentence breaks.
Reviewed by: marcel (slightly buggy version)
MFC after: 3 days
marius [Thu, 3 Jun 2010 13:01:55 +0000 (13:01 +0000)]
- In gpart_bootfile_read() fix an off-by-one error preventing the bootstrap
file to be of maximum size.
- Add special handling required for SMI/VTOC8 disklabel partcode, i.e. avoid
overwriting the label when writing the bootstrap code to the partition
starting at 0 and install it to all partitions when the -i option is omitted
just like geom_sunlabel(4) and sunlabel(8) do by default.
- Add missing prototypes.
- Add const where applicable.
kib [Thu, 3 Jun 2010 10:24:53 +0000 (10:24 +0000)]
Extend the scope of the lock on the quota file vnode in quotaon() to
cover the initial read by dqopen(). Assert that vnode is locked in
dqopen(). Remove VFS_LOCK_GIANT() from dqopen(), since quotaon() keeps
Giant locked if needed around the call.
kib [Thu, 3 Jun 2010 10:20:08 +0000 (10:20 +0000)]
Sometimes vnodes share the lock despite being different vnodes on
different mount points, e.g. the nullfs vnode and the covered vnode
from the lower filesystem. In this case, existing assertion in
vop_rename_pre() may be triggered.
Check for vnode locks equiality instead of the vnodes itself to
not trip over the situation.
alc [Thu, 3 Jun 2010 03:55:22 +0000 (03:55 +0000)]
In the unlikely event that pmap_ts_referenced() demoted five superpage
mappings to the same underlying physical page, the calling thread would be
left forever pinned to the same processor.
jmallett [Wed, 2 Jun 2010 21:15:00 +0000 (21:15 +0000)]
Fix build for O32 systems without a TARGET_CPUTYPE defined. We must default to
MIPS-III because FreeBSD relies on a number of MIPS-III features; the ABI
default would be MIPS-I which we don't intend to support. Our old default
before I switched to using the ABI default was MIPS32.