]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
2 years agolibthr: Use <machine/tls.h> for most MD TLS details.
John Baldwin [Thu, 9 Dec 2021 21:17:41 +0000 (13:17 -0800)]
libthr: Use <machine/tls.h> for most MD TLS details.

Note that on amd64 this effectively removes the unused tcb_spare field
from the end of struct tcb since the definition of struct tcb in
<x86/tls.h> does not include that field.

Reviewed by: kib, jrtc27
Sponsored by: The University of Cambridge, Google Inc.
Differential Revision: https://reviews.freebsd.org/D33352

2 years agoAdd <machine/tls.h> header to hold MD constants and helpers for TLS.
John Baldwin [Thu, 9 Dec 2021 21:17:13 +0000 (13:17 -0800)]
Add <machine/tls.h> header to hold MD constants and helpers for TLS.

The header exports the following:

- Definition of struct tcb.
- Helpers to get/set the tcb for the current thread.
- TLS_TCB_SIZE (size of TCB)
- TLS_TCB_ALIGN (alignment of TCB)
- TLS_VARIANT_I or TLS_VARIANT_II
- TLS_DTV_OFFSET (bias of pointers in dtv[])
- TLS_TP_OFFSET (bias of "thread pointer" relative to TCB)

Note that TLS_TP_OFFSET does not account for if the unbiased thread
pointer points to the start of the TCB (arm and x86) or the end of the
TCB (MIPS, PowerPC, and RISC-V).

Note also that for amd64, the struct tcb does not include the unused
tcb_spare field included in the current structure in libthr.  libthr
does not use this field, and the existing calls in libc and rtld that
allocate a TCB for amd64 assume it is the size of 3 Elf_Addr's (and
thus do not allocate room for tcb_spare).

A <sys/_tls_variant_i.h> header is used by architectures using
Variant I TLS which uses a common struct tcb.

Reviewed by: kib (older version of x86/tls.h), jrtc27
Sponsored by: The University of Cambridge, Google Inc.
Differential Revision: https://reviews.freebsd.org/D33351

2 years agolibc: Fix the alignment of the TCB to match rtld for several architectures.
John Baldwin [Thu, 9 Dec 2021 21:16:57 +0000 (13:16 -0800)]
libc: Fix the alignment of the TCB to match rtld for several architectures.

- Use 16 byte alignment rather than 8 for aarch64, powerpc64, and RISC-V.

- Use 8 byte alignment rather than 4 for 32-bit arm, mips, and powerpc.

I suspect that mips64 should be using 16 byte alignment, but both libc
and rtld currently use 8 byte alignment.

Reviewed by: kib, jrtc27
Sponsored by: The University of Cambridge, Google Inc.
Differential Revision: https://reviews.freebsd.org/D33350

2 years agoamd64: Allocate TCB with alignment of 16 rather than 8.
John Baldwin [Thu, 9 Dec 2021 21:16:45 +0000 (13:16 -0800)]
amd64: Allocate TCB with alignment of 16 rather than 8.

This matches the TLS_TCB_ALIGN definition in libc.

Reviewed by: kib, jrtc27
Sponsored by: The University of Cambridge, Google Inc.
Differential Revision: https://reviews.freebsd.org/D33349

2 years agomips _libc_get_static_tls_base: Narrow scope of #ifdef.
John Baldwin [Thu, 9 Dec 2021 21:16:34 +0000 (13:16 -0800)]
mips _libc_get_static_tls_base: Narrow scope of #ifdef.

Reviewed by: kib, emaste, jrtc27
Sponsored by: The University of Cambridge, Google Inc.
Differential Revision: https://reviews.freebsd.org/D33348

2 years agomips: Add TLS_DTV_OFFSET to the result of tls_get_addr_common.
John Baldwin [Thu, 9 Dec 2021 21:16:19 +0000 (13:16 -0800)]
mips: Add TLS_DTV_OFFSET to the result of tls_get_addr_common.

Previously TLS_DTV_OFFSET was added to the offset passed to
tls_get_addr_common; however, this approach matches powerpc and RISC-V
and better matches the intention.

Reviewed by: kib, jrtc27
Sponsored by: The University of Cambridge, Google Inc.
Differential Revision: https://reviews.freebsd.org/D33347

2 years agomips: Rename TLS_DTP_OFFSET to TLS_DTV_OFFSET.
John Baldwin [Thu, 9 Dec 2021 21:16:00 +0000 (13:16 -0800)]
mips: Rename TLS_DTP_OFFSET to TLS_DTV_OFFSET.

This is the more standard name for the bias of dtv pointers used on
other platforms.  This also fixes a few other places that were using
the wrong bias previously on MIPS such as dlpi_tls_data in struct
dl_phdr_info and the recently added __libc_tls_get_addr().

Reviewed by: kib, jrtc27
Sponsored by: The University of Cambridge, Google Inc.
Differential Revision: https://reviews.freebsd.org/D33346

2 years agolibthr: Remove the DTV_OFFSET macro.
John Baldwin [Thu, 9 Dec 2021 21:15:38 +0000 (13:15 -0800)]
libthr: Remove the DTV_OFFSET macro.

This macro is confusing as it is not related to the similarly named
TLS_DTV_OFFSET.  Instead, replace its one use with the desired
expression which is the same on all platforms.

Reviewed by: kib, emaste, jrtc27
Sponsored by: The University of Cambridge, Google Inc.
Differential Revision: https://reviews.freebsd.org/D33345

2 years agonet/if.c: plug set-but-not-unused vars
Mateusz Guzik [Thu, 9 Dec 2021 20:39:40 +0000 (20:39 +0000)]
net/if.c: plug set-but-not-unused vars

Sponsored by: Rubicon Communications, LLC ("Netgate")

2 years agoioat: plug set-but-not-unused vars
Mateusz Guzik [Thu, 9 Dec 2021 20:21:16 +0000 (20:21 +0000)]
ioat: plug set-but-not-unused vars

Sponsored by: Rubicon Communications, LLC ("Netgate")

2 years agoBump __FreeBSD_version for software crypto changes.
John Baldwin [Thu, 9 Dec 2021 19:53:07 +0000 (11:53 -0800)]
Bump __FreeBSD_version for software crypto changes.

