freebsd.git
6 years agosys: further adoption of SPDX licensing ID tags.
pfg [Mon, 20 Nov 2017 19:43:44 +0000 (19:43 +0000)]
sys: further adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 3-Clause license.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

Special thanks to Wind River for providing access to "The Duke of
Highlander" tool: an older (2014) run over FreeBSD tree was useful as a
starting point.

6 years agosys/dev: further adoption of SPDX licensing ID tags.
pfg [Mon, 20 Nov 2017 19:36:21 +0000 (19:36 +0000)]
sys/dev: further adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 3-Clause license.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

Special thanks to Wind River for providing access to "The Duke of
Highlander" tool: an older (2014) run over FreeBSD tree was useful as a
starting point.

6 years agoevdev: change USB scancode 0x54 from KEY_SLASH to KEY_KPSLASH
wulf [Mon, 20 Nov 2017 19:25:22 +0000 (19:25 +0000)]
evdev: change USB scancode 0x54 from KEY_SLASH to KEY_KPSLASH

Submitted by: dumbbell
Reviewed by: gonzo, wulf
Approved by: gonzo (mentor)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D12983

6 years agoFix evdev codes for slash and asterisk numpad keys of AT-keyboards
wulf [Mon, 20 Nov 2017 19:20:05 +0000 (19:20 +0000)]
Fix evdev codes for slash and asterisk numpad keys of AT-keyboards

Reviewed by: gonzo
Approved by: gonzo (mentor)
MFC after: 2 weeks

6 years agoevdev: Export EVDEV_SUPPORT kernel option through feature facility
wulf [Mon, 20 Nov 2017 19:17:43 +0000 (19:17 +0000)]
evdev: Export EVDEV_SUPPORT kernel option through feature facility

Suggested by: netchild
Reviewed by: gonzo
Approved by: gonzo (mentor)
MFC after: 1 week

6 years agoUse chroot(8) when invoking realpath(1) when setting BOOTFILES,
gjb [Mon, 20 Nov 2017 15:03:03 +0000 (15:03 +0000)]
Use chroot(8) when invoking realpath(1) when setting BOOTFILES,
otherwise realpath(1) exits due to a nonexistent directory.

Sponsored by: The FreeBSD Foundation

6 years agoMFV r326007: less v529.
delphij [Mon, 20 Nov 2017 08:52:33 +0000 (08:52 +0000)]
MFV r326007: less v529.

MFC after: 2 weeks

6 years agoVendor import of less v529.
delphij [Mon, 20 Nov 2017 06:53:49 +0000 (06:53 +0000)]
Vendor import of less v529.

6 years agoEliminate 1 XX_VirtToPhys() and 2 XX_PhysToVirt() calls from if_dtsec(4)
jhibbits [Mon, 20 Nov 2017 04:32:01 +0000 (04:32 +0000)]
Eliminate 1 XX_VirtToPhys() and 2 XX_PhysToVirt() calls from if_dtsec(4)

XX_VirtToPhys(), by way of pmap_kextract(), is an expensive operation.
Profiling via dtrace during a series of iperf tests I found 16111 / 30432
stack frames were located in mmu_booke_kextract(), so eliminating this
expensive call should improve performance slightly.  XX_PhysToVirt() is not
as expensive, but redundant calls in this context is wasteful.

6 years agoReduce code duplication for wlan(4) interface creation in network.subr.
avos [Sun, 19 Nov 2017 20:18:21 +0000 (20:18 +0000)]
Reduce code duplication for wlan(4) interface creation in network.subr.

Since wlandebug(8) can accept any (original or changed) interface name
this part may be simplified a bit.

6 years agowlandebug(8): allow fallback to old behavior + improve name checks.
avos [Sun, 19 Nov 2017 20:13:11 +0000 (20:13 +0000)]
wlandebug(8): allow fallback to old behavior + improve name checks.

- Treat passed interface name as original if ifconfig_get_orig_name() fails.
- Reject interface name if it does not start from "wlan".

6 years agoRemove empty directories.
nyan [Sun, 19 Nov 2017 11:33:46 +0000 (11:33 +0000)]
Remove empty directories.

6 years agoFix build.
kib [Sun, 19 Nov 2017 11:21:16 +0000 (11:21 +0000)]
Fix build.

Sponsored by: The FreeBSD Foundation

6 years agoRemove unused header.
delphij [Sun, 19 Nov 2017 03:52:03 +0000 (03:52 +0000)]
Remove unused header.

6 years agoRemove unused header.
delphij [Sun, 19 Nov 2017 03:51:47 +0000 (03:51 +0000)]
Remove unused header.

6 years agoaw_nmi: add support for a31/a83t's r_intc
kevans [Sun, 19 Nov 2017 03:14:10 +0000 (03:14 +0000)]
aw_nmi: add support for a31/a83t's r_intc

