Commit Graph

21271 Commits

Author SHA1 Message Date
Baptiste Daroussin
f3aad18d5e sh(1): fix home/del key on mobaxterm env
For $reason mobaxterm default on sending unusual sequence from home/del
key, which makes libedit unabel to catch them and bind them correctly.

mobaxterm seems popular on the windows environment, so add proper
keybinding to default shrc configuration so it works out of box.

Reported by:	lme
2021-10-20 14:00:20 +02:00
Baptiste Daroussin
5fe9737348 skel: update .shrc as well
Somehow we end up having 2 definition of the same .shrc in the source
tree, both of them should have been updated.

A batter fix would be to only keep one copy of the same file. but that
would be for another commit

Reported by:	lme
2021-10-20 11:23:13 +02:00
Felix Johnson
262717e270 arswitch(4): Add new manpage
PR:		211668
Reported by:	O. Hartmann <ohartmann@walstatt.org>
Reviewed by:	adrian, debdrup, imp
Differential Revision:	https://reviews.freebsd.org/D32476
2021-10-19 23:35:04 -04:00
Mark Johnston
6d3c78d970 Rewrite the vm_page_alloc manual page
Document the new allocator variants and flesh out the description of
some details of the page allocator interface.

Reviewed by:	kib, alc
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D32035
2021-10-19 21:22:56 -04:00
Mark Johnston
51425cb210 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
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D32472
2021-10-18 09:56:58 -04:00
Edward Tomasz Napierala
70774c637b procfs: Document as deprecated
Update the procfs(5) man page to clarify that it's deprecated.

Reviewed By:	bcr, 0mp (earlier version)
Sponsored By:	EPSRC
Differential Revision: https://reviews.freebsd.org/D22275
2021-10-17 13:46:00 +01:00
Ed Maste
2e85df652c Add libcbor to the build
From https://github.com/PJK/libcbor:

    libcbor is a C library for parsing and generating CBOR, the general-
    purpose schema-less binary data format.

libcbor will be used by ssh to support FIDO/U2F keys.  It is currently
intended only for use by ssh, and so is installed as a PRIVATELIB and is
placed in the ssh pkgbase package.

cbor_export.h and configuration.h were generated by the upstream CMake
build.  We could create them with bmake rules instead (as NetBSD has
done) but this is a fine start.

This is currently disabled for the 32-bit library build as libfido2 is
not compatible with the COMPAT_32BIT hack in usb_ioctl.h, and there is
no need for libcbor without libfido2.

Reviewed by:	kevans
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D32347
2021-10-15 15:10:24 -04:00
Felix Johnson
a524aaf683 bpf(4): Fix a misnamed constant
rarpd.c was modified in r19859 to use REVARP_REQUEST instead of
ARPOP_REVREQUEST.

PR:		183333
MFC after:	3 days
Reported by:	pluknet <pluknet@gmail.com>
2021-10-13 19:03:18 -04:00
Felix Johnson
6882064d0c acpi(4): Correct outdated sysctl
This changes the location of cx_supported sysctl to dev.cpu.N.

PR:		214370
MFC after:	3 days
2021-10-12 20:47:03 -04:00
Felix Johnson
df7d763849 pthread_np.3: Add a manpage summarizing all of the pthread extensions.
PR:		197299
MFC after:	1 week
2021-10-12 13:20:36 -07:00
Kyle Evans
08580603b5 kqueue(9): correct spelling of kn_fop 2021-10-12 02:44:09 -05:00
Mateusz Guzik
2b68eb8e1d vfs: remove thread argument from VOP_STAT
and fo_stat.
2021-10-11 13:22:32 +00:00
Baptiste Daroussin
9294a2c719 ncurses: convert libncursesw.a into a static ldscript
Introduce the notion of static linker scripts to allow libncursesw.a to
track its dependency on libtinfow.a

this allows the build of older freebsd source tree to happen and make
static linking in part with dynamic linking which already provides a
ldscript

This fixes a bootstrapping FreeBSD 12 or 13 on recent FreeBSD 14

