Commit Graph

308254 Commits

Author SHA1 Message Date
Gleb Smirnoff 0ba87ded9d inpcb: make in_pcbdisconnect() acquire the hash lock internally
Should be no functional change.

Reviewed by:		pouria, markj
Differential Revision:	https://reviews.freebsd.org/D55968
2026-04-12 11:32:06 -07:00
Gleb Smirnoff ac5b962800 inpcb: retire the inpcb global list
The iteration over all pcbs is possible without the global list. The
newborn inpcbs are put on a global list of unconnected inpcbs, then after
connect(2) or bind(2) they move to respective hash slot list.

This adds a bit of complexity to inp_next(), but the storage scheme is
actually simplified.

One potential problem before this change was that a couple of pcbs fall
into the same hash slot and are linked A->B there, but they also sit next
to each other in the global list, linked as B->A.  This can deadlock of
course.  The problem was never observed in the wild, but I was able to
instrument it with lots of effort: just few pcbs in the system, hash size
reduced down to 2 and a lot of repetitive calls into two kinds of
iterators.

However the main motivation is not the above problem, but make a step
towards splitting the big hash lock into per-slot locks.

Differential Revision:	https://reviews.freebsd.org/D55967
2026-04-12 11:31:09 -07:00
Gleb Smirnoff 2cfe62664a inpcb: retire the inpcbinfo list lock
With the SMR locking of inpcbs the use of this lock reduced down to the
global list and generation number.  It was used only on an inpcb creation
and destruction.  Use the inpcbinfo hash lock for this purpose.

Reviewed by:		pouria, rrs, markj
Differential Revision:	https://reviews.freebsd.org/D55966
2026-04-12 11:30:59 -07:00
Gleb Smirnoff 202370905f inpcb: apply smr_advance(9)/smr_wait(9) trick only to reusable sockets
The protocols marked with PR_CONNREQUIRED can never go through pr_connect
after being disconnected.  This is a tiny improvement of fdb987bebd.

While here push clearing of the addresses under the same condition.
Although this clearing originates from pre-FreeBSD times, it actually
makes sense only for protocols that can reconnect.

Reviewed by:		pouria, markj
Differential Revision:	https://reviews.freebsd.org/D55661
2026-04-12 11:30:44 -07:00
Vladimir Kondratyev 817e6995a1 wsp(4): Make evdev interface operational if sysmouse one is not opened
Before this change evdev interface sent only copy of data sent through
the sysmouse interface. It worked as /dev/wsp0 device node was
automatcaly opened by devd(8) with starting of moused(8).
Starting with 15.0 moused(8) does not open sysmouse interface by default
thus making wsp(4) device dysfunctional.
Fix it with adding extra checks of interfaces state.

MFC after:	1 week
2026-04-12 21:09:23 +03:00
Vladimir Kondratyev dc5a94962e wsp(4): Do not handle pressure on non-ForceTouch devices
They always report it value as zero breaking pressure-driven drivers
like moused(8) and xf86-input-synaptics.

MFC after:	1 week
2026-04-12 21:09:23 +03:00
Vladimir Kondratyev 9d0404cfe9 bcm5974(4): Do not handle pressure on non-ForceTouch devices
They always report it value as zero breaking pressure-driven drivers
like moused(8) and xf86-input-synaptics.

MFC after:	1 week
2026-04-12 21:09:23 +03:00
Vladimir Kondratyev d6477cd3a5 bcm5974(4): Fix pre-2015 Apple touchpad support
These devices appeared to stop sending reports via mouse USB interface
after switching to RAW mode. Fix it with changing Usage of Top Level
Collection to one found in HID report descriptor of proper interface.

MFC after:	1 week
2026-04-12 21:09:22 +03:00
Vladimir Kondratyev 2ba6ce584a hid: Change Usage Page names to match documentation
According to "HID Usage Tables FOR Universal Serial Bus (USB)"
Usage Page ID range 0x93-0xF1CF is "Reserved" and Usage Page ID range
0xFF00-0xFFFF is "Vendor-defined".

