]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
4 years agoConnect the libucl(3) manual page to the build.
gjb [Wed, 9 Oct 2019 15:35:22 +0000 (15:35 +0000)]
Connect the libucl(3) manual page to the build.

MFC after: 3 days
Sponsored by: Rubicon Communications, LLC (Netgate)

4 years agoAdd CTLFLAG_STATS to the dev.ioat.N.stats sysctl OIDs
vangyzen [Wed, 9 Oct 2019 12:14:10 +0000 (12:14 +0000)]
Add CTLFLAG_STATS to the dev.ioat.N.stats sysctl OIDs

Refer to r353111.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

4 years agozfs: remove gratuitous divergence from other openzfs flavours
avg [Wed, 9 Oct 2019 11:57:45 +0000 (11:57 +0000)]
zfs: remove gratuitous divergence from other openzfs flavours

The divergence is a result of a local change in r344601 and a followup
fix in r352580 that reverted portions of the earlier change.

MFC after: 1 week

4 years agozfs: remove incorrect warning about boot support for large_dnode
avg [Wed, 9 Oct 2019 11:46:36 +0000 (11:46 +0000)]
zfs: remove incorrect warning about boot support for large_dnode

Fixes r353341

Reported by: tsoome
MFC after: 4 days
X-MFC with: r353341

4 years agozfs: document large_dnode feature
avg [Wed, 9 Oct 2019 11:34:16 +0000 (11:34 +0000)]
zfs: document large_dnode feature

The text is copied from illumos.
The conversion to mdoc is mine.
The FreeBSD boot warning is copied from large_block description.

MFC after: 4 days

4 years agocleanup of illumos compatibility atomics
avg [Wed, 9 Oct 2019 11:26:36 +0000 (11:26 +0000)]
cleanup of illumos compatibility atomics

atomic_cas_32 is implemented using atomic_fcmpset_32 on all platforms.
Ditto for atomic_cas_64 and atomic_fcmpset_64 on platforms that have it.
The only exception is sparc64 that provides MD atomic_cas_32 and
atomic_cas_64.
This is slightly inefficient as fcmpset reports whether the operation
updated the target and that information is not needed for cas.
Nevertheless, there is less code to maintain and to add for new platforms.
Also, the operations are done inline now as opposed to function calls before.

atomic_add_64_nv is implemented using atomic_fetchadd_64 on platforms
that provide it.

casptr, cas32, atomic_or_8, atomic_or_8_nv are completely removed as they
have no users.

atomic_mtx that is used to emulate 64-bit atomics on platforms that lack
them is defined only on those platforms.

As a result, platform specific opensolaris_atomic.S files have lost most of
their code.  The only exception is i386 where the compat+contrib code
provides 64-bit atomics for userland use.  That code assumes availability of
cmpxchg8b instruction.  FreeBSD does not have that assumption for i386
userland and does not provide 64-bit atomics.  Hopefully, this can and will
be fixed.

MFC after: 3 weeks

4 years agoRevert changes to rip6_bind() from r353292. This function is always
glebius [Wed, 9 Oct 2019 05:52:07 +0000 (05:52 +0000)]
Revert changes to rip6_bind() from r353292.  This function is always
called in syscall context, so it must enter epoch itself.  This
changeset originates from early version of the patch, and somehow
slipped to the final version.

Reported by: pho

4 years agobsdinstall: fix ESP detection for auto ZFS layout
yuripv [Wed, 9 Oct 2019 05:28:10 +0000 (05:28 +0000)]
bsdinstall: fix ESP detection for auto ZFS layout

Pass the list of user selected disks from zfsboot to bootconfig so that
the latter doesn't rely on ESP autodetection that apparently fails for
some cases, e.g. memstick installation with nvme (boot) and sata drives.

While here, fix printing of debug messages in bootconfig.

Reviewed by: bcran, imp, tsoome
Differential Revision: https://reviews.freebsd.org/D21930

4 years agoRISC-V: Fix an alignment warning in libthr
mhorne [Wed, 9 Oct 2019 02:02:22 +0000 (02:02 +0000)]
RISC-V: Fix an alignment warning in libthr

Compiling with clang gives a loss-of-alignment error due the cast to
uint8_t *. Since the TLS is always tcb aligned and TP_OFFSET is defined
as sizeof(struct tcb) we can guarantee there is no misalignment. Silence
the error by moving the offset into the inline assembly.

Reviewed by: br
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D21926

4 years agoFix a bug in r353332 that snuck in with a last-minute adjustment.
markj [Tue, 8 Oct 2019 23:52:04 +0000 (23:52 +0000)]
Fix a bug in r353332 that snuck in with a last-minute adjustment.

Reported by: Jenkins
MFC with: r353332
Sponsored by: The FreeBSD Foundation

4 years agoAdd a regression test for r353331.
markj [Tue, 8 Oct 2019 23:35:23 +0000 (23:35 +0000)]
Add a regression test for r353331.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

4 years agoFix handling of empty SCM_RIGHTS messages.
markj [Tue, 8 Oct 2019 23:34:48 +0000 (23:34 +0000)]
Fix handling of empty SCM_RIGHTS messages.

As unp_internalize() processes the input control messages, it builds
an output mbuf chain containing the internalized representations of
those messages.  In one special case, that of an empty SCM_RIGHTS
message, the message is simply discarded.  However, the loop which
appends mbufs to the output chain assumed that each iteration would
produce an mbuf, resulting in a null pointer dereference if an empty
SCM_RIGHTS message was followed by a non-empty message.

Fix this by advancing the output mbuf chain tail pointer only if an
internalized control message was produced.

Reported by: syzbot+1b5cced0f7fad26ae382@syzkaller.appspotmail.com
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

4 years agoAdd support for KTLS in the Chelsio TOE module.
jhb [Tue, 8 Oct 2019 21:40:42 +0000 (21:40 +0000)]
Add support for KTLS in the Chelsio TOE module.

This adds a TOE hook to allocate a KTLS session.  It also recognizes
TLS mbufs in the socket buffer and sends those to the NIC using a TLS
work request to encrypt the record before segmenting it.

TOE TLS support must be enabled via the dev.t6nex.<N>.tls sysctl in
addition to enabling KTLS.

Reviewed by: np, gallatin
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D21891

