]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
8 years agoUse the expiry date to determine whether to replace the DB copy of
cy [Wed, 25 May 2016 01:35:02 +0000 (01:35 +0000)]
Use the expiry date to determine whether to replace the DB copy of
leapfile instead of using the leapfile serial number (create
timestamp).

PR: 209577
MFC after: 3 days

8 years agoSet the TLB caching properties for portals at attach time.
jhibbits [Wed, 25 May 2016 01:23:19 +0000 (01:23 +0000)]
Set the TLB caching properties for portals at attach time.

This was found while reworking the device tree nodes for dtsec to match the
Linux device tree.  Instead of waiting and expecting later code to call
dpaa_portal_map_registers(), do the equivalent immediately upon mapping.
Otherwise, it's possible to access the pages before that function is called, and
hang the CPU.

8 years agoDelay calling yp_malloc_dnsent() until after some additional sanity
truckman [Wed, 25 May 2016 00:25:38 +0000 (00:25 +0000)]
Delay calling yp_malloc_dnsent() until after some additional sanity
checks to avoid leaking memory on error returns.

Reported by: Coverity
CID: 1007416
MFC after: 1 week

8 years agoCall free(cur) if strdup(dirp->d_name) fails to avoid a memory leak.
truckman [Wed, 25 May 2016 00:16:52 +0000 (00:16 +0000)]
Call free(cur) if strdup(dirp->d_name) fails to avoid a memory leak.

Reported by: Coverity
CID: 1007414
MFC after: 1 week

8 years agoefi loader: Match format string to EFI_ERROR_CODE()
cem [Wed, 25 May 2016 00:13:01 +0000 (00:13 +0000)]
efi loader: Match format string to EFI_ERROR_CODE()

Silence a format specifier warning.

Sponsored by: EMC / Isilon Storage Division

8 years agoFix acpidb CIDs 1011279 (Buffer not null terminated) and 978405 and
truckman [Tue, 24 May 2016 23:41:36 +0000 (23:41 +0000)]
Fix acpidb CIDs 1011279 (Buffer not null terminated) and 978405 and
1199380 (Resource leak).

load_dsdt() calls strncpy() to copy a filename and Coverity warns
that the destination buffer may not be NUL terminated.  Fix this
by using strlcpy() instead.  If silent truncation occurs, then the
filename was not valid anyway.

load_dsdt() leaks an fd (CID 978405) and a memory region allocated
using mmap() (CID 1199380) when it returns.  Fix these by calling
close() and munmap() as appropriate.

Don't bother fixing the minor memory leak "list", allocated by
AcGetAllTablesFromFile() (CID 1355191).

Check for truncation when creating the temp file name.

Set a flag to indicate that the temp file should be unlinked.
Relying on a strcmp() test could delete the input file in contrived
cases.

Reported by: Coverity
CID: 1011279, 978405, 1199380
Reviewed by: jkim
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D6368

8 years agoFix acpidump CID 1011278 (Buffer not null terminated) and other issues
truckman [Tue, 24 May 2016 23:36:43 +0000 (23:36 +0000)]
Fix acpidump CID 1011278 (Buffer not null terminated) and other issues

Coverity reports that a buffer used for temporary file generation
might not be NUL terminated by strncpy().  This is probably not
true because the input gets passed through realpath(), but if the
path name is sufficiently long the name could be truncated and cause
other problems.  The code for generating the temp file names is
also overly complex.  Instead of a bunch of calls to strncpy() and
and strncat(), simplify the code by using snprintf() and add checks
for unexpected truncation.

The output file created by iasl -d is predictable.  Fix this by
using  mkdtemp() to create a directory to hold the iasl input and
output files.

Check the return values of more syscalls.

Reported by: Coverity
CID: 1011278
Reviewed by: jkim
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D6360

8 years agoRegenerate
bdrewery [Tue, 24 May 2016 23:19:03 +0000 (23:19 +0000)]
Regenerate

8 years agoWITH_META_MODE: Correct description of missing .meta file.
bdrewery [Tue, 24 May 2016 23:15:52 +0000 (23:15 +0000)]
WITH_META_MODE: Correct description of missing .meta file.

Sponsored by: EMC / Isilon Storage Division

8 years ago[bhnd] Normalize bhnd(4) device matching API
adrian [Tue, 24 May 2016 21:20:17 +0000 (21:20 +0000)]
[bhnd] Normalize bhnd(4) device matching API

This unifies handling of core, chip, and board-level device
matching, and adds support for matching device drivers
against the bus attach type (e.g. SoC vs WiFi adapter).

Core-level quirks on Broadcom's chipsets generally are specific
to some combination of chip model, core revision, chip
package (e.g. 12x9 SMT package), SROM revision, etc.

Unifying the match APIs for all three attribute types (core, chip,
board/srom) allows defining a single device quirk table that
matches across all of those attributes.

Submitted by: Landon Fuller <landonf@landonf.org>
Differential Revision:  https://reviews.freebsd.org/D6515

