Commit Graph

21477 Commits

Author SHA1 Message Date
Mark Johnston
09bfa5cf16 opencrypto: Add a routine to copy a crypto buffer cursor
This was useful in converting armv8crypto to use buffer cursors.  There
are some cases where one wants to make two passes over data, and this
provides a way to "reset" a cursor.

Reviewed by:	jhb
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D28949
2022-02-15 21:47:10 -05:00
Mark Johnston
389a3fa693 uma: Add UMA_ZONE_UNMANAGED
Allow a zone to opt out of cache size management.  In particular,
uma_reclaim() and uma_reclaim_domain() will not reclaim any memory from
the zone, nor will uma_timeout() purge cached items if the zone is idle.
This effectively means that the zone consumer has control over when
items are reclaimed from the cache.  In particular, uma_zone_reclaim()
will still reclaim cached items from an unmanaged zone.

Reviewed by:	hselasky, kib
MFC after:	3 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34142
2022-02-15 09:25:34 -05:00
John Baldwin
2f6a842484 Disable -Wreturn-type on GCC.
GCC is more pedantic than clang about warning when a function doesn't
handle undefined enum values (see GCC bug 87950).  Clang's warning
gives a more pragmatic coverage and should find any real bugs, so
disable the warning for GCC rather than adding __unreachable
annotations to appease GCC.

Reviewed by:	imp, emaste
Differential Revision:	https://reviews.freebsd.org/D34147
2022-02-14 11:48:47 -08:00
Ed Maste
004b0aa869 vt.4: clarify that a KMS driver switches to graphics mode
PR:		261909
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2022-02-14 14:05:09 -05:00
Stefan Eßer
eaf3c3af9c cpuset.9: add description of CPU_ISSET()
PR:		261947
Reported by:	thmu7 at freenet.de (Thomas Mueller)
MFC after:	3 days
2022-02-14 15:59:37 +01:00
Warner Losh
3e65b7d94d cleankernel: A target to delete the kernel compile file
With the meta-build, it's always a NO_CLEAN build. Provide a way to
remove so one can rebuild from scratch. 'cleankernel' will delete the
kernel and modules object directories. Document this in build(7).

Sponsored by:		Netflix
Reviewed by:		debdrup, markj
Differential Revision:	https://reviews.freebsd.org/D32978
2022-02-11 12:51:24 -07:00
Johan Jansson
d4b0fa45dc ucred.9: fix typo
PR:	261889
MFC after:	3 days
2022-02-11 20:10:19 +02:00
Ed Maste
8dc42f9804 Invert CPU arch test for LLDB default
LLDB currently defaults to enabled on all architectures except arm and
riscv64 (and can probably be enabled for 32-bit arm).  Switch to an
opt-out list.

Reviewed by:	pkubaj
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34218
2022-02-09 19:11:00 -05:00
Ed Maste
489d7a8528 Enable -Wdate-time warning
This produces an "expansion of date or time macro is not reproducible"
warning or error upon use of __DATE__ or __TIME__.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D29580
2022-02-09 17:10:03 -05:00
Piotr Kubaj
ff5025d104 src.conf: regenerate 2022-02-09 02:35:35 +01:00
Piotr Kubaj
d68224c2bd powerpc64le: enable CXGBETOOL and MLX5TOOL
While mlx5 is not yet enabled on powerpc64le, cxgbe is.
The binary seems to work properly.

Differential revision:	https://reviews.freebsd.org/D34026
Reviewed by:	emaste
2022-02-09 02:16:01 +01:00
Dimitry Andric
5f2aca8394 Disable clang 14 warning about bitwise operators in zstd
Parts of zstd, used in openzfs and other places, trigger a new clang 14
-Werror warning:

```
sys/contrib/zstd/lib/decompress/huf_decompress.c:889:25: error: use of bitwise '&' with boolean operands [-Werror,-Wbitwise-instead-of-logical]
                        (BIT_reloadDStreamFast(&bitD1) == BIT_DStream_unfinished)
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```

While the warning is benign, it should ideally be fixed upstream and
then vendor-imported, but for now silence it selectively.