We currently support the a83t's r_intc in a somewhat hack-ish way; our .dts
describes it as nmi_intc, and uses a subset of the actual register space to
make it line up with a20/a31 nmi offsets.

This breaks with the recent 4.14 update describing r_intc using the full
register space, so update aw_nmi to use the correct register offsets with
the right compat data in a way that doesn't break our current dts with
nmi_intc or upstream with r_intc described.

Reviewed by: manu
Approved by: emaste (mentor)
Differential Revision: https://reviews.freebsd.org/D13122

6 years agoAdd missing call to services_mkdb to build the services.db
brd [Sun, 19 Nov 2017 02:16:11 +0000 (02:16 +0000)]
Add missing call to services_mkdb to build the services.db

Approved by: gjb

6 years agoANSIfy sys/libkern
emaste [Sun, 19 Nov 2017 00:31:13 +0000 (00:31 +0000)]
ANSIfy sys/libkern

PR: 223641
Submitted by: ota@j.email.ne.jp
MFC after: 1 week

6 years agodts: arm64: allwinner: Remove unused dts for pine64
manu [Sat, 18 Nov 2017 21:39:54 +0000 (21:39 +0000)]
dts: arm64: allwinner: Remove unused dts for pine64

Latest u-boot port provide the dts for pine64, remove our custom
and outdated dts for this board.

6 years agoRemove unneeded special case for .OBJDIR=.CURDIR.
bdrewery [Sat, 18 Nov 2017 21:27:33 +0000 (21:27 +0000)]
Remove unneeded special case for .OBJDIR=.CURDIR.

The else statement is already handling this by ensuring a safe .OBJDIR is used.

Sponsored by: Dell

6 years agoif_awg: drain tx buffers and clear rx buffers when stopping
manu [Sat, 18 Nov 2017 21:12:06 +0000 (21:12 +0000)]
if_awg: drain tx buffers and clear rx buffers when stopping

Stale packets should not be transmitted when the interface comes up after being down.
Count the successfully transmitted ones for statistics and drop the rest.

Submitted by: Guy Yur <guyyur@gmail.com>
Differential Revision: https://reviews.freebsd.org/D12539

6 years agoif_awg: avoid hole in the rx ring buffer when mbuf allocation fails
manu [Sat, 18 Nov 2017 21:08:18 +0000 (21:08 +0000)]
if_awg: avoid hole in the rx ring buffer when mbuf allocation fails

Use a spare dma map when attempting to map a new mbuf on the rx path.
If the mbuf allocation fails or the dma map loading for the new mbuf fails just reuse the old mbuf
and increase the drop counter.

Submitted by: Guy Yur <guyyur@gmail.com>
Differential Revision: https://reviews.freebsd.org/D12538

6 years agoif_awg: rename tx functions to match other drivers and free mbuf on m_collapse failure
manu [Sat, 18 Nov 2017 21:04:39 +0000 (21:04 +0000)]
if_awg: rename tx functions to match other drivers and free mbuf on m_collapse failure

- use awg_encap and awg_txeof names to match iflib and other network drivers.
- handle m_collapse failure similarly by freeing the mbuf rather than reenqueuing it where it will continue to fail.

Submitted by: Guy Yur <guyyur@gmail.com>
Differential Revision: https://reviews.freebsd.org/D13035

6 years agoif_awg: don't process transmitted packets on TX_BUF_UA_INT, only on TX_INT
manu [Sat, 18 Nov 2017 20:59:20 +0000 (20:59 +0000)]
if_awg: don't process transmitted packets on TX_BUF_UA_INT, only on TX_INT

TX_BUF_UA_INT is set when there are no buffers to transmit and can
happen before hw.awg.tx_interval segments have been transmitted.

To reduce load, tx cleanup should be done in hw.awg.tx_interval intervals.

Submitted by: Guy Yur <guyyur@gmail.com>
Differential Revision: https://reviews.freebsd.org/D13034

6 years agoif_awg: replace multiple calls to if_setdrvflagbits with one call in awg_txintr
manu [Sat, 18 Nov 2017 20:55:37 +0000 (20:55 +0000)]
if_awg: replace multiple calls to if_setdrvflagbits with one call in awg_txintr

Small optimization

Submitted by: Guy Yur <guyyur@gmail.com>
Differential Revision: https://reviews.freebsd.org/D13033

6 years agoif_awg: only increment IFCOUNTER_OPACKETS when the last segment of a frame has been...
manu [Sat, 18 Nov 2017 20:50:31 +0000 (20:50 +0000)]
if_awg: only increment IFCOUNTER_OPACKETS when the last segment of a frame has been successfully transmitted

A packet may be built from multiple segments, don't increase the count for each segment

Submitted by: Guy Yur <guyyur@gmail.com>
Differential Revision: https://reviews.freebsd.org/D13032

6 years agoif_awg: store mbuf and dma mapping in the last segment of a tx frame instead of the...
manu [Sat, 18 Nov 2017 20:46:31 +0000 (20:46 +0000)]
if_awg: store mbuf and dma mapping in the last segment of a tx frame instead of the first

