Commit Graph

271450 Commits

Author SHA1 Message Date
John Baldwin
7def1e10b3 bus_dma: Deduplicate locking helper functions.
- Move busdma_lock_mutex to subr_bus_dma.c.

- Move _busdma_lock_dflt to subr_bus_dma.c.  This function was named a
  couple of different things previously.  It is not a public API but
  an internal helper used in place of a NULL pointer.  The prototype
  is in <sys/bus_dma.h> as not all backends include
  <sys/bus_dma_internal.h>.

Reviewed by:	kib
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D33694
2022-01-05 13:50:40 -08:00
John Baldwin
85b4607324 Deduplicate bus_dma bounce code.
Move mostly duplicated code in various MD bus_dma backends to support
bounce pages into sys/kern/subr_busdma_bounce.c.  This file is
currently #include'd into the backends rather than compiled standalone
since it requires access to internal members of opaque bus_dma
structures such as bus_dmamap_t and bus_dma_tag_t.

Reviewed by:	kib
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D33684
2022-01-05 13:50:40 -08:00
Warner Losh
ca1e55df24 hier: Remove mips and sparc64
These have been removed from the kernel, so should be removed here.

Sponsored by:		Netflix
2022-01-05 14:38:05 -07:00
Warner Losh
9a498f9a14 lio: remove from NOIP
It doesn't build here. This was masked earlier by other build breakage.

Sponsored by:		Netflix
2022-01-05 14:19:34 -07:00
Alexander Motin
ce88117008 atkbd: Disable periodic polling by default.
It is one of the few remaining Giant-locked callouts.  It would be
good to remove it, not mentioning that polling itself is not good.

If this cause keyboard/mouse freezes on some hardware, please set
loader tunable hw.atkbd.hz=1 as workaround and report the issue.

Submitted by:	imp, jhb
2022-01-05 15:12:58 -05:00
Navdeep Parhar
f3c2987f2f cxgbe(4): Do not request an FEC that is invalid for the requested speed.
This eliminates error messages like this from the driver when running at
50Gbps with 100G cables:
[3726] cc0: l1cfg failed: 71
[4407] cc0: l1cfg failed: 71

Note that link comes up anyway with or without this change.

Reported by:	Suhas Lokesha @ Chelsio
MFC after:	1 week
Sponsored by:	Chelsio Communications
2022-01-05 11:15:34 -08:00
Alexander Motin
9e007a88d6 atkbd: Reduce polling rate from 10Hz to ~1Hz.
In my understanding this is only needed to workaround lost interrupts.
I was thinking to remove it completely, but the comment about edge-
triggered interrupt may be true and needs deeper investigation.  ~1Hz
should be often enough to handle the supposedly rare loss cases, but
rare enough to not appear in top.  Add sysctl hw.atkbd.hz to tune it.

MFC after:	1 month
2022-01-05 11:41:26 -05:00
Mark Johnston
4558c11f1b bhyve: Correct unmapping of the MSI-X table BAR
The starting address passed to mprotect was wrong, so in the case where
the last page containing the table is not the last page of the BAR, the
wrong region would be unmapped.

Reported by:	Andy Fiddaman <andy@omniosce.org>
Reviewed by:	jhb
Fixes:		7fa2335347 ("bhyve: Map the MSI-X table unconditionally for passthrough")
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33739
2022-01-05 10:12:09 -05:00
Mark Johnston
76b45e688a bhyve: Map the right BAR in init_msix_table()
The PBA and MSI-X table can reside in different BARs.

Reported by:	Andy Fiddaman <andy@omniosce.org>
Reviewed by:	jhb
Fixes:		7fa2335347 ("bhyve: Map the MSI-X table unconditionally for passthrough")
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33739
2022-01-05 10:12:09 -05:00
Andrew Turner
459e0b92e8 Use the arm64 ttbr macro to define the ASID shift
Now we have a macro to descrive the arm64 TTBR registers use it in the
ASID_TO_OPERAND pmap macro.