8 years agoSilence false LOR report due to the taskqueue mutex and kqueue lock
kib [Tue, 24 May 2016 21:13:33 +0000 (21:13 +0000)]
Silence false LOR report due to the taskqueue mutex and kqueue lock
named the same.

Reported by: Doug Luce <doug@freebsd.con.com>
Sponsored by: The FreeBSD Foundation

8 years agoReturn the correct status when a partially completed request is cancelled.
jhb [Tue, 24 May 2016 21:09:05 +0000 (21:09 +0000)]
Return the correct status when a partially completed request is cancelled.

After the previous changes to fix requests on blocking sockets to complete
across multiple operations, an edge case exists where a request can be
cancelled after it has partially completed.  POSIX doesn't appear to
dictate exactly how to handle this case, but in general I feel that
aio_cancel() should arrange to cancel any request it can, but that any
partially completed requests should return a partial completion rather
than ECANCELED.  To that end, fix the socket AIO cancellation routine to
return a short read/write if a partially completed request is cancelled
rather than ECANCELED.

Sponsored by: Chelsio Communications

8 years agoRemove unnecessary memset(.., 0, ..)'s
ngie [Tue, 24 May 2016 20:06:41 +0000 (20:06 +0000)]
Remove unnecessary memset(.., 0, ..)'s

The mem_alloc macro calls calloc (userspace) / malloc(.., M_WAITOK|M_ZERO)
under the covers, so zeroing out memory is already handled by the underlying
calls

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

8 years agoFix up r300385
ngie [Tue, 24 May 2016 19:52:05 +0000 (19:52 +0000)]
Fix up r300385

I accidentally glossed over the fact that tmp is manipulated via strchr, so
if we tried to free `tmp` after r300385, it would have crashed.

Create a separate pointer (tmp2) to track the original allocation of `tmp`,
and free `tmp2` if `p->nc_lookups` can't be malloced

MFC after: 4 days
X-MFC with: r300385
Reported by: Coverity
CID: 1356026
Sponsored by: EMC / Isilon Storage Division

8 years agoIn vm_page_cache(), only drop the vnode after radix insert failure
kib [Tue, 24 May 2016 19:20:30 +0000 (19:20 +0000)]
In vm_page_cache(), only drop the vnode after radix insert failure
for empty page cache when the object type if OBJT_VNODE.

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

8 years agoRemove redundant NULLing of outbuf_pmap
ngie [Tue, 24 May 2016 18:53:06 +0000 (18:53 +0000)]
Remove redundant NULLing of outbuf_pmap

If reallocf ever failed, outbuf_pmap would already be NULL

MFC after: 1 week
X-MFC with: r300620
Reported by: cem
Sponsored by: EMC / Isilon Storage Division

8 years agoUse reallocf instead of malloc to fix leak with outbuf_pmap
ngie [Tue, 24 May 2016 18:44:50 +0000 (18:44 +0000)]
Use reallocf instead of malloc to fix leak with outbuf_pmap

The previous code overwrote outbuf_pmap's memory with malloc once per
loop iteration, which leaked its memory; use reallocf instead to ensure
that memory is properly free'd each loop iteration.

Add a outbuf_pmap = NULL in the failure case to avoid a double-free
at the bottom of the function.

Differential Revision: https://reviews.freebsd.org/D6495
MFC after: 1 week
Reported by: Coverity
CID: 1038776
Reviewed by: markj, pfgj
Sponsored by: EMC / Isilon Storage Division

8 years agoTry to unbreak the build after r300611 by including the header
bz [Tue, 24 May 2016 17:38:27 +0000 (17:38 +0000)]
Try to unbreak the build after r300611 by including the header
defining VM_MIN_KERNEL_ADDRESS.

Sponsored by: DARPA/AFRL

8 years agoAdd initial DTrace support for RISC-V.
br [Tue, 24 May 2016 16:41:37 +0000 (16:41 +0000)]
Add initial DTrace support for RISC-V.

Sponsored by: DARPA, AFRL
Sponsored by: HEIF5

8 years agoSet dependencies for genassym.c.
br [Tue, 24 May 2016 16:30:05 +0000 (16:30 +0000)]
Set dependencies for genassym.c.
This fixes non-parallel build.

8 years ago[bhnd] fix compilation due to incompatible types
adrian [Tue, 24 May 2016 15:39:57 +0000 (15:39 +0000)]
[bhnd] fix compilation due to incompatible types

Submitted by: Michael Zhilin <mizhka@gmail.com>
Differential Revision: https://reviews.freebsd.org/D6532

8 years agoAdd kern.icl.iser_offloads sysctl.
trasz [Tue, 24 May 2016 14:34:36 +0000 (14:34 +0000)]
Add kern.icl.iser_offloads sysctl.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoStore the original value of stack pointer to the exception frame
br [Tue, 24 May 2016 13:59:13 +0000 (13:59 +0000)]
Store the original value of stack pointer to the exception frame
(the value we had before supervisor exception occurred).
This helps consumers (e.g. DTrace) to not proceed additional calculations.

Sponsored by: DARPA, AFRL
Sponsored by: HEIF5