MFC after:	3 days
2022-02-08 21:46:08 +01:00
Mark Johnston
745f30641c release.7: Drop obsolete notes about old versions of mkimg
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2022-02-08 12:40:41 -05:00
Piotr Kubaj
2ec9a427c8 src.conf: regenerate 2022-02-08 14:14:02 +01:00
John Baldwin
c227269e2f Stop adding -Wredundant-decls to CWARNFLAGS.
clang doesn't implement it, and Linux doesn't enforce it.  As a
result, new instances keep cropping up both in FreeBSD's code and in
upstream sources from vendors.

Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D34144
2022-02-07 12:47:51 -08:00
Randall Stewart
a9696510f5 tcp: Add hystart++ to our cubic implementation.
As promised to the transport call on 11/4/22 here is an implementation
of hystart++ for cubic. It also cleans up the tcp_congestion function
to have a better name. Common variables are moved into the general
cc.h structure so that both cubic and newreno can use them for
hystart++

Reviewed by: Michael Tuexen, Richard Scheffenegger
Sponsored by: Netflix Inc.
Differential Revision: https://reviews.freebsd.org/D33035
2022-02-07 06:37:46 -05:00
Wolfram Schneider
b5a38d1f24 update external URL 2022-02-05 19:54:59 +00:00
Wolfram Schneider
b2dfb50f3f update external URL 2022-02-05 19:49:46 +00:00
Wolfram Schneider
4aa85205a5 update external URL 2022-02-05 19:43:03 +00:00
Wolfram Schneider
08915d6ad5 remove defunct Sundance URL 2022-02-05 19:41:28 +00:00
Wolfram Schneider
0e39bc2c14 remove defunct Ralink Technology URL 2022-02-05 19:39:18 +00:00
Wolfram Schneider
1f9aaf18b1 update external URL 2022-02-05 19:23:51 +00:00
Wolfram Schneider
8799e12ebc update external URL 2022-02-05 19:19:43 +00:00
Wolfram Schneider
f80a9407e4 update external URL 2022-02-05 19:17:33 +00:00
Wolfram Schneider
7e18e86d8c remove defunct National Semiconductor URL 2022-02-05 18:44:52 +00:00
Wolfram Schneider
ec1e597a3c update external URL 2022-02-05 18:32:38 +00:00
Wolfram Schneider
a9fd00a8b4 update URL 2022-02-05 18:30:06 +00:00
John Baldwin
bca92be683 Remove more quotes around Makefile .error/.warn/.info strings.
Reviewed by:	imp, emaste
Differential Revision:	https://reviews.freebsd.org/D34175
2022-02-04 15:59:53 -08:00
John Baldwin
ffe74ab77f bsd.compat.mk: A few cosmetic fixes.
- Add a missing ')' to a warning.

- Consistently use {} when expanding variables.

- Remove a spurious blank line.

Reviewed by:	imp, emaste
Obtained from:	CheriBSD
Differential Revision:	https://reviews.freebsd.org/D34172
2022-02-04 15:57:28 -08:00
Warner Losh
7510633e76 style(9): Default to omitting $FreeBSD$
Advise people to omit $FreeBSD$ (in both comments and macros) unless the
code is definitely going to be merged to stable/12. This strengthens
previous statements and is appropriate now that stable/11 is no longer
supported. If people are wrong and things are unexpected merged to 12,
tags can be added before that merge. No sense adding a tag that will
never be expanded and removed later on the off chance it might wind up
in stable/12.

The next step is likely to weaken this to apply just to mergemaster
managed files, but not today.

Reviewed by:	rpokala, cem, erj, hselasky, brooks, kib
Differential Revision:	https://reviews.freebsd.org/D34152
2022-02-04 15:38:15 -07:00
Richard Scheffenegger
3b0ee68050 tcp: Prevent setting of ECN bits with setsockopt()
setsockopt() grants full access to the deprecated
TOS byte. For TCP, mask out the ECN codepoint, so that
only the DSCP portion can be adjusted.

