]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
14 years agoFix typo.
Andrey V. Elsukov [Wed, 9 Jun 2010 12:30:40 +0000 (12:30 +0000)]
Fix typo.

Approved by: mav (mentor)
MFC after: 1 month

14 years agoNew netgraph node ng_patch(4). It performs data modification of packets
Andrey V. Elsukov [Wed, 9 Jun 2010 12:25:57 +0000 (12:25 +0000)]
New netgraph node ng_patch(4). It performs data modification of packets
passing through. Modifications are restricted to a subset of C language
operations on unsigned integers of 8, 16, 32 or 64 bit size.
These are: set to new value (=), addition (+=), subtraction (-=),
multiplication (*=), division (/=), negation (= -), bitwise AND (&=),
bitwise OR (|=), bitwise eXclusive OR (^=), shift left (<<=),
shift right (>>=). Several operations are all applied to a packet
sequentially in order they were specified by user.

Submitted by: Maxim Ignatenko <gelraen.ua at gmail.com>
Vadim Goncharov <vadimnuclight at tpu.ru>
Discussed with: net@
Approved by: mav (mentor)
MFC after: 1 month

14 years agofix memset() calls.
Edwin Groothuis [Wed, 9 Jun 2010 10:36:25 +0000 (10:36 +0000)]
fix memset() calls.

Found with:   Coverity Prevent(tm)
CID:          8531

14 years agoRemove -mdoc macros from -man page
Ulrich Spörlein [Wed, 9 Jun 2010 08:53:50 +0000 (08:53 +0000)]
Remove -mdoc macros from -man page

Neither groff nor mandoc render these when in -man mode.
This was introduced in r38083 as a local change, therefore no commit to
the vendor branch.

14 years agomdoc: spell out theta, the Unicode glyph is hard to read for terminal fonts
Ulrich Spörlein [Wed, 9 Jun 2010 07:31:32 +0000 (07:31 +0000)]
mdoc: spell out theta, the Unicode glyph is hard to read for terminal fonts

It is referred to as "theta" later in the document anyway,
so stop being fancy.

14 years agoAdd set of codec IDs.
Alexander Motin [Wed, 9 Jun 2010 05:49:02 +0000 (05:49 +0000)]
Add set of codec IDs.

PR: kern/147466

14 years agoRearrange how things are done to avoid dereferencing stale pointers in
Matt Jacob [Tue, 8 Jun 2010 22:46:44 +0000 (22:46 +0000)]
Rearrange how things are done to avoid dereferencing stale pointers in
the case of immediate unconfigure after configure. Hold the periph an
extra count while we have the task to create sysctl context outstanding
so that the periph doesn't go away unexpectedly.

Sponsored by: Panasas
Reviewed by: scsi@
MFC after: 1 month

14 years agoTry and narrow the gap in which you act on an event that has been canceled.
Matt Jacob [Tue, 8 Jun 2010 22:40:02 +0000 (22:40 +0000)]
Try and narrow the gap in which you act on an event that has been canceled.
Obtained from: Jaako Heinonen
MFC after: 1 month

14 years agoAdd the VHBA package. It is here in tools because it's really a testbed.
Matt Jacob [Tue, 8 Jun 2010 22:26:47 +0000 (22:26 +0000)]
Add the VHBA package. It is here in tools because it's really a testbed.

Sponsored by: Panasas
MFC after: 1 month

14 years agoThe lock associated with the /dev/apm knote is already held, so use
John Baldwin [Tue, 8 Jun 2010 21:27:05 +0000 (21:27 +0000)]
The lock associated with the /dev/apm knote is already held, so use
KNOTE_LOCKED() instead of KNOTE_UNLOCKED().

Reported by: mav
MFC after: 3 days

14 years agoMove the MD support for PCI message signalled interrupts to the x86 tree
John Baldwin [Tue, 8 Jun 2010 18:36:03 +0000 (18:36 +0000)]
Move the MD support for PCI message signalled interrupts to the x86 tree
as it is identical for i386 and amd64.

