carp_send_ad() should never return without rescheduling next run.


git-svn-id: svn://svn.freebsd.org/base/head@241043 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Update a comment to reflect recent locking changes.


git-svn-id: svn://svn.freebsd.org/base/head@241044 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Give a clue how to force tcpdump(8) to interpret correctly CARP packets.


git-svn-id: svn://svn.freebsd.org/base/head@241045 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
libc: Use O_CLOEXEC for various internal file descriptors.

This fixes a race condition where another thread may fork() before CLOEXEC
is set, unintentionally passing the descriptor to the child process.

This commit only adds O_CLOEXEC flags to open() or openat() calls where no
fcntl(fd, F_SETFD, FD_CLOEXEC) follows. The separate fcntl() call still
leaves a race window so it should be fixed later.


git-svn-id: svn://svn.freebsd.org/base/head@241046 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Disable splitfs support, since we aren't support floppies for a long
time. This slightly reduces an overhead, when loader tries to open
file that doesn't exist.


git-svn-id: svn://svn.freebsd.org/base/head@241047 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Remove unused variables.


git-svn-id: svn://svn.freebsd.org/base/head@241048 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add missing va_end.


git-svn-id: svn://svn.freebsd.org/base/head@241049 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
If devclass_get_devices(9) returns success but a count of 0,
free the pointer.


git-svn-id: svn://svn.freebsd.org/base/head@241050 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
* src/math_private.h:
  . Change the API for the LD80C by removing the explicit passing
    of the sign bit.  The sign can be determined from the last
    parameter of the macro.
  . On i386, load long double by bit manipulations to work around
    at least a gcc compiler issue.  On non-i386 ld80 architectures,
    use a simple assignment.

* ld80/s_expl.c:
  . Update the only consumer of LD80C.

Submitted by:	bde
Approved by:	das (mentor)


git-svn-id: svn://svn.freebsd.org/base/head@241051 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
- Get rid of #ifdef __FreeBSD__.
- Use correct format when printing uint64_t.


git-svn-id: svn://svn.freebsd.org/base/head@241052 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Almost each time when loader opens a file, this leads to calling
disk_open(). Very often this is called several times for one file.
This leads to reading partition table metadata for each call. To
reduce the number of disk I/O we have a simple block cache, but it
is very dumb and more than half of I/O operations related to reading
metadata, misses this cache.

Introduce new cache layer to resolve this problem. It is independent
and doesn't need initialization like bcache, and will work by default
for all loaders which use the new DISK API. A successful disk_open()
call to each new disk or partition produces new entry in the cache.
Even more, when disk was already open, now opening of any nested
partitions does not require reading top level partition table.
So, if without this cache, partition table metadata was read around
20-50 times during boot, now it reads only once. This affects the booting
from GPT and MBR from the UFS.


git-svn-id: svn://svn.freebsd.org/base/head@241053 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add support for mincore().  Specifically, this is an adaptation of the
pmap_mincore() implementation that was added to the original arm pmap
in r235717.


git-svn-id: svn://svn.freebsd.org/base/head@241054 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Eliminate unused variables.


git-svn-id: svn://svn.freebsd.org/base/head@241055 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Simplify send out queue code:
- Write method of a queue now is void,length of item is taken
  as queue property.
- Write methods don't need to know about mbud, supply just buf
  to them.
- No need for safe queue iterator in pfsync_sendout().

Obtained from:	OpenBSD


git-svn-id: svn://svn.freebsd.org/base/head@241056 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Clear and re-setup all function pointers that glue pf(4) and pfsync(4)
together whenever the pfsync0 is brought down or up respectively.


git-svn-id: svn://svn.freebsd.org/base/head@241057 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Eliminate an unused declaration.


git-svn-id: svn://svn.freebsd.org/base/head@241058 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Document the security.bsd.unprivileged_idprio in idprio(1) in addition
to rtprio(2).

Approved by:	wblock
MFC after:	3 days


git-svn-id: svn://svn.freebsd.org/base/head@241061 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
clarify the wording for 'first' and 'last'

Approved by:	wblock
MFC after:	3 days


git-svn-id: svn://svn.freebsd.org/base/head@241062 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Stop calling pmap_remove_write() from pmap_remove_all().  Doing so is not
only inefficient but also leads to recursive lock acquisition.

Tested by:	ray


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