Reviewed By: tuexen, hselasky, #manpages, #transport, debdrup
Sponsored by:        NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D34154
2022-02-03 20:06:42 +01:00
Mark Johnston
03399cd6e0 filemon.4: Document FILEMON_SET_FD errors and refine wording a bit
Reviewed by:	emaste, debdrup, Pau Amma
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34128
2022-02-03 09:46:34 -05:00
Konstantin Belousov
90be4091a7 insmntque(9): update and correct man page
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
Differential revision:	https://reviews.freebsd.org/D34071
2022-01-31 16:51:05 +02:00
Mateusz Piotrowski
79afae3b3f style.mdoc.5: Document the conventions for -width
Reviewed by:	debdrup
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D33394
2022-01-29 22:24:35 +01:00
Mateusz Piotrowski
60401b3883 ipheth.4: Simplify output filtering example
MFC after:	2 weeks
2022-01-29 22:16:50 +01:00
Mateusz Piotrowski
d0b92c068e ipheth.4: Fix examples
It is now necessary to use the -d flag for some of the usbconfig(8)
invocations.

MFC after:	2 weeks
2022-01-29 22:13:42 +01:00
Alexander V. Chernikov
217481a333 u3g: Add support Quectel EM12-G modem.
Submitted by:	<tda.77793 at gmail.com>
PR:		260218
MFC after:	2 weeks
2022-01-29 09:59:20 +00:00
John Baldwin
ac4643ef78 Remove terasic drivers used on the Cambridge BERI tablet.
Reviewed by:	brooks
Sponsored by:	The University of Cambridge, Google Inc.
Differential Revision:	https://reviews.freebsd.org/D34057
2022-01-27 11:01:51 -08:00
Piotr Kubaj
0b2d2290fe powerpc: Enable LLDB on all powerpc architectures
While LLDB on powerpc and powerpcspe builds as-is, on powerpc64 and
powerpc64le it requires adding a couple of additional source files
to build.

Differential review:	https://reviews.freebsd.org/D34043
Approved by:	dim, imp, emaste
2022-01-26 15:03:27 +01:00
Gordon Bergling
b3df222eae extra_tcp_stacks: Fix a few common typos
TCP_BBR:
- Fix a typo introducted in 1b90dfa5d2, which was reported by tuexen@

TCP_RACK:
- Correct two sysctl descriptions: s/corret/correct/

tcp_bbr(4): Also fix s/measurment/measurement/ in the man page

MFC after:	1 week
2022-01-26 10:35:17 +01:00
John Baldwin
42e51b158a Stop trying to strip 'eb' suffixes from ARM MACHINE_ARCH.
armeb is no longer a supported MACHINE_ARCH.

Reviewed by:	imp, emaste
Sponsored by:	The University of Cambridge, Google Inc.
Differential Revision:	https://reviews.freebsd.org/D34019
2022-01-25 11:37:29 -08:00
Michal Krawczyk
95161adfcb ena: fix man page typos and update contact section
Verified spelling in the README and fixed the typos.

Also updated the contact section by removing Artur and adding Dawid
Gorecki who is now the second ENA FreeBSD driver developer.

Submitted by: Michal Krawczyk <mk@semihalf.com>
Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.
2022-01-23 20:48:33 +01:00
Marcin Wojtas
eb4c4f4a2e ena: merge ena-com v2.5.0 upgrade
Merge commit '2530eb1fa01bf28fbcfcdda58bd41e055dcb2e4a'

Adjust the driver to the upgraded ena-com part twofold:

First update is related to the driver's NUMA awareness.

Allocate I/O queue memory in NUMA domain local to the CPU bound to the
given queue, improving data access time. Since this can result in
performance hit for unaware users, this is done only when RSS
option is enabled, for other cases the driver relies on kernel to
allocate memory by itself.

Information about first CPU bound is saved in adapter structure, so
the binding persists after bringing the interface down and up again.

If there are more buckets than interface queues, the driver will try to
bind different interfaces to different CPUs using round-robin algorithm
(but it will not bind queues to CPUs which do not have any RSS buckets
associated with them). This is done to better utilize hardware
resources by spreading the load.

