]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agobhnd(4): Fix bcma/siba core reset behavior
Landon J. Fuller [Mon, 27 Nov 2017 22:13:30 +0000 (22:13 +0000)]
bhnd(4): Fix bcma/siba core reset behavior

Add missing support for specifying I/O control flags during core reset,
and resolve a number of siba(4)-specific reset issues:

- Add missing check for target reject flags in siba_is_hw_suspended().
- Remove incorrect wait on SIBA_TMH_BUSY when modifying any target state
  register; this should only be done when waiting for initiated
  transactions to clear.
- Add missing wait on SIBA_IM_BY when asserting SIBA_IM_RJ.
- Overwrite any previously set SIBA_TML_REJ flag when bringing the core
  out of reset. This fixes a lockup that occured when we brought up a core
  (after reboot) that had previously been placed into RESET by siba_bwn(4).

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

6 years agobhnd(4) update inline documentation comments and man pages.
Landon J. Fuller [Mon, 27 Nov 2017 21:30:49 +0000 (21:30 +0000)]
bhnd(4) update inline documentation comments and man pages.

This includes a number of copyedits for the inline code documentation
comments, updates to the existing bhnd(4), bhndb(4), bcma(4), and siba(4)
man pages, and new man pages for bhnd_chipc(4), bhnd_pmu(4), bhndb_pci(4),
bhnd(9), and bhnd_erom(9).

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

6 years agodiskinfo(8): Delete dead code in slog test
Alan Somers [Mon, 27 Nov 2017 21:10:50 +0000 (21:10 +0000)]
diskinfo(8): Delete dead code in slog test

Reported by: Coverity
CID: 1377556
Reviewed by: mav
MFC after: 3 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D13275

6 years agoAdd basic tests for ctfconvert(1), fold(1) and rs(1)
Alan Somers [Mon, 27 Nov 2017 20:01:58 +0000 (20:01 +0000)]
Add basic tests for ctfconvert(1), fold(1) and rs(1)

Add basic command line parsing test coverage for these utilities.  The tests
were automatically generated based on their man pages.  These tests can be
expanded by hand for more thorough coverage.  The aim is to generate very
basic amount of test coverage for all the utilities in the base system.

Tests generated via: https://github.com/shivansh/smoketestsuite/

Submitted by: shivansh
Reviewed by: asomers
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D12424

6 years agoFix integer overflow in SLOG test.
Alexander Motin [Mon, 27 Nov 2017 20:01:43 +0000 (20:01 +0000)]
Fix integer overflow in SLOG test.

MFC after: 1 week

6 years agoefivar: add missing getopt 'u' option
Ed Maste [Mon, 27 Nov 2017 19:35:21 +0000 (19:35 +0000)]
efivar: add missing getopt 'u' option

6 years agoDon't use pcpu_find() to determine if a CPU ID is valid.
Mark Johnston [Mon, 27 Nov 2017 18:42:23 +0000 (18:42 +0000)]
Don't use pcpu_find() to determine if a CPU ID is valid.

This addresses assertion failures after r326218.

MFC after: 1 week

6 years agoRevert r326181 for now.
Mark Johnston [Mon, 27 Nov 2017 17:54:17 +0000 (17:54 +0000)]
Revert r326181 for now.

We can't link an executable using -m32 until the lib32 phase of a
buildworld, though the build works fine when executing make from
cddl/usr.sbin/dtrace/tests. Some other solution will need to be found.

6 years agoAvoid unnecessary lookups when initializing the vm_page array.
Mark Johnston [Mon, 27 Nov 2017 17:46:38 +0000 (17:46 +0000)]
Avoid unnecessary lookups when initializing the vm_page array.

This gives a marginal improvement in the vm_page_array initialization
time. Also garbage-collect the now-unused vm_phys_paddr_to_segind().

Reviewed by: alc, kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D13270

6 years agonetconfig.h: sync with upstream.
Pedro F. Giffuni [Mon, 27 Nov 2017 17:18:31 +0000 (17:18 +0000)]
netconfig.h: sync with upstream.

Bring some comments and the license.
Add SPDX License ID tag while here.

Obtained from: NetBSD (CVS rev 1.2, 1.5, 1.6)

6 years agoRemap ENOATTR to ENODATA in the linuxulator.
Fedor Uporov [Mon, 27 Nov 2017 17:03:11 +0000 (17:03 +0000)]
Remap ENOATTR to ENODATA in the linuxulator.
In the linux ENOADATA is frequently #defined as ENOATTR.
The change is required for an xattrs support implementation.

