]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
12 years agoFix the dependency issue properly by a) moving kdump_subr.c to the front
Dag-Erling Smørgrav [Sat, 8 Oct 2011 12:59:41 +0000 (12:59 +0000)]
Fix the dependency issue properly by a) moving kdump_subr.c to the front
of the SRCS list and b) listing kdump_subr.h in DPSRCS.

12 years agoBring ioctlname() in line with all the other *name() functions, which
Dag-Erling Smørgrav [Sat, 8 Oct 2011 12:47:00 +0000 (12:47 +0000)]
Bring ioctlname() in line with all the other *name() functions, which
actually print the name (or the numeric value, if they can't figure out
the correct name) instead of just returning a pointer to it.  Also, since
ioctl numbers are not and probably never will be unique, drop support for
using a switch statement instead of an if/else chain.

12 years agoHandle the R_386_TLS_TPOFF32 relocation, which is similar to R_386_TLS_TPOFF,
Konstantin Belousov [Sat, 8 Oct 2011 12:42:19 +0000 (12:42 +0000)]
Handle the R_386_TLS_TPOFF32 relocation, which is similar to R_386_TLS_TPOFF,
but with negative relocation value.

Found by: mpfr test suite, pointed to by ale
Reviewed by: kan
MFC after: 1 week

12 years agoSetting up TLS block for the main thread must be done after the
Konstantin Belousov [Sat, 8 Oct 2011 12:39:47 +0000 (12:39 +0000)]
Setting up TLS block for the main thread must be done after the
relocations are processed, since tls initialization section might be
itself subject for relocations. Only set up of the block is postponed,
the tls block offsets are allocated before relocation processing, since
TLS-related relocations may need offsets ready.

Reported by: ale
PR: threads/161344
Reviewed by: kan
MFC after: 1 week

12 years ago- Follow the lead of dcphy(4) and pnphy(4) and move the reminder of the PHY
Marius Strobl [Sat, 8 Oct 2011 12:33:10 +0000 (12:33 +0000)]
- Follow the lead of dcphy(4) and pnphy(4) and move the reminder of the PHY
  drivers that only ever attach to a particular MAC driver, i.e. inphy(4),
  ruephy(4) and xlphy(4), to the directory where the respective MAC driver
  lives and only compile it into the kernel when the latter is also there,
  also removing it from miibus.ko and moving it into the module of the
  respective MAC driver.
- While at it, rename exphy.c, which comes from NetBSD where the MAC driver
  it corresponds to also is named ex(4) instead of xl(4) but that in FreeBSD
  actually identifies itself as xlphy(4), and its function names accordingly
  for consistency.
- Additionally while at it, fix some minor style issues like whitespace
  in the register headers and add multi-inclusion protection to inphyreg.h.

12 years agoI appreciate the logic behind using a (void) cast to indicate that the
Dag-Erling Smørgrav [Sat, 8 Oct 2011 12:28:06 +0000 (12:28 +0000)]
I appreciate the logic behind using a (void) cast to indicate that the
return value is intentionally ignored, but frankly, all it does is
get in the way of the code.

Also fix a few other incorrect casts, such as (void *)malloc(foo) and
passing signed values to %x.

12 years agoFix casting.
Dag-Erling Smørgrav [Sat, 8 Oct 2011 12:21:51 +0000 (12:21 +0000)]
Fix casting.

12 years agoWhitespace.
Dag-Erling Smørgrav [Sat, 8 Oct 2011 12:10:16 +0000 (12:10 +0000)]
Whitespace.

12 years agoFix an infinite loop in siba_bwn_suspend().
Christian Brueffer [Sat, 8 Oct 2011 12:09:57 +0000 (12:09 +0000)]
Fix an infinite loop in siba_bwn_suspend().

CID: 3536
Found with: Coverity Prevent(tm)
MFC after: 1 week

12 years agoC has had swicth statements for 40 years or so. It's about time we
Dag-Erling Smørgrav [Sat, 8 Oct 2011 11:51:48 +0000 (11:51 +0000)]
C has had swicth statements for 40 years or so.  It's about time we
started using them.

