]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agoAdd a reference to getfsstat in statfs.
imp [Wed, 22 Nov 2017 05:27:18 +0000 (05:27 +0000)]
Add a reference to getfsstat in statfs.

Sponsored by: Netflix

6 years agopatch(1): don't assume a match if we run out of context to check
kevans [Wed, 22 Nov 2017 03:44:19 +0000 (03:44 +0000)]
patch(1): don't assume a match if we run out of context to check

Patches with very little context (-U0 and -U1) could get misapplied if
the file to be patched changes and a hunk is no longer applicable. Matching
with fuzz would be attempted and default to a match when we unexpectedly ran
out of context.

This also affected patches with higher levels of context but had limited
actual context due to the hunk being located near the beginning/end of file.

PR: 74127, 223545 (exp-run)
Reviewed by: emaste, pfg
Approved by: emaste (mentor)
Differential Revision: https://reviews.freebsd.org/D12631

6 years agoPowerPC has 12 artificial frames for the profiler
jhibbits [Wed, 22 Nov 2017 01:53:59 +0000 (01:53 +0000)]
PowerPC has 12 artificial frames for the profiler

It may need to be different between AIM and Book-E, this was tested only on
Book-E (64- and 32-bit)

MFC after: 3 weeks

6 years agofreebsd-update: do not duplicate patchlist entries
emaste [Wed, 22 Nov 2017 01:50:23 +0000 (01:50 +0000)]
freebsd-update: do not duplicate patchlist entries

PR: 221079
Submitted by: Masachika ISHIZUKA
Submitted by: ota@j.email.ne.jp
Reviewed by: cperciva
MFC after: 1 week

6 years agobhnd(4): Add support for querying DMA address translation parameters
landonf [Tue, 21 Nov 2017 23:25:22 +0000 (23:25 +0000)]
bhnd(4): Add support for querying DMA address translation parameters

BHND Wi-Fi chipsets and SoCs share a common DMA engine, operating within
backplane address space. To support host DMA on Wi-Fi chipsets, the bridge
core maps host address space onto the backplane; any host addresses must
be translated to their corresponding backplane address.

- Defines a new bhnd_get_dma_translation(9) API to support querying DMA
  address translation parameters from the bhnd(4) bus.
- Extends bhndb(4) to provide DMA translation descriptors from a DMA
  address translation table defined in the host bridge-specific
  bhndb_hwcfg.
- Defines bhndb(4) DMA address translation tables for all supported host
  bridge cores.
- Extends mips/broadcom's bhnd_nexus driver to return an identity (no-op)
  DMA translation descriptor; no translation is required when addressing
  the SoC backplane.

Approved by: adrian (mentor)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D12582

6 years agobhnd(4): implement MIPS and PCI(e) interrupt support
landonf [Tue, 21 Nov 2017 23:15:20 +0000 (23:15 +0000)]
bhnd(4): implement MIPS and PCI(e) interrupt support

On BHND MIPS SoCs, this replaces the use of hard-coded MIPS IRQ#s in the
common bhnd(4) core drivers; we now register an INTRNG child PIC that
handles routing of backplane interrupt vectors via the MIPS core.

On BHND PCI devices, backplane interrupt vectors are now routed to the
PCI/PCIe host bridge core when bus_setup_intr() is called, where they are
dispatched by the PCI core via a host interrupt (e.g. INTx/MSI).

The bhndb(4) bridge driver tracks registered interrupt handlers for the
bridged bhnd(4) devices and manages backplane interrupt routing, while
delegating actual bus interrupt setup/teardown to the parent bus on behalf
of the bridged cores.

Approved by: adrian (mentor, implicit)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D12518

6 years agoImport the latest CloudABI definitions, v0.18.
ed [Tue, 21 Nov 2017 20:46:21 +0000 (20:46 +0000)]
Import the latest CloudABI definitions, v0.18.

In addition to some small style fixes to the ARMv6 vDSO, this release
includes a new vDSO that can be used for the execution of ARMv6/ARMv7
code on 64-bit platforms.