14 years agoMove the machine check support code to the x86 tree since it is identical
John Baldwin [Tue, 8 Jun 2010 18:04:07 +0000 (18:04 +0000)]
Move the machine check support code to the x86 tree since it is identical
on i386 and amd64.

Requested by: alc

14 years agoReorganize the code in bdwrite() which handles move of dirtiness
Konstantin Belousov [Tue, 8 Jun 2010 17:54:28 +0000 (17:54 +0000)]
Reorganize the code in bdwrite() which handles move of dirtiness
from the buffer pages to buffer. Combine the code to set buffer
dirty range (previously in vfs_setdirty()) and to clean the pages
(vfs_clean_pages()) into new function vfs_clean_pages_dirty_buf(). Now
the vm object lock is acquired only once.

Drain the VPO_BUSY bit of the buffer pages before setting valid
and clean bits in vfs_clean_pages_dirty_buf() with new helper
vfs_drain_busy_pages(). pmap_clear_modify() asserts that page is not
busy.

In vfs_busy_pages(), move the wait for draining of VPO_BUSY before
the dirtyness handling, to follow the structure of
vfs_clean_pages_dirty_buf().

Reported and tested by: pho
Suggested and reviewed by: alc
MFC after: 2 weeks

14 years agoMove the I/O APIC code to the x86 tree since it is identical on i386 and
John Baldwin [Tue, 8 Jun 2010 17:51:21 +0000 (17:51 +0000)]
Move the I/O APIC code to the x86 tree since it is identical on i386 and
amd64.

14 years agoOne byte off for scsi_target_group cdb.
Matt Jacob [Tue, 8 Jun 2010 17:44:49 +0000 (17:44 +0000)]
One byte off for scsi_target_group cdb.

MFC after: 2 weeks

14 years agoRemove unused macros.
Pyun YongHyeon [Tue, 8 Jun 2010 17:28:28 +0000 (17:28 +0000)]
Remove unused macros.

Reviewed by: bde

14 years ago- Use a bit more care when moving I/O APIC interrupts between CPUs. Mask
John Baldwin [Tue, 8 Jun 2010 17:08:13 +0000 (17:08 +0000)]
- Use a bit more care when moving I/O APIC interrupts between CPUs.  Mask
  the interrupt followed by a brief delay if it is not currently masked
  before moving the interrupt.
- Move the icu_lock out of ioapic_program_intpin() and into callers.  This
  closes a race where ioapic_program_intpin() could use a stale value of
  the masked state to compute the masked bit in the register.

Reviewed by: mav
MFC after: 2 weeks

14 years agomdoc: remove literal tabs where they don't belong
Ulrich Spörlein [Tue, 8 Jun 2010 16:48:59 +0000 (16:48 +0000)]
mdoc: remove literal tabs where they don't belong

14 years agomdoc: replace troff macros with -mdoc equivalents
Ulrich Spörlein [Tue, 8 Jun 2010 16:48:49 +0000 (16:48 +0000)]
mdoc: replace troff macros with -mdoc equivalents

14 years agoFix a sign bug that caused adaptive spinning in sx_xlock() to not work
John Baldwin [Tue, 8 Jun 2010 16:17:47 +0000 (16:17 +0000)]
Fix a sign bug that caused adaptive spinning in sx_xlock() to not work
properly.  Among other things it did not drop Giant while spinning
leading to livelocks.

Reviewed by: rookie, kib, jmallett
MFC after: 3 days

14 years agoImplement the usage of Report Luns as part of SCSI probing for SCP3 or
Matt Jacob [Tue, 8 Jun 2010 16:17:25 +0000 (16:17 +0000)]
Implement the usage of Report Luns as part of SCSI probing for SCP3 or
better devices. This can be disabled on a per-device basis using quirks as
well.

This also handles the case where there is actually no connected LUN 0
(which can definitely be the case for storage arrays).

Reviewed by: scsi@
MFC after: 1 month

