]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
4 years agoaddr2line: use stdbool.h header for bool
emaste [Thu, 13 Feb 2020 16:17:05 +0000 (16:17 +0000)]
addr2line: use stdbool.h header for bool

Presumably a bool definition is obtained via header contamination on
FreeBSD-CURRENT.  Found while trying to upstream FreeBSD addr2line
changes - the FreeBSD 11.2 CI build failed there.

Reported by: Cirrus-CI, upstream ELF Tool Chain
MFC with: r357844
Sponsored by: The FreeBSD Foundation

4 years agoImprove USB gaming keyboard support.
hselasky [Thu, 13 Feb 2020 16:03:12 +0000 (16:03 +0000)]
Improve USB gaming keyboard support.

Add support for decoding pressed keys as a bitmap. The keys in the
bitmap are described in the interface specific HID descriptor. Some
keyboards even have multiple input interfaces, only using the bitmap
method when the event array is full. That typically means when more
than seven keys are pressed simultaneously.

The internals of the USB keyboard driver have been slightly reworked
to keep track of all keys in a single bitmap having 256 bits. This
bitmap is then divided into blocks of 64-bits as an optimisation.

Simplify automatic key repeat logic, because only the last key pressed
can be repeated.

PR: 224592
PR: 233884
Tested by: Alex V. Petrov <alexvpetrov@gmail.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies

4 years agoRevert r357343:
pfg [Thu, 13 Feb 2020 15:42:14 +0000 (15:42 +0000)]
Revert r357343:
services: Add PROFInet and EtherCAT.

Both are admitedly very niche features and no known users exist currently.
I am doing a further review/update of the services file (see D23621) and
both of these are not likely to be considered.

4 years agosesutil: fix Coverity CIDs
asomers [Thu, 13 Feb 2020 15:28:56 +0000 (15:28 +0000)]
sesutil: fix Coverity CIDs

1411604: file descriptor leak
1411586: memory leaks, null dereference on ENOMEM

Reported by: Coverity Scan
Coverity CIDs: 14116041411586
Reviewed by: trasz
MFC after: 2 weeks
Sponsored by: Axcient
Differential Revision: https://reviews.freebsd.org/D23651

4 years agosack_newdata and snd_recover hold the same value. Therefore, use only
tuexen [Thu, 13 Feb 2020 15:14:46 +0000 (15:14 +0000)]
sack_newdata and snd_recover hold the same value. Therefore, use only
a single instance: use snd_recover also where sack_newdata was used.

Submitted by: Richard Scheffenegger
Differential Revision: https://reviews.freebsd.org/D18811

4 years agotests: Enable net tests
kp [Thu, 13 Feb 2020 14:09:09 +0000 (14:09 +0000)]
tests: Enable net tests

We have a number of tests in the net subdirectory that were not executed. List
the net directory so we run those tests.

4 years agoWhitespace cleanup. No functional change.
tuexen [Thu, 13 Feb 2020 13:58:34 +0000 (13:58 +0000)]
Whitespace cleanup. No functional change.

Sponsored by: Netflix, Inc.

4 years agoCleanup gsched tool and geom_sched.so library after r356185.
dim [Thu, 13 Feb 2020 11:00:20 +0000 (11:00 +0000)]
Cleanup gsched tool and geom_sched.so library after r356185.

4 years agoUse INT instead of string for the ints. Because the string "I" was right, the
imp [Thu, 13 Feb 2020 03:37:11 +0000 (03:37 +0000)]
Use INT instead of string for the ints. Because the string "I" was right, the
old code appeared to work. This was a cut and paste error.

Noticed by: rpokala@

4 years agoAdd myself (freqlabs) as a src committer
freqlabs [Thu, 13 Feb 2020 01:42:13 +0000 (01:42 +0000)]
Add myself (freqlabs) as a src committer

Approved by: mav (mentor)
MFC after: 3 days

4 years agoConvert rotating and unmapped_io to a DA flag
imp [Thu, 13 Feb 2020 01:23:44 +0000 (01:23 +0000)]
Convert rotating and unmapped_io to a DA flag

Rotating and unmapped_io are really da flags. Convert them to a flag so it will
be reported with the other flags for the device. Deprecate the .rotating and
.unmapped_io sysctls in FreeBSD 14 and remove the softc ints.

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

4 years agoExport the current da flags as bitfield
imp [Thu, 13 Feb 2020 01:23:32 +0000 (01:23 +0000)]
Export the current da flags as bitfield

Export the current flags. They can be useful to other programs wanting to do
special thigns for removable or similar devices.

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

4 years agoFix typo introduced with r347534 (cap_sysctl additions).
dim [Wed, 12 Feb 2020 23:54:38 +0000 (23:54 +0000)]
Fix typo introduced with r347534 (cap_sysctl additions).

This ensures the old libcap_sysctl.so.1 gets cleaned up when running
"make delete-old-libs".

4 years agobhyve: move virtio-net header processing to pci_virtio_net
vmaffione [Wed, 12 Feb 2020 22:44:18 +0000 (22:44 +0000)]
bhyve: move virtio-net header processing to pci_virtio_net

