Add missing VM object unlocks in an error case.

Reviewed by:	kib
Override bmake's default MAKEFILE_PREFERENCE
Make 'portsnap alfred' overwrite ports tree if it's not created by a
portsnap.

Discussed with:	alfred
Reviewed by:	cperciva
Remove an extra copy of _setjmp from libstand. We have used the libc version
of this function since r183876.
Include machine/setjmp.h to get the definition of _JB_MAGIC__SETJMP. This
allows us to remove it from the ARM copy of machine/asm.h.
Reduce the difference to NetBSD.

 * Stop pretending we support anything other than ELF by removing code
   surrounded by #ifdef __ELF__ ... #endif.
 * Remove _JB_MAGIC_SETJMP and _JB_MAGIC__SETJMP, they are defined in
   setjmp.h, which is able to be included from asm.
 * Fix the spelling of dependent.
 * Rename END _END and add END and ASEND to complement ENTRY and ASENTRY
   respectively
 * Add macros to simplify accessing the Global Offset Table, some of these
   will be used in the upcoming update to the setjmp functions.
Add a new knob WITH_DEBUG_FILES to control the building of standalone
debug files for userland programs and libraries.  The "-g" debug flag
is automatically applied when WITH_DEBUG_FILES is set.

The debug files are now named ${prog}.debug and ${shlib}.debug for
consistency with other systems and documentation.  In addition they are
installed under /usr/lib/debug, to simplify the process of installing
them if needed after a crash.  Users of bsd.{prog,lib}.mk outside of the
base system place the standalone debug files in a .debug subdirectory.
GDB automatically searches both of these directories for standalone
debug files.

Thanks to everyone who contributed changes, review, and testing during
development.
Add WITH_DEBUG_FILES

makeman currently generates a src.conf that claims every option also
enforces WITHOUT_BIND_UTILS, so I applied this section by hand.
Finish pulling in the NetBSD setjmp/longjmp updates on ARM.

Store/restore the VFP registers in setjmp/longjmp on ARM EABI if VFP is
enabled in the kernel. It checks the hw.floatingpoint sysctl to see if
floating-point is available and uses this to determine if it should store
them. If it does it uses a different magic value so longjmp is able to know
if it should load them.
Fix some recent regression issues:

1) Only multi-TD isochronous transfers should use NORMAL
type after specific type as per XHCI specification.

2) BEI bit is only available in NORMAL and ISOCHRONOUS
TRB types. Don't use this bit for other types to avoid
hardware asserts. Reserved bits should be don't care
though ...

MFC after:	1 week
PR:		usb/179342
Implement foreign volume handling.  Allows admins to view foreign metadata
and clear or import it for use.

PR:     kern/172091
Submitted by:   smh@freebsd.org
Reviewed by:    jhb@freebsd.org
MFC after:      2 weeks
Merge in changes from NetBSD:
 * Remove support for non-elf files.
 * Add the VFP setjmp magic numbers.
 * Add the offsets for the VFP registers within the buffer.
cxgbe/tom: Fix bad signed/unsigned mixup in the stid allocator.  This
fixes a panic when allocating a mixture of IPv6 and IPv4 stids.

MFC after:	1 week
MFV r251519:

 * Illumos ZFS issue #3805 arc shouldn't cache freed blocks

Quote from the Illumos issue:

    ZFS should proactively evict freed blocks from the cache.

    Even though these freed blocks will never be used again, and thus
    will eventually be evicted, this causes us to use memory
    inefficiently for 2 reasons:

    1. A block that is freed has no chance of being accessed again, but
       will be kept in memory preferentially to a block that was accessed
       before it (and is thus older) but has not been freed and thus has
       at least some chance of being accessed again.

    2. We partition the ARC into several buckets:
       user data that has been accessed only once (MRU)
       metadata that has been accessed only once (MRU)
       user data that has been accessed more than once (MFU)
       metadata that has been accessed more than once (MFU)

    The user data vs metadata split is somewhat arbitrary, and the
    primary control on how much memory is used to cache data vs metadata
    is to simply try to keep the proportion the same as it has been in the
    past (each bucket "evicts against" itself).  The secondary control is
    to evict data before evicting metadata.

    Because of this bucketing, we may end up with one bucket mostly
    containing freed blocks that are very old, while another bucket has
    more recently accessed, still-allocated blocks.  Data in the useful
    bucket (with still-allocated blocks) may be evicted in preference to
    data in the useless bucket (with old, freed blocks).

    On dcenter, we saw that the MFU metadata bucket was 230MB, while the
    MFU data bucket was 27GB and the MRU metadata bucket was 256GB.
    However, the vast majority of data in the MRU metadata bucket (256GB)
    was freed blocks, and thus useless.  Meanwhile, the MFU metadata bucket
    (230MB) was constantly evicting useful blocks that will be soon needed.

    The problem of cache segmentation is a larger problem that needs more
    investigation.  However, if we stop caching freed blocks, it should
    reduce the impact of this more fundamental issue.

MFC after:	2 weeks
  Separate LIO_SYNC processing into a separate function aio_process_sync(),
and rename aio_process() into aio_process_rw().

Reviewed by:	kib
Sponsored by:	Nginx, Inc.
  Make sys_mlock() function just a wrapper around vm_mlock() function
that does all the job.

Reviewed by:	kib, jilles
Sponsored by:	Nginx, Inc.
Add proper __sync_*() intrinsics for MIPS.

To make <stdatomic.h> work on MIPS (and ARM) using GCC, we need to
provide implementations of the __sync_*() functions. I already added
these functions for 4 and 8 byte types to libcompiler-rt some time ago,
based on top of <machine/atomic.h>.

Unfortunately, <machine/atomic.h> only provides a subset of the features
needed to implement <stdatomic.h>. This means that in some cases we had
to do compare-and-exchange calls in loops, where a simple ll/sc would
suffice.

Also implement these functions for 1 and 2 byte types. MIPS only
provides ll/sc instructions for 4 and 8 byte types, but this is of
course no limitation. We can simply load 4 bytes and use some bitmask
tricks to modify only the bytes affected.

Discussed on:	mips, arch
Tested with:	QEMU
Use improved __sync_*() intrinsics for MIPS in userspace as well.

r251524 introduced custom tailored versions for MIPS of these functions
for kernel-space code. We can just reuse them in userspace as well.
  Add new system call - aio_mlock(). The name speaks for itself. It allows
to perform the mlock(2) operation, which can consume a lot of time, under
control of aio(4).

Reviewed by:	kib, jilles
Sponsored by:	Nginx, Inc.
aio_mlock() added:
  - Regen for r251526.
  - Bump __FreeBSD_version.