Commit Graph

307412 Commits

Author SHA1 Message Date
Minsoo Choo 75858ca528 Add .editorconfig
FreeBSD developers use different text editors or sometimes use GUI
editors such as VSCode or Zed on different platforms for convinence.
However, there is lack of unified config for those editors to follow
style(9) including indent rules.

Although most "modern" editors support .editorconfig out of box, basic
editors such as vim needs a plugin for autoloading .editorconfig file.

Sponsored by:	The FreeBSD Foundation

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2024
2026-03-07 00:51:15 -07:00
tslight cecd12ac3b use ASMC_FAN_FUNCS2 to avoid trying to read non-existent keys
Signed-off-by: tslight <tslight@pm.com>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2051
2026-03-07 00:51:15 -07:00
Perdixky 9f2eb94736 Add __unused workaround for linux/sys/types.h
Signed-off-by: Perdixky <3293789706@qq.com>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2063
2026-03-07 00:51:14 -07:00
Jamie Landeg-Jones 9006a731bc /bin/ps: Fix display of negative nice values on ARMv7/aarch64
On Arm-based systems (and maybe others), 'char' defaults to unsigned,
causing negative nice values to be displayed incorrectly (e.g., 246
instead of -10). Explicitly using 'signed char' ensures consistent
behaviour across architectures.

[ tested on RPI2 and generic aarch64 qemu install ]

Before:
  # /usr/bin/nice --10 ps -l | awk '(NR == 1 || $(NF-1) == "ps")'
  UID   PID  PPID C PRI  NI  VSZ  RSS MWCHAN  STAT TT     TIME COMMAND
    0 23606 22800 2 -32 246 5400 2544 -       R<+   0  0:00.06 ps -l

After:
  # /usr/bin/nice --10 ps -l | awk '(NR == 1 || $(NF-1) == "ps")'
  UID   PID  PPID C PRI  NI  VSZ  RSS MWCHAN  STAT TT     TIME COMMAND
    0 23614 22800 3 -32 -10 5400 2544 -       R<+   0  0:00.05 ps -l

Signed-off-by: Jamie Landeg-Jones <jamie@catflap.org>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2064
2026-03-07 00:51:14 -07:00
Konstantin Belousov fdc1f34506 x86: change signatures of ipi_{bitmap,swi}_handler() to take pointer
to the frame instead of the frame itself. It is some stretch of the
amd64 ABI, and is not easily fullfilled when handlers are called from C
and not asm. In particular, the struct frame is passed by value but is
modified by callees, with the expectation that the caller will see the
modifications.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D55679
2026-03-07 05:58:48 +02:00
Alexander Ziaee 74aec9f02d ports.7: Document DEFAULT_VERSIONS
MFC after:		3 days
Co-authored-by:		Adam Weinberger <adamw@FreeBSD.org>
Differential Revision:	https://reviews.freebsd.org/D55443
2026-03-06 18:47:20 -05:00
John Baldwin 1e4086d052 sys: Don't pass RF_ALLOCATED to bus_alloc_resource*
This is a nop as eventually these flags are passed to rman_reserve_resource
which unconditionally sets RF_ALLOCATED in the new flags for a region.
However, it's really a layering violation to use RF_ALLOCATED in relation
to struct resource objects outside of subr_rman.c as subr_rman.c uses
this flag to manage it's internal tracking of allocated vs free regions.

In addition, don't document this as a valid flag in the manual.  I
think the intention here was that if a caller didn't want to pass
RF_ACTIVE or RF_SHAREABLE, they could pass RF_ALLOCATED instead of 0,
but given the layering violation, I think it's best to just pass 0
instead in that case.

NB: The bhnd bus uses RF_ALLOCATED (along with RF_ACTIVE) in a
separate API to manage resource regions that are not struct resource
objects (but a separate wrapper object).  It would perhaps be cleaner
if the chipc_retain_region and chipc_release_region functions used
their own flag constants instead of reusing the rman(9) flags.

Reviewed by:	imp, kib
Differential Revision:	https://reviews.freebsd.org/D55683
2026-03-06 16:32:33 -05:00
John Baldwin ca25b1b263 devinfo: Support PCI DBSF and ACPI handles for -p
When matching on a name of a device, match on ACPI handles and PCI
selectors in addition to device names.  This can be useful for
matching on devices without an attached driver.

For example: devinfo -p pci0:0:31:0

Reviewed by:	imp
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D55673
2026-03-06 15:36:05 -05:00
Bjoern A. Zeeb 95dd8736f8 iwlwifi: update Intel's mvm/mld drivers
This version is based on
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
05f7e89ab9731565d8a62e3b5d1ec206485eeb0b ( tag: v6.19 ).

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2026-03-06 19:48:01 +00:00
Matt Delco b3d9e5013f nvme: Don't active memory space until all BARs are configured
In the current current behavior the 2nd and 3rd BARs can be activated
when they're configured with address zero. This change defers the
activation of all BARs until after they've all been configured with an
address.