MFC after: 1 week
Discussed with: netchild
Approved by: pfg

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

6 years agoAdd vmm(4) man page
Sean Bruno [Mon, 27 Nov 2017 16:28:28 +0000 (16:28 +0000)]
Add vmm(4) man page

PR: 205705 184046
Submitted by: Matt Macy <matt@mattmacy.io>
Reviewed by: grehan
Differential Revision: https://reviews.freebsd.org/D13062

6 years agoSet the kernel file name so the kern.bootfile sysctl is set. This allows
Andrew Turner [Mon, 27 Nov 2017 16:19:00 +0000 (16:19 +0000)]
Set the kernel file name so the kern.bootfile sysctl is set. This allows
for the creation of kernel.old when running installkernel.

MFC after: 1 week
Sponsored by: DARPA, AFRL

6 years agosys/kgssapi: general adoption of SPDX licensing ID tags.
Pedro F. Giffuni [Mon, 27 Nov 2017 15:49:00 +0000 (15:49 +0000)]
sys/kgssapi: general adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

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.

No functional change intended.

6 years agogrowfs: Commit the changes after expanding the partition
Emmanuel Vadot [Mon, 27 Nov 2017 15:39:11 +0000 (15:39 +0000)]
growfs: Commit the changes after expanding the partition

This fix the problem in arm snapshot present since at least 6 months where
growfs was failing at firstboot and dropped you in a single user shell.

6 years agovarious: general adoption of SPDX licensing ID tags.
Pedro F. Giffuni [Mon, 27 Nov 2017 15:37:16 +0000 (15:37 +0000)]
various: general adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

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.

No functional change intended.

6 years agoshare and pc-sysinstall: adoption of SPDX licensing ID tags.
Pedro F. Giffuni [Mon, 27 Nov 2017 15:28:26 +0000 (15:28 +0000)]
share and pc-sysinstall: adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

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.

Commit these apart because compile testing doesn't guarantee I didn't made
some nasty mistake. No functional change intended.

6 years agolibexec: adoption of SPDX licensing ID tags.
Pedro F. Giffuni [Mon, 27 Nov 2017 15:25:02 +0000 (15:25 +0000)]
libexec: adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

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.

No functional change intended.

6 years agoMake ctlstat -n option work reasonably for sparse LUN list.
Alexander Motin [Mon, 27 Nov 2017 15:24:13 +0000 (15:24 +0000)]
Make ctlstat -n option work reasonably for sparse LUN list.

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

6 years agosys: general adoption of SPDX licensing ID tags.
Pedro F. Giffuni [Mon, 27 Nov 2017 15:23:17 +0000 (15:23 +0000)]
sys: general adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

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.

No functional change intended.

6 years agosys/kern: adoption of SPDX licensing ID tags.
Pedro F. Giffuni [Mon, 27 Nov 2017 15:20:12 +0000 (15:20 +0000)]
sys/kern: adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

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.

6 years agosys/geom: adoption of SPDX licensing ID tags.
Pedro F. Giffuni [Mon, 27 Nov 2017 15:17:37 +0000 (15:17 +0000)]
sys/geom: adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

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.

6 years agosys/gdb: further adoption of SPDX licensing ID tags.
Pedro F. Giffuni [Mon, 27 Nov 2017 15:16:59 +0000 (15:16 +0000)]
sys/gdb: further adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

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.

6 years agosys/fs: further adoption of SPDX licensing ID tags.
Pedro F. Giffuni [Mon, 27 Nov 2017 15:15:37 +0000 (15:15 +0000)]
sys/fs: further adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

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.

6 years agosys/ddb: further adoption of SPDX licensing ID tags.
Pedro F. Giffuni [Mon, 27 Nov 2017 15:14:46 +0000 (15:14 +0000)]
sys/ddb: further adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

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.

6 years agosys/compat: further adoption of SPDX licensing ID tags.
Pedro F. Giffuni [Mon, 27 Nov 2017 15:13:23 +0000 (15:13 +0000)]
sys/compat: further adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

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.

6 years agosys/cam: further adoption of SPDX licensing ID tags.
Pedro F. Giffuni [Mon, 27 Nov 2017 15:12:43 +0000 (15:12 +0000)]
sys/cam: further adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

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.

6 years agosys/x86: further adoption of SPDX licensing ID tags.
Pedro F. Giffuni [Mon, 27 Nov 2017 15:11:47 +0000 (15:11 +0000)]
sys/x86: further adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

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.

