MFC 230423, 230612, 232964, 252033, 252036, 252051:

- Replace the beerware license on mdconfig(8) with standard 2-clause BSD.
- Rewrite option parsing in mdconfig(8).  This makes it more user-friendly
  by removing the ordering requirements and adding more descriptive error
  messages; it also makes it more readable and maintainable.
- Add "-f file" support to listing mode (-l).  When a -f option is
  specified, only md(4) devices which have the specified file as backing
  store are displayed.
- Use MD_NAME instead of "md".
- Use _PATH_DEV instead of "/dev/".
- Return -1 when the specified backing store file is not found in the md
  device list.


git-svn-id: svn://svn.freebsd.org/base/stable/9@252291 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r251684:
Fix two issues with the spin loops in the umtx(2) implementation.
- When looping, check for the pending suspension.
- Add missed checks for the faults from casuword*().


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

- The method introduced as part of r234898 (MFCed to stable/9 in r236076)
  for not altering the boot path when booting from ZFS turned out to also
  cause the boot path not being adjusted if booting from CD-ROM with firmware
  versions that do not employ the "cdrom" alias in that case. So shuffle the
  code around instead in order to achieve the original intent. Ideally, we
  shouldn't fiddle with the boot path when booting from UFS on a disk either;
  unfortunately, there doesn't seem to be an universal way of telling disks
  and CD-ROMs apart, though. [1]
- Use NULL instead of 0 for pointers.

PR:		179289 [1]


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

Add support for Exar XR17V358 8-port serial device to puc(4)


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

Correct the definition for Exar XR17V258IV: we must use a config_function
to specify the offset into the PCI memory spare at which each serial port
will find its registers.  This was already done for other Exar PCI serial
devices; it was accidentally omitted for this specific device.


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

Fix whitespace and normalize some entries.


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

All of Oxford/PLX OX16PCI954, OXm16PCI954 and OXu16PCI954 share the
exact same (subsystem) device and vendor IDs. However, the reference
design for the OXu16PCI954 uses a 14.7456 MHz clock (as does the EXSYS
EX-41098-2 equipped with these), while at least the OX16PCI954 defaults
to a 1.8432 MHz one. According to the datasheets of these chips, the
only difference in PCI configuration space is that OXu16PCI954 have
a revision ID of 1 while the other two are at 0. So employ the latter
for determining the default clock rates of this family.


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

Flag mpt(4) as supporting unmapped I/O; all necessary conversion actually
already has been done as part of r246713 (MFCed to stable/9 in r251874)
except for a comment update.


git-svn-id: svn://svn.freebsd.org/base/stable/9@252301 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r252045:
Corrected ATA Passthrough defines from decimal to hex


git-svn-id: svn://svn.freebsd.org/base/stable/9@252303 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r230786, r246283, r251084, r251085, r251086:

r230786 (imp):
- Allow specification of build shell for the buildenv target.

r246283 (hrs) (partial):
- Add {WORLD,KERNEL}_FLAGS to [BTWK]MAKE.

r251084:
- r245757 introduced warning output if update method is set to
  CVS_UPDATE or SUP_UPDATE.
- CVS exporter for stable/9/ is turned off for nearly one month
  now.
- It is finally time to swing the ax at these update methods.

r251085:
- Fix typo introduced in r251084.

r251086:
- Remove references to CVS_UPDATE and SUP_UPDATE to catch up
  with r251084.

Approved by:	kib (mentor)


git-svn-id: svn://svn.freebsd.org/base/stable/9@252305 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix build: in a recent pf refactor (head@240233), pf_var.h was modified
to not include netinet/tcp_fsm.h, and HEAD tcpdump rely on this change
as the tcp_fsm.h will only be processed once.

Solve this by defining TCPSTATES earlier.  This wouldn't cause breakage
should pf be merged in the future.

Noticed by:	tinderbox via many
Pointy hat to:	delphij


git-svn-id: svn://svn.freebsd.org/base/stable/9@252307 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r252056:
Fix destroyed ZFS pools failing to import

MFC r252059:
Fix ZFS zpool freeze (debug command) not processing due to invalid ioctl call syntax.

MFC r252060:
Fix intermittent ZFS lock panic

MFC r252061:
Switch ZFS mutex_owner macro to use sx_xholder as its now exported via sx.h


git-svn-id: svn://svn.freebsd.org/base/stable/9@252308 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC 250418,252166:
Revision 233677 broke certain machines.  Specifically, if the firmware/BIOS
assigned conflicting ranges to BARs then leaving the BARs alone could
result in one device stealing mmio accesses intended to go to a second
device.  Prior to 233677 the PCI bus driver attempted to handle this case
by clearing the BAR to 0 depending on BARs based at 0 not decoding (which
is not guaranteed to be true).  Now when a conflicting BAR is detected the
following steps are taken:

 1) If hw.pci.realloc_bars (a new tunable) is enabled (default is disabled),
    then ignore the current BAR setting from the firmware and attempt to
    allocate a fresh resource range for the BAR.

 2) If 1) failed (or was disabled), disable decoding for the relevant
    BAR type (e.g. disable mem decoding for a memory BAR) and emit a
    warning if booting verbose.


git-svn-id: svn://svn.freebsd.org/base/stable/9@252317 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r250951,251838:

Ensure alq's shutdown_pre_sync event handler is deregistered on module unload to
avoid a dangling pointer and eventual panic on system shutdown.

Reported by:	Ali <comnetboy at gmail.com>


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

Remove some duplicate code by making KHELP_DECLARE_MOD() a wrapper around
KHELP_DECLARE_MOD_UMA().


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

Fix a potential NULL-pointer dereference that would trigger if the hhook
registration site did not provide storage for a copy of the hhook_head struct.


git-svn-id: svn://svn.freebsd.org/base/stable/9@252328 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Merge remote-tracking branch 'upstream/svn_stable_9' into svn_stable_9