]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agoPort cloudabi32.ko to FreeBSD/arm64.
Ed Schouten [Thu, 30 Nov 2017 17:58:48 +0000 (17:58 +0000)]
Port cloudabi32.ko to FreeBSD/arm64.

This change adds an implementation of a sysent for running CloudABI
armv6 and armv7 binaries on FreeBSD/arm64. It is a somewhat literal copy
of the armv6 version, except that it's been patched up to use the proper
registers.

Just like for cloudabi32.ko on FreeBSD/amd64, we make use of a vDSO that
automatically pads system call parameters to 64-bit value. These are
stored in a buffer on the stack, meaning we need to use copyin() and
copyout() unconditionally.

6 years agoSPDX: oops .. not from CMU.
Pedro F. Giffuni [Thu, 30 Nov 2017 15:58:38 +0000 (15:58 +0000)]
SPDX: oops .. not from CMU.

6 years agoSPDX: Consider code from Carnegie-Mellon University.
Pedro F. Giffuni [Thu, 30 Nov 2017 15:48:35 +0000 (15:48 +0000)]
SPDX: Consider code from Carnegie-Mellon University.

Interesting cases, most likely from CMU Mach sources.

6 years agoSPDX: wrong license.
Pedro F. Giffuni [Thu, 30 Nov 2017 15:45:42 +0000 (15:45 +0000)]
SPDX: wrong license.

6 years agoFix assertion when ZFS fails to open certain devices
Alan Somers [Thu, 30 Nov 2017 15:36:06 +0000 (15:36 +0000)]
Fix assertion when ZFS fails to open certain devices

"panic: vdev_geom_close_locked: cp->private is NULL"
This panic will result if ZFS fails to open a device due to either of the
following reasons:

1) The device's sector size is greater than 8KB.
2) ZFS wants to open the device RW, but it can't be opened for writing.

The solution is to change the initialization order to ensure that the
assertion will be satisfied.

PR: 221066
Reported by: David NewHamlet <wheelcomplex@gmail.com>
Reviewed by: avg
MFC after: 3 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D13278

6 years agoRevert r326399
Alan Somers [Thu, 30 Nov 2017 15:34:55 +0000 (15:34 +0000)]
Revert r326399

Accidentally committed wrong file

Pointy hat to: asomers
Sponsored by: Spectra Logic Corp

6 years agoFix assertion when ZFS fails to open certain devices
Alan Somers [Thu, 30 Nov 2017 15:28:29 +0000 (15:28 +0000)]
Fix assertion when ZFS fails to open certain devices

"panic: vdev_geom_close_locked: cp->private is NULL"
This panic will result if ZFS fails to open a device due to either of the
following reasons:

1) The device's sector size is greater than 8KB.
2) ZFS wants to open the device RW, but it can't be opened for writing.

The solution is to change the initialization order to ensure that the
assertion will be satisfied.

PR: 221066
Reported by: David NewHamlet <wheelcomplex@gmail.com>
Reviewed by: avg
MFC after: 3 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D13278

6 years agoSPDX: Fix some cases wrongly attributed to MIT.
Pedro F. Giffuni [Thu, 30 Nov 2017 15:10:11 +0000 (15:10 +0000)]
SPDX: Fix some cases wrongly attributed to MIT.

In the cases of BSD-style license variants without clauses, use 0BSD for
the time being in lack of a better description.

6 years agor326394 is calling malloc with M_WAITOK under a lock, revert for now
Emmanuel Vadot [Thu, 30 Nov 2017 14:06:54 +0000 (14:06 +0000)]
r326394 is calling malloc with M_WAITOK under a lock, revert for now

Reported by: andrew

6 years agodevfs: Avoid a malloc/free if we just need to increment the refcount
Emmanuel Vadot [Thu, 30 Nov 2017 12:38:42 +0000 (12:38 +0000)]
devfs: Avoid a malloc/free if we just need to increment the refcount

MFC after: 1 week
Sponsored by: Gandi.net

6 years agoMake the ddb(4) "set" command list variables when called without parameters.
Edward Tomasz Napierala [Thu, 30 Nov 2017 12:22:15 +0000 (12:22 +0000)]
Make the ddb(4) "set" command list variables when called without parameters.

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

