Commit Graph

306506 Commits

Author SHA1 Message Date
Michael Tuexen 33596d9255 dpaa2: add support for several interface counters
Add support for IFCOUNTER_IPACKETS, IFCOUNTER_OPACKETS,
IFCOUNTER_OBYTES, IFCOUNTER_OMCASTS, IFCOUNTER_OERRORS, and
IFCOUNTER_OQDROPS.
This allows tools like systat to report the incoming and outgoing
bandwidth.

Reviewed by:		dsl, Timo Völker
MFC after:		1 week
Differential Revision:	https://reviews.freebsd.org/D54893
2026-01-30 10:58:57 +01:00
Adrian Chadd 03e4cc9fde powerpc: explicitly cast the timebase printfs
This is causing compilation issues on powerpc:powerpc GENERIC.
2026-01-29 22:36:33 -08:00
Maxim Konovalov c443f5d1c2 intro.9: grammar 2026-01-30 04:51:24 +00:00
Maxim Konovalov 7f537f4ba8 intro.9: deduplicate vm_page Xrs
PR:		292820
Submitted by:	Kraytonian
MFC after:	1 week
2026-01-30 04:48:56 +00:00
Jose Luis Duran f54f362d62 nanobsd: embedded: Stub out experimental functions
Stub out both experimental functions introduced in ecc039be7f when
doing embedded builds.

Fixes:		ecc039be7f ("nanobsd: Add a NO_ROOT build option")
MFC after:	3 days
2026-01-30 01:42:00 +00:00
Jessica Clarke ba56760a47 Revert "src.opts.mk: Enable LLDB by default globally"
This breaks the riscv64 build; clearly the version we have in-tree is
not new enough to work. That or our build system needs tweaking. Either
way, we're not ready for this, and enabling it without testing was
misguided.

This reverts commit c59a47dc6c.
2026-01-30 01:11:13 +00:00
Abdelkader Boudih fdcd67be82 firmware: Fix inverted FIRMWARE_GET_NOWARN logic
The try_binary_file() function has inverted logic for the
FIRMWARE_GET_NOWARN flag.  When the flag is set (meaning "don't warn"),
the code sets warn=true and makes noise anyway.

Invert the assignment to warn to correctly suppress warnings when
FIRMWARE_GET_NOWARN is set.

Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D54955
2026-01-29 18:02:47 -06:00
Konstantin Belousov b249cb2b18 SCHED_4BSD: maybe_resched() cannot schedule ast() for curthread
maybe_resched() needs to schedule TDA_SCHED for curthread, but this
requires taking curthread lock while owning some other thread lock.
To avoid introducing the order:
- Use a scheduler-private TDP flag.
- Register an unconditional TDA_SCHED_PRIV for 4BSD.
When an AST needs to be scheduled, i.e. the current thread must do
context switch in the return to userspace path, set the flag.
Then the ast handler calls ast_scheduler(), which gives the same
effect as scheduling TDA_AST.

The overhead is a single function call on each userspace return, for
4BSD case.

Reported and tested by:	pho (previous version)
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D54945
2026-01-30 01:26:16 +02:00
Konstantin Belousov 0730a05cd3 tuning.7: document schedulers knobs
Reviewed by:	emaste, olce, ziaee
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D54951
2026-01-30 00:43:45 +02:00
Bjoern A. Zeeb 4b32fdb4a6 lindebugfs: check that name is set as otherwise pfs_alloc_node_flags() panics
I have hit the case multiple times that some LinuxKPI field may not be
set during driver bringup and lindebugfs would cause a panic.
The backtrace goes like:

  strlen() at strlen+0x54
  pfs_create_dir() at pfs_create_dir+0x41
  debugfs_create_dir() at debugfs_create_dir+0xa1
  ...

While the problem is clearly in LinuxKPI or the driver, we likely
should at least add an assert to pfs_create_dir() if name is NULL
like we have for pfs_add_node() but for lindebugfs at least make
this a graceful error and continue without creating the dir instead
of panicing.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Reviewed by:	kevans
Differential Revision: https://reviews.freebsd.org/D54944
2026-01-29 19:35:23 +00:00
Konstantin Belousov 783b8a0fd8 kern/sched: deduplicate dtrace hook vars
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D54831
2026-01-29 20:11:56 +02:00
Konstantin Belousov 9409e86980 kern/sched: deduplicate sdt probes
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D54831
2026-01-29 20:11:56 +02:00
Konstantin Belousov a84a39dfe5 kern/sched: move duplicate preemption stat vars into sched_shim.c
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D54831
2026-01-29 20:11:56 +02:00
Konstantin Belousov 1322760fd1 sys: enable both SCHED_ULE and SCHED_4BSD for some configs
Globally enable both schedulers for LINT.
Enable both schedulers for GENERIC on amd64.