- enc_xform now supports AEAD ciphers.
- The Blake-2S/B auth transforms now support Init before
  Setkey like other auth transforms.

2 years agocryptosoft: Stop single-threading requests within a session.
John Baldwin [Thu, 9 Dec 2021 19:52:43 +0000 (11:52 -0800)]
cryptosoft: Stop single-threading requests within a session.

All of the request handlers no longer modify session state, so remove
the mutex limiting operations to one per session.  In addition, change
the pointer to the session state passed to process callbacks to const.

Suggested by: mjg
Reviewed by: mjg, markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D33317

2 years agocryptosoft: Fully support per-operation keys for auth algorithms.
John Baldwin [Thu, 9 Dec 2021 19:52:42 +0000 (11:52 -0800)]
cryptosoft: Fully support per-operation keys for auth algorithms.

Only pre-allocate auth contexts when a session-wide key is provided or
for sessions without keys.  For sessions with per-operation keys,
always initialize the on-stack context directly rather than
initializing the session context in swcr_authprepare (now removed) and
then copying that session context into the on-stack context.

This approach permits parallel auth operations without needing a
serializing lock.  In addition, the previous code assumed that auth
sessions always provided an initial key unlike cipher sessions which
assume either an initial key or per-op keys.

While here, fix the Blake2 auth transforms to function like other auth
transforms where Setkey is invoked after Init rather than before.

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

2 years agocryptosoft: Allocate cipher contexts on the stack during operations.
John Baldwin [Thu, 9 Dec 2021 19:52:42 +0000 (11:52 -0800)]
cryptosoft: Allocate cipher contexts on the stack during operations.

As is done with authentication contexts, allocate cipher contexts on
the stack while completing requests.  This permits safely dispatching
concurrent requests on a single session.  The cipher context in the
session is now only allocated when a session key is provided during
session setup to serve as a template to initialize the on-stack
context similar to auth operations.

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

2 years agocryptosoft: Rename sw_kschedule member to sw_ctx.
John Baldwin [Thu, 9 Dec 2021 19:52:42 +0000 (11:52 -0800)]
cryptosoft: Rename sw_kschedule member to sw_ctx.

The cipher context isn't always a key schedule, so use a more generic
name.

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

2 years agocrypto: Refactor software support for AEAD ciphers.
John Baldwin [Thu, 9 Dec 2021 19:52:42 +0000 (11:52 -0800)]
crypto: Refactor software support for AEAD ciphers.

Extend struct enc_xform to add new members to handle auth operations
for AEAD ciphers.  In particular, AEAD operations in cryptosoft no
longer use a struct auth_hash.  Instead, the setkey and reinit methods
of struct enc_xform are responsible for initializing both the cipher
and auth state.

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

2 years agoGMAC: Reset initial hash value and counter in AES_GMAC_Reinit().
John Baldwin [Thu, 9 Dec 2021 19:52:42 +0000 (11:52 -0800)]
GMAC: Reset initial hash value and counter in AES_GMAC_Reinit().

Previously, these values were only cleared in AES_GMAC_Init(), so a
second set of operations could reuse the final hash as the initial
hash.  Currently this bug does not trigger in cryptosoft as existing
GMAC and GCM operations always use an on-stack auth context
initialized from a template context.

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

2 years agocryptosoft: Reject AES-CCM/GCM sessions with invalid key lengths.
John Baldwin [Thu, 9 Dec 2021 19:52:41 +0000 (11:52 -0800)]
cryptosoft: Reject AES-CCM/GCM sessions with invalid key lengths.

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

2 years agocrypto: Validate AES-GCM IV length in check_csp().
John Baldwin [Thu, 9 Dec 2021 19:52:41 +0000 (11:52 -0800)]
crypto: Validate AES-GCM IV length in check_csp().

This centralizes the check for valid nonce lengths for AES-GCM.

While here, remove some duplicate checks for valid AES-GCM tag lengths
from ccp(4) and ccr(4).

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

2 years agocrypto: Don't assert for empty output buffers.
John Baldwin [Thu, 9 Dec 2021 19:52:41 +0000 (11:52 -0800)]
crypto: Don't assert for empty output buffers.

It is always valid for crp_payload_output_start to be 0.  However, if
an output buffer is empty (e.g. a decryption request with a tag but an
empty payload), the existing assertion failed since 0 is not less than
0.

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

2 years agocxgbe(4): Update firmwares to 1.26.4.0
Navdeep Parhar [Thu, 9 Dec 2021 19:10:48 +0000 (11:10 -0800)]
cxgbe(4): Update firmwares to 1.26.4.0

(Rest is from the README that came with the firmware)

Version : 1.26.4.0
Date    : 12/02/2021

Fixes
-----

BASE:
- Fixed error on setting 25G speed on 100G copper with multiple FEC set in
  firmware commands.
- Handle link of unknown optics modules by enabling module tx unconditionally.
- Fixed link not coming up for 25G CRS phys. Firmware incorrectly tried to
  bring up the link in RS-FEC but as per IEEE spec, it must be BASER FEC.
- Fixed an issue where firmware doesn't automatically retry next FEC if driver
  asks to bring up the link using RS-FEC and link doesn't come up.

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

2 years agoRevert "geom_bde: plug set-but-not-used vars"
Mateusz Guzik [Thu, 9 Dec 2021 19:23:05 +0000 (19:23 +0000)]
Revert "geom_bde: plug set-but-not-used vars"

The commit at hand happens to break userspace build as the header ins
included by sbin/gbde/gbde.c and the __diagused macro is not provided to
userspace.

Revert until this gets sorted out.

This reverts commit 26e837e2d488cc3e484c88a511728e061205edc5.

2 years agomodules: increase MAXMODNAME and provide backward compat
Bjoern A. Zeeb [Wed, 17 Nov 2021 19:35:46 +0000 (19:35 +0000)]
modules: increase MAXMODNAME and provide backward compat

With various firmware files used by graphics and wireless drivers
we are exceeding the current 32 character module name (file path
in kldxref) length.
In order to overcome this issue bump it to the maximum path length
for the next version.
To be able to MFC provide backward compat support for another version
of the struct as the offsets for the second half change due to the
array size increase.

