Commit Graph

305929 Commits

Author SHA1 Message Date
George V. Neville-Neil e2bedc7d69 Extend the script to collect gprof data
While we're at it, switch to simple waiting from communicate() calls.
2026-01-08 04:14:52 +00:00
Marius Strobl 9b5d6ab1be sdhci_pci(4): Remove incorrect __unused
The slot parameter actually is used as index into the memory resource.

Fixes:	c11bbc7d
2026-01-08 02:20:54 +01:00
Marius Strobl 61002e0371 tty(4): Consistently use ISO C99 bool
Fixes:	9750d9e5
2026-01-08 02:20:54 +01:00
Konstantin Belousov dcb80621bb vm_object.h: tweak OBJ_ONEMAPPING comment even more
The formulation that pages are allowed to have at most one mapping is
not quite clear.  Nothing prevents pages from having more than one
mapping, but the flag must be cleared then.

Reviewed by:	alc, markj
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Differential revision:	https://reviews.freebsd.org/D54570
2026-01-08 01:56:33 +02:00
Jean-Sébastien Pédron 6c0bcd15e4 linuxkpi: Add rol32()
`rol64()` and `rol32()` are used by <linux/siphash.h>. The former was
added previously, before <linux/siphash.h> was added. However the latter
was not, and it broke the build on armv7.

Reported by:	adrian
Reviewed by:	adrian, rpokala
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54588
2026-01-07 23:39:04 +01:00
Jean-Sébastien Pédron 10c6f1f627 linuxkpi: Replicate the chain of #include in the cec*.h headers
The i915 DRM driver depends on this namespace pollution to access
`debugfs_*` functions, after several explicit #include of
<linux/debugfs.h> were removed in Linux 6.10.

Reviewed by:	bz, christos
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54494
2026-01-07 22:38:40 +01:00
Jean-Sébastien Pédron 3942e85b99 linuxkpi: Add WARN_RATELIMIT()
The i915 DRM driver started to use it in Linux 6.10.

Reviewed by:	bz, christos
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54493
2026-01-07 22:38:40 +01:00
Jean-Sébastien Pédron e86e4f161e linuxkpi: Add <linux/kmsg_dump.h>
This header declares register/unregister functions to allow a piece of
code to tell what function to call in case of a panic. Several panic
handlers may be registered.

The DRM generic code started to use it in Linux 6.10 as part of the
panic handler.

Reviewed by:	bz, christos
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54492
2026-01-07 22:38:40 +01:00
Jean-Sébastien Pédron 514d37fa26 linuxkpi: Add <linux/font.h>
The header defines the minimum to allow the DRM generic code to build.
The only function used so far is `get_default_font()`, as part of a
DRM-specific panic handler. We do not use this panic handler on FreeBSD.

For now, it returns a NULL value. It should probably map to a vt(4)
font.

The DRM generic code started to use it in Linux 6.10 as part of the
panic handler.

Reviewed by:	bz, christos
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54491
2026-01-07 22:38:39 +01:00
Jean-Sébastien Pédron ac341353a0 linuxkpi: Define raw_spinlock_t in <linux/spinlock.h>
For now, it is synonymous to `spinlock_t`. The DRM generic code uses the
`struct raw_spinlock` and not `raw_spinlock_t`, that's why the
definition is a struct embedding a `struct mtx`, compared to
`spinlock_t` which is a simpler typedef.

The DRM generic code started to use it in Linux 6.10.

Reviewed by:	bz, christos
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54489
2026-01-07 22:38:36 +01:00
Andrew Gallatin 14d93f612f iflib: Drop tx lock when freeing mbufs using simple_transmit
Freeing completed transmit mbufs can be time consuming (due to them
being cold in cache, and due to ext free routines taking locks),
especially when we batch tx completions. If we do this when holding
the tx ring mutex, this can cause lock contention on the tx ring mutex
when using iflib_simple_transmit.

To resolve this, this patch opportunistically copies completed mbuf
pointers into a new array (ifsd_m_defer) so they can be freed after
dropping the transmit mutex. The ifsd_m_defer array is
opportunistically used, and may be NULL. If its NULL, then we free
mbufs in the old way. The ifsd_m_defer array is atomically nulled
when a thread is using it, and atomically restored when the freeing
thread is done with it. The use of atomics here avoids
acquire/release of the tx lock to restore the array after freeing
mbufs.

