]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoMake ^w work in ddb(4).
trasz [Thu, 6 Jul 2017 15:21:57 +0000 (15:21 +0000)]
Make ^w work in ddb(4).

Obtained from: CheriBSD
MFC after: 2 weeks
Sponsored by: DARPA, AFRL

7 years agoMake ddb(4) disassembler (x/i) use n32 register names.
trasz [Thu, 6 Jul 2017 15:08:51 +0000 (15:08 +0000)]
Make ddb(4) disassembler (x/i) use n32 register names.

Obtained from: CheriBSD
MFC after: 2 weeks
Sponsored by: DARPA, AFRL

7 years agoSimplify UIO_SYSSPACE and UIO_NOCOPY paths in uiomove
gallatin [Thu, 6 Jul 2017 15:03:54 +0000 (15:03 +0000)]
Simplify UIO_SYSSPACE and UIO_NOCOPY paths in uiomove

Uiomove can only block when the segflag is UIO_USERSPACE,
otherwise we end up just doing a bcopy (or nothing) and
moving cursors. So only emit witness warnings and
set deadlock thread flags in the UIO_USERSPACE case.

Reviewed by: kib
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D11489

7 years agoFix cleanup in lib/libc/gen/setdomainname_test
asomers [Thu, 6 Jul 2017 14:47:59 +0000 (14:47 +0000)]
Fix cleanup in lib/libc/gen/setdomainname_test

ATF cleanup routines run in separate processes from the tests themselves, so
they can't share global variables.

Also, setdomainname_test needs to be is_exclusive because the test cases
access a global resource.

PR: 219967
Reviewed by: ngie
MFC after: 3 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D11188

7 years agoacpidump: warn and exit loop on invalid subtable length
emaste [Thu, 6 Jul 2017 14:35:47 +0000 (14:35 +0000)]
acpidump: warn and exit loop on invalid subtable length

Submitted by: Guangyuan Yang <yzgyyang@outlook.com>
Sponsored by: The FreeBSD Foundation

7 years agocompiler_rt: provide bswap buildins on sparc64
emaste [Thu, 6 Jul 2017 13:27:01 +0000 (13:27 +0000)]
compiler_rt: provide bswap buildins on sparc64

