${CC} --version doesn't need to be queried if both COMPILER_TYPE and
COMPILER_VERSION are known


git-svn-id: svn+ssh://svn.freebsd.org/base/head@275588 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
The previous commit should have been a logical or not a logical "and"

Pointyhat to: me


git-svn-id: svn+ssh://svn.freebsd.org/base/head@275589 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Document support for Netgear WG111v1 (rev2)


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

5202 want ctf(4)

illumos/illumos-gate@fe2e029eea29fd49d0d9058dbd5b79a252667e6b


git-svn-id: svn+ssh://svn.freebsd.org/base/head@275592 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add refcounting to IPv6 DAD objects and simplify the DAD code to fix a
number of races which could cause double frees or use-after-frees when
performing DAD on an address. In particular, an IPv6 address can now only be
marked as a duplicate from the DAD callout.

Differential Revision:	https://reviews.freebsd.org/D1258
Reviewed by:		ae, hrs
Reported by:		rstone
MFC after:		1 month


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

When importing a pool, don't assume that the passed pool configuration
at vdev_load is always vaild.  It's possible that a stale configuration
that comes with extra vdevs, where metaslab_init() would fail because
of lower layer returns error.

Change the code to make metaslab_init() handle and return errors from
lower layer and pass it back to upper layer and handle it there.

Illumos issue:
    5213 panic in metaslab_init due to space_map_open returning ENXIO

MFC after:	2 weeks


git-svn-id: svn+ssh://svn.freebsd.org/base/head@275594 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Use calloc() instead of malloc() + bzero().  This also gets rid of a warning
because bzero is defined by strings.h which is not included in thread_pool.c.

MFC after:	2 weeks


git-svn-id: svn+ssh://svn.freebsd.org/base/head@275595 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Use CURVNET macros inside inet_get_local_port_range() function.
Without this fix, a kernel with VIMAGE + Infiniband will panic on bootup.

Certain necessary #include statements require LIST_HEAD.
Add these includes to ofed/include/linux/list.h, because
LIST_HEAD is specifically overridden in this file.

PR: 191468
Differential Revision: D1279
Reviewed by: hselasky


git-svn-id: svn+ssh://svn.freebsd.org/base/head@275599 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Build gperf with xdev as part of _xb-bootstrap-tools

This will unbreak the build when "env MK_CXX=no make delete-old" has been run
on the build host post-r272849

Tested with the following commands:

/bin/sh
export __MAKE_CONF=/dev/null SRCCONF=/dev/null
export MK_CLANG=no MK_CLANG_BOOTSTRAP=no MK_GCC=yes MK_GCC_BOOTSTRAP=yes
export MK_GNUCXX=yes TARGET=armv6 TARGET_ARCH=arm make xdev
make toolchain
make xdev-build
sudo -E make xdev-install
/usr/armv6-freebsd/usr/bin/cc -dumpmachine | grep arm

X-MFC with: r272849
Reported by: Dan Raymond <draymond@foxvalley.net>, gjb


git-svn-id: svn+ssh://svn.freebsd.org/base/head@275602 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add more USB quirks for Western Digital external USB HDD
enclosures. Rename an incorrectly named device. Increase
limit for maximum number of quirks.

PR:	    178771, 180617
MFC after:  2 weeks


git-svn-id: svn+ssh://svn.freebsd.org/base/head@275605 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add more U3G USB IDs.

Submitted by:	Benediktus Anindito <bennybroz105@gmail.com>
MFC after:	1 week


git-svn-id: svn+ssh://svn.freebsd.org/base/head@275606 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
patch(1): avoid line number overflows

Introduce strtolinenum to properly check line numbers while parsing:
no signs, no spaces, just digits, 0 <= x <= LONG_MAX

Properly validate line ranges supplied in diff file to prevent overflows.
Also fixes an out of boundary memory access because the resulting values
are used as array indices.

PR:	195436
Obtained from:	OpenBSD (CVS pch.c rev 1.45, 1,46, common.h rev 1.28)
MFC after:	1 week


