- Introduce a specific function, pmap_remove_kernel_pde, for removing
   huge pages in the kernel's address space.  This works around several
   asserts from pmap_demote_pde_locked that did not apply and gave false
   warnings.

Discovered by:	pho
Reviewed by:	alc
Sponsored by:	EMC / Isilon Storage Division


git-svn-id: svn+ssh://svn.freebsd.org/base/head@253949 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix a panic in tmpaddrtimer.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@253950 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Revert r253939:
We cannot busy a page before doing pagefaults.
Infact, it can deadlock against vnode lock, as it tries to vget().
Other functions, right now, have an opposite lock ordering, like
vm_object_sync(), which acquires the vnode lock first and then
sleeps on the busy mechanism.

Before this patch is reinserted we need to break this ordering.

Sponsored by:	EMC / Isilon storage division
Reported by:	kib


git-svn-id: svn+ssh://svn.freebsd.org/base/head@253953 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Redirect svnversion stderr to /dev/null if we cannot determine
the tree version, for example if the tree is checked out with an
outdated svn from ports, but the base system svnlite is built.

Approved by:	kib (mentor)


git-svn-id: svn+ssh://svn.freebsd.org/base/head@253956 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Note NULL encryption method for GELI

PR:		docs/180551
Submitted by:	r4721@tormail.org
Approved by:	gjb (mentor)


git-svn-id: svn+ssh://svn.freebsd.org/base/head@253957 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFprojects/camlock r249505:
Change CCB queue resize logic to be able safely handle overallocations:
 - (re)allocate queue space in power of 2 chunks with 64 elements minimum
and never shrink it; with only 4/8 bytes per element size is insignificant.
 - automatically reallocate the queue to double size if it is overflowed.
 - if queue reallocation failed, store extra CCBs in unsorted TAILQ,
fetching them back as soon as some queue element is freed.

To free space in CCB for TAILQ linking, change highpowerq from keeping
high-power CCBs to keeping devices frozen due to high-power CCBs.

This encloses all pieces of queue resize logic inside of cam_queue.[ch],
removing some not obvious duties from xpt_release_ccb().


git-svn-id: svn+ssh://svn.freebsd.org/base/head@253958 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFprojects/camlock r249006:
Pass SIM pointer as an argument to camisr_runqueue() instead of doneq
pointer.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@253960 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Correct a fat-finger in the last delta.

MFC after: ASAP


git-svn-id: svn+ssh://svn.freebsd.org/base/head@253965 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
The tmpfs_alloc_vp() is used to instantiate vnode for the tmpfs node,
in particular, from the tmpfs_lookup VOP method.  If LK_NOWAIT is not
specified in the lkflags, the lookup is supposed to return an alive
vnode whenever the underlying node is valid.

Currently, the tmpfs_alloc_vp() returns ENOENT if the vnode attached
to node exists and is being reclaimed.  This causes spurious ENOENT
errors from lookup on tmpfs and corresponding random 'No such file'
failures from syscalls working with tmpfs files.

Fix this by waiting for the doomed vnode to be detached from the tmpfs
node if sleepable allocation is requested.

Note that filesystems which use vfs_hash.c, correctly handle the case
due to vfs_hash_get() looping when vget() returns ENOENT for sleepable
requests.

Reported and tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks


git-svn-id: svn+ssh://svn.freebsd.org/base/head@253967 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
When entering exception handlers we may not have an aligned stack. This is
because an exception may happen at any time. The stack alignment rules on
ARM EABI state the only place the stack must be 8-byte aligned is on a
function boundary.

If an exception happens while a function is setting up or tearing down it's
stack frame it may not be correctly aligned. There is also no requirement
for it to be when the function is a leaf node.

The fix is to align the stack after we have stored a backup of the old stack
pointer, but before we have stored anything in the trapframe. Along with
this we need to adjust the size of the trapframe by 4 bytes to ensure the
stack below it is also correctly aligned.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@253968 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Do not override the ENOENT error for the empty path, or EFAULT errors
from copyins, with the relative lookup check.

Discussed with:	rwatson
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week


git-svn-id: svn+ssh://svn.freebsd.org/base/head@253969 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
- Use time_uptime instead of time_second in data structures for
  PF_INET6 in kernel.  This fixes various malfunction when the wall time
  clock is changed.  Bump __FreeBSD_version to 1000041.

- Use clock_gettime(CLOCK_MONOTONIC_FAST) in userland utilities.

MFC after:	1 month


git-svn-id: svn+ssh://svn.freebsd.org/base/head@253970 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Let the platform calculate the timer frequency at runtime, and use that for
the omap4, instead of relying on the (wrong) value provided in the dts.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@253971 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Document IPv6 timer value change in r253970.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@253972 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
To better understand performance problems with journalled soft updates,
we need to collect the highest level of allocation for each of the
different soft update dependency structures. This change collects these
statistics and makes them available using `sysctl debug.softdep.highuse'.

Reviewed by: kib
Tested by:   Peter Holm
MFC after:   2 weeks


git-svn-id: svn+ssh://svn.freebsd.org/base/head@253973 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
With the addition of journalled soft updates, the "newblk" structures
persist much longer than previously. Historically we had at most 100
entries; now the count may reach a million. With the increased count
we spent far too much time looking them up in the grossly undersized
newblk hash table. Configure the newblk hash table to accurately reflect
the number of entries that it must index.

Reviewed by: kib
Tested by:   Peter Holm
MFC after:   2 weeks


git-svn-id: svn+ssh://svn.freebsd.org/base/head@253974 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Evict pages from the PTEG when it's full and trying to insert a new PTE,
rather than panicking.

Reviewed by:	nwhitehorn
MFC after:	3 weeks


git-svn-id: svn+ssh://svn.freebsd.org/base/head@253976 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
- Use pget(PGET_CANDEBUG | PGET_NOTWEXIT) to determine if the specified
  PID is valid for monitoring in FILEMON_SET_PID ioctl.

- Set the monitored PID to -1 when the process exits.

Suggested by:	jilles
Tested by:	sjg
MFC after:	3 days


git-svn-id: svn+ssh://svn.freebsd.org/base/head@253977 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Remove an unnecessary panic.  The PVO's PTE entry and the PTEG's PTE entry may
not match, if the PVO's PTE is invalid.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@253978 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Micro-optimize OFW syscons 8-bit blank.

MFC after:	1 week


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