freebsd.git
7 years agoAdd a driver to create VF devices on Chelsio T4/T5 NICs.
jhb [Fri, 22 Jul 2016 22:46:41 +0000 (22:46 +0000)]
Add a driver to create VF devices on Chelsio T4/T5 NICs.

Chelsio NICs are a bit unique compared to some other NICs in that they
expose different functionality on different physical functions.  In
particular, PF4 is used to manage the NIC interfaces ('t4nex' and 't5nex').
However, PF4 is not able to create VF devices.  Instead, VFs are only
supported by physical functions 0 through 3.  This commit adds 't4iov'
and 't5iov' drivers that attach to PF0-3.

One extra wrinkle is that the iov devices cannot enable SR-IOV until the
firwmare has been initialized by the main PF4 driver.  To handle this
case, a new t4_if kobj interface has been added to permit cross-calls
between the PF drivers.  The PF4 driver notifies sibling drivers when it
is fully attached.  It also requests sibling drivers to detach before it
detaches.  Sibling drivers query the PF4 driver during their attach
routine to see if it is attached.  If not, the sibling drivers defer
their attach actions until the PF4 driver informs them it is attached.

VF devices are associated with a single port on the NIC.  VF devices
created from PF0 are associated with the first port on the NIC, VFs
from PF1 are associated with the second port, etc.  VF devices can
only be created from a PF device that has an associated port.  Thus,
on a 2-port card, VFs are only supported on PF0 and PF1.

Reviewed by: np (earlier versions)
MFC after: 1 month
Sponsored by: Chelsio Communications

7 years agoInstall a handler for firmware work request error messages.
jhb [Fri, 22 Jul 2016 21:52:07 +0000 (21:52 +0000)]
Install a handler for firmware work request error messages.

If a driver sends an malformed or disallowed work request, the firmware
responds with a work request error.  Previously the driver treated this is
as an unexpected message and panicked.  Now it decodes the error message
to aid in debugging.

Reviewed by: np (older version)
MFC after: 1 month
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D6950

7 years ago[new-committer:mizhka] add committer into graph
mizhka [Fri, 22 Jul 2016 21:49:41 +0000 (21:49 +0000)]
[new-committer:mizhka] add committer into graph

Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D7288

7 years agoUpdate after r303154 to note that operations on local files are safe.
jhb [Fri, 22 Jul 2016 20:52:40 +0000 (20:52 +0000)]
Update after r303154 to note that operations on local files are safe.

7 years agoctld(8): Fix MaxBurstLength negotiation.
np [Fri, 22 Jul 2016 19:28:23 +0000 (19:28 +0000)]
ctld(8): Fix MaxBurstLength negotiation.

The target must reply with the selected value of MaxBurstSize instead of
just echoing back the initiator's offered value.

Reviewed by: mav@
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D7278

7 years agoDon't run find(1) for __MPATH with NO_MODULES set.
bdrewery [Fri, 22 Jul 2016 17:31:14 +0000 (17:31 +0000)]
Don't run find(1) for __MPATH with NO_MODULES set.

It's a waste of time when it won't be used.

Submitted by: bde
MFC after: 3 days

7 years agoAdd GCC 6.1 warn flags for kernel as well.
br [Fri, 22 Jul 2016 16:15:35 +0000 (16:15 +0000)]
Add GCC 6.1 warn flags for kernel as well.

Sponsored by: DARPA, AFRL

7 years agoSet the soft-float flag for assembly code as well.
br [Fri, 22 Jul 2016 15:22:49 +0000 (15:22 +0000)]
Set the soft-float flag for assembly code as well.
This fixes compilation with GCC 6.1.

Sponsored by: DARPA, AFRL

7 years agoAdd warn flags for GCC 6.1 compiler.
br [Fri, 22 Jul 2016 15:00:38 +0000 (15:00 +0000)]
Add warn flags for GCC 6.1 compiler.

Sponsored by: DARPA, AFRL

7 years agoSet real values for context/cursor sizes for RISC-V to prevent static
br [Fri, 22 Jul 2016 14:57:26 +0000 (14:57 +0000)]
Set real values for context/cursor sizes for RISC-V to prevent static
assertions.

Reviewed by: emaste
Sponsored by: DARPA, AFRL

7 years agoPC5 doesn't have mmc2 function.
manu [Fri, 22 Jul 2016 14:39:55 +0000 (14:39 +0000)]
PC5 doesn't have mmc2 function.

7 years agoMake cam.ko loadable.
kib [Fri, 22 Jul 2016 06:21:03 +0000 (06:21 +0000)]
Make cam.ko loadable.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agohyperv/vmbus: Move vmbus bufring definition to vmbus_reg.h
sephe [Fri, 22 Jul 2016 05:09:08 +0000 (05:09 +0000)]
hyperv/vmbus: Move vmbus bufring definition to vmbus_reg.h

And add more comment about its fields.

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

