Commit Graph

309175 Commits

Author SHA1 Message Date
Mark Johnston 5615db1007 find: Include signal.h to get a definition for sig_atomic_t
MFC after:	1 week
2026-05-12 20:05:18 +00:00
Mark Johnston fab4acbb7d vmem: Include param.h in the userspace port as well
It is required at least for NBBY.

MFC after:	1 week
2026-05-12 20:05:18 +00:00
Mark Johnston 35a36d4a54 mdo: Avoid relying on header pollution
The uses of PAGE_SIZE and roundup2() require param.h.

MFC after:	1 week
2026-05-12 20:05:18 +00:00
Mark Johnston 3b16e96b00 tests/ip_mroute: Remove test timeouts
The configured timeout of 30s is a bit too low for a couple of tests
which create 4+ VNET jails when running tests in parallel and with
kernel sanitizers enabled.  There's no reason to have custom timeouts,
just use the default.

MFC after:	1 week
2026-05-12 20:05:18 +00:00
Mark Johnston 26bffe5695 tests/tcp_hpts_test: Fix more resource leaks
Address leaks that I missed in commit f7bf9fd619
("tests/tcp_hpts_test: Fix resource leaks").

Reviewed by:	Nick Banks <nickbanks@netflix.com>, tuexen
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D56943
2026-05-12 20:05:18 +00:00
Nick Banks d1aee9f153 sys/time.h: add bintime2us() helper
Add a microsecond conversion helper to complement the existing
bintime2ns(). The body mirrors bintime2ns().
This will be used by an upcoming eventlog(9) framework as well as
the TCP code in upcoming changes.

Approved by:		gallatin, tuexen
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D56972
2026-05-12 21:26:24 +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
Ed Maste e68433e199 sys: Fix heap disclosure in compat7 kern.proc.filedesc sysctl
Reported by: Yuxiang Yang, Yizhou Zhao, Ao Wang, Xuewei Feng, Qi Li, and Ke Xu from Tsinghua University using GLM-5.1 from Z.ai

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56976
2026-05-12 13:59:51 -04:00
Sarah Walker a6add87b5e arm64: Load SOCDEV_PA as a literal rather than an immediate
When EARLY_PRINTK is used in a realm environment, the UART physical
address must be in the unprotected address space. The resulting
physical address will not generally fit in an immediate, so use a
literal instead.

Reviewed by:	andrew
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D56600
2026-05-12 17:54:41 +01:00
Sarah Walker 56abdbc5f7 arm64: VM/PMAP changes for CCA guest support
When in a realm:

- Mappings with mode VM_MEMATTR_DEVICE and VM_MEMATTR_DEVICE_NP are
  unprotected
- Imported busdma buffers in protected memory are always bounced
- If EARLY_PRINTK is in use, the UART physical address must be in the
  unprotected address space

Reviewed by:	andrew
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D56599
2026-05-12 17:54:41 +01:00
Sarah Walker 76a2904c35 arm64: Add RSI detection for CCA
Detect the presence of the Realm Services Interface (RSI). This detection is
performed early in bootup; PSCI initialisation has been moved to initarm() to
faciliate this.

Reviewed by:	andrew
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D56598
2026-05-12 17:54:40 +01:00
Sarah Walker f9ba99eaa2 physmem: Add a way to read all memory
In Arm CCA we need to find all memory to protect it. This needs to find
all memory, ignoring any excluded memory to protect it from the host.

Add physmem_all that reads all physical memory regions.

Co-developed-by: Andrew Turner <andrew@> (writing tests & commit message)
Sponsored by:	Arm Ltd
2026-05-12 17:54:40 +01:00
Sarah Walker cd2512eaab vm: Add flags for unprotected allocations
Unprotected allocations are intended to be accessible outside of the current
VM on systems such as Arm CCA.

Reviewed by:	markj
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D56518
2026-05-12 17:54:40 +01:00
Aleksandr Rybalko 8db0553ed6 vt: Clear cut-paste selection if the area intersects with the filled region
* cut-paste buffer stays unchanged

PR:		260069
Reported by:	emaste

