Commit Graph

14464 Commits

Author SHA1 Message Date
Olivier Certner 39818654ae mac_do.4: Document executable paths, default jail values and consistency
While here, fix the bug of mentioning 'enable' as a possible value for
the 'mac.do' jail parameter whereas it is 'new' instead.

Reviewed by:    bapt
MFC after:      1 month
Sponsored by:   The FreeBSD Foundation
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/38
2026-05-29 17:40:25 +02:00
Christos Margiolis 8e804f3dd6 sound: Retire unused hw.snd.vpc_mixer_bypass
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Pull Request:	https://ron-dev.freebsd.org/FreeBSD/src/pulls/18
2026-05-27 17:32:11 +02:00
Christos Margiolis 98a62ccab6 pcm.4: Document dev.pcm.%d.eq*
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Pull Request:	https://ron-dev.freebsd.org/FreeBSD/src/pulls/15
2026-05-27 17:27:11 +02:00
Christos Margiolis a0011c74f8 sound: Expose EQ by default
The dev.pcm.%d.eq* sysctls and mixer "bass" and "treble" controls are
exposed only if hint.pcm.%d.eq is set. However, there is no good reason
why we shouldn't at least expose the controls, and let the user
enable/disable/bypass equalization through the sysctl.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Pull Request:	https://ron-dev.freebsd.org/FreeBSD/src/pulls/15
2026-05-27 17:27:11 +02:00
John Baldwin 2893bb741b cpu_thread_new_kstack: Introduce new MD callback
Previously, the cpu_thread_alloc callback was invoked each time a
kernel stack was allocated for a thread.  This included thread
creation, but it was also invoked if a recycled thread had to allocate
a new kstack.  This means that cpu_thread_alloc could be called
multiple times for a single thread, but cpu_thread_free is only called
once.  Not only that, but the cpu_thread_alloc callback can't tell if
it is being invoked on a new thread object, or a recycled thread.
Calling *_alloc multiple times on an object is also atypical for
kernel APIs.

As a result of this confusion, amd64 was potentially leaking an XSAVE
buffer each time a new kstack was allocated for an existing thread,
since cpu_thread_alloc for amd64 always allocated a new XSAVE buffer.
In practice, this edge case is probably rare.  A process object needs
to be recycled where either the new or old process is a kernel process
with a non-default kernel stack size.

Nevertheless, to ease the confusion, redefine cpu_thread_alloc to only
be called once when a new thread is allocated.  The new callback,
cpu_thread_new_kstack is invoked each time a kstack is allocated for a
thread, including both at thread creation time and if a recycled
thread allocates a new kstack.  The new callback should set any fields
whose value is dependent on td_kstack (e.g. the user frame in
td_frame, or td_pcb if the PCB is allocated on the kstack).

Reviewed by:	kib, andrew (arm changes)
Sponsored by:	AFRL, DARPA
Pull Request:	https://ron-dev.freebsd.org/FreeBSD/src/pulls/23
2026-05-27 09:45:22 -04:00
Aymeric Wibo 071d82d997 acpi.4: Update sysctl descriptions with new stype names
Sponsored by:	The FreeBSD Foundation
2026-05-27 09:44:44 +01:00
Alan Somers 14b8531c4c padlock: Restore padlock_rng to the amd64 build
Revert 88a53301e1 and d1ca01059d .  They removed padlock_rng from the
amd64 build under the mistaken belief that this device was available on
32-bit processors only.  But it's also available on the 64-bit Via Nano,
Nano X2, and some Zhaoxin CPUs.

PR:		295517
Fixes:		88a53301e1 ("padlock.4: only install on i386")
Fixes:		d1ca01059d ("padlock(4)/nehemiah: move i386-only entropy")
MFC after:	1 week
Reviewed by:	kib
Differential Revision: https://reviews.freebsd.org/D57215
2026-05-26 15:43:57 -06:00
Mark Johnston 895a0ae67f divert: Define semantics for SO_REUSEPORT_LB on divert sockets
Allow SO_REUSEPORT_LB to be set on divert sockets.  If set, then bind()
will add the socket to a "load-balancing group".  When a divert-to rule
matches a port with an associated group, the corresponding state ID is
used to select a specific socket from the group.  Packets without an
associated state are simply forwarded to the first socket in the group.
For now I only pass a state ID from pf, as I couldn't see a useful
identifier on the ipfw side.