7 years agohyperv/vmbus: Cleanup and augment bufring sysctl tree creation
sephe [Fri, 22 Jul 2016 03:42:32 +0000 (03:42 +0000)]
hyperv/vmbus: Cleanup and augment bufring sysctl tree creation

Binary state node is added, so that userland programs do not have
to parse human readable state string.

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

7 years agohyperv/vmbus: Cosmetic bufring cleanup.
sephe [Fri, 22 Jul 2016 03:30:00 +0000 (03:30 +0000)]
hyperv/vmbus: Cosmetic bufring cleanup.

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

7 years agoFix per-connection L2 caching in fast path
karels [Fri, 22 Jul 2016 02:11:49 +0000 (02:11 +0000)]
Fix per-connection L2 caching in fast path

r301217 re-added per-connection L2 caching from a previous change,
but it omitted caching in the fast path.  Add it.

Reviewed By: gallatin
Approved by: gnn (mentor)
Differential Revision: https://reviews.freebsd.org/D7239

7 years agoAdd opt_ddb.h.
imp [Thu, 21 Jul 2016 23:29:16 +0000 (23:29 +0000)]
Add opt_ddb.h.

MFC after: 1 week

7 years agoFix cam builds w/o nvme. This is a stop-gap fix until the real fix of
imp [Thu, 21 Jul 2016 23:29:13 +0000 (23:29 +0000)]
Fix cam builds w/o nvme. This is a stop-gap fix until the real fix of
dynamically loading XPTs is done and tested.

MFC After: 1 week

7 years agoAdd more documentation regarding unsafe AIO requests.
jhb [Thu, 21 Jul 2016 22:49:47 +0000 (22:49 +0000)]
Add more documentation regarding unsafe AIO requests.

The asynchronous I/O changes made previously result in different
behavior out of the box. Previously all AIO requests failed with
ENOSYS / SIGSYS unless aio.ko was explicitly loaded. Now, some AIO
requests complete and others ("unsafe" requests) fail with EOPNOTSUPP.

Reword the introductory paragraph in aio(4) to add a general
description of AIO before describing the vfs.aio.enable_unsafe sysctl.

Remove the ENOSYS error description from aio_fsync(2), aio_read(2),
and aio_write(2) and replace it with a description of EOPNOTSUPP.

Remove the ENOSYS error description from aio_mlock(2).

Log a message to the system log the first time a process requests an
"unsafe" AIO request that fails with EOPNOTSUPP. This is modeled on
the log message used for processes using the legacy pty devices.

Reviewed by: kib (earlier version)
MFC after: 1 week
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D7151

7 years agoUpdate leap-seconds to leap-seconds.3676752000.
cy [Thu, 21 Jul 2016 19:27:04 +0000 (19:27 +0000)]
Update leap-seconds to leap-seconds.3676752000.

As per https://datacenter.iers.org/web/guest/eop/-/somos/5Rgv/latest/16:

                                  UTC TIME STEP
                            on the 1st of January 2017

 A positive leap second will be introduced at the end of December 2016.
 The sequence of dates of the UTC second markers will be:

                          2016 December 31, 23h 59m 59s
                          2016 December 31, 23h 59m 60s
                          2017 January   1,  0h  0m  0s

 The difference between UTC and the International Atomic Time TAI is:

  from 2015 July 1, 0h UTC, to 2017 January 1 0h UTC   : UTC-TAI = - 36s
  from 2017 January 1, 0h UTC, until further notice    : UTC-TAI = - 37s

Obtained from: ftp://tycho.usno.navy.mil/pub/ntp/leap-seconds.3676752000
See also: https://www.iers.org/SharedDocs/News/EN/BulletinC.html
https://datacenter.iers.org/web/guest/eop/-/somos/5Rgv/latest/16
MFC after: 1 week
Relnotes: yes

7 years agolibmd: strip local absolute symbols (to link with lld)
emaste [Thu, 21 Jul 2016 18:47:51 +0000 (18:47 +0000)]
libmd: strip local absolute symbols (to link with lld)

Old versions of gas produce an invalid section index. That is ignored by
old versions of ld, but prevents a link with lld.

Submitted by: Rafael Ávila de Espíndola (earlier version)
Reviewed by: allanjude
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D6789

7 years agolibcxxrt: add padding in __cxa_allocate_* to fix alignment
emaste [Thu, 21 Jul 2016 18:20:35 +0000 (18:20 +0000)]
libcxxrt: add padding in __cxa_allocate_* to fix alignment

The addition of the referenceCount to __cxa_allocate_exception put the
unwindHeader at offset 0x58 in __cxa_exception, but it requires 16-byte
alignment. In order to avoid changing the current __cxa_exception ABI
(and thus breaking its consumers), add explicit padding in the
allocation routines (and account for it when freeing).

This is intended as a lower-risk change for FreeBSD 11. A "more correct"
fix should be prepared for upstream and -CURRENT.

Reviewed by: dim
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D7271

7 years agoRemove duplicate symbols from libroken version-script.map
emaste [Thu, 21 Jul 2016 18:12:39 +0000 (18:12 +0000)]
Remove duplicate symbols from libroken version-script.map