Reviewed by:	imp
Approved by:	imp (mentor)
Differential Revision:	https://reviews.freebsd.org/D56922
2026-05-12 18:56:20 +03:00
Chuck Tuffli 346be36e88 smart: Merge smart 1.0.3
Merge commit 'd2d20bb5099dc1c443a4b783d43b8a45338c85d2'
2026-05-12 07:33:03 -07:00
Alan Somers dc14ae4217 bsdinstall: do pkgbase installations with the "script" command
"bsdinstall script" will now do a pkgbase installation by default.  The
system components to install can be specified in the COMPONENTS
variable, and have the same names as those used in the interactive
installer.  bsdinstall will still do a legacy distset installation if
DISTRIBUTIONS is defined in the installerconfig file.

MFC:		1 week
PR:		290375
Sponsored by:	ConnectWise
Reviewed by:	ziaee, ivy, jduran
Differential Revision: https://reviews.freebsd.org/D56717
2026-05-12 08:13:16 -06:00
Brian Scott dab8138e13 g_part,mkimg: Add additional GPT partition types
Add the hifive-fsbl, hifive-bbl, and xbootldr aliases to mkimg(1).
Add the xbootldr alias to geom(4), and thus gpart(8).

The "hifive" partition types are defined and used by various RISC-V SBCs
for locating firmware.

"xbootldr", or the Extended Boot Loader Partition is defined here:
https://uapi-group.org/specifications/specs/boot_loader_specification/

Reviewed by:	emaste, markj, mhorne
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D56784
2026-05-12 11:00:10 -03:00
Brian Scott 351fad05e0 if_eqos_starfive: Read MAC address from device tree
u-boot/opensbi determines the ethernet MAC address from ROM and passes
it to the OS in the device tree. This change sets the correct MAC
address from this source. This prevents the eqos class driver from
generating random MAC addresses at each boot.

Tested on Starfive VisionFive 2, riscv64 SBC.

Reviewed by:	mhorne
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D56782
2026-05-12 11:00:10 -03:00
Chuck Tuffli d2d20bb509 Import smart revision 1.0.3
Fixes armv7 and gcc14 build issues.
2026-05-12 06:35:31 -07:00
Andrew Gallatin 23b263dfbf Revert "mlx5e: Ensure rx timestamps are monotonically increasing"
This reverts commit ce33f96fcf.

It turns out that doing it this way did indeed prevent backwards
movement of timestamps, however it also lead to an ever increasing
error, eventually yielding timestamps hundreds or thousands of
seconds in the future.

Back this out until we can come up with a solution that prevents
backards timestamps and also avoids accumulating error.

Sponsored by: Netflix
2026-05-12 08:55:54 -04:00
Andrew Gallatin 9f69446d45 lacp: fix link state with multiple aggregators
When we have multiple aggregators, the link state should reflect the
state of the active aggregator.

This change was prompted by a script pruning 10GbE interfaces from an
lacp bundle with 100GbE interfaces. Mixing speeds like this creates multiple
aggregators.  When the last 10GbE interface was removed, lagg0 would loose
link because the current aggregator's port count would drop to 0, even
though the 100GbE aggregator had active ports. This left the system in a
hard to diagnose state where lagg0 reported "active", but all outgoing
IP traffic was dropped, due to the RT_LINK_IS_UP() check noticing lagg0's
if_link_state was marked as down.

Reviewed by: zlei
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D56579
2026-05-12 08:52:24 -04:00
Ruslan Bukin bcecad2c24 riscv: IOMMU support
Support for RISC-V IOMMU spec v1.0.1 (ratified)
  https://github.com/riscv-non-isa/riscv-iommu

Supports translation for PCI devices only.
Supports 1 or 2-level device-directory-table (DDT).
Supports SV39 and SV48 virtual memory system (on per-device basis).
Supports both "standard" and "extended" device-context (DC) structure.
Supports "bypass" mode to disable translation for a particular device.
Supports WSI (Wire-Signalled Interrupts) only.

This includes both PCI-bus and FDT attachment drivers.

Note in case of PCI-bus attachment, interrupts are not available. In this
case no error report is provided in case of translation fault. Otherwise
interrupts are not needed.

Differential Revision:	https://reviews.freebsd.org/D55922
2026-05-12 11:11:32 +01:00
Aymeric Wibo 6f451c6091 power: Rename power transition enum
Just so it isn't so long.  Changing now before the API freezes, after
discussion with olce@.

While here, improve the wording in the comments for power transitions
and sleep types a bit.

Reviewed by:	olce
Approved by:	olce
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D56953
2026-05-12 10:46:24 +01:00
Baptiste Daroussin 8b70a203be nuageinit: fix command injection and related issues
- Add shell_escape() helper to safely escape shell arguments
- Apply shell_escape to all user-controlled values in shell commands:
  adduser (usershow, useradd, lock, primary_group, groups)
  addgroup (groupshow, groupadd, members)
  exec_change_password (usermod)
  settimezone (tzsetup root and timezone)
  install_package (pkg package names)
- Escape double quotes in hostname when writing rc.conf.d/hostname
- Add missing 'local' declaration for resolvconf_command in nameservers()
- Escape interface name in resolvconf -a command
- Change open_resolvconf_conf() from 'w' to 'a' mode to prevent
  data loss when nameservers() is called multiple times
- Clean up stale resolvconf.conf at the start of each boot
  (skip on postnet to preserve config written by first call)

MFC After: 1 day
2026-05-12 09:52:32 +02:00
Boris Lytochkin 3d39eadcde ipfw: fix IPv6 flow label matching
* do not require just only ip6 proto for flow-id opcode in ipfw(8).
  ipv6-icmp, tcp, udp should be fine too.
* fix off-by-one bug leading to out-of-bounds read.
* apply IPV6_FLOWLABEL_MASK before comparison in flow6id_match(),
  so flow-id opcode will match a specified flow label. No need to
  take protocol version and traffic class into account.
* add the test to verify that opcode is working correctly.

Reviewed by:	pouria
Obtained from:	Yandex LLC
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D56869
2026-05-12 10:44:10 +03: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
Ed Maste a3036edd02 if_media: Claim 10BASE-T1S and 10BASE-T1L constants
These are two single-pair Ethernet (SPE) variants that run at 10 Mbps.
10BASE-T1S has automotive origins and supports multiple nodes on up to
25m of cable.  10BASE-T1L is intended for building and industrial
automation and supports long-distance point to point links of over 1km.

Reviewed by:	kbowling
Differential Revision: https://reviews.freebsd.org/D56952
2026-05-11 20:01:04 -04:00
Jung-uk Kim 7697e6c4df acpica: Merge ACPICA 20260408
Merge commit '69ae37302ee98839857791a261546e19d078cdb8'
2026-05-11 19:29:58 -04:00
Chuck Tuffli 25942dddc8 smart: Connect contrib/smart to build
Reviewed by:	fuz, jrm
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D56638
2026-05-11 15:18:52 -07:00
Chuck Tuffli 7419d6e463 Add 'contrib/smart/' from commit 'eb3b1302382b1d0cbe37eeebabfcdd546aa2fc4e'
git-subtree-dir: contrib/smart
git-subtree-mainline: 95b4436e98
git-subtree-split: eb3b130238
2026-05-11 14:50:04 -07:00
Jung-uk Kim 69ae37302e Import ACPICA 20260408 2026-05-11 17:41:03 -04:00
Aymeric Wibo 95b4436e98 power: Rename sleep types
Make sleep type names clearer and more consistent, and allow space for
something like "os_hibernate" once that gets added to FreeBSD.

Reviewed by:	jaeyoon, olce, markj
Approved by:	jaeyoon, olce, markj
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D56920
2026-05-11 18:11:39 +01: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
Ryan Libby bac7bd5038 linux: address executable stack warnings
Mark assembly files as not requiring executable stacks.

This still leaves linux32_vdso.so without a .note.GNU-stack section in
the gcc build for now.

Reviewed by:	imp, kib
Differential Revision:	https://reviews.freebsd.org/D56894
2026-05-10 22:39:27 -07:00
Pouria Mousavizadeh Tehrani 70ef02b5d3 if_geneve: Fix uninitialized variable use in geneve_udp_input()
Set the ifp variable as soon as soft_c becomes available
so that interface statistics can be incremented.

PR:		295129
Reported by:	Robert Morris <rtm@lcs.mit.edu>
Fixes:		e44d2e941e ("if_geneve: Add Support for Geneve ...")
2026-05-10 23:08:52 +03:30
Konstantin Belousov ea72f6d5a8 sys/cdefs.h: move __BEGIN_DECLS/__END_DECLS into a helper sys/_decls.h
There are situations where nothing from sys/cdefs.h is needed except for
the declaration braces.  More, the other facilities from sys/cdefs.h
might unnecessarly pollute the namespace.

