MFC r245783:

Simplify and fix a bug in cc_ack_received()'s "are we congestion window limited"
logic (refer to [1] for associated discussion). snd_cwnd and snd_wnd are
unsigned long and on 64 bit hosts, min() will truncate them to 32 bits and could
therefore potentially corrupt the result (although under normal operation,
neither variable should legitmately exceed 32 bits).

[1] http://lists.freebsd.org/pipermail/freebsd-net/2013-January/034297.html

Submitted by:	jhb
MFC r249846:

When rebooting (exiting) from the BTX loader, make sure to restore the
GDT from the correct segment, otherwise a triple fault would be caused.
In some virtual environments (VMware, VirtualBox, etc) this could lead
to a unhandled error or hang in the guest emulation software.

Thanks to avg and jhb for a few hints in the right direction.

Noticed by:	Jeremy Chadwick <jdc@koitsu.org> (and many others)
MFC r250075:
Properly terminate the result string for intermediate results.
MFC r249489,249555

  Run configtest before restarting so that the system is not
  left without a running sshd.

  Also call configtest before reload to ensure working config.
MFC r248933:

Use a shared lock for VOP_GETEXTATTR, as it is a read-like operation.
MFC r215137:

  Revert r103230, which depended on ld preserving the __start_xxx and
  __stop_xxx symbols for custom sections, even when these were not
  referenced (at link time).  This behaviour was changed again in binutils
  commit 0b8ed435c3fe8bd09a08c23920e65bfb03251221.

  This time, put the __GLOBL macro definition in cdefs.h, so it can be
  reused in a few other places where it will be needed.

  Reviewed by:	kib

MFC r215138:

  Use the same treatment as in linker_set.h for the __start and __stop
  symbols of the set_vnet and set_pcpu sections, so those symbols will
  always be emitted in kernel modules, if they use vnet.h or pcpu.h.

  Also, for pcpu.h, make the __(start|stop)_set_pcpu declarations, and
  associated macros invisible to userland, to prevent it picking up these
  symbols.

  Reviewed by:	kib
MFC:	r210877 (partial)

Decrease emulated stack size from 64K to 4K bytes.
MFC r249811:
Literally follow POSIX:
If the bs= expr operand is specified and no conversions other than sync,
noerror, or notrunc are requested, the data returned from each input
block shall be written as a separate output block.

PR:	standards/177742
MFC r249815

Return a lun count of 1 and a lun id of 0 when CAM attempts a REPORT_LUNS
command on a disk device.  This quieseces some noise on the console that
recently appeared.
MFC r248776:
  Fix interval-based rotations when the -t flag is used. In this case, find
  the most-recently archived logfile and use its mtime to determine whether
  or not to rotate, as in the non-timestamped case.

  Previously we would just try to use the mtime of <logfile>.0, which always
  results in a rotation since it generally doesn't exist in the -t case.

Approved by:	emaste
MFC r248851:
  Ignore interface renames instead of removing the interface from the bridge
  group.

Approved by:	emaste
MFC r249257:
  Add support for getting and setting BBU properties related to battery
  relearning. Specifically, add subcommands to mfiutil(8) which allow the
  user to set the BBU and autolearn modes when the firmware supports it,
  and add a subcommand which kicks off a battery relearn.

MFC r249258:
  Switch to a 2-clause license.
Fix the build: 'valid' is no longer used.
MFC r244123 Add CTLFLAG_RWTUN define
MFC r247367 Fix non-recusive mutex MFI I/O lock
MFC r247369 Fix a large amount of bugs in MFI that cause panics

Approved by:	pjd (mentor)
MFC r250185:
Add IDs for HighPoint RocketRAID 640L/642L/644L -- new series of 4-port
6Gbps PCIe 2.0 x2 SATA controllers, based on Marvell 88SE9235 chips.
MFC r249352:
Do not sent 120 TEST UNIT READY requests on generic NOT READY statuses.

Some failing disks tend to return vendor-specific ASC/ASCQ codes with
NOT READY sense key.  It caused extremely long recovery attempts, repeating
these 120 TURs (it takes at least 1 minute) for every I/O request.
Instead of that use default error handling, doing just few retries.
MFC r250392:

For some reason, the gcc intrinsics header tmmintrin.h was imported with
two copies of itself pasted together.  Remove the extraneous copy.
MFC r250012:
	Add an alternate version of beastie to the examples directory.

PR:		docs/38556
Tidy up some CVS workarounds.
MFC r249795:
Add convenience wrapper functions to run callbacks in the context of the
USB explore thread.