4 years agomsun: Silence new harmless -Wimplicit-int-float-conversion warnings
brooks [Tue, 8 Oct 2019 21:39:51 +0000 (21:39 +0000)]
msun: Silence new harmless -Wimplicit-int-float-conversion warnings

Clang from trunk recently added a warning for when implicit int-to-float
conversions cause a loss of precision. The code in question is designed
to be able to handle that, so add explicit casts to silence this.

Submitted by: James Clarke <jrtc27@jrtc27.com>
Reviewed by: dim
Obtained from: CheriBSD
MFC after: 1 week
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D21913

4 years agoAdd a TOE KTLS mode and a TOE hook for allocating TLS sessions.
jhb [Tue, 8 Oct 2019 21:34:06 +0000 (21:34 +0000)]
Add a TOE KTLS mode and a TOE hook for allocating TLS sessions.

This adds the glue to allocate TLS sessions and invokes it from
the TLS enable socket option handler.  This also adds some counters
for active TOE sessions.

The TOE KTLS mode is returned by getsockopt(TLSTX_TLS_MODE) when
TOE KTLS is in use on a socket, but cannot be set via setsockopt().

To simplify various checks, a TLS session now includes an explicit
'mode' member set to the value returned by TLSTX_TLS_MODE.  Various
places that used to check 'sw_encrypt' against NULL to determine
software vs ifnet (NIC) TLS now check 'mode' instead.

Reviewed by: np, gallatin
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D21891

4 years agoamd64: plug spurious cld instructions
mjg [Tue, 8 Oct 2019 21:14:11 +0000 (21:14 +0000)]
amd64: plug spurious cld instructions

ABI already guarantees the direction is forward. Note this does not take care
of i386-specific cld's.

Reviewed by: kib
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D21906

4 years agoFix various -Wpointer-compare warnings
brooks [Tue, 8 Oct 2019 21:14:09 +0000 (21:14 +0000)]
Fix various -Wpointer-compare warnings

This warning (comparing a pointer against a zero character literal
rather than NULL) has existed since GCC 7.1.0, and was recently added to
Clang trunk.

Almost all of these are harmless, except for fwcontrol's str2node, which
needs to both guard against dereferencing a NULL pointer (though in
practice it appears none of the callers will ever pass one in), as well
as ensure it doesn't parse the empty string as node 0 due to strtol's
awkward interface.

Submitted by: James Clarke <jtrc27@jrtc27.com>
Obtained from: CheriBSD
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D21914

4 years agoUpdate tcsh to 6.21.00.
brooks [Tue, 8 Oct 2019 20:59:31 +0000 (20:59 +0000)]
Update tcsh to 6.21.00.

This is a bugfix release with no new features.  A number of these fixes
were previously merged into our tree.

Sponsored by: DARPA, AFRL

4 years agoAllow -DNO_CLEAN build across r352689.
brooks [Tue, 8 Oct 2019 20:26:51 +0000 (20:26 +0000)]
Allow -DNO_CLEAN build across r352689.

Split the LIBCOMPAT case because the usual egrep only matches in
LIBCOMPAT on amd64.

4 years agoSet the FID field in lookaside crypto requests to the rx queue ID.
jhb [Tue, 8 Oct 2019 20:22:05 +0000 (20:22 +0000)]
Set the FID field in lookaside crypto requests to the rx queue ID.

The PCI block in the adapter requires this field to be set to a valid
queue ID.  It is not clear why it did not fail on all machines, but
the effect was that crypto operations reading input data via DMA
failed with an internal PCI read error on machines with 128G or more
of RAM.

Reported by: gallatin
Reviewed by: np
MFC after: 3 days
Sponsored by: Chelsio Communications

4 years agoFix regression issue after r352989:
hselasky [Tue, 8 Oct 2019 19:49:25 +0000 (19:49 +0000)]
Fix regression issue after r352989:

As noted by the commit message, callouts are now persistant
and should not be in the auto-zero section of the RQ's and SQ's.
This fixes an assert when using the TX completion event
factor feature with mlx5en(4).

Found by: gallatin@
MFC after: 3 days
Sponsored by: Mellanox Technologies

4 years agoRework the logic for installing the pkg(8) configuration.
gjb [Tue, 8 Oct 2019 18:58:23 +0000 (18:58 +0000)]
Rework the logic for installing the pkg(8) configuration.

'quarterly' package sets do not exist for head, so explicitly
install the 'latest' configuration file there.  Otherwise,
fall back to the original conditional evaluation to determine
if the 'latest' or 'quarterly' configuration file should be
installed.

Reported by: manu
Reviewed by: manu
MFC after: 3 days
Sponsored by: Rubicon Communications, LLC (Netgate)

4 years agoImport 6.21.00.
brooks [Tue, 8 Oct 2019 18:20:02 +0000 (18:20 +0000)]
Import 6.21.00.

4 years agoRemove epoch assertion from if_setlladdr(). Originally this function was
glebius [Tue, 8 Oct 2019 17:55:45 +0000 (17:55 +0000)]
Remove epoch assertion from if_setlladdr().  Originally this function was
protected by IF_ADDR_LOCK(), which was a mutex, so that two simultaneous
if_setlladdr() can't execute. Later it was switched to IF_ADDR_RLOCK(),
likely by a mistake. Later it was switched to NET_EPOCH_ENTER(). Then I
incorrectly added NET_EPOCH_ASSERT() here.

In reality ifp->if_addr never goes away and never changes its length. So,
doing bcopy() in it is always "safe", meaning it won't dereference a wrong
pointer or write into someone's else memory. Of course doing two bcopy() in
parallel would result in a mess of two addresses, but net epoch doesn't
protect against that, neither IF_ADDR_RLOCK() did.

So for now, just remove the assertion and leave for later a proper fix.

Reported by: markj

4 years agoQuickly plug another regression from r353292. Again, multicast locking needs
glebius [Tue, 8 Oct 2019 16:59:17 +0000 (16:59 +0000)]
Quickly plug another regression from r353292. Again, multicast locking needs
lots of work...

Reported by: pho

4 years agoIn DIAGNOSTIC block of if_delmulti_ifma_flags() enter the network epoch.
glebius [Tue, 8 Oct 2019 16:45:56 +0000 (16:45 +0000)]
In DIAGNOSTIC block of if_delmulti_ifma_flags() enter the network epoch.
This quickly plugs the regression from r353292. The locking of multicast
definitely needs a broader review today...

Reported by: pho, dhw

