Rename {_,}pmap_unwire_pte_hold() to {_,}pmap_unwire_ptp() and update the
comment describing them.  Both the function names and the comment had grown
stale.  Quite some time has passed since these pmap implementations last
used the page's hold count to track the number of valid mapping within a
page table page.  Also, returning TRUE from pmap_unwire_ptp() rather than
_pmap_unwire_ptp() eliminates a few instructions from callers like
pmap_enter_quick_locked() where pmap_unwire_ptp()'s return value is used
directly by a conditional statement.


git-svn-id: svn://svn.freebsd.org/base/head@240126 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Only stop the BXE controller if it was first started.  Stopping
an uninitialized controller can cause IPMI bus errors on some
systems.

Reviewed by:	yongari
Obtained from:	McAfee, Inc.
MFC after:	2 weeks


git-svn-id: svn://svn.freebsd.org/base/head@240128 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
When WIFCONTINUED was added, the number of "first" macros grew from
three to four.

MFC after:	1 week


git-svn-id: svn://svn.freebsd.org/base/head@240132 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Merge recent vendor changes and sync code:
1862 incremental zfs receive fails for sparse file > 8PB
3112 ztest does not honor ZFS_DEBUG
3122 zfs destroy filesystem should prefetch blocks
3129 'zpool reopen' restarts resilvers
3130 ztest failure: Assertion failed:
       0 == dmu_objset_destroy(name, B_FALSE) (0x0 == 0x10)

References:
  https://www.illumos.org/issues/1862
  https://www.illumos.org/issues/3112
  https://www.illumos.org/issues/3122
  https://www.illumos.org/issues/3129
  https://www.illumos.org/issues/3130

Obtained from:	illumos (vendor/illumos, vendor/illumos-sys)
MFC after:	2 weeks


git-svn-id: svn://svn.freebsd.org/base/head@240133 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Whitespace cleanup.


git-svn-id: svn://svn.freebsd.org/base/head@240134 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add support for new Intel on-CPU Bull Mountain random number
generator, found on IvyBridge and supposedly later CPUs, accessible
with RDRAND instruction.

From the Intel whitepapers and articles about Bull Mountain, it seems
that we do not need to perform post-processing of RDRAND results, like
AES-encryption of the data with random IV and keys, which was done for
Padlock. Intel claims that sanitization is performed in hardware.

Make both Padlock and Bull Mountain random generators support code
covered by kernel config options, for the benefit of people who prefer
minimal kernels. Also add the tunables to disable hardware generator
even if detected.

Reviewed by:	markm, secteam (simon)
Tested by:	bapt, Michael Moll <kvedulv@kvedulv.de>
MFC after:	3 weeks


git-svn-id: svn://svn.freebsd.org/base/head@240135 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
- Explicitly call twe_done() to poll the hardware when looping in
  twe_start() to simulate the behavior on 4.x where the driver dropped
  spl to allow interrupts to run to free up space in the command
  queue.  Be careful to only poll if we are going to make at least
  one more attempt to queue the current command.  Also, when polling,
  be careful to not call twe_startio() to queue more commands to avoid
  recursion.
- Move the buffer for formatting AEN messages into the softc instead of
  using a single driver-wide static buffer.

Requested by:	scottl (1)
Tested by:	Mike Tancsa @ Sentex


git-svn-id: svn://svn.freebsd.org/base/head@240137 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Don't hardcode paths to MFS_IMAGE in the kernel config.  When they don't
exist they don't cause "make tinderbox" to fail.

Reported by:	jhb


git-svn-id: svn://svn.freebsd.org/base/head@240139 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Update to a pruned 0.16.


git-svn-id: svn://svn.freebsd.org/base/head@240141 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
After r240104, make sure the hpt27xx driver also compiles with clang,
when it is statically linked into the kernel.

MFC after:	2 weeks
X-MFC-With:	r240104


git-svn-id: svn://svn.freebsd.org/base/head@240144 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
- Simplify VM code by using vmspace_wired_count() for counting wired
memory of a process.

Reviewed by:	avg
Approved by:	kib (mentor)
MFC after:	2 weeks


git-svn-id: svn://svn.freebsd.org/base/head@240145 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
- If the PCIe "SLOT" flag is set, include this in the capability output
- Fix printing of PCIe interrupt number, the shift was incorrect.

MFC after:	1 week


git-svn-id: svn://svn.freebsd.org/base/head@240146 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Using %p in a format string requires a void *.

MFC after: 10 days


git-svn-id: svn://svn.freebsd.org/base/head@240148 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add #defines for the bits in the PCI Express SLOT registers.  Names
have been chosen based on the bit names in the PCI Express Base
Specification 3.0, and to match the predominant style of the existing
bit definitions.

MFC after:	1 week


git-svn-id: svn://svn.freebsd.org/base/head@240150 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
libc/i386: Do not export .cerror.

For some reason, libc exports the symbol .cerror (HIDENAME(cerror)), albeit
in the FBSDprivate_1.0 version. It looks like there is no reason for this
since it is not used from other libraries. Given that it cannot be accessed
from C and its strange calling convention, it is rather unlikely that other
things rely on it. Perhaps it is from a time when symbols could not be
hidden.

Not exporting .cerror causes it to be jumped to directly instead of via the
PLT.

This change also takes advantage of .cerror's new status by not saving and
loading %ebx before jumping to it. (Therefore, .cerror now saves and loads
%ebx itself.) Where there was a conditional jump to a jump to .cerror, the
conditional jump has been changed to jump to .cerror directly (many modern
CPUs don't do static prediction and in any case it is not much of a benefit
anyway).

This change makes libc.so.7 a few kilobytes smaller.

Reviewed by:	kib


git-svn-id: svn://svn.freebsd.org/base/head@240152 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Typo fix and minor word swap.

PR:		171356
Submitted by:	bdrewery
MFC After:	3 days


git-svn-id: svn://svn.freebsd.org/base/head@240153 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix test cases to work with the latest version of the API.


git-svn-id: svn://svn.freebsd.org/base/head@240154 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add missing braces

Obtained from:	DragonFly


git-svn-id: svn://svn.freebsd.org/base/head@240155 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add support for demangling C++ symbols. This requires linking libproc with
libc++rt/libsupc++.

Discussed with:	theraven


git-svn-id: svn://svn.freebsd.org/base/head@240156 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Merge remote-tracking branch 'upstream/master'