Commit Graph

309146 Commits

Author SHA1 Message Date
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
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
Jilles Tjoelker 3ca8ec19b6 libc: correct posix_spawn_file_actions_init ENOMEM error
The return value of posix_spawn_file_actions_init() is an error number.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D56911
2026-05-10 00:02:25 +02:00
Aymeric Wibo fdd7daa231 thunderbolt: Fix typo in comment
Reported by:	adrian
Sponsored by:	The FreeBSD Foundation
2026-05-09 19:47:30 +02:00
Hartmut Brandt 27ad506d26 Document some more OIDs that are used by bsnmp. 2026-05-09 18:04:45 +02:00
Chuck Silvers 7906084ba2 Fix some memory leaks when fetching the mibII.
Reviewed by:	glebius
Sponsored by:	Netflix
Differential Revision:	<https://reviews.freebsd.org/D55998>
2026-05-09 17:52:14 +02:00
Paarth Shirsat 6499888ca7 gpart(7): Fix reference to the zfsprops man page
PR:	292147
2026-05-09 14:01:12 +00:00
Gisle Nes 555ffd9022 pci: use uint32_t for eecp
eecp holds the extended capability offset. If that offset is larger
than 0xff, storing it in uint8_t truncates it, which can make the
early EHCI/XHCI capability walk read the wrong location and loop during
boot.

Seen on AMD device 1022:151e, where HCCPARAMS1 = 0x0118ffc5 and the
first xHCI extended capability offset is 0x460. Widen eecp to uint32_t
in xhci_early_takeover(), matching xhci_pci_take_controller().

Signed-off-by: Gisle Nes <gisle@gisle.net>
Reviewed by:    zlei, aokblast
MFC after:      3 days
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2127
Closes:         https://github.com/freebsd/freebsd-src/pull/2127
2026-05-09 17:09:05 +08:00
Dag-Erling Smørgrav 44338ccd12 BSD.root.dist: Correct tag for /etc/sysctl.kld.d
This is only used by rc.subr and belongs in rc, not runtime.

Fixes:		fa6d67cd16 ("BSD.root.dist: Add package tag for all directories")
MFC after:	3 days
Reviewed by:	ivy
Differential Revision:	https://reviews.freebsd.org/D56900
2026-05-09 11:04:25 +02:00
Laurent Chardon 072f79d0a2 hwpstate_amd: Initialize CPPC driver type
Assign the driver type instead of preserving uninitialized stack data

