Commit Graph

283688 Commits

Author SHA1 Message Date
Warner Losh
cf6044857e stand: Testing program for smbios
Write a quick and dirty testing program to dump physical memory to help
test and debug the smbios.c code in new environments.

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D39791
2023-05-01 15:12:19 -06:00
Warner Losh
83eabc64ef kboot: Add HOST_MAP_FAILED define
Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D39790
2023-05-01 15:11:32 -06:00
Warner Losh
b53ec4e44f stand: Add isspace to FreeBSD ctypes.h
And eliminate blake3_impl_hack.c since it's no longer needed.

Sponsored by:		Netflix
Reviewed by:		delphij
Differential Revision:	https://reviews.freebsd.org/D39899
2023-05-01 15:02:54 -06:00
Warner Losh
6c8358cd7f stand: back out the most of the horrible aarch64 kludge
Add one ifdef to upstrem code and get rid of compiling the horrible
checked-in aarch64 assembler for the boot loader that the loader will
never use. I'll attempt to upstream this and adjust as needed.

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D39897
2023-05-01 15:02:54 -06:00
Warner Losh
96b119340e stand: remove ZFS warning about computered but unused variable
Toss a __unused on the unexpected_errors variable. We compute it, but
never use it.

Sponsored by:		Netflix
2023-05-01 15:02:54 -06:00
Warner Losh
cb8179079a stand: Fix warning about variable unused
dflag is unused when LOADER_VERIEXEC isn't defined, so move it under the
ifdef.

Sponsored by:		Netflix
2023-05-01 15:02:54 -06:00
Warner Losh
5328f9034f stand/kboot: Simplify
There's plenty of stack in kboot, so use it here rather than the
malloc/free dance.

Sponsored by:		Netflix
Reviewed by:		tsoome, kevans
Differential Revision:	https://reviews.freebsd.org/D39416
2023-05-01 15:02:53 -06:00
Warner Losh
d5babd0d23 stand/efi: Simplify code here
We have plenty of stack in the EFI case, so use it instead of the
complicated malloc / free dance.

Sponsored by:		Netflix
Reviewed by:		tsoome, kevans
Differential Revision:	https://reviews.freebsd.org/D39415
2023-05-01 15:02:53 -06:00
Warner Losh
5ce98ee5f4 stand/userboot: Simplify code
We have way more than 8k of stack for the current value of the zfs
bootonce attribute. Allocate buf on the stack rather than the
complicated malloc / free dance.

Sponsored by:		Netflix
Reviewed by:		tsoome, kevans, jhb
Differential Revision:	https://reviews.freebsd.org/D39414
2023-05-01 15:02:53 -06:00
Warner Losh
0c4183f02e rc.d/zfsbe: Simplify
So $(foo) is a shorter version of "`foo`".

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D39413
2023-05-01 15:02:53 -06:00
Warner Losh
43f7eeff0d stand/boot1.efi: Implement bootonce for ZFS
Implement ZFS bootonce protocol. We pass zfs-bootonce=t to the next boot
stage as a command line argument. Unlike zfsboot -> loader handoff in
the BIOS case, we don't use the OS_BOOTONCE_USED. This would require
modifications to loader.efi which would only server to make it more
complicated. Instead, use the command line parsing interface for the
boot1.efi -> loader.efi to pass in the zfs-bootonce kenv that will be
needed by rc.d/zfsbe to activate the BE if boot progresses that far.

Sponsored by:		Netflix
Reviewed by:		tsoome, kevans
Differential Revision:	https://reviews.freebsd.org/D39412
2023-05-01 15:02:53 -06:00
Warner Losh
b765cfa380 stand/zfs: Refactor zfs_get_bootonce
Lookup the spa and pass it into zfs_get_bootonce_spa to process the boot
once protocol.

Sponsored by:		Netflix
Reviewed by:		tsoome, kevans
Differential Revision:	https://reviews.freebsd.org/D39411
2023-05-01 15:02:53 -06:00
Warner Losh
4dcae288fe stand/zfs: Refactor zfs_set_bootenv
Refactor zfs_set_bootenv to split out the lookup of spa from the
rest. zfs_set_bootenv_spa flushes the benv to the vdevs and updates the
cached benv.