8 years agoBump copyright year
skreuzer [Tue, 24 May 2016 13:58:07 +0000 (13:58 +0000)]
Bump copyright year

Approved by: gjb@ (implicit)

8 years agoReject ioctl commands for FLSHGCHR and FLSHPCHR if the size is greater
sbruno [Tue, 24 May 2016 13:57:23 +0000 (13:57 +0000)]
Reject ioctl commands for FLSHGCHR and FLSHPCHR if the size is greater
than sc->areq.  This is a bounds check to ensure we're not just cramming
arbitrarily sized nonsense into the driver and overflowing the heap.

PR: 209545
Submitted by: cturt@hardenedbsd.org
MFC after: 2 weeks

8 years agoMark all memory before the kernel as toxic to DTrace.
andrew [Tue, 24 May 2016 13:57:23 +0000 (13:57 +0000)]
Mark all memory before the kernel as toxic to DTrace.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

8 years agoRe-enable write combining, disabled by default at r295486.
mav [Tue, 24 May 2016 12:40:03 +0000 (12:40 +0000)]
Re-enable write combining, disabled by default at r295486.

if_ntb(4) strongly benefits from WC, improving throughput from 350Mbit/s
to 8-10Gbit/s on my tests.

MFC after: 1 week

8 years agosfxge(4): enable Medford support
arybchik [Tue, 24 May 2016 12:20:23 +0000 (12:20 +0000)]
sfxge(4): enable Medford support

Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D6510

8 years agosfxge(4): bump driver version to the closest out-of-tree version
arybchik [Tue, 24 May 2016 12:19:14 +0000 (12:19 +0000)]
sfxge(4): bump driver version to the closest out-of-tree version

Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week

8 years agosfxge(4): cleanup: update copyright to 2016
arybchik [Tue, 24 May 2016 12:16:57 +0000 (12:16 +0000)]
sfxge(4): cleanup: update copyright to 2016

Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D6509

8 years agosfxge(4): provide option to disable not a local MAC address check
arybchik [Tue, 24 May 2016 12:15:30 +0000 (12:15 +0000)]
sfxge(4): provide option to disable not a local MAC address check

Option EFSYS_OPT_ALLOW_UNCONFIGURED_NIC disables check that the adapter
MAC address is not a local address (beginning 02).

Submitted by:   Laurence Evans <levans at solarflare.com>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D6508

8 years agosfxge(4): be ready to receive events immediately after event queues are created
arybchik [Tue, 24 May 2016 12:14:19 +0000 (12:14 +0000)]
sfxge(4): be ready to receive events immediately after event queues are created

Submitted by:   Mark Spender <mspender at solarflare.com>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D6507

8 years agoLimit calling pmc_hook to when the interrupt comes while running userspace.
andrew [Tue, 24 May 2016 12:06:56 +0000 (12:06 +0000)]
Limit calling pmc_hook to when the interrupt comes while running userspace.
We may enable interrupts from within the callback, e.g. in a data abort
during copyin. If we receive an interrupt at that time pmc_hook will be
called again and, as it is handling userspace stack tracing, will hit a
KASSERT as it checks if the trapframe is from userland.

With this I can run hwpmc with intrng on a ThunderX and have it trace all
CPUs.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

8 years agoAllow an MTU of 65535 bytes to be set via TUN[SG]IFINFO. This requires
tuexen [Tue, 24 May 2016 11:47:14 +0000 (11:47 +0000)]
Allow an MTU of 65535 bytes to be set via TUN[SG]IFINFO. This requires
changing the type on the mtu field in struct tuninfo from short to
unsigned short.
This is used, for example, by packetdrill to test with MTUs up to the
maximum value.

Differential Revision: 6452

8 years agoThe NAS-Identifier attribute is a string, not an integer.
des [Tue, 24 May 2016 11:44:43 +0000 (11:44 +0000)]
The NAS-Identifier attribute is a string, not an integer.

MFC after: 1 week

8 years agoIn vm_page_alloc_contig(), on vm_page_insert() failure, mark each
kib [Tue, 24 May 2016 10:21:39 +0000 (10:21 +0000)]
In vm_page_alloc_contig(), on vm_page_insert() failure, mark each
freed page as VPO_UNMANAGED.  Otherwise vm_pge_free_toq() insists on
owning the page lock.

Previously, VPO_UNMANAGED was only set up to the last processed page.

Reviewed by: alc
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

8 years agoRemove Giant around allocation of the swap pager with non-NULL handle.
kib [Tue, 24 May 2016 10:16:03 +0000 (10:16 +0000)]
Remove Giant around allocation of the swap pager with non-NULL handle.
Existing issue of not protecting pager_object_list iteration in
vm_pager_object_lookup() by sw_alloc_mtx is not affected by Giant
removal.

Reviewed by: alc
Sponsored by: The FreeBSD Foundation

8 years agoAdd __iowrite32_copy() to the Linux kernel compatibility layer.
kevlo [Tue, 24 May 2016 09:23:04 +0000 (09:23 +0000)]
Add __iowrite32_copy() to the Linux kernel compatibility layer.

Reviewed by: hselasky