MAXMODNAME being defined to MAXPATHLEN needs param.h to be
included first.  With only 7 modules (or LinuxKPI module.h) not
doing that adjust them rather than including param.h in module.h [1].

Reported by: Greg V (greg unrelenting.technology)
Sponsored by: The FreeBSD Foundation
Suggested by: imp [1]
MFC after: 10 days
Reviewed by: imp (and others to different level)
Differential Revision: https://reviews.freebsd.org/D32383

2 years agogeom_raid3: plug set-but-not-unused vars
Mateusz Guzik [Thu, 9 Dec 2021 18:08:03 +0000 (18:08 +0000)]
geom_raid3: plug set-but-not-unused vars

Sponsored by: Rubicon Communications, LLC ("Netgate")

2 years agogeom_eli: mostly plug set-but-not-unused vars
Mateusz Guzik [Thu, 9 Dec 2021 18:05:06 +0000 (18:05 +0000)]
geom_eli: mostly plug set-but-not-unused vars

The remaining case is an ignored error.

Sponsored by: Rubicon Communications, LLC ("Netgate")

2 years agogeom_mirror: plug set-but-not-unused vars
Mateusz Guzik [Thu, 9 Dec 2021 18:00:27 +0000 (18:00 +0000)]
geom_mirror: plug set-but-not-unused vars

Sponsored by: Rubicon Communications, LLC ("Netgate")

2 years agombuf: plug set-but-not-used vars
Mateusz Guzik [Thu, 9 Dec 2021 17:59:11 +0000 (17:59 +0000)]
mbuf: plug set-but-not-used vars

Sponsored by: Rubicon Communications, LLC ("Netgate")

2 years agogeom_bde: plug set-but-not-used vars
Mateusz Guzik [Thu, 9 Dec 2021 17:53:48 +0000 (17:53 +0000)]
geom_bde: plug set-but-not-used vars

Sponsored by: Rubicon Communications, LLC ("Netgate")

2 years agofxp: plug set-but-not-used vars
Mateusz Guzik [Thu, 9 Dec 2021 17:45:12 +0000 (17:45 +0000)]
fxp: plug set-but-not-used vars

Sponsored by: Rubicon Communications, LLC ("Netgate")

2 years agoarm/freescale: remove FBIOSCURSOR
Mateusz Guzik [Thu, 9 Dec 2021 16:58:41 +0000 (16:58 +0000)]
arm/freescale: remove FBIOSCURSOR

Unbreaks building EFIKA_MX

Fixes: b9d3b253e2f7c491 ("fb: Remove unused cursors ioctls")
Sponsored by: Rubicon Communications, LLC ("Netgate")

2 years agofirewire: plug set-but-not-used vars
Mateusz Guzik [Thu, 9 Dec 2021 16:36:45 +0000 (16:36 +0000)]
firewire: plug set-but-not-used vars

Sponsored by: Rubicon Communications, LLC ("Netgate")

2 years agopcm: plug set-but-not-used vars
Mateusz Guzik [Thu, 9 Dec 2021 16:31:04 +0000 (16:31 +0000)]
pcm: plug set-but-not-used vars

Sponsored by: Rubicon Communications, LLC ("Netgate")

2 years agoet: plug set-but-not-used vars
Mateusz Guzik [Thu, 9 Dec 2021 16:28:08 +0000 (16:28 +0000)]
et: plug set-but-not-used vars

Sponsored by: Rubicon Communications, LLC ("Netgate")

2 years agoamdtemp: plug set-but-not-used vars
Mateusz Guzik [Thu, 9 Dec 2021 16:25:49 +0000 (16:25 +0000)]
amdtemp: plug set-but-not-used vars

Sponsored by: Rubicon Communications, LLC ("Netgate")

2 years agoamd64: plug set-but-not-used vars in pmap
Mateusz Guzik [Thu, 9 Dec 2021 16:20:45 +0000 (16:20 +0000)]
amd64: plug set-but-not-used vars in pmap

Sponsored by: Rubicon Communications, LLC ("Netgate")

2 years agomips: Remove mips as a recognized build target.
Warner Losh [Thu, 9 Dec 2021 15:59:14 +0000 (08:59 -0700)]
mips: Remove mips as a recognized build target.

Remove mips as a recognized build target in advance of its removal from
the tree.

Sponsored by: Netflix

2 years agoBelatedly note that mips has been removed from universe/tinderbox builds
Warner Losh [Thu, 9 Dec 2021 15:29:51 +0000 (08:29 -0700)]
Belatedly note that mips has been removed from universe/tinderbox builds
and that mips will be removed from the tree soon.

Sponsored by: Netflix

2 years agolibcompat: Remove MIPS from list of compat libraries
Warner Losh [Thu, 9 Dec 2021 15:22:51 +0000 (08:22 -0700)]
libcompat: Remove MIPS from list of compat libraries

Sponsored by: Netflix

2 years agokboot: remove host_seek
Warner Losh [Thu, 9 Dec 2021 08:19:26 +0000 (01:19 -0700)]
kboot: remove host_seek

host_llseek has replaced all instances of host_seek, so retire the
latter. It's unused.

Sponsored by: Netflix

2 years agokboot: simplify _start
Warner Losh [Thu, 9 Dec 2021 08:16:51 +0000 (01:16 -0700)]
kboot: simplify _start

_start can be implemented directly like this. The code generated is
identical. It's also portable.

Reviewed by: md5
Sponsored by: Netflix

2 years agoFix assert check for SV_DSO_SIG in exec_sysvec_init_secondary()
Justin Hibbits [Thu, 9 Dec 2021 04:50:10 +0000 (22:50 -0600)]
Fix assert check for SV_DSO_SIG in exec_sysvec_init_secondary()

The only requirement for SV_DSO_SIG here is that the flags match between
the source and target sysentvec.

The current assertion is too strict and fails on powerpc64, the only
other architecture than amd64 that uses this function, which doesn't
implement sigtramp in a VDSO.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D33355

2 years agomca: Some error handling logic improvements.
Alexander Motin [Thu, 9 Dec 2021 02:06:11 +0000 (21:06 -0500)]
mca: Some error handling logic improvements.

 - Enable local MCEs on capable Intel CPUs.  It delivers exceptions