MFC after:	1 week
2026-04-12 21:09:22 +03:00
Vladimir Kondratyev 84488787f4 iwmbtfw(8): Identify device type based on HCI quieries result
rather than on VID/PID. Later is not reliable for some types.
VID/PID identification can be restored by specifying of -p option.

Tested by:	arrowd, wulf
PR:		290639
MFC after:	1 week
2026-04-12 21:09:22 +03:00
Po-Chuan Hsieh 98118af4f0 [OpenSSL] Add missing header file (openssl/ml_kem.h)
Add missing header file (openssl/ml_kem.h) of OpenSSL 3.5

Reviewed by:	fluffy, ngie
Approved by:	ngie (maintainer)
Differential Revision:	https://reviews.freebsd.org/D56291
2026-04-12 11:07:24 -07:00
Gleb Smirnoff cd5ff4e841 pf: use hashalloc(9) for key, id, src-node and udp-endpoint hashes
Reviewed by:		kp
Differential Revision:	https://reviews.freebsd.org/D56113
2026-04-12 10:26:16 -07:00
Gleb Smirnoff 87ef3067ac tcp lro: use hashalloc(9)
Reviewed by:		tuexen, rrs
Differential Revision:	https://reviews.freebsd.org/D56177
2026-04-12 10:26:12 -07:00
Gleb Smirnoff 9992eb4358 gif: use hashalloc(9)
Functional change is that on destruction INVARIANTS checks will run.  Also
the mask is no longer hardcoded, so makes it easier to make hash size a
tunable.

Reviewed by:		ae
Differential Revision:	https://reviews.freebsd.org/D56176
2026-04-12 10:26:08 -07:00
Gleb Smirnoff adba114dfb netinet: use hashalloc(9) for IP address hash
While here, slightly restyle ip_vnet_init() and use sparse initializer for
pfil_head_args.  There is no functional change wrt to pfil(9) hook
registration.

Differential Revision:	https://reviews.freebsd.org/D56175
2026-04-12 10:26:03 -07:00
Gleb Smirnoff 8e1513dc67 inpcb: use hashalloc(9)
While here remove ipi_lbgrouphashmask, as it is always has the same value
as ipi_porthashmask.

Differential Revision:	https://reviews.freebsd.org/D56174
2026-04-12 10:25:57 -07:00
Gleb Smirnoff abf68d1cf0 hash(9): introduce hashalloc()/hashfree() KPI
This is a more extendable version than traditional hashinit(9).  It allows
different kinds of slot headers with optional locks.

Implement traditional hashinit()/hashdestroy() on top of it.

Reviewed by:		pouria, gallatin
Differential Revision:	https://reviews.freebsd.org/D55904
2026-04-12 10:25:51 -07:00
Andre Albsmeier e9a69948a8 daemon(8): Add "--output-file -o" to list of options enabling supervision mode
This is the small internal doc fix from https://reviews.freebsd.org/D46313

Reviewed by:	michaelo
Approved by:	(blanket; comment fix)
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D55325
2026-04-12 18:28:24 +02:00
Yuichiro NAITO 938c076b9b ixgbe: Fix MRQC register value.
Focus on the MRQE field of the MRQC register, which is 4 bits wide,
and we use these 3 types of values.

  - IXGBE_MRQC_RSSEN 0x1  (non VF mode)
  - IXGBE_MRQC_VMDQRSS32EN 0xA (less than 33 VFs)
  - IXGBE_MRQC_VMDQRSS64EN 0xB (less than 65 VFs)

If we always take a bitwise OR with IXGBE_MRQC_RSSEN,
IXGBE_MRQC_VMDQRSS32EN will never be chosen.
Select these 3 types of values for the proper case.