8 years agoRename kern.icl.drivers to kern.icl.offloads, for consistency.
trasz [Tue, 24 May 2016 08:54:41 +0000 (08:54 +0000)]
Rename kern.icl.drivers to kern.icl.offloads, for consistency.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoAdd mechanism for choosing iSER-capable ICL modules.
trasz [Tue, 24 May 2016 08:44:45 +0000 (08:44 +0000)]
Add mechanism for choosing iSER-capable ICL modules.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoUse the DROP_GIANT() and PICKUP_GIANT() macros instead of making
hselasky [Tue, 24 May 2016 07:52:53 +0000 (07:52 +0000)]
Use the DROP_GIANT() and PICKUP_GIANT() macros instead of making
assumptions about how the Giant mutex is locked.

MFC after: 1 week
Sponsored by: Mellanox Technologies

8 years agoSet "current" for all PCI enumeration callbacks.
hselasky [Tue, 24 May 2016 07:46:20 +0000 (07:46 +0000)]
Set "current" for all PCI enumeration callbacks.

Obtained from: kmacy @
MFC after: 1 week
Sponsored by: Mellanox Technologies

8 years agohyperv/vmbus: Free message taskqueue during interrupt teardown
sephe [Tue, 24 May 2016 07:07:11 +0000 (07:07 +0000)]
hyperv/vmbus: Free message taskqueue during interrupt teardown

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6506

8 years agoUse make_dev_s() instead of make_dev() to avoid race setting
hselasky [Tue, 24 May 2016 07:06:04 +0000 (07:06 +0000)]
Use make_dev_s() instead of make_dev() to avoid race setting
"si_drv1". Convert panic() into regular error while at it.

Suggested by: jhb @
MFC after: 1 week
Sponsored by: Mellanox Technologies

8 years agohyperv/vmbus: Factor out functions for vmbus interrupt set/teardown
sephe [Tue, 24 May 2016 06:42:14 +0000 (06:42 +0000)]
hyperv/vmbus: Factor out functions for vmbus interrupt set/teardown

This paves way for further cleanup and fix.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6505

8 years agohyperv/vmbus: Git rid of sc version of pcpu data extraction macro
sephe [Tue, 24 May 2016 06:10:21 +0000 (06:10 +0000)]
hyperv/vmbus: Git rid of sc version of pcpu data extraction macro

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6503

8 years agohyperv/vmbus: Use busdma(9) for messages and event flags
sephe [Tue, 24 May 2016 06:01:39 +0000 (06:01 +0000)]
hyperv/vmbus: Use busdma(9) for messages and event flags

And
- Move message and event flags to vmbus_softc per-cpu data.
- Get rid of hv_setup_arg, which serves no purpose now.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6502

8 years agohyperv/vmbus: Move SynIC setup/teardown from hyperv file to vmbus file
sephe [Tue, 24 May 2016 05:51:51 +0000 (05:51 +0000)]
hyperv/vmbus: Move SynIC setup/teardown from hyperv file to vmbus file

Avoid unnecessary exposure.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6501

8 years agohyperv/vmbus: Rename local variable and break long lines
sephe [Tue, 24 May 2016 05:43:55 +0000 (05:43 +0000)]
hyperv/vmbus: Rename local variable and break long lines

No functional changes.

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6500

8 years agoDon't leak fp in case where fo_ioctl() returns an error.
dchagin [Tue, 24 May 2016 05:29:41 +0000 (05:29 +0000)]
Don't leak fp in case where fo_ioctl() returns an error.

Reported by: C Turt <ecturt@gmail.com>
MFC after: 1 week

8 years agohyperv/busdma: Take BUS_DMA_ZERO into account
sephe [Tue, 24 May 2016 05:26:52 +0000 (05:26 +0000)]
hyperv/busdma: Take BUS_DMA_ZERO into account

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6499

8 years agohyperv/vmbus: Pass vmbus_softc and curcpu to hv_vmbus_isr()
sephe [Tue, 24 May 2016 05:18:26 +0000 (05:18 +0000)]
hyperv/vmbus: Pass vmbus_softc and curcpu to hv_vmbus_isr()

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6498

8 years agohyperv/vmbus: Move vmbus interrupt counter into vmbus softc
sephe [Tue, 24 May 2016 05:06:01 +0000 (05:06 +0000)]
hyperv/vmbus: Move vmbus interrupt counter into vmbus softc

MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6497

8 years agoFix CID 1006692 in /usr/sbin/pw pw_log() function and other fixes
truckman [Tue, 24 May 2016 05:02:24 +0000 (05:02 +0000)]
Fix CID 1006692 in /usr/sbin/pw pw_log() function and other fixes

The length of the name returned from the $LOGNAME and $USER can be
very long and it was being concatenated to a fixed length buffer
with no bounds checking.  Fix this problem by limiting the length
of the name copied.

Additionally, this name is actually used to create a format string
to be used in adding log file entries so embedded % characters in
the name could confuse *printf(), and embedded whitespace could
confuse a log file parser.  Handle the former by escaping each %
with an additional %, and handle the latter by simply stripping it
out.