Add (read-only) per-queue sysctls in order to provide the following
information:
- queueN.domain: NUMA domain associated with the queue
- queueN.cpu:    CPU affinity of the queue

The second change is for the CSUM_OFFLOAD constant, as ENA platform
file has removed its definition. To align to that change, it has been
added to the ena_datapath.h file.

Submitted by: Artur Rojek <ar@semihalf.com>
Submitted by: Dawid Gorecki <dgr@semihalf.com>
Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.
2022-01-23 20:27:13 +01:00
Ed Maste
6f6fbfa3a8 Remove quotes around Makefile .error/.warn/.info strings
The text after .error et al is emitted verbatim.

Reviewed by:	sjg
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33904
2022-01-22 14:03:07 -05:00
Baptiste Daroussin
6521372e95 pci_vendors: update to 2022-01-15 2022-01-19 09:58:13 +01:00
Kenneth D. Merry
6e8a2f0400 Update sa(4) comments and man page after review.
sys/cam/scsi/scsi_sa.c:
	Add comments explaining the priority order of the various
	sources of timeout values.  Also, explain that the probe
	that pulls in drive recommended timeouts via the REPORT
	SUPPORTED OPERATION CODES command is in a race with the
	thread that creates the sysctl variables.  Because of that
	race, it is important that the sysctl thread not load any
	timeout values from the kernel environment.

share/man/man4/sa.4:
	Use the Sy macro to emphasize thousandths of a second
	instead of capitalizing it.

Requested by:	Warner Losh <imp@freebsd.org>
Requested by:	Daniel Ebdrup Jensen <debdrup@freebsd.org>
Sponsored by:	Spectra Logic
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D33883
2022-01-18 13:50:31 -05:00
Kenneth D. Merry
bcff64c54a Clarify loader tunable usage when tape drives arrive after boot.
Tape drives that arrive after boot will still use any loader
tunables that apply to that instance.

Requested by:	Pau Amma <pauamma@gundo.com>
MFC After:	1 week
Sponsored by:	Spectra Logic
Differential Revision:	https://reviews.freebsd.org/D33883
2022-01-18 13:50:30 -05:00
Kenneth D. Merry
5719b5a1bb Switch to using drive-supplied timeouts for the sa(4) driver.
Summary:
The sa(4) driver has historically used tape drive timeouts that
were one-size fits all, with compile-time options to adjust a few
of them.

LTO-9 drives (and presumably other tape drives in the future)
implement a tape characterization process that happens the first
time a tape is loaded.  The characterization process formats the
tape to account for the temperature and humidity in the environment
it is being used in.  The process for LTO-9 tapes can take from 20
minutes (I have observed 17-18 minutes) to 2 hours according to the
documentation.

As a result, LTO-9 drives have significantly longer recommended
load times than previous LTO generations.

To handle this, change the sa(4) driver over to using timeouts
supplied by the tape drive using the timeout descriptors obtained
through the REPORT SUPPORTED OPERATION CODES command.  That command
was introduced in SPC-4.  IBM tape drives going back to at least
LTO-5 report timeout values.  Oracle/Sun/StorageTek tape drives
going back to at least the T10000C report timeout values.  HP LTO-5
and newer drives report timeout values.  The sa(4) driver only
queries drives that claim to support SPC-4.

This makes the timeout settings automatic and accurate for newer
tape drives.

Also, add loader tunable and sysctl support so that the user can
override individual command type timeouts for all tape drives in
the system, or only for specific drives.

The new global (these affect all tape drives) loader tunables are:

	kern.cam.sa.timeout.erase
	kern.cam.sa.timeout.load
	kern.cam.sa.timeout.locate
	kern.cam.sa.timeout.mode_select
	kern.cam.sa.timeout.mode_sense
	kern.cam.sa.timeout.prevent
	kern.cam.sa.timeout.read
	kern.cam.sa.timeout.read_position
	kern.cam.sa.timeout.read_block_limits
	kern.cam.sa.timeout.report_density
	kern.cam.sa.timeout.reserve
	kern.cam.sa.timeout.rewind
	kern.cam.sa.timeout.space
	kern.cam.sa.timeout.tur
	kern.cam.sa.timeout.write
	kern.cam.sa.timeout.write_filemarks