Upstream commit r24759 (efed563) prefixed some symbols with rk_, but
introduced 6 duplicate symbols in the version script (because the
rk_-prefixed versions of the symbols were already present).

7 years agoHide counted_warning(9) under #ifdef _KERNEL braces, to allow building
kib [Thu, 21 Jul 2016 17:59:30 +0000 (17:59 +0000)]
Hide counted_warning(9) under #ifdef _KERNEL braces, to allow building
subr_prf.c in userspace for libsbuf.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoDeclare aio requests on files from local filesystems safe.
kib [Thu, 21 Jul 2016 17:07:06 +0000 (17:07 +0000)]
Declare aio requests on files from local filesystems safe.
Two notes:
- I allow AIO on reclaimed vnodes, since it is deterministically terminated
  fast.
- devfs mounts are marked as MNT_LOCAL, but device vnodes have type
  VCHR, so the slow device io is not allowed.

Reviewed by: jhb
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D7273

7 years agoRemove spurious but harmless double-quote.
kib [Thu, 21 Jul 2016 16:58:53 +0000 (16:58 +0000)]
Remove spurious but harmless double-quote.

Noted by: jhb

7 years agoProvide counter_warning(9) KPI which allows to issue limited number of
kib [Thu, 21 Jul 2016 16:34:56 +0000 (16:34 +0000)]
Provide counter_warning(9) KPI which allows to issue limited number of
warnings for some kernel events, mostly intended for the use of
obsoleted or otherwise undersired interfaces.

This is an abstracted and race-expelled code from compat pty driver.

Requested and reviewed by: jhb
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D7270

7 years ago[mx25l] add new device id.
adrian [Thu, 21 Jul 2016 15:48:41 +0000 (15:48 +0000)]
[mx25l] add new device id.

Tested:

* (submitter) TP-Link TL-WR1043nd v3

Submitted by: tj@enoti.me

7 years agobinutils: fix "Bad value" error in bfd for MIPS when using -Bsymbolic.
pfg [Thu, 21 Jul 2016 15:26:21 +0000 (15:26 +0000)]
binutils: fix "Bad value" error in bfd for MIPS when using -Bsymbolic.

From OpenBSD's log:

Inspired by https://sourceware.org/ml/binutils/2010-08/msg00333.html,
but expressed differently so there are no GPLv3 issues.

Obtained from: OpenBSD (CVS rev. 1.7)
MFC after: 1 month

7 years agosed(1): Appease older GCC.
pfg [Thu, 21 Jul 2016 14:17:36 +0000 (14:17 +0000)]
sed(1): Appease older GCC.

7 years agoaxp209 needs aw_nmi so attach a bit earlier
manu [Thu, 21 Jul 2016 13:28:07 +0000 (13:28 +0000)]
axp209 needs aw_nmi so attach a bit earlier

Reviewed by: andrew
Differential Revision: https://reviews.freebsd.org/D7081

7 years agoWe need the GIC to be attached so attach later at BUS_PASS_INTERRUPT + BUS_PASS_ORDER...
manu [Thu, 21 Jul 2016 13:26:39 +0000 (13:26 +0000)]
We need the GIC to be attached so attach later at BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LATE

Reviewed by: andrew
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D7080

7 years agoFix the build:
andrew [Thu, 21 Jul 2016 13:01:35 +0000 (13:01 +0000)]
Fix the build:
 * Add acpi_if.h to the SRC list in the uart module
 * Only include new acpi headers when they are needed

Obtained from: ABT Systems Ltd
MFC after: 1 month
Sponsored by: The FreeBSD Foundation

7 years ago1) GLOB_BRACE was somewhat broken. First it repeatedly calls glob0() in
ache [Thu, 21 Jul 2016 12:53:36 +0000 (12:53 +0000)]
1) GLOB_BRACE was somewhat broken. First it repeatedly calls glob0() in
globexp1() recursive calls, but glob0() was not supposed to be called
repeatedly in the original code. It finalize results by possible adding
original pattern for no match case, may return GLOB_NOMATCH error and
by sorting all things. Original pattern adding or GLOB_NOMATCH error
can happens each time glob0() called repeatedly, and sorting happens
for one item only, all things are never sorted. Second, f.e. "a{a"
pattern does not match "a{a" file but match "a" file instead
(just one example, there are many). Third, some errors (f.e. for limits
or overflow) can be ignored by GLOB_BRACE code because it forces return (0).
Add non-finalizing flag to glob0() and make globexp0() wrapper around
recursively called globexp1() to finalize things like glob0() does.
Reorganize braces code to work correctly.

2) Don't allow MB_CUR_MAX * strlen overallocation hits GLOB_LIMIT_STRING
(ARG_MAX) limit, use final string length, not malloced space for it.

3) Revive DEBUG-ifdefed section.

7 years agoImprove typesetting.
kib [Thu, 21 Jul 2016 09:37:17 +0000 (09:37 +0000)]
Improve typesetting.