Sponsored by:		Netflix
Reviewed by:		tsoome, kevans
Differential Revision:	https://reviews.freebsd.org/D39410
2023-05-01 15:02:53 -06:00
Warner Losh
6479bd1b7d stand/zfs: Refactor zfs_get_bootenv
Create a new interface to zfs_get_bootenv called zfs_get_bootenv_spa
which takes a spa instead of a void * (effectively a devdesc *). Use
that in zfs_get_bootenv.

Sponsored by:		Netflix
Reviewed by:		tsoome, kevans
Differential Revision:	https://reviews.freebsd.org/D39409
2023-05-01 15:02:53 -06:00
Warner Losh
439a9766ad stand/zfs: Move spa_find_by_dev from zfsimpl.c to zfs.c
zfsimpl.c doesn't know about devdesc at all, but zfs.c does. Move it to
zfs.c, which is the only user. Keep it static for now, but it could be
exposed later if something else were to need it.

Sponsored by:		Netflix
Reviewed by:		tsoome, kevans
Differential Revision:	https://reviews.freebsd.org/D39408
2023-05-01 15:02:52 -06:00
Warner Losh
91ac713b64 stand/boot1.efi: Allow modules to add env variables
Sometimes filesystem modules need to pass details of the state of the
filesystem to later stages of a boot. Provide a generic method to do
so. We'll add them after any env variables set in our config files.

Sponsored by:		Netflix
Reviewed by:		tsoome, kevans
Differential Revision:	https://reviews.freebsd.org/D39407
2023-05-01 15:02:52 -06:00
Ed Maste
5f2e84015d bsd.lib.mk: decouple lib*_pic.a from TOOLCHAIN build knob
A user may use a tool chain from a package or just use an existing
tool chain from a previous installation.  There is no reason for this
to disable the installation of lib${LIB}_pic.a.

This also means we don't need to force MK_TOOLCHAIN=yes in lib/libc.

This reverts part of commit c0f5aeb032.

Reviewed by:	jrtc27
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39917
2023-05-01 16:46:39 -04:00
Ed Maste
ed2e50508c bxe: prefer C99 bool to boolean_t
Differential Revision:	https://reviews.freebsd.org/D20853
2023-05-01 16:23:39 -04:00
Ed Maste
2a3bd08708 pkgbase: hide duplicate METALOG directory warnings under verbose
Creating directories multiple times is an inherent side effect of the
way installation is done.  Hide warnings from duplicate directory
entries (with identical metadata) under metalog_reader's verbose mode.

Duplicate file entries are always reported.  They currently generate
warnings but will be switched to errors once the few instances currently
in the tree are fixed.

PR:		244596, 271178
Reviewed by:	kevans
Sponsored By:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D39898
2023-05-01 15:22:36 -04:00
Ed Maste
75baf3765c Cirrus-CI: set PKG_FORMAT via top level env:
This ensures consistency among different CI scripts, including future
ones for pkgbase work.

Sponsored by:	The FreeBSD Foundation
2023-05-01 14:03:32 -04:00
Christos Margiolis
e11d11c543 kinst: test lock in kinst_trampoline_dealloc_locked()
Reviewed by:	markj
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D39883
2023-05-01 11:40:29 -04:00
Christos Margiolis
aad1685066 fbt: get rid of redundant defines
No functional change intended.

Reviewed by:	markj
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D39882
2023-05-01 11:40:29 -04:00
Mark Johnston
56da525b53 hwpmc: Fix a typo
MFC after:	1 week
2023-05-01 11:40:29 -04:00
Tom Hukins
e5bc2547a5 geom(4): Add cross reference to geom(8)
PR:		264387
Reviewed by:	ceri
Pull Request:	https://github.com/freebsd/freebsd-src/pull/702
2023-05-01 11:06:00 -04:00
Tom Hukins
865362061d mfi(4): Refer to mrsas(4)
Reviewed by:	imp
Pull Request:	https://github.com/freebsd/freebsd-src/pull/722
2023-05-01 11:06:00 -04:00
Alexander V. Chernikov
88406e631e netlink: whitespace fix in netlink_message_writer.h.
Reported by:	garga
MFC after:	2 weeks
2023-05-01 14:47:11 +00:00
Tom Hukins
a58648a68b wlan(4): Add more related drivers to "See also"
Pull Request:	https://github.com/freebsd/freebsd-src/pull/721
2023-05-01 10:38:09 -04:00
Tom Hukins
7626863e19 pf: Fix a spelling mistake in a comment
Pull Request:	https://github.com/freebsd/freebsd-src/pull/704
2023-05-01 10:30:15 -04:00
Tom Hukins
9c353fa4a9 libc: Fix a documentation spelling mistake
Pull Request:	https://github.com/freebsd/freebsd-src/pull/704
2023-05-01 10:30:15 -04:00
Kajetan Staszkiewicz
db0a2bfd0c pf: reduce number of hashing operations when handling source nodes
Reduce number of hashing operations when handling source nodes by always
having a pointer to the hash row mutex in the source node. Provide
macros for handling and asserting the mutex. Calculate the hash only
once in pf_find_src_node() and then use this hash in subsequent
operations.

