]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
12 years agoPrevent TCP sessions from stalling indefinitely in reassembly
andre [Fri, 7 Oct 2011 16:39:03 +0000 (16:39 +0000)]
Prevent TCP sessions from stalling indefinitely in reassembly
when reaching the zone limit of reassembly queue entries.

When the zone limit was reached not even the missing segment
that would complete the sequence space could be processed
preventing the TCP session forever from making any further
progress.

Solve this deadlock by using a temporary on-stack queue entry
for the missing segment followed by an immediate dequeue again
by delivering the contiguous sequence space to the socket.

Add logging under net.inet.tcp.log_debug for reassembly queue
issues.

Reviewed by: lsteward (previous version)
Tested by:  Steven Hartland <killing-at-multiplay.co.uk>
MFC after: 3 days

12 years agoRemove unused define.
kib [Fri, 7 Oct 2011 16:09:44 +0000 (16:09 +0000)]
Remove unused define.

MFC after: 1 month

12 years agoFix whitespace inconsistencies found in homegrown Symbol.maps.
ed [Fri, 7 Oct 2011 15:05:24 +0000 (15:05 +0000)]
Fix whitespace inconsistencies found in homegrown Symbol.maps.

12 years agoAdd back the IP header length to the total packet length field on
andre [Fri, 7 Oct 2011 13:43:01 +0000 (13:43 +0000)]
Add back the IP header length to the total packet length field on
raw IP sockets.  It was deducted in ip_input() in preparation for
protocols interested only in the payload.

On raw sockets the IP header should be delivered as it at came in
from the network except for the byte order swaps in some fields.

This brings us in line with all other OS'es that provide raw
IP sockets.

Reported by: Matthew Cini Sarreo <mcins1-at-gmail.com>
MFC after: 3 days

12 years agoRemove an extraneous "already" from a comment introduced by r226081.
rmacklem [Fri, 7 Oct 2011 13:16:21 +0000 (13:16 +0000)]
Remove an extraneous "already" from a comment introduced by r226081.

Submitted by: bf1783 at googlemail.com
MFC after: 3 days

12 years agoAdd a -x option that causes ssh-agent(1) to exit when all clients have
des [Fri, 7 Oct 2011 13:10:16 +0000 (13:10 +0000)]
Add a -x option that causes ssh-agent(1) to exit when all clients have
disconnected.

MFC after: 1 week

12 years agoLoad the ECDSA key if there is one.
des [Fri, 7 Oct 2011 12:58:33 +0000 (12:58 +0000)]
Load the ECDSA key if there is one.

MFC after: 1 week

12 years agoSimply let teken_stress use arc4random.
ed [Fri, 7 Oct 2011 12:42:03 +0000 (12:42 +0000)]
Simply let teken_stress use arc4random.

This makes it run quite a bit faster, since it makes system calls less
often.

12 years agoTab should not blank cells.
ed [Fri, 7 Oct 2011 12:21:50 +0000 (12:21 +0000)]
Tab should not blank cells.

It seems I was under the impression that a tab differs from a single
forward tabulation, namely that it blanks the underlying cells. This
seems not to be the case. They are identical.

This should fix applications like jove(1) that use tabs instead of
explicit cursor position setting.

Reported by: Brett Glass <brett lariat net>
MFC after: 3 days, after it's tested

12 years agoChange one printf() to log().
jonathan [Fri, 7 Oct 2011 09:51:12 +0000 (09:51 +0000)]
Change one printf() to log().

As noted in kern/159780, printf() is not very jail-friendly, since it can't be easily monitored by jail management tools. This patch reports an error via log() instead, which, if nobody is watching the log file, still prints to the console.

Approved by: mentor (rwatson)
Submitted by: Eugene Grosbein <eugen@eg.sd.rdtc.ru>
MFC after: 5 days

12 years agoMerge from r225950:
marius [Fri, 7 Oct 2011 08:59:54 +0000 (08:59 +0000)]
Merge from r225950:

Set the sense residual properly.

Reviewed by: ken

12 years agoBegin implementing correct MIPS24K sampling mode behaviour.
adrian [Fri, 7 Oct 2011 06:13:38 +0000 (06:13 +0000)]
Begin implementing correct MIPS24K sampling mode behaviour.

* Add the interrupt bit in the configuration register
* Correctly set the counter register for the sampling overflow
  interrupt. The interrupt is asserted when bit 31 is set.
  So set the overflow value at 0x80000000 and subtract the
  programmed value as appropriate.

12 years agoIncrease MSGBUF_SIZE.
obrien [Fri, 7 Oct 2011 06:00:00 +0000 (06:00 +0000)]
Increase MSGBUF_SIZE.
The previous size lead to truncated /var/run/dmesg.boot when booted with "-v".

12 years agoDisallow various debug.kdb sysctl's when securelevel is raised.
obrien [Fri, 7 Oct 2011 05:47:30 +0000 (05:47 +0000)]
Disallow various debug.kdb sysctl's when securelevel is raised.

PR: 161350

12 years agoWork around some behavior of gpart that I absolutely do not understand in
nwhitehorn [Fri, 7 Oct 2011 01:40:30 +0000 (01:40 +0000)]
Work around some behavior of gpart that I absolutely do not understand in
order to make every operation of the partition editor fully revertable.
Under *no circumstances* will it any longer touch the disks until the user
presses Finish and confirms it.

MFC after: 3 days

12 years agoReturn proper errno when we hit error when doing sanity check.
delphij [Fri, 7 Oct 2011 01:37:58 +0000 (01:37 +0000)]
Return proper errno when we hit error when doing sanity check.
This fixes dtrace crashes when module is not compiled with CTF
data.