Sponsored by:	The FreeBSD Foundation
2022-01-05 14:56:25 +00:00
Andrew Turner
0accd72674 Add the arm64 TTBR fields to armreg.h
Sponsored by:	The FreeBSD Foundation
2022-01-05 14:56:25 +00:00
Ed Maste
a6668e31aa Fix kernel build without INET and INET6
Reviewed by:	brooks, melifaro
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33718
2022-01-05 09:41:38 -05:00
Andrew Turner
ce1e5d0d5e Add a missing space in the arm64 sendsig
Sponsored by:	The FreeBSD Foundation
2022-01-05 12:38:54 +00:00
Andrew Turner
fbdca14953 Remove the sigcode base check on arm64
This was added with the shared page support. It is unused as we always
enable the shared page on FreeBSD executables on arm64.
2022-01-05 11:57:38 +00:00
Peter Holm
dfc383201f stress2: Added new test cases 2022-01-05 10:27:29 +01:00
Edward Tomasz Napierala
bd8077ee84 linux(4): man page tweaks
Advertise rc.conf method as the right way to enable it, mention
file system mapping... and change some wording.

Reviewed By:	emaste, debdrup, Pau Amma
Sponsored By:	EPSRC
Differential Revision:	https://reviews.freebsd.org/D33720
2022-01-05 08:16:48 +00:00
Gleb Smirnoff
3f6ab5493f vtnet: don't leak pfil(9) data on detach
PR:		260667
Submitted by:	<ghuckriede blackberry.com>
2022-01-04 18:41:05 -08:00
Warner Losh
81ec547fbd bsd.endian.mk: Allow for the cross building case
We need to include bsd.endian.mk from bsd.compiler.mk to enable
compressed symbols only on FreeBSD little endian targets.

However, since we include bsd.compiler.mk from Makefile.inc1 and from
the build tools makefiles, it has to work on Linux and osx. Make the
error condition only when we're building natively (so that we are
forced to add a new architecture to the list).

Otherwise, define bogus, poisoned values and leave TARGET_ENDIANNESS
undefined.  Since we don't actually use TARGET_ENDIANNESS for anything
in the cross building phase, these values are a failsafe agianst their
use. The one place in the build phase that detects endian is
appropriately protected.

Sponsored by:		Netflix
Reviewed by:		jrtc27
Differential Revision:	https://reviews.freebsd.org/D33742
2022-01-04 16:17:17 -07:00
Warner Losh
b4dda138e8 neta: clk code ifdef'd aarch64
So #ifdef the clk.h include aarch64. Otherwise the right kernel options
aren't always present.

Sponsored by:		Netflix
2022-01-04 16:01:14 -07:00
Warner Losh
c47e2e5170 neta: need clknode_if.h
clknode_if.h is needed for this device on aarch64. Create it always.

Sponsored by:		Netflix
2022-01-04 16:01:14 -07:00
Warner Losh
44796b7e82 mips: remove saf1761
The saf1761 OTG support was only for mips targets (BERI?). Retire it.

Sponsored by:		Netflix
Reviewed by:		brooks
Differential Revision:	https://reviews.freebsd.org/D33706
2022-01-04 16:01:14 -07:00
John Baldwin
822fa6758b Bump Dd for crypto_clonereq.
Fixes:		74d3f1b63d OCF: Add crypto_clonereq().
2022-01-04 14:46:24 -08:00
John Baldwin
8903d8e37f iscsi: Pass the request PDU to icl_conn_transfer_setup().
This matches icl_conn_task_setup() which passes the PDU and avoids the
need for a layering violation in cxgbei to fetch the request PDU from
the ctl_io.

Reviewed by:	mav
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D33746
2022-01-04 14:37:17 -08:00
John Baldwin
e43cf698d9 ccr: Use a software OCF session for requests which fallback to software.
Previously the driver duplicated code from cryptosoft.c to handle
certain edge case AES-CCM and AES-GCM requests.  However, this
approach has a few downsides:

1) It only uses "plain" software and not accelerated software since it
   uses enc_xform directly.

2) It performs the operation synchronously even though the caller
   believes it is invoking an async driver.  This was fine for the
   original use case of requests with only AAD and no payload that
   execute quickly, but is a bit more disingenuous for large requests
   which fall back due to exceeding the size of a firmware work
   request (e.g. due to large scatter/gather lists).