only to the affected CPU instead of global broadcast, requiring a lot
of synchronization between CPUs.  AMD always deliver MCEs locally.
 - Make MCE handler process only uncorrected errors, while CMCI and
polling only corrected.  It reduces synchronization problems between
them and is explicitly recommended by the documentation.
 - Add minimal support for uncorrected software recoverable errors
on Intel CPUs.  It allows to avoid kernel panics in case uncorrected
errors do not affect current operation, like ones found during scrub
or write.  Such errors are only logged, postponing the panic until
the corrupted data will actually be needed (that may never happen).
 - Reduce polling period from 1 hour to 5 minutes.

MFC after: 2 weeks

2 years agoRegen
Konstantin Belousov [Wed, 8 Dec 2021 21:25:11 +0000 (23:25 +0200)]
Regen

2 years agoswapon(8): adapt to the new swapoff(2) interface
Konstantin Belousov [Wed, 8 Dec 2021 21:05:49 +0000 (23:05 +0200)]
swapon(8): adapt to the new swapoff(2) interface

also fix test sys/audit/administrative.c.

Reviewed by: brooks
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D33343

2 years agoDocument new variant of swapoff(2)
Konstantin Belousov [Wed, 8 Dec 2021 21:24:31 +0000 (23:24 +0200)]
Document new variant of swapoff(2)

Reviewed by: brooks
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D33343

2 years agoswapoff: add one more variant of the syscall
Konstantin Belousov [Wed, 8 Dec 2021 21:04:57 +0000 (23:04 +0200)]
swapoff: add one more variant of the syscall

Requested and reviewed by: brooks
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D33343

2 years agosyscalls: add COMPAT13
Konstantin Belousov [Wed, 8 Dec 2021 21:01:09 +0000 (23:01 +0200)]
syscalls: add COMPAT13

Reviewed by: brooks
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D33343

2 years agolibmd: Only define SHA256_Transform_c when using the ARM64 ifunc.
John Baldwin [Wed, 8 Dec 2021 22:25:02 +0000 (14:25 -0800)]
libmd: Only define SHA256_Transform_c when using the ARM64 ifunc.

GCC 9 doesn't define a SHA256_Transform symbol when the stub just wraps
SHA256_Transform_c resulting in an undefined symbol for
_libmd_SHA256_Transform in libmd.so.

Discussed with: andrew, jrtc27
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D31945

2 years agoApply ASAN/UBSAN Makefile check only for build target
Ed Maste [Tue, 7 Dec 2021 18:08:02 +0000 (13:08 -0500)]
Apply ASAN/UBSAN Makefile check only for build target

COMPILER_TYPE is not set during cleandir and perhaps other non-build
targets, and a build with ASAN or UBSAN enabled failed with an error
reporting that runtime libraries could not be built.

PR: 260099
Reviewed by: dim
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32805

2 years agoKernel linkers: add emergency sysctl to restore old behavior
Konstantin Belousov [Sun, 7 Nov 2021 09:26:26 +0000 (11:26 +0200)]
Kernel linkers: add emergency sysctl to restore old behavior

allowing linking to static symbols from other files.  Default the new
settings to true, delaying the change of the kernel linker behavior
for other day.

Suggested by: emaste
PR: 207898
Reviewed by: emaste, markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D32878

2 years agokernel linker: do not read debug symbol tables for non-debug symbols
Konstantin Belousov [Sun, 7 Nov 2021 08:37:48 +0000 (10:37 +0200)]
kernel linker: do not read debug symbol tables for non-debug symbols

In particular, this prevents resolving locals from other files.
To access debug symbol tables, add LINKER_LOOKUP_DEBUG_SYMBOL and
LINKER_DEBUG_SYMBOL_VALUES kobj methods, which are allowed to use
any types of present symbols in all tables.

PR: 207898
Reviewed by: emaste, markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D32878

2 years agolinker_debug_symbol_values(): use proper linker interface to get debug values
Konstantin Belousov [Tue, 16 Nov 2021 17:57:32 +0000 (19:57 +0200)]
linker_debug_symbol_values(): use proper linker interface to get debug values

Reported by: markj
Reviewed by: emaste, markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D32878

2 years agoStyle
Konstantin Belousov [Wed, 8 Dec 2021 19:01:14 +0000 (21:01 +0200)]
Style

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D32878

2 years agosyscall_args: remove MAXARGS define
Brooks Davis [Wed, 8 Dec 2021 18:45:15 +0000 (18:45 +0000)]
syscall_args: remove MAXARGS define

Use nitems instead and just use a magic `8` for the size of the args
array.  MAXARGS was rarely used (only in arm64 code) and is an overly
generic name to polute the namespace with.

Requested by: kib in D33308

2 years agoMake struct syscall_args machine independent
Brooks Davis [Wed, 8 Dec 2021 18:45:15 +0000 (18:45 +0000)]
Make struct syscall_args machine independent

After a round of cleanups in late 2020, all definitions are
functionally identical.

This removes a rotted __aligned(8) on arm. It was added in
b7112ead32bc50ef9744099bdbb1cfbd6e906b2a and was intended to align the
args member so that 64-bit types (off_t, etc) could be safely read on
armeb compiled with clang. With the removal of armev, this is no
longer needed (armv7 requires that 32-bit aligned reads of 64-bit
values be supported and we enable such support on armv6).  As further
evidence this is unnecessary, cleanups to struct syscall_args have
resulted in args being 32-bit aligned on 32-bit systems.  The sole
effect is to bloat the struct by 4 bytes.

Reviewed by: kib, jhb, imp
Differential Revision: https://reviews.freebsd.org/D33308

2 years agomca: Switch to using taskqueue_enqueue_timeout_sbt().
Alexander Motin [Wed, 8 Dec 2021 17:29:15 +0000 (12:29 -0500)]
mca: Switch to using taskqueue_enqueue_timeout_sbt().

Previously it was not allowed on fast taskqueues.  It was fixed in
4730a8972b1f.  This should make no functional change, just a bit
cleaner and efficient code.

MFC after: 1 week

2 years agomca: Decode new Intel status bits.
Alexander Motin [Wed, 8 Dec 2021 17:01:48 +0000 (12:01 -0500)]
mca: Decode new Intel status bits.