Submitted by: Paul Ambrose ambrosehua at gmail.com
MFC after: 1 week

12 years agoA crash reported on freebsd-fs@ on Sep. 23, 2011 under the subject
rmacklem [Fri, 7 Oct 2011 01:15:04 +0000 (01:15 +0000)]
A crash reported on freebsd-fs@ on Sep. 23, 2011 under the subject
heading "kernel panics with RPCSEC_GSS" appears to be caused by a
corrupted tailq list for the client structure. Looking at the code, calls
to the function svc_rpc_gss_forget_client() were done in an SMP unsafe
manner, with the svc_rpc_gss_lock only being acquired in the function
and not before it. As such, when multiple threads called
svc_rpc_gss_forget_client() concurrently, it could try and remove the
same client structure from the tailq lists multiple times.
The patch fixes this by moving the critical code into a separate
function called svc_rpc_gss_forget_client_locked(), which must be
called with the lock held. For the one case where the caller would
have no interest in the lock, svc_rpc_gss_forget_client() was retained,
but a loop was added to check that the client structure is still in
the tailq lists before removing it, to make it safe for multiple
concurrent calls.

Tested by: clinton.adams at gmail.com (earlier version)
Reviewed by: zkirsch
MFC after: 3 days

12 years agoUse the caculated length instead of maximum length.
jkim [Thu, 6 Oct 2011 21:55:05 +0000 (21:55 +0000)]
Use the caculated length instead of maximum length.

12 years agoRemove a now-defunct variable.
jkim [Thu, 6 Oct 2011 21:40:08 +0000 (21:40 +0000)]
Remove a now-defunct variable.

12 years agoUse uint32_t instead of u_int32_t. Fix style(9) nits.
jkim [Thu, 6 Oct 2011 21:17:46 +0000 (21:17 +0000)]
Use uint32_t instead of u_int32_t.  Fix style(9) nits.

12 years agoMake sure to ignore the leading NULL byte from Linux abstract namespace.
jkim [Thu, 6 Oct 2011 21:09:28 +0000 (21:09 +0000)]
Make sure to ignore the leading NULL byte from Linux abstract namespace.

12 years agoRestore the original socket address length if it was not really AF_INET6.
jkim [Thu, 6 Oct 2011 20:48:23 +0000 (20:48 +0000)]
Restore the original socket address length if it was not really AF_INET6.

12 years agoRetern more appropriate errno when Linux path name is too long.
jkim [Thu, 6 Oct 2011 20:28:08 +0000 (20:28 +0000)]
Retern more appropriate errno when Linux path name is too long.

12 years agoInline do_sa_get() function and remove an unused return value.
jkim [Thu, 6 Oct 2011 20:20:30 +0000 (20:20 +0000)]
Inline do_sa_get() function and remove an unused return value.

12 years agoUnroll inlined strnlen(9) and make it easier to read. No functional change.
jkim [Thu, 6 Oct 2011 19:59:14 +0000 (19:59 +0000)]
Unroll inlined strnlen(9) and make it easier to read.  No functional change.

12 years agoRemove no longer needed BUGS section.
kib [Thu, 6 Oct 2011 17:35:38 +0000 (17:35 +0000)]
Remove no longer needed BUGS section.

MFC after: 1 month

12 years agoConvert MIPS to the syscallenter/syscallret system call sequence handlers.
kib [Thu, 6 Oct 2011 17:34:43 +0000 (17:34 +0000)]
Convert MIPS to the syscallenter/syscallret system call sequence handlers.
This was the last architecture used custom syscall entry sequence.

Reviewed, debugged, tested and approved by: jchandra
MFC after: 1 month

12 years agoFix a typo in a comment.
wxs [Thu, 6 Oct 2011 16:13:47 +0000 (16:13 +0000)]
Fix a typo in a comment.

Approved by: kib@

12 years agoAdd myself.
melifaro [Thu, 6 Oct 2011 15:10:48 +0000 (15:10 +0000)]
Add myself.

Approved by:       kib (mentor)

12 years agoFor the INP_TIMEWAIT case, there is no valid tcpcb object tied to the
attilio [Thu, 6 Oct 2011 14:29:38 +0000 (14:29 +0000)]
For the INP_TIMEWAIT case, there is no valid tcpcb object tied to the
inpcb object.
Skip the TCP_SIGNATURE check in that case as it is consistent with the
output path (no TCP_SIGNATURE for outcoming packets in TIMEWAIT state)
and also because for TIMEWAIT state the verify may be less effective.

Sponsored by: Sandvine Incorporated
Reported by: rwatson
No objections by: rwatson
MFC after: 3 days

12 years agoMove "Exit" to the first entry in the list, so that it is the default
nwhitehorn [Thu, 6 Oct 2011 14:24:37 +0000 (14:24 +0000)]
Move "Exit" to the first entry in the list, so that it is the default
choice.

PR: bin/160913
MFC after: 3 days

12 years agoAsk if you want to set the keymap before invoking kdbmap to prevent
nwhitehorn [Thu, 6 Oct 2011 14:22:38 +0000 (14:22 +0000)]
Ask if you want to set the keymap before invoking kdbmap to prevent
confusion.

PR: bin/160913
MFC after: 3 days

