lib/msun: use the same algorithm for sw fmaf(3) as for fma(3)
This fixes rounding at the last bit for subnormals.
PR: 298260
Reviewed by: kib
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D59579
if_bridge: count the drops on the fragmentation path
bridge_pfil() returned a fragmentation failure without counting it,
and bridge_fragment() dropped a chain on three allocation failures
without counting those either.
Count the first on the filtered interface and the others with
ips_odropped, which is what ip_fragment() uses for the same failure
and what bridge_fragment() already uses for its success case.
Reviewed by: gallatin
Differential Revision: https://reviews.freebsd.org/D59391
Assisted-by: Claude Code (Fable 5, Opus 5)
if_bridge: pull up only the headers bridge_pfil() inspects
bridge_pfil() pulled up min(m_pkthdr.len, max_protohdr) bytes. When the
mapped head is shorter than that and followed by an unmapped (M_EXTPG)
mbuf -- a sendfile(2) or KTLS segment from a member advertising
IFCAP_MEXTPG -- m_pullup() ran into it and dereferenced a NULL mtod(),
panicking the kernel.
Pull up the Ethernet header first, and the SNAP/LLC header only for an
802.3 frame. This is similar to pf and ip_output().
m_pullup() and m_copyup() asserted only the first mbuf; assert inside both
copy loops so the shape trips the check.
Fixes: c38abd64dbc1 ("if_epair: support IFCAP_MEXTPG")
Suggested by: markj
Reviewed by: markj, gallatin
Assisted-by: Claude Code (Fable 5, Opus 5)
LinuxKPI: Run irq_work callbacks under RCU protection
Linux executes irq_work callbacks from an interrupt context that
provides implicit RCU read-side protection. LinuxKPI dispatches these
callbacks through a taskqueue, so provide equivalent protection
explicitly.
This prevents an RCU grace period from completing while an irq_work
callback is still using an RCU-protected object.
Suggested by: wulf
Tested by: JustAnotherHumanBeing
Signed-off-by: JustAnotherHumanBeing <oleglelchuk at gmail.com>
Pull Request: https://github.com/freebsd/freebsd-src/pull/2385
hid: Add Sony DualSense gamepad driver
Add a driver for the Sony PS5 DualSense controller (054c:0ce6)
providing gamepad input via evdev, lightbar RGB LED control, and
player indicator LEDs through sysctl.
Signed-off-by: Christos Longros <chris.longros at gmail.com>
Reviewed by: ziaee, wulf
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D56345
kobj: allow multiple inheritance with per-class softc
Add support for hierarchical softc layout so that a leaf class and each
of its base classes owns a private softc region inside a single
allocation.
device_get_softc_class(dev, cls) returns a pointer to the softc that
belongs to the requested class. The classic device_get_softc() still
returns the leaf softc and remains fully compatible with existing
drivers.
Existing drivers are unaffected; they simply obtain a slightly larger
softc block when they inherit from base classes.
MFC after: 2 months
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D59115
amd64/pmap: Return la57 in amd nested page
AMD doesn't encode page depth in eptp. As a result, the page level is
decided by the host la57 value. Without this, it uses 4 level page and
therefore cause machine enable la57 have garbage page translation.
PR: 291768
Reviewed by: kib
Tested by: Antranig Vartanian <antranigv at freebsd.am>
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D57978
linuxkpi: Add compat_ptr_ioctl
Adding the `compat_ptr_ioctl` function for amdkfd support it's called by
kfd_chardev.c
Reviewed by: dumbbell
Differential Revision: https://reviews.freebsd.org/D58076
pw: fix at job removal when deleting a user
rmat() used stat() with a path relative to the current working
directory, so it never found the job files in /var/at/jobs and the
at(1) jobs of a deleted user were never removed.
ef7d0eb9489f also broke it by introducing a typo: /usr/sbin/atrm instead
of /usr/bin/artm.
Use fstatat() with the directory fd to stat the job files relative to
the at jobs directory, and unlinkat() them directly instead of spawning
atrm.
Those changes allow us to make it works with pw -R.
MFC After: 1 week
(cherry picked from commit 6b6aa45f9a1a35acb7fef68824c1a5eb08503909)
pw: remove mail file with unlinkat instead of building a path
This is consistent with how at jobs and crontabs are removed.
MFC After: 1 week
(cherry picked from commit 1ccf8075eaa84088ad4acb65aabb1e59c3fddd3f)
pw: remove crontab with unlinkat instead of spawning crontab
crontab -r only unlinks the crontab file, so spawn it directly with
unlinkat() relative to conf.rootfd. This also makes the crontab
removal work with pw -R.
MFC After: 1 week
(cherry picked from commit ba391775e8acb7a539c18f1231a396a7d0d763e9)
pw: use _PWDASH pseudo-fd for "-" in pw_checkfd
pw_checkfd() returned the character "-" (45) for the "-" argument,
which was ambiguous with a real file descriptor.
MFC After: 1 week
(cherry picked from commit 92e8a76b87862aa2ee7e6c3f637034e60ffbc2e6)
rc.conf.5: Improve NOAUTO configuration + tag SPDX
- Show how to start a NOAUTOed interface
- "configured" is not quite right, try to improve that
MFC after: 3 days
Event: EuroBSDcon Devsummit 2026
Reviewed by: adrian
Discussed with: Antranig Vartanian <antranigv at freebsd.am>
Differential Revision: https://reviews.freebsd.org/D59571
linux: implement prctl PR_{G,S}ET_THP_DISABLE
Since we don't have THP in FreeBSD, return that it's disabled. Linux
applications use this to get around the weird latency spikes THP in
Linux creates. Since FreeBSD superpages don't suffer from this issue,
just say it's disabled.
This removes the noisiest noise from the linux claude running on
FreeBSD.
Sponsored by: Netflix
tests: skip gracefully when the tested binary's own package isn't installed
pkgbase splits programs and their tests into separate packages (e.g.
unifdef/yacc/indent/file2c -> toolchain, jail -> jail, etc), while their
tests always land in the generic tests package. Installing just the
tests package therefore leaves these suites unable to find the binary
they exercise, and they fail confusingly instead of skipping.
Rather than force all packages to be installed for the tests package,
make the tests cope with the missing packages. Add require.progs (or,
for TAP/PLAIN-style suites with no atf_set hook: TEST_METADATA
required_programs) for the binary under test in: bectl, certctl,
ctfconvert, dhclient, file2c, indent, ipfw, jail, lastcomm, mixer,
newsyslog, nvmecontrol, pfctl, praudit, sa, syslogd, tunefs, unifdef,
yacc, ztest.
I skipped adding data for all the binaries in the base runtime
package for simplicity.
[4 lines not shown]