MFC after: 1 week

2 years agotzsetup: Default to UTC
Emmanuel Vadot [Wed, 8 Dec 2021 12:51:59 +0000 (13:51 +0100)]
tzsetup: Default to UTC

Restore old behavior.

Fixes: f872dde34c ("tzsetup: replace libdialog with libbsddialog")

Reviewed by: bapt
Differential Revision: https://reviews.freebsd.org/D33334
Sponsored by: Beckhoff Automation GmbH & Co. KG

2 years agoHandle table attributes in the arm64 kernel map
Andrew Turner [Tue, 7 Dec 2021 14:23:13 +0000 (14:23 +0000)]
Handle table attributes in the arm64 kernel map

When getting the arm64 kernel maps sysctl we should look at the table
attributes as well as the block/page attributes. These attributes are
different to the last level attributes so need to be translated.

The previous code assumed the table and block/page attributes are
identical, however this is not the case. Handle the difference by
extracting the code into new helper functions & calling them as needed
based on the entry type being checked.

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

2 years agosdhci_fsl_fdt: Add support for HS200/HS400 modes
Hubert Mazur [Wed, 3 Nov 2021 09:38:05 +0000 (10:38 +0100)]
sdhci_fsl_fdt: Add support for HS200/HS400 modes

The controller requires some custom logic to perform MMC tuning
and to later switch to HS400 mode. Implement it supplying mmcbr_tune
and sdhci_set_uhs_timing devmethods respectivly. Since the latter
is called unconditionally when the ios is updated we need to keep
track of the tuning state in sc and execute the HS400 switch logic
only when required.

Two HS200/HS400 related errata were implemented.
1. In HS400 modes the clock divisors are limited to 4, 8, 12.
   Apply it by falling back to the closes, higher divider when needed.
2. Hardware tuning procedure can sometimes fails. If that is the case
   fallback to the software tuning.

Reviewed by:  manu, mw
Obtained from: Semihalf
Sponsored by: Alstom Group
Differential revision: https://reviews.freebsd.org/D33320

2 years agosdhci_fsl_fdt: Fix vccq reconfiguration
Artur Rojek [Fri, 10 Sep 2021 16:03:19 +0000 (18:03 +0200)]
sdhci_fsl_fdt: Fix vccq reconfiguration

As `vqmmc-supply` is an optional Device Tree property, don't skip vccq
reconfiguration when the regulator is not specified. Instead, accept
voltage specified by the `voltage-ranges` property.

The actual voltage switch is done through a hw register in LS1028A.
Add errata flag for other boards, as they are not supported. Return
not supported error code when switching to 1.8V on affected platforms.

Fixes: b08bf4c35ca ("sdhci_fsl_fdt: Skip vccq reconfiguration without regulator")
Co-authored-by: Artur Rojek <ar@semihalf.com>
Reviewed by:  manu, mw
Obtained from: Semihalf
Sponsored by: Alstom Group
Differential revision: https://reviews.freebsd.org/D33319

2 years agosdhci_fsl_fdt: Add LS1012A compat string
Hubert Mazur [Tue, 7 Dec 2021 07:34:26 +0000 (08:34 +0100)]
sdhci_fsl_fdt: Add LS1012A compat string

Add compat string for LS1012A board and fill SoC specific
structure data.

Reviewed by:  manu, mw
Obtained from:  Semihalf
Sponsored by: Alstom Group
Differential Revision: https://reviews.freebsd.org/D33318

2 years agong_ubt(4): Add missing module dependency for _net_bluetooth sysctl node.
Hans Petter Selasky [Wed, 8 Dec 2021 09:17:27 +0000 (10:17 +0100)]
ng_ubt(4): Add missing module dependency for _net_bluetooth sysctl node.

Differential Revision:  https://reviews.freebsd.org/D33282
PR: 238235
MFC after: 1 week
Sponsored by: NVIDIA Networking

2 years agoe1000: fix interface capabilities management
Vincenzo Maffione [Wed, 8 Dec 2021 08:55:04 +0000 (08:55 +0000)]
e1000: fix interface capabilities management

The e1000 drivers (em, lem, igb) are currently looking at the
iflib copies of the capabilities bitvectors (scctx->isc_capabilities
and scctx->isc_capenable) rather than the ifnet ones
(ifp->if_capabilities and ifp->if_capenable). However, the latter
are the ones that are actually updated by ifconfig and that should
be used by the drivers during interface operation. The former are
set by the driver on interface attach (for iflib internal use)
and should not be used anymore by the driver.
This patch fixes the e1000 driver to use the correct bitvectors.

PR: 260068
Reviewed by: markj
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D33154

2 years agosdhci_fsl_fdt: Implement pulse width detection errata
Hubert Mazur [Mon, 6 Dec 2021 08:18:00 +0000 (09:18 +0100)]
sdhci_fsl_fdt: Implement pulse width detection errata

Some boards do not detect pulse width reliably.
Implement workaround by writing 0 to special register.
Apply errata for board by adding flag to chosen soc specific data.

Obtained from: Semihalf
Sponsored by: Alstom Group
Reviewed by: mw, manu
Differential Revision: https://reviews.freebsd.org/D33222

2 years agoenetc: Serialize MDIO transactions
Kornel Duleba [Mon, 29 Nov 2021 11:57:24 +0000 (12:57 +0100)]
enetc: Serialize MDIO transactions

In theory we can have multiple concurrent accesses to the MDIO bus,
e.g. link status check tick and ifconfig request.
In that case we need to make sure that all MDIO transaction are
serialized.

Obtained from: Semihalf
Sponsored by: Alstom Group

2 years agoenetc: Fix VID/mcast address hash calculation
Kornel Duleba [Tue, 30 Nov 2021 08:23:29 +0000 (09:23 +0100)]
enetc: Fix VID/mcast address hash calculation

The hash is calculated by XOR-ing together bits of the VID.
Prepend a statement with "!!" to make sure that we're get bit 0
on both sides of the equation.

Obtained from: Semihalf
Sponsored by: Alstom Group

2 years agosys/_bitset.h: Fix fall-out from commit 5e04571cf3c
Stefan Eßer [Wed, 8 Dec 2021 07:47:42 +0000 (08:47 +0100)]
sys/_bitset.h: Fix fall-out from commit 5e04571cf3c