Signed-off-by: Yuichiro NAITO <naito.yuichiro@gmail.com>

MFC after:	1 week
Pull Request:	https://github.com/freebsd/freebsd-src/pull/2132
2026-04-11 21:50:28 -07:00
Rick Macklem 6698596cd2 nfsv4.4: Document setup of a NFSv4 root fs
Commit 8b9775912c added support for an NFSv4 mounted
root file system.  This patch documents how to set this
up.  It also includes some minor updates and fixes
some formatting.

This is a content change.

Reviewed by:	kib
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D56317
Fixes:	8b9775912c ("nfs_diskless: Add support for an NFSv4 root fs")
2026-04-11 12:36:56 -07:00
Dag-Erling Smørgrav 9d95d80669 tunefs: Fix pointer arithmetic
While here, remove a bogus const which has been there for years.

MFC after:	1 week
Reported by:	ivy@
Fixes:		1b83e8a3f8 ("Constify string pointers.")
Fixes:		8244dd3262 ("tunefs: Better fix for arm64 alignment issues")
Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D56343
2026-04-11 21:23:08 +02:00
Michael Osipov 850eb149e7 mfiutil(4)/mrsasutil(4): "show drives" truncates information
Improve mfi_pd_inq_string() by
* Reusing buffer sizes from cam/cam.h according to SCSI specification + NULL byte
* Don't truncate vendor-specific information by escaping into a too small buffer
* Use cam_strvis() from libcam instead of old, outdated local copy
* Recaculate size of inq_string based on the reused buffer sizes and
  format statements

PR:		294354
Reviewed by:	imp
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D56328
2026-04-11 20:28:03 +02:00
Michael Osipov 4f684e929d loader.efi.8/efibootmgr.8: Don't use contradicting term 'EFI BIOS'
Both (U)EFI and BIOS are completely different things, be precise and don't use
them together.

Reviewed by:	imp
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D56329
2026-04-11 20:24:43 +02:00
Robert Clausecker 47ca491ca4 msun/math.3: reference new functions f{max,min}imum{,_num,_mag}()
See also:	D55834, D56236
MFC after:	1 month
2026-04-11 20:09:13 +02:00
Jesús Blázquez 4e30c12973 lib/msun: Added fmaximum_mag and fmaximum_num families
Added support for the f{maximum,minimum}_{mag,num} families, the new
C23 standard functions for maximum magnitude and number-preferring
maximum.  This includes modifying fmax.3, on top of D56230, to
recommend the use of fmaximum_num and fminimum_num.

Reviewed by:	fuz, kargl
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D56236
2026-04-11 20:09:13 +02:00
Bjoern A. Zeeb de2ea5423c zstd: disable weak-symbol tracing hooks in the kernel
zstd's tracing API (zstd_trace.h) declares ZSTD_trace_compress_begin()
and friends as __attribute__((weak)) externals, gated on the
ZSTD_HAVE_WEAK_SYMBOLS compile-time probe.  That probe has covered
x86_64 and i386 since at least zstd 1.5.6, and was extended to aarch64
and riscv in 1.5.7.

In a static kernel image there is no dynamic linker to patch the PLT GOT
entries at runtime.  On amd64 the undefined weak symbols resolve directly
to NULL, so the "!= NULL" guard in the zstd source correctly suppresses
every call through the stubs.  On aarch64 and riscv the ABI requires
GOT-based indirection for external calls: the PLT stub address is
non-NULL, the guard passes, and the call lands in an uninitialized GOT
slot.  Because this happens before exception handlers are in place the
machine resets silently, making the kernel unbootable after the zstd
1.5.7 import.

The upstream-supported suppression is ZSTD_NO_TRACE (zstd_internal.h),
which skips inclusion of zstd_trace.h entirely and forces ZSTD_TRACE=0.
Add it to ZSTD_C alongside the existing ZSTD_* defines, and while here
group all three -DZSTD_* flags onto a single line in alphabetical order
with ${.IMPSRC} on its own line.