git-svn-id: svn+ssh://svn.freebsd.org/base/head@275612 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Adjust the 'Relnotes:' search to look for any non-empty
string following the tag.

Sponsored by:	The FreeBSD Foundation


git-svn-id: svn+ssh://svn.freebsd.org/base/head@275613 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Adjust the |x| small limit from 0x1p-7 to 0x1p-9.  This
adjustment increases the number of correctly rounded
cases within the interval on i386.

Requested by:	bde


git-svn-id: svn+ssh://svn.freebsd.org/base/head@275614 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
When process is exiting, check for suspension regardless of
multithreaded status of the process.

The stopped state must be cleared before P_WEXIT is set.  A stop
signal delivered just before first PROC_LOCK() block in exit1(9) would
put the process into pending stop with P_WEXIT set or assertion
triggered.  Also recheck for the suspension after failed
thread_single(9) call, since process lock could be dropped.

Reported and tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week


git-svn-id: svn+ssh://svn.freebsd.org/base/head@275615 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Thread waiting for the vfork(2)-ed child to exec or exit, must allow
for the suspension.

Currently, the loop performs uninterruptible cv_wait(9) call, which
prevents suspension until child allows further execution of parent.
If child is stopped, suspension or single-threading is delayed
indefinitely.

Create a helper thread_suspend_check_needed() to identify the need for
a call to thread_suspend_check().  It is required since call to the
thread_suspend_check() cannot be safely done while owning the child
(p2) process lock.  Only when suspension is needed, drop p2 lock and
call thread_suspend_check().  Perform wait for cv with timeout, in
case suspend is requested after wait started; I do not see a better
way to interrupt the wait.

Reported and tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week


git-svn-id: svn+ssh://svn.freebsd.org/base/head@275616 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Do some refactoring and minor cleanups of the thread_single() code in
preparation for the global stop commit.

Move the code to weed suspended or sleeping threads into the
appropriate state, into the helper weed_inhib().  Current code already
has deep nesting and hard to follow [1].

Add currently useless helper remain_for_mode(), which returns the
count of threads which are allowed to run, according to the
single-threading mode.

In thread_single_end(), do not save curthread into local variable, it
is unused after, except to find curproc.

Remove stray empty line.

Requested by:	avg [1]
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week


git-svn-id: svn+ssh://svn.freebsd.org/base/head@275617 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Current reaction of the nfsd worker threads to any signal is exit.
This is not correct at least for the stop requests.  Check for stop
conditions and suspend threads if requested.

Reported and tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week


git-svn-id: svn+ssh://svn.freebsd.org/base/head@275618 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
When getnewbuf_reuse_bp() is called to reclaim some (clean) buffer,
the vnode owning the buffer is not locked.  More, it cannot be locked
safely, since getnewbuf_reuse_bp() is called from newbuf(), and some
other vnode is already locked, for which reused buffer will be
reassigned.

As the consequence, reclamation of the owning vnode could go in
parallel, in particular, the call to vnode_destroy_vobject(), which
deallocates the vm object and zeroes the v_bufobj->bo_object.  Note
that the pages wired by the buffer are left wired and can be safely
freed by the vfs_vmio_release() without the need for the vm object
lock.  Also, seeing stale pointer to the v_object is safe due to vm
object type stability.

Check for bo_bufobj != NULL and cache the value in local variable to
avoid trying to lock NULL vm object.

Reported and tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week


git-svn-id: svn+ssh://svn.freebsd.org/base/head@275619 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add functions syncer_suspend() and syncer_resume(), which are supposed
to be called before suspension and after resume, correspondingly.  The
syncer_suspend() ensures that all filesystems dirty data and metadata
are saved to the permanent storage, and stops kernel threads which
might modify filesystems.  The syncer_resume() restores stopped
threads.

For now, only syncer is stopped.  This is needed, because each sync
loop causes superblock updates for UFS.

Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week


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