The changes to the bitset macros allowed sched.h to be included
into userland programs without name space pollution due to BIT_*
and BITSET_* macros.

The definition of a "struct bitset" had been overlooked. This name
space pollution caused the build of port print/miktex to fail.

This commit makes the definition of struct bitset depend on the
same condition as the visibility of the BIT_* and BITSET_* macros,
i.e. needs _KERNEL or _WANT_FREEBSD_BITSET to be defined before
including sys/_bitset.h.

It has been tested with "make universe" since a prior attempt to
fix the issue broke the PowerPC64 kernel build.

This commit shall be MFCed together with commit 5e04571cf3c.

Reported by:    arrowd
MFC after:      1 month

2 years agopkgbase: Allow to specify PKG_ABI on the command line
Emmanuel Vadot [Tue, 7 Dec 2021 17:02:58 +0000 (18:02 +0100)]
pkgbase: Allow to specify PKG_ABI on the command line

This is useful for creating kernel package without having to buildworld
before as we use uname from the world stage dir to get the ABI.

Reviewed by: emaste, imp
Differential Revision: https://reviews.freebsd.org/D33323
Sponsored by: Beckhoff Automation GmbH & Co. KG

2 years agomca: Remove excessively verbose debug messages.
Alexander Motin [Wed, 8 Dec 2021 03:27:09 +0000 (22:27 -0500)]
mca: Remove excessively verbose debug messages.

Expecially in case of AMD there was more than dozen lines per CPU.

MFC after: 1 week

2 years agomca: Make some sysctls also a loader tunables.
Alexander Motin [Wed, 8 Dec 2021 03:20:59 +0000 (22:20 -0500)]
mca: Make some sysctls also a loader tunables.

MFC after: 1 week

2 years agosavecore: emit information about saved cores under verbose
Kyle Evans [Wed, 8 Dec 2021 00:39:34 +0000 (18:39 -0600)]
savecore: emit information about saved cores under verbose

Declare how many cores we saved, and where we saved them to.  Drop a
comment about emitting little information; it's obvious from the block
in question that we emit nothing without verbose.

Reviewed by: markj
Sponsored by: NetApp, Inc.
Sponsored by: Klara, Inc.
X-NetApp-PR: #65
Differential Revision: https://reviews.freebsd.org/D31393

2 years agounionfs: implement VOP_VPUT_PAIR
Jason A. Harmening [Mon, 15 Nov 2021 16:45:20 +0000 (08:45 -0800)]
unionfs: implement VOP_VPUT_PAIR

unionfs must pass VOP_VPUT_PAIR directly to the underlying FS so that
it can have a chance to manage any special locking considerations that
may be necessary.  The unionfs implementation is based heavily on the
corresponding nullfs implementation.

Also note some outstanding issues with the unionfs locking scheme, as
a first step in fixing those issues in a future change.

Discussed with: kib
Tested by: pho
Differential Revision: https://reviews.freebsd.org/D33008

2 years agoRemove unnecessary thread argument from unionfs_nodeget() and _noderem()
Jason A. Harmening [Mon, 15 Nov 2021 16:40:17 +0000 (08:40 -0800)]
Remove unnecessary thread argument from unionfs_nodeget() and _noderem()

Also remove a couple of write-only variables found by the recent clang
update.  No functional change intended.

Discussed with: kib
Differential Revision: https://reviews.freebsd.org/D33008

2 years agolibkvm: Fix kvm_getloadavg() on modern kernel vmcores
Michał Górny [Sun, 7 Nov 2021 21:11:52 +0000 (22:11 +0100)]
libkvm: Fix kvm_getloadavg() on modern kernel vmcores

Fix kvm_getloadavg() to work correctly on vmcores for modern kernel
versions.  The kernels no longer include the `_fscale` symbol causing
the kvm_nlist() invocation to fail.  The code seemed to already assume
that `_fscale` could be missing but the early kvm_nlist() result check
has caused the function to fail if any symbol were missing.  Modify
it to only treat `_averunnable` as obligatory, and handle missing
`_fscale` gracefully.

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

2 years agosys/_bitset.h: revert commit 74e014dbfab
Stefan Eßer [Tue, 7 Dec 2021 22:34:33 +0000 (23:34 +0100)]
sys/_bitset.h: revert commit 74e014dbfab

It caused kernel build for PowerPC64 to fail.

A different patch is being tested with make universe to make sure it
works on all architectures.

MFC after: 1 month<N [day[s]|week[s]|month[s]].  Request a reminder email>

2 years agosys/_bitset.h: Fix fall-out from commit 5e04571cf3c
Stefan Eßer [Tue, 7 Dec 2021 19:29:26 +0000 (20:29 +0100)]
sys/_bitset.h: Fix fall-out from commit 5e04571cf3c

There is a reference to malloc() in #define __BITSET_ALLOC. Even
though this macro is only defined but not used, it causes the lang/gcc
ports to fail. The gcc ports "poison" a number of functions including
malloc() and prevent their use (including in macro definitions).

This commit moved the declaration of __BITSET_ALLOC into the
conditional block that depends on _KERNEL or _WANT_FREEBSD_BITSET
being defined.

There is no use of __BITSET_ALLOC in the FreeBSD sources, and userland
programs that want to use BITSEC_ALLOC will define _WANT_FREEBSD_BITSET
anyway.

This patch has been tested by building lang/gcc11 and a successful
make buildworld.

This commit shall be MFCed together with commit 5e04571cf3c.

MFC after: 1 month

2 years agosys/_bitset.h: Fix fall-out from commit 5e04571cf3c
Konstantin Belousov [Tue, 7 Dec 2021 19:15:30 +0000 (20:15 +0100)]
sys/_bitset.h: Fix fall-out from commit 5e04571cf3c

The changes to the bitset macros allowed sched.h to be included into
userland programs without name space pollution due to BIT_* and
BITSET_* macros.

The definition of a global variable "bitset" had been overlooked.
This name space pollution caused a compile failure in print/miktex.

This commit renames the bitset variable to __bitset with the same
mapping back to the bitset if _KERNEL or _WANT_FREEBSD_BITSET is
defined.