6 years agoProperly define the VLAN_XXX() function macros to avoid miscompilation when
Hans Petter Selasky [Thu, 30 Nov 2017 11:35:22 +0000 (11:35 +0000)]
Properly define the VLAN_XXX() function macros to avoid miscompilation when
used inside "if" statements comparing with another value.

Detailed explanation:
"if (a ? b : c != 0)" is not the same like "if ((a ? b : c) != 0)"
which is the expected behaviour of a function macro.

Affects:
toecore, linuxkpi and ibcore.

Reviewed by: kib
MFC after: 3 days
Sponsored by: Mellanox Technologies

6 years agoPrevent OOB access on corrupted msdos directories.
Xin LI [Thu, 30 Nov 2017 08:28:17 +0000 (08:28 +0000)]
Prevent OOB access on corrupted msdos directories.

Submitted by: Veo Zhang <veo live com>
MFC after: 2 weeks

6 years agoUpdate man page for r325354.
Fabien Thomas [Thu, 30 Nov 2017 08:28:04 +0000 (08:28 +0000)]
Update man page for r325354.

Reported by: bjk

6 years agoFinish cleaning up license :\
Eitan Adler [Thu, 30 Nov 2017 08:23:40 +0000 (08:23 +0000)]
Finish cleaning up license :\

6 years agoFix typo
Eitan Adler [Thu, 30 Nov 2017 07:24:33 +0000 (07:24 +0000)]
Fix typo

Reported by: mjg, zrj@dragonflybsd.org

6 years agoFix pthread_condattr(3) type
Eitan Adler [Thu, 30 Nov 2017 07:15:32 +0000 (07:15 +0000)]
Fix pthread_condattr(3) type

Reported by: Sascha Wildner <swildner@dragonflybsd.org>
Reviewed by: mjg

6 years agoRemove advertising clause from pr(1)
Eitan Adler [Thu, 30 Nov 2017 07:08:45 +0000 (07:08 +0000)]
Remove advertising clause from pr(1)

Permitted by https://www.freebsd.org/copyright/license.html
Renumber 4->3 to be consistent with other files

6 years agoUse const pointers to avoid casting away constness.
Warner Losh [Thu, 30 Nov 2017 05:01:56 +0000 (05:01 +0000)]
Use const pointers to avoid casting away constness.

The host_open interface was a legitimate mismatch to the userboot
function, while the other pointers didn't need to be non-const.

This makes the powerpc warning free again.

Sponsored by: Netflix

6 years agoAdd a tunable "debug.hwpstate_verify" to check P-state after changing it and
Jung-uk Kim [Thu, 30 Nov 2017 01:40:07 +0000 (01:40 +0000)]
Add a tunable "debug.hwpstate_verify" to check P-state after changing it and
turn it off by default.  It is very inefficient to verify current P-state of
each core, especially for CPUs with many cores.  When multiple commands are
requested to the same power domain before completion of pending transitions,
the last command is executed according to the manual.  Because requests are
serialized by the caller, all cores will receive the same command for each
call.  Do not call sched_bind() and sched_unbind().  It is redundant because
the caller does it anyway.

6 years agoFix style(9).
Jung-uk Kim [Wed, 29 Nov 2017 23:52:31 +0000 (23:52 +0000)]
Fix style(9).

6 years agoIt's time to retire AHC_REG_PRETTY_PRINT and AHD_REG_PRETTY_PRINT from
Scott Long [Wed, 29 Nov 2017 23:41:49 +0000 (23:41 +0000)]
It's time to retire AHC_REG_PRETTY_PRINT and AHD_REG_PRETTY_PRINT from
the standard kernels.  They are still available as custom compile
options.

6 years agoThe sched_add() function is not only used when the thread is initially
Hans Petter Selasky [Wed, 29 Nov 2017 23:28:40 +0000 (23:28 +0000)]
The sched_add() function is not only used when the thread is initially
started, but also by the turnstiles to mark a thread as runnable for
all locks, for instance sleepqueues do:
setrunnable()->sched_wakeup()->sched_add()

In r326218 code was added to allow booting from non-zero CPU numbers
by setting the ts_cpu field inside the ULE scheduler's sched_add()
function. This had an undesired side-effect that prior sched_pin() and
sched_bind() calls got disregarded. This patch fixes the
initialization of the ts_cpu field for the ULE scheduler to only
happen once when the initial thread is constructed during system
init. Forking will then later on ensure that a valid ts_cpu value gets
copied to all children.