Reviewed by:		imp
Differential Revision:	https://reviews.freebsd.org/D32435
2021-10-10 07:51:00 +02:00
Warner Losh
15575aca87 bsd.cpu.mk: Minor formatting for armv6 vs armv7
Separate out the arch/cpu options for armv6 from the armv7 ones. This is
less confusing.

Sponsored by:		Netflix
2021-10-08 15:44:46 -06:00
Konstantin Belousov
b5cadc643e Make core dump writes interruptible with SIGKILL
This can be disabled by sysctl kern.core_dump_can_intr

Reported and tested by:	pho
Reviewed by:	imp, markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D32313
2021-10-08 03:21:43 +03:00
Konstantin Belousov
2ec505d2b8 core(5): explicitly mention the core file size limit name
Reviewed by:	imp, markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D32313
2021-10-08 03:21:43 +03:00
John Baldwin
42dcd39528 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
2021-10-06 14:08:49 -07:00
John Baldwin
ae18720d27 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
2021-10-06 14:08:47 -07:00
John Baldwin
16676123fc 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
2021-10-06 14:08:46 -07:00
Tom Hukins
70ffa69e1b Remove obsolete amd(8) rc.conf configuration
The script that used these was removed in 13f7dbe822 along with amd
itself.

Fixes:		13f7dbe822 ("retire amd(8)")
MFC after:	1 week
Pull Request:	https://github.com/freebsd/freebsd-src/pull/548
2021-10-05 17:16:58 -04:00
Konstantin Belousov
be6116fdfc pthread_mutexattr(3): document each pthread_mutexattr_set/get* function
The descriptions may be more elaborated of course, but this is a good
step at starting providing any useful information in our man page, at all.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Differential revision:	https://reviews.freebsd.org/D32243
2021-10-05 06:39:53 +03:00
Konstantin Belousov
6bda192013 pthread_mutexattr(3): install pthread_mutexattr_get/setpshared links
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Differential revision:	https://reviews.freebsd.org/D32243
2021-10-05 06:39:52 +03:00
Konstantin Belousov
0a6e5fc29b pthread_mutexattr(3): document pthread_mutexattr_set/getpshared
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Differential revision:	https://reviews.freebsd.org/D32243
2021-10-05 06:39:52 +03:00
Konstantin Belousov
9f3b6cdbe8 pthread_mutexattr(3): use .Fo/.Fc to avoid too long lines
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Differential revision:	https://reviews.freebsd.org/D32243
2021-10-05 06:39:52 +03:00
Baptiste Daroussin
cbc83e378a ncurses: chase dependency changes in the source tree
Differential Revision:	https://reviews.freebsd.org/D32098
2021-10-04 11:38:24 +02:00
Baptiste Daroussin
396851c20a ncurses: split libtinfo from libncurses
many external program expects libncurses to not be provided as a single
library. Instead of fixing all ports, distribute ncurses the way
upstream distributes it

Turn libncursesw.so into a ldscript which will link automatically as
needed to libtinfow so so this change is seamless at compile time.

Differential Revision:	https://reviews.freebsd.org/D32098
2021-10-04 11:38:21 +02:00
Warner Losh
4b3da659bf nvme: Only reset once on attach.
The FreeBSD nvme driver has reset the nvme controller twice on attach to
address a theoretical issue assuring the hardware is in a known
state. However, exierence has shown the second reset is unnecessary and
increases the time to boot. Eliminate the second reset. Should there be
a situation when you need a second reset (for buggy or at least somewhat
out of the mainstream hardware), the hardware option NVME_2X_RESET will
restore the old behavior. Document this in nvme(4).

If there's any trouble at all with this, I'll add a sysctl tunable to
control it.

Sponsored by:		Netflix
Reviewed by:		cperciva, mav
Differential Revision:	https://reviews.freebsd.org/D32241
2021-10-01 11:09:34 -06:00
Kyle Evans
6a7647eccd jail(3lua): add a jail.list() method
This is implemented as an iterator, reusing parts of the earlier logic
to populate jailparams from a passed in table.

The user may request any number of parameters to pull in while we're
searching, but we'll force jid and name to appear at a minimum.