Reviewed by: bapt
No objections from: emaste
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D7261

7 years agoAdd support for arm64 to uart_dev_acpi by using the _HID property to find
andrew [Thu, 21 Jul 2016 09:32:55 +0000 (09:32 +0000)]
Add support for arm64 to uart_dev_acpi by using the _HID property to find
the uart class to use in a similar way as the fdt driver.

Obtained from: ABT Systems Ltd
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D7248

7 years agoAdd documentation for "ctld -u", the UCL configuration file format.
trasz [Thu, 21 Jul 2016 08:22:25 +0000 (08:22 +0000)]
Add documentation for "ctld -u", the UCL configuration file format.

Submitted by: jceel@
Reviewed by: wblock@
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D7222

7 years agohyperv: hv_vmbus_channel -> vmbus_channel
sephe [Thu, 21 Jul 2016 06:09:47 +0000 (06:09 +0000)]
hyperv: hv_vmbus_channel -> vmbus_channel

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

7 years agoAdd LOCAL_XTOOL_DIRS to add into cross-tools.
bdrewery [Thu, 21 Jul 2016 06:06:11 +0000 (06:06 +0000)]
Add LOCAL_XTOOL_DIRS to add into cross-tools.

Sponsored by: EMC / Isilon Storage Division

7 years agohyperv/vmbus: Shuffle function declaration and macro definition.
sephe [Thu, 21 Jul 2016 05:46:26 +0000 (05:46 +0000)]
hyperv/vmbus: Shuffle function declaration and macro definition.

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

7 years agohyperv/vmbus: Reorder channel fields.
sephe [Thu, 21 Jul 2016 05:38:05 +0000 (05:38 +0000)]
hyperv/vmbus: Reorder channel fields.

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

7 years agohyperv/vmbus: Save event flag location and evet flag mask.
sephe [Thu, 21 Jul 2016 05:30:31 +0000 (05:30 +0000)]
hyperv/vmbus: Save event flag location and evet flag mask.

This avoids unnecessary access to the vmbus_softc struct on sending path.

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

7 years agoActually import nvme_sim so the CAM attachment for NVME (nda) actually
imp [Thu, 21 Jul 2016 03:11:39 +0000 (03:11 +0000)]
Actually import nvme_sim so the CAM attachment for NVME (nda) actually
works.

MFC after: 1 week

7 years agoRemove some bogus comments and printfs. Also, we can't
imp [Thu, 21 Jul 2016 03:11:37 +0000 (03:11 +0000)]
Remove some bogus comments and printfs. Also, we can't
cam_periph_releaes_locked() at the end of nvme_probe_start because we
hit an assertion which may be bogus. Instead, leak a periph until we
sort it out. Since these devices don't arrive and depart often, so
this is the lessor of two evils.

MFC after: 1 week

