Commit graph

21088 commits

Author SHA1 Message Date
Elyes HAOUAS
27fceea98c Fix typo on "Celsius"
"Celcius" --> "Celsius"

Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
Pull Request: https://github.com/freebsd/freebsd-src/pull/551/files
(cherry picked from commit 9097ac9af4)
2021-12-06 08:55:55 -07:00
Mark Johnston
3f9a6f6cf3 elf.5: Document compressed section headers
Reviewed by:	emaste
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit e0189cf66a)
2021-12-06 09:03:50 -05:00
Alex Richardson
a5186406ac Add WITH_LLVM_BINUTILS to install LLVM binutils instead of Elftoolchain
When WITH_LLVM_BINUTILS is set, we will install the LLVM binutils as
ar/ranlib/nm/objcopy/etc. instead of the elftoolchain ones.
Having the LLVM binutils instead of the elftoolchain ones allows us to use
features such as LTO that depend on binutils that understand LLVM IR.
Another benefit will be an improved user-experience when compiling with
AddressSanitizer, since ASAN does not symbolize backtraces correctly if
addr2line is elftoolchain addr2line instead of llvm-symbolizer.
See https://lists.freebsd.org/archives/freebsd-toolchain/2021-July/000062.html
for more details.

This is currently off by default but will be turned on by default at some
point in the near future.

Reviewed By:	emaste

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

(cherry picked from commit 021385aba5)
2021-12-05 21:42:14 +01:00
Colin Percival
3afc5f08a9 uefi(8): loader.efi does not search for loader.efi
This man page formerly referred to boot1.efi searching for loader.efi;
when boot1.efi was obsoleted in favour of having loader.efi launched
directly, this was left claiming that loader.efi searched for
loader.efi.

Reviewed by:	bcran
Fixes:		db8b561345 Rework UEFI ESP generation
Differential Revision:	https://reviews.freebsd.org/D32334

(cherry picked from commit 6fa58bfb3e)
2021-12-05 10:26:33 -08:00
Mateusz Piotrowski
8de3cb052e rc.subr.8: Document changes to load_rc_config
Since e27961a496, load_rc_config does not
require a service name as its first argument. This change was documented
in the rc.subr script in 0b9c2e7ac5. Let's
update the manual page as well.

MFC after:	3 days

(cherry picked from commit 5d21348dfd)
2021-12-05 17:45:33 +01:00
Mateusz Piotrowski
3c3714ac10 apic.4: Fix a typo
MFC after:	3 days

(cherry picked from commit aa798fc2f1)
2021-12-05 17:45:06 +01:00
Ed Maste
1bacdee058 Add gone_in(9) man page
Reviewed by:	imp
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D30703

(cherry picked from commit d8aeab4b45)
2021-12-03 11:45:59 -05:00
Mark Johnston
344c1bc6e6 make_dev.9: Fix a typo
(cherry picked from commit cc7decfcf9)
2021-12-02 09:15:01 -05:00
Rick Macklem
23e8078bcc rc.conf.5: Add entries for NFS
Entries for a few recently defined rc variables
were missing from rc.conf.5.  This patch adds
those.

It was not obvious to me what the ordering is,
so I added them to the area where other nfsd
related variables are.  I can easily move them.

I also replaced "are" with "is", since it seems to
read better.

This is a content change.

(cherry picked from commit 9dae2d03bc)
2021-12-01 17:05:12 -08:00
Sergey A. Osokin
7af8903bf3 ktls.4: fix openssl-devel port name
PR:	259630
(cherry picked from commit b39a93b18e)
2021-11-30 17:45:44 -05:00
Ed Maste
3c12222322 src.conf.5: regen 2021-11-29 10:10:53 -05:00
Ed Maste
8bb7b159b5 src.opts.mk: Add WITHOUT_CXX dependencies
OFED, OPENMP, and PMC depend on C++ support.  Force them off when
building WITHOUT_CXX.

Reported by:	Michael Dexter, Build Option Survey
Reviewed by:	imp, jrtc27
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D32730

(cherry picked from commit 0e1c864898)
2021-11-29 10:10:53 -05:00
Greg V
4022f3eec4 cddl: fix missing ZFS library dependencies
In 9fae47666 zfsd got a libspl dependency to avoid undefined references.
However that workaround did not help external consumers of libzfs_core.

Fix all missing dependencies lld 13 and the rtld complain about.

Reviewed by:	freqlabs, markj