Reported by:	many
Tested by:	lwhsu
X-MFC-with:	c0d9a07101
2026-04-11 09:28:00 -07:00
Shunchao Hu 5f5cc3c67a compat/linprocfs: Update /proc/partitions output
Linux /proc/partitions reports the major/minor pair, the device size in
1K blocks, and the device name.  linprocfs still printed obsolete
statistics columns and reported the size in bytes.

Update linprocfs_dopartitions() to emit the Linux-style header and
report provider sizes in 1K blocks.

Signed-off-by: Shunchao Hu <ankohuu@gmail.com>
Reviewed by:    des
MFC after:      2 weeks
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2126
Closes:         https://github.com/freebsd/freebsd-src/pull/2126
2026-04-11 22:10:05 +08:00
Adrian Chadd 4e3fdced7f qcom_gcc: migrate the MSM8916 support to qcom_gcc
* migrate the MSM8916 (snapdragon 410) support to qcom_gcc
* add the full qcom_gcc / qcom_clk list to files.arm64, replacing
  the MSM8916 stub in sys/arm64/qualcomm .

Differential Revision:	https://reviews.freebsd.org/D49706
2026-04-10 15:12:11 -07:00
Pouria Mousavizadeh Tehrani 87bea33a67 nd6: Remove DRAFT_IETF_6MAN_IPV6ONLY_FLAG and EXPERIMENTAL options
The draft-ietf-6man-ipv6only-flag has been obsoleted by RFC 8925.
Remove the EXPERIMENTAL compile option from the kernel and remove
DRAFT_IETF_6MAN_IPV6ONLY_FLAG from userland.
This compile option was not enabled by default.
Also regenerate src.conf.5.

Reviewed by: bz
Differential Revision: https://reviews.freebsd.org/D56228
2026-04-10 23:42:09 +03:30
F. Duncanh 2c6feab253 hccontrol: Support generic Bluetooth LE AdvData
hccontrol LE_Set_Advertising_Data does not currently allow construction
of manufacturer-specific type 0xFF AdvData.  Fixed by a new data-entry
option -b "b1,b2,b3,...,bn" where b's are 8-bit byte strings (octets).

Signed-off-by: F. Duncanh <fduncanh@gmail.com>
Reviewed by: takawata, pouria
Pull Request: https://github.com/freebsd/freebsd-src/pull/2082
2026-04-10 21:36:34 +03:30
Simon J. Gerraty 35bbdfad28 Pass severity to vectx_open() rather than vectx_close()
file_loadraw() can have a need to load unverified files
like "dtrace_dof".  Allow severity_guess() to look at the filename
but if it returns less than VE_MUST check that the type is not
one we insist on verifying.

In vectx_open if severity < VE_MUST we can allow it to be unverified.
If passed VE_GUESS we call severity_guess().
Regardless, we record severity in ctx so it is available to vectx_close().

Sponsored by: Hewlett Packard Enterprise Development LP

Reviewed by:	khng
Differential Revision:	https://reviews.freebsd.org/D56297
2026-04-10 10:46:54 -07:00
Christos Longros fc68534a9a rge: add Wake-on-LAN support for magic packet
Advertise IFCAP_WOL_MAGIC when PCI power management is available
and enable it by default.  On suspend or shutdown, rge_setwol()
enables the WOL_MAGIC and WOL_LANWAKE bits in CFG3/CFG5, disables
the RXDV gate, and enables PM so the NIC stays powered to watch
for magic packets.

Move hardware-specific WOL register configuration into
rge_wol_config() in if_rge_hw.c to keep hardware-specific
functions in sync with OpenBSD.

Update rge.4 to document WoL support.

Tested on FreeBSD 16.0-CURRENT bare metal with Realtek RTL8125
on a Gigabyte B650 Gaming X AX motherboard.

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