This fix has been suggested by kib. It has been tested to let the
build of the print/miktex port succeed and to not break buildworld.

This commit shall be MFCed together with commit 5e04571cf3c.

Reported by: arrowd
MFC after: 1 month

2 years agodepend-cleanup.sh: Make the output message more precise
Mark Johnston [Tue, 7 Dec 2021 18:01:05 +0000 (13:01 -0500)]
depend-cleanup.sh: Make the output message more precise

Sponsored by: The FreeBSD Foundation

2 years agodepend-cleanup.sh: Handle commit cbdec8db18b5
Mark Johnston [Tue, 7 Dec 2021 16:18:45 +0000 (11:18 -0500)]
depend-cleanup.sh: Handle commit cbdec8db18b5

That commit changed libc to use the MI pdfork implementation, but with
an incremental build the object file for the pdfork.S stub lingers and
causes a linker error.

Cleaning the depend file is not enouch, so modify clean_deps() to remove
object files as well, and add a call to ensure that pdfork.*o is
cleaned.  The new file is _pdfork.o.

Reported by: jhb
Reviewed by: emaste
Fixes: cbdec8db18b5 ("libc: Add pdfork to the list of interposed system calls")
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D33322

2 years agoTeach vm.pmap.kernel_maps about both XN bits
Andrew Turner [Mon, 6 Dec 2021 13:08:39 +0000 (13:08 +0000)]
Teach vm.pmap.kernel_maps about both XN bits

The arm64 vm.pmap.kernel_maps sysctl would only check the kernel XN bit
when printing the kernel mapping. It can also be useful to check none
of the mappings allow userspace to execute from a given virtual address.
To check for this add the user XN bit when getting the kernel maps.

While here fix the ATTR_S1_AP_USER check to use ATTR_S1_AP to shift the
value to the correct offset.

Reviewed by: kib (earlier version), markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D33304

2 years agong_ubt(4): Make net.bluetooth.usb_isoc_enable writable.
Hans Petter Selasky [Tue, 7 Dec 2021 10:50:38 +0000 (11:50 +0100)]
ng_ubt(4): Make net.bluetooth.usb_isoc_enable writable.

Differential Revision: https://reviews.freebsd.org/D33282
PR: 238235
MFC after: 1 week
Sponsored by: NVIDIA Networking

2 years agokldstat(8): style(9) fixes.
Hans Petter Selasky [Tue, 9 Nov 2021 21:09:59 +0000 (22:09 +0100)]
kldstat(8): style(9) fixes.

No functional change intended.

Differential revision:  https://reviews.freebsd.org/D32506
Submitted by:   christos@
MFC after:      1 week
Sponsored by:   NVIDIA Networking

2 years agong_ubt(4): Introduce net.bluetooth.usb_isoc_enable loader tunable to disable
Hans Petter Selasky [Tue, 7 Dec 2021 10:28:21 +0000 (11:28 +0100)]
ng_ubt(4): Introduce net.bluetooth.usb_isoc_enable loader tunable to disable
isochronous transfers.

If users want to disable isochronous transfers, which cause high
frequency periodic interrupts from the USB host controller, then
net.bluetooth.usb_isoc_enable can be set to zero, either as a
sysctl(8) or as a loader.conf(5) tunable.

Differential Revision: https://reviews.freebsd.org/D33282
Submitted by: naito.yuichiro@gmail.com
PR: 238235
MFC after: 1 week
Sponsored by: NVIDIA Networking

2 years agoocs_fc: Remove unused function delarations.
Ram Kishore Vegesna [Mon, 6 Dec 2021 07:02:02 +0000 (12:32 +0530)]
ocs_fc: Remove unused function delarations.

Remove unused function declarations.
Changes required for internal tool.

Approved by: ken

2 years agoflex_spi: Don't try to destroy disk if it doesn't exist
Kornel Duleba [Mon, 6 Dec 2021 14:17:04 +0000 (15:17 +0100)]
flex_spi: Don't try to destroy disk if it doesn't exist

Try to stop and destroy the dist only if the driver has been successfully
attached. Otherwise a kernel panic will be triggered from disk_destroy.
The issue was observed on a board that missed SPI clock description in DT.

2 years agofusefs: invalidate the cache during copy_file_range
Alan Somers [Sun, 5 Dec 2021 20:39:10 +0000 (13:39 -0700)]
fusefs: invalidate the cache during copy_file_range

FUSE_COPY_FILE_RANGE instructs the server to write data to a file.
fusefs must invalidate any cached data within the written range.

PR: 260242
MFC after: 2 weeks
Reviewed by: pfg
Differential Revision: https://reviews.freebsd.org/D33280

2 years agofusefs: inline fuse_io_dispatch
Alan Somers [Sun, 5 Dec 2021 21:25:17 +0000 (14:25 -0700)]
fusefs: inline fuse_io_dispatch

This function was always confusing, because it created an H-shaped
callgraph: two functions called in and left via different paths based on
which which called.

MFC after: 2 weeks

2 years agofusefs: correctly handle an inode that changes file types
Alan Somers [Mon, 6 Dec 2021 05:43:17 +0000 (22:43 -0700)]
fusefs: correctly handle an inode that changes file types

Correctly handle the situation where a FUSE server unlinks a file, then
creates a new file of a different type but with the same inode number.
Previously fuse_vnop_lookup in this situation would return EAGAIN.  But
since it didn't call vgone(), the vnode couldn't be reused right away.
Fix this by immediately calling vgone() and reallocating a new vnode.

This problem can occur in three code paths, during VOP_LOOKUP,
VOP_SETATTR, or following FUSE_GETATTR, which usually happens during
VOP_GETATTR but can occur during other vops, too.  Note that the correct
response actually doesn't depend on whether the entry cache has expired.
In fact, during VOP_LOOKUP, we can't even tell.  Either it has expired
already, or else the vnode got reclaimed by vnlru.

Also, correct the error code during the VOP_SETATTR path.

PR: 258022
Reported by: chogata@moosefs.pro
MFC after: 2 weeks
Reviewed by: pfg
Differential Revision: https://reviews.freebsd.org/D33283