6 years agosys/sparc64: further adoption of SPDX licensing ID tags.
Pedro F. Giffuni [Mon, 27 Nov 2017 15:10:39 +0000 (15:10 +0000)]
sys/sparc64: further adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

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.

6 years agosys/powerpc: further adoption of SPDX licensing ID tags.
Pedro F. Giffuni [Mon, 27 Nov 2017 15:09:59 +0000 (15:09 +0000)]
sys/powerpc: further adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

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.

6 years agosys/i386: further adoption of SPDX licensing ID tags.
Pedro F. Giffuni [Mon, 27 Nov 2017 15:08:52 +0000 (15:08 +0000)]
sys/i386: further adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

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.

6 years agosys/mips: further adoption of SPDX licensing ID tags.
Pedro F. Giffuni [Mon, 27 Nov 2017 15:07:26 +0000 (15:07 +0000)]
sys/mips: further adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

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.

6 years agosys/arm: further adoption of SPDX licensing ID tags.
Pedro F. Giffuni [Mon, 27 Nov 2017 15:04:10 +0000 (15:04 +0000)]
sys/arm: further adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

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.

6 years agosys/amd64: further adoption of SPDX licensing ID tags.
Pedro F. Giffuni [Mon, 27 Nov 2017 15:03:07 +0000 (15:03 +0000)]
sys/amd64: further adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

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.

6 years agosys/sys: further adoption of SPDX licensing ID tags.
Pedro F. Giffuni [Mon, 27 Nov 2017 15:01:59 +0000 (15:01 +0000)]
sys/sys: further adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

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.

6 years agosys/dev: further adoption of SPDX licensing ID tags.
Pedro F. Giffuni [Mon, 27 Nov 2017 14:52:40 +0000 (14:52 +0000)]
sys/dev: further adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

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.

6 years agoadd myself as ports committer, mentor jrm + swills
Dave Cottlehuber [Mon, 27 Nov 2017 14:13:30 +0000 (14:13 +0000)]
add myself as ports committer, mentor jrm + swills

Approved by: jrm
Differential Revision: https://reviews.freebsd.org/D13268

6 years agoAdd /etc/autofs/include_nis, a non-rewriting NIS map.
Edward Tomasz Napierala [Mon, 27 Nov 2017 12:50:26 +0000 (12:50 +0000)]
Add /etc/autofs/include_nis, a non-rewriting NIS map.

Submitted by: G. Paul Ziemba
Suggested by: asomers@
MFC after: 2 weeks
Sponsored by: DARPA, AFRL

6 years agoRename /etc/autofs/include_nis to /etc/autofs/include_nis_nullfs, to indicate
Edward Tomasz Napierala [Mon, 27 Nov 2017 12:46:18 +0000 (12:46 +0000)]
Rename /etc/autofs/include_nis to /etc/autofs/include_nis_nullfs, to indicate
that this script provides nullfs map rewriting for local mounts.

MFC after: 2 weeks
Sponsored by: DARPA, AFRL

6 years agoChange formatting; no functional changes.
Edward Tomasz Napierala [Mon, 27 Nov 2017 12:44:03 +0000 (12:44 +0000)]
Change formatting; no functional changes.

MFC after: 2 weeks
Sponsored by: DARPA, AFRL

6 years agoUpdate intro(6) - remove hint that doesn't work, add explicit list
Edward Tomasz Napierala [Mon, 27 Nov 2017 12:39:35 +0000 (12:39 +0000)]
Update intro(6) - remove hint that doesn't work, add explicit list
of games instead, and mention the "bsdgames" port.

Reviewed by: bcr@
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D13196

6 years ago.Xr pmcstat(8) from kgmon(8) and gprof(1).
Edward Tomasz Napierala [Mon, 27 Nov 2017 12:37:14 +0000 (12:37 +0000)]
.Xr pmcstat(8) from kgmon(8) and gprof(1).

MFC after: 2 weeks
Sponsored by: DARPA, AFRL

6 years agoRevert r326125.
Edward Tomasz Napierala [Mon, 27 Nov 2017 12:34:23 +0000 (12:34 +0000)]
Revert r326125.

It turns out kgmon(8) still works, and provides some functionality that's
not provided by pmcstat(8).

Reported by: bde@
MFC after: 2 weeks
Sponsored by: DARPA, AFRL