This implementation is simple but has a caveat, that being that if
sockets are added to the group while flows are being processed, the size
of the group will change and this changes the mapping of state IDs to
sockets.  So, to get a consistent mapping, the divert socket application
must bind all of its sockets before any traffic is diverted by the
firewall.

Reviewed by:	glebius
MFC after:	1 month
Sponsored by:	OPNsense
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D56563
2026-05-26 16:04:54 +00:00
Bjoern A. Zeeb 11d69a4558 LinuxKPI: 802.11: add support for suspend/resume
Add support for automatic suspend/resume as we know it for wireless.
The problem is that the PCI driver which would normally gets the code
is the LinuxKPI PCI framework/Linux wireless driver, which we cannot
ammend or generally add extra suspend/resume code to.
A further problem is that with growing support, the LinuxKPI 802.11
(mac80211) layer also is involved in suspend/resume for WoWLAN (not
yet supported) meaning that we need to hook the suspend/resume
framework into that as well.  Unlike Linux we do not have a general
suspend/resume "hook" we can hang into and we need to tie this one
to the hardware so cannot indepedently (after the driver one) run it.

The solution for FreeBSD, in order to not mangle the Linux native
drivers and get extra maintanace overhead, is to add a bus child
which inherits the general framework and thus is 2 lines + #includes
for each driver extra to add to.

The general suspend/resume framework lives in LinuxKPI (linuxkpi_80211_pm)
and imitates the normal suspend/resume path overloading it (there is
a slight code/logic duplication from the PCI code).
Given we are passed the LinuxKPI p(ci)dev, we can go and peel out the
net80211 ic from the native bsddev and that way get access to the
wireless stack.  We then call into LinuxKPI 802.11 in order to do
the suspend/resume dance there, and, if needed also call the
official suspend/resume routine from the device driver after
(reverse for resume).
If any in this fails, suspend will be blocked as we will return the
error (no different to any native driver could do).

The LinuxKPI 802.11 suspend/resume code has the initial code for
doing a WoWLAN suspend (one could change the sysctl) but other bits
like access to ifnet flags etc. has to be sorted out before we can
go and support that.
The default code path calles into net80211 to clear everything
like native wireless drivers do.  The one thing we need to do in
addition is to remove the vif devices from the firmware and restore
them prior to net80211 resume.
We also check for a possible HW SCAN to still be runinng on resume
and warn as that may cause problems though the scan should be stopped
before suspend (we may still get a callback).  You can easily see
these problems if you suspend/resume without stopping the wlan.

Enable the PM framework for iwlwifi in the module Makefile to
be able to use all this; others can follow as tested.

In case anyone has problems with this, they can change the sysctl
back to 0 until we can figure out any further problems.
The linuxkpi_wlan.4 man page got adjusted to document this.

Sponsored by:	The FreeBSD Foundation
Tested on:	Dell XPS 13 (AX200), Lenovo TP X270 (AX210)
MFC after:	3 days
PR:		263632
2026-05-24 01:15:02 +00:00
Michael Osipov f30b1df048 mrsas.4: Use Broadcom/LSI consistently
Reviewed by:	ziaee (via IRC)
MFC after:	immediately
Differential Revision:	https://reviews.freebsd.org/D57211
2026-05-23 22:11:16 +02:00
Martin Cracauer 03c410ba17 man: Stop referring to non-existing manpage strlcpy(9)
Reviewed by: ziaee, mhorne, kevans
2026-05-21 16:08:08 -04:00
Olivier Certner 21df76d01f mac_do.4: Jail parameter takes 'new', not 'enable'; uid_t/gid_t are 32-bit
MFC after:	1 minute
Sponsored by:   The FreeBSD Foundation
2026-05-21 21:18:48 +02:00
Siva Mahadevan 02ef0b6d76 universe: allow moving build logs to UNIVERSE_LOGDIR
This allows `make universe` or `make tinderbox`
to build from a read-only src tree.

Reviewed by:	ziaee, imp, delphij
Approved by:	lwhsu (mentor), emaste (mentor)
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D55566
2026-05-21 10:16:48 -04:00
Pouria Mousavizadeh Tehrani b9a246a917 rtnetlink.4: Add RTA_PRIORITY
Add metric implementation of netlink to manual.