This enables FreeBSD on Google Compute Engine C4-LSSD Machines.

Sponsored by:		Google
Tested by:		NetApp (previous version)
Reviewed by:		gallatin, imp
Discussed with:		jrtc27 (improved error reporting)
Differential Revision:	https://reviews.freebsd.org/D55541
2026-03-06 12:28:41 -05:00
Olivier Certner af2c7d9f64 style.9: Encourage style changes when doing significant modifications
The rule of allowing style changes when about half or more of a file (or
group of files), coupled with the advice of avoiding stylistic changes,
could be interpreted as forbidding most style changes, even in heavily
modified functions.

In order to rule out that interpretation and ease transition towards our
prescribed style:
1. Clarify that avoiding stylistic changes concerns only "standalone"
   ones.
2. Actually encourage changing the style, and extend the cases where it
   is explicitly allowed to do so to any single logical unit as little
   as a function, keeping the existing "about half" of modified code as
   a rule of thumb.

When point 2 above applies, encourage to commit pure style changes
separately, and to add style-only commits to '.git-blame-ignore-revs'.

Add a specific note ruling out "horizontal" style changes spanning
unrelated directories in the whole tree, which make the merge (MFC)
process more difficult.

While here, be slightly more stringent on new kernel code.

While here, regroup the paragraphs talking about style, and put them at
the end (before the recent C++ section).

While here, rephrase the requirement on third-party maintained code to
be slightly less stringent.

Reviewed by:    jhb, imp
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D52885
2026-03-06 18:14:35 +01:00
Olivier Certner c1567d49a8 iwx: Re-activate the 32-bit boundary cross check on 64-bit architectures
__SIZEOF_*__ is in bytes, not in bits...

Reported by:    brooks
Fixes:          35da55c28d ("iwx: Fix 32-bit compilation")
MFC after:      1 minute
MFC to:         stable/15
Sponsored by:   The FreeBSD Foundation
2026-03-06 18:14:25 +01:00
Ed Maste 88dedd16ba llvm-cxxfilt: Install as c++filt only with LLVM_BINUTILS
When building WITHOUT_LLVM_BINUTILS /usr/bin/c++filt is the one from
ELF Tool Chain.

PR: 293610
Fixes: 5d757312ad ("build: Retire LLVM_CXXFILT option")
Sponsored by: The FreeBSD Foundation
2026-03-06 10:52:37 -05:00
Andrew Gallatin f1e8b1aca5 splice: optionally limit worker queues
Add a new tunable/sysctl (kern.ipc.splice.num_wq) which can be used
to limit the number of splice worker queues as a way to limit
splice cpu use.

The default (-1) keeps the current behavior of running one worker
for each core in the system.  An administrator can set it to 0 (either
via tunable, or before the first splice call via sysctl) to
effectively disable splice, or some number smaller than the number of
cores to limit splice thread use.

Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D55579
Sponsored by: Netflix
2026-03-06 10:14:23 -05:00
Ed Maste 42e4df8b85 usr.bin: Exclude ELF Tool Chain cxxfilt build
when LLVM_BINUTILS is enabled (which is the default).

PR: 293610
Fixes: 5d757312ad ("build: Retire LLVM_CXXFILT option")
Sponsored by: The FreeBSD Foundation
2026-03-06 09:50:54 -05:00
Pouria Mousavizadeh Tehrani 0951901814 rtadvd: add multi pref64 support
Add support for multi pref64 in rtadvd and rtadvctl

Reviewed By: zlei, bz
Differential Revision: https://reviews.freebsd.org/D54636
2026-03-06 16:05:09 +03:30
Christos Margiolis e85f221def rc: virtual_oss: Silence potential hw.snd.default_unit error
PR:		293582
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2026-03-06 13:27:03 +01:00
Peter Holm b15dc3ff28 stress2: Updated comments 2026-03-06 10:03:53 +01:00
Peter Holm 05cbd5fc2b stress2: Added a new test scenario 2026-03-06 10:03:11 +01:00
Xin LI 8dd28e13e4 libc/quad: fix missing closing #endif in Symbol.map
Without this lib32 libc.so.7 would be missing critical symbols,
including malloc / free and all syscall wrappers.
2026-03-06 00:22:06 -08:00
Bjoern A. Zeeb 7db8503bda iwlwifi: mld: add LINUXKPI_PARAM_PREFIX
Add a LINUXKPI_PARAM_PREFIX to mld to properly export the
power_scheme module_param (sysctl).  This is especially needed given
mvm has the same parameter and we need to avoid a clash.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2026-03-06 02:49:30 +00:00
Bjoern A. Zeeb 782fe2f8d9 iwlwifi: adjust driver description
Adjust the module driver descriptions for mvm and mld to make it clear
that this is not a driver for Linux but a Linux-based driver for FreeBSD.
Cleanup surroundings.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2026-03-06 02:49:30 +00:00
Bjoern A. Zeeb 551c4cb74a iwlwifi: mld: move module_init() to SI_ORDER_SECOND
In FreeBSD the iwlwifi driver is a single kernel module.
As for iwlwifi/mvm we need to make sure the common "iwlwifi drv" code
is initialized before trying to register the mld sub-driver
in order for lists, etc. in the registration code to be initialized.
We do this by using an extended (FreeBSD specific) version of
module_init which overrides the order parameter of the SYSINIT.
Otherwise we can randomly (depending on SYSINIT run order) run into
a NULL pointer deref panic.

