MFC: r269806,r269809,r269811,r269810

r269806:
Fix too long (seed length >12 chars) challenge handling.
1) " ext" length should be included into OPIE_CHALLENGE_MAX (as all places
of opie code expects that).
2) Overflow check in challenge.c is off by 1 even with corrected
OPIE_CHALLENGE_MAX
3) When fallback to randomchallenge() happens and rval is 0 (i.e.
challenge is too long), its value should be set to error state too.

To demonstrate the bug, run opiepasswd with valid seed:
opiepasswd -s 1234567890123456
and notice that it falls back to randomchallenge() (i.e. no
1234567890123456 in the prompt).

r269809:
When sha1 support was added, they forget to increase OPIE_HASHNAME_MAX

r269811:
Last '/' for program name, not first one.

r269810:
Link otp-sha1 to match real challenge prompt, not otp-sha.

PR:     191511
Submitted by: mitsururike@gmail.com (partially, PR 269806)


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/10@270120 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Direct commit to stable/10 reflecting r269815 because rest can't be merged

Add otp-sha


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/10@270121 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Direct commit to stable/10 reflecting r269961 because the rest can't be
merged.

Bump version because challenge buffer size changed.


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/10@270122 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC: r269875

According to opie code and even direct mention in opie(4) challenge buffer
size must be OPIE_CHALLENGE_MAX + 1, not OPIE_CHALLENGE_MAX

Reviewed by:    des


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/10@270125 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r269430: MFV r269426:

Double test device size for ztest(1).

Illumos issue:
    5039 ztest should default to larger device sizes
    Author: Matthew Ahrens <mahrens@delphix.com>


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/10@270126 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r269431: MFV r269427:

In dnode_children_t, use C99's "[]" idiom for declaring the variable
sized array dnc_children at the end of the structure.

This prevents the compiler from mistakenly optimizing away accesses
beyond the array's defined size.

Illumos issue:
    5038 Remove "old-style" flexible array usage in ZFS.
    Author: Justin T. Gibbs <justing@spectralogic.com>


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/10@270127 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r269543: MFV r269542:

In vdev_get_stats, check that the vdev is not a hole before computing the
fragmentation.  This fixes a panic when removing log device.

Illumos issue:
    5049 panic when removing log device


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/10@270128 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r269814:

blkfront: add support for unmapped IO

Sponsored by:	Citrix Systems R&D
Tested by:	robak
PR:		191173


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/10@270130 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r269492:
Improve locking of multicast addresses in VLAN and LAGG interfaces.

This fixes several scenarios of reproducible panics, cause by races
between multicast address changes and interface destruction.


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/10@270136 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r269183, r269191:
Add netmasks support to initiator-portal option.


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/10@270137 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r269977

Skip pgrep-j and pkill-j if jail or jls is not installed.

Even though jail is part of the base system, it can be disabled by src.conf
settings. Therefore, it should be listed as a required program for tests that
use it.


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/10@270150 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC of 269533 (by mckusick):

Add support for multi-threading of soft updates.

Replace a single soft updates thread with a thread per FFS-filesystem
mount point. The threads are associated with the bufdaemon process.

Reviewed by:  kib
Tested by:    Peter Holm and Scott Long
MFC after:    2 weeks
Sponsored by: Netflix

MFC of 269853 (by kib):

Revision r269457 removed the Giant around mount and unmount code, but
r269533, which was tested before r269457 was committed, implicitely
relied on the Giant to protect the manipulations of the softdepmounts
list.  Use softdep global lock consistently to guarantee the list
structure now.

Insert the new struct mount_softdeps into the softdepmounts only after
it is sufficiently initialized, to prevent softdep_speedup() from
accessing bare memory.  Similarly, remove struct mount_softdeps for
the unmounted filesystem from the tailq before destroying structure
rwlock.

Reported and tested by: pho
Reviewed by:    mckusick
Sponsored by:   The FreeBSD Foundation


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/10@270157 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r267921, r267934, r267949, r267959,	r267966, r268202, r268276,
    r268427, r268428, r268521, r268638,	r268639, r268701, r268777,
    r268889, r268922, r269008, r269042,	r269043, r269080, r269094,
    r269108, r269109, r269281, r269317,	r269700, r269896, r269962,
    r269989.

Catch bhyve up to CURRENT.