6 years agoTruncate negative lengths to zero
Poul-Henning Kamp [Mon, 27 Nov 2017 09:57:37 +0000 (09:57 +0000)]
Truncate negative lengths to zero

6 years agoFix another typo
Brad Davis [Mon, 27 Nov 2017 04:24:48 +0000 (04:24 +0000)]
Fix another typo

Pointy hat to: oshogbo

6 years agoDon't assign rs as we will assign it later.
Xin LI [Mon, 27 Nov 2017 04:15:03 +0000 (04:15 +0000)]
Don't assign rs as we will assign it later.

MFC after: 2 weeks

6 years agoFix handling -U. It does not take any arguments.
Brad Davis [Mon, 27 Nov 2017 02:28:40 +0000 (02:28 +0000)]
Fix handling -U. It does not take any arguments.

Approved by: will

6 years agorw: fix runlock_hard when new readers show up
Mateusz Guzik [Sun, 26 Nov 2017 21:10:47 +0000 (21:10 +0000)]
rw: fix runlock_hard when new readers show up

When waiters/writer spinner flags are set no new readers can show up unless
they already have a different rw rock read locked. The change in r326195 failed
to take that into account - in presence of new readers it would spin until
they all drain, which would be lead to trouble if e.g. they go off cpu and
can get scheduled because of this thread.

Reported by: pho

6 years agoSynchronize TLB1 mappings when created
Justin Hibbits [Sun, 26 Nov 2017 20:30:02 +0000 (20:30 +0000)]
Synchronize TLB1 mappings when created

This allows modules creating mappings to be loaded post-boot, after SMP has
started.  Without this, the TLB1 mappings can become unsynchronized and lead
to kernel page faults when accessed on the alternate CPUs.

MFC after: 3 weeks

6 years agoMove vm_phys_init_page() to vm_page.c.
Mark Johnston [Sun, 26 Nov 2017 19:17:55 +0000 (19:17 +0000)]
Move vm_phys_init_page() to vm_page.c.

Suggested by: kib
Reviewed by: alc, kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D13250

6 years agoRemove unneeded initializations from vm_phys_init_page().
Mark Johnston [Sun, 26 Nov 2017 19:16:45 +0000 (19:16 +0000)]
Remove unneeded initializations from vm_phys_init_page().

The page allocator always initializes the aflags and oflags fields.

Reviewed by: alc, kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D13242

6 years agoAdd to ipfw support for sending an SCTP packet containing an ABORT chunk.
Michael Tuexen [Sun, 26 Nov 2017 18:19:01 +0000 (18:19 +0000)]
Add to ipfw support for sending an SCTP packet containing an ABORT chunk.
This is similar to the TCP case. where a TCP RST segment can be sent.

There is one limitation: When sending an ABORT in response to an incoming
packet, it should be tested if there is no ABORT chunk in the received
packet. Currently, it is only checked if the first chunk is an ABORT
chunk to avoid parsing the whole packet, which could result in a DOS attack.

Thanks to Timo Voelker for helping me to test this patch.
Reviewed by: bcr@ (man page part), ae@ (generic, non-SCTP part)
Differential Revision: https://reviews.freebsd.org/D13239

6 years agoAddd work around for LLVM bug 35023.
Michal Meloun [Sun, 26 Nov 2017 16:41:30 +0000 (16:41 +0000)]
Addd work around for LLVM bug 35023.

Clang crashes when compiling zstd_compress.c with optimization for ARM targets.
https://bugs.llvm.org/show_bug.cgi?id=35023

6 years agoAdd efidp_format_device_path_node to format a single node in a device
Warner Losh [Sun, 26 Nov 2017 16:12:10 +0000 (16:12 +0000)]
Add efidp_format_device_path_node to format a single node in a device
path, much like efidp_format_device_path will format the entire path.

Sponsored by: Netflix

6 years agoAdd a Saved Process Status Register bit for AArch32 execution mode.
Ed Schouten [Sun, 26 Nov 2017 14:56:23 +0000 (14:56 +0000)]
Add a Saved Process Status Register bit for AArch32 execution mode.

The documentation on the Saved Process Status Register (SPSR) is a bit
weird; the M[4] bit is documented separately from M[3:0]. The M[4] bit
can be toggled to switch to 32-bit execution mode. This functionality is
orthogonal to M[3:0].

Change the definition of PSR_M_MASK to no longer include M[4]. Add a new
definition, PSR_AARCH32 that can be used to toggle 32-bit independently.
This bit will be used by the cloudabi32 code to force execution of
userspace code in 32-bit mode.

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