4 years agoSimplify pmap_page_array_startup() a bit.
markj [Tue, 8 Oct 2019 16:42:50 +0000 (16:42 +0000)]
Simplify pmap_page_array_startup() a bit.

No functional change intended.

Sponsored by: The FreeBSD Foundation

4 years agozfs: fix the zfsd_hotspare_007_pos test
asomers [Tue, 8 Oct 2019 15:48:28 +0000 (15:48 +0000)]
zfs: fix the zfsd_hotspare_007_pos test

It was trying to destroy the pool while zfsd was detaching the spare, and
"zpool destroy" failed.  Fix by waiting until the spare has fully detached.

MFC after: 2 weeks
Sponsored by: Axcient

4 years agozfs: fix the zfsd_autoreplace_003_pos test
asomers [Tue, 8 Oct 2019 15:33:11 +0000 (15:33 +0000)]
zfs: fix the zfsd_autoreplace_003_pos test

The test declared that it only needed 5 disks, but actually tried to use 6.
Fix it to use just 5, which is all it really needs.

MFC after: 2 weeks
Sponsored by: Axcient

4 years agoAvoid erroneously clearing PGA_WRITEABLE in riscv's pmap_enter().
markj [Tue, 8 Oct 2019 15:03:48 +0000 (15:03 +0000)]
Avoid erroneously clearing PGA_WRITEABLE in riscv's pmap_enter().

During a CoW fault, we must check for both 4KB and 2MB mappings before
clearing PGA_WRITEABLE on the old mapping's page.  Previously we were
only checking for 4KB mappings.  This was missed in r344106.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

4 years agoamd64 pmap: allocate pv table entries for gaps in PA
mjg [Tue, 8 Oct 2019 14:59:50 +0000 (14:59 +0000)]
amd64 pmap: allocate pv table entries for gaps in PA

This matches the state prior to r353149 and fixes crashes with DRM
modules.

Reported and tested by: cy, garga, Krasznai Andras
Fixes: r353149 ("amd64 pmap: implement per-superpage locks")
Sponsored by: The FreeBSD Foundation

4 years agoClear PGA_WRITEABLE in riscv's pmap_remove_l3().
markj [Tue, 8 Oct 2019 14:54:35 +0000 (14:54 +0000)]
Clear PGA_WRITEABLE in riscv's pmap_remove_l3().

pmap_remove_l3() may remove the last mapping of a page, in which case
it must clear PGA_WRITEABLE.

Reported by: Jenkins, via lwhsu
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

4 years agoFix problems in the kern_maxfiles__increase test
vangyzen [Tue, 8 Oct 2019 13:43:05 +0000 (13:43 +0000)]
Fix problems in the kern_maxfiles__increase test

ATF functions such as ATF_REQUIRE do not work correctly in child processes.
Use plain C functions to report errors instead.

In the parent, check for the untimely demise of children.  Without this,
the test hung until the framework's timeout.

Raise the resource limit on the number of open files.  If this was too low,
the test hit the two problems above.

Restore the kern.maxfiles sysctl OID in the cleanup function.
The body prematurely removed the symlink in which the old value was saved.

Make the test more robust by opening more files.  In fact, due to the
integer division by 4, this was necessary to make the test valid with
some initial values of maxfiles.  Thanks, asomers@.

wait() for children instead of sleeping.

Clean up a temporary file created by the test ("afile").

Reviewed by: asomers
MFC after: 1 week
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D21900

4 years agozfs: use atomic_load_64 to read atomic variable in dmu_object_alloc_impl
avg [Tue, 8 Oct 2019 11:27:48 +0000 (11:27 +0000)]
zfs: use atomic_load_64 to read atomic variable in dmu_object_alloc_impl

As long as we support ZFS on 32-bit platforms we should do this for all
64-bit variables that are modified in a lockless fashion using atomic
operations.  Otherwise, there is a risk of a reading a torn value.

Here is a rationale for why I am doing this in dmu_object_alloc_impl:
- it's very recent code
- the code deals with object IDs and a number of objects in a file
  system can overflow 32 bits
- incorrect allocation of an object ID may result in hard to debug
  problems
- fixing all plain reads of 64-bit atomic variables is not a trivial
  undertaking to do in one shot, so I chose to do it incrementally

MFC after: 3 weeks
X-MFC after: r353301, r353176

4 years agoValidate length before use it, not vice versa.
tuexen [Tue, 8 Oct 2019 11:07:16 +0000 (11:07 +0000)]
Validate length before use it, not vice versa.
r353060 should have contained this...
This fixes
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=18070
MFC after: 3 days

4 years agoFix regression issue after r353274:
hselasky [Tue, 8 Oct 2019 11:06:24 +0000 (11:06 +0000)]
Fix regression issue after r353274:

Make sure the vnet_shutdown field is not set until after all
VNET_SYSUNINIT()'s in the SI_SUB_VNET_DONE subsystem have been
executed. Especially the vnet_if_return() functions requires that
if_move() is still operational.

Reported by: lwhsu@
MFC after: 1 week
Sponsored by: Mellanox Technologies

4 years agoi386: hide more of atomic 64-bit definitions under _KERNEL
avg [Tue, 8 Oct 2019 10:50:16 +0000 (10:50 +0000)]
i386: hide more of atomic 64-bit definitions under _KERNEL

At the moment i386 does not provide 64-bit atomic operations in
userland.  Exposing some atomic_*_64 defines can cause unnecessary
confusion.

Discussed with: kib
MFC after: 2 weeks

4 years agoDefine macro VM_MAP_ENTRY_FOREACH for enumerating the entries in a vm_map.
dougm [Tue, 8 Oct 2019 07:14:21 +0000 (07:14 +0000)]
Define macro VM_MAP_ENTRY_FOREACH for enumerating the entries in a vm_map.
In case the implementation ever changes from using a chain of next pointers,
then changing the macro definition will be necessary, but changing all the
files that iterate over vm_map entries will not.

Drop a counter in vm_object.c that would have an effect only if the
vm_map entry count was wrong.

Discussed with: alc
Reviewed by: markj
Tested by: pho (earlier version)
Differential Revision: https://reviews.freebsd.org/D21882

4 years agoloader/powerpc64: Include generic PVR values in CAS architecture list
jhibbits [Tue, 8 Oct 2019 02:36:53 +0000 (02:36 +0000)]
loader/powerpc64: Include generic PVR values in CAS architecture list