Reviewed by:	freqlabs
Differential Revision:	https://reviews.freebsd.org/D26756
2021-09-30 16:30:57 -05:00
Warner Losh
79a100e28e bluetooth: complete removal of ng_h4
The ng_h4 module was disconnected 13 years ago when the tty later was
locked by Ed. It completely fails to compile, and has a number of false
positives for Giant use. Remove it for lack of interest. Bluetooth has
largely (completely?) moved on from bluetooth over UART transport.

OK'd by:		emax
Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D31846
2021-09-29 20:00:02 -06:00
Kristof Provost
20f015f08d pf.conf: document syncookies
Reviewed by:	bcr
Obtained from:	OpenBSD
MFC after:	1 week
Sponsored by:	Modirum MDPay
Differential Revision:	https://reviews.freebsd.org/D32137
2021-09-29 15:41:49 +02:00
Ed Maste
543df60907 mgb: Connect if_mgb module to the build
It supports the following Microchip devices:

LAN7430 PCIe Gigabit Ethernet controller with PHY
LAN7431 PCIe Gigabit Ethernet controller with RGMII interface

The driver has a number of caveats and limitations, but is functional.

Relnotes:	Yes
Sponsored by:	The FreeBSD Foundation
2021-09-28 21:16:40 -04:00
Ed Maste
667ea7385d mgb: Update man page wrt state of the driver
Be explicit that the driver has caveats and limitations, and remove the
note about not being connected to the build: I plan to connect it soon.
(Also the note serves no real purpose in a man page that is not
installed.)

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2021-09-28 16:28:37 -04:00
Mitchell Horne
800e74955d boot(9): update to match reality
This function was renamed to kern_reboot() in 2010, but the man page has
failed to keep in sync. Bring it up to date on the rename, add the
shutdown hooks to the synopsis, and document the (obvious) fact that
kern_reboot() does not return.

Fix an outdated reference to the old name in kern_reboot(), and leave a
reference to the man page so future readers might find it before any
large changes.

Reviewed by:	imp, markj
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D32085
2021-09-28 11:36:09 -03:00
Yasuhiro Kimura
77087b11e2 Add myself as ports committer and update mentor/mentee information
It corresponds to the 5th step of the procedure described in section
7.1 of Committer's Guide.

Approved by:	meta (mentor)
Differential Revision:	https://reviews.freebsd.org/D32151
2021-09-27 15:10:47 +09:00
Alexander Motin
c8077ccd70 acpi_cpu: Make device unit numbers match OS CPU IDs.
There are already APIC ID, ACPI ID and OS ID for each CPU.  In perfect
world all of those may match, but at least for SuperMicro server boards
none of them do.  Plus none of them match the CPU devices listing order
by ACPI.  Previous code used the ACPI device listing order to number
cpuX devices.  It looked nice from NewBus perspective, but introduced
4th different set of IDs. Extremely confusing one, since in some places
the device unit numbers were treated as OS CPU IDs (coretemp), but not
in others (sysctl dev.cpu.X.%location).
2021-09-24 21:24:19 -04:00
Kristof Provost
00a7a05bde pf.conf.5: document dummynet support
MFC after:	2 weeks
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D31907
2021-09-24 11:41:26 +02:00
Kristof Provost
c8607bf4e7 man dummynet: dummynet can also be used with pf
MFC after:	2 weeks
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D31906
2021-09-24 11:41:26 +02:00
Kristof Provost
cc1ce085b8 man dummynet: point to dnctl instead of ipfw
Dummynet configuration is ideally done through dnctl now. While ipfw
still works dnctl is preferred now that dummynet can also be used with
pf.

MFC after:	2 weeks
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D31902
2021-09-24 11:41:25 +02:00
Baptiste Daroussin
00582fa660 pci_vendors: update to 2021.09.19 2021-09-22 09:36:43 +02:00
Konstantin Belousov
cf0ee8738e Drop cloudabi
According to https://github.com/NuxiNL/cloudlibc:
CloudABI is no longer being maintained. It was an awesome experiment,
but it never got enough traction to be sustainable.

There is no reason to keep it in FreeBSD.