3) It has required several updates since ccr(4) was added to the tree.

Instead, allocate a software session for AES-CCM and AES-GCM sessions
and dispatch a cloned request asynchronusly to the software session.

Reviewed by:	markj
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D33608
2022-01-04 14:22:32 -08:00
John Baldwin
74d3f1b63d OCF: Add crypto_clonereq().
This function clones an existing crypto request, but associates the
new request with a specified session.  The intended use case is for
drivers to be able to fall back to software by cloning a request and
dispatch it to an internally allocated software session.

Reviewed by:	markj
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D33607
2022-01-04 14:22:12 -08:00
John Baldwin
753c851387 sigev_findtd: Fix whitespace nit in argument list.
Obtained from:	CheriBSD
2022-01-04 13:37:39 -08:00
Warner Losh
f3d7ace4b2 file: Turns out we need xlocal.h protection
It turns out that we still need xlocal.h protection for when we're
cross building on Linux. Linux doesn't have this file, but os/x
does. Before, we'd assume we didn't have it, like old FreeBSD, when
cross compiling. After the latest update, all that code was removed so
cross compiling needs to be handled separaetly. Do so by defining
HAVE_XLOCALE_H only when we're not building on linux. This allows us
to build the mkmagic build tool needed to build file(1).

Sponsored by:		Netflix
Reviewed by:		jrtc27
Differential Revision:	https://reviews.freebsd.org/D33741
2022-01-04 14:12:59 -07:00
Warner Losh
d373e61ef3 bsd.endian.mk: Sort architecture list
Sort arm alphabetically.

Reviewed by:		emaste
Differential Revision:	https://reviews.freebsd.org/D33744

Sponsored by:		Netflix
2022-01-04 13:57:47 -07:00
Justin Hibbits
3a9688f8bc busdma: Fix powerpc DMA alignment check
The original logic was to check if there's no filter and the address is
misaligned relative to the requirements.  The refactoring in
c606ab59e7 missed this, and instead caused
it to return failure if the address *is* properly aligned.
2022-01-04 09:24:03 -06:00
Cy Schubert
ad07e93fe1 ipfilter: Fix manpage typos
Reported by:	jrtc27
Fixes:		2582ae5740
MFC after:	1 month
2022-01-04 07:11:00 -08:00
Mark Johnston
ed166a0173 mvneta: Unconditionally print an error message if mii_attach() fails
The error message is useful for diagnosing mvneta_attach() failures.

MFC after:	1 week
2022-01-04 09:46:23 -05:00
Mark Johnston
e2576591b9 libsysdecode: Decode sendmsg/recvmsg flags containing an underscore
Otherwise MSG_CMSG_CLOEXEC is not decoded.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2022-01-04 09:46:23 -05:00
Edward Tomasz Napierala
f7b04c53de linux(4): Reduce diffs between linux_rt_sendsig() and sendsig()
No functional changes (except for the uprintf).

Discussed With:	kib
Sponsored By:	EPSRC
2022-01-04 14:39:19 +00:00
Edward Tomasz Napierala
562bc0a943 Unstaticize {get,set}_fpcontext() on amd64
This will be used to fix Linux signal delivery.

Discussed With:	kib
Sponsored By:	EPSRC
2022-01-04 13:25:12 +00:00
Hubert Mazur
4885d6f3ec if_mvneta: Use clock frequency
Make neta use frequency obtained from clock, instead of
hardcoded one. Use default frequency in case of clock
device failure. Remove unnecessary function calls
to obtain frequency and use cached one instead.

Reviewed by:		manu
Obtained from:		Semihalf
Differential revision:	https://reviews.freebsd.org/D32336
2022-01-04 13:26:35 +01:00
Hubert Mazur
f21c469dbc Add driver for marvell, a37x0 peripheral clocks
Add driver for Marvell, Armada-37xx peripheral clock.
Register clocks for various peripheral devices in
north bridge or south bridge domain. Dump clock's
domain while verbose boot.