12 years ago- Currently, sched_balance_pair() may cause a CPU to send an IPI_PREEMPT to
marius [Thu, 6 Oct 2011 11:48:13 +0000 (11:48 +0000)]
- Currently, sched_balance_pair() may cause a CPU to send an IPI_PREEMPT to
  itself, which sparc64 hardware doesn't support. One way to solve this
  would be to directly call sched_preempt() instead of issuing a self-IPI.
  However, quoting jhb@:
  "On the other hand, you can probably just skip the IPI entirely if we are
  going to send it to the current CPU.  Presumably, once this routine
  finishes, the current CPU will exit softlock (or will do so "soon") and
  will then pick the next thread to run based on the adjustments made in
  this routine, so there's no need to IPI the CPU running this routine
  anyway.  I think this is the better solution.  Right now what is probably
  happening on other platforms is as soon as this routine finishes the CPU
  processes its self-IPI and causes mi_switch() which will just switch back
  to the softclock thread it is already running."
- With r226054 and the the above change in place, sparc64 now no longer is
  incompatible with ULE and vice versa. However, powerpc/E500 still is.

Submitted by: jhb
Reviewed by: jeff

12 years ago- Use atomic operations rather than sched_lock for safely assigning pm_active
marius [Thu, 6 Oct 2011 11:01:31 +0000 (11:01 +0000)]
- Use atomic operations rather than sched_lock for safely assigning pm_active
  and pc_pmap for SMP. This is key to allowing adding support for SCHED_ULE.
  Thanks go to Peter Jeremy for additional testing.
- Add support for SCHED_ULE to cpu_switch().

Committed from: 201110DevSummit

12 years agoFix build on i386 and arm.
delphij [Thu, 6 Oct 2011 04:39:18 +0000 (04:39 +0000)]
Fix build on i386 and arm.

Tested with: make universe
Pointy hat to: delphij

12 years agoUpgrade to OpenSSH 5.9p1.
des [Wed, 5 Oct 2011 22:08:17 +0000 (22:08 +0000)]
Upgrade to OpenSSH 5.9p1.

MFC after: 3 months

12 years agoRemove assertion against empty NFSv4 ACLs. An empty ACL is not exactly
trasz [Wed, 5 Oct 2011 17:29:49 +0000 (17:29 +0000)]
Remove assertion against empty NFSv4 ACLs.  An empty ACL is not exactly
valid - we don't allow for setting it on a file, for example - but it's
not something we should assert on.

For STABLE kernel, it changes nothing, because it's not compiled with
INVARIANTS.  If it was, it would fix crashes.  It also fixes an assert
in libc encountered with NFSv4 without nfsuserd(8) running.

Submitted by: Yuri Pankov (earlier version)
MFC after: 1 month

12 years agoSupply unique (st_dev, st_ino) value pair for the fstat(2) done on the pipes.
kib [Wed, 5 Oct 2011 16:56:06 +0000 (16:56 +0000)]
Supply unique (st_dev, st_ino) value pair for the fstat(2) done on the pipes.

Reviewed by: jhb, Peter Jeremy <peterjeremy acm org>
MFC after: 2 weeks

12 years agoExport devfs inode number allocator for the kernel consumers.
kib [Wed, 5 Oct 2011 16:50:15 +0000 (16:50 +0000)]
Export devfs inode number allocator for the kernel consumers.

Reviewed by: jhb
MFC after: 2 weeks

12 years agoThe IFA_RTSELF instead of the IFA_ROUTE flag should be checked to
qingli [Wed, 5 Oct 2011 16:27:11 +0000 (16:27 +0000)]
The IFA_RTSELF instead of the IFA_ROUTE flag should be checked to
determine if a loopback route should be installed for an interface
IPv6 address. Another condition is the address must not belong to a
looopback interface.

Reviewed by: hrs
MFC after: 3 days

12 years agoIgnore SRAT memory entries if the memory range does not overlap with an
jhb [Wed, 5 Oct 2011 16:03:47 +0000 (16:03 +0000)]
Ignore SRAT memory entries if the memory range does not overlap with an
existing phys_avail[] table.  If a hw.physmem setting causes a memory
domain to not be present in phys_avail[], the SRAT table will now be
ignored rather than triggering a panic when a CPU in the missing domain
tries to allocate a page.

MFC after: 1 week

12 years agoUpdate BSD grep to the latest development version. It has some code
gabor [Wed, 5 Oct 2011 09:56:43 +0000 (09:56 +0000)]
Update BSD grep to the latest development version.  It has some code
backported that was written for the TRE integration project in Google
Summer of Code 2011.  This is a temporary solution until the whole
regex library is not replaced so that BSD grep development can continue
and the backported code gets some review and testing.  This change only
improves scalability slightly, there is no big performance boost yet
but several minor bugs have been found and fixed.

Approved by: delphij (mentor)
Sposored by: Google Summer of Code 2011
MFC after: 1 week

12 years agoAdd missing newbus glue, this has never attached properly to gpiobus.
thompsa [Wed, 5 Oct 2011 08:33:50 +0000 (08:33 +0000)]
Add missing newbus glue, this has never attached properly to gpiobus.

12 years agoAdd strnlen() to libkern.
jkim [Tue, 4 Oct 2011 23:53:47 +0000 (23:53 +0000)]
Add strnlen() to libkern.

12 years agoportsnap: Detect error immediately if we can't fetch the snapshot metadata.
jilles [Tue, 4 Oct 2011 22:28:06 +0000 (22:28 +0000)]
portsnap: Detect error immediately if we can't fetch the snapshot metadata.

Also add some quotes around command substitution where useful and possible.

Reviewed by: cperciva
MFC after: 1 week

12 years agoWork around the autotools problem with the 10.0 version.
jilles [Tue, 4 Oct 2011 22:23:00 +0000 (22:23 +0000)]
Work around the autotools problem with the 10.0 version.