According to the datasheet, TX_DESC_CTL is cleared when whole frame is transmitted or all
data in the current descriptor's buffer are transmitted.
When the mbuf and mapping are stored in the first segment and in a scenario where a tx
completion interrupt arrives for a frame and only the start of the next frame was transmitted,
at the time of interrupt processing the mbuf and mapping will be freed when processing the
first segment of the next frame but the other untrasmitted segments still need to use them.

Submitted by: Guy Yur <guyyur@gmail.com>
Differential Revision: https://reviews.freebsd.org/D13031

6 years agoif_awg: mark the first tx descriptor as ready only after all the other tx descriptors...
manu [Sat, 18 Nov 2017 20:42:48 +0000 (20:42 +0000)]
if_awg: mark the first tx descriptor as ready only after all the other tx descriptors are set up

In a multi segment frame, if the first tx descriptor is marked with TX_DESC_CTL
but not all tx descriptors for the other segments in the frame are set up,
the TX DMA may transmit an incomplete frame.
To prevent this, set TX_DESC_CTL for the first tx descriptor only when done
with all the other segments.

Also, don't bother cleaning transmitted tx descriptors since TX_DESC_CTL
is cleared for them by the hardware and they will be reprogrammed before
TX_DESC_CTL is reenabled for them.

Submitted by: Guy Yur <guyyur@gmail.com>
Differential Revision: https://reviews.freebsd.org/D13030

6 years agoif_awg: only request completion interrupt on the last descriptor of a tx frame
manu [Sat, 18 Nov 2017 20:38:05 +0000 (20:38 +0000)]
if_awg: only request completion interrupt on the last descriptor of a tx frame

The hardware will not issue a completion interrupt for a descriptor
with TX_INT_CTL set if it doesn't also have TX_LAST_DESC set.

Submitted by:  Guy Yur <guyyur_gmail.com>
Differential Revision: https://reviews.freebsd.org/D13029

6 years agoRemove duplicate static function prototype to fix compilation of
hselasky [Sat, 18 Nov 2017 20:32:09 +0000 (20:32 +0000)]
Remove duplicate static function prototype to fix compilation of
mlx5_fs_tree.c after r325638 when using GCC.

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

6 years agoEvaluate options after including src-env.conf and before Makefile.sys.inc.
bdrewery [Sat, 18 Nov 2017 20:10:36 +0000 (20:10 +0000)]
Evaluate options after including src-env.conf and before Makefile.sys.inc.

Fixes top-level breakage in r325974.

Pointyhat to: bdrewery
Sponsored by: Dell

6 years agoFix top-level targets with read-only OBJDIR.
bdrewery [Sat, 18 Nov 2017 20:01:15 +0000 (20:01 +0000)]
Fix top-level targets with read-only OBJDIR.

This also makes it so that top-level build targets do not immediately create
the OBJDIR.  Only sub-make targets will do so.  This avoids creating object
directories for targets like 'make check-old' or creating unneeded
MACHINE.MACHINE_ARCH directories during 'make tinderbox'.

Reported by: npn, lifanov
Tested by: npn, Mark Millard
Sponsored by: Dell

6 years agoMove top-level AUTO_OBJ logic to Makefile.sys.inc.
bdrewery [Sat, 18 Nov 2017 20:01:12 +0000 (20:01 +0000)]
Move top-level AUTO_OBJ logic to Makefile.sys.inc.

Sponsored by: Dell

6 years agoInclude Makefile.sys.inc if possible for top-level only.
bdrewery [Sat, 18 Nov 2017 20:01:09 +0000 (20:01 +0000)]
Include Makefile.sys.inc if possible for top-level only.