Reviewed by:	markj
Differential Revision: https://reviews.freebsd.org/D56324
2026-05-21 00:25:04 +03:30
Alexander Ziaee 9096a8b1c8 crypto driver manuals: Add crypto to search index
While here, tag spdx and sync the drivers in crypto(4)/SEE ALSO.

MFC after:		2 days (add back hifn)
Differential Revision:	https://reviews.freebsd.org/D57060
2026-05-20 09:25:54 -04:00
Mateusz Piotrowski d04da19acb d.7: Document no support for ddi_pathnam(), getmajor(), and getminor()
MFC after:	3 days
2026-05-20 14:36:40 +02:00
John Baldwin ffcf5e3566 pci: Add is_pci_device helper function
This returns true if a given device is a PCI device (child of a PCI
bus).

Reviewed by:	bz, kib
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D56996
2026-05-18 14:50:39 -04:00
Dag-Erling Smørgrav 2af70d7a38 tcp: Make RFC 6191 support configurable
Add a default-on per-VIMAGE sysctl for RFC 6191 connection recycling.
This makes it possible to merge the change to older branches where it
can be switched off by default to minimize risk.

MFC after:	1 week
Sponsored by:	Klara, Inc.
Sponsored by:	Modirum MDPay
Reviewed by:	pouria, marius.h_lden.org, tuexen
Differential Revision:	https://reviews.freebsd.org/D57045
2026-05-18 16:50:14 +02:00
Mateusz Piotrowski 30f500e97b p9fs.4: MLINK to virtio_p9fs.4
Technically, virtio_p9fs is an emulated device that masquerades
as a p9fs mount, but it does not make sense to have two separate manual
pages.

Reviewed by:	bnovkov, dfr
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D57013
2026-05-18 11:12:12 +02:00
Konstantin Belousov 56bc43f5d0 locking.9: warn about using sleepable lock address as a sleep channel
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Differential revision:	https://reviews.freebsd.org/D57012
2026-05-17 22:55:23 +03:00
Bjoern A. Zeeb 0a2f7683bf man: iwlwifi/rtw88/rtw89: update man pages for Linux v7.0 based updates
For all:
- harmonize Copyright/license section according to style.9 and used
  SPDX only.
- mention that the current generation of the driver is based on
  Linux version 7.0.
- make linuxkpi.4 and linuxkpi_wlan.4 .Xr as the man pages do exist
  these days.

iwlwifi: update the card/chipset names supported (while we still can)
iwlwififw: leave a comment only that we can no longer update the
  man page and it will be removed in the future.
rtw88: update supported chipsets and add note to BUGS sections
rtw89: update supported chipsets and add note to BUGS sections

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Reviewed by:	ziaee
Differential Revision: https://reviews.freebsd.org/D57019
2026-05-15 18:38:52 +00:00
Christos Margiolis 9354e204f5 sound: Force-disable hw.snd.compat_linux_mmap by default
Eventually this hack will be removed, so start by disabling it by
default.

Sponsored by:	The FreeBSD Foundation
MFC after:	12 months
Reviewed by:	emaste
Pull Request:	https://ron-dev.freebsd.org/FreeBSD/src/pulls/29
2026-05-15 17:08:11 +02:00
Christos Margiolis b9c10eeb38 sound: Improve hw.snd.compat_linux_mmap
- Reject PROT_EXEC in all cases when Linux support is not compiled in.
- Define sysctl only when Linux support is compiled in.
- Document better.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Reviewed by:	emaste
Pull Request:	https://ron-dev.freebsd.org/FreeBSD/src/pulls/29
2026-05-15 17:08:11 +02:00
Alexander Ziaee bcd50fe5c3 style.mdoc: Explain why not to abuse Nm
MFC after:		3 days
Reviewed by:		0mp
Differential Revision:	https://reviews.freebsd.org/D55299
2026-05-15 08:50:42 -04:00
Mateusz Piotrowski ae0fd05a33 p9fs.4: Cross-reference mount(8)
MFC after:	3 days
2026-05-15 12:13:20 +02:00
Mateusz Piotrowski 03bc95b060 dtrace_dtmalloc.4: Document the DTrace dtmalloc provider
MFC after:	1 week
Discussed with:	christos, markj, ziaee
Differential Revision:	https://reviews.freebsd.org/D51396
2026-05-12 20:03:11 +02:00
Raphael 'kena' Poss e26b5e0749 spkr.4: Reflect latest changes and add history
- speaker(4) was recently modernized to lock the driver per-playback
  instead of per-open. Update the man page to explain this change.