6 years agoCorrect some more places where TO_PTR() should be used.
Ed Schouten [Sun, 26 Nov 2017 14:53:56 +0000 (14:53 +0000)]
Correct some more places where TO_PTR() should be used.

These were missed in r326228.

MFC after: 2 weeks

6 years agoUse TO_PTR() to convert integers to pointers.
Ed Schouten [Sun, 26 Nov 2017 14:45:56 +0000 (14:45 +0000)]
Use TO_PTR() to convert integers to pointers.

For FreeBSD/arm64's cloudabi32 support, I'm going to need a TO_PTR() in
this place. Also use it for all of the other source files, so that the
difference remains as minimal as possible.

MFC after: 2 weeks

6 years agoMake 32-bit system calls end up in svc_handler().
Ed Schouten [Sun, 26 Nov 2017 14:28:27 +0000 (14:28 +0000)]
Make 32-bit system calls end up in svc_handler().

The nice thing about ARM64 is that it's pretty elegant to install
separate trap/exception handlers for 32-bit and 64-bit processes. That
said, for all other architectures (e.g., i386 on amd64) we always let
32-bit counterparts go through the regular system call codepath. Let's
do the same on ARM64.

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

6 years agoImprove sysctl(8) pretty printing of some structures.
Konstantin Belousov [Sun, 26 Nov 2017 10:02:43 +0000 (10:02 +0000)]
Improve sysctl(8) pretty printing of some structures.

S_vmtotal:
Use unsigned format to print unsigned memory counters from struct
vmtotal.
Remove unneeded cast, style locals declarations.

S_efi_map:
Make printing of the memory regions descriptions less MD by
using uintmax_t formats.

Noted by and discussed with: bde
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agoMake the arm64 pmap_invalidate functions static inline. This fixes building
Andrew Turner [Sun, 26 Nov 2017 09:29:34 +0000 (09:29 +0000)]
Make the arm64 pmap_invalidate functions static inline. This fixes building
with DIAGNOSTIC.

PR: 223874
Reported by: emaste
MFC after: 1 week

6 years agoFix spelling error (probably typo).
Cy Schubert [Sun, 26 Nov 2017 06:31:34 +0000 (06:31 +0000)]
Fix spelling error (probably typo).

6 years agoFill in date.
Xin LI [Sun, 26 Nov 2017 04:55:23 +0000 (04:55 +0000)]
Fill in date.

6 years agoRemove another extern int n_slbs made redundant by declaring this in
Nathan Whitehorn [Sun, 26 Nov 2017 04:34:13 +0000 (04:34 +0000)]
Remove another extern int n_slbs made redundant by declaring this in
mmu_oea64.h.

MFC after: 3 weeks

6 years agoUse the cookie now set by loader to determine whether the value passed to
Nathan Whitehorn [Sun, 26 Nov 2017 03:53:20 +0000 (03:53 +0000)]
Use the cookie now set by loader to determine whether the value passed to
PowerPC kernels in r6 is actually metadata from loader(8) or gibberish
left in r6, which is not required to be anything under the
PAPR/ePAPR/CHRP/OF standards, by another boot loader.

Note that, as a result, systems need a new boot loader to boot PPC kernels
after this revision without ending up at a mountroot prompt. New boot
loaders are backwards compatible and can boot older kernels.

Reviewed by: jhibbits
MFC after: 2 months

6 years agolib: further adoption of SPDX licensing ID tags.
Pedro F. Giffuni [Sun, 26 Nov 2017 02:00:33 +0000 (02:00 +0000)]
lib: further adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 2-Clause license, however the tool I
was using mis-identified many licenses so this was mostly a manual - error
prone - task.

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.

6 years agoRemove some, but not all, assumptions that the BSP is CPU 0 and that CPUs
Nathan Whitehorn [Sat, 25 Nov 2017 23:41:05 +0000 (23:41 +0000)]
Remove some, but not all, assumptions that the BSP is CPU 0 and that CPUs
are numbered densely from there to n_cpus.

MFC after: 1 month

6 years agoAvoid assumptions about the BSP being CPU 0.
Nathan Whitehorn [Sat, 25 Nov 2017 23:23:24 +0000 (23:23 +0000)]
Avoid assumptions about the BSP being CPU 0.

MFC after: 3 weeks