Reviewed by:	adrian
Differential Revision:	https://reviews.freebsd.org/D56259
2026-04-10 10:31:38 -07:00
Simon J. Gerraty de9fe28ab8 Allow passing xtras to safe_set
This allows safe_set to be leveraged in other contexts
where additional chars like '*' or '!' or even '\[\]' need to
be preserved in the result.
2026-04-10 09:11:21 -07:00
Alexander Ziaee ff32dbb1d1 arcmsr.4: Improve HARDWARE introductory sentence
MFC after:	3 days
2026-04-10 11:26:45 -04:00
Konstantin Belousov 31069fdbda kevent: do not check knote lists being empty before removing a knote
If a knote belongs to the list, there is no reason to check for the list
emptiness.  On the other hand, if the knote does not belong to the list,
then checking for emptiness is not enough since there might be a
different knote there.

Reviewed bu:	kevans, markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D56341
2026-04-10 17:34:48 +03:00
ShengYi Hung 2358492b03 x86: Add zen identifier helper function
Reviewed by:    kib
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56330
2026-04-10 21:51:31 +08:00
Mariusz Zaborski 9f1be4bfeb cap_dns: plug a memory leak 2026-04-10 12:20:27 +02:00
Konstantin Belousov 4da93b9a8a subr_early.c: cleanup includes
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2026-04-10 13:16:28 +03:00
Warner Losh 82ff1c334b nvme: Allow larger user request sizes
We have a small buffer for pages on the stack, but if the user wants to
do an I/O larger than this we currently fail w/o a way for the user to
know the max size. It's not hard to allocate an array for the uncommon
case of very large I/Os, and the performance advantage of the array is
small in that case anyway. In addition, this allows firmware upgrades
using the full transfer size of the device as a happy accident too.

Sponsored by:		Netflix
Reviewed by:		chs, chuck
Differential Revision:	https://reviews.freebsd.org/D55638
2026-04-09 17:37:21 -06:00
Warner Losh 428034ad0d sys/kobj.h: Make self-sufficient
kobj.h just needs sys/types.h (because it uses u_int, it can't use
sys/_types.h). kobj.h isn't a standard thing, so we don't need to be
careful about namespace pollution.

Sponsored by:		Netflix
2026-04-09 17:37:21 -06:00
Bhosale, Yogesh 6b58d10fc6 ix(4): Add support for firmware logging for E610 adapters
This is part 3 of the support for the new Intel Ethernet E610
family of devices

The ix driver now enables firmware logging on Intel E610 devices
for debugging with Customer Support. Logs are enabled by default
and generated in binary format that requires decoding by support
teams. The collected data is firmware and hardware related for
debugging purposes only.

When the driver loads, it creates a fw_log sysctl node under the
debug section. Events are organized into categories (modules) for
targeted logging, and users can adjust verbosity levels as needed.

This adds sysctl support for the firmware logging feature and
updates the ix(4) manual page with documentation.

Signed-off-by: Yogesh Bhosale <yogesh.bhosale@intel.com>
Co-developed-by: Krzysztof Galazka <krzysztof.galazka@intel.com>

Reviewed by:	ziaee, kbowling
Tested by:      Mateusz Moga <mateusz.moga@intel.com>
MFC after:      1 weeks
Sponsored by:   Intel Corporation
Differential Revision:	https://reviews.freebsd.org/D53973
2026-04-09 20:43:43 +02:00
Baptiste Daroussin 72d701eb1d nlsysevent: add manpage
Reviewed by:	des
2026-04-09 19:39:28 +02:00
Weixie Cui c6224994ac freebsd32: Fix freebsd11_nstat copyout condition
freebsd11_freebsd32_nstat() invoked copyout(2) when
freebsd11_cvtnstat32() failed and skipped copyout on success. This is
backwards.

Fix this to match freebsd11_freebsd32_nlstat() and freebsd11_nstat(),
and only copy the nstat32 result to userspace when conversion succeeds.