- added a reference to MML and SMX in the historical context to make
  it easier for users to find additional documentation online.

Signed-off-by:	Raphael Poss <knz@thaumogen.net>
Reviewed by:	ziaee
Closes:		https://github.com/freebsd/freebsd-src/pull/2183
2026-05-11 23:14:16 -04:00
Kyle Evans 92f623e4a9 rge: add the Intel Killer E5000 PCI ID
This and the E3000 are both handled by the r8169 driver in Linux, and
reportedly this is infact just a straight re-brand of the RTL8126.

Tested by:	"Sinetek" on Discord
Reviewed by:	adrian
Differential Revision:	https://reviews.freebsd.org/D56917
2026-05-11 10:26:03 -05:00
Mateusz Piotrowski 076e448391 uio.9: Document uiomove_fromphys()
Reviewed by:	kib
Discussed with:	markj, royger
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D54070
2026-05-08 11:05:57 +02:00
John Hall e9912b7e88 smartpqi.4: Document runtime debug_level sysctl
Update smartpqi(4) to document the dev.smartpqi.<unit>.debug_level
sysctl for runtime debug level changes, and note that device
add/remove and controller event messages always appear in dmesg
regardless of the debug_level setting.

PR:		294161
Reviewed by:	imp
Approved by:	imp
MFC after:	2 weeks

Differential Revision:	https://reviews.freebsd.org/D56832
2026-05-07 11:08:27 -07:00
Mateusz Piotrowski 2b9301a22b d.7: Document macro variables
MFC after:	1 week
2026-05-07 16:20:46 +02:00
Mateusz Piotrowski 640af0d906 cam: Cross-reference dtrace_cam.4 and cam.4
While here, remove empty sections from cam.4.

MFC after:	3 days
Fixes:		1a7151f796 cam: Add probes for xpt actions
2026-05-07 15:13:47 +02:00
Mateusz Piotrowski ef19cae253 dtrace_mib.4: Document the DTrace MIB provider
Reviewed by:	kp
MFC after:	1 week
Obtained from:	60d8dbbef0 netinet: add a probe point for IP, IP6, ICMP, ICMP6, UDP and TCP stats counters
Differential Revision:	https://reviews.freebsd.org/D53709
2026-05-07 13:53:50 +02:00
Mateusz Piotrowski 242050278a dtrace: Document the syscall provider
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D56831
2026-05-07 11:57:03 +02:00
Maxim Konovalov 09d81767e3 freebsd-base.7: style 2026-05-07 01:50:45 +00:00
Alexander Ziaee c4af3f13a4 freebsd-base.7: Document adding a local repo
MFC after:		1 day
Discussed with:		bcr, ivy, kevans, ngie
Differential Revision:	https://reviews.freebsd.org/D56608
2026-05-06 17:25:26 -04:00
Hans Rosenfeld 84a9574180 sys/cdefs.h: Introduce __maybe_unused attribute
The __maybe_unused attribute should be used for variables which may or
may not be used, such as when their only use is in an assertion. This
attribute is functionally identical to __unused, suppressing compiler
warnings for particular variable if it remains unused.

Reviewed by:	Minsoo Choo <minsoo@minsoo.io>, imp
Differential Revision:	https://reviews.freebsd.org/D56517
2026-05-06 15:51:46 -04:00
Mateusz Piotrowski c295f02637 zone.9: Add a missing newline
MFC after:	3 days
2026-05-04 20:29:48 +02:00
Abdelkader Boudih 36b399f55e asmc: rename wol sysctl to auto_poweron
Older SMC firmware exposed AUPO as a Wake-on-LAN control. On updated
firmware, the key controls automatic power-on when AC power is restored
after a power loss; WoL is handled by the GBE controller instead.
Rename the sysctl to reflect the current semantics. No compatibility
alias is provided as the sysctl has not appeared in any release.