Clean up the code by moving the variable declarations to the top
of the function, formatting them to conform with style, and moving
intialization elsewhere.

Reduce code indentation by returning early in a couple of places.

Reported by: Coverity
CID: 1006692
Reviewed by: markj (previous version)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D6490

8 years ago[bwn] begin separating out the attach path from the SIBA specific bits.
adrian [Tue, 24 May 2016 04:58:58 +0000 (04:58 +0000)]
[bwn] begin separating out the attach path from the SIBA specific bits.

* convert phy_getinfo() to take a "gmode" flag, rather than the siba
  TGSHIGH flags and then check for 2GHz.  This should ensure that
  gmode is set correctly even on DUALPHY NICs.
* move the siba_powerup() call and the TGSHIGH decoding into a
  call to bwn_is_bus_siba(), and return an error if it's called
  on anything else.  We don't yet do anything else, but when we do..

Tested:

* BCM4322, 11a STA

8 years ago[bwn] add BCM43225 to the BHND device list.
adrian [Tue, 24 May 2016 04:55:00 +0000 (04:55 +0000)]
[bwn] add BCM43225 to the BHND device list.

This is all for the bhnd(4) work in progress.  It's enough to probe/attach
all the bhnd internals, but we're missing OTP support and some cleanup
code.  And, well, all the rest of the bhnd(4) migration.

So no, this won't give you BCM43225 support.  Sorry!

8 years agoIt seems <sys/types.h> is a new prerequisite for <bitstring.h> after
peter [Tue, 24 May 2016 03:15:46 +0000 (03:15 +0000)]
It seems <sys/types.h> is a new prerequisite for <bitstring.h> after
r300539. Attempt to fix the build for i386.

8 years agoDon't prematurely return short completions on blocking sockets.
jhb [Tue, 24 May 2016 03:13:27 +0000 (03:13 +0000)]
Don't prematurely return short completions on blocking sockets.

Always requeue an AIO job at the head of the socket buffer's queue if
sosend() or soreceive() returns EWOULDBLOCK on a blocking socket.
Previously, requests were only requeued if they returned EWOULDBLOCK
and completed no data.  Now after a partial completion on a blocking
socket the request is queued and the remaining request is retried when
the socket is ready.  This allows writes larger than the currently
available space on a blocking socket to fully complete.  Reads on a
blocking socket that satifsy the low watermark can still return a short
read (same as read()).

In order to track previously completed data, the internal 'status'
field of the AIO job is used to store the amount of previously
computed data.

Non-blocking sockets continue to return short completions for both
reads and writes.

Add a test for a "large" AIO write on a blocking socket that writes
twice the socket buffer size to a UNIX domain socket.

Sponsored by: Chelsio Communications

8 years agoUpdate some of the TBD entries in ciss(4) to match what's in the pci
sbruno [Tue, 24 May 2016 01:42:21 +0000 (01:42 +0000)]
Update some of the TBD entries in ciss(4) to match what's in the pci
IDS data.

Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>
MFC after: 2 weeks

8 years agoMove the OFW iicbus code to dev/iicbus to stop polluting dev/ofw with
loos [Tue, 24 May 2016 01:33:49 +0000 (01:33 +0000)]
Move the OFW iicbus code to dev/iicbus to stop polluting dev/ofw with
unrelated code.

Discussed with: nwhitehorn (a long time ago)

8 years ago[bwn] add extra debugging for non-SIBA devices.
adrian [Tue, 24 May 2016 01:20:30 +0000 (01:20 +0000)]
[bwn] add extra debugging for non-SIBA devices.

This is a no-op at the present moment, but will eventually remind me
where the SIBA specific demons lie.

Tested:

* BCM4322, STA mode

8 years ago[bhnd] Implement pass-through resource management for ChipCommon.
adrian [Tue, 24 May 2016 01:12:19 +0000 (01:12 +0000)]
[bhnd] Implement pass-through resource management for ChipCommon.

This patchset adds support to bhnd_chipc for sharing SYS_RES_MEMORY
resources with its children, allowing us to hang devices off of
bhnd_chipc that rely on access to a subset of the device register space
that bhnd_chipc itself must also allocate.

We could avoid most of this heavy lifting if RF_SHAREABLE+SYS_RES_MEMORY
wasn't limited to use with allocations at the same size/offset.

As a work-around, I implemented something similar to vga_pci.c, which
implements similar reference counting of of PCI BAR resources for its
children.

With these changes, chipc will use reference counting of SYS_RES_MEMORY
allocation/activation requests, to decide when to allocate/activate/
deactivate/release resources from the parent bhnd(4) bus.

The requesting child device is allocated a new resource from chipc's
rman, pointing to (possibly a subregion of) the refcounted bhnd resources
allocated by chipc.

Other resource types are just passed directly to the parent bhnd bus;
RF_SHAREABLE works just fine with IRQs.

I also lifted the SPROM device code out into a common driver, since this
now allows me to hang simple subclasses off of a common driver off of both
bhndb_pci and bhnd_chipc.

Tested:

* (landonf) Tested against BCM4331 and BCM4312, confirmed that SPROM still
  attaches and can be queried.

Submitted by: Landon Fuller <landonf@landonf.org>
Reviewed by: mizkha@gmail.com
Differential Revision: https://reviews.freebsd.org/D6471

8 years agoFix multiple Coverity Out-of-bounds access false postive issues in CAM
truckman [Tue, 24 May 2016 00:57:11 +0000 (00:57 +0000)]
Fix multiple Coverity Out-of-bounds access false postive issues in CAM

The currently used idiom for clearing the part of a ccb after its
header generates one or two Coverity errors for each time it is
used.  All instances generate an Out-of-bounds access (ARRAY_VS_SINGLETON)
error because of the treatment of the header as a two element array,
with a pointer to the non-existent second element being passed as
the starting address to bzero().  Some instances also alsp generate
Out-of-bounds access (OVERRUN) errors, probably because the space
being cleared is larger than the sizeofstruct ccb_hdr).

In addition, this idiom is difficult for humans to understand and
it is error prone.  The user has to chose the proper struct ccb_*
type (which does not appear in the surrounding code) for the sizeof()
in the length calculation.  I found several instances where the
length was incorrect, which could cause either an actual out of
bounds write, or incompletely clear the ccb.

A better way is to write the code to clear the ccb itself starting
at sizeof(ccb_hdr) bytes from the start of the ccb, and calculate
the length based on the specific type of struct ccb_* being cleared
as specified by the union ccb member being used.  The latter can
normally be seen in the nearby code.  This is friendlier for Coverity
and other static analysis tools because they will see that the
intent is to clear the trailing part of the ccb.

Wrap all of the boilerplate code in a convenient macro that only
requires a pointer to the desired union ccb member (or a pointer
to the union ccb itself) as an argument.

Reported by: Coverity
CID: 100757810086841009724100977310113041011306
CID: 101130710113081011309101131010113111011312
CID: 101131310113141011315101131610113171011318
CID: 101131910113201011321101132210113241011325
CID: 101132610113271011328101132910113301011374
CID: 101139010113911011392101139310113941011395
CID: 101139610113971011398101139910114001011401
CID: 101140210114031011404101140510114061011408
CID: 101140910114101011411101141210114131011414
CID: 101746110183871086860108687411942571229897
CID: 122996813062291306234133128213312831331294
CID: 133129513315351331536133153913315401341623
CID: 13416241341637134163813552641355324
Reviewed by: scottl, ken, delphij, imp
MFH: 1 month
Differential Revision: https://reviews.freebsd.org/D6496

8 years agoOnly set kern.geom.part.mbr.enforce_chs=0 once, instead of once per disk
allanjude [Tue, 24 May 2016 00:23:39 +0000 (00:23 +0000)]
Only set kern.geom.part.mbr.enforce_chs=0 once, instead of once per disk

Sponsored by: ScaleEngine Inc.

8 years agoAdd support for RAID 1+0 (striped mirrors) to bsdinstall/zfsboot
allanjude [Tue, 24 May 2016 00:22:29 +0000 (00:22 +0000)]
Add support for RAID 1+0 (striped mirrors) to bsdinstall/zfsboot

Sponsored by: ScaleEngine Inc.

8 years agoFix build of kern/subr_unit.c, broken by r300539
asomers [Tue, 24 May 2016 00:14:58 +0000 (00:14 +0000)]
Fix build of kern/subr_unit.c, broken by r300539

Reported by: peter
Pointyhat to: asomers
Sponsored by: Spectra Logic Corp

8 years agoDocument POPCNT erratum for 6th Generation Intel Core processors.
jkim [Mon, 23 May 2016 23:00:47 +0000 (23:00 +0000)]
Document POPCNT erratum for 6th Generation Intel Core processors.

8 years agoUpdate pci_vendors to 2016.05.23
bapt [Mon, 23 May 2016 22:01:06 +0000 (22:01 +0000)]
Update pci_vendors to 2016.05.23

8 years agoBe more clear about LOCKLEAF being exclusive and add LOCKSHARED.
bdrewery [Mon, 23 May 2016 21:29:57 +0000 (21:29 +0000)]
Be more clear about LOCKLEAF being exclusive and add LOCKSHARED.

8 years agoAdd bit_count to the bitstring(3) api
asomers [Mon, 23 May 2016 20:29:18 +0000 (20:29 +0000)]
Add bit_count to the bitstring(3) api

Add a bit_count function, which efficiently counts the number of bits set in
a bitstring.

sys/sys/bitstring.h
tests/sys/sys/bitstring_test.c
share/man/man3/bitstring.3
Add bit_alloc

sys/kern/subr_unit.c
Use bit_count instead of a naive counting loop in check_unrhdr, used
when INVARIANTS are enabled. The userland test runs about 6x faster
in a generic build, or 8.5x faster when built for Nehalem, which has
the POPCNT instruction.

sys/sys/param.h
Bump __FreeBSD_version due to the addition of bit_alloc