This will allow disabling some things like AUTO_OBJ early if not needed for the
directory/targets, without putting special logic into share/mk/*.sys.mk.

Sponsored by: Dell

6 years agoFix PORTS_MODULES+'make reinstallkernel' trying to run bogus 'make redeinstall'.
bdrewery [Sat, 18 Nov 2017 20:01:05 +0000 (20:01 +0000)]
Fix PORTS_MODULES+'make reinstallkernel' trying to run bogus 'make redeinstall'.

Also fix 'make installkernel' running 'make deinstall' twice.

PR: 201779
MFC after: 2 weeks
Sponsored by: Dell

6 years agoFix 'make -n' for {reinstall,distribute}kernel.
bdrewery [Sat, 18 Nov 2017 20:01:02 +0000 (20:01 +0000)]
Fix 'make -n' for {reinstall,distribute}kernel.

PR: 201779
Sponsored by: Dell

6 years agodts: Allwinner: Remove our last custom DTS
manu [Sat, 18 Nov 2017 16:07:53 +0000 (16:07 +0000)]
dts: Allwinner: Remove our last custom DTS

All Allwinner boards should use the upstream DTS so remove our
remaining custom ones.

6 years agoUpdate our copy of DTS from the ones from Linux 4.14
manu [Sat, 18 Nov 2017 15:46:48 +0000 (15:46 +0000)]
Update our copy of DTS from the ones from Linux 4.14

6 years agoRemove unused Casper configurations files.
oshogbo [Sat, 18 Nov 2017 15:34:31 +0000 (15:34 +0000)]
Remove unused Casper configurations files.

This is a reaming of Casper daemon.

6 years agospdx: initial adoption of licensing ID tags.
pfg [Sat, 18 Nov 2017 14:26:50 +0000 (14:26 +0000)]
spdx: initial adoption of licensing ID tags.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

Special thanks to Wind River for providing access to "The Duke of
Highlander" tool: an older (2014) run over FreeBSD tree was useful as a
starting point.

Initially, only tag files that use BSD 4-Clause "Original" license.

RelNotes: yes
Differential Revision: https://reviews.freebsd.org/D13133

6 years agoIncrease rtld initial memory pool size from 32kB to 128kB.
trasz [Sat, 18 Nov 2017 13:21:22 +0000 (13:21 +0000)]
Increase rtld initial memory pool size from 32kB to 128kB.

The old value was probably fine back in 1998, when that code was imported
(although the comments still mention VAX, which was quite obsolete by then);
now, however, it's too small to handle our libc, which results in some
additional calls to munmap/mmap later on.  Asking for more virtual address
space is virtually free, and syscalls are not, thus the change.

It was suggested by kib@ that this might be a symptom of a deeper problem.
It doesn't only affect libc, though - the change also improves rtld memory
management for eg KDE libraries.  I guess it's just a natural bloat.

MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D12834

6 years agoRemove leftover in lagg(4) manpage forgotten in r271733
bhd [Sat, 18 Nov 2017 11:58:35 +0000 (11:58 +0000)]
Remove leftover in lagg(4) manpage forgotten in r271733

Reviewed by: bcr
Differential Revision: https://reviews.freebsd.org/D13061

6 years agolocks: fix compilation issues without SMP or KDTRACE_HOOKS
mjg [Fri, 17 Nov 2017 23:27:06 +0000 (23:27 +0000)]
locks: fix compilation issues without SMP or KDTRACE_HOOKS

6 years agoAdd comment for accidentally committed unrelated change in r325960.
ae [Fri, 17 Nov 2017 23:25:06 +0000 (23:25 +0000)]
Add comment for accidentally committed unrelated change in r325960.

Do not invoke IPv4 NAT handler for non IPv4 packets. Libalias expects
a packet is IPv4. And in case when it is IPv6, it just translates them
as IPv4. This leads to corruption and in some cases to panics.
In particular a panic can happen when value of ip6_plen modified to
something that leads to IP fragmentation, but actual packet length does
not match the IP length.

Packets that are not IPv4 will be dropped by NAT rule.

Reported by: Viktor Dukhovni <freebsd at dukhovni dot org>
MFC after: 1 week

6 years agocxgbe(4): Add core Vdd to the sysctl MIB.
np [Fri, 17 Nov 2017 23:22:39 +0000 (23:22 +0000)]
cxgbe(4): Add core Vdd to the sysctl MIB.

Sponsored by: Chelsio Communications

6 years agoUnconditionally enable support for O_IPSEC opcode.
ae [Fri, 17 Nov 2017 22:40:02 +0000 (22:40 +0000)]
Unconditionally enable support for O_IPSEC opcode.

IPsec support can be loaded as kernel module, thus do not depend from
kernel option IPSEC and always build O_IPSEC opcode implementation as
enabled.

Obtained from: Yandex LLC
MFC after: 1 week
Sponsored by: Yandex LLC

6 years agoAdd assertion in probedone() that we're holding the device lock.
asomers [Fri, 17 Nov 2017 20:53:52 +0000 (20:53 +0000)]
Add assertion in probedone() that we're holding the device lock.

Submitted by: ken
Reviewed by: asomers
MFC after: 3 weeks
Sponsored by: Spectra Logic Corp

6 years agolockmgr: remove the ADAPTIVE_LOCKMGRS option
mjg [Fri, 17 Nov 2017 20:41:17 +0000 (20:41 +0000)]
lockmgr: remove the ADAPTIVE_LOCKMGRS option

The code was never enabled and is very heavy weight.

A revamped adaptive spinning may show up at a later time.

Discussed with: kib

6 years agovfs_lookup: Allow PATH_MAX-1 symlinks
cem [Fri, 17 Nov 2017 19:25:39 +0000 (19:25 +0000)]
vfs_lookup: Allow PATH_MAX-1 symlinks

Previously, symlinks in FreeBSD were artificially limited to PATH_MAX-2.

Add a short test case to verify the change.

Submitted by: Gaurav Gangalwar <ggangalwar AT isilon.com>
Reviewed by: kib
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D12589

6 years agoBump dates after lint removal.
kib [Fri, 17 Nov 2017 19:10:10 +0000 (19:10 +0000)]
Bump dates after lint removal.

Noted by: wblock
Sponsored by: The FreeBSD Foundation

6 years agoFix 'local' to not look in the source tree for the file.
bdrewery [Fri, 17 Nov 2017 18:34:14 +0000 (18:34 +0000)]
Fix 'local' to not look in the source tree for the file.

Usually 'local' is used along with other rules such as 'no-implicit-rule' or
'dependency' which avoids this problem.  It's possible to need to use 'local'
while relying on the default rules though for a file which is not in the source
tree nor generated in the kernel.

Sponsored by: Dell
Differential Revision: https://reviews.freebsd.org/D13125

6 years agoRemove build system support for lint.
imp [Fri, 17 Nov 2017 18:16:46 +0000 (18:16 +0000)]
Remove build system support for lint.

Differential Revision: https://reviews.freebsd.org/D13124

6 years agoAdd general configuration files used by release/release.sh for
gjb [Fri, 17 Nov 2017 18:00:52 +0000 (18:00 +0000)]
Add general configuration files used by release/release.sh for
big-iron installation images.

MFC after: 3 days
MFC with: r325948, r325949, r325950, r325951
Sponsored by: The FreeBSD Foundation

6 years agoAdd Intel Processor Trace registers for:
br [Fri, 17 Nov 2017 17:54:10 +0000 (17:54 +0000)]
Add Intel Processor Trace registers for:
- CPUID
- Table of Physical Addresses (ToPA).

Sponsored by: DARPA, AFRL

6 years agoFix indentation.
gjb [Fri, 17 Nov 2017 17:40:53 +0000 (17:40 +0000)]
Fix indentation.

Sponsored by: The FreeBSD Foundation

6 years agoSort variables for consistency.
gjb [Fri, 17 Nov 2017 17:36:45 +0000 (17:36 +0000)]
Sort variables for consistency.

Sponsored by: The FreeBSD Foundation

6 years agoSort variables in arm64 SoC configurations.
gjb [Fri, 17 Nov 2017 17:34:52 +0000 (17:34 +0000)]
Sort variables in arm64 SoC configurations.
Remove an unneeded UBLDR_LOADADDR from RPI3.conf.

Sponsored by: The FreeBSD Foundation

6 years agoRemove stray SRCBRANCH included by mistake.
gjb [Fri, 17 Nov 2017 17:33:06 +0000 (17:33 +0000)]
Remove stray SRCBRANCH included by mistake.

Sponsored by: The FreeBSD Foundation

6 years agoFix potential NULL pointer dereference of device physical path
asomers [Fri, 17 Nov 2017 17:13:00 +0000 (17:13 +0000)]
Fix potential NULL pointer dereference of device physical path

In scsi_dev_advinfo(), if the physical path is being stored and there is a
malloc failure (malloc(9) is called with M_NOWAIT), we could wind up in a
situation where the device's physpath_len is set to the length the user
provided, but the physpath itself is NULL.

If another context then comes in to fetch the physical path value, we would
wind up trying to memcpy a NULL pointer into the caller's buffer.

So, set the physpath_len to 0 when we free the physpath on entry into the
store case for the physical path.  Reset the length to a non-zero value only
after we've successfully malloced a buffer to hold it.

Submitted by: ken
Reviewed by: asomers
MFC after: 3 weeks
Sponsored by: Spectra Logic Corp

6 years agoVOP_LOOKUP.9: update locking info
asomers [Fri, 17 Nov 2017 16:04:37 +0000 (16:04 +0000)]
VOP_LOOKUP.9: update locking info

The old description has been inaccurate since at least 243271, if not
before.

Submitted by: will
Reviewed by: kib
MFC after: 3 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D13108

6 years agoCorrect grammar nit.
gordon [Fri, 17 Nov 2017 15:46:19 +0000 (15:46 +0000)]
Correct grammar nit.

6 years agoRename P_OSREL_CK_CLYGRP to P_OSREL_CK_CYLGRP
scottl [Fri, 17 Nov 2017 13:12:20 +0000 (13:12 +0000)]
Rename P_OSREL_CK_CLYGRP to P_OSREL_CK_CYLGRP

6 years agoActually commit the right patch for r325929
bapt [Fri, 17 Nov 2017 09:33:29 +0000 (09:33 +0000)]
Actually commit the right patch for r325929

6 years agoDo not remove the sources when zstd is called as zstdcat
bapt [Fri, 17 Nov 2017 09:29:26 +0000 (09:29 +0000)]
Do not remove the sources when zstd is called as zstdcat

6 years agoAdd jumbo frame support to dtsec(4)
jhibbits [Fri, 17 Nov 2017 04:29:32 +0000 (04:29 +0000)]
Add jumbo frame support to dtsec(4)

MFC after: 2 weeks

6 years agoStop special casing 32-bit AIM in memory parsing
jhibbits [Fri, 17 Nov 2017 04:10:52 +0000 (04:10 +0000)]
Stop special casing 32-bit AIM in memory parsing

There's no need to special case 32-bit AIM to short circuit processing.
Some AIM CPUs can handle 36 bit addresses, and 64-bit CPUs can run 32-bit
OSes, so this will allow us to expand for that in the future if we desire.

6 years agomtx: add missing parts of the diff in r325920
mjg [Fri, 17 Nov 2017 02:59:28 +0000 (02:59 +0000)]
mtx: add missing parts of the diff in r325920

Fixes build breakage.

6 years agosched: move panic handling code out of choosethread
mjg [Fri, 17 Nov 2017 02:45:38 +0000 (02:45 +0000)]
sched: move panic handling code out of choosethread

This avoids jumps in the common case of the kernel not being panicked.

6 years agoCheck for PRS_NEW without locking the proc in sysctl_kern_proc
mjg [Fri, 17 Nov 2017 02:29:06 +0000 (02:29 +0000)]
Check for PRS_NEW without locking the proc in sysctl_kern_proc

6 years agosx: perform a minor cleanup of the unlock slowpath
mjg [Fri, 17 Nov 2017 02:27:04 +0000 (02:27 +0000)]
sx: perform a minor cleanup of the unlock slowpath

No functional changes.

6 years agorwlock: unlock before traversing threads to wake up
mjg [Fri, 17 Nov 2017 02:26:15 +0000 (02:26 +0000)]
rwlock: unlock before traversing threads to wake up

While here perform a minor cleanup of the unlock path.

6 years agomtx: unlock before traversing threads to wake up
mjg [Fri, 17 Nov 2017 02:25:04 +0000 (02:25 +0000)]
mtx: unlock before traversing threads to wake up

This shortens the lock hold time while not affecting corretness.
All the woken up threads end up competing can lose the race against
a completely unrelated thread getting the lock anyway.

6 years agolocks: pull up PMC_SOFT_CALLs out of slow path loops
mjg [Fri, 17 Nov 2017 02:22:51 +0000 (02:22 +0000)]
locks: pull up PMC_SOFT_CALLs out of slow path loops

6 years agorwlock: avoid branches in the slow path if lockstat is disabled
mjg [Fri, 17 Nov 2017 02:21:24 +0000 (02:21 +0000)]
rwlock: avoid branches in the slow path if lockstat is disabled

6 years agosx: avoid branches if in the slow path if lockstat is disabled
mjg [Fri, 17 Nov 2017 02:21:07 +0000 (02:21 +0000)]
sx: avoid branches if in the slow path if lockstat is disabled

6 years agoprocstat: fix a crash with -k -a options
avg [Thu, 16 Nov 2017 22:14:49 +0000 (22:14 +0000)]
procstat: fix a crash with -k -a options

The traditional / legacy usage should still be supported.
This fixes a regression in r324619 that introduced a nicer, verb based
interface.

Reviewed by: brooks
X-MFC with: r324619

6 years agoOnly try to enable CK_CLYGRP if we're running on kernel newer than
imp [Thu, 16 Nov 2017 21:28:14 +0000 (21:28 +0000)]
Only try to enable CK_CLYGRP if we're running on kernel newer than
1200046, the first version that supports this feature. If we set it,
then use an old kernel, we'll break the 'contract' of having
checksummed cylinder groups this flag signifies. To avoid creating
something with an inconsistent state, don't turn the flag on in these
cases. The first full fsck with a new kernel will turn this on.

Spnsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D13114

6 years agoFix default numbers of iflib queue sets
shurd [Thu, 16 Nov 2017 18:52:58 +0000 (18:52 +0000)]
Fix default numbers of iflib queue sets

The intent appears to be having one RX/TX queue set per core,
but since scctx->isc_n[tr]xqsets is set to max before calling
iflib_msix_init(), both end up being set to total number of cores.

Use ctx->ifc_sysctl_n[rt]xqs as the selected value and
scctx->isc_n[rt]xqsets as the max. This should result in what appears
to be the intended behaviour

Reviewed by: sbruno
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D13096

6 years agoImprove the library dependencies helper script in src/tools.
hselasky [Thu, 16 Nov 2017 15:26:39 +0000 (15:26 +0000)]
Improve the library dependencies helper script in src/tools.

Implement double pass of the relevant Makefiles. First make a list of
library names and directories and then scan for all the dependencies.
Spaces in directories in the source tree are not supported.

This avoids using hardcoded mappings between the library name
and the directory containing the library Makefile.

Add support for scanning contrib/ofed .

Bail out on any errors.

Sponsored by: Mellanox Technologies
MFC after: 1 week

6 years agoRemove xlint(1).
kib [Thu, 16 Nov 2017 14:37:18 +0000 (14:37 +0000)]
Remove xlint(1).

xlint is currently a fossil.  We have much more useful and alive tools
to do now what xlint did twenty years ago.

I did not cleared some stuff which makes lint operational, in
sys/x86/include and sys/sys, but I might do it as followup.  The
x86/include/ucontext.h and _types.h hacks made to please lint was the
main reason for my initial proposal to classify xlint as obsolete and
to remove it.

Also I do not intend to clear sccs ids.

Reviewed by: bapt, brooks, emaste, jhb, pfg
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D13015

6 years agoRemove i386 XBOX support.
kib [Thu, 16 Nov 2017 14:27:02 +0000 (14:27 +0000)]
Remove i386 XBOX support.

It is for console presented at 2001 and featuring Pentium III
processor.  Even if any of them are still alive and run FreeBSD, we do
not have any sign of life from their users.  While removing another
dozens of #ifdefs from the i386 sources reduces the aversion from
looking at the code and improves the platform vitality.

Reviewed by: cem, pfg, rink (XBOX support author)
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D13016

6 years agoAdd some 4k quirks for Samsung pm863a SSDs
bapt [Thu, 16 Nov 2017 10:15:17 +0000 (10:15 +0000)]
Add some 4k quirks for Samsung pm863a SSDs

Submitted by: Nikita Kozlov <nikita.kozlov at blade-group.com>
MFC after: 3 days
Sponsored by: blade
Differential Revision: https://reviews.freebsd.org/D13093

6 years agoAvoid holding the process in uread() and uwrite().
markj [Thu, 16 Nov 2017 07:25:12 +0000 (07:25 +0000)]
Avoid holding the process in uread() and uwrite().

In general, higher-level code will atomically verify that the process
is not exiting and hold the process. In one case, we were using uwrite()
to copy a probed instruction to a per-thread scratch space block, but
copyout() can be used for this purpose instead; this change effectively
reverts r227291.

MFC after: 1 week

6 years agoTake r313504 into account when recomputing the string table length.
markj [Thu, 16 Nov 2017 07:14:29 +0000 (07:14 +0000)]
Take r313504 into account when recomputing the string table length.

When we encounter a USDT probe in a weak symbol, we emit an alias for
the probe function symbol. Such aliases are named differently from the
aliases we emit for probes in local functions, so make sure to take that
difference into account when resizing the output object file's string
table. Otherwise, we underrun the string table buffer.

PR: 223680

6 years agocxgbe(4): Remove rsrv_noflowq from intrs_and_queues structure as it does
np [Thu, 16 Nov 2017 02:42:37 +0000 (02:42 +0000)]
cxgbe(4): Remove rsrv_noflowq from intrs_and_queues structure as it does
not influence or get affected by the number of interrupts or queues.

Sponsored by: Chelsio Communications

6 years agocxgbe(4): Sanitize t4_num_vis during MOD_LOAD like all other t4_*
np [Thu, 16 Nov 2017 01:33:53 +0000 (01:33 +0000)]
cxgbe(4): Sanitize t4_num_vis during MOD_LOAD like all other t4_*
tunables.  Add num_vis to the intrs_and_queues structure as it affects
the number of interrupts requested and queues created.  In future
cfg_itype_and_nqueues might lower it incrementally instead of going
straight to 1 when enough interrupts aren't available.

Sponsored by: Chelsio Communications

6 years agoUse better wording: change there to the and define to defines.
imp [Thu, 16 Nov 2017 00:19:44 +0000 (00:19 +0000)]
Use better wording: change there to the and define to defines.
Also fix a run-a-way macro invocation of Dv.

Noticed by: matteo@

6 years agoFix some formatting issues, bump .Dd to today's date, don't use
imp [Wed, 15 Nov 2017 23:51:17 +0000 (23:51 +0000)]
Fix some formatting issues, bump .Dd to today's date, don't use
contractions, and make igor almost happy with this (two issues are
false positives, and I'm not sure a synopsis makes sense).

Sponsored by: Netflix

6 years agocxgbe(4): Combine all _10g and _1g tunables and drop the suffix from
np [Wed, 15 Nov 2017 23:48:02 +0000 (23:48 +0000)]
cxgbe(4):  Combine all _10g and _1g tunables and drop the suffix from
their names.  The finer-grained knobs weren't practically useful.

Sponsored by: Chelsio Communications

6 years agoipsec: Use the same keysize values for HMAC as prior to r324017
cem [Wed, 15 Nov 2017 22:42:20 +0000 (22:42 +0000)]
ipsec: Use the same keysize values for HMAC as prior to r324017

The HMAC construction natively permits any key size between 0 and the input
block length. Before r324017, the auth_hash 'keysize' member was the hash
output length, which was used by ipsec for key sizes. (Non-ipsec consumers
need the ability to use other keysizes, hence, r324017.)

The ipsec SADB code blindly uses the auth_hash 'keysize' member for both
minimum and maximum key size, which is wrong (from an HMAC perspective).
For now, just switch it to 'hashsize', which matches the existing
expectations.

Instead it should probably use the range [0, keysize]. But there may be
other broken code in ipsec that rejects hashes with too small a minimum
key size.

Reported by: olivier@
Reviewed by: olivier, no objection from ae
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D12770

6 years agoProperly bzero kldstat structure to prevent kernel information leak.
gordon [Wed, 15 Nov 2017 22:30:21 +0000 (22:30 +0000)]
Properly bzero kldstat structure to prevent kernel information leak.

Submitted by: kib
Reported by: TJ Corley
Security: CVE-2017-1088

6 years agoFix the handling of ERROR chunks which a lot of error causes.
tuexen [Wed, 15 Nov 2017 22:13:10 +0000 (22:13 +0000)]
Fix the handling of ERROR chunks which a lot of error causes.
While there, clean up the code.
Thanks to Felix Weinrank who found the bug by using fuzz-testing
the SCTP userland stack.

MFC after: 1 week

6 years agoOnly copy /etc/resolv.conf to ${CHROOTDIR} if /etc/resolv.conf does
gjb [Wed, 15 Nov 2017 19:14:44 +0000 (19:14 +0000)]
Only copy /etc/resolv.conf to ${CHROOTDIR} if /etc/resolv.conf does
not already exist within ${CHROOTDIR}.  This allows re-using a build
chroot with CHROOTBUILD_SKIP set to a non-empty value and CHROOTDIR
set to '/' in release.conf.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

6 years agorelease: Update u-boot and firmware file for RPI2 target
manu [Wed, 15 Nov 2017 19:04:23 +0000 (19:04 +0000)]
release: Update u-boot and firmware file for RPI2 target

The u-boot port for RPI-2 was updated to use u-boot-master, this cause
an update in u-boot version to v2017.09 and changing the filename.
The various firmware files for the RPI* are now in a common ports
sysutils/rpi-firmware as they are shared on all the RPI version.

Update the release files to copy the right files from the right location.

Reviewed by: gjb
MFC after: 3 days

6 years agorelease: Update u-boot and firmware file for RPI-B target
manu [Wed, 15 Nov 2017 19:03:06 +0000 (19:03 +0000)]
release: Update u-boot and firmware file for RPI-B target

THe u-boot port for RPI-B was updated to use u-boot-master, this cause
an update in u-boot version to v2017.09 and changing the filename.
The various firmware files for the RPI* are now in a common ports
sysutils/rpi-firmware as they are shared on all the RPI version.

Update the release files to copy the right files from the right location.

Reviewed by: gjb
MFC after: 3 days

6 years agonewfs: warn if newer than kernel
emaste [Wed, 15 Nov 2017 18:40:40 +0000 (18:40 +0000)]
newfs: warn if newer than kernel

Creating a UFS filesystem with a newfs newer than the running kernel,
and then mounting that filesystem, can lead to interesting failures.

Add a safety belt to explicitly warn when newfs is newer than the
running kernel.

Reviewed by: gjb, jhb, mckusick
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D12765

6 years agoSort pkgbase mtree metadata, for reproducible builds
emaste [Wed, 15 Nov 2017 18:03:31 +0000 (18:03 +0000)]
Sort pkgbase mtree metadata, for reproducible builds

Packaged base packages are created by running the stageworld and
stagekernel targets with -DNO_ROOT, and converting the resulting mtree
file into a set of pkg plists.  If stage* is run with multiple processes
the order of entries in the mtree file may be nondeterministic, and the
resulting package tbz also had nondeterministic file ordering.

The mtree file generated by -DNO_ROOT builds consists of one line per
file, with the filename starting in the first column, so is easily
sorted.  There's one exception: the first line of the mtree file is a
comment, but the # character sorts before the filenames anyhow and needs
no special treatment.

PR: 223673
Reviewed by: bapt, gjb
Sponsored by: The Linux Foundation, Core Infrastructure Initiative
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D13103

6 years agoRemove a double free(9) in xpt_bus_register
asomers [Wed, 15 Nov 2017 15:52:06 +0000 (15:52 +0000)]
Remove a double free(9) in xpt_bus_register

In xpt_bus_register(), remove superfluous call to free().  This was mostly
benign since free(9) checks for NULL before doing anything, and
xpt_create_path() is nice enough to NULL out the pointer on failure.
However, it could've segfaulted if malloc(9) failed during
xpt_create_path().

Submitted by: gibbs
MFC after: 3 weeks
Sponsored by: Spectra Logic Corp

6 years agoReplace Fx's with 'the' since expanding FreeBSD here didn't seem quite
imp [Wed, 15 Nov 2017 15:02:45 +0000 (15:02 +0000)]
Replace Fx's with 'the' since expanding FreeBSD here didn't seem quite
right.

Sponsored by: Netflix

6 years agoReword a bit for clarity.
imp [Wed, 15 Nov 2017 15:00:02 +0000 (15:00 +0000)]
Reword a bit for clarity.

Sponsored by: Netflix