Cherry-picked from development of D39880

Reviewed by:	kp, mjg
Sponsored by:	InnoGames GmbH
Differential Revision:	https://reviews.freebsd.org/D39888
2023-05-01 16:15:30 +02:00
Alexander V. Chernikov
6a09a7f1e9 netlink: always zero provided header buffers.
Reported by:	KMSAN
MFC after:	3 days
2023-05-01 14:09:47 +00:00
Hans Petter Selasky
a554ff4670 libmlx5: Add more ConnectX-6/7/8 HCA IDs to hca_table.
To allow userspace utilities to use these devices.

MFC after:	1 week
Sponsored by:	NVIDIA Networking
2023-05-01 13:48:20 +02:00
Mina Galić
d502d3fc72 opensm: Fix build with -Werror and -Wdate-time.
This fixes builds WITH_OFED_EXTRA=YES .

PR:		270776
Pull Request:	https://github.com/freebsd/freebsd-src/pull/715
MFC after:	1 week
Sponsored by:	NVIDIA Networking
2023-05-01 13:46:24 +02:00
Peter Holm
b274854dd9 stress2: Added a temporary fix for the UFS+SU "out of inodes" issue 2023-05-01 12:52:42 +02:00
Xin LI
159d764c16 Vendor import of less v632. 2023-05-01 01:22:19 -07:00
Emmanuel Vadot
d198b8774d fwget: Introduce new utility
This script's goal is to check the system for peripherals that needs
firmware and install the needed packages for them.
For now it only support pci subsystem and only video classes for AMD
and Intel GPUs.

Reviewed by:	bapt
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D39825
2023-05-01 08:32:59 +02:00
Emmanuel Vadot
ea9075959b armv7: release: Stop installing BBB u-boot
BBB code was removed from GENERIC kernel as it's not functional.
Stop installing u-boot for a platform that we don't boot on.

Reviewed by:	imp, gjb
Approved by:	re@ (gjb)
MFC after:	never
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D39844
2023-05-01 08:32:21 +02:00
Emmanuel Vadot
3416e102c4 arm: Remove TI code from GENERIC
TI support is in a sad state for years.
We haven't been able to keep up with all the breaking changes that
upstream do in the DTS. This requires a lot of new drivers to handle the
new buses that they create and all the new clocks that they expose.
Keep the code for now in case somebody is interested in reviving this
platform but stop bloating GENERIC with code that don't work.

Reviewed by:	imp, mmel
MFC after:	never
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D39843
2023-05-01 08:32:21 +02:00
Eugene Grosbein
4824d78872 listen(2): improve administrator control over logging
As documented in listen.2 manual page, the kernel emits a LOG_DEBUG
syslog message if a socket listen queue overflows. For some appliances,
it may be desirable to change the priority to some higher value
like LOG_INFO while keeping other debugging suppressed.

OTOH there are cases when such overflows are normal and expected.
Then it may be desirable to suppress overflow logging altogether,
so that dmesg buffer is not flooded over long run.

In addition to existing sysctl kern.ipc.sooverinterval,
introduce new sysctl kern.ipc.sooverprio that defaults to 7 (LOG_DEBUG)
to preserve current behavior. It may be changed to any value
in a range of 0..7 for corresponding priority or to -1 to suppress logging.
Document it in the listen.2 manual page.