12 years agoSort and line up.
Dag-Erling Smørgrav [Sat, 8 Oct 2011 11:39:00 +0000 (11:39 +0000)]
Sort and line up.

12 years agoRemove dead code, "error" doesn't change between this check and the
Christian Brueffer [Sat, 8 Oct 2011 10:50:48 +0000 (10:50 +0000)]
Remove dead code, "error" doesn't change between this check and the
previous one.

CID: 3254
Found with: Coverity Prevent(tm)
MFC after: 1 week

12 years ago1) Some of the #defines or enums for which we auto-generate naming
Dag-Erling Smørgrav [Sat, 8 Oct 2011 09:57:29 +0000 (09:57 +0000)]
1) Some of the #defines or enums for which we auto-generate naming
   functions may be wider than int, so use intmax_t throughout.  Also
   add missing casts in printf() calls.

2) Clean up some of the auto-generated code to improve readability.

3) Auto-generate kdump_subr.h.  Note that this requires a semi-ugly hack
   in the Makefile to make sure it is generated before make(1) tries to
   build kdump.c, or preprocess it for 'make depend'.

MFC after: 3 weeks

12 years agoRemove two dublicated assignments.
Christian Brueffer [Sat, 8 Oct 2011 09:14:18 +0000 (09:14 +0000)]
Remove two dublicated assignments.

CID: 9870
Found with: Coverity Prevent(tm)
Confirmed by: rwatson
MFC after: 1 week

12 years agoRemove extraneous WARNS=7.
Ed Schouten [Sat, 8 Oct 2011 07:20:12 +0000 (07:20 +0000)]
Remove extraneous WARNS=7.

WARNS above 6 has no use. Also, all of usr.bin is also built with
WARNS=6 by default.

Discussed with: edwin

12 years ago- Add a couple of more sed subsitutions needed to get the correct
Stanislav Sedov [Sat, 8 Oct 2011 00:01:17 +0000 (00:01 +0000)]
- Add a couple of more sed subsitutions needed to get the correct
  libtool.m4.  With these fixes libtool will correctly indentify the
  system as ELF (and not a.out).
- While here, change the substitutions so they're still correctly
  match freebsd1.x, freebsd2.x etc.

12 years agoBCE_MISC_ID register of BCM5716 returns the same id of BCM5709 so
Pyun YongHyeon [Sat, 8 Oct 2011 00:00:54 +0000 (00:00 +0000)]
BCE_MISC_ID register of BCM5716 returns the same id of BCM5709 so
remove explicit checks for BCM5716.
The BCM5709 and BCM5716 chips are virtually indistinguishable by
software except for the PCI device ID.  The two chips differ in
that BCM5709 supports TCP/IP and iSCSI offload in Windows while
the BCM5716 doesn't.
While I'm here remove now unused definition of BCE_CHIP_NUM_5716
and BCE_CHIP_ID_5716_C0.

Reported by: sbruno
Reviewed by: davidch
Tested by: davidch

12 years ago- ${WRKSRC} might be missing when the autotools fixup is running.
Stanislav Sedov [Fri, 7 Oct 2011 23:43:51 +0000 (23:43 +0000)]
- ${WRKSRC} might be missing when the autotools fixup is running.
  Account for this.

Reported by: Mykola Dzham <i@levsha.me>

12 years agoAdd myself.
Jakub Wojciech Klama [Fri, 7 Oct 2011 23:12:33 +0000 (23:12 +0000)]
Add myself.

Approved by: wkoszek (mentor)

12 years agoDo not try removing an ARP entry associated with a given interface
Qing Li [Fri, 7 Oct 2011 22:22:19 +0000 (22:22 +0000)]
Do not try removing an ARP entry associated with a given interface
address if that interface does not support ARP. Otherwise the
system will generate error messages unnecessarily due to the missing
entry.

PR: kern/159602
Submitted by: pluknet
MFC after: 3 days

12 years agoMention tdsignal(9).
Dag-Erling Smørgrav [Fri, 7 Oct 2011 22:14:18 +0000 (22:14 +0000)]
Mention tdsignal(9).