Reviewed by: jhb, kib
Discussed with: nwhitehorn
MFC after: 1 month
Differential revision: https://reviews.freebsd.org/D13298
Sponsored by: Mellanox Technologies

6 years agoDon't fail the build due to clang integer constant range warnings
Alex Richardson [Wed, 29 Nov 2017 21:16:14 +0000 (21:16 +0000)]
Don't fail the build due to clang integer constant range warnings

This warning checks whether a constant is out of range of the integer
type. An example is `comparison of 'u_int' > 4294967295 is always false`
and in this case the warning makes sense.
However, when the type is a typedef that can be either 64 or 32 bits the
if condition is only tautological in some configurations so this should
not be a warning that fails the build.

Reviewed by: dim
Approved by: jhb (mentor)
Differential Revision: https://reviews.freebsd.org/D12912

6 years agoVerify the object/vnode association after vget() in vm_pageout_clean().
Mark Johnston [Wed, 29 Nov 2017 19:47:09 +0000 (19:47 +0000)]
Verify the object/vnode association after vget() in vm_pageout_clean().

It's theoretically possible for the vnode and object to be disassociated
while locks are dropped around the vget() call, in which case we
shouldn't proceed with laundering.

Noted and reviewed by: kib
MFC after: 1 week

6 years agoFix comment introduced in r326369
Stephen Hurd [Wed, 29 Nov 2017 18:21:17 +0000 (18:21 +0000)]
Fix comment introduced in r326369

The code uses the set of all CPUs, it doesn't zero out the set.

Sponsored by: Limelight Networks

6 years agoEnsure that ctx->ifc_cpus is always initialized
Stephen Hurd [Wed, 29 Nov 2017 18:14:57 +0000 (18:14 +0000)]
Ensure that ctx->ifc_cpus is always initialized

If a device didn't support MSI-X, ctx->ifc_cpus would not be initialized,
but the IRQ allocation routines still uses the value.  Move the
initialization to common code.

Sponsored by: Limelight Networks

6 years agoRemove some comments that became incorrect with r325530.
Mark Johnston [Wed, 29 Nov 2017 14:34:05 +0000 (14:34 +0000)]
Remove some comments that became incorrect with r325530.

6 years agoFix several noticed style issues.
Alexey Dokuchaev [Wed, 29 Nov 2017 12:49:22 +0000 (12:49 +0000)]
Fix several noticed style issues.

Reviewed by: bde
Approved by: bapt

6 years agoImplement hardware mlx5(4) rx timestamps.
Konstantin Belousov [Wed, 29 Nov 2017 10:04:11 +0000 (10:04 +0000)]
Implement hardware mlx5(4) rx timestamps.

Driver support is only provided for ConnectX4/5.

System-time timestamp is calculated based on the free-running counter
timestamp provided by hardware.  Driver periodically samples the
counter to calibrate it against the system clock and uses linear
interpolation to convert.  Stability of the crystal which drives the
clock is +-50 ppm at the operational temperature, which makes the
algorithm good enough.

The calculation is somewhat delicate because all values are 64bit and
overflow the naive formula for linear interpolation.  The calculation
drops the least significant bits in advance, see the PREC shift in
mlx5_mbuf_tstmp().

Hardware stamps can be turned off by 'ifconfig mceN -hwrxtsmp'.  Buggy
firmware might result in small but visible errors in the reported
timestamps, detectable e.g. by nonsensical (negative) RTT values for
LAN pings.

Reviewed by: gallatin, hselasky
Sponsored by: Mellanox Technologies
Differential revision: https://reviews.freebsd.org/D12638

6 years agoDisallow TUN and TAP character device IOCTLs to modify the network device
Hans Petter Selasky [Wed, 29 Nov 2017 09:40:11 +0000 (09:40 +0000)]
Disallow TUN and TAP character device IOCTLs to modify the network device
type to any value. This can cause page faults and panics due to accessing
uninitialized fields in the "struct ifnet" which are specific to the network
device type.

MFC after: 1 week
Found by: jau@iki.fi
PR: 223767
Sponsored by: Mellanox Technologies

6 years agoRemove unused include.
Xin LI [Wed, 29 Nov 2017 09:18:24 +0000 (09:18 +0000)]
Remove unused include.