Add generic PVR values for PowerISA 2.07 and 3.00.  This allows booting pseries
in QEMU with compatibilty mode enabled.

Submitted by: Shawn Anastasio <shawn@anastas.io>

4 years agopowerpc: Implement atomic_(f)cmpset_ for short and char
jhibbits [Tue, 8 Oct 2019 01:36:34 +0000 (01:36 +0000)]
powerpc: Implement atomic_(f)cmpset_ for short and char
|
This adds two implementations for each atomic_fcmpset_ and atomic_cmpset_
short and char functions, selectable at compile time for the target
architecture.  By default, it uses a generic shift-and-mask to perform atomic
updates to sub-components of 32-bit words from <sys/_atomic_subword.h>.
However, if ISA_206_ATOMICS is defined it uses the ll/sc instructions for
halfword and bytes, introduced in PowerISA 2.06.  These instructions are
supported by all IBM processors from POWER7 on, as well as the Freescale/NXP
e6500 core.  Although the e5500 and e500mc both implement PowerISA 2.06 they
do not implement these instructions.

As part of this, clean up the atomic_(f)cmpset_acq and _rel wrappers, by
using macros to reduce code duplication.

ISA_206_ATOMICS requires clang or newer binutils (2.20 or later).

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

4 years agoImprove locking in the IPV6_V6ONLY socket option handler.
markj [Mon, 7 Oct 2019 23:35:23 +0000 (23:35 +0000)]
Improve locking in the IPV6_V6ONLY socket option handler.

Acquire the inp lock before checking whether the socket is already bound,
and around updates to the inp_vflag field.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D21867

4 years agoAssert that the PGA_{WRITEABLE,EXECUTABLE} flags do not leak.
markj [Mon, 7 Oct 2019 23:31:17 +0000 (23:31 +0000)]
Assert that the PGA_{WRITEABLE,EXECUTABLE} flags do not leak.

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

4 years agovm: stop trylocking page queues in vm_page_pqbatch_submit
mjg [Mon, 7 Oct 2019 23:19:09 +0000 (23:19 +0000)]
vm: stop trylocking page queues in vm_page_pqbatch_submit

About 11 minutes of poudriere -s -j 104 and probing on return value of
trylocks reveals that over 10% of attempts fail, which in turn means
there are more atomics performed than necessary.

Trylocking was there to try preventing migration, but it's not very likely
to happen if the lock is uncontested.

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D21925

4 years agoWiden NET_EPOCH coverage.
glebius [Mon, 7 Oct 2019 22:40:05 +0000 (22:40 +0000)]
Widen NET_EPOCH coverage.

When epoch(9) was introduced to network stack, it was basically
dropped in place of existing locking, which was mutexes and
rwlocks. For the sake of performance mutex covered areas were
as small as possible, so became epoch covered areas.

However, epoch doesn't introduce any contention, it just delays
memory reclaim. So, there is no point to minimise epoch covered
areas in sense of performance. Meanwhile entering/exiting epoch
also has non-zero CPU usage, so doing this less often is a win.

Not the least is also code maintainability. In the new paradigm
we can assume that at any stage of processing a packet, we are
inside network epoch. This makes coding both input and output
path way easier.

On output path we already enter epoch quite early - in the
ip_output(), in the ip6_output().

This patch does the same for the input path. All ISR processing,
network related callouts, other ways of packet injection to the
network stack shall be performed in net_epoch. Any leaf function
that walks network configuration now asserts epoch.

Tricky part is configuration code paths - ioctls, sysctls. They
also call into leaf functions, so some need to be changed.

This patch would introduce more epoch recursions (see EPOCH_TRACE)
than we had before. They will be cleaned up separately, as several
of them aren't trivial. Note, that unlike a lock recursion the
epoch recursion is safe and just wastes a bit of resources.

Reviewed by: gallatin, hselasky, cy, adrian, kristof
Differential Revision: https://reviews.freebsd.org/D19111

4 years agoIn r343587 a simple port filter as sysctl tunable was added to siftr.
tuexen [Mon, 7 Oct 2019 20:35:04 +0000 (20:35 +0000)]
In r343587 a simple port filter as sysctl tunable was added to siftr.
The new sysctl was not added to the siftr.4 man page at the time.
This updates the man page, and removes one left over trailing whitespace.

Submitted by: Richard Scheffenegger
Reviewed by: bcr@
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D21619

4 years agoZFS: fix the redundancy tests
asomers [Mon, 7 Oct 2019 20:21:23 +0000 (20:21 +0000)]
ZFS: fix the redundancy tests

* Fix force_sync_path, which ensures that a file is fully flushed to disk.
  Apparently "zpool history"'s performance has improved, but exporting and
  importing the pool still works.
* Fix file_dva by using undocumented zdb syntax to clarify that we're
  interested in the pool's root file system, not the pool itself. This
  should also fix the zpool_clear_001_pos test.
* Remove a redundant cleanup step

MFC after: 2 weeks
Sponsored by: Axcient
Differential Revision: https://reviews.freebsd.org/D21901

4 years agoZFS: mark hotspare_scrub_002_pos as an expected failure
asomers [Mon, 7 Oct 2019 20:19:05 +0000 (20:19 +0000)]
ZFS: mark hotspare_scrub_002_pos as an expected failure

"zpool scrub" doesn't detect all errors on active spares in raidz arrays

PR: 241069
MFC after: 2 weeks
Sponsored by: Axcient

4 years agoZFS: fix the delegate tests
asomers [Mon, 7 Oct 2019 20:13:49 +0000 (20:13 +0000)]
ZFS: fix the delegate tests

These tests have never worked correctly

* Replace runwattr with sudo
* Fix a scoping bug with the "dtst" variable
* Cleanup user properties created during tests
* Eliminate the checks for refreservation and send support. They will always
  be supported.
* Fix verify_fs_snapshot. It seemed to assume that permissions would not yet
  be delegated, but that's not how it's actually used.
* Combine verify_fs_promote with verify_vol_promote
* Remove some useless sleeps
* Fix backwards condition in verify_vol_volsize
* Remove some redundant cleanup steps in the tests. cleanup.ksh will handle
  everything.
* Disable some parts of the tests that FreeBSD doesn't support:
    * Creating snapshots with mkdir
    * devices
    * shareisci
    * sharenfs
    * xattr
    * zoned