MFC after: 1 week

12 years agoSync with ahc(4)/ahd(4)/sym(4) etc:
Marius Strobl [Fri, 7 Oct 2011 21:23:42 +0000 (21:23 +0000)]
Sync with ahc(4)/ahd(4)/sym(4) etc:
Zero any sense not transferred by the device as the SCSI specification
mandates that any untransferred data should be assumed to be zero.

Reviewed by: ken

12 years agoAdd missing va_end() in an error case to clean up after va_start()
Christian Brueffer [Fri, 7 Oct 2011 21:00:26 +0000 (21:00 +0000)]
Add missing va_end() in an error case to clean up after va_start()
(already done in the non-error case).

CID: 4726
Found with: Coverity Prevent(tm)
MFC after: 1 week

12 years agoAdd missing va_end() to clean up after va_start().
Christian Brueffer [Fri, 7 Oct 2011 20:54:12 +0000 (20:54 +0000)]
Add missing va_end() to clean up after va_start().

CID: 4725
Found with: Coverity Prevent(tm)
MFC after: 1 week

12 years agoRemove the reference held on the loopback route when the interface
Qing Li [Fri, 7 Oct 2011 18:01:34 +0000 (18:01 +0000)]
Remove the reference held on the loopback route when the interface
address is being deleted. Only the last reference holder deletes the
loopback route. All other delete operations just clear the IFA_RTSELF
flag.

PR: kern/159601
Submitted by: pluknet
Reviewed by: discussed on net@
MFC after: 3 days

12 years agoPrevent TCP sessions from stalling indefinitely in reassembly
Andre Oppermann [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.
Konstantin Belousov [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 Schouten [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 Oppermann [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.
Rick Macklem [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
Dag-Erling Smørgrav [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.
Dag-Erling Smørgrav [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 Schouten [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 Schouten [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 Anderson [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 Strobl [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 Chadd [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.
David E. O'Brien [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.
David E. O'Brien [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
Nathan Whitehorn [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.
Xin LI [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
Rick Macklem [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.
Jung-uk Kim [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.
Jung-uk Kim [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.
Jung-uk Kim [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.
Jung-uk Kim [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.
Jung-uk Kim [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.
Jung-uk Kim [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.
Jung-uk Kim [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.
Jung-uk Kim [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.
Konstantin Belousov [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.
Konstantin Belousov [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.
Wesley Shields [Thu, 6 Oct 2011 16:13:47 +0000 (16:13 +0000)]
Fix a typo in a comment.

Approved by: kib@

12 years agoAdd myself.
Alexander V. Chernikov [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 Rao [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
Nathan Whitehorn [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
Nathan Whitehorn [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 Strobl [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 Strobl [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.
Xin LI [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.
Dag-Erling Smørgrav [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
Edward Tomasz Napierala [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.
Konstantin Belousov [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.
Konstantin Belousov [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
Qing Li [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
John Baldwin [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 Kovesdan [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.
Andrew Thompson [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.
Jung-uk Kim [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 Tjoelker [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 Tjoelker [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
Xin LI [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 Moolenaar [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 Moolenaar [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
Colin Percival [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
Konstantin Belousov [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 Moolenaar [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 Moolenaar [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 Moolenaar [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 Moolenaar [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 Moolenaar [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 Moolenaar [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 Moolenaar [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 Moolenaar [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
Dag-Erling Smørgrav [Tue, 4 Oct 2011 15:00:54 +0000 (15:00 +0000)]
latin1 -> utf8

12 years agoActually enforce limit for inheritable resources on fork.
Edward Tomasz Napierala [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 Chadd [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 Chadd [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
Yoshihiro Takahashi [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.
Konstantin Belousov [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.
Konstantin Belousov [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 Chadd [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
Andrew Thompson [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.
Ivan Voras [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:
Alexander Motin [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.
Nathan Whitehorn [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
Nathan Whitehorn [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
Kenneth D. Merry [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
Qing Li [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
Qing Li [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