With this, I can build various ports on a 10.0-CURRENT system without
hacking or hiding the version number.

This commit should be reverted when there is a cleaner fix in autotools
and/or ports/Mk/bsd.port.mk.

The original patch is from Ed Schouten but needed some additions.

12 years agoAdd the 9750 SATA+SAS 6Gb/s RAID controller card driver, tws(4). Many
delphij [Tue, 4 Oct 2011 21:40:25 +0000 (21:40 +0000)]
Add the 9750 SATA+SAS 6Gb/s RAID controller card driver, tws(4).  Many
thanks for their contiued support to FreeBSD.

This is version 10.80.00.003 from codeset 10.2.1 [1]

Obtained from: LSI http://kb.lsi.com/Download16574.aspx [1]

12 years agoAdd default address for FLASH mapping on the boot bus.
marcel [Tue, 4 Oct 2011 20:30:15 +0000 (20:30 +0000)]
Add default address for FLASH mapping on the boot bus.

Reviewed by: jmallett, marcel
Obtained from: Juniper Networks, Inc
Author: Andrew Duane

12 years agoRemove octeon_bootinfo from all files except octeon_machdep.c.
marcel [Tue, 4 Oct 2011 20:17:43 +0000 (20:17 +0000)]
Remove octeon_bootinfo from all files except octeon_machdep.c.
Use instead cvmx_sysinfo_get() consistently.

Reviewed by: jmallett, marcel
Obtained from: Juniper Networks, Inc
Author: Andrew Duane

12 years agoFix a bug in UNIX socket handling in the linux emulator which was
cperciva [Tue, 4 Oct 2011 19:07:38 +0000 (19:07 +0000)]
Fix a bug in UNIX socket handling in the linux emulator which was
exposed by the security fix in FreeBSD-SA-11:05.unix.

Approved by: so (cperciva)
Approved by: re (kib)
Security: Related to FreeBSD-SA-11:05.unix, but not actually
a security fix.

12 years agoMove parts of the commit log for r166167, where Tor explained the
kib [Tue, 4 Oct 2011 18:45:29 +0000 (18:45 +0000)]
Move parts of the commit log for r166167, where Tor explained the
interaction between vnode locks and vfs_busy(), into comment.

MFC after: 1 week

