MFC 260237:
Fix a bug in the HPET emulation where a timer interrupt could be lost when the
guest disables the HPET.

The HPET timer interrupt is triggered from the callout handler associated with
the timer. It is possible for the callout handler to be delayed before it gets
a chance to execute. If the guest disables the HPET during this window then the
handler never gets a chance to execute and the timer interrupt is lost.

This is now fixed by injecting a timer interrupt into the guest if the callout
time is detected to be in the past when the HPET is disabled.
Add FreeBSD version 11.0.

This is a direct commit to stable/10.
MFC r266006 and r266011:
Fix unload of USB audio kernel module.
MFC rev. 265593:
(dd_out): Fix handling of all-zeroes block at end of input with
conv=sparse.

PR:		bin/189174
PR:		bin/189284
Reviewed by:	kib
MFC r265534:

msync(2) must return ENOMEM and not EINVAL when the address is outside the
allowed range or when one or more pages are not mapped. This according to
The Open Group Base Specifications Issue 7.

Sponsored by:	EMC / Isilon storage division
Fix a typo.

Submitted by:	Hilko Meyer <hilko.meyer@gmx.de>
Sponsored by:	The FreeBSD Foundation
MFC r266426

Slightly restructure the final loop in rman_reserve_resource_bound().
Replace with the existing loop termination test with a similar
condition from the nested "if" that may terminate the loop a bit
sooner, but still not too early.   This condition can then be removed
from the nested "if".  Relocate an operator to be style(9) compliant.
MFC r266116,r266136

A page mask size is 12-bits, not 11.
MFC mpr(4) changes: r265484, r265485, r265709 and r265712

  ------------------------------------------------------------------------
  r265484 | ken | 2014-05-06 23:11:16 -0600 (Tue, 06 May 2014) | 5 lines

  Remove some debugging code.

  Submitted by:	Steve McConnell <stephen.mcconnell@avagotech.com>

  ------------------------------------------------------------------------
  ------------------------------------------------------------------------
  r265485 | ken | 2014-05-06 23:14:48 -0600 (Tue, 06 May 2014) | 9 lines

  Hold the SIM lock when calling xpt_create_path() and xpt_action() in
  mprsas_SSU_to_SATA_devices().

  This fixes an assertion on shutdown with INVARIANTS enabled with SATA
  drives present on an IR firmware controller.

  Reviewed by:	Steve McConnell <stephen.mcconnell@avagotech.com>.

  ------------------------------------------------------------------------
  ------------------------------------------------------------------------
  r265709 | ken | 2014-05-08 14:28:22 -0600 (Thu, 08 May 2014) | 15 lines

  Fix TLR (Transport Layer Retry) support in the mps(4) and mpr(4) drivers.

  TLR is necessary for reliable communication with SAS tape drives.

  This was broken by change 246713 in the mps(4) driver.  It changed the
  cm_data field for SCSI I/O requests to point to the CCB instead of the data
  buffer.  So, instead, look at the CCB's data pointer to determine whether
  or not we're talking to a tape drive.

  Also, take the residual into account to make sure that we don't go off the
  end of the request.

  Sponsored by:	Spectra Logic Corporation

  ------------------------------------------------------------------------
  ------------------------------------------------------------------------
  r265712 | ken | 2014-05-08 14:46:46 -0600 (Thu, 08 May 2014) | 10 lines

  Add #ifdefs in the mpr(4) driver so that versions of stable/9 that
  have implemented the PIM_NOSCAN rescan functionality will have it
  enabled.

  This is a no-op for head.

  Reviewed by:	slm
  Sponsored by:	Spectra Logic Corporation

  ------------------------------------------------------------------------

Sponsored by:	Spectra Logic, Avago
Merge r266111 from head:

  Fix typo.  Note that although this file is under contrib, it has diverged
  sufficiently from upstream (including a full whitespace commit and large
  portions rewritten) that this change does not move us further from the
  upstream.

PR:		docs/186608
Submitted by:	Jamie Landeg-Jones <jamie@dyslexicfish.net>
Merge r266261 from head:

  USB endpoints are almost always single-digits, fix the path in the man
  page to be clearer.

PR:		docs/175560
Submitted by:	Andreas Gustafsson <gson gson.org>
MFC r266297: Update example portion of comment to coincide with r264840
MFC r265358, r265427, r265777, r265783,
 r265806, r265872, r266012 and r266394:

- Multiple DWC OTG host mode related fixes, improvements and optimisations.
- Add full support for ISOCHRONOUS transfers to the DWC OTG driver.
- Use the interrupt filter to handle basic USB FIFO interrupts.
- Fixed unbalanced unlock in case of "dwc_otg_init_fifo()" failure.
- Add common spinlock to the USB bus structure.
MFC r265359 and r265780:
Remove ISA load dependency for the kernel sound
driver module for ARM and MIPS.
MFC r266466, r266471, r266484, r266505, r266535 and r266542:
Fix multiple issues in the RSU driver.
MFC r257543, r264912, r264972, r264982 and r266472:
- Add preliminary support for the Realtek RTL8188EUS and RTL8188ETV chipsets.
- Add device ID for 'Sanoxy 802.11N' USB
- Initialize rssi variable.
- Fix gcc build, initialize off variable.
- The DELAY() should not be used in USB drivers.
- The usb_pause_mtx() function takes ticks and not milliseconds as last argument.
MFC r266464:
In execve(2), postpone the free of old vmspace until the threads are resumed
and exited.
MFC r265886, r265948
  With the new-and-improved vm_fault_copy_entry() (r265843), we can always
  avoid soft page faults when adding write access to user wired entries in
  vm_map_protect().  Previously, we only avoided the soft page fault when
  the underlying pages were copy-on-write.  In other words, we avoided the
  pages faults that might sleep on page allocation, but not the trivial
  page faults to update the physical map.

  On a fork allow read-only wired pages to be copy-on-write shared between
  the parent and child processes.  Previously, we copied these pages even
  though they are read only.  However, the reason for copying them is
  historical and no longer exists.  In recent times, vm_map_protect() has
  developed the ability to copy pages when write access is added to wired
  copy-on-write pages.  So, in this case, copy-on-write sharing of wired
  pages is not to be feared.  It is not going to lead to copy-on-write
  faults on wired memory.
MFC r266208: Speed up pmcstat by improving string hash

  In one case generating callgraph output from a 24MB system-wide sampling
  data file took 17.4 seconds on average.  Profiling showed pmcstat
  spending a lot of time in strcmp, due to hash collisions.

  Replacing the XOR-only hash with FNV-1a reduces the run time for my
  test by 40%.
MFC r259107
  Eliminate a redundant parameter to vm_radix_replace().

  Improve the wording of the comment describing vm_radix_replace().