MFC after: 2 weeks

6 years agoReplace a reference to a license in another file with the license text.
John Baldwin [Wed, 29 Nov 2017 05:07:54 +0000 (05:07 +0000)]
Replace a reference to a license in another file with the license text.

The relevant file was recently renamed, so the reference was stale.
In addition, explicit licenses are more typical in our sources.

6 years agoOnly check the page tables if within the KVA.
Justin Hibbits [Wed, 29 Nov 2017 01:26:07 +0000 (01:26 +0000)]
Only check the page tables if within the KVA.

Devices aren't mapped within the KVA, and with the way 64-bit hashes the
addresses pte_vatopa() may not return a 0 physical address for a device.

MFC after: 1 week

6 years agoImport lua 5.3.4 to contrib
Warner Losh [Wed, 29 Nov 2017 00:46:36 +0000 (00:46 +0000)]
Import lua 5.3.4 to contrib

6 years agoEliminate kmem_arena and kmem_object in preparation for further NUMA commits.
Jeff Roberson [Tue, 28 Nov 2017 23:40:54 +0000 (23:40 +0000)]
Eliminate kmem_arena and kmem_object in preparation for further NUMA commits.

The arena argument to kmem_*() is now only used in an assert.  A follow-up
commit will remove the argument altogether before we freeze the API for the
next release.

This replaces the hard limit on kmem size with a soft limit imposed by UMA.  When
the soft limit is exceeded we periodically wakeup the UMA reclaim thread to
attempt to shrink KVA.  On 32bit architectures this should behave much more
gracefully as we exhaust KVA.  On 64bit the limits are likely never hit.

Reviewed by: markj, kib (some objections)
Discussed with: alc
Tested by: pho
Sponsored by: Netflix / Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D13187

6 years agoMove domain iterators into the page layer where domain selection should take
Jeff Roberson [Tue, 28 Nov 2017 23:18:35 +0000 (23:18 +0000)]
Move domain iterators into the page layer where domain selection should take
place.  This makes the majority of the phys layer explicitly domain specific.

Reviewed by: markj, kib (some objections)
Discussed with: alc
Tested by: pho
Sponsored by: Netflix & Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D13014

6 years agoImport Lua 3.5.4
Warner Losh [Tue, 28 Nov 2017 22:55:31 +0000 (22:55 +0000)]
Import Lua 3.5.4

Downloaded from https://www.lua.org/ftp/lua-5.3.4.tar.gz

6 years agoFix fetching ntp leapfile after 325256
Alan Somers [Tue, 28 Nov 2017 20:44:10 +0000 (20:44 +0000)]
Fix fetching ntp leapfile after 325256

Submitted by: Ronald Klop <ronald-lists@klop.ws>
Reviewed by: asomers
MFC after: 3 days
X-MFC-With: 325256

6 years agoFix fabs() for MIPS when used on -0.0
Alex Richardson [Tue, 28 Nov 2017 20:37:27 +0000 (20:37 +0000)]
Fix fabs() for MIPS when used on -0.0

It would previously return negative zero for -0.0 since -0.0 does not
compare less than 0. The issue was discovered when running the libc++
test suite on softfloat MIPS64.

I have verified that both clang and GCC generate sensible code for the
builtin. For soft float they clear the sign bit using integer operations
and in hard float mode they use abs.d.

Reviewed by: #mips, jhb, brooks, imp, emaste
Approved by: jhb (mentor)
Differential Revision: https://reviews.freebsd.org/D13135

6 years agoRevert r325558 as it is incorrect.
Gleb Smirnoff [Tue, 28 Nov 2017 19:25:01 +0000 (19:25 +0000)]
Revert r325558 as it is incorrect.

6 years agoFix obvious NULL pointer dereference from r310350.
Gleb Smirnoff [Tue, 28 Nov 2017 19:18:00 +0000 (19:18 +0000)]
Fix obvious NULL pointer dereference from r310350.

6 years agoDisable vim syntax highlighting.
Brooks Davis [Tue, 28 Nov 2017 18:23:17 +0000 (18:23 +0000)]
Disable vim syntax highlighting.

Vim's default pick doesn't understand that ';' is a comment character
and the result looks horrible.

Reviewed by: emaste

