]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/log
FreeBSD/stable/9.git
11 years agoRedo r241528:
delphij [Fri, 15 Mar 2013 18:10:38 +0000 (18:10 +0000)]
Redo r241528:

MFC r240339: openssl: change SHLIB_VERSION_NUMBER to reflect the reality.

git-svn-id: svn://svn.freebsd.org/base/stable/9@248334 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC the second half of r246784:
brooks [Fri, 15 Mar 2013 15:34:09 +0000 (15:34 +0000)]
MFC the second half of r246784:

- Fix libmd dependency.  It is needed in the bootstrap library list because
  usr.bin/xinstall depends on it.

git-svn-id: svn://svn.freebsd.org/base/stable/9@248333 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r245751,245893:
brooks [Fri, 15 Mar 2013 15:21:34 +0000 (15:21 +0000)]
MFC r245751,245893:

r245751:
Implement the -l option using ln(1) to facilitate boostrapping.

Ignore the new options -D, -h, -T, and -U.  Adjust -M support to ignore
an argument.

Sponsored by: DARPA, AFRL
Reviewed by: ian, ray, rpaulo

r245893:
Use = not == in test arguments.

Submitted by: Christoph Mallon <christoph.mallon@gmx.de>

git-svn-id: svn://svn.freebsd.org/base/stable/9@248332 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC all changes to install(1) through r246784. Notable functional
brooks [Fri, 15 Mar 2013 15:19:33 +0000 (15:19 +0000)]
MFC all changes to install(1) through r246784.  Notable functional
changes are:

r245617:
Introduce six new options from NetBSD:
 * -M <metalog>   Log metadata in mtree format.
 * -D <destdir>   Log paths relative to <destdir>.
 * -h <hash>      Log digest of type <hash>.
 * -T <tags>      Specify which mtree tags to log.
 * -l <linkflag>  Create hard or symbolic links (allows logging).
 * -U             Install without root privileges (owner, group, mode,
                  and flags can be logged via -M

NOTE: In the interest of compatibility with NetBSD and because it is the
obvious letter, the nearly useless -M option (disable mmap) has been
repurposed.

Sponsored by: DARPA, AFRL
Obtained from: NetBSD
Reviewed by: bz

r245312:
Implement the -N <dbdir> option which allows an alternate passwd and
group file to be used.  This is useful for installing on systems where
a user or group does not currently exist.

Sponsored by: DARPA, AFRL
Obtained from: NetBSD

git-svn-id: svn://svn.freebsd.org/base/stable/9@248331 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r245311:
brooks [Fri, 15 Mar 2013 14:53:29 +0000 (14:53 +0000)]
MFC r245311:

Add pwcache(3) and vis(3) to libegacy as install(1) is about to grow a
dependency on them.

Sponsored by: DARPA, AFRL

git-svn-id: svn://svn.freebsd.org/base/stable/9@248330 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoAdd support for installation directly via HTTP.
dteske [Fri, 15 Mar 2013 05:00:51 +0000 (05:00 +0000)]
Add support for installation directly via HTTP.

Submitted by: Rick Miller <vmiller@hostileadmin.com>
Reviewed by: jkh

git-svn-id: svn://svn.freebsd.org/base/stable/9@248313 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMerge of current of tzdata2013b
edwin [Fri, 15 Mar 2013 01:02:35 +0000 (01:02 +0000)]
Merge of current of tzdata2013b

Lots of historical data added.

Morocco: add DST rules for the coming years
Cuba: Doing DST in 2013.
Chili: Will do DST in 2013 as it seems

git-svn-id: svn://svn.freebsd.org/base/stable/9@248310 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC all change to makefs through r247052. Key functional changes
brooks [Thu, 14 Mar 2013 22:57:27 +0000 (22:57 +0000)]
MFC all change to makefs through r247052.  Key functional changes
include:

r239562:
Add -p flag to create the image as a sparse file.

r242501:
If no contents keyword is specified, the default for files is
the named file.

r247041:
Add a -D flag that causes duplicate entries in an mtree manifest to be
treated as warnings rather than errors.

r247042:
Fix the -N option in manifest mode by using pwcache(3).  This also
speeds up image creation appreciably.

r247043:
Allow '.' components in manifest paths.  They are always the first
component of mtree -C and install -M output and are easily skipped.

r247052:
Support hardlinks in manifest files by the same logic as the treewalk
code.

git-svn-id: svn://svn.freebsd.org/base/stable/9@248293 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC of the E1000 drivers including revisions:
jfv [Thu, 14 Mar 2013 22:55:59 +0000 (22:55 +0000)]
MFC of the E1000 drivers including revisions:
------------------------------------------------------------------------
r238765 | luigi | 2012-07-25 04:28:15 -0700 (Wed, 25 Jul 2012) | 7 lines
Use legacy interrupts as a default. This gives up to 10% speedup
when used in qemu (and this driver is for non-PCIe cards,
so probably its largest use is in virtualized environments).
------------------------------------------------------------------------
r238770 | luigi | 2012-07-25 05:51:33 -0700 (Wed, 25 Jul 2012) | 4 lines
remove some extra testing code that slipped into the previous commit
------------------------------------------------------------------------
r238953 | jfv | 2012-07-31 11:44:10 -0700 (Tue, 31 Jul 2012) | 6 lines
Clean up some unused leftover code from em
Make IRQ style a tuneable
Fix lock handling in the interrupt handler
------------------------------------------------------------------------
r238981 | sbruno | 2012-08-01 17:00:34 -0700 (Wed, 01 Aug 2012) | 9 lines
CPU_NEXT() already handles wrapping around to the beginning.  Also, in a
system with sparse CPU IDs, you can have a valid CPU ID > mp_ncpus (e.g. if
you have two CPUs 0 and 4, with mp_maxid == 4 and mp_ncpus == 2).
------------------------------------------------------------------------
r239105 | jfv | 2012-08-06 13:44:05 -0700 (Mon, 06 Aug 2012) | 5 lines
Correct the mq_start routine to avoid out-of-order
packet delivery, always enqueue when possible. Also
correct the DEPLETED test as multiple bits might be
set.  Thanks to Randall Stewart for the changes!
------------------------------------------------------------------------
r239109 | jfv | 2012-08-06 15:43:49 -0700 (Mon, 06 Aug 2012) | 6 lines
Make the polling interface in igb able to handle
multiqueue, and correct the rxdone handling. Update
the polling man page to include igb as well.
------------------------------------------------------------------------
r239304 | jfv | 2012-08-15 10:12:40 -0700 (Wed, 15 Aug 2012) | 10 lines
Customer report of a panic on boot due to the old
"m_getjcl:invalid cluster type" that occurred some
time back with the igb driver. This happens often when
booting over the net. I believe the NIC hardware is left
in a warm state when handed over to the driver, and a stray
RX interrupt happens earlier than the code is prepared for
it to happen. This change was verified to fix the problem,
its kind of a bandaid... but it is similar to what was done
in the igb code.
------------------------------------------------------------------------
r240693 | gavin | 2012-09-19 05:27:23 -0700 (Wed, 19 Sep 2012) | 5 lines
Switch some PCI register reads from using magic numbers to using the names
defined in pcireg.h
------------------------------------------------------------------------
r241856 | eadler | 2012-10-21 20:41:14 -0700 (Sun, 21 Oct 2012) | 7 lines
Now that device disabling is generic, remove extraneous code from the
device drivers that used to provide this feature.
------------------------------------------------------------------------
r241885 | eadler | 2012-10-22 06:06:09 -0700 (Mon, 22 Oct 2012) | 7 lines
This isn't functionally identical.  In some cases a hint to disable
unit 0 would in fact disable all units.  This reverts r241856
------------------------------------------------------------------------
r243570 | glebius | 2012-11-26 12:03:57 -0800 (Mon, 26 Nov 2012) | 14 lines
  drbr_enqueue() awlays consumes mbuf, no matter did it
fail or not. The mbuf pointer is no longer valid, so
can't be reused after.
  Fix igb_mq_start() where mbuf pointer was used after
drbr_enqueue().
  This eventually leads us to all invocations of
igb_mq_start_locked() called with third argument as NULL.
This allows us to simplify this function.
------------------------------------------------------------------------
r245334 | smh | 2013-01-12 08:05:55 -0800 (Sat, 12 Jan 2013) | 9 lines
Fixed mbuf free when receive structures fail to allocate.
This prevents quad igb card on high core machines, without any nmbcluster or
igb queue tuning wedging the boot process if all nics are configured.
------------------------------------------------------------------------
r246128 | sbz | 2013-01-30 10:01:20 -0800 (Wed, 30 Jan 2013) | 5 lines
Use DEVMETHOD_END macro defined in sys/bus.h instead of {0, 0} sentinel on device_method_t arrays
------------------------------------------------------------------------
r246482 | rrs | 2013-02-07 07:20:54 -0800 (Thu, 07 Feb 2013) | 30 lines
This fixes a out-of-order problem with several
of the newer drivers. The basic problem was
that the driver was pulling the mbuf off the
drbr ring and then when sending with xmit(), encounting
a full transmit ring. Thus the lower layer
xmit() function would return an error, and the
drivers would then append the data back on to the ring.
For TCP this is a horrible scenario sure to bring
on a fast-retransmit.

The fix is to use drbr_peek() to pull the data pointer
but not remove it from the ring. If it fails then
we either call the new drbr_putback or drbr_advance
method. Advance moves it forward (we do this sometimes
when the xmit() function frees the mbuf). When
we succeed we always call advance. The
putback will always copy the mbuf back to the top
of the ring. Note that the putback *cannot* be used
with a drbr_dequeue() only with drbr_peek(). We most
of the time, in putback, would not need to copy it
back since most likey the mbuf is still the same, but
sometimes xmit() functions will change the mbuf via
a pullup or other call. So the optimial case for
the single consumer is to always copy it back. If
we ever do a multiple_consumer (for lagg?) we
will  need a test and atomic in the put back possibly
a seperate putback_mc() in the ring buf.
------------------------------------------------------------------------
r247064 | jfv | 2013-02-20 16:25:45 -0800 (Wed, 20 Feb 2013) | 19 lines
Refresh on the shared code for the E1000 drivers.
  - bear with me, there are lots of white space changes, I would not
    do them, but I am a mere consumer of this stuff and if these drivers
    are to stay in shape they need to be taken.

em driver changes: support for the new i217/i218 interfaces

igb driver changes:
  - TX mq start has a quick turnaround to the stack
  - Link/media handling improvement
  - When link status changes happen the current flow control state
    will now be displayed.
  - A few white space/style changes.

lem driver changes:
  - the shared code uncovered a bogus write to the RLPML register
    (which does not exist in this hardware) in the vlan code,this
    is removed.
------------------------------------------------------------------------

git-svn-id: svn://svn.freebsd.org/base/stable/9@248292 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC of the ixgbe driver including the follow revisions:
jfv [Thu, 14 Mar 2013 21:39:39 +0000 (21:39 +0000)]
MFC of the ixgbe driver including the follow revisions:

235547,235964,241616,241646,241856,241885,242403,
242421,243714,243716,243718,243721,243724,243725,
243728,243729,243733,243735,243736,243741,243833,
244514,246128,246482,247035,247056,247822,247823

Note: 246482 includes only the changes in the ixgbe driver
      and the buf_ring supporting code in if_var.h and buf_ring.h
      igb and em will be seperate commits, and non-Intel drivers
      can commit the changes at will.

Reviewed by:rss, jhb

git-svn-id: svn://svn.freebsd.org/base/stable/9@248287 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r247960:
dim [Thu, 14 Mar 2013 21:18:19 +0000 (21:18 +0000)]
MFC r247960:

  Make ctfconvert work correctly on clang-compiled object files.  Clang
  puts the full original source filename in the STT_FILE entry of the ELF
  symbol table, while gcc saves only the basename.

  Since the DWARF DW_AT_name attribute contains the full source filename,
  both for clang and gcc, ctfconvert takes just the basename of it, for
  matching with the STT_FILE entry.  So when attempting to match with such
  an entry, use its basename, if necessary.

  Reported by: avg

MFC r247962:

  Fix error in r247960: actually assign the basename to match.iim_file.

  Pointed out by: avg
  Pointy hat to: dim

git-svn-id: svn://svn.freebsd.org/base/stable/9@248284 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMerge OpenSSL 0.9.8y. This is a direct commit to stable/9 as HEAD is on a
delphij [Thu, 14 Mar 2013 17:48:07 +0000 (17:48 +0000)]
Merge OpenSSL 0.9.8y.  This is a direct commit to stable/9 as HEAD is on a
different release now.

git-svn-id: svn://svn.freebsd.org/base/stable/9@248272 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r247918:
mav [Thu, 14 Mar 2013 05:24:25 +0000 (05:24 +0000)]
MFC r247918:
Fix panic when Secondary_Element_Count == 1 and Secondary_Element_Seq
is not set (255).

git-svn-id: svn://svn.freebsd.org/base/stable/9@248263 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r247048.
gibbs [Wed, 13 Mar 2013 17:37:13 +0000 (17:37 +0000)]
MFC r247048.

Orphaned processes that are being traced are killed by the
kernel.  Properly restore, continue, and detach from processes
being DTraced when DTrace exits with an error so the program
being inspected is not terminated.

cddl/contrib/opensolaris/cmd/dtrace/dtrace.c:
In fatal(), the generic error handler, close the DTrace
handle as is done in the "probe/script" error handler
dfatal().  fatal() can be invoked after DTrace attaches
to processes (e.g. a script specified by command line
argument can't be found) and closing the handle will
release them.

Submitted by: Spectra Logic Corporation
Reviewed by: rpaulo, gnn

git-svn-id: svn://svn.freebsd.org/base/stable/9@248249 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC kernel fixes to userland dtrace support.
gibbs [Wed, 13 Mar 2013 17:34:42 +0000 (17:34 +0000)]
MFC kernel fixes to userland dtrace support.

r247049
-------
Avoid panic when tearing down the DTrace pid provider for a
process that has crashed.

sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c:
In fasttrap_pid_disable(), we cannot PHOLD the proc
structure for a process that no longer exists, but
we still have other, fasttrap specific, state that
must be cleaned up for probes that existed in the
dead process.  Instead of returning early if the
process related to our probes isn't found,
conditionalize the locking and carry on with a NULL
proc pointer.  The rest of the fasttrap code already
understands that a NULL proc is possible and does
the right things in this case.

r247820
-------
Fix assertion failure when using userland DTrace probes from
the pid provider on a kernel compiled with INVARIANTS.

sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c:
In fasttrap_probe_pid(), attempts to write to the
address space of the thread that fired the probe
must be performed with the process of the thread
held.  Use _PHOLD() to ensure this is the case.

In fasttrap_probe_pid(), use proc_write_regs() instead
of calling set_regs() directly.  proc_write_regs()
performs invariant checks to verify the calling
environment of set_regs().  PROC_LOCK()/UNLOCK() around
the call to proc_write_regs() so that it's invariants
are satisfied.

Sponsored by: Spectra Logic Corporation

git-svn-id: svn://svn.freebsd.org/base/stable/9@248248 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r245742:
nwhitehorn [Wed, 13 Mar 2013 14:01:58 +0000 (14:01 +0000)]
MFC r245742:

Fix typo and simplify condition.

Submitted by: Christoph Mallon <christoph dot mallon at gmx dot de>
Missed MFC pointed out by: Garrett Cooper

git-svn-id: svn://svn.freebsd.org/base/stable/9@248241 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r245700,245701,245702,245706,245707,245758,245759,245760,245792,245796,
nwhitehorn [Wed, 13 Mar 2013 13:50:50 +0000 (13:50 +0000)]
MFC r245700,245701,245702,245706,245707,245758,245759,245760,245792,245796,
245980,246013:

Automated installation support for bsdinstall.

git-svn-id: svn://svn.freebsd.org/base/stable/9@248240 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r245680:
nwhitehorn [Wed, 13 Mar 2013 13:45:47 +0000 (13:45 +0000)]
MFC r245680:

Make "Finish" the default choice in the partition editor. This lets you
successfully complete an installation with all defaults by pressing
Enter repeatedly until your machine reboots.

git-svn-id: svn://svn.freebsd.org/base/stable/9@248239 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoRecord merge of r228048.
nwhitehorn [Wed, 13 Mar 2013 13:44:08 +0000 (13:44 +0000)]
Record merge of r228048.

git-svn-id: svn://svn.freebsd.org/base/stable/9@248238 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC miscellaneous bug fixes (r228042,228192,230522,232531,233473,233904,
nwhitehorn [Wed, 13 Mar 2013 13:41:28 +0000 (13:41 +0000)]
MFC miscellaneous bug fixes (r228042,228192,230522,232531,233473,233904,
235228,239500,241902,242188,243832,243854,244858,245333). This is mostly
documentation fixes and updates to the default FTP list that got left
behind in -CURRENT.

git-svn-id: svn://svn.freebsd.org/base/stable/9@248237 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r244209:
ae [Wed, 13 Mar 2013 10:45:36 +0000 (10:45 +0000)]
MFC r244209:
  Add an #include guard to the sys/fnv_hash.h.

git-svn-id: svn://svn.freebsd.org/base/stable/9@248235 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r247389:
kib [Wed, 13 Mar 2013 10:04:47 +0000 (10:04 +0000)]
MFC r247389:
Make recursive getblk() slightly more useful.

git-svn-id: svn://svn.freebsd.org/base/stable/9@248234 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r247388:
kib [Wed, 13 Mar 2013 10:01:05 +0000 (10:01 +0000)]
MFC r247388:
Work around the hold of references to the struct dquot by the freeblk
workitems for some time at unmount.

git-svn-id: svn://svn.freebsd.org/base/stable/9@248233 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r233463 (by trasz):
kib [Wed, 13 Mar 2013 09:54:11 +0000 (09:54 +0000)]
MFC r233463 (by trasz):
Remove unused define.

git-svn-id: svn://svn.freebsd.org/base/stable/9@248232 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r248214:
markj [Tue, 12 Mar 2013 19:28:41 +0000 (19:28 +0000)]
MFC r248214:
  Revert r246917, as it is causing incorrect behaviour as reported on
  freebsd-current.

Approved by: emaste (co-mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/9@248215 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r247815:
mav [Mon, 11 Mar 2013 07:53:51 +0000 (07:53 +0000)]
MFC r247815:
Add quirk to enable headphones redirection on Lenovo X220.

PR: kern/174876

git-svn-id: svn://svn.freebsd.org/base/stable/9@248148 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r247906:
lstewart [Mon, 11 Mar 2013 06:09:08 +0000 (06:09 +0000)]
MFC r247906:

The hashmask returned by hashinit() is a valid index in the returned hash array.
Fix a siftr(4) potential memory leak and INVARIANTS triggered kernel panic in
hashdestroy() by ensuring the last array index in the flow counter hash table is
flushed of entries.

git-svn-id: svn://svn.freebsd.org/base/stable/9@248144 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r247534 (by ru): Fixed documented prototype of kinfo_getproc(3).
pluknet [Sun, 10 Mar 2013 17:50:19 +0000 (17:50 +0000)]
MFC r247534 (by ru): Fixed documented prototype of kinfo_getproc(3).

git-svn-id: svn://svn.freebsd.org/base/stable/9@248137 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r247953:
dim [Sun, 10 Mar 2013 15:02:30 +0000 (15:02 +0000)]
MFC r247953:

Make c99(1) invoke /usr/bin/cc with argv[0] set to "/usr/bin/cc" instead
of just "cc", since there is no reason to cause additional path searches
in this case.

git-svn-id: svn://svn.freebsd.org/base/stable/9@248132 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r247951:
dim [Sun, 10 Mar 2013 15:01:06 +0000 (15:01 +0000)]
MFC r247951:

Make c89(1) invoke /usr/bin/cc with argv[0] also set to /usr/bin/cc,
similar to what c99(1) does, to prevent "c89: illegal option -- 1"
messages, when clang is /usr/bin/cc.

Reported by: tijl

git-svn-id: svn://svn.freebsd.org/base/stable/9@248131 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r247725:
mav [Sun, 10 Mar 2013 13:52:19 +0000 (13:52 +0000)]
MFC r247725:
Fix typos in hint names.

git-svn-id: svn://svn.freebsd.org/base/stable/9@248130 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoUpdate ports count and size in sysinstall(8).
gjb [Sat, 9 Mar 2013 21:21:30 +0000 (21:21 +0000)]
Update ports count and size in sysinstall(8).
This is a direct commit to stable/9.

Submitted by: ryusuke
Approved by: kib (implicit)

git-svn-id: svn://svn.freebsd.org/base/stable/9@248115 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC: r227309 (partial)
marius [Sat, 9 Mar 2013 02:36:32 +0000 (02:36 +0000)]
MFC: r227309 (partial)

Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs.

The SYSCTL_NODE macro defines a list that stores all child-elements of
that node. If there's no SYSCTL_DECL macro anywhere else, there's no
reason why it shouldn't be static.

git-svn-id: svn://svn.freebsd.org/base/stable/9@248085 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC: r243857 (partial)
marius [Sat, 9 Mar 2013 00:39:54 +0000 (00:39 +0000)]
MFC: r243857 (partial)

Mechanically substitute flags from historic mbuf allocator with
malloc(9) flags in sys/dev.

git-svn-id: svn://svn.freebsd.org/base/stable/9@248078 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r244631
rstone [Fri, 8 Mar 2013 21:07:01 +0000 (21:07 +0000)]
MFC r244631
  Correct a series of errors in the hand-rolled locking for drace_debug.c:

  - Use spinlock_enter()/spinlock_exit() to prevent a thread holding a
    debug lock from being preempted to prevent other threads waiting
    on that lock from starvation.

  - Handle the possibility of CPU migration in between the fetch of curcpu
    and the call to spinlock_enter() by saving curcpu in a local variable.

  - Use memory barriers to prevent reordering of loads and stores of the
    data protected by the lock outside of the critical section

  - Eliminate false sharing of the locks by moving them into the structures
    that they protect and aligning them to a cacheline boundary.

  - Record the owning thread in the lock to make debugging future problems
    easier.

  Reviewed by:  rpaulo (initial version)

git-svn-id: svn://svn.freebsd.org/base/stable/9@248073 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r226452 (by marcel@)
rstone [Fri, 8 Mar 2013 21:03:35 +0000 (21:03 +0000)]
MFC r226452 (by marcel@)

  Define dtrace_cmpset_long in terms of atomic_cmpset_long
  and not by virtue of inline assembly. Now this file
  compiles on all supported architectures.

git-svn-id: svn://svn.freebsd.org/base/stable/9@248071 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r241009
rstone [Fri, 8 Mar 2013 19:36:36 +0000 (19:36 +0000)]
MFC r241009
  Ensure that all cases that enqueue a netgraph item for delivery by a
  ngthread properly set the item's depth to 1.  In particular, prior to this
  change if ng_snd_item failed to acquire a lock on a node, the item's depth
  would not be set at all.  This fix ensures that the error code from rcvmsg/
  rcvdata is properly passed back to the apply callback.  For example, this
  fixes a bug where an error from rcvmsg/rcvdata would not previously
  propagate back to a libnetgraph consumer when the message was queued.

  Reviewed by:  mav
  MFC after:    1 month
  Sponsored by: Sandvine Incorporated

git-svn-id: svn://svn.freebsd.org/base/stable/9@248066 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r240923
rstone [Fri, 8 Mar 2013 19:01:26 +0000 (19:01 +0000)]
MFC r240923

  Some aac(4) adapters will always report that a direct access device is
  offline in response to a INQUIRY command that does not retreive vital
  product data(I personally have observed the behaviour on an Adaptec 2405
  and a 5805).  Force the peripheral qualifier to "connected" so that upper
  layers correctly recognize that a disk is present.

  This bug was uncovered by r216236.  Prior to that fix, aac(4) was
  accidentally clearing the peripheral qualifier for all inquiry commands.

  This fixes an issue where passthrough devices were not created for
  disks behind aac(4) controllers suffering from the bug.  I have
  verified that if a disk is not present that we still properly detect
  that and not create the passthrough device.

  Sponsored by: Sandvine Incorporated
  MFC after:    1 week

git-svn-id: svn://svn.freebsd.org/base/stable/9@248063 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r231879,246799,247880,248059:
delphij [Fri, 8 Mar 2013 18:46:21 +0000 (18:46 +0000)]
MFC r231879,246799,247880,248059:

Update driver to version 4.6.95.0.

Submitted by: "Duvvuru,Venkat Kumar" <VenkatKumar.Duvvuru Emulex.Com>

git-svn-id: svn://svn.freebsd.org/base/stable/9@248062 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC: r247632
marius [Fri, 8 Mar 2013 12:57:58 +0000 (12:57 +0000)]
MFC: r247632

- Complete r231621 (MFC'ed to stable/9 in r232092) by also blacklisting the
  bridge used by VMware for PCIe devices. While at it, update the comment
  now that we know that MSI-X doesn't work with ESXi 5.1 for Intel 82576
  either and the underlying issue is a bug in the MSI-X allocation code of
  the hypervisor.
  Reported by: Harald Schmalzbauer
- Make the nomatch table const.

git-svn-id: svn://svn.freebsd.org/base/stable/9@248052 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC: r247601, r247621
marius [Fri, 8 Mar 2013 12:52:52 +0000 (12:52 +0000)]
MFC: r247601, r247621

- Correct an incorrect argument to shutdown_nice(9).
- Mark unused parameters as such.
- Use NULL instead of 0 for pointers.

git-svn-id: svn://svn.freebsd.org/base/stable/9@248050 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC: r247600, r247620
marius [Fri, 8 Mar 2013 12:50:29 +0000 (12:50 +0000)]
MFC: r247600, r247620

- While Netra X1 generally show no ill effects when registering a power
  fail interrupt handler, there seems to be either a broken batch of them
  or a tendency to develop a defect which causes this interrupt to fire
  inadvertedly. Given that apart from this problem these machines work
  just fine, add a tunable allowing the setup of the power fail interrupt
  to be disabled.
  While at it, remove the DEBUGGER_ON_POWERFAIL compile time option and
  make that behavior also selectable via the newly added tunable.
- Correct an incorrect argument to shutdown_nice(9).
- Mark unused parameters as such.
- Use NULL instead of 0 for pointers.

git-svn-id: svn://svn.freebsd.org/base/stable/9@248048 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC: r247579
marius [Fri, 8 Mar 2013 12:44:08 +0000 (12:44 +0000)]
MFC: r247579

- Move reporting of failures to disable RX/TX MAC under bootverbose as at
  least the Saturn chips of 501-6738 cards may fail to do so the first
  time, which isn't fatal though.
  Reported by: Paul Keusemann
- Explain why we don't enable infinite bursts on sparc64.
- Given that these chips support memory write invalidate, make sure that
  it's enabled in the command register. Also make sure that PERR# and
  SERR# assertion is enabled.

git-svn-id: svn://svn.freebsd.org/base/stable/9@248046 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC: r247574
marius [Fri, 8 Mar 2013 12:13:30 +0000 (12:13 +0000)]
MFC: r247574

- In sbbc_pci_attach() just pass the already obtained bus tag and handle
  instead of acquiring these anew.
- Use NULL instead of 0 for pointers.

git-svn-id: svn://svn.freebsd.org/base/stable/9@248044 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC: r247573
marius [Fri, 8 Mar 2013 12:11:37 +0000 (12:11 +0000)]
MFC: r247573

- Remove an unused header.
- Use NULL instead of 0 for pointers.
- Let ofw_pcib_probe() return BUS_PROBE_DEFAULT instead of 0 so specialized
  PCI-PCI-bridge drivers may attach instead.
- Add WARs for PLX Technology PEX 8114 bridges and PEX 8532 switches.
  Ideally, these should live in MI code but at least for the latter we're
  missing the necessary infrastructure there.

git-svn-id: svn://svn.freebsd.org/base/stable/9@248042 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC: r236736
marius [Fri, 8 Mar 2013 12:08:52 +0000 (12:08 +0000)]
MFC: r236736

Add support for the Sunix SER5437A dual serial PCI Express card.

git-svn-id: svn://svn.freebsd.org/base/stable/9@248040 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC: r247571
marius [Fri, 8 Mar 2013 11:41:48 +0000 (11:41 +0000)]
MFC: r247571

- Apparently, r186520 was just wrong and the clock of Oxford OX16PCI958 is
  neither DEFAULT_RCLK * 2 nor DEFAULT_RCLK * 10 but plain DEFAULT_RCLK
  and there's no (open) source indicating otherwise. This was tested with
  an EXSYS EX-41098-2, whose clock is not configurable and identifies as:
  puc0@pci0:5:1:0:        class=0x070200 card=0x06711415 chip=0x95381415 rev=0x01 hdr=0x00
      vendor     = 'Oxford Semiconductor Ltd'
      class      = simple comms
      subclass   = multiport serial

  Note that this exactly matches the card mentioned in PR 129665 so no
  sub-device/sub-vendor based quirking of the latter is possible. So maybe
  we should grow some sort of tunable, in case non-default cards such as
  the latter aren't configurable either (this also wouldn't be the first
  time an allegedly tested commit turns out to be wrong though).
- Make the TiMedia tables const.

git-svn-id: svn://svn.freebsd.org/base/stable/9@248038 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC: r247565, r247590
marius [Fri, 8 Mar 2013 11:32:58 +0000 (11:32 +0000)]
MFC: r247565, r247590

- Make tables, device ID strings etc const.
- Use NULL instead of 0 for pointers.
- Remove redundant bzero(9)'ing of the softc.
- Remove redundant/unused softc members.
- Don't allocate MSI/MSI-X as RF_SHAREABLE.
- Re-use bus accessor macros instead of duplicating them.
- In bce_miibus_{read,write}_reg(), remove superfluous limiting of the PHY
  address (missed in r213893).

git-svn-id: svn://svn.freebsd.org/base/stable/9@248036 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC: r247561
marius [Fri, 8 Mar 2013 11:25:52 +0000 (11:25 +0000)]
MFC: r247561

- Use strdup(9) instead of reimplementing it.
- Use __DECONST instead of strange casts.
- Reduce code duplication and simplify name2oid().

PR: 176373
Submitted by: Christoph Mallon

git-svn-id: svn://svn.freebsd.org/base/stable/9@248034 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r247560:
kib [Fri, 8 Mar 2013 08:09:26 +0000 (08:09 +0000)]
MFC r247560:
Make the default implementation of the VOP_VPTOCNP() fail if the
directory entry, matched by the inode number, is ".".

git-svn-id: svn://svn.freebsd.org/base/stable/9@248029 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r247829
bryanv [Fri, 8 Mar 2013 02:38:19 +0000 (02:38 +0000)]
MFC r247829

    Only set the barrier flag if the feature was negotiated

Approved by: grehan (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/9@248026 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r247399:
pho [Wed, 6 Mar 2013 20:02:19 +0000 (20:02 +0000)]
MFC r247399:
The .journal file needs to reside on the ROOTINO which must not extend
beyond direct blocks. A typo caused this check to fail.

git-svn-id: svn://svn.freebsd.org/base/stable/9@247900 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r247854:
np [Wed, 6 Mar 2013 18:44:45 +0000 (18:44 +0000)]
MFC r247854:
Fix compile warning by including ctype.h for isdigit().

git-svn-id: svn://svn.freebsd.org/base/stable/9@247896 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r246532: zfs_vget, zfs_fhtovp: properly handle the z_shares_dir object
avg [Wed, 6 Mar 2013 11:11:02 +0000 (11:11 +0000)]
MFC r246532: zfs_vget, zfs_fhtovp: properly handle the z_shares_dir object

git-svn-id: svn://svn.freebsd.org/base/stable/9@247888 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r246243: uart: add resume method and enable it for attachments on
avg [Wed, 6 Mar 2013 11:07:59 +0000 (11:07 +0000)]
MFC r246243: uart: add resume method and enable it for attachments on
the most common x86 buses

git-svn-id: svn://svn.freebsd.org/base/stable/9@247887 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r246245,246324: ng_ether: track interface renaming
avg [Wed, 6 Mar 2013 11:02:44 +0000 (11:02 +0000)]
MFC r246245,246324: ng_ether: track interface renaming

git-svn-id: svn://svn.freebsd.org/base/stable/9@247886 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r246251: acpi: clear power button status bit after waking up
avg [Wed, 6 Mar 2013 10:52:01 +0000 (10:52 +0000)]
MFC r246251: acpi: clear power button status bit after waking up

git-svn-id: svn://svn.freebsd.org/base/stable/9@247884 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r246250,246252: acpi: after wakeup from a state > S1 re-enable
avg [Wed, 6 Mar 2013 10:45:46 +0000 (10:45 +0000)]
MFC r246250,246252: acpi: after wakeup from a state > S1 re-enable
SCI_EN with a direct write

git-svn-id: svn://svn.freebsd.org/base/stable/9@247883 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r233579,236403,236408: make interrupt flags management closer to head
avg [Wed, 6 Mar 2013 10:23:56 +0000 (10:23 +0000)]
MFC r233579,236403,236408: make interrupt flags management closer to head

r233579: Restore interrupt state after executing AcpiEnterSleepState().
r236403,236408: acpi_wakeup_machdep/acpi_sleep_machdep

The merged changes are modified a bit to account for lots of missing
acpi and acpica MFCs.
For the same reason MFC to stable/8 is not practical.

MFC slackers: iwasaki, jkim

git-svn-id: svn://svn.freebsd.org/base/stable/9@247881 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r246248: cpususpend_handler: mark AP as resumed only after fully
avg [Wed, 6 Mar 2013 09:33:04 +0000 (09:33 +0000)]
MFC r246248: cpususpend_handler: mark AP as resumed only after fully
setting up lapic

git-svn-id: svn://svn.freebsd.org/base/stable/9@247878 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r246247: x86 suspend/resume: suspend pics and pseudo-pics in reverse order
avg [Wed, 6 Mar 2013 09:22:45 +0000 (09:22 +0000)]
MFC r246247: x86 suspend/resume: suspend pics and pseudo-pics in reverse order

git-svn-id: svn://svn.freebsd.org/base/stable/9@247877 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r246246,246254: print compiler version in the kernel banner
avg [Wed, 6 Mar 2013 09:12:38 +0000 (09:12 +0000)]
MFC r246246,246254: print compiler version in the kernel banner

git-svn-id: svn://svn.freebsd.org/base/stable/9@247874 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r247382:
yongari [Wed, 6 Mar 2013 08:03:26 +0000 (08:03 +0000)]
MFC r247382:
  RX checksum offloading on old Yukon controllers seem to cause more
  problems.  Disable RX checksum offloading on controllers that don't
  use new descriptor format but give chance to enable it with
  ifconfig(8).

git-svn-id: svn://svn.freebsd.org/base/stable/9@247872 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r247281, r247345:
trociny [Wed, 6 Mar 2013 06:58:11 +0000 (06:58 +0000)]
MFC r247281, r247345:

r247281:

Add i/o error counters to hastd(8) and make hastctl(8) display
them.  This may be useful for detecting problems with HAST disks.

Discussed with and reviewed by: pjd

r247345:

Fix casting.

git-svn-id: svn://svn.freebsd.org/base/stable/9@247867 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r247281:
trociny [Wed, 6 Mar 2013 06:57:18 +0000 (06:57 +0000)]
MFC r247281:

Add i/o error counters to hastd(8) and make hastctl(8) display
them.  This may be useful for detecting problems with HAST disks.

Discussed with and reviewed by: pjd

git-svn-id: svn://svn.freebsd.org/base/stable/9@247866 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r247268:
gallatin [Tue, 5 Mar 2013 16:37:20 +0000 (16:37 +0000)]
MFC r247268:
 Several cleanups and fixes to mxge:

 - Remove vestigial null pointer tests after malloc(..., M_WAITOK).

 - Remove vestigal qualhack union

 - Use strlcpy() instead of the error-prone strncpy() when parsing
   EEPROM and copying strings

 - Check the MAC address in the EEPROM strings more strictly.

 - Expand the macro MXGE_NEXT_STRING() at its only user. Due to a typo,
   the macro was very confusing.

 - Remove unnecessary buffer limit check.  The buffer is double-NUL
   terminated per construction.

PR:             kern/176369
Submitted by:   Christoph Mallon <christoph.mallon gmx.de>

git-svn-id: svn://svn.freebsd.org/base/stable/9@247850 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r247396:
tijl [Tue, 5 Mar 2013 16:04:07 +0000 (16:04 +0000)]
MFC r247396:

Map libraries linked with -Ttext-segment=base_addr at base_addr.
Normal libraries have base address 0 and are unaffected by this change.

PR: 176216
Submitted by: Damjan Jovanovic <damjan.jov@gmail.com>
Reviewed by: kib

git-svn-id: svn://svn.freebsd.org/base/stable/9@247846 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r247594:
delphij [Tue, 5 Mar 2013 06:43:54 +0000 (06:43 +0000)]
MFC r247594:

Fix a typo in mfi_stp_cmd() that would give wrong assignment.

Submitted by: Sascha Wildner <saw online de>
Obtained from: DragonFly rev 0dc98fff2206d7bb78ce5e07ac34d6954e4bd96a

git-svn-id: svn://svn.freebsd.org/base/stable/9@247828 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r247443:
delphij [Tue, 5 Mar 2013 06:41:39 +0000 (06:41 +0000)]
MFC r247443:

Refresh vendor driver version which adds ARC-1224 support.

Many thanks to Areca for continuing to support FreeBSD.

Submitted by: 黃清隆 <ching2048 areca com tw>

git-svn-id: svn://svn.freebsd.org/base/stable/9@247827 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r246134 ...
ian [Mon, 4 Mar 2013 16:50:01 +0000 (16:50 +0000)]
MFC r246134 ...

Improve devd startup time, by tweaking some string handling routines that are
heavily used when parsing config files.  Mostly these changes avoid making
temporary copies of the strings, and avoid doing byte at a time append
operations, on the most-used code path.

On a 1.2 GHz ARM processor this reduces the time to parse the config files
from 13 to 6 seconds.

git-svn-id: svn://svn.freebsd.org/base/stable/9@247803 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r246361 ... bump .Dd for content change.
ian [Mon, 4 Mar 2013 16:44:19 +0000 (16:44 +0000)]
MFC r246361 ... bump .Dd for content change.

git-svn-id: svn://svn.freebsd.org/base/stable/9@247802 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r247160
gallatin [Mon, 4 Mar 2013 15:32:38 +0000 (15:32 +0000)]
MFC r247160

  Bump mxge copyright.

git-svn-id: svn://svn.freebsd.org/base/stable/9@247795 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r247159
gallatin [Mon, 4 Mar 2013 15:30:38 +0000 (15:30 +0000)]
MFC r247159
  Improvements for newer mxge nics:

  - Some mxge nics may store the serial number in the SN2 field of the
    EEPROM.  These will also have an SN=0 field, so parse the SN2 field,
    and give it precedence.

  - Skip MXGEFW_CMD_UNALIGNED_TEST on mxge nics which do not require it.
    This saves roughly 10ms per port at device attach time.

git-svn-id: svn://svn.freebsd.org/base/stable/9@247794 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r247780:
dteske [Mon, 4 Mar 2013 11:40:52 +0000 (11:40 +0000)]
MFC r247780:

Fix VERBOSE reporting on results when removing _PATH_LOCALTIME for UTC option.

PR: bin/164976
Submitted by: dteske

git-svn-id: svn://svn.freebsd.org/base/stable/9@247781 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r226775:
hrs [Mon, 4 Mar 2013 05:46:35 +0000 (05:46 +0000)]
MFC r226775:

- Add support for a "!" character in regex matching in devd(8).  It inverts
  the logic (true/false) of the matching.

- Add "!usbus[0-9]+" to IFNET ATTACH notification handler in the default
  devd.conf to prevent rc.d/netif from running when usbus[0-9]+ is attached.

git-svn-id: svn://svn.freebsd.org/base/stable/9@247767 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r230520:
dteske [Sun, 3 Mar 2013 19:31:44 +0000 (19:31 +0000)]
MFC r230520:

Clean up reinstall option and remove duplicate code

- Move the reinstall logic to be before menus are initialised
  (menus are not needed when reinstalling a zonefile).

- Remove unnecessary re-initialization of path_db.

- Update variable name and error message because we now use the
  zone name relative to /usr/share/zoneinfo, not the full path.

PR: bin/164041
Submitted by: dteske

git-svn-id: svn://svn.freebsd.org/base/stable/9@247729 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r230296:
dteske [Sun, 3 Mar 2013 19:26:05 +0000 (19:26 +0000)]
MFC r230296:

Don't write /var/db/zoneinfo when zone is not actually changed.

If the specified zone file does not exist or the -n flag is specified,
do not update /var/db/zoneinfo.

PR: bin/164039
Submitted by: dteske

git-svn-id: svn://svn.freebsd.org/base/stable/9@247728 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r230299:
dteske [Sun, 3 Mar 2013 19:20:30 +0000 (19:20 +0000)]
MFC r230299:

Fix #ifdef VERBOSE for UTC case

Update verbose output to match what actually happens when selecting
the UTC option, and when the -n option is used.

Patch updated slightly for new libdialog.

PR: bin/164042
Submitted by: dteske

git-svn-id: svn://svn.freebsd.org/base/stable/9@247727 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoDummy commit to show r247722 was (in addition to being an MFC for r227934), an
dteske [Sun, 3 Mar 2013 19:12:07 +0000 (19:12 +0000)]
Dummy commit to show r247722 was (in addition to being an MFC for r227934), an
MFC for r227947:

calloc +1 DIALOG_LISTITEM to prevent possible wild pointer access
in dlg_default_listitem().

and also for r228176: Sync xdialog_menu() implementation with sade.

git-svn-id: svn://svn.freebsd.org/base/stable/9@247726 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r246978:
markj [Sun, 3 Mar 2013 19:02:23 +0000 (19:02 +0000)]
MFC r246978:
  - Make sure to set an error code when trying to obtain a data descriptor for
    a section of type SHT_NULL.
  - Update the man page to reflect the fact that elf_getdata() and
    elf_rawdata() may return with an error of ELF_E_SECTION.

Approved by: rstone (co-mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/9@247724 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r227934: Port to new libdialog.
dteske [Sun, 3 Mar 2013 18:59:59 +0000 (18:59 +0000)]
MFC r227934: Port to new libdialog.

git-svn-id: svn://svn.freebsd.org/base/stable/9@247722 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r230005:
dteske [Sun, 3 Mar 2013 17:39:29 +0000 (17:39 +0000)]
MFC r230005:

Use a reasonable-sized buffer when formatting error messages about
installing zoneinfo.  While we're in the vicinity, add some missing
error checking to eliminate an unhelpful error message when unlink()
fails.

/me is embarrassed by the quality of his 16-year-old code.
The whole thing is awful and could stand a complete rewrite.

PR: 164038
Submitted by: Devin Teske (but implemented differently)

git-svn-id: svn://svn.freebsd.org/base/stable/9@247721 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r246921:
kib [Sun, 3 Mar 2013 07:09:25 +0000 (07:09 +0000)]
MFC r246921:
Do not update the fsinfo block on each update of any fat block.
Postpone the flush to VFS_SYNC().

git-svn-id: svn://svn.freebsd.org/base/stable/9@247685 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r247441:
gjb [Sun, 3 Mar 2013 00:37:34 +0000 (00:37 +0000)]
MFC r247441:
Properly handle '-h' argument.

PR: 176332

git-svn-id: svn://svn.freebsd.org/base/stable/9@247677 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC: r242854 (by rdivacky)
flo [Sat, 2 Mar 2013 17:51:22 +0000 (17:51 +0000)]
MFC: r242854 (by rdivacky)

Initialize hdrlen to 0 to avoid clang warning in NOINET case.

This fixes the kernel build for INET6 only kernels.

Approved by: cognet

git-svn-id: svn://svn.freebsd.org/base/stable/9@247658 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC: r246689, r246696
marius [Sat, 2 Mar 2013 17:39:11 +0000 (17:39 +0000)]
MFC: r246689, r246696

Make SYSCTL_{LONG,QUAD,ULONG,UQUAD}(9) work as advertised and also handle
constant values.

Reviewed by: kib

git-svn-id: svn://svn.freebsd.org/base/stable/9@247656 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC: r246300
marius [Sat, 2 Mar 2013 17:36:29 +0000 (17:36 +0000)]
MFC: r246300

- Make pci_ns8250_ids[] const.
- Use DEVMETHOD_END.
- Use NULL instead of 0 for pointers.

git-svn-id: svn://svn.freebsd.org/base/stable/9@247654 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC: r246257
marius [Sat, 2 Mar 2013 17:32:15 +0000 (17:32 +0000)]
MFC: r246257

Improve r238673 (MFC'ed to stable/9 in r239494) to additionally allow
for odd-aligned buffers as passed in by smartd of smartmontools.
While at it, hint the compiler that 32-bit PIO is the most likely
case (idea from Linux) and use bus_{read,write}_stream_2(9) instead
of bus_{read,write}_multi_stream_2(9) for single count reads/writes.

git-svn-id: svn://svn.freebsd.org/base/stable/9@247652 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC: r235857
marius [Sat, 2 Mar 2013 17:25:41 +0000 (17:25 +0000)]
MFC: r235857

mdoc: Only use macros inside a reference block.

git-svn-id: svn://svn.freebsd.org/base/stable/9@247650 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC: r246106, r246139
marius [Sat, 2 Mar 2013 17:14:51 +0000 (17:14 +0000)]
MFC: r246106, r246139

Mark tftp_log() as __printflike() and deal with the fallout.

git-svn-id: svn://svn.freebsd.org/base/stable/9@247644 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC: r229780 (partial)
marius [Sat, 2 Mar 2013 16:45:58 +0000 (16:45 +0000)]
MFC: r229780 (partial)

Spelling fixes for libexec/

git-svn-id: svn://svn.freebsd.org/base/stable/9@247641 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC: r241720 (partial)
marius [Sat, 2 Mar 2013 16:38:58 +0000 (16:38 +0000)]
MFC: r241720 (partial)

Fix warnings found by -Wmising-variable-declarations.

git-svn-id: svn://svn.freebsd.org/base/stable/9@247638 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC: r235643
marius [Sat, 2 Mar 2013 16:33:43 +0000 (16:33 +0000)]
MFC: r235643

Properly use LDADD & DPADD to link against libwrap.

git-svn-id: svn://svn.freebsd.org/base/stable/9@247637 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoUpdate FTP directories to include new layout. Previously discussed with
dteske [Sat, 2 Mar 2013 16:18:40 +0000 (16:18 +0000)]
Update FTP directories to include new layout. Previously discussed with
kensmith and others as this alleviates the need for the symbolic link upkeep
which is currently manually maintained.

git-svn-id: svn://svn.freebsd.org/base/stable/9@247634 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMerge
melifaro [Sat, 2 Mar 2013 15:11:20 +0000 (15:11 +0000)]
Merge
* r233937 - Improve BPF locking model
* r233938 - Improve performace for writer-only BPF users
* r233946 - Fix build
* r235744 - Fix (new) panic on attaching to non-existent interface
* r235745 - Fix old panic when BPF consumer attaches to destroying interface
* r235746 - Call bpf_jitter() before acquiring BPF global lock
* r235747 - Make most BPF ioctls() SMP-safe.
* r236231 - Fix BPF_JITTER code broken by r235746.
* r236251 - Fix shim for BIOCSETF to drop all packets buffered on the descriptor.
* r236261 - Save the previous filter right before we set new one.
* r236262 - Fix style(9) nits, reduce unnecessary type castings.
* r236559 - Fix panic introduced by r235745
* r236806 - Fix typo introduced in r236559.

r233937
  - Improve BPF locking model.

  Interface locks and descriptor locks are converted from mutex(9) to rwlock(9).
  This greately improves performance: in most common case we need to acquire 1
  reader lock instead of 2 mutexes.

  - Remove filter(descriptor) (reader) lock in bpf_mtap[2]
  This was suggested by glebius@. We protect filter by requesting interface
  writer lock on filter change.

  - Cover struct bpf_if under BPF_INTERNAL define. This permits including bpf.h
  without including rwlock stuff. However, this is is temporary solution,
  struct bpf_if should be made opaque for any external caller.

r233938
  - Improve performace for writer-only BPF users.

  Linux and Solaris (at least OpenSolaris) has PF_PACKET socket families to send
  raw ethernet frames. The only FreeBSD interface that can be used to send raw
  frames is BPF. As a result, many programs like cdpd, lldpd, various dhcp stuff
  uses BPF only to send data. This leads us to the situation when software like
  cdpd, being run on high-traffic-volume interface significantly reduces overall
  performance since we have to acquire additional locks for every packet.

  Here we add sysctl that changes BPF behavior in the following way:
  If program came and opens BPF socket without explicitly specifyin read filter
  we assume it to be write-only and add it to special writer-only per-interface
  list. This makes bpf_peers_present() return 0, so no additional overhead is
  introduced. After filter is supplied, descriptor is added to original
  per-interface list permitting packets to be captured.

  Unfortunately, pcap_open_live() sets catch-all filter itself for the purpose
  of setting snap length.

  Fortunately, most programs explicitly sets (event catch-all) filter after
  that. tcpdump(1) is a good example.

  So a bit hackis approach is taken: we upgrade description only after second
  BIOCSETF is received.

  Sysctl is named net.bpf.optimize_writers and is turned off by default.

  - While here, document all sysctl variables in bpf.4

r233946
  Fix build broken by r233938.

r235744
  Fix panic on attaching to non-existent interface
(introduced by r233937, pointed by hrs@)
  Fix panic on tcpdump being attached to interface being removed
(introduced by r233937, pointed by hrs@ and adrian@)
  Protect most of bpf_setf() by BPF global lock

  Add several forgotten assertions (thanks to adrian@)

  Document current locking model inside bpf.c
  Document EVENTHANDLER(9) usage inside BPF.

r235745
  Fix old panic when BPF consumer attaches to destroying interface.
  'flags' field is added to the end of bpf_if structure. Currently the only
  flag is BPFIF_FLAG_DYING which is set on bpf detach and checked by bpf_attachd()
  Problem can be easily triggered on SMP stable/[89] by the following command
  (sort of):
  'while true; do ifconfig vlan222 create vlan 222 vlandev em0 up ; \
    tcpdump -pi vlan222 & ; ifconfig vlan222 destroy ; done'

  Fix possible use-after-free when BPF detaches itself from interface, freeing
  bpf_bif memory, while interface is still UP and there can be routes via this
  interface. Freeing is now delayed till ifnet_departure_event is received via
  eventhandler(9) api.

  Convert bpfd rwlock back to mutex due lack of performance gain
  (currently checking if packet matches filter is done without holding bpfd
   lock and we have to acquire write lock if packet matches)

r235746
  Call bpf_jitter() before acquiring BPF global lock due to malloc() being
  used inside bpf_jitter.

  Eliminate bpf_buffer_alloc() and allocate BPF buffers on descriptor creation
   and BIOCSBLEN ioctl. This permits us not to allocate buffers inside
   bpf_attachd() which is protected by global lock.

r235747
  Make most BPF ioctls() SMP-safe.

r236559
  Fix panic introduced by r235745. Panic occurs after first packet traverse
  renamed interface.
  Add several comments on locking

r236231
  Fix BPF_JITTER code broken by r235746.

r236251
  Fix 32-bit shim for BIOCSETF to drop all packets buffered on the descriptor
  and reset statistics as it should.

r236261
  - Save the previous filter right before we set new one.
  - Reduce duplicate code and make it little easier to read.

r236262
  Fix style(9) nits, reduce unnecessary type castings, etc., for bpf_setf().

r236806
  Fix typo introduced in r236559.

git-svn-id: svn://svn.freebsd.org/base/stable/9@247629 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r247205:
dim [Sat, 2 Mar 2013 14:39:48 +0000 (14:39 +0000)]
MFC r247205:

Pull in r175962 from upstream llvm trunk:

  X86: Disable cmov-memory patterns on subtargets without cmov.

  Fixes PR15115.

For the i386 arch, this should enable cmov instructions only on
-march=pentiumpro and higher.  Since our default CPU is i486, cmov
instructions will now be disabled by default.

git-svn-id: svn://svn.freebsd.org/base/stable/9@247625 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r247422:
delphij [Sat, 2 Mar 2013 01:04:02 +0000 (01:04 +0000)]
MFC r247422:

Add a reminder that the user should update boot block if they are upgrading
their existing system and use LZ4 compression for ZFS.

Suggested by: mm

git-svn-id: svn://svn.freebsd.org/base/stable/9@247607 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r246562:
pfg [Fri, 1 Mar 2013 22:03:57 +0000 (22:03 +0000)]
MFC r246562:

Remove unused MAXSYMLINKLEN macro.

Reviewed by: mckusick
PR: kern/175794

git-svn-id: svn://svn.freebsd.org/base/stable/9@247589 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC r246121 ...
ian [Fri, 1 Mar 2013 20:48:53 +0000 (20:48 +0000)]
MFC r246121 ...

Fix a descriptor leak in devd.  Clients reading /var/run/devd.pipe can close
their socket connection any time, and devd only notices that when it gets an
error trying to write an event to the client.  On a system with no device
change activity, clients could connect and disappear repeatedly without devd
noticing, leading to an ever-growing list of open socket descriptors in devd.

Now devd uses poll(2) looking for POLLHUP on all existing clients every time
a new client connection is established, and also periodically (once a minute)
to proactively find zombie clients and reap the socket descriptors.  It also
now has a connection limit, configurable with a new -l <num> command line arg.
When the maximum number of connections is reached it stops accepting new
connections until some current clients drop off.

git-svn-id: svn://svn.freebsd.org/base/stable/9@247576 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

11 years agoMFC 246799:
jpaetzel [Fri, 1 Mar 2013 20:33:35 +0000 (20:33 +0000)]
MFC 246799:

Resolve issue that caused WITNESS to report LORs.

git-svn-id: svn://svn.freebsd.org/base/stable/9@247572 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f