Reviewed by:	ziaee, adrian
Differential Revision:	https://reviews.freebsd.org/D56747
2026-05-04 07:26:44 -07:00
Alexander Ziaee dd97c3d83f ocs_fc.4: Cleanup
+ more consistent document description
+ enumerate available options in synopsis in vt.4 style
+ tag spdx
+ tweak list rendering
+ cleanup HARDWARE
+ reflow excessively long lines silencing linter warnings
+ fix link macros

MFC after:		3 days
Reported by:		michaelo (hardware notes)
Differential Revision:	https://reviews.freebsd.org/D56753
2026-05-03 14:29:43 -04:00
Alexander Ziaee 28deec9b7e ports.7/FILES: Expand and refactor into 3 tables
Add make.conf, CHANGES, CONTRIBUTING.Md, UPDATING, and Tools/scripts.
Refactor the FILES section of the ports reference manual into a bigger
table with three sections separated by root directory. Remove preceeding
article from all but "the big Kahuna", and root dirs where reasonable.

MFC after:              3 days
Relnotes:		yes
Reported by:            adamw, arrowd, linimon
Differential Revision:	https://reviews.freebsd.org/D55441
2026-05-03 13:29:06 -04:00
Artem Bunichev 0ed292531e debug.sh.8: Add FILES section
Which contains only the source code file.

While here, remove trailing empty lines in the end of the page.

Reviewed by:	mhorne
Differential Revision:	https://reviews.freebsd.org/D56659
2026-04-30 10:49:52 -03:00
Mitchell Horne 16dd592982 ddb.4: add 'show preload' entry
For the recently added command.

Fixes:	b683fd0b32 ("preload: add "show preload" DDB command")
2026-04-30 10:24:04 -03:00
Jean-Sébastien Pédron eebb643bb3 sx: Add sx_has_waiters() macro
This macro will return non-zero if there are threads waiting for this
lock; otherwise, it will return zero.

The function assumes (but does not assert) that the caller already holds
the lock and that it is interested in other threads waiting for it to
release the lock.

The motivation to add this is the implementation of
`rwsem_is_contended()` in linuxkpi.

This Linux function indicates the same thing to the caller: if other
threads are waiting for this semaphore.

The amdgpu DRM driver started to use `rwsem_is_contended()` in Linux
6.12.

Reviewed by:	bz, olce
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56443
2026-04-30 13:40:05 +02:00
Maxim Konovalov d5db883af2 group.7: spell priority 2026-04-28 17:44:40 +00:00
Alexander Ziaee ab98fd3234 build.7: Explain update-packages repo signing
MFC after:		3 days
Reported by:		kevans
Reviewed by:		kevans, ngie
Differential Revision:	https://reviews.freebsd.org/D56607
2026-04-28 12:56:45 -04:00
Alexander Ziaee 0f91468c04 intro.7: Reference groups.7
PR:		264966
MFC after:	3 days
2026-04-28 09:56:49 -04:00
Artem Bunichev e09104dfb7 groups.7: New manual page of standard group names
Import groups(7) from NetBSD, with tweaks for our system. The group
list is sorted by GID. All the group names from /usr/src/etc/group
are described, except "uucp". The FILES section was added on top of
the original manual page.

PR:			264966
Relnotes:		yes
MFC after:		3 days
Obtained from:		NetBSD
Reviewed by:		des, ziaee
Differential Revision:	https://reviews.freebsd.org/D54114
2026-04-28 09:53:39 -04:00
Timo Völker 1bfd392b9e vtnet: remove loader tunable fixup_needs_csum
Removes the deprecated loader tunable fixup_needs_csum. Removes also
the sysctl counter rx_csum_bad_offset that is no longer in use.

Reviewed by:		tuexen
Event:			Wiesbaden Hackathon 2026
Differential Revision:	https://reviews.freebsd.org/D55588
2026-04-26 11:42:38 +02:00
Enji Cooper af864dd4a2 hosts.equiv.5: correct nits to fix mandoc -T lint issues
- Rename `.Nm .rhosts` to `.Nm rhosts` to match the MLINK for the
  manpage.
- Use `.Pa` instead of `.Nm` when discussing the paths for `.rhosts` and
  `hosts.equiv.5` for explicitness and clarity.

Bump .Dd for the change.

MFC after:	1 week
2026-04-24 13:45:14 -07:00