The new per-instance loader tunable / sysctl variables are:

	kern.cam.sa.%d.timeout.erase
	kern.cam.sa.%d.timeout.load
	kern.cam.sa.%d.timeout.locate
	kern.cam.sa.%d.timeout.mode_select
	kern.cam.sa.%d.timeout.mode_sense
	kern.cam.sa.%d.timeout.prevent
	kern.cam.sa.%d.timeout.read
	kern.cam.sa.%d.timeout.read_position
	kern.cam.sa.%d.timeout.read_block_limits
	kern.cam.sa.%d.timeout.report_density
	kern.cam.sa.%d.timeout.reserve
	kern.cam.sa.%d.timeout.rewind
	kern.cam.sa.%d.timeout.space
	kern.cam.sa.%d.timeout.tur
	kern.cam.sa.%d.timeout.write
	kern.cam.sa.%d.timeout.write_filemarks

The values are reported and set in units of thousandths of a
second.

share/man/man4/sa.4:
	Document the new loader tunables in the sa(4) man page.

sys/cam/scsi/scsi_sa.c:
	Add a new timeout_info array to the softc.

	Add a default timeouts array, along with descriptions.

	Add a new sysctl tree to the softc to handle the timeout
	sysctl values.

	Add a new function, saloadtotunables(), that will load
	the global loader tunables first and then any per-instance
	loader tunables second.

	Add creation of the new timeout sysctl variables in
	sasysctlinit().

	Add a new, optional probe state to the sa(4) driver.  We
	previously didn't do any probing, but now we probe for
	timeout descriptors if the drive claims to support SPC-4 or
	later.  In saregister(), we check the SCSI revision and
	either launch the probe state machine, or announce the
	device and become ready.

	In sastart() and sadone(), add support for the new
	SA_STATE_PROBE.  If we're probing, we don't go through
	saerror(), since that is currently only written to handle
	I/O errors in the normal state.

	Change every place in the sa(4) driver that fills in
	timeout values in a CCB to use the new timeout_info[] array
	in the softc.

	Add a new saloadtimeouts() routine to parse the returned
	timeout descriptors from a completed REPORT SUPPORTED
	OPERATION CODES command, and set the values for the
	commands we support.

MFC after:	1 week
Sponsored by:	Spectra Logic

Test Plan:
Try this out with a variety of tape drives and make sure the timeouts that
result (sysctl kern.cam.sa to see them) are reasonable.

Reviewers: #manpages, #cam

Subscribers: imp

Differential Revision: https://reviews.freebsd.org/D33883
2022-01-18 13:50:30 -05:00
Mark Johnston
2188152717 security.7: Minor fixes for ASLR sysctl descriptions
Reviewed by:	debdrup, danfe, emaste
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33908
2022-01-17 16:12:43 -05:00
Mark Johnston
1811c1e957 exec: Reimplement stack address randomization
The approach taken by the stack gap implementation was to insert a
random gap between the top of the fixed stack mapping and the true top
of the main process stack.  This approach was chosen so as to avoid
randomizing the previously fixed address of certain process metadata
stored at the top of the stack, but had some shortcomings.  In
particular, mlockall(2) calls would wire the gap, bloating the process'
memory usage, and RLIMIT_STACK included the size of the gap so small
(< several MB) limits could not be used.

There is little value in storing each process' ps_strings at a fixed
location, as only very old programs hard-code this address; consumers
were converted decades ago to use a sysctl-based interface for this
purpose.  Thus, this change re-implements stack address randomization by
simply breaking the convention of storing ps_strings at a fixed
location, and randomizing the location of the entire stack mapping.
This implementation is simpler and avoids the problems mentioned above,
while being unlikely to break compatibility anywhere the default ASLR
settings are used.

The kern.elfN.aslr.stack_gap sysctl is renamed to kern.elfN.aslr.stack,
and is re-enabled by default.

PR:		260303
Reviewed by:	kib
Discussed with:	emaste, mw
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33704
2022-01-17 16:12:36 -05:00