The sharenfs parts could probably be reenabled with more work to remove the
Solarisms.

MFC after: 2 weeks
Sponsored by: Axcient
Differential Revision: https://reviews.freebsd.org/D21898

4 years agozfs: skip the zfsd tests if zfsd is not running
asomers [Mon, 7 Oct 2019 19:50:22 +0000 (19:50 +0000)]
zfs: skip the zfsd tests if zfsd is not running

MFC after: 2 weeks
Sponsored by: Axcient
Differential Revision: https://reviews.freebsd.org/D21878

4 years agozfs: fix the zdb_001_neg test
asomers [Mon, 7 Oct 2019 19:48:18 +0000 (19:48 +0000)]
zfs: fix the zdb_001_neg test

The test needed to be updated for r331701 (MFV illumos 8671400), which added
a "-k" option.

MFC after: 2 weeks
Sponsored by: Axcient

4 years agoZFS: fix the zpool_get_002_pos test
asomers [Mon, 7 Oct 2019 19:24:50 +0000 (19:24 +0000)]
ZFS: fix the zpool_get_002_pos test

ZFS has grown some additional properties that hadn't been added to the
config file yet.  While I'm here, improve the error message, and remove a
superfluous command.

MFC after: 2 weeks
Sponsored by: Axcient

4 years agoIntroduce stats(3), a flexible statistics gathering API.
trasz [Mon, 7 Oct 2019 19:05:05 +0000 (19:05 +0000)]
Introduce stats(3), a flexible statistics gathering API.

This provides a framework to define a template describing
a set of "variables of interest" and the intended way for
the framework to maintain them (for example the maximum, sum,
t-digest, or a combination thereof).  Afterwards the user
code feeds in the raw data, and the framework maintains
these variables inside a user-provided, opaque stats blobs.
The framework also provides a way to selectively extract the
stats from the blobs.  The stats(3) framework can be used in
both userspace and the kernel.

See the stats(3) manual page for details.

This will be used by the upcoming TCP statistics gathering code,
https://reviews.freebsd.org/D20655.

The stats(3) framework is disabled by default for now, except
in the NOTES kernel (for QA); it is expected to be enabled
in amd64 GENERIC after a cool down period.

Reviewed by: sef (earlier version)
Obtained from: Netflix
Relnotes: yes
Sponsored by: Klara Inc, Netflix
Differential Revision: https://reviews.freebsd.org/D20477

4 years agozfs: fix the slog_012_neg test
asomers [Mon, 7 Oct 2019 18:55:40 +0000 (18:55 +0000)]
zfs: fix the slog_012_neg test

This test attempts to corrupt a file-backed vdev by deleting it and then
recreating it with truncate.  But that doesn't work, because the pool
already has the vdev open, and it happily hangs on to the open-but-deleted
file.  Fix by truncating the file without deleting it.

MFC after: 2 weeks
Sponsored by: Axcient

4 years agoZFS: fix several zvol_misc tests
asomers [Mon, 7 Oct 2019 18:21:33 +0000 (18:21 +0000)]
ZFS: fix several zvol_misc tests

* Adapt zvol_misc_001_neg to use dumpon instead of Solaris's dumpadm
* Disable zvol_misc_003_neg, zvol_misc_005_neg, and zvol_misc_006_pos,
  because they involve using a zvol as a dump device, which FreeBSD does not
  yet support.

MFC after: 2 weeks
Sponsored by: Axcient

4 years agoCompile time assert a valid subsystem for all VNET init and uninit functions.
hselasky [Mon, 7 Oct 2019 14:24:59 +0000 (14:24 +0000)]
Compile time assert a valid subsystem for all VNET init and uninit functions.
Using VNET init and uninit functions outside the given range has undefined
behaviour.

MFC after: 1 week
Sponsored by: Mellanox Technologies

4 years agoFactor out VNET shutdown check into an own vnet structure field.
hselasky [Mon, 7 Oct 2019 14:15:41 +0000 (14:15 +0000)]
Factor out VNET shutdown check into an own vnet structure field.
Remove the now obsolete vnet_state field. This greatly simplifies the
detection of VNET shutdown and avoids code duplication.

Discussed with: bz@
MFC after: 1 week
Sponsored by: Mellanox Technologies

4 years agoMake control endpoint quirk for xhci(4) configurable.
hselasky [Mon, 7 Oct 2019 13:40:29 +0000 (13:40 +0000)]
Make control endpoint quirk for xhci(4) configurable.

MFC after: 1 week
Sponsored by: Mellanox Technologies

4 years agofix up r353168, add atomic_swap_64 to i386 version of opensolaris_atomic.S
avg [Mon, 7 Oct 2019 12:53:27 +0000 (12:53 +0000)]
fix up r353168, add atomic_swap_64 to i386 version of opensolaris_atomic.S

The compatibility code for the atomic operations in ZFS code is a bit
messy.  In some cases the native definitions are directly made
available, in some cases there are emulated operations in
opensolaris_atomic.c and in yet other cases there are atomic operations
implemented in assembly that were obtained from OpenSolaris / illumos.

This commit adds atomic_swap_64 for use with i386 userland.
The code is copied from illumos.

I am not sure why FreeBSD does not provide that operation natively.
Maybe because we try (or pretend) to support processors that did not
have the necessary instructions.

While here I also added atomic_load_64 for the same reasons.
This is original code based on iilumos atomic_swap_64 and FreeBSD
atomic_load_acq_64_i586.

Pointyhat to: avg
MFC after: 1 week

4 years agoMFV r350898, r351075: 8423 8199 7432 Implement large_dnode pool feature
avg [Mon, 7 Oct 2019 08:14:45 +0000 (08:14 +0000)]
MFV r350898, r351075: 8423 8199 7432 Implement large_dnode pool feature

8423 8199 7432 Implement large_dnode pool feature

7432 Large dnode pool feature
8199 multi-threaded dmu_object_alloc()
8423 Implement large_dnode pool feature
10406 large_dnode changes broke zfs recv of legacy stream

llumos/illumos-gate@54811da5ac6b517992fdc173df5d605e4e61fdc0
https://github.com/illumos/illumos-gate/commit/54811da5ac6b517992fdc173df5d605e4e61fdc0
https://www.illumos.org/issues/8423
https://www.illumos.org/issues/8199
https://www.illumos.org/issues/7432