7 years agoFix mismerge and add NVME xport support to devstat (or rather, exclude
imp [Thu, 21 Jul 2016 03:11:36 +0000 (03:11 +0000)]
Fix mismerge and add NVME xport support to devstat (or rather, exclude
it from SCSI).

MFC after: 1 week

7 years agoFix mismerge and include the nvme support.
imp [Thu, 21 Jul 2016 03:11:35 +0000 (03:11 +0000)]
Fix mismerge and include the nvme support.
Also, print out the name of any CCB's functions that's not supported.

MFC after: 1 week

7 years agoMirror r303120 to gcore
cem [Thu, 21 Jul 2016 00:53:14 +0000 (00:53 +0000)]
Mirror r303120 to gcore

Sponsored by: EMC / Isilon Storage Division

7 years agoimgact_elf: Rename the segment iterator to match reality
cem [Wed, 20 Jul 2016 22:51:33 +0000 (22:51 +0000)]
imgact_elf: Rename the segment iterator to match reality

The each_writable_segment routine evaluates segments on a slightly little more
nuanced metric than simply "writable" or not.  Rename the function to more
closely match its behavior (each_dumpable_segment).

Suggested by: jhb
Sponsored by: EMC / Isilon Storage Division

7 years agoCreate a /usr/home -> /home symlink for the arm images to
gjb [Wed, 20 Jul 2016 22:49:33 +0000 (22:49 +0000)]
Create a /usr/home -> /home symlink for the arm images to
avoid /usr/home confusingly being created as a directory.

Reported by: Russell Haley
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

7 years agoANSI-fy imgact_elf.c
cem [Wed, 20 Jul 2016 22:46:56 +0000 (22:46 +0000)]
ANSI-fy imgact_elf.c

Sponsored by: EMC / Isilon Storage Division

7 years agourtwn: fix A-MSDU tx aggregation when encryption is used.
avos [Wed, 20 Jul 2016 22:05:44 +0000 (22:05 +0000)]
urtwn: fix A-MSDU tx aggregation when encryption is used.

Clear unused (undocumented) CAM bytes while setting a key;
without that, hardware does weird things when A-MSDU bit in QoS header
is set.

Tested with RTL8188CUS (AP) -> RTL8188EU (STA) (A-MSDU transmit).

Reported by: many
Obtained from: https://github.com/s3erios/urtwm
MFC after: 5 days

7 years agoAdd extended segment support to gcore
cem [Wed, 20 Jul 2016 22:03:45 +0000 (22:03 +0000)]
Add extended segment support to gcore

A follow-up to r303099, D7255.  Basically, apply the exact same change, with
the exact same rationale, to gcore.  gcore's elfcore.c is largely a clone of
the kernel imgact_elf coredump facility.

Reviewed by: emaste (earlier version, not substantially different)
Requested by: jhb
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D7265

7 years agoCross-link some SMBus controller drivers man pages.
mav [Wed, 20 Jul 2016 20:18:52 +0000 (20:18 +0000)]
Cross-link some SMBus controller drivers man pages.

Some compatibility cases are not obvious.

7 years agoDocument list of supported chipsets.
mav [Wed, 20 Jul 2016 20:10:37 +0000 (20:10 +0000)]
Document list of supported chipsets.

7 years agoRemove uneeded parens.
sbruno [Wed, 20 Jul 2016 19:21:11 +0000 (19:21 +0000)]
Remove uneeded parens.

MFC after: 1 day

7 years agoUpdate crashinfo to work with newer gdb from ports.
jhb [Wed, 20 Jul 2016 18:41:47 +0000 (18:41 +0000)]
Update crashinfo to work with newer gdb from ports.

If gdb from ports is installed, use it instead of the base system gdb
to extract variables from a kernel.  Note that base gdb and ports gdb
do not support the same options for invoking a single command in batch
mode, so a wrapper shell function is used.  In addition, prefer kgdb
from ports when generating a backtrace if present.

PR: 193335
Reviewed by: emaste
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D7218

7 years agoChange wording to use function rather than system call in the description
zeising [Wed, 20 Jul 2016 18:16:58 +0000 (18:16 +0000)]
Change wording to use function rather than system call in the description
as well.

Reviewed by: brooks
MFC after: 5 days

7 years agoFix DEBUG build on 64-bit arch after r303099
cem [Wed, 20 Jul 2016 18:11:22 +0000 (18:11 +0000)]
Fix DEBUG build on 64-bit arch after r303099

Reported by: Larry Rosenman <ler at lerctr.org>

7 years agoUpdate to reflect the fact that pipe() is a wrapper around the pipe2()
brooks [Wed, 20 Jul 2016 18:02:07 +0000 (18:02 +0000)]
Update to reflect the fact that pipe() is a wrapper around the pipe2()
system call.

Reviewed by: jhb, wblock
MFC after: 5 days
Sponsored by: DAPRA, AFRL
Differential Revision: https://reviews.freebsd.org/D6948

7 years agoMinor wording improvements to the note about pipe(2) removal.
brooks [Wed, 20 Jul 2016 18:00:22 +0000 (18:00 +0000)]
Minor wording improvements to the note about pipe(2) removal.

MFC after: 5 days
Sponsored by: DARPA, AFRL

7 years agoMark the Designware MMC and USB OTG drivers as FDT only. These are normally
andrew [Wed, 20 Jul 2016 17:46:33 +0000 (17:46 +0000)]
Mark the Designware MMC and USB OTG drivers as FDT only. These are normally
found on arm64 devices that use FDT.

Obtained from: ABT Systems Ltd
MFC after: 1 month
Sponsored by: The FreeBSD Foundation

7 years agoAdd a comment describing the 'fast path' that was introduced in r270011.
alc [Wed, 20 Jul 2016 17:20:22 +0000 (17:20 +0000)]
Add a comment describing the 'fast path' that was introduced in r270011.

Reviewed by: kib
MFC after: 3 days
Sponsored by: EMC / Isilon Storage Division

7 years agoWe will be switching to a new arm64 uart cpu driver that handles both FDT
andrew [Wed, 20 Jul 2016 17:19:47 +0000 (17:19 +0000)]
We will be switching to a new arm64 uart cpu driver that handles both FDT
and ACPI. As such pull out what will be the common parts of the FDT cpu
detection to a new function that can be shared between them.

Reviewed by: manu
Obtained from: ABT Systems Ltd
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D7262

7 years agoExtend ELF coredump to support more than 65535 segments
cem [Wed, 20 Jul 2016 16:59:36 +0000 (16:59 +0000)]
Extend ELF coredump to support more than 65535 segments

The ELF e_phnum field is only 16 bits wide. To support more than 65535 segments
(program headers), Sun's "Linker and Libraries Guide" table 7-7 (or 12-7,
depending on document version) prescribes a special first section header where
sh_info represents the real number of program headers.

Test code to follow, when it is ready.

Reference: http://docs.oracle.com/cd/E18752_01/pdf/817-1984.pdf

Reviewed by: emaste, markj
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D7255

7 years agoRedo the r302894: the very new value for a non-scheduled callout is -1.
glebius [Wed, 20 Jul 2016 16:48:25 +0000 (16:48 +0000)]
Redo the r302894: the very new value for a non-scheduled callout is -1.
This was recently added in r290664.