UPDATING
Add a note about the ABI incompatibility of the bitstring(3)
changes, as suggested by lidl.

Suggested by: gibbs
Reviewed by: gibbs, ngie
MFC after: 9 days
X-MFC-With: 299090, 300538
Relnotes: yes
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D6255

8 years agoCommit a missing change from 299090
asomers [Mon, 23 May 2016 20:19:07 +0000 (20:19 +0000)]
Commit a missing change from 299090

tests/sys/kern/Makefile
Reenable a disabled compiler warning, the need for which was
eliminated by r299090.

Reviewed by: ngie
MFC after: 4 weeks
X-MFC-With: 299090
Sponsored by: Spectra Logic Corp

8 years agoMark the prefix and default router list sysctl handlers MPSAFE.
markj [Mon, 23 May 2016 20:18:11 +0000 (20:18 +0000)]
Mark the prefix and default router list sysctl handlers MPSAFE.

MFC after: 2 weeks

8 years agoAcquire the nd6 lock in the prefix list sysctl handler.
markj [Mon, 23 May 2016 20:15:08 +0000 (20:15 +0000)]
Acquire the nd6 lock in the prefix list sysctl handler.

The nd6 lock will be used to synchronize access to the NDP prefix list.

MFC after: 2 weeks
Tested by: Jason Wolfe (as part of a larger change)

8 years agoSpaces->tab in comment.
ian [Mon, 23 May 2016 20:13:17 +0000 (20:13 +0000)]
Spaces->tab in comment.

8 years agoOops, fix a paste-o commited in r300533.
ian [Mon, 23 May 2016 20:12:38 +0000 (20:12 +0000)]
Oops, fix a paste-o commited in r300533.

8 years agoUse the new(-ish) CP15_SCTLR macro to generate system control reg accesses
ian [Mon, 23 May 2016 20:07:17 +0000 (20:07 +0000)]
Use the new(-ish) CP15_SCTLR macro to generate system control reg accesses
where possible.  In the places that doesn't work (multi-line inline asm,
and places where the old armv4 cpufuncs mechanism is used), annotate the
accesses with a comment that includes SCTLR.  Now a grep -i sctlr can find
all the system control register manipulations.

No functional changes.

8 years agoFix ada(4) trim support quirk setting.
ken [Mon, 23 May 2016 19:52:08 +0000 (19:52 +0000)]
Fix ada(4) trim support quirk setting.

I broke broke the quirk in the ada(4) driver disabling NCQ trim support
in revision 300207.  The support flags were set before the quirks were
loaded.

sys/cam/ata/ata_da.c:
Call adasetflags() after loading quirks, so that we'll set the
flags accurately.

Sponsored by: Spectra Logic

8 years agontb_hw(4): Only record the first three MSIX vectors
cem [Mon, 23 May 2016 19:46:58 +0000 (19:46 +0000)]
ntb_hw(4): Only record the first three MSIX vectors

Don't overrun the msix_data array by reading the (unused) link state
interrupt information.

Reported by: mav (earlier version)
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D6489

8 years agoINTRNG - support new interrupt mapping type INTR_MAP_DATA_GPIO
skra [Mon, 23 May 2016 18:16:21 +0000 (18:16 +0000)]
INTRNG - support new interrupt mapping type INTR_MAP_DATA_GPIO
introduced in r298738.

Reviewed by: ian

8 years agoINTRNG - use gpio generic interrupt modes definitions added in r298738.
skra [Mon, 23 May 2016 18:12:52 +0000 (18:12 +0000)]
INTRNG - use gpio generic interrupt modes definitions added in r298738.

Reviewed by: ian

8 years agoProperly allow META_MODE to be set from environment.
bdrewery [Mon, 23 May 2016 17:27:42 +0000 (17:27 +0000)]
Properly allow META_MODE to be set from environment.

Sponsored by: EMC / Isilon Storage Division

8 years agoUse sed(1) to determine cc version rather than tail(1) since it is already in ITOOLS.
bdrewery [Mon, 23 May 2016 17:11:32 +0000 (17:11 +0000)]
Use sed(1) to determine cc version rather than tail(1) since it is already in ITOOLS.

This fixes 'tail: not found' warnings in installworld after r300351.

Sponsored by: EMC / Isilon Storage Division

8 years agoDocument r298998, OpenSSL updated to 1.0.2h.
skreuzer [Mon, 23 May 2016 17:06:46 +0000 (17:06 +0000)]
Document r298998, OpenSSL updated to  1.0.2h.

Approved by: gjb@ (implicit with re@ hat on)

8 years agoOnly export and re-import the root pool if installing on MBR
allanjude [Mon, 23 May 2016 17:04:13 +0000 (17:04 +0000)]
Only export and re-import the root pool if installing on MBR

This step is required in order to dd the boot2 bits into the ZFS partition

Sponsored by: ScaleEngine Inc.

8 years agoCorrect an error in a comment: One of the conditions for page allocation
alc [Mon, 23 May 2016 16:59:05 +0000 (16:59 +0000)]
Correct an error in a comment: One of the conditions for page allocation
is actually the opposite of that stated in the comment.