(cherry picked from commit 9e9c651cac)
2021-11-29 09:26:35 -05:00
Mark Johnston
1556ae1356 vm_page: Remove vm_page_sbusy() and vm_page_xbusy()
They are unused today and cannot be safely used in the face of unlocked
lookup, in which pages may be busied without the object lock held.

Obtained from:	jeff (object_concurrency patches)
Reviewed by:	kib

(cherry picked from commit a2665158d0)
2021-11-29 09:11:37 -05:00
Mark Johnston
cb081566cf vm_page: Consolidate page busy sleep mechanisms
- Modify vm_page_busy_sleep() and vm_page_busy_sleep_unlocked() to take
  a VM_ALLOC_* flag indicating whether to sleep on shared-busy, and fix
  up callers.
- Modify vm_page_busy_sleep() to return a status indicating whether the
  object lock was dropped, and fix up callers.
- Convert callers of vm_page_sleep_if_busy() to use vm_page_busy_sleep()
  instead.
- Remove vm_page_sleep_if_(x)busy().

No functional change intended.

Obtained from:	jeff (object_concurrency patches)
Reviewed by:	kib

(cherry picked from commit 87b646630c)
2021-11-29 09:11:29 -05:00
Mateusz Piotrowski
2b890871f7 style.Makefile.5: Do not require $FreeBSD$ SCM IDs
It's no longer required to have those SCM IDs at the start of makefiles.

MFC after:	3 days

(cherry picked from commit 1ac5586c6d)
2021-11-28 17:45:08 +01:00
Mateusz Piotrowski
98ddcae346 os-release.5: Fix quoting of dots
Dots needs to escaped with \& to be places inside Ql quotes.

MFC after:	3 days

(cherry picked from commit ee7485bef5)
2021-11-28 17:42:37 +01:00
Ed Maste
374f859ec0 ng_h4: add deprecation notice
It is already gone in FreeBSD 14.

Sponsored by:	The FreeBSD Foundation
2021-11-27 19:26:38 -05:00
Kristof Provost
cfe9b890d5 pf: Introduce ridentifier
Allow users to set a number on rules which will be exposed as part of
the pflog header.
The intent behind this is to allow users to correlate rules across
updates (remember that pf rules continue to exist and match existing
states, even if they're removed from the active ruleset) and pflog.

Obtained from:	pfSense
MFC after:	3 weeks
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D32750

(cherry picked from commit 76c5eecc34)
2021-11-26 04:39:05 +01:00
Ed Maste
c433c96d86 Update deprecation version for drivers removed in main
Removal of the amr, esp, iir, mly and twa drivers was planned before
FreeBSD 13, but did not happen before the branch.  Update the
depreciation notices to indicate that they are gone in FreeBSD 14.

Sponsored by:	The FreeBSD Foundation
2021-11-25 11:54:12 -05:00
Ed Maste
ab3f1b678d cloudabi: add deprecation notice in stable branches
It has been removed from main before 14.0.

Sponsored by:	The FreeBSD Foundation
2021-11-25 11:54:11 -05:00
Guangyuan Yang
3218666bd0 bridge(4): Use American spelling of "behavior"
Fixes:		8406182dbe
Reported by:	Pau Amma <pauamma@gundo.com>

(cherry picked from commit 28ba36c65d)
2021-11-25 00:01:16 -05:00
Andriy Gapon
f1d2f22b34 pca954x: driver for PCA954x / TCA954x I2C switches
At the moment only PCA9548A is supported and has been tested.

(cherry picked from commit c0525ab1d1)
2021-11-24 16:19:09 +02:00
Warner Losh
532cfa69cf Document that 13.x is the end of the line for FreeBSD/mips
MFC After:		3 days
Sponsored by:		Netflix
Reviewed by:	brooks, jhb, emaste
Differential Revision:	https://reviews.freebsd.org/D32852

(cherry picked from commit a721ac948e)
2021-11-21 17:45:28 -07:00
Andriy Gapon
ee82e15cd9 pcf8574: driver for 8-pin quasi-bidirectional GPIO over I2C
(cherry picked from commit 6354154ef5)
2021-11-21 11:59:34 +02:00
Tom Marcoen
ffc00e9db9 bridge(4): Fix spelling
PR:		237725

(cherry picked from commit 8406182dbe)
2021-11-19 20:08:14 -05:00
Warner Losh
706f4f705b vt: fix git mismerge
I made a mistaking in merging the final commits for the devctl changes. This
adds the 'hushed' variable and has the correct dates for the manuals.

Pointy hat to: imp

(cherry picked from commit 80f21bb039)
2021-11-18 22:10:07 -07:00
Warner Losh
1076b8d267 vt: fix typo
Notifcation -> Notification

(cherry picked from commit cc48eb70d1)
2021-11-18 22:10:07 -07:00
Warner Losh
a82d7aeb3f vt: Add devctl message for bells
Generate VT events when the bell beeps. When coupled with disabling the
bell,this allows custom bells to be rung when we'd otherwise beep.

Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D32656

(cherry picked from commit 4ac3d08a96)
2021-11-18 21:52:22 -07:00
Bjoern A. Zeeb
9806b36dee epair: remove "All rights reserved"
Remove "All rights reserved" from The FreeBSD Foundation owned
copyrights on epair code and documentation.

Approved by:	emaste (FreeBSD Foundation)

(cherry picked from commit 1a8f198fa6)
2021-11-19 00:01:27 +00:00
Felix Johnson
1093301550 module(9): Document that evhand can be NULL
PR:		192250
Reported by:	ngie

(cherry picked from commit c5e0492ae8)
2021-11-14 01:37:20 -05:00
Andriy Gapon
8f57430de1 driver for MAX44009 I2C illuminance sensor
(cherry picked from commit ff6fe29835)
2021-11-13 11:12:05 +02:00
Andriy Gapon
d6f71e09a7 pcf8591: driver for adc/dac with i2c interface
(cherry picked from commit a60b304697)
2021-11-13 11:10:44 +02:00
Lakshman
3530ba8cc1 efirt(9): Correct efi_var_set definition in the manpage
PR:		257531

(cherry picked from commit 2fe85640b2)
2021-11-05 00:59:54 -04:00
Ed Maste
70cb6c34bb Force WITHOUT_OPENSSL_KTLS off when WITHOUT_OPENSSL
Discussed with:	jhb
MFC after:	1 week
Reported by:	Michael Dexter, Build Option Survey
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 6940d0e470)
2021-11-03 20:41:11 -04:00
Mark Johnston
48d2c7cc30 Add the KASAN runtime
KASAN enables the use of LLVM's AddressSanitizer in the kernel.  This
feature makes use of compiler instrumentation to validate memory
accesses in the kernel and detect several types of bugs, including
use-after-frees and out-of-bounds accesses.  It is particularly
effective when combined with test suites or syzkaller.  KASAN has high
CPU and memory usage overhead and so is not suited for production
environments.

