Commit Graph

24117 Commits

Author SHA1 Message Date
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
Stephen J. Kiernan b89155be25 bsd.endian.mk: Avoid use of M_ListToSkip
While the src build works fine with M_ListToSkip, it can break the
ports build. For now, it is safer just to do the actual variable
modifiers in place.

Reported by:	se
Fixes: 		01674e15de ("bsd.endian.mk: Optimize the handling...")
2026-05-03 15:39:50 -04: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
Stephen J. Kiernan 01674e15de bsd.endian.mk: Optimize the handling of big/little endian determination.
Add variables to contain lists of MACHINE_ARCH values to use
to determine little or big endian.

Only error out about not being able to determine endianess if
TARGET_ENDIANNESS is empty and not cross-compiling.

Reviewed by:	sjg
Obtained from:	Hewlett Packard Enterprise Development LP
Differential Revision:	https://reviews.freebsd.org/D44629
2026-05-02 22:21:56 -04:00
Kyle Evans 8583bcb5b4 Revert "build: provide a FORTIFY_SOURCE.<src file> override"
This reverts commit c46a0b5907.  It broke
the build and I'm not awake yet.
2026-05-01 07:19:17 -05:00
Kyle Evans c46a0b5907 build: provide a FORTIFY_SOURCE.<src file> override
For native files we can do more minimal fixes to avoid this large of a
hammer, but for third party files it may not be worth the effort to try
and patch them.  NetBSD has the original _FORTIFY_SOURCE implementation
that ours is based on, for instance, but tests sourced from there can't
do an __ssp_real(foo) without being certain that `foo` actually has a
fortified definition.

This change does always define _FORTIFY_SOURCE as a result, so gate it
on CFLAGS not already containing _FORTIFY_SOURCE definitions.

PR:		294881
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D56733
2026-04-30 21:58:48 -05: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
Enji Cooper 573a9e5764 security(7): fix mandoc -T lint complaints
- Add `.Nm` section for securelevel(7) to match corresponding MLINKS entry.
- Fix the spelling for mac(4) (the actual subsystem manpage is spelled out in
  lowercase.

MFC after:	1 week
2026-04-24 13:45:14 -07:00
Warner Losh 334adacbc1 cam: Document kern.cam.max_high_power.
Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D56463
2026-04-24 12:32:42 -06:00
Ali Mashtizadeh 70ae0c4524 i386: Remove perfmon performance monitoring facility
Remove the perfmon performance monitoring facility that was for Intel
Pentium and Pentium Pro processors.

Reviewed by: imp,mhorne,emaste
Pull Request: https://github.com/freebsd/freebsd-src/pull/2155
2026-04-24 10:23:05 -06:00
Lexi Winter bb75b0d581 packages: Convert world to a subdir build
Instead of driving the world package build from Makefile.inc1,
use a subdir build where each package has a subdirectory under
packages/ using the new <bsd.pkg.mk>.

Convert some metadata that was previously in the UCL files (e.g.
sets and dependencies) to Makefile variables.

Build the packages under objdir (not repodir), and use the new
stagepackages target to copy them to repodir when creating the
repository.

Determine an explicit list of packages to build in packages/Makefile
based on enabled src.conf options, and add logic to abort the build
if we attempt to build an empty package.  This inverts the previous
logic in Makefile.inc1 which would simply skip empty packages.

There are a few advantages to doing it this way:

* The package build works more like the rest of the build system,
  so it's more accessible to developers.

* We can customise the packages we build based on src.conf options,
  e.g. skipping a package entirely, or adjusting its dependencies
  based on what it actually requires.

* We have a specific list of packages that we want to build, and an
  unexpectedly missing package results in a build error, instead of
  silently producing a broken repository.

* It's possible to build (and in the future, install) an individual
  package without having to rebuild the entire repository.

This doesn't apply to the dtb, kernel-* or src-* packages; those
have their own build systems in Makefile.inc1 and will be converted
later.

MFC after:	4 weeks (stable/15 only)
Reviewed by:	jlduran, sjg, brooks
Sponsored by:	https://www.patreon.com/bsdivy
Differential Revision:	https://reviews.freebsd.org/D56087
2026-04-24 15:10:01 +01:00
Kyle Evans b675ff8eed mac_seeotheruids: allow specificgid to be a list of groups
The specificgid functionality has historically allowed only a single
group to be exempt, but in practice one might want a few services to
be exempt for reasons.  From a security perspective, we probably don't
want to encourage unrelated users to be grouped together solely for
this purpose, as that creates one point of shared access that could be
used for nefarious purposes.

Normalize the group list as we do cr_groups to allow for linear matching
rather than quadratic, we just need to account for the differences in
FreeBSD 15.0+ where cr_groups is entirely supplementary groups vs.
earlier versions, where cr_groups[0] is the egid and the rest is
sorted.

Reviewed by:	csjp, des (earlier version)
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D56592
2026-04-23 16:13:11 -05:00
R. Christian McDonald 4578c15ab9 pf: Document broadcast/multicast forwarding through route-to
pf_route() and pf_route6() forward broadcast and multicast traffic
when a route-to rule matches, without any check against the output
interface's broadcast domain. This is a deliberate property of the
route option code path, but it is not documented and the workaround
is non-obvious.

Document the behavior in pf.conf(5) with example block-out rules on
the target interface, scoped with the received-on qualifier so that
only forwarded traffic is dropped while the router's own broadcast
and multicast traffic continues to pass.

Add regression tests covering the full broadcast/multicast and
forwarded/local matrix on both IPv4 and IPv6.

Reviewed by:	glebius, kp
Approved by:	kp (mentor)
MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D56559
2026-04-23 15:23:59 -04:00
~Not Toby c0e26f7b29 hkbd/ukbd: sysctls to swap macbook kbd modifiers
Many applications, desktop environments, window managers & text editors
favor the usage of Alt or Ctrl over Super (Cmd). On a Macbook it is
quite annoying that the Super (Cmd) key gets pride of place by the spacebar.

The standard MacBook Cmd key location only really makes sense for macOS
or maybe in some tiling wm if Mod4/Super is your main modifier.
For most mainstream desktops and window managers, having Alt or Ctrl
in that location makes much much more sense.

This patch adds two sysctls for swapping either Opt(Alt) or Ctrl with Cmd(Super).

Linux has similar sysctls to this; allowing a user to make an Apple
keyboard more "orthodox"/useful at a level that takes effect independent
of typing context - ie) tty, Xorg and/or wayland.

Having a sysctl to do these swaps means that a user doesn't have to faff
about with both creating a custom vt keymap AND figure out which magic
setxkbmap incantation one needs to make one's keyboard behave as desired
across environments.

Signed-off-by: ~Not Toby <0x2b@0xff.art>

Reviewed by:	wulf
MFC after:	1 week
Pull Request:	https://github.com/freebsd/freebsd-src/pull/2141
2026-04-23 08:10:05 +03:00
Alexander Ziaee 886610c100 freebsd-base.7: Add a caveat about dev branches
MFC after:		3 days (to 15)
Discussed with:		bapt, emaste, ivy
Differential Revision:	https://reviews.freebsd.org/D56389
2026-04-22 13:59:26 -04:00
Alexander Ziaee b183dae4a9 build.7: Explain specifying multiple KERNCONFs
MFC after:		3 days
Reviewed by:		ivy, mhorne
Differential Revision:	https://reviews.freebsd.org/D56281
2026-04-22 13:31:04 -04:00
Alexander Ziaee 1bcd2e2f83 build.7: Explain packaging a custom kernel
MFC after:		3 days (to 15 only)
Requested by:		vermaden
Discussed with:		emaste, ivy, Mark Millard <markmi_dsl-only.net>
Differential Revision:	https://reviews.freebsd.org/D56217
2026-04-22 13:26:46 -04:00
Alexander Ziaee 1d69c8e4ac build.7: Improve make delete-old example
Be more explicit that deleting old files and libraries needs to be
really after you're rebooted a third time and you're really actually
sure your applications aren't using old libs, following irc discussion.

Also adjust an example slightly to fit on 80 character console.