Attempting to build sparc64 world with GCC 6.3 previously failed with
zstd_compress.c:(.text+0x8fc): undefined reference to `__bswapsi2'

7 years agoImprove ddb(4) error reporting a bit.
trasz [Thu, 6 Jul 2017 12:30:39 +0000 (12:30 +0000)]
Improve ddb(4) error reporting a bit.

Obtained from: CheriBSD
MFC after: 2 weeks
Sponsored by: DARPA, AFRL

7 years agoMake ddb(4) a bit more user-friendly by improving "help".
trasz [Thu, 6 Jul 2017 12:27:14 +0000 (12:27 +0000)]
Make ddb(4) a bit more user-friendly by improving "help".

Obtained from: CheriBSD
MFC after: 2 weeks
Sponsored by: DARPA, AFRL

7 years agousr.sbin/bsdinstall/scripts/hardening: fix options numbers
robak [Thu, 6 Jul 2017 12:19:15 +0000 (12:19 +0000)]
usr.sbin/bsdinstall/scripts/hardening: fix options numbers

Submitted by: Bartek Rutkowski <robak@FreeBSD.org>
Reviewed by: bapt
Approved by: bapt
MFC after: 1 day
Differential Revision: https://reviews.freebsd.org/D11505

7 years agoReport device descr in addition to ident.
mav [Thu, 6 Jul 2017 09:05:38 +0000 (09:05 +0000)]
Report device descr in addition to ident.

Serial number without device model is somewhat less useful.

MFC after: 2 weeks

7 years agoAdd GEOM::descr attribute for symmetry with GEOM::ident.
mav [Thu, 6 Jul 2017 08:36:14 +0000 (08:36 +0000)]
Add GEOM::descr attribute for symmetry with GEOM::ident.

MFC after: 2 weeks

7 years agoChase upstream change deprecating LIBXO_OPTIONS similar to r320521
ngie [Thu, 6 Jul 2017 08:05:57 +0000 (08:05 +0000)]
Chase upstream change deprecating LIBXO_OPTIONS similar to r320521

LIBXO_OPTIONS was deprecated in favor of the --libxo options.

Inspired by: https://github.com/Juniper/libxo (02272d5c6d7d)

7 years ago:snprintf_float: don't blindly set RLIMIT_DATA and RLIMIT_AS to 1 MB -- raise
ngie [Thu, 6 Jul 2017 07:59:00 +0000 (07:59 +0000)]
:snprintf_float: don't blindly set RLIMIT_DATA and RLIMIT_AS to 1 MB -- raise
the limit to 32MB instead.

Require user=root and memory=64MB+ first so one can be reasonably sure that
the test will function appropriately.

MFC after: 1 month
MFC with: r320726
PR: 220502

7 years agoExpect :snprintf_float to segfault
ngie [Thu, 6 Jul 2017 07:45:20 +0000 (07:45 +0000)]
Expect :snprintf_float to segfault

This issue started occurring within the past month or so.

PR: 220502
Reported by: Jenkins (amd64-head job)

7 years agortwn: add Rx descriptor structures for common code.
avos [Thu, 6 Jul 2017 07:37:33 +0000 (07:37 +0000)]
rtwn: add Rx descriptor structures for common code.

Remove any chipset specific usage of Rx descriptor structure / bits
from common code to prevent misuse of fields that may differ
between various chipsets.

Checked with:  RTL8821AU in STA mode.

7 years ago:l_flag:: be more aggressive when normalizing whitespace
ngie [Thu, 6 Jul 2017 07:37:03 +0000 (07:37 +0000)]
:l_flag:: be more aggressive when normalizing whitespace

Save output from ls -ldT and stat -l, then normalize all repeating whitespace using
sed to single column spaces.

This makes the test flexible with single-digit days, etc, similar to r320723. This
approach is just a bit more of a hammer approach because of how the columns are
ordered/spaced in both ls and stat.

MFC after: 1 week
MFC with: r319841

7 years agoUse %e instead of %d with x_output_date(..)
ngie [Thu, 6 Jul 2017 06:15:44 +0000 (06:15 +0000)]
Use %e instead of %d with x_output_date(..)

stat -x doesn't 0-fill days so %d is inappropriate. %e is correct.

MFC after: 1 week
MFC with: r319841

7 years agoRegenerate src.conf(5)
ngie [Thu, 6 Jul 2017 05:43:04 +0000 (05:43 +0000)]
Regenerate src.conf(5)

7 years agoAdd WITH_RCMDS for parity with WITHOUT_RCMDS
ngie [Thu, 6 Jul 2017 05:40:51 +0000 (05:40 +0000)]
Add WITH_RCMDS for parity with WITHOUT_RCMDS

7 years agohptmv: avoid gcc variably-modified warning
rlibby [Thu, 6 Jul 2017 05:32:22 +0000 (05:32 +0000)]
hptmv: avoid gcc variably-modified warning

gcc produces a "variably modified X at file scope" warning for
structures that use these size definitions.

PR: 211540
Reviewed by: markj
Approved by: markj (mentor)
Sponsored by: Dell EMC Isilon
Differential revision: https://reviews.freebsd.org/D11416

7 years agoRelease mtx hw_lock before calling pause() in qla_stop() and
davidcs [Thu, 6 Jul 2017 05:16:06 +0000 (05:16 +0000)]
Release mtx hw_lock before calling pause() in qla_stop() and
qla_error_recovery()

MFC after: 5 days

7 years ago[ar724x] put in explicit memory barriers now that read/write register no longer
adrian [Thu, 6 Jul 2017 04:56:23 +0000 (04:56 +0000)]
[ar724x] put in explicit memory barriers now that read/write register no longer
implicitly do them.

They were removed as part of my "fix this to actually work" a few commits
ago in this file.

Tested:

* AP93, AR7240 + AR9280 PCI

7 years agoAdd tests to help verify Links functionality for .../contrib/tzdata/backwards
ngie [Thu, 6 Jul 2017 04:30:06 +0000 (04:30 +0000)]
Add tests to help verify Links functionality for .../contrib/tzdata/backwards

MFC after: 1 month
MFC with: r320702

7 years agoFormalize LEAPSECONDS and OLDTIMEZONES in share/zoneinfo/... as
ngie [Thu, 6 Jul 2017 04:19:33 +0000 (04:19 +0000)]
Formalize LEAPSECONDS and OLDTIMEZONES in share/zoneinfo/... as
`MK_ZONEINFO_LEAPSECONDS_SUPPORT == yes` and
`MK_ZONEINFO_OLD_TIMEZONES_SUPPORT == yes`.

Keep `LEAPSECONDS` and `OLDTIMEZONES` for backwards compatibility,
but print out a warning notifying users that they should use the new
variables, in an effort to migrate them to the variables. This is being
done mostly for automated build tools, etc, that might rely on these
variables being set. The variables will be removed in the future on
^/head, e.g., after ^/stable/12 is cut.

MFC after:      1 month
Relnotes:       yes
Reviewed by: bdrewery
Differential Revision: D11376

7 years agoRemove SUBDIR ordering/uniquifying in *bin/Makefile
ngie [Thu, 6 Jul 2017 04:15:30 +0000 (04:15 +0000)]
Remove SUBDIR ordering/uniquifying in *bin/Makefile

After the addition of SUBDIR.yes, uniquifying/ordering the SUBDIRs doesn't
make a whole lot of sense, and it's in effect a half measure.

Ordering SUBDIR (after adding SUBDIR.yes to it) in bsd.subdir.mk is a
separate change that warrants more discussion/testing, because while
the SUBDIR_PARALLEL work largely fixed dependency ordering for SUBDIRs,
there might be downstream FreeBSD consumers that rely on the SUBDIR
ordering.

MFC after: 2 months
Reviewed by: bdrewery
Differential Revision: D11398

7 years ago[ar71xx] Start migrating the AR934x based boards over to the new world order.
adrian [Thu, 6 Jul 2017 04:06:25 +0000 (04:06 +0000)]
[ar71xx] Start migrating the AR934x based boards over to the new world order.

This unifies the PCI hints with the AHB/NOR hint syntax.

Tested:

* DIR825C1, AR9344 SoC / 2x2 2G + AR9580 PCI 2x2 5G

7 years agoAdd support for AF_LOCAL socket upcalls to the nfsuserd daemon.
rmacklem [Thu, 6 Jul 2017 00:53:12 +0000 (00:53 +0000)]
Add support for AF_LOCAL socket upcalls to the nfsuserd daemon.

This patch adds support for AF_LOCAL socket upcalls to an nfsuserd daemon
that supports them. A future patch to the nfsuserd daemon will use AF_LOCAL
sockets to avoid a problem when using upcalls to 127.0.0.1 if jails are
in use.

Suggested by: dfr
PR: 205193

7 years agoAllow ipsec to run in vnet jails
kp [Wed, 5 Jul 2017 20:00:58 +0000 (20:00 +0000)]
Allow ipsec to run in vnet jails

ipsec is usable in vnet jails, so allow it to run there.

PR: 211364
Submitted by: Matthias Meyser <meyser xenet.de>

7 years agoFix out-of-tree kernel builds after r320275 when bsd.linker.mk not yet installed.
bdrewery [Wed, 5 Jul 2017 19:43:16 +0000 (19:43 +0000)]
Fix out-of-tree kernel builds after r320275 when bsd.linker.mk not yet installed.

Submitted by: bde

7 years agoAllow MTU changes without ifconfig down/up
davidcs [Wed, 5 Jul 2017 19:25:09 +0000 (19:25 +0000)]
Allow MTU changes without ifconfig down/up

MFC after:5 days

7 years agoFix create-kernel-packages with multiple BUILDKERNELS after r320284
bdrewery [Wed, 5 Jul 2017 19:24:38 +0000 (19:24 +0000)]
Fix create-kernel-packages with multiple BUILDKERNELS after r320284

Submitted by: Kyle Evans <kevans91@ksu.edu>
Reviewed by: ngie

7 years agoDefer ACPI taskqueue creation to SI_SUB_KICK_SCHEDULER.
markj [Wed, 5 Jul 2017 17:39:17 +0000 (17:39 +0000)]
Defer ACPI taskqueue creation to SI_SUB_KICK_SCHEDULER.

This addresses a deadlock during boot when EARLY_AP_STARTUP is configured:
a taskqueue thread may call pause() with an ACPI mutex held, and thread0
may block on this mutex before configuring the eventtimer. In this case
the taskqueue thread will sleep forever waiting for its callout to fire.

PR: 220277
Submitted by: jhb
MFC after: 3 days

7 years agoixgbe(4): Update HEAD (p3) to 3.2.12-k
erj [Wed, 5 Jul 2017 17:27:03 +0000 (17:27 +0000)]
ixgbe(4): Update HEAD (p3) to 3.2.12-k

Includes:

- Support for X550EM devices.
- Support for Bypass adapters.
- Flow Director code moved to separate files
- SR-IOV code moved to separate files
- Netmap code moved to separate files

Differential Revision: https://reviews.freebsd.org/D11232
Submitted by: Jeb Cramer <cramerj@intel.com>
Reviewed by: erj@
Tested by: Jeff Pieper <jeffrey.e.pieper@intel.com>
Sponsored by: Intel Corporation

7 years agoFix the ftp-stage target for RPI3 images by loosening the
gjb [Wed, 5 Jul 2017 16:55:45 +0000 (16:55 +0000)]
Fix the ftp-stage target for RPI3 images by loosening the
constraints on the TARGET and TARGET_ARCH variables.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

7 years agoAdd naive benchmark for SSDs in ZFS SLOG role.
mav [Wed, 5 Jul 2017 16:20:22 +0000 (16:20 +0000)]
Add naive benchmark for SSDs in ZFS SLOG role.

ZFS SLOGs have very specific access pattern with many cache flushes,
which none of benchmarks I know can simulate.  Since SSD vendors rarely
specify cache flush time, this measurement can be useful to explain why
some ZFS pools are slower then expected.  This test writes data chunks
of different size followed by cache flush, alike to what ZFS SLOG does,
and measures average time.

To illustrate, here is result for 6 years old SATA Intel 710 Series SSD:

Synchronous random writes:
         0.5 kbytes:    138.3 usec/IO =      3.5 Mbytes/s
           1 kbytes:    137.7 usec/IO =      7.1 Mbytes/s
           2 kbytes:    151.1 usec/IO =     12.9 Mbytes/s
           4 kbytes:    158.2 usec/IO =     24.7 Mbytes/s
           8 kbytes:    175.6 usec/IO =     44.5 Mbytes/s
          16 kbytes:    210.1 usec/IO =     74.4 Mbytes/s
          32 kbytes:    274.2 usec/IO =    114.0 Mbytes/s
          64 kbytes:    416.5 usec/IO =    150.1 Mbytes/s
         128 kbytes:    776.6 usec/IO =    161.0 Mbytes/s
         256 kbytes:   1503.1 usec/IO =    166.3 Mbytes/s
         512 kbytes:   2968.7 usec/IO =    168.4 Mbytes/s
        1024 kbytes:   5866.8 usec/IO =    170.5 Mbytes/s
        2048 kbytes:  11696.6 usec/IO =    171.0 Mbytes/s
        4096 kbytes:  23329.6 usec/IO =    171.5 Mbytes/s
        8192 kbytes:  46779.5 usec/IO =    171.0 Mbytes/s

, and much newer and supposedly much faster NVMe Samsung 950 PRO SSD:

Synchronous random writes:
         0.5 kbytes:   2092.9 usec/IO =      0.2 Mbytes/s
           1 kbytes:   2013.1 usec/IO =      0.5 Mbytes/s
           2 kbytes:   2014.8 usec/IO =      1.0 Mbytes/s
           4 kbytes:   2090.7 usec/IO =      1.9 Mbytes/s
           8 kbytes:   2044.5 usec/IO =      3.8 Mbytes/s
          16 kbytes:   2084.8 usec/IO =      7.5 Mbytes/s
          32 kbytes:   2137.1 usec/IO =     14.6 Mbytes/s
          64 kbytes:   2173.4 usec/IO =     28.8 Mbytes/s
         128 kbytes:   2923.9 usec/IO =     42.8 Mbytes/s
         256 kbytes:   3085.3 usec/IO =     81.0 Mbytes/s
         512 kbytes:   3112.2 usec/IO =    160.7 Mbytes/s
        1024 kbytes:   2430.6 usec/IO =    411.4 Mbytes/s
        2048 kbytes:   3788.9 usec/IO =    527.9 Mbytes/s
        4096 kbytes:   6198.0 usec/IO =    645.4 Mbytes/s
        8192 kbytes:  10764.9 usec/IO =    743.2 Mbytes/s

While the first one obviously has maximal throughput limitations, the
second one has so high cache flush latency (about 2 millisecond), that
it makes one almost useless in SLOG role, despite of its good throughput
numbers.  Power loss protection is out of scope of this test, but I
suspect it can be related.

MFC after: 2 weeks
Sponsored by: iXsystems, Inc.

7 years agoDon't overpromote values when calculating len in tcp_output().
jtl [Wed, 5 Jul 2017 16:10:30 +0000 (16:10 +0000)]
Don't overpromote values when calculating len in tcp_output().

sbavail() returns u_int and sendwin is a uint32_t. Therefore, min() (which
operates on two u_int values) is able to correctly calculate the minimum
of these two arguments.

Reported by: rrs
MFC after: 1 week
Sponsored by: Netflix

7 years agoFix typo introduced in r320672 - check for existence of the right file.
trasz [Wed, 5 Jul 2017 15:42:33 +0000 (15:42 +0000)]
Fix typo introduced in r320672 - check for existence of the right file.

Reported by: rpokala@
MFC after: 2 weeks

7 years agoAdd deprecation notices for gdb and kgdb.
jhb [Wed, 5 Jul 2017 15:23:30 +0000 (15:23 +0000)]
Add deprecation notices for gdb and kgdb.

Even though gdb and kgdb may not be removed for 12.0 on some architectures,
the notice is unconditional as these tools will likely be removed at some
point in the future when adequate replacements are available (gdb in ports
or lldb in base).

Reviewed by: emaste
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D11477

7 years agoAdd option to bsdinstall to disable insecure console, update stack guard option
robak [Wed, 5 Jul 2017 13:37:27 +0000 (13:37 +0000)]
Add option to bsdinstall to disable insecure console, update stack guard option

This patch adds new bsdinstall option to hardening section that allows users
to change this behaviour to secure one and updates stack guard option so it
would set the value of relevant sysctl to 512 (2MB)

Submitted by: Bartek Rutkowski
Reviewed by: adrian, bapt, emaste
Approved by: bapt, emaste
MFC after: 1 day
Sponsored by: Pixeware LTD
Differential Revision: https://reviews.freebsd.org/D9700

7 years agoSort entries in libgcc_s Version.map
emaste [Wed, 5 Jul 2017 13:13:38 +0000 (13:13 +0000)]
Sort entries in libgcc_s Version.map

7 years agoCosmetic tweaks to the default shell rc files, mostly comments.
trasz [Wed, 5 Jul 2017 13:08:07 +0000 (13:08 +0000)]
Cosmetic tweaks to the default shell rc files, mostly comments.

MFC after: 2 weeks

7 years agoUse more canonical .Dt for vt(4).
trasz [Wed, 5 Jul 2017 10:43:27 +0000 (10:43 +0000)]
Use more canonical .Dt for vt(4).

MFC after: 2 weeks

7 years agoRun "resizewin -z" from the default shell profile files. This makes
trasz [Wed, 5 Jul 2017 10:37:37 +0000 (10:37 +0000)]
Run "resizewin -z" from the default shell profile files. This makes
the terminal work properly out of the box when logging over a serial
line, which is quite important for the user experience on boards like
Raspberry Pi.  It doesn't affect cases where the terminal size is
already non-zero, such as SSH or vt(4) sessions.

Note that this doesn't handle a scenario pointed out by rgrimes@:
when the terminal is resized after login, the terminal size won't
get updated even after logging out and back in.

Reviewed by: imp
Obtained from: CheriBSD
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D10642

7 years agoMake MULTIDELAY a requirement in the MPCore Timer driver when using
andrew [Wed, 5 Jul 2017 10:29:05 +0000 (10:29 +0000)]
Make MULTIDELAY a requirement in the MPCore Timer driver when using
PLATFORM. This will help with removing the MULTIDELAY option, enabling
it when PLATFORM is enabled.

7 years agoRequire the ARM Generic Timer driver is built for MULTIDELAY on 32bit arm.
andrew [Wed, 5 Jul 2017 09:27:18 +0000 (09:27 +0000)]
Require the ARM Generic Timer driver is built for MULTIDELAY on 32bit arm.
As this driver is also used for DELAY on arm64 we need to keep the existing
DELAY code for it to use.

7 years agoIn open_binary_fd: when using buffer size for strl* and snprintf,
delphij [Wed, 5 Jul 2017 06:12:21 +0000 (06:12 +0000)]
In open_binary_fd: when using buffer size for strl* and snprintf,
always use >= instead of > to avoid truncation.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D11474
MFC after: 3 days

7 years agoDocument supported poollist() (ippool -l) options in usage() and in
cy [Wed, 5 Jul 2017 05:50:36 +0000 (05:50 +0000)]
Document supported poollist() (ippool -l) options in usage() and in
ippool.8 man page.

7 years agolibelftc: bump version, tracking import in r320343
emaste [Wed, 5 Jul 2017 02:58:46 +0000 (02:58 +0000)]
libelftc: bump version, tracking import in r320343

7 years agoRemove an obsolete comment
jhibbits [Wed, 5 Jul 2017 02:20:03 +0000 (02:20 +0000)]
Remove an obsolete comment

This has been wrong for well over a year, we support the full 36-bit
(or more) PA space.

7 years agoAdd a Bugs section that indicates that the nfsuserd doesn't work
rmacklem [Tue, 4 Jul 2017 22:20:30 +0000 (22:20 +0000)]
Add a Bugs section that indicates that the nfsuserd doesn't work
when jails are being used on the system.
It is hoped that the patches in PR#205193 will someday get tested/debugged
so that they can be committed to fix this.

This is a content change.

PR: 205193
MFC after: 2 weeks

7 years agoWhen reporting undefined symbol, note the version, if specified.
kib [Tue, 4 Jul 2017 20:19:36 +0000 (20:19 +0000)]
When reporting undefined symbol, note the version, if specified.

Use the standard syntax of name@version, I do not expect a confusion
due to unlikely possibility of the name containing the '@' character.

Requested by: emaste
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agocam: EOL whitespace cleanup and line wrapping changes
emaste [Tue, 4 Jul 2017 18:48:08 +0000 (18:48 +0000)]
cam: EOL whitespace cleanup and line wrapping changes

NFC. This cleanup simplifies diffs for review of the MMC-CAM work.

Submitted by: kibab

7 years agoInvoke suspend/resume methods from the driver pmops if available.
markj [Tue, 4 Jul 2017 18:44:14 +0000 (18:44 +0000)]
Invoke suspend/resume methods from the driver pmops if available.

Obtained from: kmacy (original version)
MFC after: 1 week

7 years agoAdd a driver for the imx6 on-chip realtime clock.
ian [Tue, 4 Jul 2017 18:38:34 +0000 (18:38 +0000)]
Add a driver for the imx6 on-chip realtime clock.

This driver is standard rather than optional because it can always provide
time after a reboot, but it will only provide time after a power cycle if
battery power is supplied to the chip's SNVS power domain.

7 years agoMove to open state after plausibility checks.
tuexen [Tue, 4 Jul 2017 18:24:50 +0000 (18:24 +0000)]
Move to open state after plausibility checks.

When doing this too early, the MIB counters go wrong.

MFC after: 1 week

7 years agoAfter r319722 two fields were left uninitialized when transforming a
hselasky [Tue, 4 Jul 2017 18:23:17 +0000 (18:23 +0000)]
After r319722 two fields were left uninitialized when transforming a
socket structure into a listening socket. This resulted in an invalid
instruction fault for all 32-bit platforms.

When INVARIANTS is set the union where the two uninitialized fields
reside gets properly zeroed. This patch ensures the two uninitialized
fields are zeroed when INVARIANTS is undefined.

For 64-bit platforms this issue was not visible because so->sol_upcall
which is uninitialized overlaps with so->so_rcv.sb_state which is
already zero during soalloc();

For 32-bit platforms this issue was visible and resulted in an invalid
instruction fault, because so->sol_upcall overlaps with
so->so_rcv.sb_sel which is always initialized to a valid data pointer
during soalloc().

Verifying the offset locations mentioned above are identical is left
as an exercise to the reader.

PR: 220452
PR: 220358
Reviewed by: ae (network), gallatin
Differential Revision: https://reviews.freebsd.org/D11475
Sponsored by: Mellanox Technologies

7 years agoMove the simple armv6 only timer drivers to require MULTIDELAY to help
andrew [Tue, 4 Jul 2017 18:07:09 +0000 (18:07 +0000)]
Move the simple armv6 only timer drivers to require MULTIDELAY to help
move all armv6 configs it.

7 years agoDon't hold if refcount on an stcb when it is not needed.
tuexen [Tue, 4 Jul 2017 18:04:44 +0000 (18:04 +0000)]
Don't hold if refcount on an stcb when it is not needed.
This improves the consistency with other parts of the code.

7 years agoAdd a delay count to the last few places. This will help make MULTIDELAY
andrew [Tue, 4 Jul 2017 17:15:23 +0000 (17:15 +0000)]
Add a delay count to the last few places. This will help make MULTIDELAY
a requirement on armv6 with PLATFORM.

7 years agoRemove PLATFORM_SMP. It's unneeded as all configs with both PLATFORM and
andrew [Tue, 4 Jul 2017 16:52:55 +0000 (16:52 +0000)]
Remove PLATFORM_SMP. It's unneeded as all configs with both PLATFORM and
SMP use it so we can switch to the combination of these as the check.

7 years agoAdd deprecation notices for all rcmd tools
allanjude [Tue, 4 Jul 2017 15:44:30 +0000 (15:44 +0000)]
Add deprecation notices for all rcmd tools

Submitted by: bcr
Reviewed by: emaste, bapt, jhl
MFC after: immediate
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D11471

7 years agoAdd PLATFORM and PLATFORM_SMP support to the ALPINE kernel configuration.
andrew [Tue, 4 Jul 2017 12:26:47 +0000 (12:26 +0000)]
Add PLATFORM and PLATFORM_SMP support to the ALPINE kernel configuration.
This will help move it to be part of GENERIC.

7 years agoTeach VERSATILEPB about PLATFORM. This will help move it into the GENERIC
andrew [Tue, 4 Jul 2017 12:17:49 +0000 (12:17 +0000)]
Teach VERSATILEPB about PLATFORM. This will help move it into the GENERIC
kernel configuration.

7 years agortwn_usb: reject too long (>16K) mbufs.
avos [Tue, 4 Jul 2017 07:07:08 +0000 (07:07 +0000)]
rtwn_usb: reject too long (>16K) mbufs.

While here move RTWN_TXBUFSZ constant from common to USB specific code
(it's not used anywhere else).

7 years agoAdd some auxiliary types for device driver support.
markj [Tue, 4 Jul 2017 01:23:36 +0000 (01:23 +0000)]
Add some auxiliary types for device driver support.

MFC after: 1 week

7 years agoAdd a field for the class code to struct pci_driver.
markj [Tue, 4 Jul 2017 01:05:20 +0000 (01:05 +0000)]
Add a field for the class code to struct pci_driver.

Fill out some previously uninitialized fields as well.

MFC after: 1 week

7 years agoAdd some PCI class definitions.
markj [Tue, 4 Jul 2017 00:48:50 +0000 (00:48 +0000)]
Add some PCI class definitions.

MFC after: 1 week

7 years agoRename the "driver" field to "bsddriver" to avoid a name collision.
markj [Tue, 4 Jul 2017 00:30:48 +0000 (00:30 +0000)]
Rename the "driver" field to "bsddriver" to avoid a name collision.

MFC after: 1 week

7 years agoReplace mbuf defragmentation with collapse
zbb [Tue, 4 Jul 2017 00:10:29 +0000 (00:10 +0000)]
Replace mbuf defragmentation with collapse

Collapse should be more effective than defragmentation.
Added missing declaration of ena_check_and_collapse_mbuf().

Submitted by:   Michal Krawczyk <mk@semihalf.com>
Obtained from:  Semihalf
Sponsored by:   Amazon.com Inc.

7 years agoFix creation of dma tags and TSO settings
zbb [Tue, 4 Jul 2017 00:08:47 +0000 (00:08 +0000)]
Fix creation of dma tags and TSO settings

TSO settings were not reflecting real HW capabilities.

DMA tags were created with wrong window - high address was the same as
low, so excluding window was not working.

Capabilities of TX dma transaction were not set properly - TSO max size
had been increased and size of one segment had been adjusted.

Submitted by:   Michal Krawczyk <mk@semihalf.com>
Obtained from:  Semihalf
Sponsored by:   Amazon.com Inc.

7 years agoRemove RX mtx from ENA driver
zbb [Tue, 4 Jul 2017 00:06:56 +0000 (00:06 +0000)]
Remove RX mtx from ENA driver

RX lock is no longer required. There can only be one RX cleanup task
running at a time, RX cleanup cannot be executed if interface is not
yet initialized and ena_down() will not free any RX resources if any io
interrupt is being handled - RX cleanup task is only called from an
interrupt handler.

Submitted by:   Michal Krawczyk <mk@semihalf.com>
Obtained from:  Semihalf
Sponsored by:   Amazon.com Inc.

7 years agoCall drbr_advance() before leaving TX routine
zbb [Tue, 4 Jul 2017 00:04:31 +0000 (00:04 +0000)]
Call drbr_advance() before leaving TX routine

If drbr_advance() is not called before doing cleanup and packet is
already enqueued for sending (tx_info is holding pointer to mbuf), then
mbuf is cleaned both in drbr_flush() and in cleanup routine, when all
mbufs hold by tx_buffer_info are being released.

This causes panic, because mbuf is released twice.

Submitted by:   Michal Krawczyk <mk@semihalf.com>
Obtained from:  Semihalf
Sponsored by:   Amazon.com Inc.

7 years agoUnmask all IO irqs after driver state is set as running
zbb [Tue, 4 Jul 2017 00:02:28 +0000 (00:02 +0000)]
Unmask all IO irqs after driver state is set as running

If driver left MSI-x handlling routine because interface was put down,
it is not unmasking IRQs, so any requesting interrupt will be awaiting
for unmasking.

On ena_up() routine all interrupts are being unmasked and any awaiting
interrupt will be handled right away.

If handler was executed before driver state was set as running, handling
routine is being ended immediately, leaving IO irqs for given queue
masked.

Submitted by:   Michal Krawczyk <mk@semihalf.com>
Obtained from:  Semihalf
Sponsored by:   Amazon.com Inc.

7 years agoHold the PCI device list lock when removing an element.
markj [Tue, 4 Jul 2017 00:02:06 +0000 (00:02 +0000)]
Hold the PCI device list lock when removing an element.

MFC after: 1 week

7 years agoAcquire locks before calling drbr_flush()
zbb [Tue, 4 Jul 2017 00:00:42 +0000 (00:00 +0000)]
Acquire locks before calling drbr_flush()

It is required to hold lock that is associated with buffer ring before
flushing drbr.

Submitted by:   Michal Krawczyk <mk@semihalf.com>
Obtained from:  Semihalf
Sponsored by:   Amazon.com Inc.

7 years agoAdd missing lock upon initialization of the interface
zbb [Mon, 3 Jul 2017 23:59:11 +0000 (23:59 +0000)]
Add missing lock upon initialization of the interface

Lack of this lock was causing crash if down was called in
parallel with the initialization routine.

Submitted by:   Michal Krawczyk <mk@semihalf.com>
Obtained from:  Semihalf
Sponsored by:   Amazon.com Inc.

7 years agoFix a few issues with the lockstat provider man page.
markj [Mon, 3 Jul 2017 23:54:39 +0000 (23:54 +0000)]
Fix a few issues with the lockstat provider man page.

- Address most of the post-commit comments on D11128.[1]
- Reference the man pages for the lock types supported by the provider.
- Add a BUGS section.
- Eliminate some redundancy by describing similar probes in the same
  paragraph.
- Fix several inaccuracies, particularly in the probe argument
  descriptions.

Submitted by: wblock [1]
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D11293

7 years agoUpdate jemalloc to 5.0.1.
jasone [Mon, 3 Jul 2017 23:27:57 +0000 (23:27 +0000)]
Update jemalloc to 5.0.1.

7 years agoCorrect a typo in the comment part of r320577, later on copied into
marius [Mon, 3 Jul 2017 20:47:32 +0000 (20:47 +0000)]
Correct a typo in the comment part of r320577, later on copied into
the commit message; as actually implemented, the intent is to retry
up to 2 ms for controllers to enable bus power.
Noticed by: ian@, rgrimes@

Additional note: Among others, the problem addressed by r320577 is
the APL32 ("Storage Controllers May Not Be Power Gated") erratum.
Hopefully, along with r318282, r320577 works around the remaining
problems seen with Intel Apollo Lake eMMC and SDXC controllers.

7 years agoResolve confusion between different error code spaces.
kib [Mon, 3 Jul 2017 20:44:01 +0000 (20:44 +0000)]
Resolve confusion between different error code spaces.

The vm_map_fixed() and vm_map_stack() VM functions return Mach error
codes.  Convert them into errno values before returning result from
exec_new_vmspace().

While there, modernize the comment and do minor style adjustments.

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

7 years agoAllow rtadvd and bsnmpd to run in vnet jails
kp [Mon, 3 Jul 2017 20:36:58 +0000 (20:36 +0000)]
Allow rtadvd and bsnmpd to run in vnet jails

Both of these tools are usable in vnet jails, so allow them to run there.

PR: 220431, 220432
Submitted by: olivier@freebsd.org

7 years agoClear clang warning:
sbruno [Mon, 3 Jul 2017 19:49:25 +0000 (19:49 +0000)]
Clear clang warning:
  warning: macro expansion producing 'defined' has undefined behavior
  [-Wexpansion-to-defined]

Submitted by: Aaron Prieger <aprieger@llnw.com>
Reviewed by: dim
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D11166

7 years agoAdd a sysctl to toggle the use of the sockets LOWAT when calculating auto window...
sbruno [Mon, 3 Jul 2017 19:39:58 +0000 (19:39 +0000)]
Add a sysctl to toggle the use of the sockets LOWAT when calculating auto window growth

Submitted by: j@nitrology.com (Jason Wolfe)
Reviewed by: gnn hiren
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D11016

7 years agoGarbage collect kernel option TWA_FLASH_FIRMWARE
sbruno [Mon, 3 Jul 2017 19:33:50 +0000 (19:33 +0000)]
Garbage collect kernel option TWA_FLASH_FIRMWARE

Submitted by:  kevin.bowling0kev009.com
Differential Revision: https://reviews.freebsd.org/D11387

7 years agoallwinner: Add A64 ccung support
manu [Mon, 3 Jul 2017 19:30:03 +0000 (19:30 +0000)]
allwinner: Add A64 ccung support

Upstream DTS for A64 SoC doesn't provide a /clocks node as Linux switched
to ccu-ng
This commit adds the necessary bits to boot on pine64 with latest DTS from
upstream.
USB is not working for now and some node aren't present in the DTS (like the
PMU, Power Management Unit).

Tested on: Pine64

7 years agoiflib - flib_busdma_load_mbuf_sg used isc_tx_maxsize as max semgent size.
sbruno [Mon, 3 Jul 2017 19:23:45 +0000 (19:23 +0000)]
iflib - flib_busdma_load_mbuf_sg used isc_tx_maxsize as max semgent size.

Submitted by: krzysztof.galazka@intel.com
Differential Revision: https://reviews.freebsd.org/D11403

7 years agobnxt(4) Enable LRO support, redux
sbruno [Mon, 3 Jul 2017 18:23:35 +0000 (18:23 +0000)]
bnxt(4) Enable LRO support, redux

iflib - reset fl-ifl_fragidx to 0 on iflib_fl_bufs_free().  This caused the
panic in em/igb when adding it to a bridge device.

iflib - Handle out of order packet delivery from hardware in support of LRO

Out of order updates to rxd's is fixed in r315217. However, it is not
completely fixed.  While refilling the buffers, iflib is not considering
the out of order descriptors. Hence, it is refilling sequentially.
"idx" variable in _iflib_fl_refill routine is incremented sequentially.
By doing refilling sequentially, it will override the SGEs that
are *IN USE* by other connections.  Fix is to maintain a bitmap of
rx descriptors and differentiate the used one with unused one and
refill only at the unused indices.  This patch also fixes a
few bugs in bnxt, related to the same feature.

Submitted by: bhargava.marreddy@broadcom.com
Reviewed by: venkatkumar.duvvuru@broadcom.com shurd
Differential Revision: https://reviews.freebsd.org/D10681

7 years agoarm: gic: Change GIC_DEBUG_SPURIOUS to TUNABLE
manu [Mon, 3 Jul 2017 18:01:58 +0000 (18:01 +0000)]
arm: gic: Change GIC_DEBUG_SPURIOUS to TUNABLE

On armv6 default to 1 if INVARIANTS is set
On arm64 always default to 0

Discussed with: andrew, ian, mmel

7 years agoSwitch fabric scans from GID_FT to GID_PT+GFF_ID/GFT_ID.
mav [Mon, 3 Jul 2017 15:56:45 +0000 (15:56 +0000)]
Switch fabric scans from GID_FT to GID_PT+GFF_ID/GFT_ID.

Instead of using GID_FT SNS request to get list of registered FCP ports,
use GID_PT to get list of all Nx_Ports, and then use GFF_ID and/or GFT_ID
requests to find whether they are FCP and target capable.

The problem with old approach is that GID_FT does not report ports without
FC-4 type registered.  In particular it was impossible to boot OS from
FreeBSD FC target using QLogic FC BIOS, since one does not register FC-4
type even on new cards and so ignored by old code as incompatible.

As a side bonus this allows initiator to skip pointless logins to other
initiators by fetching that information from SNS instead.

In case some switches do not implement GFF_ID/GFT_ID correctly, add sysctls
to disable that functionality.  I handled broken GFF_ID of my Brocade 200E,
but there may be other switches with different bugs.

Linux also uses GID_PT, but GFF_ID is disabled by default there, and GFT_ID
is not supported.

Sponsored by: iXsystems, Inc.

7 years agoed(1): Allow the omission of one address in (.,.) and (.;.) address ranges
pfg [Mon, 3 Jul 2017 15:54:44 +0000 (15:54 +0000)]
ed(1): Allow the omission of one address in (.,.) and (.;.) address ranges

With this patch, ",n" is an abbreviation for "1,n", ";n" abbreviates
".;n". The "n," and "n;" variants mean "n,n" and "n;n", respectively.
Also, piping to a shell command does not count as a save, so don't reset
the modified flag.

Obtained from: OpenBSD (CVS Rev. 1.58, 1.59)

7 years agoFix Vagrant image upload after recent API changes.
gjb [Mon, 3 Jul 2017 14:31:38 +0000 (14:31 +0000)]
Fix Vagrant image upload after recent API changes.

- Update ATLAS_UPLOAD_URL to avoid various regular expressions
  from failing to match due to redirections.
- Use ATLAS_UPLOAD_URL throughout the script.
- Adjust several regular expression patterns.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

7 years agoAdd support for musl consumers to the Linuxulator.
dchagin [Mon, 3 Jul 2017 10:24:49 +0000 (10:24 +0000)]
Add support for musl consumers to the Linuxulator.

PR: 213809
Submitted by: Yonas Yanfa
Reported by: Yonas Yanfa
MFC after: 1 week
Relnotes: yes

7 years agoLet io_mapping_init_wc() fall back to an uncacheable mapping.
markj [Mon, 3 Jul 2017 02:01:16 +0000 (02:01 +0000)]
Let io_mapping_init_wc() fall back to an uncacheable mapping.

This allows usage of the function on architectures that don't support
write-combining.

Reported by: bz, emaste
X-MFC With: r320196

7 years agopatch(1): add support for git generated diffs.
pfg [Sun, 2 Jul 2017 21:00:30 +0000 (21:00 +0000)]
patch(1): add support for git generated diffs.

Sometimes patches coming from other places have extra a/ and b/
directories prepended to filenames.

Obtained from: OpenBSD (CVS rev. 1.57, 1.58)

7 years agoext2fs: be more verbose about unsupported ext2fs features.
pfg [Sun, 2 Jul 2017 20:47:25 +0000 (20:47 +0000)]
ext2fs: be more verbose about unsupported ext2fs features.

It is useful to know exactly what features may be lacking when trying to
mount ext4 filesystems.

Submitted by: Fedor Uporov
Differential Revision: https://reviews.freebsd.org/D11208

7 years agoRetry up to 20 ms to enable bus power as at least with some Intel
marius [Sun, 2 Jul 2017 19:13:01 +0000 (19:13 +0000)]
Retry up to 20 ms to enable bus power as at least with some Intel
SDHCI/eMMC controllers the first attempt after a D3 to D0 transition,
i. e. when the firmware has put the devices into D3 state before,
can fail.

7 years agodiskinfo(8): correct typo in man page
allanjude [Sun, 2 Jul 2017 16:20:49 +0000 (16:20 +0000)]
diskinfo(8): correct typo in man page

Reported by: N.J. Mann <njm@njm.me.uk>

7 years agoMove comment respecting previous commit.
mav [Sun, 2 Jul 2017 15:08:32 +0000 (15:08 +0000)]
Move comment respecting previous commit.

7 years agoSlightly unify SNS requests for post- and pre-24xx.
mav [Sun, 2 Jul 2017 14:59:41 +0000 (14:59 +0000)]
Slightly unify SNS requests for post- and pre-24xx.

7 years agoIn the arm64 pmap_remove, when removing a full superpage there is no need
andrew [Sun, 2 Jul 2017 08:52:08 +0000 (08:52 +0000)]
In the arm64 pmap_remove, when removing a full superpage there is no need
to demote it to 512 pages, then remove each of these. We can just remove
the l2 map directly. This is what the intel pmaps already do.

Sponsored by: DARPA, AFRL