Make sure that ${SHLIB_NAME}.debug and ${SHLIB_NAME}.symbols are always
deleted by a "make clean" when DEBUG_FLAGS is set.

Reported by:	gleb
Approved by:	emaste (co-mentor)


git-svn-id: svn://svn.freebsd.org/base/head@248806 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix the AR933x platform device start/stop code.

This was ported from the AR724x code and I think that also doesn't
quite work.  I'll investigate that soon.

With this in place the system reset path works, so 'reset' from kdb
actually resets the SoC.

Tested:

* AP121 test board


git-svn-id: svn://svn.freebsd.org/base/head@248809 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Release the v_writecount reference on the vnode in case of error,
before the vnode is vput() in vm_mmap_vnode().  Error return means
that there is no use reference on the vnode from the vm object
reference, and failing to restore v_writecount breaks the invariant
that v_writecount is less or equal to the usecount.

The situation observed when nfs client returns ESTALE for
VOP_GETATTR() after the open.

In collaboration with:	pho
MFC after:	1 week


git-svn-id: svn://svn.freebsd.org/base/head@248815 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
rc.subr: disabling globbing while processing devfs rules

The rules themselves typically have shell-like patterns and it is
incorrect when they get replaced with matching filesystem entries.

Shell magic by:	jilles
MFC after:	2 weeks


git-svn-id: svn://svn.freebsd.org/base/head@248820 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix compile of ciss(4) with CISS_DEBUG defined

Obtained from:	Yahoo! Inc.
MFC after:	2 weeks


git-svn-id: svn://svn.freebsd.org/base/head@248824 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Except one case mps(4) driver does not touch the data and works well with
unmapped I/O.  That one exception is access to INQUIRY VPD request result.
Those requests are never unmapped now, but to be safe add respective check
there and allow unmapped I/O for the SIM by setting PIM_UNMAPPED flag.


git-svn-id: svn://svn.freebsd.org/base/head@248825 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Restore DB_COMMAND capabilities of ciss(4) for debugging and diagnostics

Obtained from:	Yahoo! Inc.
MFC after:	2 weeks


git-svn-id: svn://svn.freebsd.org/base/head@248826 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add myself as ports committer.

Approved by:	crees (mentor)


git-svn-id: svn://svn.freebsd.org/base/head@248827 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Several fixes and improvements to sendfile()

1.  If we wanted to send exactly as many bytes as the socket buffer is
    sized for, the inner loop of kern_sendfile() would see that the
    socket is full before seeing that it had no more bytes left to send.
    This would cause it to return EAGAIN to the caller instead of
    success.  Fix by changing the order that these conditions are tested.
2.  Simplify the calculation for the bytes to send in each iteration of
    the inner loop of kern_sendfile()
3.  Fix some calls with bogus arguments to sf_buf_ext().  These would
    only trigger on mbuf allocation failure, but would be hilariously
    bad if they did trigger.

Submitted by:	gibbs(3), andre(2)
Reviewed by:	emax, andre
Obtained from:	Netflix
MFC after:	1 week


git-svn-id: svn://svn.freebsd.org/base/head@248830 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Delete extra IO qpairs allocated based on number of MSI-X vectors, but
later found to not be usable because the controller doesn't support the
same number of queues.

This is not the normal case, but does occur with the Chatham prototype
board.

Sponsored by:	Intel


git-svn-id: svn://svn.freebsd.org/base/head@248834 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Remove obsolete comment.  This code has now been tested with the QEMU
NVMe device emulator.


git-svn-id: svn://svn.freebsd.org/base/head@248835 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
KGDB: Allow modules to be loaded from the specified kernel's directory.

When looking up the absolute path for a kld, call find_kld_path() first.
This enables locating the module in a different directory than the one
stored in kernel memory.

With this change, kgdb can now be run on a kernel & vmcore whose associated
modules are located in the same directory as the kernel.  This makes
independent triaging of problems much easier.

This change also does not break the normal kgdb use case where no arguments
are specified; in that case kgdb loads the running kernel and its modules.

Reviewed by:	adrian
Approved by:	ken (mentor)
Sponsored by:	Spectra Logic
MFC after:	1 month


git-svn-id: svn://svn.freebsd.org/base/head@248836 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
KGDB: Accept KLD symbol files with the ".symbols" extension.

Submitted by:	gibbs
Approved by:	ken (mentor)
Sponsored by:	Spectra Logic
MFC after:	1 month


git-svn-id: svn://svn.freebsd.org/base/head@248838 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add the "-g <gdport>" option to the vmrun.sh script that enables remote
debugging of the guest via kgdb.

See also: https://wiki.freebsd.org/BHyVe/gdb

Obtained from:	NetApp


git-svn-id: svn://svn.freebsd.org/base/head@248840 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Update hwpmc to support Haswell class processors.
0x3C:      /* Per Intel document 325462-045US 01/2013. */

Add manpage to document all the goodness that is available in this
processor model.

Submitted by:	hiren panchasara <hiren.panchasara@gmail.com>
Reviewed by:	jimharris, sbruno
Obtained from:	Yahoo! Inc.
MFC after:	2 weeks


git-svn-id: svn://svn.freebsd.org/base/head@248842 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Bring over the initial, CPU-only UART support for the AR933x SoC.

This implements the kernel glue needed (getc, putc, rxready).

This isn't a 16550 UART, even if the datasheet overview claims so.

The Linux ar933x support was used as a reference, however the uart code
is a reimplementation.

Attentive viewers will note that the uart code is based off of the ns8250
code and the UART bus code is a stubbed-out version of this.  I'll be
replacing it with non-stubbed versions soon, making this a fully featured
driver.

Tested:

* AP121 reference board (AR933x), booting through the mountroot> prompt;
  then doing some basic interactive tests in ddb.


git-svn-id: svn://svn.freebsd.org/base/head@248843 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Tie in the AR933x support into -HEAD.


git-svn-id: svn://svn.freebsd.org/base/head@248844 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Remove dependency code that caused a double inclusion.

Pointed out by: rpaulo and others


git-svn-id: svn://svn.freebsd.org/base/head@248845 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Revert previous change in favor of a fix to the actual dtrace
libraries that addresses a #pragma issue.


git-svn-id: svn://svn.freebsd.org/base/head@248846 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Commit a patch that fixes a problem in the #pragma statement when searching
for and loading dependent modules.  This addresses a bug seen with
io.d where it was being doubly included.

PR:		171678
Submitted by:	 Mark Johnston
MFC after:	2 weeks


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