illumos/illumos-gate@811964cd9f1fbae0fc3b93d116269e9b1fca090a
https://github.com/illumos/illumos-gate/commit/811964cd9f1fbae0fc3b93d116269e9b1fca090a
https://www.illumos.org/issues/10406

  ZoL issues:
  Improved dnode allocation #6564
  Clean up large dnode code #6262
  Fix dnode_hold() freeing dnode behavior #8172
  Fix dnode allocation race #6414, #6439
  Partial: Raw sends must be able to decrease nlevels #6821, #6864
  Remove unnecessary txg syncs from receive_object() Closes #7197

This updates FreeBSD large_dnode code (that was imported from ZoL) to a
version that was committed to illumos.  It has some cleanups,
improvements and fixes comparing to what we have in FreeBSD now.
I think that the most significant update is 8199 multi-threaded
dmu_object_alloc().

This commit reverts r351077 that was a revert of r351074 and r351076 and
restores those changes.  Required atomic operations should be available
now on all platforms where we build ZFS.

Obtained from: illumos
MFC after: 3 weeks

4 years agoarm: dts: ti: Fix mmc3 instance by setting it to disabled
manu [Mon, 7 Oct 2019 08:11:49 +0000 (08:11 +0000)]
arm: dts: ti: Fix mmc3 instance by setting it to disabled

DTS Import of Linux 5.3 added a patch that rework the L3 mmc instance
in the AM335x SoC but removed the status = 'disabled' on the node.
This cause the kernel to probe the device even if the board doesn't
have this mmc used and since we don't correctly activate the clock
for this module we panic with an external data abort.
Beaglebone(s) don't have this device anyway so simply disabling it.
Patch for the DTS was sent upstream.
https://patchwork.kernel.org/patch/11176921/

PR: 241089
Reported by: phk

4 years agoZFS: unconditionally use atomic_swap_64
avg [Mon, 7 Oct 2019 08:00:54 +0000 (08:00 +0000)]
ZFS: unconditionally use atomic_swap_64

Previously, the code used a plain store on platforms that lacked
atomic_swap_64 and possibly some other platforms as the condition worked
only if atomic_swap_64 was a macro.

MFC after: 1 week
X-MFC after: r353166, r353167

4 years agoZFS: add emulation of atomic_swap_64 and atomic_load_64
avg [Mon, 7 Oct 2019 07:54:34 +0000 (07:54 +0000)]
ZFS: add emulation of atomic_swap_64 and atomic_load_64

Some 32-bit platforms do not provide 64-bit atomic operations that ZFS
requires, either in userland or at all.  We emulate those operations for
those platforms using a mutex.  That is not entirely correct and it's
very efficient.  Besides, the loads are plain loads, so torn values are
possible.

Nevertheless, the emulation seems to work for some definition of work.

This change adds atomic_swap_64, which is already used in ZFS code, and
atomic_load_64 that can be used to prevent torn reads.

MFC after: 1 week

4 years agoadd atomic_load_64 for mipsn32
avg [Mon, 7 Oct 2019 07:42:26 +0000 (07:42 +0000)]
add atomic_load_64 for mipsn32

It's just an alias for atomic_load_acq_64 (same as on i386).

MFC after: 1 week

4 years agoalign use of cp15_pmccntr_get with its availability
avg [Mon, 7 Oct 2019 07:37:42 +0000 (07:37 +0000)]
align use of cp15_pmccntr_get with its availability

According to ian, the only armv6 cpu we support is the 1176, so this
change is effectively a no-op.
The change is just to make the code more self-consistent.
The issue was noticed by a standalone module build for armv6.

Reviewed by: ian
MFC after: 3 weeks

4 years agoEliminate an unused declaration. The variable in question is only defined
alc [Mon, 7 Oct 2019 04:22:03 +0000 (04:22 +0000)]
Eliminate an unused declaration.  The variable in question is only defined
and used on sparc64.

MFC after: 1 week

4 years agoEliminate a redundant bzero(). The l0 page table page was already zeroed
alc [Mon, 7 Oct 2019 03:37:28 +0000 (03:37 +0000)]
Eliminate a redundant bzero().  The l0 page table page was already zeroed
by efi_1t1_page().

MFC after: 1 week

4 years agoRevert r352557: powerpc/loader: Install ubldr without stripping
kevans [Mon, 7 Oct 2019 03:28:11 +0000 (03:28 +0000)]
Revert r352557: powerpc/loader: Install ubldr without stripping

This was committed due to what was later diagnosed as an msdosfs bug
preventing in-place strip. This bug was fixed in r352564, and we agreed to
keep the workaround in for a bit to allow the driver fix a suitable amount
of propagation time for folks building/installing powerpc/ubldr, seeing as
how we were not in any hurry to revert.

4 years agoloader/powerpc64: Fix HV check for CAS usage
jhibbits [Mon, 7 Oct 2019 03:05:32 +0000 (03:05 +0000)]
loader/powerpc64: Fix HV check for CAS usage

Logic was backwards.  The function returns true if it *is* running as a
hypervisor, whereas we want to only call the CAS utility if we're running as a
guest.

Reported by: Shawn Anastasio <shawn@anastas.io>

4 years agopowerpc64/pmap: Fix release order to match lock order in moea64_enter()
jhibbits [Mon, 7 Oct 2019 02:36:42 +0000 (02:36 +0000)]
powerpc64/pmap: Fix release order to match lock order in moea64_enter()

Page PV lock is always taken first, so should be released last.  This also
(trivially) shortens the hold time of the pmap lock.

Submitted by: mjg

4 years agoBrad Davis identified a problem with the new LRO code, VLAN's
rrs [Sun, 6 Oct 2019 22:29:02 +0000 (22:29 +0000)]
Brad Davis identified a problem with the new LRO code, VLAN's
no longer worked. The problem was that the defines used the
same space as the VLAN id. This commit does three things.
1) Move the LRO used fields to the PH_per fields. This is
   safe since the entire PH_per is used for IP reassembly
   which LRO code will not hit.
2) Remove old unused pace fields that are not used in mbuf.h
3) The VLAN processing is not in the mbuf queueing code. Consequently
   if a VLAN submits to Rack or BBR we need to bypass the mbuf queueing
   for now until rack_bbr_common is updated to handle the VLAN properly.

Reported by: Brad Davis