Reviewed by:	markj, imp
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D56889
2026-05-10 21:14:18 +03:00
Konstantin Belousov 5e4947f7e0 sys/vnode.h: remove stale comment
The source sweep is not going to happen.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D56611
2026-05-10 20:43:46 +03:00
Konstantin Belousov a57420b214 vfs: convert VFS_OPs from macros to static inlines
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D56611
2026-05-10 20:43:46 +03:00
Konstantin Belousov e9a5eb0e5e vop_read_pgcache_post(): report inotify IN_ACCESS same as for vop_read_post()
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D56611
2026-05-10 20:43:46 +03:00
Konstantin Belousov 1d5e4020e3 vnode: add VIRF_KNOTE flag
to indicate non-empty vnode knote list.  Use it instead of
VN_KNLIST_EMPTY() and guard note activations with it.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D56611
2026-05-10 20:43:46 +03:00
Konstantin Belousov 32cf4514ca vfs: convert vfs_op_thread_* macros to static inlines
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D56611
2026-05-10 20:43:46 +03:00
Steve Kargl 3085fc9d97 [libm] implementation of rsqrt, rsqrtf, and rsqrtl
From the PR:
The attached diff implements the inverse square root function, i.e,
rsqrt(x) = 1 / sqrt(x).  Exhaustive testing of the float version
suggests that it is correctly rounded in round-to-nearest for all
test values in the range [0x1p-127,0x1p126].
Exhaustive testing of rsqrt and rsqrtl cannot be done, but 1100M
values of x for rsqrt and 400M values for rsqrtl were tested.  All
tested values were correctly rounded.

I do not have access to LD128 (i.e., IEEE 128-bit floating point)
hardware, so the implementation of rsqrtl() is untested.

The following is a summary of changes to source code.

* lib/msun/Makefile:
  . Add s_rsqrt.c and s_rsqrtf.c to COMMON_SRCS.
  . For non-53-bit long double targets, add s_rsqrtl.c to COMMON_SRCS.
  . Add MLINKS for rsqrt.3, rsqrtf.3, and rsqrtl.3 to sqrt.3.

* lib/msun/Symbol.map:
  . Add rsqrt, rsqrtf, and rsqrtl to the Symbol map for shared libm.so.

* lib/msun/man/sqrt.3:
  . Update the sqrt.3 manual page to include information for rsqrt[fl].
  . Note, these function come from ISO C23 (and IEEE-754 2008).

* lib/msun/src/math.h:
  . Add prototypes for new functions.

* lib/msun/src/math_private.h:
  . Add _SPLIT, _FAST2SUM, _SLOW2SUM, _XADD, _MUL, and _XMUL
    macros to perform type-type arthimetic (i.e., float-float).

* src/s_rsqrt.c:
  . New file with the implementation of 'double rsqrt(double)'.
  . For 53-bit long double targets, add a weak reference for rsqrtl.

* src/s_rsqrtf.c:
  . New file with the implementation of 'float rsqrt(float)'.

* src/s_rsqrtl.c
  . New file with the implementation of 'long double rsqrt(long double)'.
    Note, the LD80 version uses bit twiddling and LD128 version is a
    straight C language implementation.  The LD128 is untested due to
    lack of hardware.

PR:	295089
MFC after:	1 week
2026-05-10 19:36:33 +03:00
Baptiste Daroussin 8b03193289 nuageinit: add update_sshd_config tests 2026-05-10 17:54:48 +02:00
Baptiste Daroussin 0f92bee2b3 nuageinit: add adddoas tests 2026-05-10 17:54:48 +02:00
Baptiste Daroussin a49b3b10aa nuageinit: add addsudo tests 2026-05-10 17:54:47 +02:00
Baptiste Daroussin 68fd0feacb nuageinit: add decode_base64 tests 2026-05-10 17:50:53 +02:00
Konstantin Belousov 428da7d65b Add O_SYMLINK emulation
for MacOSX partial compatibility, defined as O_PATH | O_NOFOLLOW.
fstat(2) and freadlink(3) works on the resulting file descriptors,
but reads on the regular file do not.

More complete but more hackish version was developed but deemed too
hackish.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D56365
2026-05-10 17:53:20 +03:00
Konstantin Belousov a2e0822543 libc: add freadlink(3)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D56365
2026-05-10 17:53:20 +03:00
Ryan Libby 0f6c880fce stand/i386: quiet executable stack warning
Reviewed by:	imp, kib
Differential Revision:	https://reviews.freebsd.org/D56908
2026-05-09 21:25:43 -07:00
Ryan Libby 58e5b4dbd9 vfs_subr: mark uma zone and smr pointers __read_mostly
Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D56892
2026-05-09 21:25:12 -07:00