Just like for i686 on x86-64, this new vDSO is responsible for padding
arguments and return values to 64-bit values, so that the kernel can
easily forward system calls to the native system calls.

Obtained from: https://github.com/NuxiNL/cloudabi

6 years agofilter all passwords (not only changed) from periodic passwd backup
emaste [Tue, 21 Nov 2017 20:31:54 +0000 (20:31 +0000)]
filter all passwords (not only changed) from periodic passwd backup

The periodic 200.backup-passwd script outputs any differences it finds
in master.passwd, relative to the previous backup.  It intends to elide
the encrypted password field, but previously did so only for changed
lines (i.e., those beginning with - or + in the diff).

Apply the sed expression also to unchanged lines to also elide their
passwords.

PR: 223461
Reported by: Andre Albsmeier
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

6 years agosystat: use and correctly display 64bit counters.
kib [Tue, 21 Nov 2017 19:55:32 +0000 (19:55 +0000)]
systat: use and correctly display 64bit counters.

Following struct vmtotal changes, make systat use and correctly
display 64-bit counters.  Switch to humanize_number(3) to overcome
homegrown arithmetics limits in pretty printing large numbers.  Use
1024 as a divisor for memory fields to make it consistent with other
tools and users expectations.

Submitted by: Pawel Biernacki <pawel.biernacki@gmail.com>
Sponsored by: Mysterious Code Ltd.
PR: 2137
Differential revision: https://reviews.freebsd.org/D13105

6 years agoUnbreak riscv build in universe.
imp [Tue, 21 Nov 2017 19:23:20 +0000 (19:23 +0000)]
Unbreak riscv build in universe.

riscv doesn't have -msoft-float. For the moment, just don't add
anything. There's no /boot/loader or other bootstrap contained in the
tree for riscv*. However, with real hardware coming next year, there
are plans for one, so keep building at least a minimal libsa and
ficl to prevent bitrot.

Sponsored by: Netflix

6 years agoUse TARGET_ARCH=riscv64 when TARGET=riscv
imp [Tue, 21 Nov 2017 19:23:12 +0000 (19:23 +0000)]
Use TARGET_ARCH=riscv64 when TARGET=riscv

The supported targets are riscv64 and riscv64sf. Use the former when
building with a bare TARGET=riscv and it is the more common one.

Sponsored by: Netflix

6 years agozfs_write: fix problem with writes appearing to succeed when over quota
avg [Tue, 21 Nov 2017 18:28:14 +0000 (18:28 +0000)]
zfs_write: fix problem with writes appearing to succeed when over quota

The problem happens when the writes have offsets and sizes aligned with
a filesystem's recordsize (maximum block size).  In this scenario
dmu_tx_assign() would fail because of being over the quota, but the uio
would already be modified in the code path where we copy data from the
uio into a borrowed ARC buffer.  That makes an appearance of a partial
write, so zfs_write() would return success and the uio would be modified
consistently with writing a single block.

That bug can result in a data loss because the writes over the quota
would appear to succeed while the actual data is being discarded.

This commit fixes the bug by ensuring that the uio is not changed until
after all error checks are done.  To achieve that the code now uses
uiocopy() + uioskip() as in the original illumos design.  We can do that
now that uiocopy() has been updated in r326067 to use
vn_io_fault_uiomove().

Reported by: mav
Analyzed by: mav
Reviewed by: mav
Pointyhat to: avg (myself)
MFC after: 1 week
X-MFC after: r326067
X-Erratum: wanted

6 years agoFix gptzfsboot for cases with GELI.
imp [Tue, 21 Nov 2017 18:03:47 +0000 (18:03 +0000)]
Fix gptzfsboot for cases with GELI.

