Merge the projects/pf/head branch, that was worked on for last six months,
into head. The most significant achievements in the new code:

 o Fine grained locking, thus much better performance.
 o Fixes to many problems in pf, that were specific to FreeBSD port.

New code doesn't have that many ifdefs and much less OpenBSDisms, thus
is more attractive to our developers.

  Those interested in details, can browse through SVN log of the
projects/pf/head branch. And for reference, here is exact list of
revisions merged:

r232043, r232044, r232062, r232148, r232149, r232150, r232298, r232330,
r232332, r232340, r232386, r232390, r232391, r232605, r232655, r232656,
r232661, r232662, r232663, r232664, r232673, r232691, r233309, r233782,
r233829, r233830, r233834, r233835, r233836, r233865, r233866, r233868,
r233873, r234056, r234096, r234100, r234108, r234175, r234187, r234223,
r234271, r234272, r234282, r234307, r234309, r234382, r234384, r234456,
r234486, r234606, r234640, r234641, r234642, r234644, r234651, r235505,
r235506, r235535, r235605, r235606, r235826, r235991, r235993, r236168,
r236173, r236179, r236180, r236181, r236186, r236223, r236227, r236230,
r236252, r236254, r236298, r236299, r236300, r236301, r236397, r236398,
r236399, r236499, r236512, r236513, r236525, r236526, r236545, r236548,
r236553, r236554, r236556, r236557, r236561, r236570, r236630, r236672,
r236673, r236679, r236706, r236710, r236718, r237154, r237155, r237169,
r237314, r237363, r237364, r237368, r237369, r237376, r237440, r237442,
r237751, r237783, r237784, r237785, r237788, r237791, r238421, r238522,
r238523, r238524, r238525, r239173, r239186, r239644, r239652, r239661,
r239773, r240125, r240130, r240131, r240136, r240186, r240196, r240212.

I'd like to thank people who participated in early testing:

Tested by:	Florian Smeets <flo freebsd.org>
Tested by:	Chekaluk Vitaly <artemrts ukr.net>
Tested by:	Ben Wilber <ben desync.com>
Tested by:	Ian FREISLICH <ianf cloudseed.co.za>


git-svn-id: svn://svn.freebsd.org/base/head@240233 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
The first part of check_priv() function, that attempts to obtain creds
from the control message, actually never worked. This means check_priv()
didn't work for local dgram sockets.

The SCM_CREDS control messages is received only in two cases:

1) If we did setsockopt(LOCAL_CREDS) on our socket, and in this case
   the message is struct sockcred.
2) If sender did supplied SCM_CREDS control message in his sendmsg()
   syscall. In this case the message is struct cmsgcred.

We can't rely on 2), so we will use 1) for dgram sockets. For stream
sockets it is more reliable to obtain accept-time credentials, since
SCM_CREDS control message is attached only on first read. Thus:

o Do setsockopt(LOCAL_CREDS) on local dgram sockets.
o Split check_priv() into check_priv_stream() and check_priv_dgram(),
  and call them from recv_stream() and recv_dgram() respectively.
o Don't provide space for SCM_CREDS control message in recv_stream().
o Provide space for SCM_CREDS control message in recv_dgram(), but there
  is no need to initialize anything in it.
o In recv_dgram() do not blindly expect that first message is SCM_CREDS,
  instead use correct search cycle through control messages.


git-svn-id: svn://svn.freebsd.org/base/head@240234 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
mdoc fixes.


git-svn-id: svn://svn.freebsd.org/base/head@240235 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Revert r239049:
This is the way to assign a range, but not
a single IPv4 address.

PR:		conf/167648
Approved by:	cperciva (implicit)


git-svn-id: svn://svn.freebsd.org/base/head@240237 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
pmap_remove:

  Avoid re-walking the page table from the root for every PTE examined.

  Tidy up some of pmap_remove()'s helper functions.

pmap_enter:

  Set PV_TABLE_REF whenever the physical page being mapped is managed, not
  just when it is writeable.

  Only call pmap_update_page() when the old mapping was valid.  If there was
  no prior valid mapping, then pmap_update_page() serves no useful purpose.
  However, it will interrupt every processor that has the pmap active.

pmap_enter_quick_locked:

  Always set PTE_RO.

pmap_emulate_modified:

  Don't set PV_TABLE_REF.

  Eliminate a nonsensical comment.


git-svn-id: svn://svn.freebsd.org/base/head@240241 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
userret() already checks for td_locks when INVARIANTS is enabled, so
there is no need to check if Giant is acquired after it.

Reviewed by:	kib
MFC after:	1 week


git-svn-id: svn://svn.freebsd.org/base/head@240244 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Move PT_UPDATED_FLUSH() before td_locks check in order to have more
coverage also in the XEN case.

Reviewed by:	kib
MFC after:	1 week


git-svn-id: svn://svn.freebsd.org/base/head@240245 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Move the checks for td_pinned, td_critnest, TDP_NOFAULTING and
TDP_NOSLEEPING leaking from syscallret() to userret() so that also
trap handling is covered. Also, the check on td_locks is not duplicated
between the two functions.

Reported by:	avg
Reviewed by:	kib
MFC after:	1 week


git-svn-id: svn://svn.freebsd.org/base/head@240246 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sh: Remove XXX comment about removing nextopt().

Using nextopt() avoids depending on the BSD-specific optreset feature in
getopt() and reduces code size (both source and binary).


git-svn-id: svn://svn.freebsd.org/base/head@240247 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix loading of kernel modules at boot time for powerpc64.

Reported by:	Mathias Breuninger
MFC after:	1 week


git-svn-id: svn://svn.freebsd.org/base/head@240249 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Whitespace cleanup.

MFC after: 10 days


git-svn-id: svn://svn.freebsd.org/base/head@240250 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Regenerate src.conf.5 after the projects/armv6 merge

Approved by:	des


git-svn-id: svn://svn.freebsd.org/base/head@240251 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Remove documentation and www cvsup files as they are no longer useful
with the switch to subversion.

Approved by:	gjb (man pages)
Approved by:	cperciva (example files, implicit)
MFC after:	1 week


git-svn-id: svn://svn.freebsd.org/base/head@240252 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Minor English grammar fixes.
Specifically document that an incomplete ports tree is not supported.
Remove useless comment about sendmail.

Reviewed by:	yuri.pankov@gmail.com
Approved by:	cperciva (implicit)
MFC after:	1 week
X-MFC-With:	r240252


git-svn-id: svn://svn.freebsd.org/base/head@240253 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Merge remote-tracking branch 'upstream/master'