This patch cleans up the API between the net frontends (e1000,
virtio-net) and the net backends (tap and netmap).
We move the virtio-net header stripping/prepending to the
virtio-net code, where this functionality belongs.
In this way, the netbe_send() and netbe_recv() signatures
can have const struct iov * rather than struct iov *.

Reviewed by: grehan, bcr, aleksandr.fedorov@itglobal.com
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D23342

4 years agoefiloader: don't execute hooks when setting currdev/loaddev
kevans [Wed, 12 Feb 2020 22:29:08 +0000 (22:29 +0000)]
efiloader: don't execute hooks when setting currdev/loaddev

We still need to set the hooks to prevent improper manipulations thereafter
at the loader prompt, but as it is we're actively preventing loaddev from
being set correctly in some circumstances (ZFS in particular) and doing more
work than needed with currdev -- that hook in particular validates it as a
correct device, which we can assume isn't needed in this context.

Reviewed by: imp, sigsys@gmail.com
Submitted/Diagnosed by: sigsys@gmail.com
Differential Revision: https://reviews.freebsd.org/D23390

4 years agoaddr2line: Handle DW_AT_ranges in compile units
emaste [Wed, 12 Feb 2020 21:52:10 +0000 (21:52 +0000)]
addr2line: Handle DW_AT_ranges in compile units

Based on original submission by Marat Radchenko in ELF Tool Chain
ticket #545, rebased and updated by Tiger Gao.

PR: 217736
Submitted by: Marat Radchenko <marat@slonopotamus.org>
Submitted by: Tiger Gao <tig@freebsdfoundation.org>
Reviewed by: markj
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D23501

4 years ago* Fix flaking lle tests by filtering out non-relevant rtsock messages.
melifaro [Wed, 12 Feb 2020 21:16:30 +0000 (21:16 +0000)]
* Fix flaking lle tests by filtering out non-relevant rtsock messages.
* Consistently use RTM_DECLARE_ROOT_TEST() macro.
* Temporarily remove iftype validation from IPv6 lle notifications.

Reported by: kp

4 years agonetipsec: fix a mismatched uma_zfree -> uma_zfree_pcpu
mjg [Wed, 12 Feb 2020 20:18:29 +0000 (20:18 +0000)]
netipsec: fix a mismatched uma_zfree -> uma_zfree_pcpu

PR: 244077
Reported by: lwhsu
Fixes: r357805 ("amd64: store per-cpu allocations subtracted by __pcpu")
4 years agodiff.1: Fix style & document -y as extension to POSIX
0mp [Wed, 12 Feb 2020 20:06:41 +0000 (20:06 +0000)]
diff.1: Fix style & document -y as extension to POSIX

- Long options must be stylized with the Fl macro as well.

Reviewed by: bapt
Approved by: bcr (mentor)
Differential Revision: https://reviews.freebsd.org/D23642

4 years agosys/kern sysent: re-add dependency on capabilities.conf
kevans [Wed, 12 Feb 2020 19:06:34 +0000 (19:06 +0000)]
sys/kern sysent: re-add dependency on capabilities.conf

r356868 inadvertently removed this, so changes to capabilities.conf were no
longer considered for being outdated.

4 years agoregen sysent after r357831, r357838
emaste [Wed, 12 Feb 2020 19:05:10 +0000 (19:05 +0000)]
regen sysent after r357831, r357838

Capability mode changes allowing fdatasync and getloginclass.

Sponsored by: The FreeBSD Foundation

4 years agoAllow getloginclass in capability mode
emaste [Wed, 12 Feb 2020 18:59:00 +0000 (18:59 +0000)]
Allow getloginclass in capability mode

As with e.g. getgroups and getlogin it allows querying current process
credential state.

Reported by: sigsys@gmail.com via kevans
Sponsored by: The FreeBSD Foundation

4 years agofusefs: fix some memory leaks in the tests.
asomers [Wed, 12 Feb 2020 18:11:07 +0000 (18:11 +0000)]
fusefs: fix some memory leaks in the tests.

Oddly, most of these were not detected by Coverity.

Reported by: Coverity (one of them, anyway)
Coverity CID: 1404490
MFC after: 2 weeks

4 years agoMake the warning for deprecated NO_ variables an error.
brooks [Wed, 12 Feb 2020 18:09:20 +0000 (18:09 +0000)]
Make the warning for deprecated NO_ variables an error.

Support for NO_CTF, NO_DEBUG_FILES, NO_INSTALLLIB, NO_MAN, NO_PROFILE,
and NO_WARNS as deprecated in 2014 with a warning added for each one
found. Turn these into error in preperation for removal of compatability
support before FreeBSD 13.

This was previously committed in r354909 and reverted in r355011 due to
unforseen impacts on ports.  I've since corrected all amd64 and i386
ports reported in prior runs as well as instance of these variables I
found via grep.

4 years agoTag pjdfstest symlink with pkgbase package
emaste [Wed, 12 Feb 2020 17:37:32 +0000 (17:37 +0000)]
Tag pjdfstest symlink with pkgbase package

As with the rest of pjdfstest, tag the symlink with package=tests.
The tests -> . symlink seems a little strange but that's independent
of pkgbase.

Sponsored by: The FreeBSD Foundation

4 years agotag /etc/rmt symlink with pkgbase package
emaste [Wed, 12 Feb 2020 17:30:09 +0000 (17:30 +0000)]
tag /etc/rmt symlink with pkgbase package

For historical reasons the "remote magtape protocol module" rmt gets
invoked as /etc/rmt, which is a symlink to /usr/sbin/rmt.  Put it in the
utilities package, as /usr/sbin/rmt is.

Sponsored by: The FreeBSD Foundation

4 years agoAllow fdatasync in capability mode
emaste [Wed, 12 Feb 2020 17:12:26 +0000 (17:12 +0000)]
Allow fdatasync in capability mode

fdatasync is essentially a subset of fsync (and may be exactly fsync,
depending on filesystem and development effort) and operates only on
a provided fd.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

4 years agoDon't panic under INVARIANTS when we can't allocate memory for storing
tuexen [Wed, 12 Feb 2020 17:05:10 +0000 (17:05 +0000)]
Don't panic under INVARIANTS when we can't allocate memory for storing
a vtag in time wait.
This issue was found by running syzkaller.

MFC after: 1 week

4 years agoMark the socket as disconnected when freeing the association the first
tuexen [Wed, 12 Feb 2020 17:02:15 +0000 (17:02 +0000)]
Mark the socket as disconnected when freeing the association the first
time.
This issue was found by running syzkaller.

MFC after: 1 week

4 years agointerp_lua: fix bogus indentation, NFC
kevans [Wed, 12 Feb 2020 16:10:00 +0000 (16:10 +0000)]
interp_lua: fix bogus indentation, NFC

4 years agolualoader: disable autoboot on high-level interpreter errors
kevans [Wed, 12 Feb 2020 16:09:01 +0000 (16:09 +0000)]
lualoader: disable autoboot on high-level interpreter errors

If we hit an error at this level, we are almost certainly not in any kind
of sane state where autoboot can do the right thing. Instead of letting it
try and probably failing, disable autoboot so they immediately get kicked
into a loader prompt for manual remediation/diagnosis.

Reviewed by: tsoome
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D23611

4 years agoelfcopy: set ELF OS/ABI field when converting from binary
emaste [Wed, 12 Feb 2020 15:59:59 +0000 (15:59 +0000)]
elfcopy: set ELF OS/ABI field when converting from binary

PR: 228934
Submitted by: Tiger Gao <tig@freebsdfoundation.org>
Reviewed by: markj, jkoshy
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D23504

4 years agoLets get the real correct version.. gessh. I need
rrs [Wed, 12 Feb 2020 15:26:56 +0000 (15:26 +0000)]
Lets get the real correct version.. gessh. I need
more coffee evidently.

Sponsored by: Netflix

4 years agoImplement vm.pmap.kernel_maps for RISC-V
mhorne [Wed, 12 Feb 2020 14:06:02 +0000 (14:06 +0000)]
Implement vm.pmap.kernel_maps for RISC-V

This is taken from the arm64 version, with the following simplifications:

- Our current pmap implementation uses a 3-level paging scheme
- The "mode" field has been omitted since RISC-V PTEs don't encode
  typical mode attributes

Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D23594

4 years agoRISC-V: un-ifdef vm.kvm_size and vm.kvm_free
mhorne [Wed, 12 Feb 2020 13:58:37 +0000 (13:58 +0000)]
RISC-V: un-ifdef vm.kvm_size and vm.kvm_free

Fix formatting and add CTLFLAG_MPSAFE.

Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D23522

4 years agoOpps committed the wrong ratelimit version in the
rrs [Wed, 12 Feb 2020 13:37:53 +0000 (13:37 +0000)]
Opps committed the wrong ratelimit version in  the
whitespace cleanup.. Restore it to the proper version.

Sponsored by: Netfilx Inc.

4 years agoWhite space cleanup -- remove trailing tab's or spaces
rrs [Wed, 12 Feb 2020 13:31:36 +0000 (13:31 +0000)]
White space cleanup -- remove trailing tab's or spaces
from any line.

Sponsored by: Netflix Inc.

4 years agoWhitespace, remove from three files trailing white
rrs [Wed, 12 Feb 2020 13:07:09 +0000 (13:07 +0000)]
Whitespace, remove from three files trailing white
space (leftover presents from emacs).

Sponsored by: Netflix Inc.

4 years agoThis small fix makes it so we properly follow
rrs [Wed, 12 Feb 2020 13:04:19 +0000 (13:04 +0000)]
This small fix makes it so we properly follow
the RFC and only enable ECN when both the
CWR and ECT bits our set within the SYN packet.

Sponsored by: Netflix Inc.
Differential Revision: https://reviews.freebsd.org/D23645

4 years agoRemove all trailing white space from the BBR/Rack fold. Bits
rrs [Wed, 12 Feb 2020 12:40:06 +0000 (12:40 +0000)]
Remove all trailing white space from the BBR/Rack fold. Bits
left around by emacs (thanks emacs).

4 years agoNow that all of the stats framework is
rrs [Wed, 12 Feb 2020 12:36:55 +0000 (12:36 +0000)]
Now that all of the stats framework is
in FreeBSD the bits that disabled stats
when netflix-stats is not defined is no longer
needed. Lets remove these bits so that we
will properly use stats per its definition
in BBR and Rack.

Sponsored by: Netflix Inc
Differential Revision: https://reviews.freebsd.org/D23088

4 years agoFix indent.
kib [Wed, 12 Feb 2020 12:23:46 +0000 (12:23 +0000)]
Fix indent.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

4 years agovfs: refactor vputx and add more comment
mjg [Wed, 12 Feb 2020 11:19:07 +0000 (11:19 +0000)]
vfs: refactor vputx and add more comment

Reviewed by: jeff (previous version)
Tested by: pho (previous version)
Differential Revision: https://reviews.freebsd.org/D23530

4 years agovfs: drop remaining zpcpu casts
mjg [Wed, 12 Feb 2020 11:18:12 +0000 (11:18 +0000)]
vfs: drop remaining zpcpu casts

4 years agovfs: switch to smp_rendezvous_cpus_retry for vfs_op_thread_enter/exit
mjg [Wed, 12 Feb 2020 11:17:45 +0000 (11:17 +0000)]
vfs: switch to smp_rendezvous_cpus_retry for vfs_op_thread_enter/exit

In particular on amd64 this eliminates an atomic op in the common case,
trading it for IPIs in the uncommon case of catching CPUs executing the
code while the filesystem is getting suspended or unmounted.

4 years agorms: use smp_rendezvous_cpus_retry instead of a hand-rolled variant
mjg [Wed, 12 Feb 2020 11:17:18 +0000 (11:17 +0000)]
rms: use smp_rendezvous_cpus_retry instead of a hand-rolled variant

4 years agoAdd smp_rendezvous_cpus_retry
mjg [Wed, 12 Feb 2020 11:16:55 +0000 (11:16 +0000)]
Add smp_rendezvous_cpus_retry

This is a wrapper around smp_rendezvous_cpus which enables use of IPI
handlers which can fail and require retrying.

wait_func argument is added to to provide a routine which can be used to
poll CPU of interest for when the IPI can be retried.

Handlers which succeed must call smp_rendezvous_cpus_done to denote that
fact.

Discussed with:  jeff
Differential Revision: https://reviews.freebsd.org/D23582

4 years agoamd64: provide custom zpcpu set/add/sub routines
mjg [Wed, 12 Feb 2020 11:15:33 +0000 (11:15 +0000)]
amd64: provide custom zpcpu set/add/sub routines

Note that clobbers are highly overzealous, can be cleaned up later.

4 years agoDedup zpcpu assertions into one macro and guard the rest with #ifndef
mjg [Wed, 12 Feb 2020 11:14:23 +0000 (11:14 +0000)]
Dedup zpcpu assertions into one macro and guard the rest with #ifndef

Sponsored by: The FreeBSD Foundation

4 years agoamd64: store per-cpu allocations subtracted by __pcpu
mjg [Wed, 12 Feb 2020 11:12:13 +0000 (11:12 +0000)]
amd64: store per-cpu allocations subtracted by __pcpu

This eliminates a runtime subtraction from counter_u64_add.

before:
mov    0x4f00ed(%rip),%rax        # 0xffffffff80c01788 <numfullpathfail4>
sub    0x808ff6(%rip),%rax        # 0xffffffff80f1a698 <__pcpu>
addq   $0x1,%gs:(%rax)

after:
mov    0x4f02fd(%rip),%rax        # 0xffffffff80c01788 <numfullpathfail4>
addq   $0x1,%gs:(%rax)

Reviewed by: jeff
Differential Revision: https://reviews.freebsd.org/D23570

4 years agoStore offset into zpcpu allocations in the per-cpu area.
mjg [Wed, 12 Feb 2020 11:11:22 +0000 (11:11 +0000)]
Store offset into zpcpu allocations in the per-cpu area.

This shorten zpcpu_get and allows more optimizations.

Reviewed by: jeff
Differential Revision: https://reviews.freebsd.org/D23570

4 years agoepoch: convert zpcpu_get_cpua(.., curcpu) to zpcpu_get
mjg [Wed, 12 Feb 2020 11:10:10 +0000 (11:10 +0000)]
epoch: convert zpcpu_get_cpua(.., curcpu) to zpcpu_get

4 years agoAdd support for debugnet in mlx5en(4).
hselasky [Wed, 12 Feb 2020 10:03:25 +0000 (10:03 +0000)]
Add support for debugnet in mlx5en(4).

MFC after: 1 week
Sponsored by: Mellanox Technologies

4 years agoAdd support for disabling and polling MSIX interrupts in mlx5core.
hselasky [Wed, 12 Feb 2020 09:58:19 +0000 (09:58 +0000)]
Add support for disabling and polling MSIX interrupts in mlx5core.

MFC after: 1 week
Sponsored by: Mellanox Technologies

4 years agoUse NET_TASK_INIT() and NET_GROUPTASK_INIT() for drivers that process
hselasky [Wed, 12 Feb 2020 09:19:47 +0000 (09:19 +0000)]
Use NET_TASK_INIT() and NET_GROUPTASK_INIT() for drivers that process
incoming packets in taskqueue context.

This patch extends r357772.

Tested by: yp@mm.st
Sponsored by: Mellanox Technologies

4 years agoMake sure the so-called end of receive interrupts don't starve in iflib.
hselasky [Wed, 12 Feb 2020 08:30:07 +0000 (08:30 +0000)]
Make sure the so-called end of receive interrupts don't starve in iflib.

When the receive ring cannot be filled with mbufs, due to lack of memory,
no more interrupts may be generated to fill the receive ring later on.
Make sure to have a watchdog, to try refilling the receive ring from time
to time, hopefully when more mbufs are available.

Differential Revision: https://reviews.freebsd.org/D23315
MFC after: 1 week
Reviewed by: gallatin@
Sponsored by: Mellanox Technologies

4 years agoRemove sparc64 specific inclusion of bswap32 built-ins.
imp [Wed, 12 Feb 2020 06:56:04 +0000 (06:56 +0000)]
Remove sparc64 specific inclusion of bswap32 built-ins.

4 years agoRemove sparc64 specific warning suppression.
imp [Wed, 12 Feb 2020 06:54:34 +0000 (06:54 +0000)]
Remove sparc64 specific warning suppression.

4 years agoRemove excluding libproc and librtld_db on sparc64.
imp [Wed, 12 Feb 2020 06:54:28 +0000 (06:54 +0000)]
Remove excluding libproc and librtld_db on sparc64.

4 years agoRemove sparc64 files
imp [Wed, 12 Feb 2020 06:53:29 +0000 (06:53 +0000)]
Remove sparc64 files

These were disconnected from the build when the kernel was
removed. Since they depend on removed parts of the kernel, remove them
completely.

4 years agoRemove sparc64 specific bits of the man pages.
imp [Wed, 12 Feb 2020 06:52:22 +0000 (06:52 +0000)]
Remove sparc64 specific bits of the man pages.

4 years agocxgbe(4): Update T4/5/6 firmwares to 1.24.12.0.
np [Wed, 12 Feb 2020 02:55:06 +0000 (02:55 +0000)]
cxgbe(4): Update T4/5/6 firmwares to 1.24.12.0.

Obtained from: Chelsio Communications
MFC after: 1 month
Sponsored by: Chelsio Communications

4 years agoMark hme(4) as deprecated.
brooks [Wed, 12 Feb 2020 00:58:17 +0000 (00:58 +0000)]
Mark hme(4) as deprecated.

It was saved from the initial purge of drivers in fcp-101 due to being
the onboard Ethernet device on a number of sparc64 machines.  Now that
sparc64 is gone, it serves little purpose (PCI cards exist, but are rare
and are unlikely to have been deployed outside Sun systems).

MFC after: 3 days

4 years agoipfw nat: add missing bits after r357092 (RFC 6598/Carrier Grade NAT)
eugen [Wed, 12 Feb 2020 00:46:33 +0000 (00:46 +0000)]
ipfw nat: add missing bits after r357092 (RFC 6598/Carrier Grade NAT)

Submitted by: Neel Chauhan <neel AT neelc DOT org>
Reviewed by: Lutz Donnerhacke
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D23448

4 years agong_nat: avoid panic if attached directly to ng_ether and got short packet
eugen [Wed, 12 Feb 2020 00:31:00 +0000 (00:31 +0000)]
ng_nat: avoid panic if attached directly to ng_ether and got short packet

From the beginning, ng_nat safely assumed cleansed traffic
because of limited ways it could be attached to NETGRAPH:
ng_ipfw or ng_ppp only.

Now as it may be attached with ng_ether too, the assumption proven wrong.
Add needed check to the ng_nat. Thanks for markj for debugging this.

PR: 243096
Submitted by: Lutz Donnerhacke <lutz@donnerhacke.de>
Reported by: Robert James Hernandez <rob@sarcasticadmin.com>
Reviewed by: markj and others
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D23091

4 years agoMFV r357783:
mm [Wed, 12 Feb 2020 00:16:56 +0000 (00:16 +0000)]
MFV r357783:
Update libarchive to 3.4.2

Relevant vendor changes:
  PR #1289: atomic extraction support (bsdtar -x --safe-writes)
  PR #1308: big endian fix for UTF16 support in LHA reader
  PR #1326: reject RAR5 files that declare invalid header flags
  Issue #987: fix support 7z archive entries with Delta filter
  Issue #1317: fix compression output buffer handling in XAR writer
  Issue #1319: fix uname or gname longer than 32 characters in pax writer
  Issue #1325: fix use after free when archiving hardlinks in ISO9660 or XAR
  Use localtime_r() and gmtime_r() instead of localtime() and gmtime()

X-MFC-With: r356212,r356365,r356416
MFC after: 1 week

4 years agoUpdate vendor/libarchive/dist to git 3288ebb0353beb51dfb09d444dedbe9235ead53d
mm [Tue, 11 Feb 2020 23:48:03 +0000 (23:48 +0000)]
Update vendor/libarchive/dist to git 3288ebb0353beb51dfb09d444dedbe9235ead53d

Libarchive 3.4.2

Relevant vendor changes:
  PR #1289: atomic extraction support (bsdtar -x --safe-writes)
  PR #1308: big endian fix for UTF16 support in LHA reader
  PR #1326: reject RAR5 files that declare invalid header flags
  Issue #987: fix support 7z archive entries with Delta filter
  Issue #1317: fix compression output buffer handling in XAR writer
  Issue #1319: fix uname or gname longer than 32 characters in pax writer
  Issue #1325: fix use after free when archiving hardlinks in ISO9660 or XAR
  Use localtime_r() and gmtime_r() instead of localtime() and gmtime()

4 years agoTemporarily skip flakey test case sys.kern.ptrace_test.ptrace__parent_exits_before_child
lwhsu [Tue, 11 Feb 2020 23:17:58 +0000 (23:17 +0000)]
Temporarily skip flakey test case sys.kern.ptrace_test.ptrace__parent_exits_before_child

PR: 244056
Sponsored by: The FreeBSD Foundation

4 years agoTemporarily skip failing test case sys.kern/ptrace_test/ptrace__parent_wait_after_attach
lwhsu [Tue, 11 Feb 2020 22:48:12 +0000 (22:48 +0000)]
Temporarily skip failing test case sys.kern/ptrace_test/ptrace__parent_wait_after_attach

PR: 244055
Sponsored by: The FreeBSD Foundation

4 years agoTemporarily skip sys.geom.class.multipath.failloop.failloop in CI
lwhsu [Tue, 11 Feb 2020 22:21:22 +0000 (22:21 +0000)]
Temporarily skip sys.geom.class.multipath.failloop.failloop in CI

This case uses `dtrace -c` but it has some issues at the moment

PR: 244053
Sponsored by: The FreeBSD Foundation

4 years agoRemove assertion from TASK_INIT() macro, since some users of
glebius [Tue, 11 Feb 2020 20:59:41 +0000 (20:59 +0000)]
Remove assertion from TASK_INIT() macro, since some users of
sys/taskqueue.h may not have includes that define MPASS. It
was useful during testing of r357771, but can be omitted now.
An invalid value of priority will yield only in potential
priority inversion, not a crash.

This fixes compilation of ports/x11/nvidia-driver.

4 years agoReduce nc timeout in sys.mac.portacl.*
lwhsu [Tue, 11 Feb 2020 20:41:51 +0000 (20:41 +0000)]
Reduce nc timeout in sys.mac.portacl.*

It is not necessary to wait that long for localhost.

Sponsored by: The FreeBSD Foundation

4 years agolibmemstat: Catch up with r357776.
markj [Tue, 11 Feb 2020 20:15:49 +0000 (20:15 +0000)]
libmemstat: Catch up with r357776.

Reported by: O. Hartmann <ohartmann@walstatt.org>

4 years agoReduce lock hold time in keg_drain().
markj [Tue, 11 Feb 2020 20:06:33 +0000 (20:06 +0000)]
Reduce lock hold time in keg_drain().

Maintain a count of free slabs in the per-domain keg structure and use
that to clear the free slab list in constant time for most cases.  This
helps minimize lock contention induced by reclamation, in preparation
for proactive trimming of excesses of free memory.

Reviewed by: jeff, rlibby
Tested by: pho
Differential Revision: https://reviews.freebsd.org/D23532

4 years agoRevert https://svnweb.freebsd.org/changeset/base/357761
tuexen [Tue, 11 Feb 2020 20:02:20 +0000 (20:02 +0000)]
Revert https://svnweb.freebsd.org/changeset/base/357761

This was suggested by cem@

4 years agoFix duplicate target warning.
netchild [Tue, 11 Feb 2020 19:39:59 +0000 (19:39 +0000)]
Fix duplicate target warning.

4 years agoMark lio taskqueue as requiring network epoch.
glebius [Tue, 11 Feb 2020 19:13:34 +0000 (19:13 +0000)]
Mark lio taskqueue as requiring network epoch.

4 years agoUse NET_TASK_INIT() and NET_GROUPTASK_INIT() for drivers that process
glebius [Tue, 11 Feb 2020 18:57:07 +0000 (18:57 +0000)]
Use NET_TASK_INIT() and NET_GROUPTASK_INIT() for drivers that process
incoming packets in taskqueue context.

Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D23518

4 years agoAdd flag to struct task to mark the task as requiring network epoch.
glebius [Tue, 11 Feb 2020 18:48:07 +0000 (18:48 +0000)]
Add flag to struct task to mark the task as requiring network epoch.

When processing a taskqueue and a task has associated epoch, then
enter for duration of the task.  If consecutive tasks belong to the
same epoch, batch them.  Now we are talking about the network epoch
only.

Shrink the ta_priority size to 8-bits.  No current consumers use
a priority that won't fit into 8 bits.  Also complexity of
taskqueue_enqueue() is a square of maximum value of priority, so
we unlikely ever want to go over UCHAR_MAX here.

Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D23518

4 years agovfs: fix vhold race in mnt_vnode_next_lazy_relock
mjg [Tue, 11 Feb 2020 18:19:56 +0000 (18:19 +0000)]
vfs: fix vhold race in mnt_vnode_next_lazy_relock

vdrop can set the hold count to 0 and wait for the ->mnt_listmtx held by
mnt_vnode_next_lazy_relock caller. The routine incorrectly asserted the
count has to be > 0.

Reported by: pho
Tested by: pho

4 years agoAdd missing EPOCH(9) wrapper in ipfw(8).
hselasky [Tue, 11 Feb 2020 18:16:29 +0000 (18:16 +0000)]
Add missing EPOCH(9) wrapper in ipfw(8).

Backtrace:
panic()
ip_output()
dyn_tick()
softclock_call_cc()
softclock()
ithread_loop()

Differential Revision: https://reviews.freebsd.org/D23599
Reviewed by: glebius@ and ae@
Found by: mmacy@
Reported by: jmd@
Sponsored by: Mellanox Technologies

4 years agoDon't start an SCTP timer using a net, which has been removed.
tuexen [Tue, 11 Feb 2020 18:15:57 +0000 (18:15 +0000)]
Don't start an SCTP timer using a net, which has been removed.

Submitted by: Taylor Brandstetter
MFC after: 1 week

4 years agoamd64: remove redundant sa->code assignment from cpu_fetch_syscall_args_fallback
mjg [Tue, 11 Feb 2020 18:15:23 +0000 (18:15 +0000)]
amd64: remove redundant sa->code assignment from cpu_fetch_syscall_args_fallback

It is already set in the only caller.

4 years agocapsicum: restore the cap_rights_contains symbol
mjg [Tue, 11 Feb 2020 18:13:53 +0000 (18:13 +0000)]
capsicum: restore the cap_rights_contains symbol

It is expected to be provided by libc.

PR: 244033
Reported by:  Jan Kokemueller

4 years agoif_media.h: Add 50G KR4 ethernet media type.
kib [Tue, 11 Feb 2020 18:03:45 +0000 (18:03 +0000)]
if_media.h: Add 50G KR4 ethernet media type.

Submitted by: Adam Peace <adam.e.peace@gmail.com>
Reviewed by: hselasky
Differential revision: https://reviews.freebsd.org/D23620

4 years agoif_media.c: staticize and constify ifmedia description structures used under IFMEDIA_...
kib [Tue, 11 Feb 2020 17:45:01 +0000 (17:45 +0000)]
if_media.c: staticize and constify ifmedia description structures used under IFMEDIA_DEBUG.

The reason for this change is to make it clear the scope of the in-kernel usage
of IFM_TYPE_DESCRIPTIONS and IFM_SUBTYPE_ETHERNET_DESCRIPTIONS macros.  Also it
is somewhat better C.

Reviewed by: hselasky
Sponsored by: Mellanox Technologies
Differential revision: https://reviews.freebsd.org/D23620

4 years agoif_media.c: use __FBSDID().
kib [Tue, 11 Feb 2020 17:41:45 +0000 (17:41 +0000)]
if_media.c: use __FBSDID().

Reviewed by: hselasky
Sponsored by: Mellanox Technologies
Differential revision: https://reviews.freebsd.org/D23620

4 years agoAdd PCI Express driver for the ARM Neoverse N1 System Development
br [Tue, 11 Feb 2020 15:12:09 +0000 (15:12 +0000)]
Add PCI Express driver for the ARM Neoverse N1 System Development
Platform (N1SDP).

Neoverse N1 is a high-performance ARM microarchitecture designed
by the ARM Holdings for the server market.

The PCI part on N1SDP was shipped untested and suffers from some
integration issues.

For instance accessing to not existing BDFs causes System Error
(SError) exception. To mitigate this, the firmware scans the bus,
catches SErrors and creates a table with valid BDFs. That allows
us to filter-out accesses to invalid BDFs in this driver.

Also the root complex config space (BDF == 0) has an unusual
location in memory map, so remapping accesses to it is required.

Finally, the config space is restricted to 32-bit accesses only.

This was tested on the ARM boxes kindly provided by the ARM Ltd
to the DARPA CHERI Project.

In collaboration with: andrew
Reviewed by: andrew
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D23349

4 years agoUse an int instead of a bool variable, since bool is not supported
tuexen [Tue, 11 Feb 2020 14:00:27 +0000 (14:00 +0000)]
Use an int instead of a bool variable, since bool is not supported
on all platforms the stack is running on in userland.

4 years agoMFV r357712: file 5.38.
delphij [Tue, 11 Feb 2020 07:02:48 +0000 (07:02 +0000)]
MFV r357712: file 5.38.

MFC after: 2 weeks

4 years agobackup-passwd: mask out all passwords in the diff
kevans [Tue, 11 Feb 2020 06:12:02 +0000 (06:12 +0000)]
backup-passwd: mask out all passwords in the diff

The previous expression borked if a username had a plus or hyphen in it.
This is needlessly restrictive- at leSt a hyphen in the middle is valid.
Instead of playing this game, let's just assume the username can't contain a
colon and mask out the second field.

Submitted by: sigsys gmail com
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D23548

4 years agoMount /dev while deinstalling pkg inside EC2 AMIs.
cperciva [Tue, 11 Feb 2020 04:05:45 +0000 (04:05 +0000)]
Mount /dev while deinstalling pkg inside EC2 AMIs.

This gets rid of (harmless) warnings:
"pkg: Cannot open /dev/null:No such file or directory".

MFC after: 2 weeks

4 years agoRemove /qemu from EC2 ARM AMIs
cperciva [Tue, 11 Feb 2020 04:03:22 +0000 (04:03 +0000)]
Remove /qemu from EC2 ARM AMIs

I forgot to do this as part of r345858 -- I added it to the
vm_extra_pre_umount in vmimage.subr but forgot that function
was overridden in the EC2 build.

MFC after: 2 weeks

4 years agovfs: fix device count leak on vrele racing with vgone
mjg [Mon, 10 Feb 2020 22:28:54 +0000 (22:28 +0000)]
vfs: fix device count leak on vrele racing with vgone

The race is:

CPU1                                CPU2
                                    devfs_reclaim_vchr
make v_usecount 0
                                      VI_LOCK
                                      sees v_usecount == 0, no updates
                                      vp->v_rdev = NULL;
                                      ...
                                      VI_UNLOCK
VI_LOCK
v_decr_devcount
  sees v_rdev == NULL, no updates

In this scenario si_devcount decrement is not performed.

Note this can only happen if the vnode lock is not held.

Reviewed by: kib
Tested by: pho
Differential Revision: https://reviews.freebsd.org/D23529

4 years agoRestore the behavior of allowing empty string in a string sysctl
lwhsu [Mon, 10 Feb 2020 20:53:59 +0000 (20:53 +0000)]
Restore the behavior of allowing empty string in a string sysctl

Added as a special case to avoid unnecessary memory operations.

Reviewed by: delphij
Sponsored by: The FreeBSD Foundation

4 years agoFix for unbalanced EPOCH(9) usage in the generic kernel interrupt
hselasky [Mon, 10 Feb 2020 20:23:08 +0000 (20:23 +0000)]
Fix for unbalanced EPOCH(9) usage in the generic kernel interrupt
handler.

Interrupt handlers are removed via intr_event_execute_handlers() when
IH_DEAD is set. The thread removing the interrupt is woken up, and
calls intr_event_update(). When this happens, the ie_hflags are
cleared and re-built from all the remaining handlers sharing the
event. When the last IH_NET handler is removed, the IH_NET flag will
be cleared from ih_hflags (or ie_hflags may still be being rebuilt in
a different context), and the ithread_execute_handlers() may return
with ie_hflags missing IH_NET. This can lead to a scenario where
IH_NET was present before calling ithread_execute_handlers, and is not
present at its return, meaning the need for epoch must be cached
locally.

This can happen when loading and unloading network drivers. Also make
sure the ie_hflags is not cleared before being updated.

This is a regression issue after r357004.

Backtrace:
panic()
# trying to access epoch tracker on stack of dead thread
_epoch_enter_preempt()
ifunit_ref()
ifioctl()
fo_ioctl()
kern_ioctl()
sys_ioctl()
syscallenter()
amd64_syscall()

Differential Revision: https://reviews.freebsd.org/D23483
Reviewed by: glebius@, gallatin@, mav@, jeff@ and kib@
Sponsored by: Mellanox Technologies

4 years agoUse __riscv instead of __riscv__
imp [Mon, 10 Feb 2020 18:28:02 +0000 (18:28 +0000)]
Use __riscv instead of __riscv__

I misread arch(7) when I added this...

Noticed by: jhb@ and mhorne@

4 years agoModify the vm.panic_on_oom sysctl to take a count of events.
jtl [Mon, 10 Feb 2020 18:06:38 +0000 (18:06 +0000)]
Modify the vm.panic_on_oom sysctl to take a count of events.

Currently, the vm.panic_on_oom sysctl is a boolean which controls the
behavior of the VM system when it encounters an out-of-memory situation.
If set to 0, the VM system kills the largest process. If set to any other
value, the VM system will initiate a panic.

This change makes the sysctl a count of events. If set to 0, the VM system
kills the largest process. If set to any other value, the VM system will
kill the largest process until it has seen the specified number of
out-of-memory events. Once it reaches the specified number of events, it
will initiate a panic.

This change is helpful in capturing cores when the system is in a perpetual
cycle of out-of-memory events (as opposed to just hitting one or two
sporadic out-of-memory events).

Reviewed by: kib
MFC after: 2 weeks
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D23601

4 years agoRemove ifdefs for ia64 and sparc64.
imp [Mon, 10 Feb 2020 17:17:08 +0000 (17:17 +0000)]
Remove ifdefs for ia64 and sparc64.

Reivewed by: cy@, bcr@
Differential Revision: https://reviews.freebsd.org/D23593

4 years agoRefresh architecture list with latest:
imp [Mon, 10 Feb 2020 17:17:03 +0000 (17:17 +0000)]
Refresh architecture list with latest:

Remove: sparc, sparc64 (twice), ia64, alpha
Add: riscv64

Remove now-useless sparc64 ifdef

Reivewed by: cy@, bcr@
Differential Revision: https://reviews.freebsd.org/D23593