Sponsored by:	The FreeBSD Foundation
PR:		291120
MFC after:	3 days
2026-03-06 02:49:07 +00:00
Konstantin Belousov 272ea45119 amd64: print userspace fsbase and gsbase for uprintf_signal 2026-03-06 01:53:57 +02:00
Konstantin Belousov 3e8a9995e9 amd64: extract uprintf_signal printing into a helper 2026-03-06 01:53:57 +02:00
Konstantin Belousov 5c71df9850 nfsclient: convert to use vn_delayed_setsize()
Reviewed by:	rmacklem
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D55595
2026-03-06 01:46:54 +02:00
Konstantin Belousov 45117ffcd5 vfs: add VOP_DELAYED_SETSIZE() and related infrastructure
The change generalizes code that was initially developed for nfs client
to handle filesystems that needs to call vnode_pager_setsize() while
only owning the vnode lock shared.  Since vnode pager might need to trim
or extend the vnode vm_object' page queue, the vnode lock for the call
must be owned exclusive.  This is typical for filesystems with remote
authorative source of file attributes, like nfs/p9/fuse.

Handle the conflict by delaying the vnode_pager_setsize() to the next
vnode locking to avoid relock.  But if the next locking request is in
shared mode, lock it exclusively instead, perform the delayed
vnode_pager_setsize() call by doing VOP_DEFAULT_SETSIZE(), and then
downgrade to shared.

Filesystems that opt into the feature must provide the implementation of
VOP_DELAYED_SETSIZE() that actually calls vnode_pager_setsize(), and use
vn_delay_setsize() helper to mark the vnode as requiring the delay call.

Reviewed by:	rmacklem
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D55595
2026-03-06 01:46:54 +02:00
Konstantin Belousov ef8292e339 Regen 2026-03-06 01:46:54 +02:00
Konstantin Belousov 619e49b2ba renameat2(2): document
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D55539
2026-03-06 01:46:53 +02:00
Konstantin Belousov 5f911eaba0 libsys/rename.2: remove commented-out CAVEAT section
FreeBSD UFS does not support hardlinks to directories.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D55539
2026-03-06 01:46:53 +02:00
Konstantin Belousov 8feb8d221c linuxolator: translate LINUX_RENAME_NOREPLACE into our AT_RENAME_NOREPLACE
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D55539
2026-03-06 01:46:53 +02:00
Konstantin Belousov 7a1217ff3b zfs: implement AT_RENAME_NOREPLACE
Reviewed by:	markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D55539
2026-03-06 01:46:53 +02:00
Konstantin Belousov 7aaec5f3fa renameat2(2): implement AT_RENAME_NOREPLACE flag
For msdosfs, tmpfs, and ufs.

Reviewed by:	markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D55539
2026-03-06 01:46:53 +02:00
Konstantin Belousov 28599a1e5f sys: add renameat2(2) syscall
Reviewed by:	markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D55539
2026-03-06 01:46:53 +02:00
Konstantin Belousov 1f3020067a kern_renameat(9): add flags argument
Reviewed by:	markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D55539
2026-03-06 01:46:53 +02:00
Konstantin Belousov e486066cf4 VOP_RENAME(9): add flags argument
Reviewed by:	markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D55539
2026-03-06 01:46:53 +02:00
Konstantin Belousov ed87040311 zfs rename: properly cleanup on errors occuring before zfs_do_rename()
Reported and tested by:	arrowd
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D55539
2026-03-06 01:46:53 +02:00
Konstantin Belousov 347cec10e2 amd64: align stack on 16 bytes when calling into a EFIRT method
Reported by:	Abdelkader Boudih
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2026-03-06 01:43:55 +02:00
Olivier Certner 35da55c28d iwx: Fix 32-bit compilation
- Avoid shifts wider than integer types, by wrapping the corresponding
  checks into '#if __SIZEOF_SIZE_T__ > 32' blocks.  'bus_addr_t'
  currently has the same width as 'size_t' on all architectures (and
  this is not going to change for 32-bit architectures).