14 years agoDisable NCQ and PMP support for VIA VT8251 AHCI. It was reported to be
Alexander Motin [Tue, 8 Jun 2010 10:03:08 +0000 (10:03 +0000)]
Disable NCQ and PMP support for VIA VT8251 AHCI. It was reported to be
unreliable under load. Linux does the same.

14 years agoMake additional definitions up to and including SPC-4. Add in definitions
Matt Jacob [Tue, 8 Jun 2010 05:14:18 +0000 (05:14 +0000)]
Make additional definitions up to and including SPC-4. Add in definitions
for REPORT and SET TARGET PORT GROUP commands (foundations for future work).

Regularize opcodes to be upper case hex.

Pick *one* of tab or space after #define (tab) and stick with that.

MFC after: 2 weeks

14 years ago2 Bugs:
Randall Stewart [Tue, 8 Jun 2010 03:39:31 +0000 (03:39 +0000)]
2 Bugs:

1) Only use both mapping arrays when NR sack is off. This
   way we can hold off moving the cumack (not the best but
   workable) when NR-sack is on.

2) We must make sure to just return on the move of the
   bit to the NR array if the cum-ack as already went
   past the TSN. This prevents marking a bit behind the
   array and hitting the invariant code that panic's us.

MFC after: 1 week

14 years agoA number of netfront fixes and stability improvements:
Kenneth D. Merry [Tue, 8 Jun 2010 03:13:26 +0000 (03:13 +0000)]
A number of netfront fixes and stability improvements:

 - Re-enable TSO.  This was broken previously due to CSUM_TSO clearing the
   CSUM_TCP flag, so our checksum flags were incorrectly set going to the
   netback driver.  That was fixed in r206844 in tcp_output.c, so we can
   turn TSO back on here.

 - Fix the way transmit slots are calculated, so that we can't overfill
   the ring.

 - Avoid sending packets with more fragments/segments than netback can
   handle.  The Linux netback code can only handle packets of
   MAX_SKB_FRAGS, which turns out to be 18 on machines with 4K pages.  We
   can easily generate packets with 32 or so fragments with TSO turned on.
   Right now the solution is just to drop the packets (since netback
   doesn't seem to handle it gracefully), but we should come up with a way
   to allow a driver to tell the TCP stack the maximum number of fragments
   it can handle in a single packet.

 - Fix the way the consumer is tracked in the receive path.  It could get
   out of sync fairly easily.

 - Use standard Xen ring macros to make it clearer how netfront is using
   the rings.

 - Get rid of Linux-ish negative errno return values.

 - Added more documentation to the driver.

 - Refactored code to make it easier to read.

 - Some other minor fixes.

Reviewed by: gibbs

Reviewed by: gibbs
Sponsored by: Spectra Logic
MFC after: 7 days

14 years agoredfacedly noting a missing part of a patch.
Matt Jacob [Mon, 7 Jun 2010 22:43:37 +0000 (22:43 +0000)]
redfacedly noting a missing part of a patch.

Pointy Hat To: Me
MFC after: 2 Week
X-MFC: 208896

14 years agoCall BUS_PROBE_NOMATCH() when device detached due to driver unload.
Alexander Motin [Mon, 7 Jun 2010 18:47:53 +0000 (18:47 +0000)]
Call BUS_PROBE_NOMATCH() when device detached due to driver unload.
This allows bus to power-down device when driver unloaded on-flight.

14 years agoThis fixes a BUG in the handling of the cum-ack calculation.
Randall Stewart [Mon, 7 Jun 2010 18:29:10 +0000 (18:29 +0000)]
This fixes a BUG in the handling of the cum-ack calculation.
We were only paying attention to the nr-mapping-array. Which
seems to make sense on the surface, by definition things
up to the cum-ack should be deliverable thus in the nr-mapping-array.
However (there is always a gotcha) thats not true when it
comes to large messages. The stack may hold the message
while re-assembling it not not deliver it based on several
thresholds. If that happens (which it would for smaller
large messages) then the cum-ack is figured wrong. We
now properly use both arrays in the cum-ack calculation.

MFC after: 1 week.

14 years agoDo a minor amount of stylifying. Also, get a Fibre Channel WWPN if one exists
Matt Jacob [Mon, 7 Jun 2010 17:41:34 +0000 (17:41 +0000)]
Do a minor amount of stylifying. Also, get a Fibre Channel WWPN if one exists
for a da unit and create a sysctl OID for it.

14 years agoFix XPT_GET_TRAN_SETTING for FC which has been broken for while so that
Matt Jacob [Mon, 7 Jun 2010 17:39:36 +0000 (17:39 +0000)]
Fix XPT_GET_TRAN_SETTING for FC which has been broken for while so that
it will figure out the correct target to handle index and be able to find
things like WWPN, etc.

MFC after: 2 weeks

14 years agoOpps... my bad.. we don't need a SOCK_UNLOCK() after
Randall Stewart [Mon, 7 Jun 2010 11:33:20 +0000 (11:33 +0000)]
Opps... my bad.. we don't need a SOCK_UNLOCK() after
calling socantrcvmore_locked() since it will unlock
the lock for you.

MFC after: 1 week

14 years agoFollow up revision 208888 with purely ident changes.
Xin LI [Mon, 7 Jun 2010 10:10:44 +0000 (10:10 +0000)]
Follow up revision 208888 with purely ident changes.

MFC after: 1 week

14 years agoCorrect a bug in gzip(1): make sure that initialize isb with fstat() on
Xin LI [Mon, 7 Jun 2010 10:09:40 +0000 (10:09 +0000)]
Correct a bug in gzip(1): make sure that initialize isb with fstat() on
input file before using it.

PR: bin/147275
Submitted by: thomas
MFC after: 1 week

14 years agocxgb(4): add an 'nfilters' tunable that lets the user place an upper
Navdeep Parhar [Mon, 7 Jun 2010 08:23:16 +0000 (08:23 +0000)]
cxgb(4): add an 'nfilters' tunable that lets the user place an upper
limit on the number of hardware filters (and thus the amount of TCAM
reserved for filtering).

14 years agobgeom(3) does strdup of param name.
Andrey V. Elsukov [Mon, 7 Jun 2010 07:41:41 +0000 (07:41 +0000)]
bgeom(3) does strdup of param name.
Don't leak memory when deleting param from gctl_req.

Reviewed by: marcel
Approved by: mav (mentor)
MFC after: 2 weeks

14 years agoDocument ZFS upgrade to version 14, support for NFSv4 ACLs,
Martin Matuska [Mon, 7 Jun 2010 06:38:12 +0000 (06:38 +0000)]
Document ZFS upgrade to version 14, support for NFSv4 ACLs,
changes in L2ARC and zfs send.

Approved by: delphij (mentor)

14 years agoFix so we call socantrcvmore_locked so we
Randall Stewart [Mon, 7 Jun 2010 04:01:38 +0000 (04:01 +0000)]
Fix so we call socantrcvmore_locked so we
don't see a race where we unlock to call
the non-locked version and have the socket
go away.

MFC after: 1 week

14 years agosh: Pass through SIGINT from a child if interactive and job control
Jilles Tjoelker [Sun, 6 Jun 2010 22:27:32 +0000 (22:27 +0000)]
sh: Pass through SIGINT from a child if interactive and job control
is enabled.

This already worked if without job control.

In either case, this depends on it that a process that terminates due to
SIGINT exits on it (so not with status 1, or worse, 0).

Example:
  sleep 5; echo continued
This does not print "continued" any more if sleep is aborted via ctrl+c.

MFC after: 1 month

14 years ago1) Optimize the cleanup and don't always depend on
Randall Stewart [Sun, 6 Jun 2010 20:34:17 +0000 (20:34 +0000)]
1) Optimize the cleanup and don't always depend on
   the timer. This is done by considering the locks
   we will destroy and if they are contended we consider
   it the same as a reference count being up. Fixing this
   appears to cleanup another crash that was appearing with
   all the timers where the socket buf lock got corrupted.