HAVE_GPT isn't currently a thing, but HAVE_GELI is. Replace the former
with the latter and remove util.o from the build list (it's picked up
from libsa/libsa32, and that's OK).

Sponsored by: Netflix

6 years agoRemove /etc/resolv.conf from virtual machine images, which is
gjb [Tue, 21 Nov 2017 18:02:18 +0000 (18:02 +0000)]
Remove /etc/resolv.conf from virtual machine images, which is
copied from the build host.  It is renamed to /etc/resolv.conf.bak
on boot, so never used anyway.

Noticed by: peter
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

6 years agomake illumos uiocopy use vn_io_fault_uiomove
avg [Tue, 21 Nov 2017 18:01:43 +0000 (18:01 +0000)]
make illumos uiocopy use vn_io_fault_uiomove

uiocopy() is currently unused, its purpose is copy data from a uio
without modifying the uio.  It was in use before the vn_io_fault support
was added to ZFS, at which point our code diverged from the illumos code
a little bit.  Because ZFS is the only (potential) user of the function
we are free to modify it to better suit ZFS needs.

The intention behind this change is to remove the differences introduced
earlier in zfs_write().

While here, re-implement uioskip() using uiomove() with
uio_segflg == UIO_NOCOPY.
The story of uioskip is the same as with uiocopy.

Reviewed by: mav
MFC after: 1 week

6 years agoAdd a driver for the EFI RTC. This uses the EFI Runtime Services to query
andrew [Tue, 21 Nov 2017 17:23:16 +0000 (17:23 +0000)]
Add a driver for the EFI RTC. This uses the EFI Runtime Services to query
the system time.

As we seem to only read this time on boot, and this is the only source of
time on many arm64 machines we need to enable this by default there. As
this is not always the case with U-Boot firmware, or when we have been
booted from a non-UEFI environment we only enable the device driver when
the Runtime Services are present and reading the time doesn't result in an
error.

PR: 212185
Reviewed by: imp, kib
Tested by: emaste
Relnotes: yes
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D12650

6 years agoFix uninitialized variable from 326034
asomers [Tue, 21 Nov 2017 16:38:30 +0000 (16:38 +0000)]
Fix uninitialized variable from 326034

Reported by: Coverity
CID: 1382887
MFC after: 20 days
X-MFC-With: 326034
Sponsored by: Spectra Logic Corp

6 years agoRefine symtab sorting in libproc.
markj [Tue, 21 Nov 2017 16:03:21 +0000 (16:03 +0000)]
Refine symtab sorting in libproc.

Add some rules to more closely match what illumos does when an address
resolves to multiple symbols:
- prefer non-local symbols
- prefer symbols with fewer leading underscores and no leading '$'

Add some regression tests to verify these rules.

6 years agoAnnotate usdt/tst.eliminate.ksh as EXFAIL.
markj [Tue, 21 Nov 2017 16:00:18 +0000 (16:00 +0000)]
Annotate usdt/tst.eliminate.ksh as EXFAIL.

It appears to depend on some behaviour specific to the Sun link editor.

MFC after: 1 week

6 years agoDon't assume that we can resolve "main" in the ksh executable.
markj [Tue, 21 Nov 2017 15:03:38 +0000 (15:03 +0000)]
Don't assume that we can resolve "main" in the ksh executable.

MFC after: 1 week

6 years agoClean up the SYSINIT_FLAGS definitions for rwlock(9) and rmlock(9).
markj [Tue, 21 Nov 2017 14:59:23 +0000 (14:59 +0000)]
Clean up the SYSINIT_FLAGS definitions for rwlock(9) and rmlock(9).

Avoid duplication in their macro definitions, and document them. No
functional change intended.

MFC after: 1 week

6 years agoMake sure all initialized mutexes are destroyed in the iser module,
hselasky [Tue, 21 Nov 2017 13:56:30 +0000 (13:56 +0000)]
Make sure all initialized mutexes are destroyed in the iser module,
else WITNESS will panic. Prefix all mutex names with "iser_" to
prevent future WITNESS issues.

Sponsored by: Mellanox Technologies
MFC after: 1 week

6 years agovidcontrol: correct history size error message
emaste [Tue, 21 Nov 2017 13:55:10 +0000 (13:55 +0000)]
vidcontrol: correct history size error message

`vidcontrol -h 0` is acceptable, so be explicit that it's less than zero
that is not allowed.

Reported by: Siva Mahadevan
Sponsored by: The FreeBSD Foundation

6 years agoWhen fpcurthread is not the current thread it may be non-NULL. In this
andrew [Tue, 21 Nov 2017 13:19:38 +0000 (13:19 +0000)]
When fpcurthread is not the current thread it may be non-NULL. In this
case another thread has had the VFP unit enabled and will have its state
in the VFP registers along with it stored in memory. As such we don't need
to store the state, but do need to zero the fpcurthread pointer to stop
the VFP driver from using the enable fast path.

Reported by: emaste
Sponsored by: DARPA, AFRL

6 years agoAllow for fictitious physical pages in vm_page_scan_contig().
markj [Tue, 21 Nov 2017 13:17:40 +0000 (13:17 +0000)]
Allow for fictitious physical pages in vm_page_scan_contig().

Some drm2 drivers will set PG_FICTITIOUS in physical pages in order to
satisfy the OBJT_MGTDEVICE object interface, so a scan may encounter
fictitous pages. For now, allow for this possibility; such pages will be
skipped later in the scan since they are wired.

Reported by: avg
Reviewed by: kib
MFC after: 1 week

6 years agoSupport SIGINFO.
delphij [Tue, 21 Nov 2017 08:14:30 +0000 (08:14 +0000)]
Support SIGINFO.

Obtained from: NetBSD
MFC after: 2 weeks

6 years agoThis program is more useful if it skips leading whitespace when
imp [Tue, 21 Nov 2017 07:35:29 +0000 (07:35 +0000)]
This program is more useful if it skips leading whitespace when
parsing a textual UEFI Device Path, since otherwise it things the
passed in path is a filename. While here, reduce the repetition of
8192.

Sponsored by: Netflix

6 years agoDocument what the command line arguments actually do. List some of the
imp [Tue, 21 Nov 2017 07:35:24 +0000 (07:35 +0000)]
Document what the command line arguments actually do. List some of the
size limitations.

Sponsored by: Netflix

6 years agoWhile the EFI spec allows numbers to be in many forms, libefivar
imp [Tue, 21 Nov 2017 06:12:21 +0000 (06:12 +0000)]
While the EFI spec allows numbers to be in many forms, libefivar
produces hex numbers for the dsn. Since that come is from EDK2, change
this for symmetry, by generating the dsn as a hex number.

Noticed by: gpart list | grep efimedia | awk -F: '{print $2;}' | \
sed -e 's/^ *//g;s/,,/,/' | grep MBR | efidp -p | efidp -f
Sponsored by: Netflix

6 years agoRemove trailing whitespace (one I just introduced and a bunch of
imp [Tue, 21 Nov 2017 05:42:13 +0000 (05:42 +0000)]
Remove trailing whitespace (one I just introduced and a bunch of
others in the same directory).

Sponsored by: Netflix

6 years agoImplement efi media tagging for MBR partitioning types.
imp [Tue, 21 Nov 2017 05:35:21 +0000 (05:35 +0000)]
Implement efi media tagging for MBR partitioning types.

Sponsored by: Netflix

6 years agodt_modtext: return error on archs lacking an implementation
emaste [Tue, 21 Nov 2017 03:15:32 +0000 (03:15 +0000)]
dt_modtext: return error on archs lacking an implementation

Reported by: mmel
Reviewed by: markj
MFC after: 1 week
MFC with: r325042
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D13176

6 years agoCheck the page table before TLB1 in pmap_kextract()
jhibbits [Tue, 21 Nov 2017 03:12:16 +0000 (03:12 +0000)]
Check the page table before TLB1 in pmap_kextract()

The vast majority of pmap_kextract() calls are looking for a physical memory
address, not a device address.  By checking the page table first this saves
the formerly inevitable 64 (on e500mc and derivatives) iteration loop
through TLB1 in the most common cases.

Benchmarking this on the P5020 (e5500 core) yields a 300% throughput
improvement on dtsec(4) (115Mbit/s -> 460Mbit/s) measured with iperf.

Benchmarked on the P1022 (e500v2 core, 16 TLB1 entries) yields a 50%
throughput improvement on tsec(4) (~93Mbit/s -> 165Mbit/s) measured with
iperf.

MFC after: 1 week
Relnotes: Maybe (significant performance improvement)

6 years agoPreemptively map MIPS INTRNG interrupts on non-FDT MIPS targets
landonf [Tue, 21 Nov 2017 01:54:48 +0000 (01:54 +0000)]
Preemptively map MIPS INTRNG interrupts on non-FDT MIPS targets

This replaces a partial workaround introduced in r305527 that was
incompatible with nested INTRNG interrupt controllers if not also using
FDT.

On non-FDT MIPS INTRNG targets, we now preemptively produce a set of fixed
mappings for the MIPS IRQ range during nexus attach. On FDT targets,
OFW_BUS_MAP_INTR() remains responsible for mapping the MIPS IRQs.

Approved by: adrian (mentor)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D12385

6 years agocxgbe(4): Fix unsafe mailbox access in cudbg.
np [Tue, 21 Nov 2017 01:18:58 +0000 (01:18 +0000)]
cxgbe(4): Fix unsafe mailbox access in cudbg.

MFC after: 1 week
Sponsored by: Chelsio Communications

6 years agoperiodic: fix exit status for nonexistent arguments
asomers [Mon, 20 Nov 2017 23:51:51 +0000 (23:51 +0000)]
periodic: fix exit status for nonexistent arguments

When called with an absolute pathname, periodic should attempt to execute
every script in that directory. If the directory does not exist, it should
print an error and exit 1. Due to a copy/paste mistake in r231568, it exits
0 in that case.

Reported by: devel/hs-ShellCheck
MFC after: 3 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D13070

6 years agoQuirk Seagate ST8000AS0003-2HH
asomers [Mon, 20 Nov 2017 23:45:42 +0000 (23:45 +0000)]
Quirk Seagate ST8000AS0003-2HH

Like its predecessor ST8000AS0002, this is a drive-managed SMR drive, but
doesn't declare that in its ATA identify data.

MFC after: 3 weeks
Sponsored by: Spectra Logic Corp

6 years agoAdd ATF tests for head(1)
asomers [Mon, 20 Nov 2017 22:55:02 +0000 (22:55 +0000)]
Add ATF tests for head(1)

Submitted by: Fred Schlecter <https://github.com/fjs-github>
Reviewed by: asomers, jilles
MFC after: 3 weeks
Differential Revision: https://github.com/freebsd/freebsd/pull/127

6 years agoMove some more common stuff up to Makefile.inc. In particular, the no
imp [Mon, 20 Nov 2017 22:42:21 +0000 (22:42 +0000)]
Move some more common stuff up to Makefile.inc. In particular, the no
simd / no float stuff is centeralized here. Also centralise
-ffreestanding since it is specified everywhere.

This, along with a change to share/mk/bsd.cpu.mk to include -mno-avx2
in CFLAGS_NO_SIMD should fix building for newer machines (eg with
CPUTYPE=haswell) where clang was generating avx2 instructions.

Sponsored by: Netflix

6 years agoAdd -mno-avx2 for clang as well as -mno-avx. We don't want either of
imp [Mon, 20 Nov 2017 22:41:22 +0000 (22:41 +0000)]
Add -mno-avx2 for clang as well as -mno-avx. We don't want either of
them when asking for no SIMD.

Reviewed by: emaste@
Sponsored by: Netflix

6 years agoda(4): Short-circuit unnecessary BIO_FLUSH commands
asomers [Mon, 20 Nov 2017 22:27:33 +0000 (22:27 +0000)]
da(4): Short-circuit unnecessary BIO_FLUSH commands

sys/cam/scsi/scsi_da.c
Complete BIO_FLUSH commands immediately if the da(4) device hasn't
been written to since the last flush. If we haven't written to the
device, there is no reason to send a flush.

Submitted by: gibbs
Reviewed by: imp
MFC after: 3 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D13106

6 years agoRemove a couple variables that are unused after r325790.
brooks [Mon, 20 Nov 2017 22:18:24 +0000 (22:18 +0000)]
Remove a couple variables that are unused after r325790.

Reported by: rpokala

6 years agoFix multiple bugs in cam_strmatch
asomers [Mon, 20 Nov 2017 22:01:45 +0000 (22:01 +0000)]
Fix multiple bugs in cam_strmatch

* Wrongly matches strings that are shorter than the pattern
* Fails to match negative character sets
* Fails to match character sets that aren't at the end of the pattern
* Fails to match character ranges

Reviewed by: imp
MFC after: 3 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D13173

6 years agoFix off-by-one error in bit_nclear() usage
shurd [Mon, 20 Nov 2017 21:57:04 +0000 (21:57 +0000)]
Fix off-by-one error in bit_nclear() usage

bit_nclear() takes the bit numbers for the start and end bits, not the start
and a count.  This was resulting in memory corruption past the end of the
bitstr_t.

Sponsored by: Limelight Networks

6 years agoPrint ZAC device type in "camcontrol identify" output
asomers [Mon, 20 Nov 2017 21:56:25 +0000 (21:56 +0000)]
Print ZAC device type in "camcontrol identify" output

ZAC (Zoned-device ATA Command set) is the standard for addressing SMR
(shingled magnetic recording) devices over SATA.  Drives indicate their
support for ZAC in their IDENTIFY block. Print whether and how a drive
supports ZAC in the output of "camcontrol identify".

Reviewed by: ken, imp
MFC after: 3 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D13171

6 years agomsdosfs(5): Reflect READONLY attribute in file mode
cem [Mon, 20 Nov 2017 21:38:24 +0000 (21:38 +0000)]
msdosfs(5): Reflect READONLY attribute in file mode

Msdosfs allows setting READONLY by clearing the owner write bit of the file
mode.  (While here, correct the misspelling of S_IWUSR as VWRITE.  No
functional change.)

In msdosfs_getattr, intuitively reflect that READONLY attribute to userspace
in the file mode.

Reported by: Karl Denninger <karl AT denninger.net>
Sponsored by: Dell EMC Isilon

6 years agoInstall strings unconditionally
emaste [Mon, 20 Nov 2017 20:55:41 +0000 (20:55 +0000)]
Install strings unconditionally

Previously it was enabled by WITH_/WITHOUT_TOOLCHAIN, but it is commonly
expected to be available and may have non-toolchain consumers.  As it
is now taken from the BSD-licensed ELF Tool Chain project, just install
it unconditionally.

PR: 213665, 223725
Reviewed by: bdrewery
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D8398

6 years agoUpdate a comment in brelse() to match reality.
scottl [Mon, 20 Nov 2017 20:53:03 +0000 (20:53 +0000)]
Update a comment in brelse() to match reality.

6 years agoiconv: Fix a pointer mismatch.
pfg [Mon, 20 Nov 2017 20:05:30 +0000 (20:05 +0000)]
iconv: Fix a pointer mismatch.

Catch NULL pointer earlier, check for empty string later.
Apparently this fixes a GCC8 warning.

Obtained from: NetBSD (CVS Rev. 1.21, 1.22) through DragonFlyBSD
MFC after: 1 week

6 years agoIndent protection and some other oops from the prvious commits.
pfg [Mon, 20 Nov 2017 19:56:11 +0000 (19:56 +0000)]
Indent protection and some other oops from the prvious commits.

6 years agocxgbe(4): Add a custom board to the device id list.
np [Mon, 20 Nov 2017 19:50:48 +0000 (19:50 +0000)]
cxgbe(4): Add a custom board to the device id list.

MFC after: 1 week
Sponsored by: Chelsio Communications

6 years agoGeneral further adoption of SPDX licensing ID tags.
pfg [Mon, 20 Nov 2017 19:49:47 +0000 (19:49 +0000)]
General 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 agoinclude: further adoption of SPDX licensing ID tags.
pfg [Mon, 20 Nov 2017 19:45:28 +0000 (19:45 +0000)]
include: 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: 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