2 years agoamd64: Pass DEBUG when building VDSO wrapper
Jessica Clarke [Mon, 6 Dec 2021 23:09:29 +0000 (23:09 +0000)]
amd64: Pass DEBUG when building VDSO wrapper

Not doing so results in ctfconvert failing with

  ERROR: ctfconvert: elf-vdso.so.o doesn't have type data to convert

On FreeBSD this is non-fatal, since the ctf tools have a hack to make
such errors not fail the build and instead just silently continue
without CTF data (which is a bad idea these days and should probably be
removed; they date back to the original import). However, those are
under #ifdef __FreeBSD__ so do not apply when cross-building from
non-FreeBSD, causing the build to fail.

Fix this by forwarding DEBUG on to the compiler invocation for the VDSO
wrapper. It's assembly so it's not hugely useful, but there is a
non-zero amount of information preserved, and other assembly files are
built with -g by default too so this matches them; the alternative would
be to tag the files.amd64 entries with no-ctfmerge. Note that the VDSO
itself is still compiled without debug info, this only affects the
wrapper linked into the kernel.

Fixes: 98c8b6252496 ("vdso for ia32 on amd64"), ab4524b3d7fb ("amd64: wrap 64bit sigtramp into vdso")
MFC after: 1 month

2 years agosrc.libnames.mk: Extend _DP_archive hack when bootstrapping on non-FreeBSD
Jessica Clarke [Mon, 6 Dec 2021 23:06:34 +0000 (23:06 +0000)]
src.libnames.mk: Extend _DP_archive hack when bootstrapping on non-FreeBSD

On Linux, libcrypto is available so a non-WITHOUT_OPENSSL build happens
to work, but on macOS it isn't available to be linked against (though
there is a versioned dylib for /usr/bin/openssl etc), and neither have
libmd so would both be broken under WITHOUT_OPENSSL. Since we're using
the system libarchive, further extend the hack to ensure _DP_archive is
empty.

Fixes: ed4050750c1a ("src.libnames.mk: Add hack to workaround libarchive not being bootstrapped")
MFC after: 1 week

2 years agoMakefile.inc1: Bootstrap libcrypt on non-FreeBSD for libroken
Jessica Clarke [Mon, 6 Dec 2021 23:00:31 +0000 (23:00 +0000)]
Makefile.inc1: Bootstrap libcrypt on non-FreeBSD for libroken

After f0a6ab51e6da, we need libroken's dependencies to be present; in
particular, libcrypt is not present on macOS, and so needs to be
bootstrapped. We include this on Linux too for consistency and to avoid
future compatibility issues, even if strictly unnecessary currently.

Fixes: f0a6ab51e6da ("src.libnames.mk: Include dependencies when bootstrapping from non-FreeBSD"
MFC after: 1 week

2 years agocross-build: Provide _PASSWORD_EFMT1 for libcrypt on Linux
Jessica Clarke [Mon, 6 Dec 2021 23:25:53 +0000 (23:25 +0000)]
cross-build: Provide _PASSWORD_EFMT1 for libcrypt on Linux

Linux's pwd.h does not define _PASSWORD_EFMT1 (macOS's does), so we need
to define it in order to be able to bootstrap libcrypt (crypt-des.c uses
it) on non-FreeBSD, which will be done in a subsequent commit.

MFC after: 1 week

2 years agocross-build: Define crypt_data in unistd.h for libcrypt
Jessica Clarke [Mon, 6 Dec 2021 22:29:51 +0000 (22:29 +0000)]
cross-build: Define crypt_data in unistd.h for libcrypt

This is where it's defined in the base system, so is where libcrypt
expects it to exist when being built, and will be needed when being
bootstrapped in a subsequent commit.

MFC after: 1 week

2 years agolibcrypt: Drop inclusion of libutil.h
Jessica Clarke [Mon, 6 Dec 2021 22:28:10 +0000 (22:28 +0000)]
libcrypt: Drop inclusion of libutil.h

This was rendered obsolete in 2012 by a0ee974f0bad, since auth_getval
was the only reason the header was included.

MFC after: 1 week

2 years agozlib: Fix bootstrap build on macOS
Jessica Clarke [Mon, 6 Dec 2021 22:24:42 +0000 (22:24 +0000)]
zlib: Fix bootstrap build on macOS

gzlib.c uses lseek but does not include unistd.h, where it is defined to
live. On FreeBSD this happens to work due to sys/types.h declaring it,
but on macOS it fails due to being only implicitly declared, which is
treated as an error by default by the system Clang.

MFC after: 1 week

2 years agolibc: get rid of NO_P1003_1B make variable
Brooks Davis [Tue, 7 Dec 2021 00:18:34 +0000 (00:18 +0000)]
libc: get rid of NO_P1003_1B make variable

There's no point in a knob to avoid installing a half dozen manpages.
It's undocumented and unused in the tree.  Online, the only metions
I've found are the FreeBSD source tree, a commit in DragonFly BSD
removing it, and some lists of build options for small systems where
it's inevitably redundant due to an accompanying NO_MAN.

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

2 years agoamd64: Only build aout.ko when COMPAT_FREEBSD32 is enabled
Konstantin Belousov [Mon, 6 Dec 2021 23:11:10 +0000 (01:11 +0200)]
amd64: Only build aout.ko when COMPAT_FREEBSD32 is enabled

a.out.ko is useless without COMPAT_FREEBSD32, and since vdso support was
added, it requires a header built during depend phase, from the COMPAT
option.

Reported by: glebius
Reviewed by: emaste, markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D33311

2 years agokern.pre.mk: trim space at EoL
Konstantin Belousov [Mon, 6 Dec 2021 23:10:12 +0000 (01:10 +0200)]
kern.pre.mk: trim space at EoL

Reviewed by: emaste, markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D33311

2 years agolibc: Add pdfork to the list of interposed system calls
Mark Johnston [Mon, 6 Dec 2021 23:02:25 +0000 (18:02 -0500)]
libc: Add pdfork to the list of interposed system calls

Otherwise the asm stub is used and libthr interposition does not work.

Reviewed by: kib
Fixes: 21f749da82e7 ("libthr: wrap pdfork(2), same as fork(2).")
MFC after: 1 week
Sponsored by: The FreeBSD Foundation