Reviewed by:	olce
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D54831
2026-01-29 20:11:56 +02:00
Konstantin Belousov ff870b783f sched_shim: restore kern.ccpu sysctl
It is apparently should be considered part of the ABI, and is used by
the base top(1).  But do not declare the ccpu variable in headers, it is
needed only by 4bsd. So put the variable definition into sched_shim.c to
make the kernel buildable without SCHED_4BSD.

Reviewed by:	olce
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D54831
2026-01-29 20:11:56 +02:00
Konstantin Belousov 5a6e0e31bc sysctl kern.sched.ule.topology_spec: allow to run if ULE is not initialized
Reviewed by:	olce
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D54831
2026-01-29 20:11:56 +02:00
Konstantin Belousov b602ba1b5f net/iflib.c: move out scheduler-depended code into the hook
Add sched_find_l2_neighbor().  This really should be not
scheduler-depended, in does not have anything to do with scheduler at
all.  But for now keep the same code structure.

Reviewed by:	olce
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D54831
2026-01-29 20:11:56 +02:00
Konstantin Belousov 1c4e16f6db x86/cpu_machdep.c: unconditionally fence
For !SCHED_ULE, even if the fence is not needed, it is harmless.

Reviewed by:	olce
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D54831
2026-01-29 20:11:56 +02:00
Konstantin Belousov c384b35e42 x86/local_apic.c: remove direct SCHED_ULE use
Move the code to decide on the timer accounting into the scheduler hook.
Since there were no inclusion of opt_sched.h, it is probably done
unconditionally anyway.

Reviewed by:	olce
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D54831
2026-01-29 20:11:56 +02:00
Konstantin Belousov 377c053a43 cpu_switch(): unconditionally wait on the blocked mutex transient
It is nop for 4BSD.

Reviewed by:	olce
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D54831
2026-01-29 20:11:56 +02:00
Konstantin Belousov ba8f429f42 kern/sched_shim.c: Add sysctl kern.sched.available
Reports all compiled-in schedulers.

Reviewed by:	olce
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D54831
2026-01-29 20:11:55 +02:00
Konstantin Belousov 8aa8289d99 sys: Move 4BSD sysctls under kern.sched.4bsd
Reviewed by:	olce
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D54831
2026-01-29 20:11:55 +02:00
Konstantin Belousov b125c4d130 sys: Make sched_4bsd a sched instance
Reviewed by:	olce
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D54831
2026-01-29 20:11:55 +02:00
Konstantin Belousov eb454937a3 sys: Move ULE sysctls under kern.sched.ule
Reviewed by:	olce
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D54831
2026-01-29 20:11:55 +02:00
Konstantin Belousov d14e018024 sys: Make sched_ule a sched instance
Reviewed by:	olce
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D54831
2026-01-29 20:11:55 +02:00
Konstantin Belousov 7efbfd6ff6 kern/sched_shim.c: provide required SYSINIT hooks
Reviewed by:	olce
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D54831
2026-01-29 20:11:55 +02:00
Konstantin Belousov bab24f22ba kern/sched_shim.c: Provide a scheduler selection machinery
Reviewed by:	olce
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D54831
2026-01-29 20:11:55 +02:00
Konstantin Belousov ce38acee8d Add kern/sched_shim.c
This is the infrastructure to allow scheduler implementation to be
selected on boot, supported by ifuncs.

The DEFINE_SHIM() macros and their usage provided by jrtc27@.

Reviewed by:	olce
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D54831
2026-01-29 20:11:55 +02:00
Konstantin Belousov 0b474a48dc sys/sched.h: add SCHED_STAT_DECLARE()
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D54831
2026-01-29 20:11:55 +02:00
Konstantin Belousov a556ec46d3 kern/sched_{ule,4bsd}.c: cleanup headers
Reviewed by:	olce
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D54831
2026-01-29 20:11:55 +02:00
Konstantin Belousov 610d7062c6 sched_4bsd: remove unused function sched_pctcpu_delta()
It is not used since c72188d85a.

Noted by:	jrtc27
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D54831
2026-01-29 20:11:55 +02:00
Konstantin Belousov 8515934ce3 sys/sched.h: make sched_clear_tdname() function prototypes unconditional
There is no harm in having unused prototypes.

Reviewed by:	olce
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D54831
2026-01-29 20:11:54 +02:00
Konstantin Belousov 57bb132e98 maybe_preempt(): make static in sched_4bsd.c
Reviewed by:	olce
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D54831
2026-01-29 20:11:54 +02:00
Konstantin Belousov 23266bc992 amd64/machdep.c: remove extra empty line
Reviewed by:	olce
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D54831
2026-01-29 20:11:54 +02:00
Konstantin Belousov 03d61fe978 arm, riscv: add a preprocessor symbol indicating missed support of ifunc
in kernel.

Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D54831
2026-01-29 20:11:54 +02:00
Bjoern A. Zeeb 5cfe09e3a4 LinuxKPI: 802.11: only announce netdev_features if any are set
Printing an empty netdev_features= line makes little sense even under
bootverbose.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2026-01-29 18:07:43 +00:00
Bjoern A. Zeeb 0762cf10fc usb: indentation (whitespace change only)
No functional change.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2026-01-29 18:07:43 +00:00
Artem Bunichev eb0fc67c45 src.conf.5: Cross-reference uname(1) manual page
Reviewed by:		emaste, ziaee
Differential Revision:	https://reviews.freebsd.org/D54688
2026-01-29 12:44:46 -05:00
Artem Bunichev 2711852bd9 sh.1: Provide detailed job control documentation
Adopt the POSIX standard text to our implementation.

PR:			206284
Reviewed by:		des, jilles, ziaee
Differential Revision:	https://reviews.freebsd.org/D49895
2026-01-29 12:08:47 -05:00
Ed Maste 54e006369c release: Remove not-NO_ROOT cases
We always use NO_ROOT for release artifact builds, so remove the
alternate code paths.

For the first step we set NO_ROOT unconditionally in cases that invoke
submakes, and turn NO_ROOT being unset into an error in lover-level
targets so that we can catch potential out-of-tree build scripts (or
missed in-tree cases) that expect to run not-NO_ROOT builds.  The second
step will be to remove those entirely.

Reviewed by:	cperciva
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54179
2026-01-29 12:03:20 -05:00
Aymeric Wibo 5a73302608 touch: Test for -m flag
Reviewed by:	kevans
Approved by:	kevans
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D54853
2026-01-29 16:51:17 +01:00
Aymeric Wibo 578b4ec8f1 touch: Test for -a flag
Reviewed by:	kevans
Approved by:	kevans
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D54852
2026-01-29 16:50:26 +01:00
Aymeric Wibo 21efed6cd8 touch: Tests for -h flag
Reviewed by:	kevans
Approved by:	kevans
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D54836
2026-01-29 16:49:28 +01:00
Ed Maste 627e126dbb netinet6: Disallow connections to IN6ADDR_ANY
Previously connect() or sendto() to INADDR_ANY or IN6ADDR_ANY reached
some socket bound to some host interface address.  Although this was
intentional it was an artifact of a different era, and is not desirable
now.

In 417b35a97b markj added support to disallow connect() to INADDR_ANY
and IN6ADDR_ANY.  Connections to INADDR_ANY were disabled by default in
cd240957d7.  Follow suit with IN6ADDR_ANY.

Reviewed by:	glebius, markj, zlei
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54306
2026-01-29 09:08:45 -05:00
Baptiste Daroussin 90a7728cd8 nuageinit: support fetching configuration on multiple iface
On some environement a VM can be connected to multiple ifaces but only
one will respond to dhcp and able to fetch the metadata.

Launch the early dhclient on all available ifaces and as soon as one
dhcp has successfully configured an iface, proceed with fetching the
metadata.

MFC After:	1 week
Reported by:	mateusz.klejn@ovhcloud.com
Tested by:	mateusz.klejn@ovhcloud.com
Sponsored by:	OVHcloud
2026-01-29 11:03:06 +01:00
Michael Osipov 56970c3c4b loader: Prefer comma-separated list of values for "console"
PR:		292595
Reviewed by:	imp
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D54923
2026-01-29 09:44:45 +01:00
Eric A. Borisch 1b2d495a24 Set virtual_oss_enable="NO" in /etc/defaults/rc.conf
This prevents 'service -e' from emitting (/var/log/messages):

/usr/sbin/service: WARNING: $virtual_oss_enable is not set properly - see rc.conf(5)

Pull Request:	https://github.com/freebsd/freebsd-src/pull/1987
Reviewed by:	christos
Signed-off-by:	eborisch@gmail.com
MFC after:	1 week
2026-01-29 09:33:59 +02:00
Enji Cooper 3926ae98ad gtest.cc: declare fail_if_no_test_linked flag
Clang's -Wmissing-variable-declarations flags this as an issue since the
flag is only used in `gtest.cc`. Declare the flag beforehand to ensure
that the variable scope is properly limited to `gtest.cc`.

MFC after:	1 week
MFC with:	46333229c6
Ref:		https://github.com/google/googletest/pull/4898
2026-01-28 17:25:26 -08:00
Enji Cooper 46333229c6 GoogleTest: import 1.17.0
The changes between the two versions can be found in this diff of the
two release tags:
https://github.com/google/googletest/compare/v1.15.2...v1.17.0

One notable change is that GoogleTest 1.17.0 now requires C++-17 to
build.

MFC after:	1 week
Merge commit '3a4c29b5bed4ea20266ad9371fbfdc6bca088f92'
2026-01-28 17:24:01 -08:00
Ed Maste c59a47dc6c src.opts.mk: Enable LLDB by default globally
Previously it was enabled for all architectures except but RISC-V.
Upstream made significant progress on RISC-V support over the last
year[1], and although there's still some FreeBSD-specific work to do we
can start building it now.

[1] https://jonasdevlieghere.com/post/lldb-2025/

Sponsored by:	The FreeBSD Foundation
2026-01-28 18:13:52 -05:00