Remove an unnecessary assignment.  Use an assertion to document the fact
that no assignment is needed.

Rewrite another comment to clarify that the page is not completely valid.

Reviewed by: kib

8 years agoFix missing pool name in zfs set command
allanjude [Mon, 23 May 2016 16:49:26 +0000 (16:49 +0000)]
Fix missing pool name in zfs set command

8 years agoMove binutils handling after src.opts.mk.
bdrewery [Mon, 23 May 2016 16:24:34 +0000 (16:24 +0000)]
Move binutils handling after src.opts.mk.

This fixes the arm64 build after r300348.

Sponsored by: EMC / Isilon Storage Division

8 years agoImplement "atomic_long_add_unless()" in the LinuxKPI and fix the
hselasky [Mon, 23 May 2016 16:19:51 +0000 (16:19 +0000)]
Implement "atomic_long_add_unless()" in the LinuxKPI and fix the
implementation of "atomic_long_inc_not_zero()".

Found by: ngie @
MFC after: 1 week
Sponsored by: Mellanox Technologies

8 years agoDocument r296190, openresolv updated to 3.7.3.
skreuzer [Mon, 23 May 2016 15:44:39 +0000 (15:44 +0000)]
Document r296190, openresolv updated to 3.7.3.

Approved by: gjb@ (implicit with re@ hat on)

8 years agoDocument r298161, sqlite3 updated to 3.12.1.
skreuzer [Mon, 23 May 2016 15:37:12 +0000 (15:37 +0000)]
Document r298161, sqlite3 updated to 3.12.1.

Approved by: gjb@ (implicit with re@ hat on)

8 years agoDocument r298192, file(1) updated to 5.26.
skreuzer [Mon, 23 May 2016 15:33:56 +0000 (15:33 +0000)]
Document r298192, file(1) updated to 5.26.

Approved by: gjb@ (implicit with re@ hat on)

8 years agoAdd the needed hwpmc hooks to subr_intr.c. This is needed for the correct
andrew [Mon, 23 May 2016 15:26:35 +0000 (15:26 +0000)]
Add the needed hwpmc hooks to subr_intr.c. This is needed for the correct
operation of hwpmc on, for example, arm64 with intrng.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

8 years agoFix error in bsdinstall where additional filesystems cannot be mounted
allanjude [Mon, 23 May 2016 15:11:01 +0000 (15:11 +0000)]
Fix error in bsdinstall where additional filesystems cannot be mounted

Do not set canmount=noauto on the boot environment at create time, because
this causes / to not be mounted, and since the chroot is read only, new
mountpoints cannot be created.

The property is set later, when other properties are adjusted

Reported by: HardenedBSD
Sponsored by: ScaleEngine Inc.

8 years agopf: Fix more ICMP mistranslation
kp [Mon, 23 May 2016 13:59:48 +0000 (13:59 +0000)]
pf: Fix more ICMP mistranslation

In the default case fix the substitution of the destination address.

PR: 201519
Submitted by: Max <maximos@als.nnov.ru>
MFC after: 1 week

8 years agoA missing definition needed by ktime_to_ms().
hselasky [Mon, 23 May 2016 13:19:20 +0000 (13:19 +0000)]
A missing definition needed by ktime_to_ms().

Obtained from: kmacy @
MFC after: 1 week
Sponsored by: Mellanox Technologies

8 years agoFix some data types and add "inline" keyword for __reg_op() function.
hselasky [Mon, 23 May 2016 13:18:15 +0000 (13:18 +0000)]
Fix some data types and add "inline" keyword for __reg_op() function.

Obtained from: kmacy @
MFC after: 1 week
Sponsored by: Mellanox Technologies

8 years agosfxge(4): cleanup: remove unused EFX preempt macros
arybchik [Mon, 23 May 2016 13:17:37 +0000 (13:17 +0000)]
sfxge(4): cleanup: remove unused EFX preempt macros

The EFSYS_PREEMPT_DISABLE() and EFSYS_PREEMPT_ENABLE() macros
were used to ensure correct timing of I2C operations. The APIs
for I2C operations have been removed, so these macros have no
callers.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week

8 years agoBuild iscsid(8) with ICL_KERNEL_PROXY defined by default, as required
trasz [Mon, 23 May 2016 12:58:24 +0000 (12:58 +0000)]
Build iscsid(8) with ICL_KERNEL_PROXY defined by default, as required
for iSER.

Obtained from: Mellanox Technologies
MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoImplement ror32() in the LinuxKPI.
hselasky [Mon, 23 May 2016 12:53:17 +0000 (12:53 +0000)]
Implement ror32() in the LinuxKPI.

Obtained from: kmacy @
MFC after: 1 week
Sponsored by: Mellanox Technologies

8 years agoDefine more copy to/from userspace functions in the LinuxKPI.
hselasky [Mon, 23 May 2016 12:52:22 +0000 (12:52 +0000)]
Define more copy to/from userspace functions in the LinuxKPI.

Obtained from: kmacy @
MFC after: 1 week
Sponsored by: Mellanox Technologies