6 years agoCorrect a comment after r326330.
Glen Barber [Tue, 28 Nov 2017 18:08:14 +0000 (18:08 +0000)]
Correct a comment after r326330.

MFC after: 3 days
MFC with: r326330
Sponsored by: The FreeBSD Foundation

6 years agoAdd a comment to release/release.conf.sample documenting
Glen Barber [Tue, 28 Nov 2017 18:02:58 +0000 (18:02 +0000)]
Add a comment to release/release.conf.sample documenting
EMBEDDEDPORTS. [1]

Remove and update stale documentation from release(7) while here.

PR: 206344 [1]
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

6 years agoWhen the swap pager allocates space on disk, it requests contiguous
Alan Cox [Tue, 28 Nov 2017 17:46:03 +0000 (17:46 +0000)]
When the swap pager allocates space on disk, it requests contiguous
blocks in a single call to blist_alloc().  However, when it frees
that space, it previously called blist_free() on each block, one at a
time.  With this change, the swap pager identifies ranges of
contiguous blocks to be freed, and calls blist_free() once per
range.  In one extreme case, that is described in the review, the time
to perform an munmap(2) was reduced by 55%.

Submitted by: Doug Moore <dougm@rice.edu>
Reviewed by: kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D12397

6 years agoFix the direction we move the instruction to retuirn to after exiting the
Andrew Turner [Tue, 28 Nov 2017 16:26:56 +0000 (16:26 +0000)]
Fix the direction we move the instruction to retuirn to after exiting the
kernel debugger. We should skip the breakpoint instruction, not execute the
instruction before it.

Pointy-hat to: andrew
MFC after: 1 week
Sponsored by: DARPA, AFRL

6 years agoSync bsd_to_linux_errno[] table with i386 and amd64 tables in the sys directory.
Fedor Uporov [Tue, 28 Nov 2017 16:25:46 +0000 (16:25 +0000)]
Sync bsd_to_linux_errno[] table with i386 and amd64 tables in the sys directory.
Additional fix for r326282.

MFC after: 1 week
Approved by: pfg

6 years agoSet DISTDIR and WRKDIRPREFIX when building ports within the
Glen Barber [Tue, 28 Nov 2017 16:00:27 +0000 (16:00 +0000)]
Set DISTDIR and WRKDIRPREFIX when building ports within the
chroot(8) to avoid mtime changes within the ports checkout,
which can cause checksum differences.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

6 years agoMake kdb_reenter() silent when explicitly called from db_error().
Edward Tomasz Napierala [Tue, 28 Nov 2017 12:53:55 +0000 (12:53 +0000)]
Make kdb_reenter() silent when explicitly called from db_error().
This removes the useless backtrace on various ddb(4) user errors.

Reviewed by: jhb@
Obtained from: CheriBSD
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D13212

6 years agoWhen we exit the kernel debugger having entered because of a breakpoint
Andrew Turner [Tue, 28 Nov 2017 11:04:47 +0000 (11:04 +0000)]
When we exit the kernel debugger having entered because of a breakpoint
instruction we need to jump over the instruction. Without this we will
execute the same instruction again and enter into the debugger again.

PR: 223917
Reported by: emaste
MFC after: 1 week
Sponsored by: DARPA, AFRL

6 years agoFix index calculation for the page table pages for efirt 1:1 map.
Konstantin Belousov [Tue, 28 Nov 2017 09:34:43 +0000 (09:34 +0000)]
Fix index calculation for the page table pages for efirt 1:1 map.

Stop issuing pre-assigned number to enumerate all page table pages,
the assignment is incorrect.  Instead automatically calculate the next
unused index. This index in fact does not serve any purpose except to
be unique to satisfy vm_page_grab() interface, we do not look up the
page by the index later.

Reported and tested by: emaste
Reviewed by: andrew
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
PR: 223906
Differential revision: https://reviews.freebsd.org/D13273

6 years agoBack out OF module installation in the event of failure. PS3 firmware gives
Nathan Whitehorn [Tue, 28 Nov 2017 06:31:39 +0000 (06:31 +0000)]
Back out OF module installation in the event of failure. PS3 firmware gives
some ancient FDT version (2) that fails the init check in OFW_FDT. It is
still possible to make progress, but not while the OF layer is going crazy.