6 years agoOn AIM systems, it is not actually possible to stop the CPU timer, so we
Nathan Whitehorn [Sat, 25 Nov 2017 22:43:52 +0000 (22:43 +0000)]
On AIM systems, it is not actually possible to stop the CPU timer, so we
just set it to a large default value (and inherit any previously existing
value), hoping it never turns over. Instead, silently allow spurious
one-shots from rollovers.

MFC after: 10 days

6 years agoReturn base IRQ of PIC when added and massively increase the number of
Nathan Whitehorn [Sat, 25 Nov 2017 22:42:05 +0000 (22:42 +0000)]
Return base IRQ of PIC when added and massively increase the number of
available IRQs per PIC for large systems.

MFC after: 3 weeks

6 years agoMissed gate on __powerpc64__ for setting LPCR in r326207.
Nathan Whitehorn [Sat, 25 Nov 2017 22:15:56 +0000 (22:15 +0000)]
Missed gate on __powerpc64__ for setting LPCR in r326207.

MFC after: 3 weeks
X-MFC-with: r326207

6 years agoWhen booting from an FDT, make sure the FDT itself isn't included the range
Nathan Whitehorn [Sat, 25 Nov 2017 22:14:30 +0000 (22:14 +0000)]
When booting from an FDT, make sure the FDT itself isn't included the range
of available memory. Boot loaders are supposed to add a reserved entry for
it, but not all do.

MFC after: 2 weeks

6 years agoAllow platform modules to set the size of large pizes, as potentially
Nathan Whitehorn [Sat, 25 Nov 2017 22:13:19 +0000 (22:13 +0000)]
Allow platform modules to set the size of large pizes, as potentially
discovered from firmware, and better handle highly-discontiguous memory
and CPU maps.

MFC after: 3 weeks

6 years agoInvalidate TLB at boot using the correct IS settings on newer-than-POWER5
Nathan Whitehorn [Sat, 25 Nov 2017 22:10:10 +0000 (22:10 +0000)]
Invalidate TLB at boot using the correct IS settings on newer-than-POWER5
CPUs.

MFC after: 3 weeks

6 years agoDefinitions for registers and trap types found on new POWER CPUs.
Nathan Whitehorn [Sat, 25 Nov 2017 22:08:40 +0000 (22:08 +0000)]
Definitions for registers and trap types found on new POWER CPUs.

MFC after: 3 weeks

6 years agoMissed platform_smp_timebase_sync() in r326205.
Nathan Whitehorn [Sat, 25 Nov 2017 22:06:40 +0000 (22:06 +0000)]
Missed platform_smp_timebase_sync() in r326205.

MFC after: 3 weeks
X-MFC-With: r326205