12 years agoRemove bogus and wrong definition of BLKDEV_IOSIZE.
marcel [Tue, 4 Oct 2011 18:06:08 +0000 (18:06 +0000)]
Remove bogus and wrong definition of BLKDEV_IOSIZE.
Wrong in that it must be guarded (it's configurable)
and bogus in that there's absolutely no rationale for
it not default to a page size like all other archs.

12 years agoo Clean up some ID printfs, and put under bootverbose
marcel [Tue, 4 Oct 2011 18:03:55 +0000 (18:03 +0000)]
o   Clean up some ID printfs, and put under bootverbose
o   Remove redundant lookups of base address in cf_identify
o   Fix some indenting issues
o   Fix an identification bug that uses DRQ to checlk for ident block
    returned. The correct spec is to look for BSY to be cleared.

Reviewed by: imp, marcel
Obtained from: Juniper Networks, Inc
Author: Andrew Duane

12 years agoPartially revert r224661:
marcel [Tue, 4 Oct 2011 17:49:19 +0000 (17:49 +0000)]
Partially revert r224661:
octeon_ap_boot is not a bitmask. It holds the CPU Id of the
AP currently being started. As such there's no need to make
it a 64-bit integral and we're not limited to 64 CPUs.

Reported by: jmallet
Obtained from: Andre Duane

12 years agoMatch the files directive and all the ways to add or subtract options
marcel [Tue, 4 Oct 2011 17:11:38 +0000 (17:11 +0000)]
Match the files directive and all the ways to add or subtract options
and makeoptions by being a little smarter about REs.

12 years agoProperly guard definitions of DFLDSIZ, MAXDSIZ, DFLSSIZ, MAXSSIZ and
marcel [Tue, 4 Oct 2011 17:00:50 +0000 (17:00 +0000)]
Properly guard definitions of DFLDSIZ, MAXDSIZ, DFLSSIZ, MAXSSIZ and
SGROWSIZ. They can be set in the kernel configuration file.

12 years agoFix build when DEBUG is defined in the kernel configuration file (e.g.
marcel [Tue, 4 Oct 2011 16:58:20 +0000 (16:58 +0000)]
Fix build when DEBUG is defined in the kernel configuration file (e.g.
LINT).

12 years agoInclude opt_* headers first. Otherwise we can end up with redefined
marcel [Tue, 4 Oct 2011 16:55:53 +0000 (16:55 +0000)]
Include opt_* headers first. Otherwise we can end up with redefined
symbols.

12 years agoFix build when DEBUG is defined (e.g. for LINT).
marcel [Tue, 4 Oct 2011 16:53:11 +0000 (16:53 +0000)]
Fix build when DEBUG is defined (e.g. for LINT).

12 years agolatin1 -> utf8
des [Tue, 4 Oct 2011 15:00:54 +0000 (15:00 +0000)]
latin1 -> utf8

12 years agoActually enforce limit for inheritable resources on fork.
trasz [Tue, 4 Oct 2011 14:56:33 +0000 (14:56 +0000)]
Actually enforce limit for inheritable resources on fork.

MFC after: 3 days

12 years agoHandle the situation where fixups_close() has been called but more fixups
adrian [Tue, 4 Oct 2011 14:26:45 +0000 (14:26 +0000)]
Handle the situation where fixups_close() has been called but more fixups
are still available on the queue.

Without this, the fixups producer/consumer pipeline will artifically terminate
before all of the fixups have been processed, leading to incomplete updates
and generally quite unhappy users.

Submitted by: mux

12 years agoUpdate the comment to reflect what is actually going on.
adrian [Tue, 4 Oct 2011 14:25:10 +0000 (14:25 +0000)]
Update the comment to reflect what is actually going on.

Submitted by: mux

12 years agoMFi386: revision 225936
nyan [Tue, 4 Oct 2011 13:24:22 +0000 (13:24 +0000)]
MFi386: revision 225936

  Add some improvements in the idle table callbacks:
  - Replace instances of manual assembly instruction "hlt" call
    with halt() function calling.
  - In cpu_idle_mwait() avoid races in check to sched_runnable() using
    the same pattern used in cpu_idle_hlt() with the 'hlt' instruction.
  - Add comments explaining the logic behind the pattern used in
    cpu_idle_hlt() and other idle callbacks.

12 years agoRemove no longer valid statement about ARM.
kib [Tue, 4 Oct 2011 13:15:12 +0000 (13:15 +0000)]
Remove no longer valid statement about ARM.

MFC after: 1 month

12 years agoConvert ARM to the syscallenter/syscallret system call sequence handlers.
kib [Tue, 4 Oct 2011 13:14:24 +0000 (13:14 +0000)]
Convert ARM to the syscallenter/syscallret system call sequence handlers.

Tested by: gber
MFC after: 1 month

12 years agoAdd an AR5416 aware version of the "current RSSI" function.
adrian [Tue, 4 Oct 2011 00:32:10 +0000 (00:32 +0000)]
Add an AR5416 aware version of the "current RSSI" function.

Pre-11n devices and AR5416 use AR_PHY(263) for current RX RSSI.
AR9130 and later have a fourth calibration register (for doing
ADC calibration) and thus the register has moved to AR_PHY(271).

This isn't currently used by any of the active code; I'm committing
this for completeness and in case any third party code attempts to
use it for legacy reasons.

12 years agoAllow ixp425 boot2 to compile after r219452
thompsa [Tue, 4 Oct 2011 00:15:40 +0000 (00:15 +0000)]
Allow ixp425 boot2 to compile after r219452

12 years agoDon't chop IO into small pieces, follow cp(1) and just use MAXPHYS.
ivoras [Mon, 3 Oct 2011 21:48:10 +0000 (21:48 +0000)]
Don't chop IO into small pieces, follow cp(1) and just use MAXPHYS.

12 years agoRevert r225875, r225877:
mav [Mon, 3 Oct 2011 21:19:15 +0000 (21:19 +0000)]
Revert r225875, r225877:
It is reported that on some chips (e.g. the 970MP) behavior of POW bit set
simultaneously with modifying other bits is undefined and may cause hangs.
The race should be handled in some other way, but for now just get back.

Reported by: nwitehorn

12 years agoNow that its only consumer is gone (sysinstall), remove libftpio as well.
nwhitehorn [Mon, 3 Oct 2011 20:49:02 +0000 (20:49 +0000)]
Now that its only consumer is gone (sysinstall), remove libftpio as well.

12 years agoFix a number of platform problems in this file (mostly assuming that only
nwhitehorn [Mon, 3 Oct 2011 20:46:36 +0000 (20:46 +0000)]
Fix a number of platform problems in this file (mostly assuming that only
amd64 has lib32).

12 years agoAdd descriptor sense support to CAM, and honor sense residuals properly in
ken [Mon, 3 Oct 2011 20:32:55 +0000 (20:32 +0000)]
Add descriptor sense support to CAM, and honor sense residuals properly in
CAM.

Desriptor sense is a new sense data format that originated in SPC-3.  Among
other things, it allows for an 8-byte info field, which is necessary to
pass back block numbers larger than 4 bytes.

This change adds a number of new functions to scsi_all.c (and therefore
libcam) that abstract out most access to sense data.

This includes a bump of CAM_VERSION, because the CCB ABI has changed.
Userland programs that use the CAM pass(4) driver will need to be
recompiled.

camcontrol.c: Change uses of scsi_extract_sense() to use
scsi_extract_sense_len().

Use scsi_get_sks() instead of accessing sense key specific
data directly.

scsi_modes: Update the control mode page to the latest version (SPC-4).

scsi_cmds.c,
scsi_target.c: Change references to struct scsi_sense_data to struct
scsi_sense_data_fixed.  This should be changed to allow the
user to specify fixed or descriptor sense, and then use
scsi_set_sense_data() to build the sense data.

ps3cdrom.c: Use scsi_set_sense_data() instead of setting sense data
manually.

cam_periph.c: Use scsi_extract_sense_len() instead of using
scsi_extract_sense() or accessing sense data directly.

cam_ccb.h: Bump the CAM_VERSION from 0x15 to 0x16.  The change of
struct scsi_sense_data from 32 to 252 bytes changes the
size of struct ccb_scsiio, but not the size of union ccb.
So the version must be bumped to prevent structure
mis-matches.

scsi_all.h: Lots of updated SCSI sense data and other structures.

Add function prototypes for the new sense data functions.

Take out the inline implementation of scsi_extract_sense().
It is now too large to put in a header file.

Add macros to calculate whether fields are present and
filled in fixed and descriptor sense data

scsi_all.c: In scsi_op_desc(), allow the user to pass in NULL inquiry
data, and we'll assume a direct access device in that case.

Changed the SCSI RESERVED sense key name and description
to COMPLETED, as it is now defined in the spec.

Change the error recovery action for a number of read errors
to prevent lots of retries when the drive has said that the
block isn't accessible.  This speeds up reconstruction of
the block by any RAID software running on top of the drive
(e.g. ZFS).

In scsi_sense_desc(), allow for invalid sense key numbers.
This allows calling this routine without checking the input
values first.

Change scsi_error_action() to use scsi_extract_sense_len(),
and handle things when invalid asc/ascq values are
encountered.

Add a new routine, scsi_desc_iterate(), that will call the
supplied function for every descriptor in descriptor format
sense data.

Add scsi_set_sense_data(), and scsi_set_sense_data_va(),
which build descriptor and fixed format sense data.  They
currently default to fixed format sense data.

Add a number of scsi_get_*() functions, which get different
types of sense data fields from either fixed or descriptor
format sense data, if the data is present.

Add a number of scsi_*_sbuf() functions, which print
formatted versions of various sense data fields.  These
functions work for either fixed or descriptor sense.

Add a number of scsi_sense_*_sbuf() functions, which have a
standard calling interface and print the indicated field.
These functions take descriptors only.

Add scsi_sense_desc_sbuf(), which will print a formatted
version of the given sense descriptor.

Pull out a majority of the scsi_sense_sbuf() function and
put it into scsi_sense_only_sbuf().  This allows callers
that don't use struct ccb_scsiio to easily utilize the
printing routines.  Revamp that function to handle
descriptor sense and use the new sense fetching and
printing routines.

Move scsi_extract_sense() into scsi_all.c, and implement it
in terms of the new function, scsi_extract_sense_len().
The _len() version takes a length (which should be the
sense length - residual) and can indicate which fields are
present and valid in the sense data.

Add a couple of new scsi_get_*() routines to get the sense
key, asc, and ascq only.

mly.c: Rename struct scsi_sense_data to struct
scsi_sense_data_fixed.

sbp_targ.c: Use the new sense fetching routines to get sense data
instead of accessing it directly.

sbp.c: Change the firewire/SCSI sense data transformation code to
use struct scsi_sense_data_fixed instead of struct
scsi_sense_data.  This should be changed later to use
scsi_set_sense_data().

ciss.c: Calculate the sense residual properly.  Use
scsi_get_sense_key() to fetch the sense key.

mps_sas.c,
mpt_cam.c: Set the sense residual properly.

iir.c: Use scsi_set_sense_data() instead of building sense data by
hand.

iscsi_subr.c: Use scsi_extract_sense_len() instead of grabbing sense data
directly.

umass.c: Use scsi_set_sense_data() to build sense data.

Grab the sense key using scsi_get_sense_key().

Calculate the sense residual properly.

isp_freebsd.h: Use scsi_get_*() routines to grab asc, ascq, and sense key
values.

Calculate and set the sense residual.

MFC after: 3 days
Sponsored by: Spectra Logic Corporation

12 years agoA system may have multiple physical interfaces, all of which are on the
qingli [Mon, 3 Oct 2011 19:51:18 +0000 (19:51 +0000)]
A system may have multiple physical interfaces, all of which are on the
same prefix. Since a single route entry is installed for the prefix
(without RADIX_MPATH), incoming packets on the interfaces that are not
associated with the prefix route may trigger an error message about
unable to allocation LLE entry, and fails L2. This patch makes sure a
valid route is present in the system, and allow the aforementioned
condition to exist and treats as valid.

Reviewed by: bz
MFC after: 5 days

12 years agoThis patch allows ARP to work properly in the presence of
qingli [Mon, 3 Oct 2011 19:06:55 +0000 (19:06 +0000)]
This patch allows ARP to work properly in the presence of
self-referencing routes. This patch is a rework of r223862.

Reviewed by: bz, zec
MFC after: 5 days

12 years agoRemove a redundant check for libncp.
jkim [Mon, 3 Oct 2011 18:05:51 +0000 (18:05 +0000)]
Remove a redundant check for libncp.

Submitted by: Alexander Sack (asack at niksun dot com)

12 years agoMove some code inside the racct_proc_fork(); it spares a few lock operations
trasz [Mon, 3 Oct 2011 17:40:55 +0000 (17:40 +0000)]
Move some code inside the racct_proc_fork(); it spares a few lock operations
and it's more logical this way.

MFC after: 3 days

12 years agoDo not allow the kernel to access usermode pages without installed
kib [Mon, 3 Oct 2011 17:01:31 +0000 (17:01 +0000)]
Do not allow the kernel to access usermode pages without installed
fault handler. Panic immediately in such situation, on i386 and amd64.

Reviewed by: avg, jhb
MFC after: 1 week

12 years agoAssert that exiting process does not return to usermode.
kib [Mon, 3 Oct 2011 16:58:58 +0000 (16:58 +0000)]
Assert that exiting process does not return to usermode.

Reviewed by: avg, jhb
MFC after: 1 week

12 years agoFix an unaligned access issue; tidy up OFDM/DS rate decoding from the PLCP.
adrian [Mon, 3 Oct 2011 16:30:18 +0000 (16:30 +0000)]
Fix an unaligned access issue; tidy up OFDM/DS rate decoding from the PLCP.

This fixes a panic on PPC.

Submitted by: novel
Obtained from: OpenBSD, sys/dev/ic/bwi.c r1.89

12 years agoFix another bug introduced in r225641, which caused rctl to access certain
trasz [Mon, 3 Oct 2011 16:23:20 +0000 (16:23 +0000)]
Fix another bug introduced in r225641, which caused rctl to access certain
fields in 'struct proc' before they got initialized in do_fork().

MFC after: 3 days

12 years agoFix bug introduced in r225641, which would cause panic if racct_proc_fork()
trasz [Mon, 3 Oct 2011 15:32:15 +0000 (15:32 +0000)]
Fix bug introduced in r225641, which would cause panic if racct_proc_fork()
returned error -- the racct_destroy_locked() would get called twice.

MFC after: 3 days

12 years agoFarewall, sysinstall! You served us well for many years, but 10.0 is one
nwhitehorn [Mon, 3 Oct 2011 15:13:09 +0000 (15:13 +0000)]
Farewall, sysinstall! You served us well for many years, but 10.0 is one
digit beyond your time.

Various sysinstall dependencies (e.g. libftpio, libdisk, libodialog, etc.)
will be cleaned up in coming days. Some will take longer than others due to
a few other consumers (tzsetup and sade).

12 years agoAdd some improvements in the idle table callbacks:
attilio [Mon, 3 Oct 2011 14:23:00 +0000 (14:23 +0000)]
Add some improvements in the idle table callbacks:
- Replace instances of manual assembly instruction "hlt" call
  with halt() function calling.
- In cpu_idle_mwait() avoid races in check to sched_runnable() using
  the same pattern used in cpu_idle_hlt() with the 'hlt' instruction.
- Add comments explaining the logic behind the pattern used in
  cpu_idle_hlt() and other idle callbacks.

In collabouration with: jhb, mav
Reviewed by: adri, kib
MFC after: 3 weeks

12 years agoPort over the radar pulse decoding code common to the AR5416 and later chipsets.
adrian [Mon, 3 Oct 2011 12:12:03 +0000 (12:12 +0000)]
Port over the radar pulse decoding code common to the AR5416 and later chipsets.

Obtained from: Atheros

12 years agoActually enable NEW_PCIB by default, missed in r225931.
marius [Sun, 2 Oct 2011 23:31:14 +0000 (23:31 +0000)]
Actually enable NEW_PCIB by default, missed in r225931.

12 years agoMake sparc64 compatible with NEW_PCIB and enable it:
marius [Sun, 2 Oct 2011 23:22:38 +0000 (23:22 +0000)]
Make sparc64 compatible with NEW_PCIB and enable it:
- Implement bus_adjust_resource() methods as far as necessary and in non-PCI
  bridge drivers as far as feasible without rototilling them.
- As NEW_PCIB does a layering violation by activating resources at layers
  above pci(4) without previously bubbling up their allocation there, move
  the assignment of bus tags and handles from the bus_alloc_resource() to
  the bus_activate_resource() methods like at least the other NEW_PCIB
  enabled architectures do. This is somewhat unfortunate as previously
  sparc64 (ab)used resource activation to indicate whether SYS_RES_MEMORY
  resources should be mapped into KVA, which is only necessary if their
  going to be accessed via the pointer returned from rman_get_virtual() but
  not for bus_space(9) as the later always uses physical access on sparc64.
  Besides wasting KVA if we always map in SYS_RES_MEMORY resources, a driver
  also may deliberately not map them in if the firmware already has done so,
  possibly in a special way. So in order to still allow a driver to decide
  whether a SYS_RES_MEMORY resource should be mapped into KVA we let it
  indicate that by calling bus_space_map(9) with BUS_SPACE_MAP_LINEAR as
  actually documented in the bus_space(9) page. This is implemented by
  allocating a separate bus tag per SYS_RES_MEMORY resource and passing the
  resource via the previously unused bus tag cookie so we later on can call
  rman_set_virtual() in sparc64_bus_mem_map(). As a side effect this now
  also allows to actually indicate that a SYS_RES_MEMORY resource should be
  mapped in as cacheable and/or read-only via BUS_SPACE_MAP_CACHEABLE and
  BUS_SPACE_MAP_READONLY respectively.
- Do some minor cleanup like taking advantage of rman_init_from_resource(),
  factor out the common part of bus tag allocation into a newly added
  sparc64_alloc_bus_tag(), hook up some missing newbus methods and replace
  some homegrown versions with the generic counterparts etc.
- While at it, let apb_attach() (which can't use the generic NEW_PCIB code
  as APB bridges just don't have the base and limit registers implemented)
  regarding the config space registers cached in pcib_softc and the SYSCTL
  reporting nodes set up.

12 years agoCorrect a typo that was introduced in 225912
gjb [Sun, 2 Oct 2011 16:05:19 +0000 (16:05 +0000)]
Correct a typo that was introduced in 225912

Submitted by: Valentin Nechayev (netch % netch!kiev!ua), arundel
MFC after: 1 week
With-MFC: 225908

12 years agoRemove an unused variable.
adrian [Sun, 2 Oct 2011 14:10:25 +0000 (14:10 +0000)]
Remove an unused variable.

12 years agoVarious interrupt handling and RX interrupt mitigation fixes.
adrian [Sun, 2 Oct 2011 14:08:56 +0000 (14:08 +0000)]
Various interrupt handling and RX interrupt mitigation fixes.

* The AR_ISR_RAC interrupt processing method has a subtle bug in all
  the MAC revisions (including pre-11n NICs) until AR9300v2.
  If you're unlucky, the clear phase clears an update to one of the
  secondary registers, which includes TX status.

  This shows up as a "watchdog timeout" if you're doing very low levels
  of TX traffic. If you're doing a lot of non-11n TX traffic, you'll
  end up receiving a TX interrupt from some later traffic anyway.

  But when TX'ing 11n aggregation session traffic (which -HEAD isn't yet
  doing), you may find that you're only able to TX one frame (due to
  BAW restrictions) and this may end up hitting this race condition.

  The only solution is to not use RAC and instead use AR_ISR and the
  AR_ISR_Sx registers. The bit in AR_ISR which represents the secondary
  registers are not cleared; only the AR_ISR_Sx bits are. This way
  any updates which occur between the read and subsequent write will
  stay asserted and (correctly) trigger a subsequent interrupt.

  I've tested this on the AR5416, AR9160, AR9280. I will soon test
  the AR9285 and AR9287.

* The AR_ISR TX and RX bits (and all others!) are set regardless of
  whether the contents of the AR_IMR register. So if RX mitigation is
  enabled, RXOK is going to be set in AR_ISR and it would normally set
  HAL_INT_RX.

  Fix the code to not set HAL_INT_RX when RXOK is set and RX mitigation
  is compiled in. That way the RX path isn't prematurely called.

  I would see:

  * An interrupt would come in (eg a beacon, or TX completion) where
    RXOK was set but RXINTM/RXMINT wasn't;
  * ath_rx_proc() be called - completing RX frames;
  * RXINTM/RXMINT would then fire;
  * ath_rx_proc() would then be called again but find no frames in the
    queue.

  This fixes the RX mitigation behaviour to not overly call ath_rx_proc().

* Start to flesh out more correct timer interrupt handling - it isn't
  kite/merlin specific. It's actually based on whether autosleep support
  is enabled or not.

This is sourced from my 11n TX branch and has been tested for a few weeks.

Finally, the interrupt handling change should likely be implemented
for AR5210, AR5211 and AR5212.

12 years agoDocument exactly what the RX interrupt mitigation timers do.
adrian [Sun, 2 Oct 2011 13:51:26 +0000 (13:51 +0000)]
Document exactly what the RX interrupt mitigation timers do.

12 years agoFor now (ie: until autosleep support is fully fleshed out), always clear
adrian [Sun, 2 Oct 2011 13:47:03 +0000 (13:47 +0000)]
For now (ie: until autosleep support is fully fleshed out), always clear
all of the RX status fields when initialising a new RX descriptor.

12 years agoDisable TX interrupt mitigation just for the time being.
adrian [Sun, 2 Oct 2011 13:43:06 +0000 (13:43 +0000)]
Disable TX interrupt mitigation just for the time being.

There are some timing concerns which I've yet to fully map out.
In any case, there's an existing software driven mitigation method
for TX interrupts and when TX'ing 11n frames, the whole frame itself
generates an interrupt rather then the subframes.

12 years agoFix a panic in the wifi stack when a software beacon miss occurs in the wrong state.
adrian [Sun, 2 Oct 2011 02:42:31 +0000 (02:42 +0000)]
Fix a panic in the wifi stack when a software beacon miss occurs in the wrong state.

The ieee80211_swbmiss() callout is not called with the ic lock held, so it's
quite possible the scheduler will run the callout during a state change.

This patch:

* changes the swbmiss callout to be locked by the ic lock
* enforces the ic lock being held across the beacon vap functions
  by grabbing it inside beacon_miss() and beacon_swmiss().

This ensures that the ic lock is held (and thus the VAP state
stays constant) during beacon miss and software miss processing.
Since the callout is removed whilst the ic lock is held, it also
ensures that the ic lock can't be called during a state change
or exhibit any race conditions seen above.

Both Edgar and Joel report that this patch fixes the crash and
doesn't introduce new issues.

Reported by: Edgar Martinez <emartinez@kbcnetworks.com>
Reported by: Joel Dahl <joel@vnode.se>
Reported by: emaste

12 years agoTweaks to ps(1):
gjb [Sat, 1 Oct 2011 23:47:37 +0000 (23:47 +0000)]
Tweaks to ps(1):
- there's no reason the semantics of the -x flag are being explained in
  the -a flag description
- be more precise regarding the relation between the -a flag and the
  security.bsd.see_other_uids sysctl
- describe the format of the -t flag's argument
- 'con' no longer is a possible entry in the 'TT' column
- explain that the 'TT' column refers to pseudo-terminals via mere numbers
- add a hint in the 'tt' keyword description that a keyword 'tty' exists,
  which will give the full terminal pathname

Submitted by: arundel (via docs@) (original)
MFC after: 1 week
With-MFC: 225908

12 years agoReorder default ps(1) output according to reality.
gjb [Sat, 1 Oct 2011 20:56:58 +0000 (20:56 +0000)]
Reorder default ps(1) output according to reality.

Submitted by: arundel (via docs@)
MFC after: 1 week

12 years agoShut up warnings with Cyrus SASL 2.1.25.
ume [Sat, 1 Oct 2011 18:20:10 +0000 (18:20 +0000)]
Shut up warnings with Cyrus SASL 2.1.25.

Spotted by: ache
Tested by: ache

12 years agoRemove obsolete macros.
marius [Sat, 1 Oct 2011 13:33:14 +0000 (13:33 +0000)]
Remove obsolete macros.

12 years agoNuke SUN4U #ifdef's which with the demise of sun4v no longer serve any
marius [Sat, 1 Oct 2011 13:16:01 +0000 (13:16 +0000)]
Nuke SUN4U #ifdef's which with the demise of sun4v no longer serve any
purpose.

12 years agoAlso allocate space for the PIL counters. Given that no machine actually
marius [Sat, 1 Oct 2011 13:11:29 +0000 (13:11 +0000)]
Also allocate space for the PIL counters. Given that no machine actually
uses IV_MAX interrupt vectors this wasn't a problem in practice though.