add an rc.d script to automatically grow the specified FS...  It has
been tested on both MBR and GPT...  It won't be enabled until you add
growfs_enable="YES" and will only run on first boot..
filedesc: lock filedesc lock in fdcloseexec only when needed
Get rid of the postrandom script.  It was born in a time when the
random script ran before filesystems were mounted, which is no
longer the case.

In random_start(), immediately delete each file that is fed into
/dev/random, and recreate the default entropy file immediately
after reading and deleting it.  The logic used in random_stop()
to determine which file to write to should probably be factored
out and used here as well.
Restore the auto-reseed logic, but move it to a much later point,
immediately before kick_init.

Approved by:	so (self)
filedesc: tidy up fdcheckstd

No functional changes.
PAX ASLR: Make some experimental changes regarding getting the jail and locking it. Make more changes mjg@freebsd.org requested.

Conflicts:
	sys/kern/kern_pax.c
	sys/kern/kern_pax_aslr.c
	sys/kern/kern_pax_hardening.c
	sys/kern/kern_pax_segvguard.c
	sys/sys/jail.h
NG_NODE_NAME(node) is always not NULL. Use correct macro.

Submitted by:	Dmitry Luhtionov <dmitryluhtionov gmail.com>
Add pkg-config file for libarchive

Requested by:	bapt
MFC after:	1 week
drm: Lower priority of two messages related to invalid EDID

Like in r259717, the prority goes from "error" to "debug" to avoid
spamming logs when the connectors are polled.

MFC after:	1 week
In agp(4) avoid the need to flush all cpu caches with wbinvd between
updating the GTT and flushing the AGP TLB by storing the GTT in
write-combining memory.

On x86 flushing the AGP TLB is done by an I/O operation or a store to a
MMIO register in uncacheable memory.  Both cases imply that WC buffers are
flushed so no memory barriers are needed.

On powerpc there is no WC memory type.  It maps to uncacheable memory and
two stores to uncacheable memory, such as to the GTT and then to an MMIO
register, are strongly ordered, so no memory barriers are needed either.

MFC after:	1 month
In agp_amd_bind_page don't flush the AGP TLB.  It's done by the calling
function.
- agp_generic_unbind_memory: flush AGP TLB before unwiring pages
- agp_bind_pages: assert that pages have been wired down

MFC after:	1 month
Fix two issues with lockmgr(9) LK_CAN_SHARE() test, which determines
whether the shared request for already shared-locked lock could be
granted.  Both problems result in the exclusive locker starvation.

The concurrent exclusive request is indicated by either
LK_EXCLUSIVE_WAITERS or LK_EXCLUSIVE_SPINNERS flags.  The reverse
condition, i.e. no exclusive waiters, must check that both flags are
cleared.

Add a flag LK_NODDLKTREAT for shared lock request to indicate that
current thread guarantees that it does not own the lock in shared
mode.  This turns back the exclusive lock starvation avoidance code;
see man page update for detailed description.

Use LK_NODDLKTREAT when doing lookup(9).

Reported and tested by:	pho
No objections from:	attilio
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
When non-forced unmount or remount rw->ro is performed, writes on UFS
are not suspended.  In particular, on the SU-enabled vulumes, there is
no reason why, between the call to softdep_flushfiles() and
softdep_waitidle(), SU work items cannot be queued.

Correct the condition to trigger the panic by only checking when
forced operation is done.  Convert direct panic() call into KASSERT(),
there is no invalid on-disk data structures directly involved, so
follow the usual debugging vs. non-debugging approach.

Reported and tested by:	pho
Reviewed by:	mckusick
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
filedesc: factor out some code out of fdescfree

Previously it had a huge self-contained chunk dedicated to dealing with shared
tables.

No functional changes.
Use default memory type for TTM buffer objects that may be cached.

MFC after:	1 week
filedesc: move freeing old tables to fdescfree

They cannot be accessed by anyone and hold count only protects the structure
from being freed.
vt(4): Fix keyboard allocation when kbdmux(4) isn't used

The problem was that only the kbdmux keyboard index was saved in
vd->vd_keyboard. This index is -1 when kbdmux isn't used. In this
case, the keyboard was correctly allocated, but the returned index was
discarded.

PR:		194718
MFC after:	1 week
PAX ASLR: remove unused pax_aslr_debug and related codes

Signed-off-by: Oliver Pinter <oliver.pntr@gmail.com>

Conflicts:
	sys/kern/kern_pax.c
	sys/kern/kern_pax_aslr.c
	sys/sys/pax.h
PAX ASLR: style

Signed-off-by: Oliver Pinter <oliver.pntr@gmail.com>