6 years agoMake n_slbs public in a more straightforward way. Some platforms (like
Nathan Whitehorn [Sat, 25 Nov 2017 22:05:05 +0000 (22:05 +0000)]
Make n_slbs public in a more straightforward way. Some platforms (like
PowerNV) use firmware-assisted mechanisms to discover it and need access
to the variable.

MFC after: 3 weeks

6 years agoPreserve the LPCR on new-ish (POWER7 and POWER8) CPUs, preventing exceptions
Nathan Whitehorn [Sat, 25 Nov 2017 22:03:25 +0000 (22:03 +0000)]
Preserve the LPCR on new-ish (POWER7 and POWER8) CPUs, preventing exceptions
and such from ending on the wrong CPU on SMP systems. It would be good to
have this be more generic somehow as POWER9s appear, but PPC does not
have features bits, unfortunately.

MFC after: 3 weeks

6 years agoYield while spinning on APs and avoid announcing all CPUs unless bootverbose
Nathan Whitehorn [Sat, 25 Nov 2017 22:01:55 +0000 (22:01 +0000)]
Yield while spinning on APs and avoid announcing all CPUs unless bootverbose
is set. These improve startup performance on massively multithreaded systems
with 8-way SMT and dozens to hundreds of CPUs.

MFC after: 3 weeks

6 years agoWhether you can use mttb() or not is more complicated than whether PSL_HV
Nathan Whitehorn [Sat, 25 Nov 2017 21:59:59 +0000 (21:59 +0000)]
Whether you can use mttb() or not is more complicated than whether PSL_HV
is set and the right thing to do may be platform-dependent (it requires
firmware on PowerNV, for instance). Make it a new platform method called
platform_smp_timebase_sync().

MFC after: 3 weeks

6 years agoDo not bind to CPUs with SMT, which use a different CPU numbering convention
Nathan Whitehorn [Sat, 25 Nov 2017 21:46:51 +0000 (21:46 +0000)]
Do not bind to CPUs with SMT, which use a different CPU numbering convention
that does not play well with this driver.

MFC after: 2 weeks

6 years agoAvoid emitting a PT_INTERP section for powerpc64 kernels and arrange for
Nathan Whitehorn [Sat, 25 Nov 2017 21:45:51 +0000 (21:45 +0000)]
Avoid emitting a PT_INTERP section for powerpc64 kernels and arrange for
the first instruction to be at the start of the text segment. This allows
the kernel to be booted correctly by stock kexec-lite.

MFC after: 2 weeks

6 years agoAutomatically use the ELFv2 ABI on powerpc64 if supported by the compiler.
Nathan Whitehorn [Sat, 25 Nov 2017 21:44:23 +0000 (21:44 +0000)]
Automatically use the ELFv2 ABI on powerpc64 if supported by the compiler.
This has the same effects on DDB working as -mcall=aixdesc, but also is
supported by clang and marginally improves kernel performance.

MFC after: 2 weeks

6 years agoAdd the missing lockstat check for thread lock.
Mateusz Guzik [Sat, 25 Nov 2017 20:49:27 +0000 (20:49 +0000)]
Add the missing lockstat check for thread lock.

6 years agoConvert in-kernel thread_lock_flags calls to thread_lock when debug is disabled
Mateusz Guzik [Sat, 25 Nov 2017 20:37:13 +0000 (20:37 +0000)]
Convert in-kernel thread_lock_flags calls to thread_lock when debug is disabled

The flags argument is not used in this case.

6 years agorwlock: fix up compilation of the previous change
Mateusz Guzik [Sat, 25 Nov 2017 20:25:45 +0000 (20:25 +0000)]
rwlock: fix up compilation of the previous change

commmitted wrong version of the patch

6 years agorwlock: add __rw_try_{r,w}lock_int
Mateusz Guzik [Sat, 25 Nov 2017 20:22:51 +0000 (20:22 +0000)]
rwlock: add __rw_try_{r,w}lock_int

6 years agosx: change sunlock to wake waiters up if it locked sleepq
Mateusz Guzik [Sat, 25 Nov 2017 20:13:50 +0000 (20:13 +0000)]
sx: change sunlock to wake waiters up if it locked sleepq

sleepq is only locked if the curhtread is the last reader. By the time
the lock gets acquired new ones could have arrived. The previous code
would unlock and loop back. This results spurious relocking of sleepq.

This is a step towards xadd-based unlock routine.

6 years agolocks: retry turnstile/sleepq loops on failed cmpset
Mateusz Guzik [Sat, 25 Nov 2017 20:10:33 +0000 (20:10 +0000)]
locks: retry turnstile/sleepq loops on failed cmpset

In order to go to sleep threads set waiter flags, but that can spuriously
fail e.g. when a new reader arrives. Instead of unlocking everything and
looping back, re-evaluate the new state while still holding the lock necessary
to go to sleep.

6 years agorwlock: stop re-reading the owner when going to sleep
Mateusz Guzik [Sat, 25 Nov 2017 20:08:11 +0000 (20:08 +0000)]
rwlock: stop re-reading the owner when going to sleep

6 years agolibc: further adoption of SPDX licensing ID tags.
Pedro F. Giffuni [Sat, 25 Nov 2017 17:12:48 +0000 (17:12 +0000)]
libc: further adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 2-Clause license, however the tool I
was using mis-identified many licenses so this was mostly a manual - error
prone - task.

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.

6 years agoinclude: General further adoption of SPDX licensing ID tags.
Pedro F. Giffuni [Sat, 25 Nov 2017 17:09:43 +0000 (17:09 +0000)]
include: General further adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 2-Clause license, however the tool I
was using mis-identified many licenses so this was mostly a manual - error
prone - task.

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.

6 years agoAllwinner a83t: enable USB support
Kyle Evans [Sat, 25 Nov 2017 16:46:35 +0000 (16:46 +0000)]
Allwinner a83t: enable USB support

Originally a patch by Mark Millard, augmented with information from work
done on NetBSD by jmcneill@.

Submitted by: Mark Millard (markmi@dsl-only.net)
Reviewed by: emaste, manu
Approved by: emaste (mentor)
Differential Revision: https://reviews.freebsd.org/D13240

6 years agoAdd r-ccu support for the Allwinner a83t
Kyle Evans [Sat, 25 Nov 2017 15:14:40 +0000 (15:14 +0000)]
Add r-ccu support for the Allwinner a83t

The r-ccu on the a83t differs from the others only by what it names the
ar100 parents. Export the _CCU macros (now converted to an enu) so that
ccu_sun8i_r can differentiate between a83t r-ccu and the others, then add
the compat string for the a83t r-ccu.

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

6 years agozdb: follow-up to r326150, check if malloc succeeded
Andriy Gapon [Sat, 25 Nov 2017 09:47:31 +0000 (09:47 +0000)]
zdb: follow-up to r326150, check if malloc succeeded

Reported by: rpokala
MFC after: 1 week
X-MFC with: r326150

6 years agoSlightly fix bidirectional stream number allocation.
Alexander Motin [Sat, 25 Nov 2017 09:42:14 +0000 (09:42 +0000)]
Slightly fix bidirectional stream number allocation.

This logic is still imperfect, since it allows at most 15 bidirectional
streams out of 30 allowed by specification, but at least now those should
work better.  On the other side I don't remember I ever saw controller
supporting the bidirectional streams, so this is likely a nop change.

MFC after: 1 month

6 years agoSet errno to EFTYPE instead of EINVAL to be more consistent with the
Xin LI [Sat, 25 Nov 2017 09:03:38 +0000 (09:03 +0000)]
Set errno to EFTYPE instead of EINVAL to be more consistent with the
rest of code.

MFC after: 1 month

6 years agoDecode kevent structures logged via ktrace(2) in kdump.
John Baldwin [Sat, 25 Nov 2017 04:49:12 +0000 (04:49 +0000)]
Decode kevent structures logged via ktrace(2) in kdump.

- Add a new KTR_STRUCT_ARRAY ktrace record type which dumps an array of
  structures.

  The structure name in the record payload is preceded by a size_t
  containing the size of the individual structures.  Use this to
  replace the previous code that dumped the kevent arrays dumped for
  kevent().  kdump is now able to decode the kevent structures rather
  than dumping their contents via a hexdump.

  One change from before is that the 'changes' and 'events' arrays are
  not marked with separate 'read' and 'write' annotations in kdump
  output.  Instead, the first array is the 'changes' array, and the
  second array (only present if kevent doesn't fail with an error) is
  the 'events' array.  For kevent(), empty arrays are denoted by an
  entry with an array containing zero entries rather than no record.

- Move kevent decoding tables from truss to libsysdecode.

  This adds three new functions to decode members of struct kevent:
  sysdecode_kevent_filter, sysdecode_kevent_flags, and
  sysdecode_kevent_fflags.

  kdump uses these helper functions to pretty-print kevent fields.

- Move structure definitions for freebsd11 and freebsd32 kevent
  structures to <sys/event.h> so that they can be shared with userland.
  The 32-bit structures are only exposed if _WANT_KEVENT32 is defined.
  The freebsd11 structures are only exposed if _WANT_FREEBSD11_KEVENT is
  defined.  The 32-bit freebsd11 structure requires both.

- Decode freebsd11 kevent structures in truss for the compat11.kevent()
  system call.

- Log 32-bit kevent structures via ktrace for 32-bit compat kevent()
  system calls.

- While here, constify the 'void *data' argument to ktrstruct().

Reviewed by: kib (earlier version)
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D12470

6 years agoAdd stdio.h to the synopsis for sysdecode functions that take a FILE *.
John Baldwin [Sat, 25 Nov 2017 03:59:36 +0000 (03:59 +0000)]
Add stdio.h to the synopsis for sysdecode functions that take a FILE *.

6 years agoModify all FreeBSD bootloaders on PowerPC AIM (Book-S) systems to pass a
Nathan Whitehorn [Fri, 24 Nov 2017 23:41:04 +0000 (23:41 +0000)]
Modify all FreeBSD bootloaders on PowerPC AIM (Book-S) systems to pass a
magic number to the kernel in r7 rather than the (currently unused and
irrelevant) width of the metadata pointer, which I believe was intended
for a never-used approach to the 64-bit port. This enables the kernel,
in a future commit, to switch on the cookie to distinguish a real
metadata pointer from loader(8) from garbage left in r6 by some other
boot loader.

MFC after: 3 weeks

6 years agoCompile one of the uctf test programs with -m32.
Mark Johnston [Fri, 24 Nov 2017 19:57:13 +0000 (19:57 +0000)]
Compile one of the uctf test programs with -m32.

The err.user64mode.ksh test expects it to run as a 32-bit process.

MFC after: 1 week