- Use appropriate printf(3) format for 'wk_keytsc'.

Reviewed by:    adrian
MFC after:      1 minute
MFC to:         stable/15
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D55667
2026-03-05 21:40:53 +01:00
Ed Maste 9cea0f0be7 bsd.linker.mk: Retire support for binutils 2.17.50
GNU binutils 2.17.50 is the last GPLv2 version, and we retained support
in FreeBSD while it was part of the in-tree toolchain.  The last parts
of binutils 2.17.50 were removed in commit 74e8d41e0a ("Retire
BINUTILS and BINUTILS_BOOTSTRAP options") and there is no longer a need
for the build infrastructure.

We retain build-id and ifunc in LINKER_FEATURES unconditionally for now,
as they may be tested by 3rd-party Makefiles.  We can however stop
testing for them in the tree.

Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55674
2026-03-05 15:01:21 -05:00
Ed Maste a1789fa30c netinet6: Remove support for connecting to IN6ADDR_ANY
RFC4291 section 2.5.2:
    The unspecified address must not be used as the destination address
    of IPv6 packets or in IPv6 Routing headers.  An IPv6 packet with a
    source address of unspecified must never be forwarded by an IPv6
    router.

We disallowed connections to IN6ADDR_ANY by default, as of commit
627e126dbb ("netinet6: Disallow connections to IN6ADDR_ANY").  As this
is actually disallowed by the RFC, just remove the support.

Reported by:	bz (in D54306)
Reviewed by:	bz, glebius
Relnotes:	yes
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54942
2026-03-05 14:57:36 -05:00
John Baldwin 54bf594851 libc/quad: Switch to per-arch lists of symbols
This more closely mirrors libc/quad/Makefile.inc and is easier to
read.

Reviewed by:	brooks
Differential Revision:	https://reviews.freebsd.org/D55658
2026-03-05 14:07:09 -05:00
John Baldwin 27cfa8ec63 libc/quad: narrow list of symbols exposed for 32-bit arm
lld doesn't notice, but ld.bfd complains.

Reviewed by:	brooks
Differential Revision:	https://reviews.freebsd.org/D55657
2026-03-05 14:07:09 -05:00
John Baldwin cf92fa3370 bsd.linker.mk: Sort list of linker features
Reindent the features as well to be friendly to long feature names.

Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D55656
2026-03-05 14:07:09 -05:00
John Baldwin 1b77f6ec6b bsd.linker.mk: Document ifunc, ifunc-noplt, riscv-relaxations features
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D55655
2026-03-05 14:07:09 -05:00
John Baldwin d19f2af2b7 acpi: Don't attach a "wake" sysctl node to devices without the ACPI flags IVAR
Not all bus drivers for ACPI-aware devices implement the ACPI flags
IVAR used by the acpi_wake_set_sysctl handler.  In some cases this may
be a feature as some new-bus devices share the same ACPI handle (e.g.
a pcibX device and its child pciY device) which can lead to confusing
results (e.g. setting the sysctl on pciY changes the behavior of the
parent pcibX device, but the "wake" sysctl for pcibX won't reflect the
new behavior, or reflect the device's state).

Reviewed by:	obiwac, ngie, imp
Differential Revision:	https://reviews.freebsd.org/D55562
2026-03-05 14:07:09 -05:00
Gleb Smirnoff 6feb16b77e witness: report a thread that can't sleep in WITNESS_WARN
Although this is not related to locking, but seems to be the right
place to catch violators, given that WITNESS_WARN is already used
widely in the kernel.

Reviewed by:		kib, markj
Differential Revision:	https://reviews.freebsd.org/D55316
2026-03-05 10:43:17 -08:00
Pouria Mousavizadeh Tehrani 0616521adc ndp: Simplify and breakdown nd6_ra_input()
`nd6_ra_input()` is simplied to make it easier to add
additional options.

Reviewed by: glebius
Differential Revision: https://reviews.freebsd.org/D55267
2026-03-05 21:34:32 +03:30
Pouria Mousavizadeh Tehrani 7f3b46fe54 ndp: Add support for Gratuitous Neighbor Discovery (GRAND)
Implement RFC 4861 Section 7.2.6 and RFC 9131, which is also
address one of the IPv6 deployment issues in RFC 9898 Section 3.9.
GRAND should be triggered by a change in link-layer address of interface
or by configuration of a new global ipv6 address after DAD completes.

Reviewed by: glebius
Differential Revision: https://reviews.freebsd.org/D55015
2026-03-05 21:28:38 +03:30
Baptiste Daroussin 6d2a147ae5 libedit: fix use after free 2026-03-05 17:13:08 +01:00