PR:     294899
Reviewed by:    aokblast
2026-05-09 16:38:21 +08:00
Lianwei Wang 10e342c1ec fsck_msdosfs: fix FAT header correction not persisting in cache mode
When fsck_msdosfs runs with FAT32 cache mode (used for large
filesystems that cannot be mmap'd), a detected FAT header correction
was written into the in-memory buffer but the corresponding cache
entry (fat32_cache_allentries[0]) was never marked dirty.  As a
result, fat_flush_fat32_cache_entry() skipped it, the corrected
bytes were never written to disk, and copyfat() propagated the
uncorrected on-disk data to all backup FAT copies.  Every subsequent
fsck run would repeat the same "FAT starts with odd byte sequence /
FIXED" cycle indefinitely.

Fix by marking fat32_cache_allentries[0].dirty = true after applying
the in-memory correction, ensuring the chunk is flushed before
copyfat() runs.

Obtained from:	https://android-review.googlesource.com/c/platform/external/fsck_msdos/+/4047981
MFC after:	3 days
2026-05-08 21:56:12 -07:00
Navdeep Parhar 1bef5535c1 cxgbe(4): Updates to the hw and fw headers and config file
MFC after:	1 week
Sponsored by:	Chelsio Communications
2026-05-08 15:26:02 -07:00
Ryan Libby 324d53c26b sys/time: rework saturation ifdef to avoid direct arch ref
Suggested by:	kib
Reviewed by:	imp, kib
Differential Revision:	https://reviews.freebsd.org/D56401
2026-05-08 12:37:24 -07:00
Ryan Libby 94323513dd types: provide __SIZEOF_{INT{8,16,32,64},TIME,TIME32}_T
Suggested by:	kib
Reviewed by:	imp, kib
Discussed with:	emaste, jrtc27
Differential Revision:	https://reviews.freebsd.org/D56783
2026-05-08 12:37:24 -07:00
Dimitry Andric d9b272a19d Merge commit 871038759afb from llvm git (by Marco Elver):
Thread Safety Analysis: Fix pointer handling of variables with deprecated attributes (#148974)

  de10e44b6fe7 ("Thread Safety Analysis: Support warning on
  passing/returning pointers to guarded variables") added checks for
  passing pointer to guarded variables. While new features do not
  necessarily need to support the deprecated attributes (`guarded_var`,
  and `pt_guarded_var`), we need to ensure that such features do not cause
  the compiler to crash.

  As such, code such as this:

          struct {
            int v __attribute__((guarded_var));
          } p;

          int *g() {
            return &p.v;  // handleNoMutexHeld() with POK_ReturnPointer
          }

  Would crash in debug builds with the assertion in handleNoMutexHeld()
  triggering. The assertion is meant to capture the fact that this helper
  should only be used for warnings on variables (which the deprecated
  attributes only applied to).

  To fix, the function handleNoMutexHeld() should handle all POK cases
  that apply to variables explicitly, and produce a best-effort warning.

  We refrain from introducing new warnings to avoid unnecessary code bloat
  for deprecated features.

  Fixes: https://github.com/llvm/llvm-project/issues/140330

This fixes an assertion while building the net/openvswitch port:
"Assertion failed: ((POK == POK_VarAccess || POK == POK_VarDereference)
&& "Only works for variables"), function handleNoMutexHeld, file
/usr/src/contrib/llvm-project/clang/lib/Sema/AnalysisBasedWarnings.cpp,
line 2120.'

Reported by:	cy
PR:		295101, 292067
MFC after:	1 month
2026-05-08 19:59:54 +02:00
Alan Somers bd1e789b84 Make "make update-packages" idempotent
If the user runs "make update-packages" without bumping BRANCH, then it
isn't possible to copy packages from the old location to the new one
(because the two locations are the same).  So just skip that step.

Sponsored by:		ConnectWise
PR:			295085
MFC after:		1 week
Reviewed by:		ivy, emaste
Differential Revision:	https://reviews.freebsd.org/D56872
2026-05-08 09:17:57 -06: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
Alan Somers 1d24638d3e Fix LOCAL_PEERCRED in 32-bit compat mode
Previously the cr_pid field would be incorrectly copied to userland, due
to a size mismatch between the structure as defined in 32-bit vs 64-bit
builds.  Fix it by converting the structure before copying it to
userland.

PR:		294833
Sponsored by:	ConnectWise
MFC after:	1 week
Reviewed by:	emaste
Differential Revision: https://reviews.freebsd.org/D56675
2026-05-07 14:52:35 -06:00
Konstantin Belousov 8eef59db25 vm_map_growstack(): use local for p->p_vmspace
Noted by:	alc
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2026-05-07 22:58:18 +03:00
Dag-Erling Smørgrav 2c88636e0e stat: Expand devname test case
Test what happens when we ask for the rdev of a non-device.

MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D56838
2026-05-07 20:45:14 +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
John Hall 0d48d6d7bb smartpqi: Add runtime sysctl for debug_level and log device state changes
The smartpqi driver did not log device add/remove or controller events
to syslog, and hw.smartpqi.debug_level could only be set at boot via
loader.conf with no runtime sysctl interface.

Add a read-write sysctl at dev.smartpqi.N.debug_level for runtime
debug level changes. Add device_printf calls for device addition,
removal, and controller events (hotplug, hardware, physical/logical
device, AIO state/config changes) so state changes always appear in
dmesg. Add DBG_DISC logging for discovery state transitions. Fix
spelling errors in strings and comments across the driver.

Bump driver version to 14.4691.1.2000 / 15.2.1.2000.

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

Differential Revision:	https://reviews.freebsd.org/D56832
2026-05-07 11:08:26 -07:00
Ryan Libby 944a4eb089 stand/libsa/zfs: disable ZSTD_TRACE and DYNAMIC_BMI2 code paths
Enabling ZSTD_TRACE leaves behind undefined weak symbols, which causes a
problem for gcc builds.  The bfd linker emits an obscure error about
overlapping FDEs.  We don't need ZSTD_TRACE for libsa, so just disable
it.

Also disable BMI2 instruction optimizations.  The addition of the
optional BMI2 code paths caused the boot loader binaries to grow larger
(28 KiB for clang, 32 KiB for gcc).  The boot loader binaries are size
constrained, and this pushed the gcc-generated lua_loader.bin over the
500000 byte limit, and the clang one to within 4k of the limit.

Fixes:	8a62a2a565 ("zfs: merge openzfs/zfs@f8e5af53e")
Reviewed by:	delphij, imp, mm
Differential Revision:	https://reviews.freebsd.org/D56866
2026-05-07 10:30:05 -07:00
Mark Johnston 54625dfb36 git-arc: Update the usage message to mention create -d
Fixes:	448ec129bc ("git-arc: Add a create-draft mode")
2026-05-07 17:18:32 +00:00
Konstantin Belousov 18c5a26f8a vm_map_growstack(): give a hint to user that stack was blown out
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D56863
2026-05-07 20:00:14 +03:00
Konstantin Belousov 642dd17ee9 vm_map_growstack(): consistently use local vars instead of curthread/proc
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D56863
2026-05-07 20:00:14 +03:00
Kristof Provost 4e7c1ff95a pfctl: relax interface name requirement
The FreeBSD network stack, for better or worse, does not impose any
requirements on interface names. As such it's valid for an interface
name to start with a number (or indeed, be something like '').

Allow this in pfctl, and add a test case for the specific case of
interface names starting with a number.

Note that we don't support UTF-8 names fully, so those may still fail.

PR:		295064
MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2026-05-07 17:07:23 +02:00
Kristof Provost 726ff260ec pfctl: optionally print the rule in the state overview
When dumping states optionally (at '-vv') also show the rule which
created the state. This can be helpful if the ruleset changed and we
want to know what rule created the state.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2026-05-07 17:06:56 +02: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
Konstantin Belousov ce4e8c478a bufspace_wait(): only try to help bufdaemon if there is a chance to help
Only call buf_flush() if there are some dirty buffers belonging to the
vnode we are allocating the buffer for.  Otherwise the bd dirty queue
scan cannot find anything and it makes no sense to spend CPU doing it.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2026-05-07 14:59:11 +03:00