Reviewed by:
Obtained from:		Semihalf
Differential revision:	https://reviews.freebsd.org/D32294
2022-01-04 13:26:35 +01:00
Hubert Mazur
127e4d9524 Add driver for armada, 37x0-tbg-clock
Driver for tbg clocks. Read reference frequency from parent
and modify it depending on parameters read from register.

Reviewed by:		manu
Obtained from:		Semihalf
Differential revision:	https://reviews.freebsd.org/D32293
2022-01-04 13:26:34 +01:00
Hubert Mazur
01b9c59fd2 Add driver for marvell, armada-3700 oscillator
Driver registers new clock device. Clock frequency is set depending
on tenth bit's value obtained from syscon register. Full information
about the clock is dumped if bootverbose is enabled.

Driver was tested on EspressoBin.

Reviewed by:		manu
Obtained from:		Semihalf
Differential revision:	https://reviews.freebsd.org/D32292
2022-01-04 13:26:34 +01:00
Hans Petter Selasky
fff236e89d mixer(3): Revert: "Fix for header file pollution."
Differential Revision:	https://reviews.freebsd.org/D33732
Submitted by:	christos@
MFC after:	1 week
Sponsored by:	NVIDIA Networking
2022-01-04 12:35:23 +01:00
Cy Schubert
cc3e5b372e ipfilter userland: Fix typos
Reported by:	netchild
Fixes:		2582ae5740
MFC after:	1 month
2022-01-04 03:08:51 -08:00
Hans Petter Selasky
55224280e2 mixer(3): Fix for header file pollution.
Differential Revision:	https://reviews.freebsd.org/D33732
Submitted by:	christos@
MFC after:	1 week
Sponsored by:	NVIDIA Networking
2022-01-04 11:43:59 +01:00
Xin LI
43a5ec4eb4 file: upgrade to 5.41.
MFC after:	2 weeks
2022-01-03 22:03:39 -08:00
Cy Schubert
a3522837b0 ipfilter userland: Fix branch mismerge
The work to ANSIfy and adjust returns to style(9) resulted in a mismerge
of a stash when ipfilter was moved from contrib to sbin. An older file
replaced WIP at the time, resulting in a regression.

The majority of this work was done in 2018 saved as git stashes within
a git-svn tree and migrated to the git tree. The regression occurred
when the various stashes were sequentially merged to create individual
commits, following the ipfilter move to netpfil and sbin.

Reported by:	jrtc27
Fixes:		2582ae5740
Pointy hat to:	cy
MFC after:	1 month
2022-01-03 19:39:24 -08:00
Cy Schubert
44bc301921 ipfilter userland: Style(9) requires a space after return
Reported by:    jrtc27
Fixes:          2582ae5740
MFC after:      1 month
2022-01-03 19:37:25 -08:00
Cy Schubert
701301511f ipfilter module: Style(9) requires a space after return
Reported by:	jrtc27
Fixes:		8c82b37461
MFC after:	1 month
2022-01-03 18:46:49 -08:00
Cy Schubert
d86f022e79 ipfilter: Fix typos
Reported by:	jrtc27
Fixes:		2582ae5740
MFC after:	1 month
2022-01-03 18:45:10 -08:00
Cy Schubert
6b54d2f4c5 ipfilter: Add SDT probe frb_natv6in
Like IPv4 NAT frb_natv4in, add a corresponding IPv6 NAT SDT probe called
frb_natv6in.

MFC after:	1 week
2022-01-03 18:06:44 -08:00
Cy Schubert
b6f072f767 ipfilter: Unconditionally expose SDT probe frb_natv4in
SDT probe frb_natv4in is only available when an error is encountered.
Make it also available when no error is encountered, i.e. NATed and
not translated.

MFC after:	1 week
2022-01-03 18:06:44 -08:00
Cy Schubert
5e13b104a4 ipfilter userland: Fix whitespace errors
Replace leading spaces with a tabs on affected lines.

MFC after:	1 month
2022-01-03 18:06:44 -08:00
Cy Schubert
80030b6cc7 ipfilter module: Fix whitespace errors
Replace leading spaces with a tabs on affected lines.

MFC after:	1 month
2022-01-03 18:06:44 -08:00