2) Fix the sysctl code to take a lot more care when looking
   at INP's that are in the GONE or ALLGONE state.

MFC after: 1 week

14 years agoOk, yet another bug in killing off all the hundreds
Randall Stewart [Sun, 6 Jun 2010 19:24:32 +0000 (19:24 +0000)]
Ok, yet another bug in killing off all the hundreds
of apitesters.. Basically we end up with attempting
to destroy a lock thats contended on. A cookie echo
arrives at the same time that the close is happening.
The close gets the lock but the cookie echo has already
passed the check for the gone flag and is then locked
waiting on the create lock.. when we go to destroy it
bam. For now we do the timer destroy for all calls
to close.. We can probably optimize this later so that
we check whats being contended on and if there is contention
then do the timer thing. but this is probably safest since
the inp has been removed from all lists and references and
only the timer can find it.. once the locks are released all
other places will instantly see the GONE flag and bail (thats
what the change in sctp_input is one place that was lacking
the bail code).

MFC after: 1 week

14 years agoStyle-compilant order of declarations.
Konstantin Belousov [Sun, 6 Jun 2010 16:13:50 +0000 (16:13 +0000)]
Style-compilant order of declarations.

Noted by: bde
MFC after: 1 month

14 years ago1) Further enhance the INVARIANT lock validation (no locks) are
Randall Stewart [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.

MFC after: 1 week

14 years agoFix a bug in the sctp_inpcb_free. Basically if the socket
Randall Stewart [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

14 years agoFix a bug in sctp_abort_assoc(). DON'T call the sctp_inpcb_free
Randall Stewart [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.

MFC after: 1 week

14 years agoRework tcpp output so that it generates a comma-delimited list of values,
Robert Watson [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.

MFC after: 1 week
Sponsored by: Juniper Networks

14 years agoAdd Open Firmware PNP info strings to GPIOs and Uninorth cells.
Nathan Whitehorn [Sun, 6 Jun 2010 14:29:06 +0000 (14:29 +0000)]
Add Open Firmware PNP info strings to GPIOs and Uninorth cells.

Submitted by: Andreas Tobler

14 years agoSome revisions of the Serverworks K2 SATA controller have a data
Nathan Whitehorn [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.

Observer on: Xserve G5
Reviewed by: mav
MFC after: 1 week

14 years ago- Fix signal handling in bc/dc. Now Ctrl-C terminates the execution.
Gabor Kovesdan [Sun, 6 Jun 2010 11:36:08 +0000 (11:36 +0000)]
- Fix signal handling in bc/dc.  Now Ctrl-C terminates the execution.

Requested by: gk (via private mail)
Approved by: delphij (mentor)

14 years ago- Fig segmentation fault
Gabor Kovesdan [Sun, 6 Jun 2010 11:32:38 +0000 (11:32 +0000)]
- Fig segmentation fault

Submitted by: Hizel Ildar <hizel@vyborg.ru> (via current@)

14 years agoDon't set PG_WRITEABLE in init_pte_prot() (and thus pmap_enter()) unless
Alan Cox [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.

Tested by: jchandra@

14 years agoHopefully this fixes a LOR by making
Randall Stewart [Sun, 6 Jun 2010 02:33:46 +0000 (02:33 +0000)]
Hopefully this fixes a LOR by making
so we only hold the iterator lock during
updates to the iterators work.

MFC after: 1 week

14 years agoBruce's fix for some return's in
Randall Stewart [Sun, 6 Jun 2010 02:32:20 +0000 (02:32 +0000)]
Bruce's fix for some return's in
error legs.

MFC after: 1 week

14 years agoFix a bug introduced in r199011. When bge(4) reuses loaded RX
Pyun YongHyeon [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.

Reported by: marcel
Tested by: marcel

14 years agoConvert pm_runcount to int to correctly check for negative value.
Fabien Thomas [Sat, 5 Jun 2010 23:05:08 +0000 (23:05 +0000)]
Convert pm_runcount to int to correctly check for negative value.
Remove uncessary check for error.

Found with: Coverity Prevent(tm)
MFC after: 1 month

14 years agoFix memory leak on error.
Fabien Thomas [Sat, 5 Jun 2010 23:00:02 +0000 (23:00 +0000)]
Fix memory leak on error.

Found with: Coverity Prevent(tm)
MFC after: 1 month

14 years agoAlthough we currently don't compile in CPU-pinning support by default,
Robert Watson [Sat, 5 Jun 2010 22:59:37 +0000 (22:59 +0000)]
Although we currently don't compile in CPU-pinning support by default,
add a -P to enable it if it were.

MFC after: 1 week
Sponsored by: Juniper Networks

14 years agoFix warnings found by Coverity.
Fabien Thomas [Sat, 5 Jun 2010 22:57:53 +0000 (22:57 +0000)]
Fix warnings found by Coverity.

Found with:   Coverity Prevent(tm)
MFC after: 1 month

14 years agoPurge out a Windows def that somehow slipped
Randall Stewart [Sat, 5 Jun 2010 21:39:52 +0000 (21:39 +0000)]
Purge out a Windows def that somehow slipped
past the scrubber.

MFC after: 1 Week

14 years agoSpacing issues
Randall Stewart [Sat, 5 Jun 2010 21:33:16 +0000 (21:33 +0000)]
Spacing issues

MFC after: 1 Week

14 years agoThis change does the following:
Randall Stewart [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.

MFC after: 1 week.

14 years agoUse the proper increment macro when increasing the
Randall Stewart [Sat, 5 Jun 2010 21:22:58 +0000 (21:22 +0000)]
Use the proper increment macro when increasing the
number on sent_queue_retran_cnt.

MFC after: 1 week

14 years agoThis does two changes:
Randall Stewart [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

14 years agoThis fixes a bug in the close up of a socket that
Randall Stewart [Sat, 5 Jun 2010 21:17:23 +0000 (21:17 +0000)]
This fixes a bug in the close up of a socket that
had un-accepted assoc's. Basically the assoc (and inp)
would get stuck and never get cleaned up.

MFC after: 1 week

14 years agoBe more specific about which CDB length we're going to use. Not really a likely
Matt Jacob [Sat, 5 Jun 2010 20:37:40 +0000 (20:37 +0000)]
Be more specific about which CDB length we're going to use. Not really a likely
bug but we might as well be clearer.

Found with: Coverity Prevent(tm)
CID: 3981

MFC after: 2 weeks

14 years agoCorrect a harmless typo introduced when copying code from mmu_oea64.
Nathan Whitehorn [Sat, 5 Jun 2010 18:24:41 +0000 (18:24 +0000)]
Correct a harmless typo introduced when copying code from mmu_oea64.

Submitted by: alc
MFC after: 8.1-RELEASE

14 years agoDon't set PG_WRITEABLE in pmap_enter() unless the page is managed.
Alan Cox [Sat, 5 Jun 2010 18:20:09 +0000 (18:20 +0000)]
Don't set PG_WRITEABLE in pmap_enter() unless the page is managed.

Correct a typo in a nearby comment on sparc64.

14 years agoAdd a driver for the CPU temperature sensors attached over I2C on the
Nathan Whitehorn [Sat, 5 Jun 2010 17:51:37 +0000 (17:51 +0000)]
Add a driver for the CPU temperature sensors attached over I2C on the
PowerMac 11,2.

14 years agoAdd support for the I2C busses hanging off Apple system management chips.
Nathan Whitehorn [Sat, 5 Jun 2010 17:50:20 +0000 (17:50 +0000)]
Add support for the I2C busses hanging off Apple system management chips.

14 years agoUtilize the Keywest I2C combined mode for messages with repeated starts.
Nathan Whitehorn [Sat, 5 Jun 2010 17:49:40 +0000 (17:49 +0000)]
Utilize the Keywest I2C combined mode for messages with repeated starts.

14 years agoAdd two new flags (IIC_M_NOSTOP and IIC_M_NOSTART) to struct iic_msg to
Nathan Whitehorn [Sat, 5 Jun 2010 17:48:26 +0000 (17:48 +0000)]
Add two new flags (IIC_M_NOSTOP and IIC_M_NOSTART) to struct iic_msg to
allow consumers of iicbus_transfer() to send messages with repeated starts.

Reviewed by: imp

14 years agoCorrect the comment. We now use level low instead of edge high for this
Nathan Whitehorn [Sat, 5 Jun 2010 16:27:15 +0000 (16:27 +0000)]
Correct the comment. We now use level low instead of edge high for this
interrupt.

14 years agoPartially revert r208162 while waiting for review on a more comprehensive
Nathan Whitehorn [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.

MFC after: 3 days

14 years agoMake sure that interrupt sense settings set after interrupts are enabled
Nathan Whitehorn [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.

PR: powerpc/146888
MFC after: 5 days

14 years agoUse the fpu_kern_enter() interface to properly separate usermode FPU
Konstantin Belousov [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.

Globally mark crypto(9) kthread as using FPU.

Reviewed by: pjd
Hardware provided by: Sentex Communications
Tested by:   pho
PR:    amd64/135014
MFC after:    1 month

14 years agoIntroduce the x86 kernel interfaces to allow kernel code to use
Konstantin Belousov [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.

KPI discussed with: fabient
Tested by:    pho, fabient
Hardware provided by: Sentex Communications
MFC after:    1 month

14 years agoAdd comment that this value is unused.
Edwin Groothuis [Sat, 5 Jun 2010 12:53:44 +0000 (12:53 +0000)]
Add comment that this value is unused.
It is obvious that it isn't used, but both clang and Coverity talk about it.

Found with:   Coverity Prevent(tm)
CID:          8066

14 years agoWhen there is a problem with writing, also bail out.
Edwin Groothuis [Sat, 5 Jun 2010 12:49:39 +0000 (12:49 +0000)]
When there is a problem with writing, also bail out.

Found with the clang checker.

14 years agoMake clang happier by removing unused assignments.
Edwin Groothuis [Sat, 5 Jun 2010 12:31:08 +0000 (12:31 +0000)]
Make clang happier by removing unused assignments.

14 years agoFix warnings about uninitialized variables.
Edwin Groothuis [Sat, 5 Jun 2010 11:41:46 +0000 (11:41 +0000)]
Fix warnings about uninitialized variables.
It was mostly harmless since strftime() only used %a and %b anyway.

Found with:   Coverity Prevent(tm)
CID:          7769

14 years agoFix: when unable to parse the sequence string, erase everything.
Edwin Groothuis [Sat, 5 Jun 2010 11:32:31 +0000 (11:32 +0000)]
Fix: when unable to parse the sequence string, erase everything.

Found with:   Coverity Prevent(tm)
CID:          7888

14 years agoFix memory-leak at the processing of multiple calendars.
Edwin Groothuis [Sat, 5 Jun 2010 11:12:35 +0000 (11:12 +0000)]
Fix memory-leak at the processing of multiple calendars.

Found with:   Coverity Prevent(tm)
CID:          7085

14 years agoProperly check the return value of chdir, even if it is a "this
Edwin Groothuis [Sat, 5 Jun 2010 11:06:56 +0000 (11:06 +0000)]
Properly check the return value of chdir, even if it is a "this
should not happen" case.

Found with:   Coverity Prevent(tm)
CID:          4932

14 years agoRemove some dead and incorrect code.
Alexander Motin [Sat, 5 Jun 2010 10:16:23 +0000 (10:16 +0000)]
Remove some dead and incorrect code.

Found with:   Coverity Prevent(tm)
CID:          4562

14 years agoAdd allocation error hadling.
Alexander Motin [Sat, 5 Jun 2010 09:31:13 +0000 (09:31 +0000)]
Add allocation error hadling.

Found with:   Coverity Prevent(tm)
CID:          3897

14 years agoFix possible use after free.
Alexander Motin [Sat, 5 Jun 2010 08:58:03 +0000 (08:58 +0000)]
Fix possible use after free.

Found with:   Coverity Prevent(tm)
CID:          4634

14 years agoDon't try to copy a socket after "xxx is a socket (not copied)." message.
Edward Tomasz Napierala [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

14 years agoFix use after free on error.
Alexander Motin [Sat, 5 Jun 2010 08:44:40 +0000 (08:44 +0000)]
Fix use after free on error.

Found with:   Coverity Prevent(tm)
CID:          4722

14 years agoFix double free on error.
Alexander Motin [Sat, 5 Jun 2010 08:36:37 +0000 (08:36 +0000)]
Fix double free on error.

Found with:   Coverity Prevent(tm)
CID:          4573

14 years agoPlug memory leak to silent Coverity. Error is still not really handled.
Alexander Motin [Sat, 5 Jun 2010 08:21:18 +0000 (08:21 +0000)]
Plug memory leak to silent Coverity. Error is still not really handled.

Found with:   Coverity Prevent(tm)
CID:          4137

14 years agoPlug memory leak to silent Coverity. Error is still not really handled.
Alexander Motin [Sat, 5 Jun 2010 08:16:21 +0000 (08:16 +0000)]
Plug memory leak to silent Coverity. Error is still not really handled.

Found with:   Coverity Prevent(tm)
CID:          4196

14 years agoFix attach errors handling.
Alexander Motin [Sat, 5 Jun 2010 08:14:19 +0000 (08:14 +0000)]
Fix attach errors handling.

Found with:   Coverity Prevent(tm)
CID:          3477

14 years agoPlug resource leak.
Edward Tomasz Napierala [Sat, 5 Jun 2010 08:11:11 +0000 (08:11 +0000)]
Plug resource leak.

Found with: Coverity Prevent
CID: 7040

14 years agoPlug memory leak to silent Coverity. Error is still not really handled.
Alexander Motin [Sat, 5 Jun 2010 08:07:54 +0000 (08:07 +0000)]
Plug memory leak to silent Coverity. Error is still not really handled.

Found with:   Coverity Prevent(tm)
CID:          4130

14 years agoFix attach errors handling.
Alexander Motin [Sat, 5 Jun 2010 08:02:19 +0000 (08:02 +0000)]
Fix attach errors handling.

Found with:   Coverity Prevent(tm)
CID:          3424

14 years agoMake sure not to pass NULL to g_orphan_provider().
Edward Tomasz Napierala [Sat, 5 Jun 2010 08:00:52 +0000 (08:00 +0000)]
Make sure not to pass NULL to g_orphan_provider().

Found with: Coverity Prevent
CID: 3411

14 years agoDon't use pointer to 64 bit value (id_t) to point to 32 bit value (uid_t).
Edward Tomasz Napierala [Sat, 5 Jun 2010 07:40:32 +0000 (07:40 +0000)]
Don't use pointer to 64 bit value (id_t) to point to 32 bit value (uid_t).

Found with: Coverity Prevent
CID: 7466, 7467
MFC after: 2 weeks

14 years agoDon't set PG_WRITEABLE in pmap_enter() unless the page is managed.
Alan Cox [Sat, 5 Jun 2010 06:56:06 +0000 (06:56 +0000)]
Don't set PG_WRITEABLE in pmap_enter() unless the page is managed.

14 years agoMake the internal target > SPC2 (so REPORT LUNS can be tested).
Matt Jacob [Sat, 5 Jun 2010 00:56:15 +0000 (00:56 +0000)]
Make the internal target > SPC2 (so REPORT LUNS can be tested).
Give the NIL inquiry data real values other than just plain 0x7f
in the first byte.

MFC after: 2 weeks

14 years agoI was getting panics in sleepq_add for the second sleep in isp_kthread.
Matt Jacob [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.

MFC after: 2 weeks

14 years ago- Add myself to committers-src.dot
Matthew D Fleming [Fri, 4 Jun 2010 17:54:30 +0000 (17:54 +0000)]
- Add myself to committers-src.dot
- Add myself to calendar.freebsd

Approved by: zml (mentor)