Signed-off-by:	Weixie Cui <cuiweixie@gmail.com>
Reviewed by:	mhorne
MFC after:	1 week
Pull Request:	https://github.com/freebsd/freebsd-src/pull/2109
2026-04-09 13:46:23 -03:00
Ali Mashtizadeh f86ba3eec5 hwpmc: prevent IBS fetch from getting stuck
Both fetch and op IBS sampling have the same problem where we need to
rewrite the control MSR to ensure sampling continues at the correct
rate.  I also like this because it resets the counter reducing the
chances that we collect a sample inside the NMI handler.

Reported by:	Aalok Agarwal
Reviewed by:	mhorne
Sponsored by:	Netflix
Fixes:	e51ef8ae49 ("hwpmc: Initial support for AMD IBS")
Pull Request:	https://github.com/freebsd/freebsd-src/pull/2130
2026-04-09 13:35:26 -03:00
Ali Mashtizadeh 7a1aaca06c hwpmc: Fix bug when stopping ibs-op
In ibs_stop_pmc I accidently cleared the fetch max count value rather
than the op max count value, when stopping the op counter.  This
mitigates a bug in early pre-zen processors, but breaks using both
counters simultaneously.  I also found that the max op count mask needs
to be extended for recent zen processors.

Reported by:	Andre Fernando da Silva
Reviewed by:	mhorne
Sponsored by:	Netflix
Fixes:	e51ef8ae49 ("hwpmc: Initial support for AMD IBS")
Pull Request:	https://github.com/freebsd/freebsd-src/pull/2120
2026-04-09 13:35:26 -03:00
Navdeep Parhar 2f3dcbb5ef hwpmc: Fix compile warning
.../sys/dev/hwpmc/hwpmc_mod.c:4640:1: warning: unused function 'pmc_is_multipart' [-Wunused-function]
 4640 | pmc_is_multipart(struct pmc_sample *ps)
      | ^~~~~~~~~~~~~~~~
1 warning generated.

Reviewed by:	mhorne
Fixes:		e51ef8ae49 - main - hwpmc: Initial support for AMD IBS
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D56296
2026-04-09 09:22:50 -07:00
Alice Cariboni f916091241 tuning.7: Fix suds typo in manual pages
MFC after:		3 days
Fixes:			fc32c80215 Add two new manual pages
Differential Revision:	https://reviews.freebsd.org/D55814
2026-04-09 17:57:32 +02:00
Li-Wen Hsu 8672683ec8 test/sys/arch: Fix arch without test/sys/arch/${MACHINE_ARCH}
Fixes:		0ddaa4c86d ("arm64: Add arm64 SVE tests")
Sponsored by:	The FreeBSD Foundation
2026-04-09 23:49:56 +08:00
Lexi Winter 0dd9c4abf0 tools/build/Makefile: Always add md4.h to SYSINCS
Since libmd was added to the bootstrap, building main on stable/14
fails because of an incompatibility in its old md4.h.  Fix this by
always including md4.h in the bootstrap headers, instead of only
doing so when building on a non-FreeBSD host.

Fixes:		50de0bf505 ("flua: Always build as a bootstrap tool")
Reported by:	olce
Reviewed by:	olce, kevans
Sponsored by:	https://www.patreon.com/bsdivy
Differential Revision:	https://reviews.freebsd.org/D56327
2026-04-09 15:30:20 +01:00
Sarah Walker f54209510b virtio_blk: Fix initialisation of dump request structure
Commit c8c37141 ("virtio_blk: Use bus_dma for command/ack buffer
allocations") failed to update initialisation of the dedicated dump
request structure. This caused a panic on attempting to dump core to a
virtio_blk device.

Reviewed by:	asomers
Sponsored by:	Arm Ltd
Pull Request:	https://reviews.freebsd.org/D56156
2026-04-09 15:13:31 +01:00