Approved by:	ed (private mail)
Reviewed by:	emaste
Sponsored by:	The FreeBSD Foundation
Differential revision:	https://reviews.freebsd.org/D31923
2021-09-22 00:18:44 +03:00
Mark Johnston
dfd3bde577 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
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D32028
2021-09-21 12:07:39 -04:00
Bartlomiej Grzesik
3f9a00e3b5 device: add device_get_property and device_has_property
Generialize bus specific property accessors. Those functions allow driver code
to access device specific information.

Currently there is only support for FDT and ACPI buses.

Reviewed by: manu, mw
Sponsored by: Semihalf
Differential revision: https://reviews.freebsd.org/D31597
2021-09-20 17:17:57 +02:00
John Baldwin
93d6fa53c9 Disable -Woverflow errors for i386 for GCC 9.
GCC 9 warns about floating point constants overflowing for i386.

Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D26201
2021-09-13 11:00:38 -07:00
Dimitry Andric
45feade38e Add -Wno-error=unused-but-set-variable when building with Clang 13+
This warning triggers many times while building world. Downgrade it to a
warning until all occurrences have been fixed. Once the Clang warnings
have been fixed we should be able to turn it on for GCC as well. See
also f4fed768bb which did the same for the
kernel builds.

Reviewed by:	arichardson, imp
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D31927
2021-09-13 18:05:43 +02:00
Edward Tomasz Napierala
ddedf2a11e tzcode: Implement timezone change detection
Implement optional timezone change detection for local time libc
functions.  This is disabled by default; set WITH_DETECT_TZ_CHANGES
to build it.

Reviewed By:	imp
Sponsored by:	NetApp, Inc.
Sponsored by:	Klara, Inc.
X-NetApp-PR:	#47
Differential Revision:	https://reviews.freebsd.org/D30183
2021-09-12 03:07:58 +00:00
Alex Richardson
2d78130185 Add missing dep patterns for .pieo
While adding sanitizer support, I noticed that all other extensions were
handled but .pieo was missing.

Reviewed By:	emaste, imp
MFC after:	1 week

Differential Revision: https://reviews.freebsd.org/D31040
2021-09-13 13:22:31 +01:00
Ed Maste
7c0226cad3 bsd.lib.mk: add conditions for building _pie.a archives
As with other .a targets, build _pie.a archives only if LIB is set.

At present we build _pie.a only for INTERNALLIBs, and none of them
include bsd.lib.mk without setting LIB.  However, we might want to build
_pie.a for non-INTERNALLIBs in the future.

Reviewed by:	arichardson
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D31920
2021-09-13 07:52:02 -04:00
Antranig Vartanian
7955efd574 Add support for jail.conf.d
Using /etc/jail.{jailname}.conf is nice, however it makes /etc/ very
messy if you have many jails.  This patch allows one to move these
config files out of the way into /etc/jail.conf.d/{jailname}.conf.

Note that the same caveat as /etc/jail.*.conf applies: the jail service
will not autodiscover all of these for starting 'all' jails.  This is
considered future work, since the behavior matches.

Reviewed by:	kevans
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D24570
2021-09-10 00:30:04 -05:00
Henri Hennebert
9d3bc16382 rtsx: Call taskqueue sooner, adjust DELAY(9) calls, add an inversion heuristic
- Some configurations, e.g. HP EliteBook 840 G3, come with a dummy card
in the card slot which is detected as a valid SD card.  This added long
timeout at boot time.  To alleviate the problem, the default timeout is
reduced to one second during the setup phase. [1]

- Some configurations crash at boot if rtsx(4) is defined in the kernel
config.  At boot time, without a card inserted, the driver found that
a card is present and just after that a "spontaneous" interrupt is
generated showing that no card is present.  To solve this problem,
DELAY(9) is set to one quarter of a second before checking card presence
during driver attach.

- As advised by adrian, taskqueue and DMA are set up sooner during
the driver attach.  A heuristic to try to detect configuration needing
inversion was added.

PR:		255130 [1]
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D30499
2021-09-09 14:26:17 -04:00
Emmanuel Vadot
27a7ae0ce0 pkgbase: Create a syscons-data package
syscons is mostly deprecated and all it's files aren't needed for most
users so create a separate package for them.

Differential Revision:	   https://reviews.freebsd.org/D31798
Reviewed by: emaste
2021-09-07 10:21:40 +02:00