MFC after:	1 month
2023-05-01 03:26:44 +07:00
Stefan Eßer
8c48f4c537 contrib/bc: import version 6.5.0
This release that fixes an infinite loop bug in the (non-standard)
extended math library functions root() and cbrt(), fixes a bug with
BC_LINE_LENGTH=0, and adds the fib() function to the extended math
library to calculate Fibonacci numbers.

(cherry picked from commit 438a1101dc1f687928cdbe02cd7817a88a24f42f)

MFC after:      3 days
2023-04-30 20:28:21 +02:00
Kristof Provost
6a23843a4a libifconfig: fix carp key configuration
There were two issues with the carp key configuration in the new netlink
code.

The first is that userspace failed to actually pass the CARP_NL_KEY
attribute to the kernel, so a key was never set.

The second issue is that snl_attr_get_string() returns a pointer to the
string inside the netlink message. It does not copy the string to the
target buffer. That's somewhat inconvenient to work with in libifconfig
where we have a static buffer for the key.
Introduce snl_attr_copy_string() which can copy a string to a target
buffer and uses the 'arg' parameter to pass the buffer size, so it
doesn't accidentally exceed the available space.

Reviewed by:	melifaro
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D39874
2023-04-30 20:11:54 +02:00
Mateusz Guzik
a50ef47c0a newfs: fix up 32-bit compile
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-04-30 18:00:20 +00:00
Michael Tuexen
1f0e13449b sctp: improve handling of stale cookie error causes
* If a measure of staleness of 0 is reported, use the RTT instead.
* Ensure that we always send a cookie preservative parameter by
  rounding up during the calculation.
* If allowed, perform a round trip time measurement.
* Clear the overall error counter, since the error cause also
  acts like an ACK.

MFC after:	1 week
2023-04-30 11:39:32 +02:00
Kirk McKusick
2e7797cd9b Yet another try to fix printf format conflict.
I find it very annoying that there is no FreeBSD infrastructure to
determine failures across architectures other than to check in
changes and then have Jenkins find them.

Suggested by: Jessica Clarke
MFC after:    1 week
2023-04-30 00:00:23 -07:00
Poul-Henning Kamp
e0e5bf4d62 freebsd-update: Mention 13.2-RELEASE in usage. 2023-04-30 05:06:56 +00:00
Kirk McKusick
6995e6b323 Fix printf format conflict
MFC after:   1 week
2023-04-29 17:55:15 -07:00
Kirk McKusick
62dc21b107 Additional validity checking in newfs(8).
A check in the superblock validity code verifies that the computed
size of the filesystem cylinder groups (CGSIZE macro) does not
exceed the filesystem block size (fs_bsize).

A report was received that a filesystem had been flagged as failing
this check. We were unable to determine how the reported filesystem
could have been created. This commit adds a check at the end of the
newfs(8) command to verify that the the cylinder group size is valid.
If an oversize cylinder group is found newfs(8) prints a diagnostic
output and rebuilds the filesystem to make it compiliant.

MFC after:   1 week
2023-04-29 17:01:18 -07:00
Kirk McKusick
a2d1957bbc Updates to UFS/FFS superblock integrity checks when reading a superblock.
Check for an uninitialed (zero valued) fs_maxbsize and set it
to its minimum valid size (fs_bsize). Uninitialed fs_maxbsize
were left by older versions of makefs(8) and the superblock
integrity checks fail when they are found.

No legitimate superblocks should fail as a result of these changes.

MFC after:    1 week
Sponsored by: The FreeBSD Foundation
2023-04-29 17:01:18 -07:00
Kirk McKusick
04997e19e2 Additional output from dumpfs(8).
Provide an additional line of output for the superblock giving the
computed size of the cylinder group (CGSIZE macro) along with the
details needed to calculate it.

MFC after:   1 week
2023-04-29 17:01:18 -07:00
Kristof Provost
61b95bcb42 wg: change module name to if_wg
Other virtual interface drivers (e.g. if_gif, if_stf, if_ovpn) all start
with if_. The wireguard file is also named if_wg, but the module name
was 'wg'.

Fix this inconsistency.

Reported by:	Christian McDonald <cmcdonald@netgate.com>
Reviewed by:	zlei, kevans
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D39853
2023-04-29 18:30:24 +02:00