MFC after:		3 days
Discussed with:		emaste, fuz, jhb
Differential Revision:	https://reviews.freebsd.org/D54079
2026-04-22 13:24:39 -04:00
Pierre Pronchery 57db556be4 src.conf(5): rebuild after introduction of WITHOUT_PKGCONF
Sponsored by:	The FreeBSD Foundation
Reviewed by:	bapt, philip
Approved by:	philip (mentor)
2026-04-22 15:43:20 +02:00
Pierre Pronchery b8352da33f pkgconf: import into the base system
This introduces the following option:

* MK_PKGCONF: determines if pkgconf and bomtool should be built

The objective is to allow the creation of SBOM information while
building FreeBSD's src tree. The build system cannot rely on the
presence of bomtool (and eventually also spdxtool) in the build
environment, except for having it as part of the src tree directly.

The framework implementing the generation of SBOM files is under review
in D56474.

This will also help simplifying the build, with the introduction of
another framework relying on the availability of pkgconf.

Sponsored by:		Alpha-Omega, The FreeBSD Foundation
Reviewed by:		bapt, philip
Approved by:		philip (mentor)
Differential Revision:	https://reviews.freebsd.org/D56404
2026-04-22 15:42:56 +02:00
Dag-Erling Smørgrav 3d00db6b8b tests.7: Provide better examples
Previous authors appear to have prioritized brevity over clarity.  This
unfortunately resulted in a manual page that left its reader with the
false impression that Kyua is difficult to use.  Attempt to correct
this by providing more and simpler examples with longer explanations.

While here, correct outdated information about where Kyua stores its
logs and results.

MFC after:	1 week
Reviewed by:	ziaee, ngie
Differential Revision:	https://reviews.freebsd.org/D56475
2026-04-22 10:19:32 +02:00
Dan Mahoney 2bff747bb0 termcap: fix screen entry standout mode (so/se) capabilities
so=\E[3m (italic) is incorrect, should be so=\E[7m (reverse video).
se=\E[23m (italic off) is incorrect, should be se=\E[27m (reverse off).

mr=\E[7m (reverse video) is correctly defined in the same entry.
screen-256color inherits from screen via tc=screen and is fixed
transitively.

PR:		294499
Pull Request:	https://github.com/freebsd/freebsd-src/pull/2139
MFC after:	1 week

Signed-off-by: Dan Mahoney <freebsd@gushi.org>
2026-04-21 20:03:23 -07:00
Warner Losh e8156a7e5f src.conf.5: Regenerate
Last time I generated this, there were many copies of WITH_CASPER for
reasons unknown.

Sponsored by:		Netflix
2026-04-21 09:30:31 -06:00
Warner Losh 3d2fd71786 src.opts.mk: Sort options
Sort the options in each of the sections alphabetically.

Sponsored by:		Netflix
2026-04-21 09:30:31 -06:00
Warner Losh 4ed20e0236 kshim/usb: Add build option.
Add WITH{,OUT}_LOADER_USB to build the kshim usb library. Nothing
in-tree uses it, but this will make it easier to keep building. Updated
src.conf.5 with a few extra changes...

Sponsored by:		Netflix
2026-04-17 20:41:43 -06:00
Alexander Ziaee b2aea7a042 e6000sw.4: Mention MV88E6171
Fixes:	680e6e30c0 (etherswitch: Add minimal support for mv88e6170)
Reviewed by:		jhibbits
Differential Revision:	https://reviews.freebsd.org/D56455
2026-04-17 11:21:13 -04:00
Alfredo Dal'Ava Junior 3b373d4840 us.intl.acc.kbd: add it to Makefile
This keyboard was implemented but wasn't actually installed to the
system.

Fixes: a049678039
Discussed with: imp
MFC after: 1 day
Relnotes: yes
2026-04-17 06:45:32 -03:00
Alfredo Dal'Ava Junior 6fb5df548e br.lenovo.kdb: add it to Makefile
This keyboard was implemented but wasn't actually installed to the
system.

Fixes: 9357c694e8
MFC after: 1 day
Relnotes: yes
2026-04-17 00:55:03 -03:00
Christos Longros 4390c37b5c rge: add disable_aspm tunable for PCIe power management
Add a per-interface loader tunable dev.rge.%d.disable_aspm to
disable PCIe ASPM (L0s/L1) and ECPM on the RTL8125/8126/8127.

Disabling ASPM reduces latency at the cost of higher power
consumption. Default is off (ASPM left as configured by BIOS).

Signed-off-by: Christos Longros <chris.longros@gmail.com>

Reviewed by:	adrian
Differential Revision:	https://reviews.freebsd.org/D56103
2026-04-16 19:34:55 -07:00
Mitchell Horne 47b0ac1cad OF_getprop.9: update OF_hasprop() signature
The return type has been converted to a bool.

Reported by:	manu
Sponsored by:	The FreeBSD Foundation
Fixes:		b60cd486a6 ("ofw: bool-ify OF_hasprop()")
2026-04-16 13:15:40 -03:00
Christos Margiolis a3094f522f rc.conf.5: Document virtual_oss(8)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D56225
2026-04-16 16:51:06 +02:00
Abdelkader Boudih a85c4ab626 appleir: Add Apple IR receiver driver
HID driver for Apple IR receivers (USB HID, vendor 0x05ac).
Supports Apple Remote and generic IR remotes using NEC protocol.

Supported hardware:
- Apple IR Receiver (0x8240, 0x8241, 0x8242, 0x8243, 0x1440)

Apple Remote protocol (proprietary 5-byte HID reports):
- Key down/repeat/battery-low detection
- 17-key mapping with two-packet command support
- Synthesized key-up via 125ms callout timer

Generic IR remotes (NEC protocol):
- Format: [0x26][0x7f][0x80][code][~code]
- Checksum: code + ~code = 0xFF
- Default keymap with 8 common codes
- See: https://techdocs.altium.com/display/FPGA/NEC+Infrared+Transmission+Protocol

Output via evdev with standard KEY_* codes.
Raw HID access available at /dev/hidraw0 for custom remapping.

Based on protocol reverse-engineering by James McKenzie et al.
Reference: drivers/hid/hid-appleir.c (Linux)

Tested on Mac Mini 2011 (0x05ac:0x8242).

Differential Revision:	https://reviews.freebsd.org/D55472
2026-04-15 15:36:17 -07:00
Abdelkader Boudih 3e27114a7f asmc: add raw SMC key read/write interface
This patch adds a debugging interface to read and write arbitrary
Apple SMC keys by name through sysctl, enabling hardware exploration
 and control of undocumented features.

The interface provides four sysctls under dev.asmc.0.raw.*:
  - key - Set the 4-character SMC key name (e.g., "AUPO")
  - value - Read/write key value as a hex string
  - len - Auto-detected key value length (can be overridden)
  - type - Read-only 4-character type string (e.g., "ui8", "flt")

Implementation includes a new asmc_key_getinfo() function using SMC
command 0x13 to query key metadata. The interface automatically
detects key lengths and types, uses hex string encoding for
arbitrary binary values, and is safe for concurrent access via
CTLFLAG_NEEDGIANT.

This interface was essential for discovering that the AUPO key
enables Wake-on-LAN from S5 state, and for mapping all 297 SMC keys
on Mac Mini 5,1.

Reviewed by:	ngie, adrian, markj
Differential Revision:	https://reviews.freebsd.org/D54441
2026-04-14 21:21:46 -07:00
Alexander Ziaee 998d501ae6 freebsd-base.7: Add an example for unregistering
MFC after:		3 days
Reviewed by:		ivy, emaste
Discussed with:		bapt, des, emaste, ivy, phk, pi
Differential Revision:	https://reviews.freebsd.org/D55458
2026-04-14 09:22:15 -04:00
Alexander Ziaee 5f922bd20d freebsd-base.7: Break examples into subsections
Break the examples into subsections, so that we can have multi-step
examples.

MFC after:		3 days (to 15 only)
Discussed with:		ivy
Differential Revision:	https://reviews.freebsd.org/D55526
2026-04-14 09:21:05 -04:00