MFamd64: Move extern declaration of _ucodesel and _udatasel to
<machine/md_var.h>
Fix a bug which prevented ND6_IFF_IFDISABLED flag from clearing when
the newly-added IPv6 address was /128.

PR:	188032
MFamd64: Add support for extended FPU states on i386.  This includes
support for AVX on i386.
- Similar to amd64, move the FPU save area out of the PCB and instead
  store saved FPU state in a variable-sized buffer after the PCB on the
  stack.
- To support the variable PCB location, alter the locore code to only use
  the bottom-most page of proc0stack for init386().  init386() returns
  the correct stack pointer to locore which adjusts the stack for thread0
  before calling mi_startup().
- Don't bother setting cr3 in thread0's pcb in locore before calling
  init386().  It wasn't used (init386() overwrote it at the end) and
  it doesn't work with the variable-sized FPU save area.
- Remove the new-bus attachment from npx.  This was only ever useful for
  external co-processors using IRQ13, but those have not been supported
  for several years.  npxinit() is now called much earlier during boot
  (init386()) similar to amd64.
- Implement PT_{GET,SET}XSTATE and I386_GET_XFPUSTATE.
- npxsave() is now only called from context switch contexts so it can
  use XSAVEOPT.

Differential Revision:	https://reviews.freebsd.org/D1058
Reviewed by:	kib
Tested on:	FreeBSD/i386 VM under bhyve on Intel i5-2520
 - Make sure random_adaptor accesses happen only when
   random_adaptors_lock is held.
 - Use sx_sleep instead of tsleep in read and write path to allow
   another thread that registers a new random adapter when waiting.
   Assert that random_adaptor is not NULL after reacquiring the lock.
 - Capture EINTR/ERESTART from sx_sleep to allow the blocking cycle be
   stopped when user requests so, while there also make short
   read/write's return 0.
 - Move M_WAITOK allocations out of lock scope.

In collobration with:	kib, markm, ian, jilles
Reviewed by:	kib, markm
Approved by:	so
Do not try to create a /dev/log symlink in a jail.

PR:	179828
Fix up some session-related races in devfs.

One was introduced with r272596, the rest was there to begin with.

Noted by: jhb
filedesc: create a dedicated zone for struct filedesc0

Currently sizeof(struct filedesc0) is 1096 bytes, which means allocations from
malloc use 2048 bytes.

There is no easy way to shrink the structure <= 1024 an it is likely to grow in
the future.
Don't assert random_adaptors_lock in random_adaptor_read_rate().

Reported by:	many
Pointy hat to:	delphij (for not testing the commit with WITNESS)
Approved by:	so
filedesc: plug unnecessary fdp NULL checks in fdescfreee and fdcopy

Anything reaching these functions has fd table.
Integrate usr.sbin/useradd/t_useradd.sh from NetBSD into FreeBSD as pw_test

- Suffix useradd/userdel commands with pw
- Remove the atf_expect_fail for bin/39546

Phabric: D921
Reviewed by: brd
Sponsored by: EMC / Isilon Storage Division
filedesc: plus sys/kdb.h include which crept in with r274007
Integrate pjdfstest test suite execution into kyua

pjdfstest execution is opt-in and must be done as root due to some of the
assumptions made by the test suite and lack of error checking in the non-root
case

A description of how to execute pjdfstest with kyua is provided in
share/pjdfstest/README

Phabric: D824 (an earlier prototype patch)
MFC after: 1 month
Relnotes: yes
Sponsored by: EMC / Isilon Storage Division
Provide an on-stack temporary buffer for small ioctl requests.
Reduce boot verbosity.

MFC:		3 days
Remove explicit KYUAFILE=yes from tests/sys/Makefile

This causes the directory traversing Kyuafile to be installed, which in turn
causes tests/sys/pjdfstest to always be run from /usr/tests/sys

Let KYUAFILE default to auto, so the file generated by suite.test.mk gets
installed instead

MFC after: 1 week
Require root when running the pw_delete and pw_modify test programs (pw(8)
requires it)
When other end of the pipe closed during the write, but some bytes
were written, return short write instead of EPIPE.

Update comment.

Discussed with:	bde (long time ago)
MFC after:	2 weeks
drm: Take vt(4) default mode from loader tunables

By default, vt(4) gets the "preferred mode" from DRM, when using a DRM
video driver as its backend. The preferred mode is usually the native
screen resolution.

Now, if this mode isn't appropriate, a user can use loader tunables to
select a mode. The tunables are read in the following order:
    1. kern.vt.fb.modes.$connector_name
    2. kern.vt.fb.default_mode

For example, to set a 1024x768 mode, no matter the connector:
    kern.vt.fb.default_mode="1024x768"

To set a 800x600 mode only on the laptop builtin screen:
    kern.vt.fb.modes.LVDS-1="800x600"

MFC after:	1 week
s/icl_pdu_new/icl_pdu_new_empty/g; no functional changes.

Sponsored by:	The FreeBSD Foundation
Remove check for obsolete FreeBSD versions

PR:		194517
Submitted by:	François Tigeot <ftigeot@wolfpond.org>