Free memory after deleting an address policy entry.

MFC after:	1 week


git-svn-id: svn://svn.freebsd.org/base/head@249398 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Update with several early mentor/mentee relationships and dates commit
bits were granted.  Relationships have been provided by the mentees,
dates have been sourced from either the mentees or the CVS mailing list
archives.

Obtained from:	mux, wilko, msmith, peter, schweikh
Obtained from:	gallatin, dfr, murray, jkoshy


git-svn-id: svn://svn.freebsd.org/base/head@249399 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Attempt to clean up spacing and long lines.


git-svn-id: svn://svn.freebsd.org/base/head@249400 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
isa_if.h is indirectly included.
Depend on it to unbreak pc98 builds.


git-svn-id: svn://svn.freebsd.org/base/head@249403 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
- Switch order of setting real uid and gid. If we set uid first, then we
  don't have enough privileges to set gid.

  This looks like a long standing bug, just recently revealed by r241852.

Approved by:	cognet


git-svn-id: svn://svn.freebsd.org/base/head@249404 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
- Do not bail out if stat(2) fails with ENOENT in the spool directory. This
  happens if another atrm process removes a job while we're scanning through
  the directory.
- While at it, optimize a bit the directory scanning, so that we quit looping
  as soon as all jobs specified in argv have been dealt with.

Approved by:	cognet


git-svn-id: svn://svn.freebsd.org/base/head@249406 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sh: Don't modify exit status when break/continue/return passes !.

This matches what would happen if  ! P  were to be replaced with
if P; then false; else true; fi.

Example:
  f() { ! return 0; }; f


git-svn-id: svn://svn.freebsd.org/base/head@249407 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix kenv behavior when there is no static environment

In case where there are no static kernel environment entries, the
function init_dynamic_kenv() adds an incorrect entry at position 0 of
the dynamic kernel environment. This in turn causes kenv(1) to print
and empty list even though there are dynamic entries added later.

Fix this by checking env_pos in init_dynamic_kenv() and adding dynamic
entries only if there are static entries.


git-svn-id: svn://svn.freebsd.org/base/head@249408 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix incorrect KASSERTs in xlpge

Fix for crash in Netlogic XLP network accelerator driver when invariants
are enabled - use correct the condition for KASSERT.


git-svn-id: svn://svn.freebsd.org/base/head@249409 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Remove ctl(4) from GENERIC.  Also remove 'options CTL_DISABLE'
and kern.cam.ctl.disable tunable; those were introduced as a workaround
to make it possible to boot GENERIC on low memory machines.

With ctl(4) being built as a module and automatically loaded by ctladm(8),
this makes CTL work out of the box.

Reviewed by:	ken
Sponsored by:	FreeBSD Foundation


git-svn-id: svn://svn.freebsd.org/base/head@249410 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Reflect removing of the counter_u64_subtract() function in the macro.


git-svn-id: svn://svn.freebsd.org/base/head@249411 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix usage for soreceive(9) - uio must always be non-NULL.

MFC after:	1 week


git-svn-id: svn://svn.freebsd.org/base/head@249412 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add some more dates and relationships.

Submitted by:	jkoshy, gj, dfr


git-svn-id: svn://svn.freebsd.org/base/head@249413 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Move MIPS_MAX_TLB_ENTRIES definition from cpuregs.h to tlb.c

Having MIPS_MAX_TLB_ENTRIES defined to 128 is misleading, since it used
to be 64 in older releases of MIPS architecture (where it could be read
from Config1) and can be much more than 128 for the newer processors.

For now, move the definition to the only file using it (mips/mips/tlb.c)
and define MIPS_MAX_TLB_ENTRIES depending on the MIPS cpu defined. Also
add few checks so that we do not write beyond the end of the tlb_state
array.

This fixes a kernel data corruption seen in Netlogic XLP, which was casued
by tlb_save() writing beyond the end of tlb_state array when breaking into
debugger.


git-svn-id: svn://svn.freebsd.org/base/head@249415 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Do not panic when a busdma mapping operation fails.

Instead, print an error message and fail the associated command with
DATA_TRANSFER_ERROR NVMe completion status.

Sponsored by:	Intel


git-svn-id: svn://svn.freebsd.org/base/head@249416 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Rename the controller's fail_req_lock, so that it can be used for other
locking operations on the controller.

Sponsored by:	Intel


git-svn-id: svn://svn.freebsd.org/base/head@249417 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add a mutex to each namespace, for general locking operations on the namespace.

Sponsored by:	Intel


git-svn-id: svn://svn.freebsd.org/base/head@249418 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Remove the NVMe-specific physio and associated routines.

These were added early on for benchmarking purposes to avoid the mapped I/O
penalties incurred in kern_physio.  Now that FreeBSD (including kern_physio)
supports unmapped I/O, the need for these NVMe-specific routines no longer exists.

Sponsored by:	Intel


git-svn-id: svn://svn.freebsd.org/base/head@249419 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Move the busdma mapping functions to nvme_qpair.c.

This removes nvme_uio.c completely.

Sponsored by:	Intel


git-svn-id: svn://svn.freebsd.org/base/head@249420 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add support for passthrough NVMe commands.

This includes a new IOCTL to support a generic method for nvmecontrol(8) to pass
IDENTIFY, GET_LOG_PAGE, GET_FEATURES and other commands to the controller, rather than
separate IOCTLs for each.

Sponsored by:	Intel


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