Noticed by: hselasky
Tested by: Larry Rosenman <ler lerctr.org>
PR: 210884

7 years agoAdd myself to MAINTAINERS.
nwhitehorn [Wed, 20 Jul 2016 16:46:13 +0000 (16:46 +0000)]
Add myself to MAINTAINERS.

7 years agoRevert r303037. It re-introduces the panic with TCP timers.
glebius [Wed, 20 Jul 2016 16:44:22 +0000 (16:44 +0000)]
Revert r303037. It re-introduces the panic with TCP timers.

Agreed by: rrs, re (gjb)

7 years agoContinuation lines with comments badly affects gprof, it is excluded from
ache [Wed, 20 Jul 2016 15:59:37 +0000 (15:59 +0000)]
Continuation lines with comments badly affects gprof, it is excluded from
build on amd64 f.e.

7 years agoFix camdd for host-aware and host-managed SMR disks.
asomers [Wed, 20 Jul 2016 15:00:05 +0000 (15:00 +0000)]
Fix camdd for host-aware and host-managed SMR disks.

This should've gone in as part of r300207

Reviewed by: ken
MFC after: 3 days
Sponsored by: Spectra Logic Corp

7 years agoEnsure that the UFS directory vnode' vm_object is properly sized
kib [Wed, 20 Jul 2016 14:40:56 +0000 (14:40 +0000)]
Ensure that the UFS directory vnode' vm_object is properly sized
before UFS_BALLOC() is called.  I do not believe that this caused any
real issue on FreeBSD because the exclusive vnode lock is held over
the balloc/resize, the change is to make formally correct KPI use.

Based on: the Matthew Dillon' patch from DragonFly BSD
PR: 93942
Reviewed by: mckusick
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoIn addition to r303074 case 1, search for protected L'/' too in globtilde()
ache [Wed, 20 Jul 2016 12:46:21 +0000 (12:46 +0000)]
In addition to r303074 case 1, search for protected L'/' too in globtilde()

7 years agoAdd support for the SID (Security ID Module) on Allwinner A10 and A20.
manu [Wed, 20 Jul 2016 11:23:06 +0000 (11:23 +0000)]
Add support for the SID (Security ID Module) on Allwinner A10 and A20.
The rootkey is burnt at production and can't be changed, thus is can be used
as a device unique ID or to generate a MAC address (This is was u-boot does).
The rootkey is exposed as a sysctl (dev.aw_sid.<unit>.rootkey).

Reviewed by: jmcneill
Differential Revision: https://reviews.freebsd.org/D6383

7 years agoMFV r303083: 7164 zdb should be able to open the root dataset
avg [Wed, 20 Jul 2016 11:15:32 +0000 (11:15 +0000)]
MFV r303083: 7164 zdb should be able to open the root dataset

Note: conversion of the manual page change from roff to mdoc is mine.

illumos/illumos-gate@b702644a6eb66615d67b492fd73ecd9efa11fc7d
https://github.com/illumos/illumos-gate/commit/b702644a6eb66615d67b492fd73ecd9efa11fc7d

https://www.illumos.org/issues/7164
  If the pool/dataset command-line argument is specified with a trailing
  slash, for example, "tank/", we should interpret it as the topmost
  dataset (rather than the whole pool)

Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Tim Chase <tim@chase2k.com>
PR: 204661
MFC after: 1 week
Relnotes: yes

7 years agoRemove outdated list of supported chipsets, generalizing it.
mav [Wed, 20 Jul 2016 11:04:49 +0000 (11:04 +0000)]
Remove outdated list of supported chipsets, generalizing it.

7 years agoMFV r303082: 6391 Override default SPA config location via environment
avg [Wed, 20 Jul 2016 10:06:56 +0000 (10:06 +0000)]
MFV r303082: 6391 Override default SPA config location via environment

illumos/illumos-gate@ae24175b2b25e9fb4bfd9ac0648b57e0735b6651
https://github.com/illumos/illumos-gate/commit/ae24175b2b25e9fb4bfd9ac0648b57e0735b6651

https://www.illumos.org/issues/6391
  When using zdb with non-default SPA config file it is not convenient
  to add -U <non-default-config-file-path> all the time. This commit
  introduces support for setting/overriding SPA config location via
  environment variable 'SPA_CONFIG_PATH'.
  If -U flag is specified in the command line it will override any other
  value as usual.

https://github.com/zfsonlinux/zfs/commit/64d7b6cf75e52a4698d9bdec61745573c39d2e5a

Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed by: Richard Yao <ryao@gentoo.org>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Will Andrews <will@freebsd.org>
Reviewed by: George Wilson <george.wilson@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Cyril Plisko <cyril.plisko@mountall.com>
MFC after: 1 week

7 years agovesa: fix panic on suspend
royger [Wed, 20 Jul 2016 09:29:39 +0000 (09:29 +0000)]
vesa: fix panic on suspend