6 years agoCorrectly report the vmxnet3 link down media status
Bryan Venteicher [Tue, 28 Nov 2017 06:21:37 +0000 (06:21 +0000)]
Correctly report the vmxnet3 link down media status

Reported by: lew@perftech.com
MFC after: 1 week

6 years agoRemove assertion that a CPU be present before returning a PCPU for it. It
Nathan Whitehorn [Tue, 28 Nov 2017 05:39:48 +0000 (05:39 +0000)]
Remove assertion that a CPU be present before returning a PCPU for it. It
is up to the caller to check for a NULL return value. The assert was meant
to catch buggy code that did not check the return value. Some code, however,
was smart and used the return value to see if a CPU existed, which this
broke.

Requested by: jhb@

6 years agoUpdate vis(3) the latest from NetBSD.
Brooks Davis [Tue, 28 Nov 2017 01:35:28 +0000 (01:35 +0000)]
Update vis(3) the latest from NetBSD.

This adds VIS_DQ for compatiblity with OpenBSD.

Correct by an off-by-one error and a read buffer overflow detected using
asan.

MFC after: 1 day

6 years agosiba(4): Add support for devices have neither PMU nor PWRCTL support.
Landon J. Fuller [Tue, 28 Nov 2017 00:42:44 +0000 (00:42 +0000)]
siba(4): Add support for devices have neither PMU nor PWRCTL support.

Very early BHND Wi-Fi devices (e.g. BCM4318) do not support any form of
dynamic clock control; on these devices, any PMU requests that cannot be
met by the device's fixed clock state will return an appropriate error
code.

Approved by: adrian (mentor, implicit)
Sponsored by: The FreeBSD Foundation

6 years agobhndb(4): Implement bridge support for the BCM4312 and other PCI_V0 chipsets.
Landon J. Fuller [Tue, 28 Nov 2017 00:12:14 +0000 (00:12 +0000)]
bhndb(4): Implement bridge support for the BCM4312 and other PCI_V0 chipsets.

Very early (PCI_V0) Broadcom PCI Wi-Fi chipsets have a few quirks when
compared to later PCI(e) core revisions:

- The standard static BAR0 mapping of the PCI core registers is discontiguous,
  with siba's cfg0 register block mapped distinctly from the other core
  registers.
- No dedicated ChipCommon register mapping is provided; instead, the
  single configurable register window must be used to access both
  ChipCommon and D11 core registers. The D11 core's operational semantics
  guarantee the safety of -- after disabling interrupts -- borrowing
  the single dynamic register window to perform the few ChipCommon
  operations required by a driver.

To support these early PCI devices:

- Allow defining multiple discontiguous BHNDB_REGWIN_T_CORE register
  windows that map a single port/region, and producing bridged resource
  allocations backed by those discontiguous windows.
- Support stealing existing register window allocations to fulfill indirect
  bhnd(4) bus I/O requests within address ranges tagged with
  BHNDB_ALLOC_FULFILL_ON_OVERCOMMIT.
- Fix an inverted test of bhndb_is_pcie_attached() that disabled
  PCI-only clock bring-up required by these devices.

Approved by: adrian (mentor, implicit)
Sponsored by: The FreeBSD Foundation

6 years agoVendor import of NetBSD's (un)vis(3) at 2017-11-27
Brooks Davis [Mon, 27 Nov 2017 23:47:57 +0000 (23:47 +0000)]
Vendor import of NetBSD's (un)vis(3) at 2017-11-27

6 years agosiba(4): fix workaround for BCM4312 D11 core backplane timeouts
Landon J. Fuller [Mon, 27 Nov 2017 22:38:44 +0000 (22:38 +0000)]
siba(4): fix workaround for BCM4312 D11 core backplane timeouts

The SIBA_QUIRK_PCIE_D11_SB_TIMEOUT quirk should match on all BCM4312
revisions, and backplane service timeouts must also be disabled.

Approved by: adrian (mentor, implicit)
Sponsored by: The FreeBSD Foundation

6 years agobhnd(4): Print the core's hardware revision in bhnd(4)'s
Landon J. Fuller [Mon, 27 Nov 2017 22:29:35 +0000 (22:29 +0000)]
bhnd(4): Print the core's hardware revision in bhnd(4)'s
BUS_PROBE_NOMATCH().

Approved by: adrian (mentor, implicit)
Sponsored by: The FreeBSD Foundation

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