The runtime and pmap maintain a shadow of the kernel map to store
information about the validity of memory mapped at a given kernel
address.

The runtime implements a number of functions defined by the compiler
ABI.  These are prefixed by __asan.  The compiler emits calls to
__asan_load*() and __asan_store*() around memory accesses, and the
runtime consults the shadow map to determine whether a given access is
valid.

kasan_mark() is called by various kernel allocators to update state in
the shadow map.  Updates to those allocators will come in subsequent
commits.

The runtime also defines various interceptors.  Some low-level routines
are implemented in assembly and are thus not amenable to compiler
instrumentation.  To handle this, the runtime implements these routines
on behalf of the rest of the kernel.  The sanitizer implementation
validates memory accesses manually before handing off to the real
implementation.

The sanitizer in a KASAN-configured kernel can be disabled by setting
the loader tunable debug.kasan.disable=1.

Obtained from:	NetBSD
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 38da497a4d)
2021-11-01 09:56:31 -04:00
Mark Johnston
c5bd130deb bitset: Reimplement BIT_FOREACH_IS(SET|CLR)
Eliminate the nested loops and re-implement following a suggestion from
rlibby.

Add some simple regression tests.

Reviewed by:	rlibby, kib
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 51425cb210)
2021-11-01 09:20:11 -04:00
Mark Johnston
2788bb20cc bitset(9): Introduce BIT_FOREACH_ISSET and BIT_FOREACH_ISCLR
These allow one to non-destructively iterate over the set or clear bits
in a bitset.  The motivation is that we have several code fragments
which iterate over a CPU set like this:

while ((cpu = CPU_FFS(&cpus)) != 0) {
	cpu--;
	CPU_CLR(cpu, &cpus);
	<do something>;
}

This is slow since CPU_FFS begins the search at the beginning of the
bitset each time.  On amd64 and arm64, CPU sets have size 256, so there
are four limbs in the bitset and we do a lot of unnecessary scanning.

A second problem is that this is destructive, so code which needs to
preserve the original set has to make a copy.  In particular, we have
quite a few functions which take a cpuset_t parameter by value, meaning
that each call has to copy the 32 byte cpuset_t.

The new macros address both problems.