Since we're no longer always freeing mbufs inline, peeking into them to see if a
transmit used TSO or not will cause a useless cache miss, as nothing
else in the mbuf is likely to be accessed soon. To avoid that cache
miss, we encode a TSO or not TSO flag in the lower bits of the mbuf
pointer stored in the ifsd_m array. Note that the IFLIB_NO_TSO flag
exists primarily for sanity/debugging.

iflib_completed_tx_reclaim() was refactored to break out
iflib_txq_can_reclaim() and _iflib_completed_tx_reclaim()
so the that the tx routine can call iflib_tx_credits_update()
just once, rather than twice.

Note that deferred mbuf freeing is not enabled by default, and can be
enabled using the dev.$DEV.$UNIT.iflib.tx_defer_mfree sysctl.

Differential Revision: https://reviews.freebsd.org/D54356
Sponsored by: Netflix
Reviewed by: markj, kbowling, ziaee
2026-01-07 14:32:08 -05:00
Kyle Evans e30086ab4c lualoader: fix pruning of non-existent default kernel
Removing the kernel from the list of available kernels is sufficient to
avoid rendering it in the list, but we need more for booting to actually
work.  Notably, the 'kernel' loader.conf var was left intact to its
default value, so if one didn't use the kernel selector in the menu then
we'd try to boot the nonexistent 'kernel' instead of the new default
(first autodetected).

There's room to improve the error messages here, but for now let's just
make it actually work correctly.

PR:		292232
Fixes:	d04415c520 ("loader: lua: remove the default kernel [...]")
2026-01-07 12:20:05 -06:00
Jose Luis Duran 47015e4546 tests: Increase timeout
Bump the timeout value, to avoid cutoff on emulated architectures on
ci.freebsd.org.

Reported by:	Jenkins
Reviewed by:	ngie
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D54550
2026-01-07 17:52:26 +00:00
Jose Luis Duran 301bc149b9 pf: tests: Require python3
Reported by:	Jenkins
Reviewed by:	kp, ngie
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D54549
2026-01-07 17:51:57 +00:00
Roman Bogorodskiy 9fc7fe6427 bhyve: improve console error reporting on arm64
Currently, on arm64, if bhyve fails to initialize the console,
it falls into assert(), which does not look particularly pretty
for users.

Replace the assert with proper error handling so bhyve prints
a meaningful error message and exits with status code 4 (error).
That matches the behavior on amd64.

Approved by:		markj
Reviewed by:		markj
Differential Revision:	https://reviews.freebsd.org/D54504
2026-01-07 18:06:45 +01:00
Alan Somers 3b6615ec03 netstat: fix a segfault with --libxo
Fix a segfault when printing the "protocol" field.  The field-format and
encoding-format were expecting different numbers of arguments.

Also, fix the width of the tcp-state field in encoded output.

PR:		292228
Fixes:		c2b08c13c2 netstat: add support for UDP-Lite endpoints
MFC after:	1 week
Sponsored by:	ConnectWise
Reviewed by:	tuexen, js, des
Differential Revision: https://reviews.freebsd.org/D54567
2026-01-07 07:35:13 -07:00
Baptiste Daroussin d07198ff72 release: stop disabling sendmail
sendmail is already disabled by default everywhere since 14.0

MFC After:	1 week
Approved by:	emaste (re)
Reviewed by:	emaste (re)
Differential Revision:	https://reviews.freebsd.org/D54575
2026-01-07 15:19:43 +01:00
Gonéri Le Bouder cbc00fcc2b nuageinit: only create the default user when needed
The "default" user should only be created when:

- the `users` key is missing
- or the `default` string is present in the `users` list

Since the `public_keys` is extracted from the meta-data, this patch has
to slightly adjust the way they are loaded.
The change simplify the logic around the default user SSH key injection.
Both `ssh_authorized_keys` and `public_keys` are handled at the same time.

MFC After:	1 week
Signed-off-by: Gonéri Le Bouder <goneri@lebouder.net>
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1952
2026-01-07 13:29:58 +01:00
Michael Osipov c2b407244f mrsas.4: Fix devid hex style 2026-01-07 09:04:14 +01:00
Brad Smith 5d73fca1f4 if_rge: sync with up to date OpenBSD code
a0b4d9e5bd63984bc3ad25b7f2881741e0d73980
Add support for RTL8126 chip revision 0x64a00000 from Carl Henriksson.
While here, update and add microcode for the RTL8126 chipset variant.

46810ff569a9416642fc5f8e86501028008a2e95
For RTL8125, there's no need to check whether RGE_CMD_STOPREQ has been
completed.  As with other chip variants, RGE_CMD_STOPREQ never acknowledges
completion.