Fix the following panic seen when migrating a FreeBSD guest on Xen:

panic: mtx_lock() of destroyed mutex @ /usr/src/sys/dev/fb/vesa.c:541
cpuid = 0
KDB: stack backtrace:
db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe001d2fa4f0
vpanic() at vpanic+0x182/frame 0xfffffe001d2fa570
kassert_panic() at kassert_panic+0x126/frame 0xfffffe001d2fa5e0
__mtx_lock_flags() at __mtx_lock_flags+0x15b/frame 0xfffffe001d2fa630
vesa_bios_save_restore() at vesa_bios_save_restore+0x78/frame 0xfffffe001d2fa680
vga_suspend() at vga_suspend+0xa3/frame 0xfffffe001d2fa6b0
isavga_suspend() at isavga_suspend+0x1d/frame 0xfffffe001d2fa6d0
bus_generic_suspend_child() at bus_generic_suspend_child+0x44/frame
[...]

This is caused because vga_sub_configure (which is called if the VGA adapter
is attached after VESA tried to initialize), points to vesa_configure, which
doesn't initialize the VESA mutex. In order to fix it, make sure
vga_sub_configure points to vesa_load, so that all the needed vesa
components are properly initialized.

Sponsored by: Citrix Systems R&D
MFC after: 3 days
PR: 209203
Reviewed by: dumbbell
Differential revision: https://reviews.freebsd.org/D7196

7 years ago1) Per POSIX (and glibc) GLOB_NOCHECK should return original pattern,
ache [Wed, 20 Jul 2016 07:30:44 +0000 (07:30 +0000)]
1) Per POSIX (and glibc) GLOB_NOCHECK should return original pattern,
unmodified, if no matches found. But our original code strips all '\'
returning it. Rewrite the code to allow to reconstruct exact the
original pattern with backslashes for this case.

2) Prevent to use truncated pattern if MAXPATHLEN exceeded, return
GLOB_NOMATCH instead.

3) Fix few end loop conditions filling Char arrays with mbrtowc(),
MB_CUR_MAX is unneeded in two places and condition is less by one
in other place.

4) Prevent to use truncated filenames match if MAXPATHLEN exceeded,
skip such directory entries.

5) Don't end *pathend with L'/' in glob3() if limit is reached, this
change will be not visible since error is returned.

6) If error happens in (*readdirfunc)(), do the same GLOB_ABORTED
processing as for g_opendir() as POSIX requires.

7 years agoFix a bug in deferred stream reset processing which results
tuexen [Wed, 20 Jul 2016 06:29:26 +0000 (06:29 +0000)]
Fix a bug in deferred stream reset processing which results
in using a length field before it is set.

Thanks to Taylor Brandstetter for reporting the issue and
providing a fix.

MFC after: 3 days

7 years agohyperv/vmbus: Save MNF trigger location instead of MNF trigger index.
sephe [Wed, 20 Jul 2016 06:12:32 +0000 (06:12 +0000)]
hyperv/vmbus: Save MNF trigger location instead of MNF trigger index.

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

7 years agohyperv/vmbus: Hide channel struct definition.
sephe [Wed, 20 Jul 2016 06:00:27 +0000 (06:00 +0000)]
hyperv/vmbus: Hide channel struct definition.

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

7 years agohyperv/vmbus: Deprecate the device private data in channel struct
sephe [Wed, 20 Jul 2016 05:48:52 +0000 (05:48 +0000)]
hyperv/vmbus: Deprecate the device private data in channel struct

They are neither flexible nor extensible.

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

7 years agohyperv/vmbus: Pass channel as the first argument for channel callback
sephe [Wed, 20 Jul 2016 05:34:28 +0000 (05:34 +0000)]
hyperv/vmbus: Pass channel as the first argument for channel callback

The prepares to kill device private fields in channel struct, which
are not flexible and extensible.

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

7 years agohyperv/vmbus: Channel struct field rename
sephe [Wed, 20 Jul 2016 05:26:04 +0000 (05:26 +0000)]
hyperv/vmbus: Channel struct field rename

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

7 years agohyperv/vmbus: Move IC register definition to Hyper-V utilities
sephe [Wed, 20 Jul 2016 05:16:23 +0000 (05:16 +0000)]
hyperv/vmbus: Move IC register definition to Hyper-V utilities

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

7 years agohyperv/vmbus: Get rid of unnecessary definition.
sephe [Wed, 20 Jul 2016 05:03:04 +0000 (05:03 +0000)]
hyperv/vmbus: Get rid of unnecessary definition.

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

7 years agoAdd myself (stevek) as a src committer and mentor (sjg) to committers-src.dot
stevek [Wed, 20 Jul 2016 04:25:09 +0000 (04:25 +0000)]
Add myself (stevek) as a src committer and mentor (sjg) to committers-src.dot

Approved by: sjg (mentor)

7 years agoMFV r298167, r300962, r303048:
pfg [Wed, 20 Jul 2016 03:52:04 +0000 (03:52 +0000)]
MFV r298167, r300962, r303048:
openresolv: update to version 3.8.1.