Reviewed by:	cem, kib
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit dfd3bde577)
2021-11-01 09:20:11 -04:00
Felix Johnson
4e56152e47 pthread_np.3: Add a manpage summarizing all of the pthread extensions.
PR:		197299

(cherry picked from commit df7d763849)
2021-10-26 13:59:28 -07:00
Ed Maste
8032812ac2 Update old iSCSI initiator man pages for removal from 14 and later
The old initiator was removed from main in 48cb3fee25 in advance of
FreeBSD 14.
2021-10-26 16:23:41 -04:00
Gleb Smirnoff
fba1554683 Mark sppp(4) as gone in FreeBSD 14. 2021-10-22 11:27:00 -07:00
John Baldwin
64c043d2d2 crypto: Support Chacha20-Poly1305 with a nonce size of 8 bytes.
This is useful for WireGuard which uses a nonce of 8 bytes rather
than the 12 bytes used for IPsec and TLS.

Note that this also fixes a (should be) harmless bug in ossl(4) where
the counter was incorrectly treated as a 64-bit counter instead of a
32-bit counter in terms of wrapping when using a 12 byte nonce.
However, this required a single message (TLS record) longer than 64 *
(2^32 - 1) bytes (about 256 GB) to trigger.

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

(cherry picked from commit 42dcd39528)
2021-10-21 14:19:30 -07:00
John Baldwin
fd464d2f78 crypto: Support multiple nonce lengths for AES-CCM.
Permit nonces of lengths 7 through 13 in the OCF framework and the
cryptosoft driver.  A helper function (ccm_max_payload_length) can be
used in OCF drivers to reject CCM requests which are too large for the
specified nonce length.

Reviewed by:	sef
Sponsored by:	Chelsio Communications, The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D32111

(cherry picked from commit ae18720d27)
2021-10-21 14:07:36 -07:00
John Baldwin
38b8a2be5c cryptodev: Permit explicit IV/nonce and MAC/tag lengths.
Add 'ivlen' and 'maclen' fields to the structure used for CIOGSESSION2
to specify the explicit IV/nonce and MAC/tag lengths for crypto
sessions.  If these fields are zero, the default lengths are used.

This permits selecting an alternate nonce length for AEAD ciphers such
as AES-CCM which support multiple nonce leengths.  It also supports
truncated MACs as input to AEAD or ETA requests.

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

(cherry picked from commit 16676123fc)
2021-10-21 14:05:11 -07:00
John Baldwin
a017868e28 crypto: Add crypto_cursor_segment() to fetch both base and length.
This function combines crypto_cursor_segbase() and
crypto_cursor_seglen() into a single function.  This is mostly
beneficial in the unmapped mbuf case where back to back calls of these
two functions have to iterate over the sub-components of unmapped
mbufs twice.

Bump __FreeBSD_version for crypto drivers in ports.

Suggested by:	markj
Reviewed by:	markj
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D30445

(cherry picked from commit beb817edfe)
2021-10-21 08:51:26 -07:00
John Baldwin
58d69f4ecf crypto: Add a new type of crypto buffer for a single mbuf.
This is intended for use in KTLS transmit where each TLS record is
described by a single mbuf that is itself queued in the socket buffer.
Using the existing CRYPTO_BUF_MBUF would result in
bus_dmamap_load_crp() walking additional mbufs in the socket buffer
that are not relevant, but generating a S/G list that potentially
exceeds the limit of the tag (while also wasting CPU cycles).

Reviewed by:	markj
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D30136

(cherry picked from commit 883a0196b6)
2021-10-21 08:51:26 -07:00
John Baldwin
60b9ce7245 sglist: Add sglist_append_single_mbuf().
This function appends the contents of a single mbuf to an sglist
rather than an entire mbuf chain.

Reviewed by:	gallatin, markj
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D30135

(cherry picked from commit 6663f8a23e)
2021-10-21 08:51:26 -07:00
John Baldwin
06e1e115a9 Add Chacha20+Poly1035 to the list of AEAD algorithms.
Sponsored by:	Netflix

(cherry picked from commit c853c53d02)
2021-10-21 08:51:24 -07:00
John Baldwin
5131b1448c ossl: Add support for the ChaCha20 + Poly1305 AEAD cipher from RFC 8439
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D28757

(cherry picked from commit 78991a93eb)
2021-10-21 08:51:24 -07:00
John Baldwin
6ca6d4edc2 ossl: Add ChaCha20 cipher support.
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D28756

(cherry picked from commit 92aecd1e6f)
2021-10-21 08:51:24 -07:00