4 years agoufs: add root vnode caching
mjg [Sun, 6 Oct 2019 22:18:03 +0000 (22:18 +0000)]
ufs: add root vnode caching

See r353150.

Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D21646

4 years agonfsclient: add root vnode caching
mjg [Sun, 6 Oct 2019 22:17:29 +0000 (22:17 +0000)]
nfsclient: add root vnode caching

See r353150.

Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D21646

4 years agotmpfs: add root vnode caching
mjg [Sun, 6 Oct 2019 22:17:11 +0000 (22:17 +0000)]
tmpfs: add root vnode caching

See r353150.

Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D21646

4 years agodevfs: add root vnode caching
mjg [Sun, 6 Oct 2019 22:16:55 +0000 (22:16 +0000)]
devfs: add root vnode caching

See r353150.

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D21646

4 years agozfs: add root vnode caching
mjg [Sun, 6 Oct 2019 22:16:00 +0000 (22:16 +0000)]
zfs: add root vnode caching

This replaces the approach added in r338927.

See r353150.

Sponsored by: The FreeBSD Foundation

4 years agovfs: add optional root vnode caching
mjg [Sun, 6 Oct 2019 22:14:32 +0000 (22:14 +0000)]
vfs: add optional root vnode caching

Root vnodes looekd up all the time, e.g. when crossing a mount point.
Currently used routines always perform a costly lookup which can be
trivially avoided.

Reviewed by: jeff (previous version), kib
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D21646

4 years agoamd64 pmap: implement per-superpage locks
mjg [Sun, 6 Oct 2019 22:13:35 +0000 (22:13 +0000)]
amd64 pmap: implement per-superpage locks

The current 256-lock sized array is a problem in the following ways:
- it's way too small
- there are 2 locks per cacheline
- it is not NUMA-aware

Solve these issues by introducing per-superpage locks backed by pages
allocated from respective domains.

This significantly reduces contention e.g. during poudriere -j 104.
See the review for results.

Reviewed by: kib
Discussed with: jeff
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D21833

4 years agopowerpc/pmap64: Properly parenthesize PV_LOCK_COUNT macros
jhibbits [Sun, 6 Oct 2019 19:11:01 +0000 (19:11 +0000)]
powerpc/pmap64: Properly parenthesize PV_LOCK_COUNT macros

As pointed out by mjg, without the parentheses the calculations done against
these macros are incorrect, resulting in only 1/3 of locks being used.

Reported by: mjg

4 years agoloader.efi: for text mode, use STM to scroll the whole screen
tsoome [Sun, 6 Oct 2019 18:38:58 +0000 (18:38 +0000)]
loader.efi: for text mode, use STM to scroll the whole screen

Since local UEFI console is implemented on top of framebuffer,
we need to avoid redrawing the whole screen ourselves, but let
Simple Text Mode to do the scroll for us.

4 years agoPlumb an mbuf leak in a code path that should not be taken. Also avoid
tuexen [Sun, 6 Oct 2019 08:47:10 +0000 (08:47 +0000)]
Plumb an mbuf leak in a code path that should not be taken. Also avoid
that this path is taken by setting the tail pointer correctly.
There is still bug related to handling unordered unfragmented messages
which were delayed in deferred handling.
This issue was found by OSS-Fuzz testing the usrsctp stack and reported in
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=17794

MFC after: 3 days

4 years agoRe-add ALLOW_MIPS_SHARED_TEXTREL, sprinkle it around
kevans [Sun, 6 Oct 2019 04:19:49 +0000 (04:19 +0000)]
Re-add ALLOW_MIPS_SHARED_TEXTREL, sprinkle it around

Diff partially stolen from CheriBSD; these bits need -Wl,-z,notext in order
to build in an LLVM world. They are needed for all flavors/sizes of MIPS.
This will eventually get fixed in LLVM, but it's unclear when.

Reported by: arichardson, emaste
Differential Revision: https://reviews.freebsd.org/D21696

4 years agoriscv: use the common sub-word {,f}cmpset implementation
kevans [Sun, 6 Oct 2019 01:35:31 +0000 (01:35 +0000)]
riscv: use the common sub-word {,f}cmpset implementation

Reviewed by: mhorne
Differential Revision: https://reviews.freebsd.org/D21888

4 years agoMark "private use area" characters as printable.
yuripv [Sat, 5 Oct 2019 22:17:54 +0000 (22:17 +0000)]
Mark "private use area" characters as printable.

At least some of the characters in E000-F8FF range are used by Powerline
fonts, and having no attributes for these ranges in UnicodeData.txt
other than "Other, Private Use" it should be safe to mark all of them as
printable.  Some actually were before r340491, so this fixes the
regression introduced there as well.

PR: 240911
Reviewed by: bapt
Tested by: Daniel Ponte <amigan@gmail.com>
Differential Revision: https://reviews.freebsd.org/D21850

4 years agoRemove the remnants of SI_CHEAPCLONE
kevans [Sat, 5 Oct 2019 21:52:06 +0000 (21:52 +0000)]
Remove the remnants of SI_CHEAPCLONE

SI_CHEAPCLONE was introduced in r66067 for use with cloned bpfs. It was
later also used in tty, tun, tap at points. The rough timeline for being
removed in each of these is as follows:

- r181690: bpf switched to use cdevpriv API by ed@
- r181905: ed@ rewrote the TTY later to be mpsafe
- r204464: kib@ removes it from tun/tap, declaring it unused

I've not yet been able to dig up any other consumers in the intervening 9
years. It is no longer set on any devices in the tree and leaves an
interesting situation in make_dev_sv where we're ok with the device already
being set SI_NAMED.

4 years agokern_conf: fully initialize cloned devices with make_dev_args, too
kevans [Sat, 5 Oct 2019 21:44:18 +0000 (21:44 +0000)]
kern_conf: fully initialize cloned devices with make_dev_args, too

Attempting to initialize si_drv{1,2} with mda_si_drv{1,2} does not work if
you are operating on cloned devices.

clone_create must be called prior to the make_dev* family to create/return
the device on the clonelist as needed. This device is later returned early
in newdev(), prior to si_drv{0,1,2} initialization.

This patch simply breaks out of the loop if we've found a device and
finishes init.

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

4 years agoPre-generate Big5 charmap from CLDR data.
yuripv [Sat, 5 Oct 2019 21:28:46 +0000 (21:28 +0000)]
Pre-generate Big5 charmap from CLDR data.