Among the new features it attempts to support alternative init systems.

MFC after: 1 month

7 years agolibunwind: Properly align _Unwind_Exception.
emaste [Wed, 20 Jul 2016 03:13:02 +0000 (03:13 +0000)]
libunwind: Properly align _Unwind_Exception.

_Unwind_Exception is required to be double word aligned.  GCC has
interpreted this to mean "use the maximum useful alignment for the
target" so follow that lead.

Obtained from: LLVM review D22543

7 years agoRelease the second critical section in uma_zfree_arg() slightly earlier.
markj [Wed, 20 Jul 2016 01:01:50 +0000 (01:01 +0000)]
Release the second critical section in uma_zfree_arg() slightly earlier.

It is only needed when removing a full bucket from the per-CPU cache. The
bucket cache (uz_buckets) is protected by the zone mutex and thus the
critical section can be released before inserting into that list.

MFC after: 1 week

7 years agoMake vm_pageout_wakeup_thresh a u_int rather than an int.
markj [Wed, 20 Jul 2016 00:09:22 +0000 (00:09 +0000)]
Make vm_pageout_wakeup_thresh a u_int rather than an int.

It's a threshold for v_free_count, which is of type u_int. This also lets
us get rid of a cast in vm_paging_needed().

Reviewed by: alc
MFC after: 1 week

7 years agoOnly build makewhatis(1)/apropos(1) with MAN_UTILS.
bdrewery [Wed, 20 Jul 2016 00:06:03 +0000 (00:06 +0000)]
Only build makewhatis(1)/apropos(1) with MAN_UTILS.

This is what src.conf(5) documents and is what the older non-mandoc
versions respected.

Sponsored by: EMC / Isilon Storage Division

7 years agoMerge {amd64,i386}/instr_size.c into x86_instr_size.c.
markj [Wed, 20 Jul 2016 00:02:10 +0000 (00:02 +0000)]
Merge {amd64,i386}/instr_size.c into x86_instr_size.c.

Also reduce the diff between us and upstream: the input data model will
always be DATAMODEL_NATIVE because of a bug (p_model is never set but is
always initialized to 0), so we don't need to override the caller anyway.
This change is also necessary to support the pid provider for 32-bit
processes on amd64.

MFC after: 2 weeks

7 years agosed(1): Assorted cleanups and simplifications.
pfg [Tue, 19 Jul 2016 22:56:40 +0000 (22:56 +0000)]
sed(1): Assorted cleanups and simplifications.

Const-ify several variables, make it build cleanly with WARNS level 5.

Submitted by: mi
PR: 195929
MFC after: 1 month

7 years agolibc: tag the Rune initialization function prototypes visibility as hidden.
pfg [Tue, 19 Jul 2016 20:22:13 +0000 (20:22 +0000)]
libc: tag the Rune initialization function prototypes visibility as hidden.

It is good practice to export as few symbols as possible from your shared
libraries, so use the GCC visibility attribute in this case, matching what
Apple's libc does.

Reference:
https://developer.apple.com/library/mac/documentation/DeveloperTools/Conceptual/CppRuntimeEnv/Articles/SymbolVisibility.html

Hinted by: Apple's libc 1082.20.4
MFC after: 1 week

7 years agoarch.7: correct MIPS endianness transcription error
emaste [Tue, 19 Jul 2016 20:11:50 +0000 (20:11 +0000)]
arch.7: correct MIPS endianness transcription error

Submitted by: Nikolai Lifanov <lifanov@mail.lifanov.com>

7 years agoarch.7: we also use 1M page mappings on armv6
emaste [Tue, 19 Jul 2016 19:50:30 +0000 (19:50 +0000)]
arch.7: we also use 1M page mappings on armv6

Submitted by: alc

7 years agoIncrease vt(4) framebuffer maximum size
cem [Tue, 19 Jul 2016 19:20:47 +0000 (19:20 +0000)]
Increase vt(4) framebuffer maximum size

And rename "DEFAULT" constants to the more accurate "MAX."

PR: 210382
Submitted by: Felix <felixphew0 at gmail.com>
Reviewed by: wblock, cem
Tested by: Dave Cottlehuber <dch at skunkwerks.at>

7 years agoRemove unused variable from last commit.
scottl [Tue, 19 Jul 2016 19:19:03 +0000 (19:19 +0000)]
Remove unused variable from last commit.

7 years agoerwin stepped down from portmgr, update the graph.
rene [Tue, 19 Jul 2016 19:13:01 +0000 (19:13 +0000)]
erwin stepped down from portmgr, update the graph.

7 years agoSupporting flushing the dump before returning, and simplify/combine the
scottl [Tue, 19 Jul 2016 19:09:23 +0000 (19:09 +0000)]
Supporting flushing the dump before returning, and simplify/combine the
logic.  Switch to a 5us delay since most NVME devices can easily do 200,000
iops.

Submitted by: imp
MFC after: 3 days
Sponsored by: Netflix, Inc.