5729fb17b5eeba56781da0b5c0525c198c5c2cd8
remove duplicate RGE_PHYSTAT_5000MBPS test

Reviewed by:	adrian
Differential Revision:	https://reviews.freebsd.org/D54517
Obtained from:	OpenBSD
2026-01-06 18:27:09 -08:00
Minsoo Choo f441a225c4 stdbool.h: Update for C23
When a compiler with C23 or higher is detected, builtin bool, true,
and false are used to conform the C23 standard.

Reviewed by:	imp
Differential Revision: https://reviews.freebsd.org/D44664
2026-01-06 20:26:59 -05:00
Alexander Ziaee 1961785e35 pxeboot.8: Fix mdoc typo for emails, tag spdx
Fixes:		a37825313f (Fix mdoc typos for emails, tag spdx)
MFC after:	3 days
2026-01-06 17:47:54 -05:00
Andrew Gallatin 83e6f0d780 iflib: document new sysctls
Document the new tx related sysctls I've added to iflib in the
last few months:  tx_reclaim_ticks & tx_reclaim_thresh

Sponsored by: Netflix
Reviewed by: ziaee
Differential Revision: https://reviews.freebsd.org/D54564
MFC after: 3 days
2026-01-06 17:46:12 -05:00
Michael Osipov ccec94bf63 mrsas.4: Add Fujitsu RAID Controller SAS 6Gbit/s 1GB (D3116)
This is an OEM card from Fujitsu using an LSI SAS2208 ROC controller shipped
with many Fujitsu PRIMERGY servers like RX300 S7.

Controller description: https://www.fujitsu.com/global/products/computing/servers/primergy/blades/connection/cb-pmod-110426.html

Reviewed by:	ziaee
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D54566
2026-01-06 22:32:26 +01:00
Mark Johnston 203e5a1eee linker: Reset DMAP protections in link_elf_unload_file()
On x86, when a preloaded kernel module is unloaded, we free the backing
(physically contiguous) pages.  The ET_REL linker will have adjusted
protections on segments of the preloaded file, which updates the direct
map, so the original protections must be restored when unloading the
module.

Previously this was handled in kmem_bootstrap_free(), but there is no
apparent reason not to handle this within the kernel linker.  Moreover,
we were not resetting permissions in the kernel map on arm64.

Reviewed by:	alc, kib
MFC after:	3 weeks
Differential Revision:	https://reviews.freebsd.org/D54438
2026-01-06 20:54:10 +00:00
Michael Osipov 8b210276cd mfi(4): Add subvendor and subdevice for Fujitsu RAID Controller SAS 6Gbit/s 1GB (D3116)
This is an OEM card from Fujitsu using an LSI SAS2208 ROC controller shipped
with many Fujitsu PRIMERGY servers like RX300 S7. This chip is also recognized
by mrsas(4) under the generic name for the controller chip.

Controller description: https://www.fujitsu.com/global/products/computing/servers/primergy/blades/connection/cb-pmod-110426.html

Reviewed by:	ziaee
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D54520
2026-01-06 20:10:46 +01:00
Minsoo Choo 6c6e00b7f1 mips: remove mips leftovers
Signed-off-by: Minsoo Choo <minsoochoo0122@proton.me>
Pull-request: https://github.com/freebsd/freebsd-src/pull/1909
2026-01-06 12:56:50 -05:00
Alexander Ziaee 2962dc7687 sh.1: Restore missing builtin commands
PR:		292221
Fixes:		2980318b27 (sh.1: extend the section about getopts)
MFC after:	3 days
2026-01-06 12:31:32 -05:00
Frank Hilgendorf be6ba97aae loader.efi: add stride & offset for MacBookPro3,1
Note that there are three variants of this MacBook. We only have the
stride and offset values for the 17" 1680x1050 model.

Reviewed by:	vexeduxr
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1584
2026-01-06 18:29:01 +02:00
Alexander Ziaee 75866d71e8 manuals: Correct some sysctl markup
This enables additional searching the manual by sysctl variable.
This syntax is standardized in style.mdoc(5).

Reported by:	bapt
MFC after:	3 days
2026-01-06 11:08:21 -05:00
Alexander Ziaee 03e1605cdf cxgbe.4: Update for recent HARDWARE
Adjust document description, description section, and hardware section
to include Chelsio T7. Since this driver now supports many generations,
order reverse chronologically. Compare language to ice.4 and bnxt.4,
the other terabit ethernet drivers.

This list of HARDWARE is obtained from the Chelsio prouduct selector.

MFC after:		3 days (T7 support shipped with 15.0)
Discussed with:		jhb, np
Differential Revision:	https://reviews.freebsd.org/D54276
2026-01-06 09:52:50 -05:00
Andrew Turner a9e77eb701 arm64: Correctly align the SVE signal context
The SVE signal context needs to be correctly aligned. Fix this by
creating a new macro to calculate the needed size to provide this
alignment, and use it when setting and checking the saved SVE signal
context.

Reported by:	cperciva
Reviewed by:	cperciva, markj
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D54396
2026-01-06 10:36:37 +00:00
Marian Cingel a9f2f92322 arm64: Fix jump to wrong label in case of 0 entries
Broke qemu-system-aarch6 boot with VIRT kernconf

PR:		292156
Fixes:		ea8dc498aa ("arm64: Create an L3 table to limit permissions")
Signed-off-by:	Marian Cingel <cingel.marian@gmail.com>
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1943
2026-01-06 10:36:37 +00:00
Sarah Walker 6748ac4ee7 arm64: Add Arm SPE thread mode support
Add support for the using the Arm Statistical Profiling Extension (SPE) in
the hardware tracing framework, hwt(4), thread mode.

SPE is an optional extension added in Armv8.1 to provide profiling of
software using randomised instruction sampling. Thread mode allows tracing
of a single thread, regardless of the CPU it is scheduled on.

Reviewed by:	andrew
Sponsored by:   Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D53738
2026-01-06 10:36:36 +00:00
George V. Neville-Neil 77153a491e Split counting from sampling. 2026-01-06 08:55:42 +00:00
Baptiste Daroussin 9ea30bbb0e nuageinit(7): pert mandoc linter
MFC After: 	1 week
2026-01-06 09:25:14 +01:00
Gonéri Le Bouder 402f135370 nuageinit/man: clarify how to enable sudo and doas
Clarify that both `sudo` and `doas` are not part of the base system and
they need to be listed in the `packages` section if the user wants to
enable them.

MFC After: 	1 week
Signed-off-by: Gonéri Le Bouder <goneri@lebouder.net>
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1944
2026-01-06 09:25:14 +01:00
Gonéri Le Bouder 7af8b75201 nuageinit: config2_network support dns service cfg
This change enhances `config2_network()` to honor the DNS
configuration, when it's defined through the `services` section.

The `network_data.json` file can hold DNS configuration at two different
places:
- within a network configuration entry
- or `dns` entry in the `services` section, in this case the configuration is global.

An example of such configuration:

{"links": [{"id": "interface0", "type": "phy",
"ethernet_mac_address": "52:54:00:01:59:03"}], "networks": [{"id": "private-ipv4-0", "type": "ipv4", "link": "interface0",
"ip_address": "192.168.123.5", "netmask": "255.255.255.0", "routes": [{"network": "0.0.0.0", "netmask": "0.0.0.0", "gateway":
"192.168.123.1"}], "network_id": "9e5b1ed9-f5e6-4941-a90f-2e06bab858de", "dns_nameservers": ["192.168.123.1"], "services": [{"type":
 "dns", "address": "192.168.123.1"}]}], "services": [{"type": "dns", "address": "192.168.123.1"}]}

See: https://docs.openstack.org/nova/latest/user/metadata.html

MFC After: 	1 week
Signed-off-by: Gonéri Le Bouder <goneri@lebouder.net>
Pull Request: 	https://github.com/freebsd/freebsd-src/pull/1941
2026-01-06 09:25:14 +01:00
George V. Neville-Neil e018fedef0 Correct the data collection arguments. Add proper tempdirs. 2026-01-06 08:18:22 +00:00
Anagh Verma f384784289 kern_syscall_deregister: document syscall 0 no-op logic
Document syscall #0 being handled specially in
`kern_syscall_deregister(..)`: it's a reserved syscall and not
dynamically registered, and hence does not need to be deregistered in
the function.

Co-authored-by:	ngie@
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D54326
2026-01-05 23:48:54 -08:00
Lexi Winter 4028504b48 lib/libbl[ao]cklist: Use LIB_PACKAGE
This avoids e.g. utilities or ssh depending on the full blocklist
package just because they link against libblocklist.

This change moves files between packages so, until we have a proper
policy on how to handle this in release/stable branches, it should
not be MFC'd.

MFC after:	never
Reviewed by:	bapt
Sponsored by:	https://www.patreon.com/bsdivy
Differential Revision:	https://reviews.freebsd.org/D53605
2026-01-06 04:28:43 +00:00
Lexi Winter bde17e7663 libypclnt: Move to yp package
This was previously in runtime, because pam_unix uses it and we don't
want to pull in the entire yp package as a dependency of runtime.

However, we can now use LIB_PACKAGE here to create a yp-lib package
to contain the library, which is a much more reasonable dependency.
Since libypclnt clearly belongs in the yp package, move it there.

This change moves files between packages so, until we have a proper
policy on how to handle this in release/stable branches, it should
not be MFC'd.

MFC after:	never
Reviewed by:	bapt
Sponsored by:	https://www.patreon.com/bsdivy
Differential Revision:	https://reviews.freebsd.org/D53600
2026-01-06 04:26:53 +00:00
Lexi Winter 9c401bf148 zstd: Move to a new zstd package
Zstd is a discrete, self-contained system component.  To match how we
package zlib, bzip2 and xz, move it to its own package, with a separate
lib package.

Add the new package to the minimal set, since this is a core component
that users expect to be installed.

This change adds a new package to the system so, until we have a proper
policy on how to handle this in release/stable branches, it should not
be MFC'd.

MFC after:	never
Reviewed by:	bapt
Sponsored by:	https://www.patreon.com/bsdivy
Differential Revision:	https://reviews.freebsd.org/D53603
2026-01-06 04:24:59 +00:00
Lexi Winter 665ac052aa powerpc: Update CPUTYPE options in make.conf
Document the supported PPC/POWER CPUTYPEs in the example make.conf.

Update bsd.cpu.mk to handle CPUs newer than POWER9, and remove
32-bit CPUTYPEs since we no longer support those at all.

Reviewed by:	imp, jhibbits
Sponsored by:	https://www.patreon.com/bsdivy
Differential Revision:	https://reviews.freebsd.org/D54257
2026-01-06 04:22:20 +00:00
ykla 171f9cbbbf UPDATING: move entry to the correct place
Reviewed by:	vexeduxr
Signed-off-by:	ykla yklaxds@gmail.com
Sponsored by:	Chinese FreeBSD Community
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1917
2026-01-06 04:16:22 +02:00
Ahmad Khalifa 9b2478f60b ng_tty: avoid the sign extention of char
When c is compared to sc->hotchar, both undergo integer promotion, which
can lead to c being sign extended. Fix this by casting c to an unsigned
char.

Reviewed by:	kevans
MFC after:	5 days
Differential Revision:	https://reviews.freebsd.org/D54544
2026-01-06 04:10:11 +02:00
Lexi Winter 0b298e314a Makefile.inc1: Fix INSTALLEXTRAKERNELS for one-kernel case
If BUILDKERNELS contains a single kernel, and NO_INSTALLEXTRAKERNELS=no,
then ${BUILDKERNELS:[2..-1]} returns the first kernel in the list and
that kernel ends up in both INSTALLKERNEL and INSTALLEXTRAKERNELS.

This breaks the package build because it means we generate that package
twice, once with an incorrect install path of /boot/kernel.NAME instead
of /boot/kernel.

Only set INSTALLEXTRAKERNELS if we're building at least two kernels.

Fixes:	2c0e9a76c1 ("Makefile.inc1: Make NO_INSTALLKERNEL less of a hack")
Reviewed by:	jrtc27
Sponsored by:	https://www.patreon.com/bsdivy
Differential Revision:	https://reviews.freebsd.org/D54539
2026-01-06 01:48:04 +00:00
Enji Cooper f224591746 Add ASMC_DEBUG make option
This allows folks to enable debug statements in asmc(4) using kernel
configs via the `options ASMC_DEBUG` directive.

While here, remove a duplicate `device vt_efifb` directive in `NOTES`
as it's already handled in the `GENERIC` config

MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D54511
2026-01-05 17:43:04 -08:00
Jose Luis Duran 12c5148418 makefs.8: Cleanup man page
Reviewed by:	ziaee
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D54538
2026-01-06 00:59:27 +00:00
Konstantin Belousov 55305b5907 x86: change ap_boot_mtx from spinlock mutex to naive lock
Problem is that the printfs done under the spinlock might be very slow,
then spinlock triggers the panic due to some AP holding the mutex too
long.  We do want to ensure that the printfs are serialized, still.

Also, reduce the scope of the lock. The local APIC and MTRR
initializations are local to the AP, while mca_init() protects the
shared state with mca-private spinlock.

PR:	289297
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D54464
2026-01-06 01:12:22 +02:00