The one used previously was missing the characters in 0-127 range,
making various tools try to escape them in output.

PR: 235100
Reviewed by: bapt
Tested by: Ting-Wei Lan <lantw44@gmail.com>
Differential Revision: https://reviews.freebsd.org/D21794

4 years agodevfs: plug redundant bwillwrite avoidance
mjg [Sat, 5 Oct 2019 17:44:33 +0000 (17:44 +0000)]
devfs: plug redundant bwillwrite avoidance

vn_write already checks for vnode type to see if bwillwrite should be called.

This effectively reverts r244643.

Reviewed by: kib
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D21905

4 years agoarm64: rockchip: usb2phy: Add set/get mode
manu [Sat, 5 Oct 2019 17:36:33 +0000 (17:36 +0000)]
arm64: rockchip: usb2phy: Add set/get mode

We only support host mode so those functions are just added so
we won't panic when generic-{e,o}hci will set the phy to host mode.

MFC after: 1 month
X-MFC-With: r353062

4 years agoFix a use after free bug when removing remote addresses.
tuexen [Sat, 5 Oct 2019 13:28:01 +0000 (13:28 +0000)]
Fix a use after free bug when removing remote addresses.
This bug was found by OSS-Fuzz and reported in
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=18004

MFC after: 3 days

4 years agoPlumb an mbuf leak found by Mark Wodrich from Google by fuzz testing the
tuexen [Sat, 5 Oct 2019 12:34:50 +0000 (12:34 +0000)]
Plumb an mbuf leak found by Mark Wodrich from Google by fuzz testing the
userland stack and reporting it in:
https://github.com/sctplab/usrsctp/issues/396

MFC after: 3 days

4 years agoCorrect grammos and typos.
schweikh [Sat, 5 Oct 2019 09:59:00 +0000 (09:59 +0000)]
Correct grammos and typos.

4 years agoFix the adding of padding to COOKIE-ECHO chunks.
tuexen [Sat, 5 Oct 2019 09:46:11 +0000 (09:46 +0000)]
Fix the adding of padding to COOKIE-ECHO chunks.

Thanks to Mark Wodrich who found this issue while fuzz testing the
usrsctp stack and reported the issue in
https://github.com/sctplab/usrsctp/issues/382

MFC after: 3 days

4 years agoZFS: fix several of the "zpool create" tests
asomers [Sat, 5 Oct 2019 03:19:53 +0000 (03:19 +0000)]
ZFS: fix several of the "zpool create" tests

* Remove zpool_create_013_neg.  FreeBSD doesn't have an equivalent of
  Solaris's metadevices.  GEOM would be the equivalent, but since all geoms
  are the same from ZFS's perspective, this test would be redundant with
  zpool_create_012_neg

* Remove zpool_create_014_neg.  FreeBSD does not support swapping to regular
  files.

* Remove zpool_create_016_pos.  This test is redundant with literally every
  other test that creates a disk-backed pool.

* s:/etc/vfstab:/etc/fstab in zpool_create_011_neg

* Delete the VTOC-related portion of zpool_create_008_pos.  FreeBSD doesn't
  use VTOC.

* Replace dumpadm with dumpon and swap with swapon in multiple tests.

* In zpool_create_015_neg, don't require "zpool create -n" to fail.  It's
  reasonable for that variant to succeed, because it doesn't actually open
  the zvol.

* Greatly simplify zpool_create_012_neg.  Make it safer, too, but not
  interfering with the system's regular swap devices.

* Expect zpool_create_011_neg to fail (PR 241070)

* Delete some redundant cleanup steps in various tests

* Remove some unneeeded ATF timeout specifications.  The default is fine.

PR: 241070
MFC after: 2 weeks
Sponsored by: Axcient

4 years agoZFS: the hotspare_add_004_neg test needs at least two disks
asomers [Sat, 5 Oct 2019 01:34:35 +0000 (01:34 +0000)]
ZFS: the hotspare_add_004_neg test needs at least two disks

MFC after: 2 weeks
Sponsored by: Axcient

4 years agoAdd missing definition in DEBUG code.
cy [Fri, 4 Oct 2019 22:10:38 +0000 (22:10 +0000)]
Add missing definition in DEBUG code.

MFC after: 3 days

4 years agonvdimm(4): Fix Clang build after r353110
cem [Fri, 4 Oct 2019 21:47:09 +0000 (21:47 +0000)]
nvdimm(4): Fix Clang build after r353110

Clang spuriously warns about some well-defined C99 static initializers.
Mute it.

X-MFC-With: r353110

4 years agoMake the hw.intrs sysctl OID read-only
vangyzen [Fri, 4 Oct 2019 21:46:11 +0000 (21:46 +0000)]
Make the hw.intrs sysctl OID read-only

The handler ignores the new value, so make the OID read-only.

I found this while working on r353111.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

4 years agoAdd CTLFLAG_STATS to several debug.softdep sysctl OIDs
vangyzen [Fri, 4 Oct 2019 21:44:52 +0000 (21:44 +0000)]
Add CTLFLAG_STATS to several debug.softdep sysctl OIDs

Refer to r353111.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

4 years agoAdd CTLFLAG_STATS to some vfs sysctl OIDs
vangyzen [Fri, 4 Oct 2019 21:43:43 +0000 (21:43 +0000)]
Add CTLFLAG_STATS to some vfs sysctl OIDs

Add CTLFLAG_STATS to the following OIDs:

vfs.altbufferflushes
vfs.recursiveflushes
vfs.barrierwrites
vfs.flushwithdeps
vfs.reassignbufcalls

Refer to r353111.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

4 years agoAdd CTLFLAG_STATS to all COUNTER_U64* sysctl OIDs
vangyzen [Fri, 4 Oct 2019 21:39:11 +0000 (21:39 +0000)]
Add CTLFLAG_STATS to all COUNTER_U64* sysctl OIDs

CTLFLAG_STATS identifies a sysctl OID as statistical or informational,
as opposed to a configurable/tunable OID that changes behavior.
This can be used, for example, to verfiy that the kyua tests do not
modify configurable OIDs when allow_sysctl_side_effects is true.

Add CTLFLAG_STATS to all COUNTER_U64* OIDs.

I will add the flag to more OIDs in a few subsequent commits, to
facilitate MFC.  The flag should be added to many more OIDs.  I plan to
add it those that my test found and some nearby that looked obvious.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon