Commit Graph

131714 Commits

Author SHA1 Message Date
Kristof Provost
dd00a42a6b bridge: Change lists to CK_LIST as a peparation for epochification
Prepare the ground for a rework of the bridge locking approach. We will
use an epoch-based approach in the datapath and making it safe to
iterate over the interface, span and rtnode lists without holding the
BRIDGE_LOCK. Replace the relevant lists by their ConcurrencyKit
equivalents.

No functional change in this commit.

Reviewed by:	emaste, ae, philip (previous version)
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D24249
2020-04-05 17:15:20 +00:00
Jason A. Harmening
407a5b7953 mac_policy: Remove mac_policy_sx
This lock was made unnecessary by the addition of mac_policy_rms in r356120.

Reviewed by:	mjg, kib
Differential Revision:	https://reviews.freebsd.org/D24283
2020-04-04 04:03:10 +00:00
Ed Maste
2efe3be95e vt: avoid overrun when stride is not a multiple of bytes per pixel
The reporter is developing a frame buffer driver for hardware using
3 bytes per pixel, but a stride that's a multiple of 256.  Previously
this resulted in writing beyond the end of each stride.  On the last
row this attempted to write past the end of the frame buffer, triggering
the assertion in vt_fb_mem_wr1().

PR:		243533
MFC after:	2 weeks
Submitted by:	Thomas Skibo
2020-04-04 00:31:30 +00:00
Justin Hibbits
ccb1ebe01c powerpc/amigaone: Add CPLD driver for AmigaOne A1222 "Tabor"
Like the X5000, the main CPLD on the A1222 is the communication medium
between the CPU and the GPIO CPLD.  It provides a mailbox communication
feature, along with dual-port RAM accessible from both the CPU and GPIO
CPLD, and 3 fan speed reporting registers.
2020-04-03 20:45:16 +00:00
Kirk McKusick
2baca88584 When shrinking the size of a directory it is sometimes necessary to
sync it to disk before shrinking it. Complete the sync before getting
the buffer for the block to be updated to do the shrink to avoid
panicing with a recursive lock on one of the directory's buffers.

Reviewed by:  Chuck Silvers (chs)
MFC after:    3 days
Sponsored by: Netflix
2020-04-03 20:43:25 +00:00
Kirk McKusick
aedb9cc662 Convert DOINGSOFTDEP, MOUNTEDSOFTDEP, DOINGSUJ, and MOUNTEDSUJ to being
boolean expressions so that their values are not lost when assigned to
`bool' or `int' variables.

Reviewed by:  Chuck Silvers (chs)
MFC after:    3 days
Sponsored by: Netflix
2020-04-03 20:30:45 +00:00
Mark Johnston
c205ac921b geom_journal: Only stop the switcher process if one was started.
PR:		243196
MFC after:	1 week
2020-04-03 13:57:41 +00:00
Conrad Meyer
1e9ee2b596 ddb(4): show lockchain: Don't dereference LK_KERNPROC
Also, print a little more information for otherwise unhandled inhibited states.

Finally, improve the grammar of some prints.  Some of the print statements
missing verb.

Sponsored by:	Dell EMC Isilon
2020-04-02 20:47:51 +00:00
Alexander V. Chernikov
66bc03d415 Use interface fib for proxyarp checks.
Before the change, proxyarp checks for src and dst addresses
 were performed using default fib, breaking multi-fib scenario.

PR:		245181
Submitted by:	Scott Aitken (original version)
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D24244
2020-04-02 20:06:37 +00:00
Ian Lepore
78c1387f4c Add the Cadence GEM ethernet driver to NOTES so that it gets built with
LINT kernels.  Move the config for it from files.<arch> files into the
main config (conf/files), because it works on multiple platforms now.
2020-04-02 19:06:05 +00:00
Ian Lepore
f674004f5d Cadence GEM ethernet driver style clean-up, no functional changes.
This is mostly indentation whitespace, and reflowing a few multiline
comments.  This gets a bunch of minor stuff out of the way so that the diffs
for style don't clutter up the diffs for some upcoming functional changes.

Submitted by:	Thomas Skibo
Differential Revision:	https://reviews.freebsd.org/D24226
2020-04-02 17:57:40 +00:00
John Baldwin
1b96435a65 Avoid checking pointers that are never NULL.
Coverity noted that cod pointer is always non-NULL at the end of
cryptodev_aead().  While here, fix cryptodev_op() to match by making
one earlier failure case before cod and crp are allocated just return
directly.

CID:		1422185
Reported by:	Coverity
2020-04-02 17:22:16 +00:00
John Baldwin
54ae1f3308 Remove duplicate conditional.
CID:		1422192
Reported by:	Coverity
2020-04-02 16:55:28 +00:00
Takanori Watanabe
3cba89e6f8 Fix mbuf handling in le advertize packet processing.
Submitted by: Marc Veldman <marc at bumblingdork.com>
2020-04-02 09:15:31 +00:00
Nick O'Brien
96d3575edc riscv/sifive: add FE310 Always-on driver
This driver supports SiFive's FE310 Always-on (AON) peripheral's
Real-time clock (RTC) and Watchdog timer (WDT). AON has other
functionality that this driver could support such as the power
management unit (PMU) but that functionality hasn't been implemented.

Reviewed by:	philip (mentor), kp (mentor)
Approved by:	philip (mentor)
Sponsored by:	Axiado
Differential Revision:	https://reviews.freebsd.org/D24170
2020-04-02 00:33:15 +00:00
John Baldwin
59838c1a19 Retire procfs-based process debugging.
Modern debuggers and process tracers use ptrace() rather than procfs
for debugging.  ptrace() has a supserset of functionality available
via procfs and new debugging features are only added to ptrace().
While the two debugging services share some fields in struct proc,
they each use dedicated fields and separate code.  This results in
extra complexity to support a feature that hasn't been enabled in the
default install for several years.

PR:		244939 (exp-run)
Reviewed by:	kib, mjg (earlier version)
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D23837
2020-04-01 19:22:09 +00:00
John Baldwin
02cb5b4be8 Set crp_ilen for crypto requests.
Assertions in crypto_dispatch() depend on this value being set to
verify that payload and AAD regions are in bounds.  Also, requests
that use a single kernel buffer rely on this to know how long the
buffer is for bus_dma, etc.

Reported by:	kp
2020-04-01 17:09:21 +00:00
Warner Losh
24ae19c414 Start the retirement process for ufm
This driver hasn't been relevant in almost 15 years. It was for a product on the
shelves for about 6 months in 2003/2004. I've not updated the driver since then,
and have had nobody talk to me about it since maybe 2006 or 2007. It doesn't
implement a standard interface, and can be better done with libusb. All the
action has moved to webcamd for newer, more fully featured hardware. It makes no
appearances in the nycbug dmesg archive.

Relnotes: yes
MFC After: 3 days
2020-04-01 16:22:31 +00:00
Konstantin Belousov
bd8a359f81 x86 tsc: fall back to CPUID if calibration results looks unbelievable.
Teested and reviewed by:	scottl
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D24247
2020-04-01 16:21:11 +00:00
Jason A. Harmening
8abaf6a7c8 deadlkres: include thread name in panic messages
Reviewed by:	markj
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D24235
2020-04-01 04:51:39 +00:00
Alexander Motin
274328a4ef Add support for AHCI BIOS/OS Handoff.
This allows clean handoff from BIOS implementing some asynchronous I/O to
the OS AHCI driver.  During attach driver declares OS ownership request
and waits from 25ms to 2s for BIOS to complete operation and release the
hardware.

MFC after:	2 weeks
2020-04-01 03:27:47 +00:00
Alexander Motin
16b766eed4 Add ID for JMicron JMB582/JMB585 AHCI controller.
JMB582 has 2 6Gbps SATA ports and PCIe 3.0 x1.
JMB585 has 5 6Gbps SATA ports and PCIe 3.0 x2.

Both chips support AHCI v1.31, Port Multiplier with FBS and 8 MSI vectors.

MFC after:	2 weeks
2020-04-01 03:19:42 +00:00
Andrey V. Elsukov
cfad769689 Ignore ND6 neighbor advertisement received for static link-layer entries.
Previously such NA could override manually created LLE.

Reported by:	Martin Beran <martin at mber cz>
Reviewed by:	melifaro
MFC after:	10 days
2020-04-01 02:13:01 +00:00
Ravi Pokala
144af011b4 Fix build for mips.XLP64 kernel, by re-ordering headers
The log for the failure contained errors like this:

| In file included from ${SRCTOP}/sys/mips/nlm/dev/net/xlpge.c:34:
| In file included from ${SRCTOP}/sys/sys/systm.h:44:
| In file included from ./machine/atomic.h:849:
| ${SRCTOP}/sys/sys/_atomic_subword.h:222:37: error: unknown type name 'u_long'; did you mean 'long'?
| atomic_testandset_acq_long(volatile u_long *p, u_int v)
|                                     ^~~~~~
|                                     long

And similar "unknown type name" errors for u_int, not recognizing bool as a type, etc.

This was caused by including <sys/param.h> too far down; move it up where it belongs.

While here, add a blank line after '__FBSDID()', in keeping with convention.

Reviewed by:	emaste
Sponsored by:	Panasas
Differential Revision:	https://reviews.freebsd.org/D24242
2020-03-31 20:09:20 +00:00
Michael Tuexen
413c3db101 Allow the TCP backhole detection to be disabled at all, enabled only
for IPv4, enabled only for IPv6, and enabled for IPv4 and IPv6.
The current blackhole detection might classify a temporary outage as
an MTU issue and reduces permanently the MSS. Since the consequences of
such a reduction due to a misclassification are much more drastically
for IPv4 than for IPv6, allow the administrator to enable it for IPv6 only.

Reviewed by:		bcr@ (man page), Richard Scheffenegger
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D24219
2020-03-31 15:54:54 +00:00
Takanori Watanabe
c30797873f Add Platform Controller Hub built-in thermal management device driver.
Differential Revision:	https://reviews.freebsd.org/D24077
2020-03-31 06:25:43 +00:00
Mark Johnston
431f2b8712 Use a dedicated taskqueue thread for in6m_release_task().
Interfaces may be detached from a taskqueue_thread task, for example by
prison_complete(), so after r359438, when draining the queue we may end
up deadlocking.

Reported by:	Jenkins via lwhsu
MFC with:	r359438
2020-03-31 02:25:53 +00:00
Bryan Drewery
adc0388117 Remove dead code leftover from r331018.
Sponsored by:	Dell EMC
2020-03-31 01:12:53 +00:00
Andrew Gallatin
c4ad247b7a KTLS: Coalesce adjacent TLS trailers & headers to improve PCIe bus efficiency
KTLS uses the embedded header and trailer fields of unmapped
mbufs. This can lead to "silly" buffer lengths, where we have an
mbuf chain that will create a scatter/gather lists with a
regular pattern of 13 bytes followed by 16 bytes between each
adjacent TLS record.

For software ktls we typically wind up with a pattern where we
have several TLS records encrypted, and made ready at once. When
these records are made ready, we can coalesce these silly buffers
in sbready_compress by copying 13b TLS header of the next record
into the 16b TLS trailer of the current record. After doing so,
we now have a small 29 byte chunk between each TLS record.

This marginally increases PCIe bus efficiency. We've seen an
almost 1Gb/s increase in peak throughput on Broadwell based Xeons
running a 100% software TLS workload with Mellanox ConnectX-4
NICs.

Note that this change is ifdef'ed for KTLS, as KTLS is currently
the only user of the hdr/trailer feature of unmapped mbufs, and
peeking into them is expensive, since the ext_pgs struct lives in
separately allocated memory, and may be cold in cache.

This optimization is not applicable to HW ("NIC") TLS, as that
depends on having the entire TLS record described by a single
unmapped mbuf, so we cannot shift parts of the record between
mbufs for HW TLS.

Reviewed by:	jhb, hselasky, scottl
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D24204
2020-03-30 23:29:53 +00:00
Konstantin Belousov
c506a6386f kern_sendfile.c: fix bugs with handling of busy page states.
- Do not call into a vnode pager while leaving some pages from the
  same block as the current run, xbusy. This immediately deadlocks if
  pager needs to instantiate the buffer.
- Only relookup bogus pages after io finished, otherwise we might
  obliterate the valid pages by out of date disk content.  While there,
  expand the comment explaining this pecularity.
- Do not double-unbusy on error.  Split unbusy for error case, which
  is left in the sendfile_swapin(), from the more properly coded
  normal case in sendfile_iodone().
- Add an XXXKIB comment explaining the serious bug in the validation
  algorithm, not fixed by this patch series.

PR:	244713
Reviewed by:	glebius, markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D24038
2020-03-30 22:13:32 +00:00
Konstantin Belousov
d866353677 kern_sendfile.c: do not release sfio reference on error.
It is already done by sendfile_iodone(), now consistently for all errors.
This de-facto reverts r358597, after r359466.

Reviewed by:	glebius, markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D24038
2020-03-30 22:01:36 +00:00
Konstantin Belousov
59e1ac9d79 kern_sendfile.c: wait for all in-flight ios completion before unwiring pages.
Reviewed by:	glebius, markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D24038
2020-03-30 21:57:28 +00:00
Konstantin Belousov
8f0a223c78 kern_sendfile.c: add specific malloc type.
Now sfio leaks are more easily seen in the malloc statistics than
e.g. just wired or busy pages leak.

Reviewed by:	glebius, markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D24038
2020-03-30 21:50:51 +00:00
Konstantin Belousov
abfdf76791 VOP_GETPAGES_ASYNC(): consistently call iodone() callback in case of error.
Reviewed by:	glebius, markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D24038
2020-03-30 21:44:30 +00:00
Konstantin Belousov
bbca4bd7cd buffer pager: skip bogus pages.
We cannot validate bogus page by reading a buffer.

PR:	244713
Reviewed by:	glebius, markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D24038
2020-03-30 21:42:46 +00:00
Konstantin Belousov
0ac8511aef kern_sendfile.c style: order headers alphabetically.
Reviewed by:	glebius, markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D24038
2020-03-30 21:40:35 +00:00
Hans Petter Selasky
98029019b6 Fine grain locking inside the cuse(3) kernel module.
Implement one mutex per cuse(3) server instance which also cover the
clients belonging to the given server instance.

This should significantly reduce the mutex congestion inside the
cuse(3) kernel module when multiple servers are in use.

MFC after:	1 week
Sponsored by:	Mellanox Technologies
2020-03-30 18:25:43 +00:00
Ed Maste
fa9ce9ac29 capabilities.conf: provide information about capmode permitted syscalls
Reviewed by:	jhb (earlier)
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D24118
2020-03-30 18:24:07 +00:00
Christian S.J. Peron
b1c170686c Make sure we convert internal audit records for thr_new
into BSM records.

MFC after:	2 weeks
2020-03-30 18:15:36 +00:00
Hans Petter Selasky
86c9b3f3a6 Add support for multiple playback and recording devices per physical USB audio
device. This requires some structural refactoring inside the driver, mostly
about converting existing audio channel structures into arrays.

The main audio mixer is provided by the first PCM instance.
The non-first audio instances may only have a software mixer for PCM playback.

Tested by:	Horse Ma <Shichun.Ma@dell.com>
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2020-03-30 16:50:32 +00:00
Justin Hibbits
abc00e5fb9 powerpc/pmap: Replace a logical TAILQ_FOREACH_SAFE with the real thing
No functional change, just cleanup.
2020-03-30 16:32:55 +00:00
Ed Maste
aeb665b538 remove extraneous double ;s in sys/ 2020-03-30 16:04:25 +00:00
Hans Petter Selasky
93e39e2325 Implement new mixer API to return the device pointer based on the mixer pointer.
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2020-03-30 15:36:38 +00:00
Hans Petter Selasky
8e2e5ae7d1 Evaluate modifier keys before the regular keys, so that if a modifier
key is pressed at the same time as a regular key, that means key with
modifier is output. Some automated USB keyboards like Yubikeys need this.

This fixes a regression issue after r357861.

Reported by:	Adam McDougall <mcdouga9@egr.msu.edu>
PR:		224592
PR:		233884
MFC after:	3 days
Sponsored by:	Mellanox Technologies
2020-03-30 15:29:39 +00:00
Mark Johnston
9b1d850be8 Remove the "config" taskqgroup and its KPIs.
Equivalent functionality is already provided by taskqueue(9), just use
that instead.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2020-03-30 14:24:03 +00:00
Mark Johnston
9893ab3f50 Fix accounting of hwpmc's thread descriptor freelist.
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2020-03-30 14:23:08 +00:00
Mark Johnston
59d50fe5ef Simplify taskqgroup inititialization.
taskqgroup initialization was broken into two steps:

1. allocate the taskqgroup structure, at SI_SUB_TASKQ;
2. initialize taskqueues, start taskqueue threads, enqueue "binder"
   tasks to bind threads to specific CPUs, at SI_SUB_SMP.

Step 2 tries to handle the case where tasks have already been attached
to a queue, by migrating them to their intended queue.  In particular,
tasks can't be enqueued before step 2 has completed.  This breaks NFS
mountroot on systems using an iflib-based driver when EARLY_AP_STARTUP
is not defined, since mountroot happens before SI_SUB_SMP in this case.

Simplify initialization: do all initialization except for CPU binding at
SI_SUB_TASKQ.  This means that until CPU binding is completed, group
tasks may be executed on a CPU other than that to which they were bound,
but this should not be a problem for existing users of the taskqgroup
KPIs.

Reported by:	sbruno
Tested by:	bdragon, sbruno
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D24188
2020-03-30 14:22:52 +00:00
Alan Somers
9338f18965 fusefs: add a dtrace probe that fires after mounting is complete
This probe is useful for showing the protocol options negotiated with a FUSE
server.

MFC after:	2 weeks
2020-03-30 14:03:35 +00:00
Vladimir Kondratyev
006eb44926 evdev: return error rather than zero-length data on blocked read()
if blocked process has been woken up by evdev device destruction.

MFC after:	2 weeks
2020-03-29 23:01:36 +00:00
Vladimir Kondratyev
80ddbddfd7 evdev: Add COMPAT_FREEBSD32 support for amd64 arch
Incompatibility between i386 and amd64 evdev ABIs was caused by presence of
'struct timeval' in evdev protocol. Replace it with 'struct timeval32' for
32 bit binaries.

Big-endian platforms may require additional work due to bitstr_t (array of
unsigned longs) usage in ioctl interface.

MFC after:	2 weeks
2020-03-29 23:00:33 +00:00