Lightly tested with FreeBSD i386/amd64,	Linux i386/amd64, and
OpenBSD/amd64. Still resolving an	issue with OpenBSD/i386.

Many thanks to jhb@ for	all the	hard work on the prior MFCs !

r267921 - support the "mov r/m8, imm8" instruction
r267934 - document options
r267949 - set DMI vers/date to fixed values
r267959 - doc: sort cmd flags
r267966 - EPT misconf post-mortem info
r268202 - use correct flag for event index
r268276 - 64-bit virtio capability api
r268427 - invalidate guest TLB when cr3 is updated, needed for TSS
r268428 - identify vcpu's operating mode
r268521 - use correct offset in guest logical-to-linear translation
r268638 - chs value
r268639 - chs fake values
r268701 - instr emul operand/address size override prefix support
r268777 - emulation for legacy x86 task switching
r268889 - nested exception support
r268922 - fix INVARIANTS build
r269008 - emulate instructions found in the OpenBSD/i386 5.5 kernel
r269042 - fix fault injection
r269043 - Reduce VMEXIT_RESTARTs in task_switch.c
r269080 - fix issues in PUSH emulation
r269094 - simplify return values from the inout handlers
r269108 - don't return -1 from the push emulation handler
r269109 - avoid permanent sleep in vm_handle_hlt()
r269281 - list VT-x features in base kernel dmesg
r269317 - Mark AHCI fatal errors as not completed
r269700 - Support PCI extended config space in bhyve
r269896 - Minor cleanup
r269962 - use max guest memory when creating IOMMU domain
r269989 - fix interrupt mode names


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/10@270159 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r269859:
Fix for memory leak.

Sponsored by:	Mellanox Technologies


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/10@270166 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Bump __FreeBSD_version after r269490 so ports can use it.


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/10@270174 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
vt(4): Add vtbuf_dirty*_locked() to lock vtbuf once, not twice

In several functions, vtbuf_putchar() in particular, the lock on vtbuf
is acquired twice:
    1. once by the said functions;
    2. once in vtbuf_dirty().

Now, vtbuf_dirty_locked() and vtbuf_dirty_cell_locked() allow to
acquire that lock only once.

This improves the input speed of vt(4). To measure the gain, a
50,000-lines file was displayed on the console using cat(1). The time
taken by cat(1) is reported below:
    o  On amd64, with vt_vga:
        - before: 1.0"
        - after:  0.5"
    o  On sparc64, with creator_vt:
        - before: 13.6"
        - after:  10.5"

This is an MFC of r269780.


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/10@270182 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r265098

Bump WITNESS_PENDLIST by MAXCPU to account for the
pmap pvlist locks which are scaled by MAXCPU.


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/10@270185 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r266103

Update dis_tables.c to the latest Illumos version.

This includes decodes of recent Intel instructions, in particular
VT-x and related instructions. This allows the FBT provider to
locate the exit points of routines that include these new
instructions.

Illumos issues:
 3414 Need a new word of AT_SUN_HWCAP bits
 3415 Add isainfo support for f16c and rdrand
 3416 Need disassembler support for rdrand and f16c
 3413 isainfo -v overflows 80 columns
 3417 mdb disassembler confuses rdtscp for invlpg
 1518 dis should support AMD SVM/AMD-V/Pacifica instructions
 1096 i386 disassembler should understand complex nops
 1362 add kvmstat for monitoring of KVM statistics
 1363 add vmregs[] variable to DTrace
 1364 need disassembler support for VMX instructions
 1365 mdb needs 16-bit disassembler support

This corresponds to Illumos-gate (github) version
eb23829ff08a873c612ac45d191d559394b4b408


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/10@270186 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r266473,267331,267511:

  Use an intermediate target to associate with _SUBDIR which is marked .MAKE
  this allows make -n to do tree walks as expected without
  doing anything else (as intended).
  Use prefix _sub. to help avoid conflict with any real target.

  Put the test suite in its own tests.txz distribution file.
  Force all the contents of /usr/tests to go into a separate distribution
  file so that users of binary releases can easily choose to not install

  Create a mechanism for providing fine-grained build order dependencies
  during SUBDIR_PARALLEL builds.  This augments the coarse .WAIT mechanism,
  which is still useful if you've got a situation such as "almost everything
  depends on A and B".


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/10@270187 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r269907:
Fix leaks of unqueued unwired pages.


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/10@270205 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f