MFC 226145,226147,226148,226150,226151,226153,226157,226158,226164,226246,
226262,226329,226344,226608:
Merge most "infrastructure" changes to kdump to make other MFC's to add
new decodings, etc. easier:
- Some of the #defines or enums for which we auto-generate naming
  functions may be wider than int, so use intmax_t throughout.
- Auto-generate kdump_subr.h.
- Use a switch statement instead of a giant if-else.
- Remove a lot of (void) casts.
- 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.
- Mostly WARNS=6 clean.
- Update mkioctls to still work with both kdump and truss.
libcpp: Keep a record of changes from upstream GCC (pre-43).

This makes it easier to track the changes in the rare event of the code
being distributed without access to version control.

MFC after:	3 weeks
Revert r258528: wrong tree

Inofensive as it is, this was meant for current. It will be re-merged
along with related changes in 3 weeks.
MFC r258353: zfs page_busy: fix the boundaries of the cleared range

This is a fix for a regression introduced in r246293.

vm_page_clear_dirty expects the range to have DEV_BSIZE aligned boundaries,
otherwise it extends them.  Thus it can happen that the whole page is
marked clean while actually having some small dirty region(s).
This commit makes the range properly aligned and ensures that only
the clean data is marked as such.

It would interesting to evaluate how much benefit clearing with DEV_BSIZE
granularity produces.  Perhaps instead we should clear the whole page
when it is completely overwritten and don't bother clearing any bits
if only a portion a page is written.
MFC r258389: MFV r258378: 4089 NULL pointer dereference in arc_read()

illumos/illumos-gate@57815f6b95a743697e148327725b7f568e75e6ea
MFV r258377: 4088 use after free in arc_release()

illumos/illumos-gate@ccc22e130479b5bd7c0002267fee1e0602d3f772
MFC r240834: Add rounddown2() macro similar to the roundup2() macro.

MFC slacker:	pjd
MFC r246482 (rrs) + r246581:

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.

Reviewed by:	jhb@freebsd.org, jlv@freebsd.org
MFC r257007,258140:

Update driver to version 10.0.664.0.

Many thanks to Emulex for their continued support of FreeBSD.

Submitted by:	Venkata Duvvuru <VenkatKumar.Duvvuru Emulex Com>
MFC r258350:

Pull in r191896 from upstream llvm trunk:

  CaptureTracking: Plug a loophole in the "too many uses" heuristic.

  The heuristic was added to avoid spending too much compile time in a
  specially crafted test case (PR17461, PR16474) with many uses on a
  select or bitcast instruction can still trigger the slow case. Add a
  check for that case.

  This only affects compile time, don't have a good way to test it.

This fixes the excessive compile time spent on a specific file of the
graphics/rawtherapee port.

Reported by:	mandree
MFC r229663: Allow to change vfs.zfs.arc_meta_limit at runtime.

- Change vfs.zfs.arc_meta_used from CTLFLAG_RDTUN to CTLFLAG_RD,
as it is not a tunable.

MFC slacker:	pjd
MFC r258135: x86: Allow users to change PSL_RF via ptrace(PT_SETREGS...)

  Debuggers may need to change PSL_RF. Note that tf_eflags is already stored
  in the signal context during signal handling and PSL_RF previously could
  be modified via sigreturn, so this change should not provide any new
  ability to userspace.

  For background see the thread at:
  http://lists.freebsd.org/pipermail/freebsd-i386/2007-September/005910.html

  Reviewed by:	jhb, kib

Sponsored by:	DARPA, AFRL
MFC r257879:

Fix typo in r256646: We want to generate lists of directories in
INDEX-OLD and INDEX-NEW and compare them, not generate the same
list of directories from INDEX-OLD twice...

Pointy hats to: cperciva & everybody who didn't proofread
		EN-13:04 enough
Errata Notice:	FreeBSD-EN-13:05.freebsd-update
MFC r258620:

Pull in r195558 from upstream clang trunk:

  Fix a SSE2 intrinsics typo

  Full discourse at:

   http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20131104/092514.html
   http://lists.cs.uiuc.edu/pipermail/llvmdev/2013-November/068124.html

  Patch by Dimitry Andric and Alexey Dokuchaev!

Reported by:	danfe
MFC r258664:

Create /var/cache with mode 0755 instead of 0750.

This directory is used by many third party applications and having
permission 0750 makes it impossible to drop group privileges.
MFC r258499:
Fix for the spurious signal handler call with zero signo in the threaded
process.
MFC: r258718: fix emulated jail_v0 byte order
MFC r256557 - kernel and userland osreldate helpers.
MFC r258347,r258349:

  Support SNI in libfetch

  SNI is Server Name Indentification which is a protocol for TLS that
  indicates the host that is being connected to at the start of the
  handshake. It allows to use Virtual Hosts on HTTPS.

PR:		kern/183583
Approved by:	bapt (implicit)
MFC r258737

In keg_dtor(), print out the keg name in the "Freed UMA keg was not empty"
message printed to the console.  This makes it easier to track down
the source of certain memory leaks.

Suggested by: adrian