MFC 260847,264055,264867:
- Add a very simple virtio_random(4) driver for FreeBSD guests to harvest
  entropy from hypervisors.
- Add support to bhyve for the virtio RNG entropy-source device to provide
  entry to bhyve guests.


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/10@268933 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC 264916,267611:
Provide a very basic stub for the 8042 PS/2 keyboard controller.


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/10@268934 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC 263780,264516,265062,265101,265203,265364:
Add an ioctl to suspend a virtual machine (VM_SUSPEND).

Add logic in the HLT exit handler to detect if the guest has put all vcpus
to sleep permanently by executing a HLT with interrupts disabled.

When this condition is detected the guest with be suspended with a reason of
VM_SUSPEND_HALT and the bhyve(8) process will exit.

This logic can be disabled via the tunable 'hw.vmm.halt_detection'.


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/10@268935 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r268532 and r268585. When world and kernel are built without INET6
support, the userland was still built with INET6 turned on.

PR:		190964
Approved by:	glebius (mentor, implicit)


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/10@268937 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r267603 by trasz: Add polish vt(4) keymap.

Sponsored by:	The FreeBSD Foundation


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/10@268940 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r268460 by ray:

  Fix inconsistent token parameters for kbd_allocate() and kbd_release()
  in vt(4).

PR:		191306
Submitted by:	jau789 at gmail.com
Sponsored by:	The FreeBSD Foundation


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/10@268941 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC syscons(4) man page updates:

r268050: Add a vt(4) cross reference to syscons(4)

r268169: Clarify the setting of syscons driver flags

  Submitted by:	wblock

r268215: Describe kern.vty sc/vt tunable in syscons(4)

  Reviewed by:	wblock


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/10@268946 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r266847: Add missing , in converted font output


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/10@268950 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC 264275:
Explicitly initialize 'vmname' to NULL.


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/10@268951 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC 264347:
Account for the "plus 1" encoding of the CPUID Function 4 reported
core per package and cache sharing values.


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/10@268952 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC 264353,264509,264768,264770,264825,264846,264988,265114,265165,265365,
265941,265951,266390,266550,266910:
Various bhyve fixes:
- Don't save host's return address in 'struct vmxctx'.
- Permit non-32-bit accesses to local APIC registers.
- Factor out common ioport handler code.
- Use calloc() in favor of malloc + memset.
- Change the vlapic timer frequency to be in the ballpark of contemporary
  hardware.
- Allow the guest to read the TSC via MSR 0x10.
- A VMCS is always inactive when it exits the vmx_run() loop.  Remove
  redundant code and the misleading comment that suggest otherwise.
- Ignore writes to microcode update MSR.  This MSR is accessed by RHEL7
  guest.
  Add KTR tracepoints to annotate wrmsr and rdmsr VM exits.
- Provide an alias for the userboot console and name it 'comconsole'.
- Use EV_ADD to create an mevent and EV_ENABLE to enable it.
- abort(3) the process in response to a VMEXIT_ABORT.
- Don't include the guest memory segments in the bhyve(8) process core dump.
- Make the vmx asm code dtrace-fbt-friendly.
- Allow vmx_getdesc() and vmx_setdesc() to be called for a vcpu that is in
  the VCPU_RUNNING state.
- Enable VMX in the IA32_FEATURE_CONTROL MSR if it not enabled and the MSR
  isn't locked.


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/10@268953 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r268017 and r268018

268017:
Check return of cam_periph_find() before using it in a printf.

268018:
Add detection for ciss(4)  controllers that are set to non-raid JBOD mode.


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/10@268955 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r268450 (by glebius).  The leak affects stable/10 too.

In several cases in ip_output() we obtain reference on ifa. Do not
leak it.


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

  Change NFS readdir() to only ignore cookies preceding the given offset for
  UFS rather than for all but ZFS.


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/10@268961 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC	r268642:
libc/gen: small updates to code originating at OpenBSD

arc4random.c
- CVS rev. 1.22
Change arc4random_uniform() to calculate ``2**32 % upper_bound'' as
``-upper_bound % upper_bound''. Simplifies the code and makes it the
same on both ILP32 and LP64 architectures, and also slightly faster on
LP64 architectures by using a 32-bit remainder instead of a 64-bit
remainder.
- CVS rev. 1.23
Spacing

readpassphrase.c
-CVS rev. v 1.24
most obvious unsigned char casts for ctype

Obtained from:	OpenBSD


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/10@268962 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC	r268644:
libc/stdlib: Minor cleanups to code originating in NetBSD

Mostly ANSIfication and typos.

Obtained from:	NetBSD


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/10@268964 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC	r268798, r268799, r268801:
grep: Fix type.
grep: fix some memory leaks.

queue.c (CVS Rev. 1.4. 1.5)
Fix memory leaks.
NULL does not need a cast.

grep.c (CVS Rev. 1.6)
Use the more portable getline.

Obtained from:	NetBSD


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/10@268966 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC	r268632:
fsck_msdosfs: Assorted fixes from other BSDs.

When truncating cluster chains fix the length of the cluster head.
http://marc.info/?t=140304310700005&r=1&w=2

Avoid infinite loops in cluster chain linked lists.
http://marc.info/?l=openbsd-tech&m=140275150804337&w=2

Avoid off-by-one on FAT12 filesystems.
http://marc.info/?l=openbsd-tech&m=140234174104724&w=2

Obtained from:	NetBSD (from OpenBSD)


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/10@268968 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r268715,r268722:

    Document the 'show bio' command added in 2009.
    Also link 'show bio' to g_bio(9.)


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/10@268969 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC 266125:
Implement a PCI interrupt router to route PCI legacy INTx interrupts to
the legacy 8259A PICs.


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