MFC r235982:
Add tunable/sysctl kern.cam.pmp.hide_special, controlling whether special
PMP ports such as PMP configuration or SEMB should be exposed or hidden.
These ports were always hidden before as useless and sometimes promatic.
But with updated ses driver supporting SEMB it is no longer so straight.
Keep ports hidden by default to avoid probe request ttimeouts if SEP is
not connected to PMP's SEMB via I2C, that is very often situation.


git-svn-id: svn://svn.freebsd.org/base/stable/9@236765 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r236122,r236595:

Wording corrections and simplifications.

Approved by:	gjb (mentor)


git-svn-id: svn://svn.freebsd.org/base/stable/9@236773 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r235897:
 - Add low-level support for SATA Enclosure Management Bridge (SEMB)
devices -- SATA equivalents of the SCSI SES/SAF-TE devices.
 - Add some utility functions for SCSI SAF-TE devices access.

Sponsored by:   iXsystems, Inc.


git-svn-id: svn://svn.freebsd.org/base/stable/9@236778 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r236228:
Plug request and references leak caused by race between invalidated
ond probe periph destruction and new incoming probe request.

This at least caused problems with SATA Port Multipliers hot-plug.


git-svn-id: svn://svn.freebsd.org/base/stable/9@236779 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r236234:
Allow to change number of openings (used tags) for ATA/SATA devices
via `camcontrol tags ... -N ...`.  There is no need to tune it in
usual cases, but some users want to have it for debugging purposes.


git-svn-id: svn://svn.freebsd.org/base/stable/9@236782 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
NFC r236393:
Use AC_GETDEV_CHANGED async to notify ada driver about DMA and NCQ status
change. Now that allows switching between PIO and DMA modes on the fly.


git-svn-id: svn://svn.freebsd.org/base/stable/9@236784 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r236437:
Rewrite enabling NCQ for SATA devices in a way more alike to SCSI TCQ.
This allows to control it with `camcontrol negotiate adaX -T (en|dis)able`
on the fly, same as for SCSI devices.

Sponsored by:   iXsystems, Inc.


git-svn-id: svn://svn.freebsd.org/base/stable/9@236786 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r236552:
Remove some dead code that I doubt will ever be implemented.


git-svn-id: svn://svn.freebsd.org/base/stable/9@236788 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
r236666:
ATA/SATA controllers have no idea about protocol of the connected device
until transport will do some probe actions (at least soft reset).
Make ATA/SATA SIMs to not report bogus and confusing PROTO_ATA protocol.
Make ATA/SATA transport to fill that gap by reporting protocol to SIM with
XPT_SET_TRAN_SETTINGS and patching XPT_GET_TRAN_SETTINGS results if needed.


git-svn-id: svn://svn.freebsd.org/base/stable/9@236790 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r236043:
Add a vn_bmap_seekhole(9) vnode helper which can be used by any
filesystem which supports VOP_BMAP(9) to implement SEEK_HOLE/SEEK_DATA
commands for lseek(2).


git-svn-id: svn://svn.freebsd.org/base/stable/9@236792 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r236691:
Remove declaration of scsi_interpret_sense(), removed 11 years ago.


git-svn-id: svn://svn.freebsd.org/base/stable/9@236793 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r236044:
Implement SEEK_HOLE/SEEK_DATA for UFS.


git-svn-id: svn://svn.freebsd.org/base/stable/9@236795 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r236465:
Update the print mask for decoding b_flags. Add print masks for
b_vflags and b_xflags_t and print them as well.

MFC r236487:
Fix typo. Use commas to separate flag printouts, in style with
other parts of function.


git-svn-id: svn://svn.freebsd.org/base/stable/9@236796 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r236686:
Add gettimeofday() test.


git-svn-id: svn://svn.freebsd.org/base/stable/9@236797 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r236690:
Do not execute a needed statement with side-effect in assert().


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

Fix two warnings about self-assignment in libc.  These normally only
trigger with clang, when you either use -save-temps, or ccache.

Reported by:	Sevan / Venture37 <venture37@gmail.com>


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

 Plug two interface address refcount leaks in early error return cases
 in the ioctl path.

 Reported by:	rpaulo
 Reviewed by:	emax


git-svn-id: svn://svn.freebsd.org/base/stable/9@236826 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r236143, r236705:

MFC r236143 [1]:
Import illumos changeset 13571:a5771a96228c
1950 ztest backwards compatibility testing option

MFC r236705 [2]:
Import Illumos revision 13715:351036203e4b
2803 zfs get guid pretty-prints the output

References:
https://www.illumos.org/issues/1950 [1]
https://www.illumos.org/issues/2803 [2]

Obtained from:	illumos (issue #1950 [1], #2803 [2])


git-svn-id: svn://svn.freebsd.org/base/stable/9@236837 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r236155:
Import illumos changeset 13570:3411fd5f1589
1948 zpool list should show more detailed pool information

Display per-vdev information with "zpool list -v".
The added expandsize property has currently no value on FreeBSD.
This changeset allows adding expansion support to individual vdevs
in the future.

References:
https://www.illumos.org/issues/1948

Obtained from:	illumos (issue #1948)


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

During buildworld and buildkernel, define EARLY_BUILD in the earlier
stages (build-tools, cross-tools, etc) of the build, so we can detect in
bsd.*.mk whether to pass compiler-specific flags to ${CC}.

In particular, this commit will allow using WITH_CLANG_IS_CC when the
base compiler is still gcc, and when ${CC}, ${CXX} and ${CPP} are left
at their defaults.  The early stages will then be built using gcc, and
no clang-specific flags will be passed to it.  The later stages will be
built as usual.

The EARLY_BUILD define can also serve other uses, such as building the
world stage C++ executables with libc++ instead of libstdc++: during the
early build stages, we cannot assume libc++ is already available, so we
must still build with libstdc++ at that time.


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